Skip to main content

@blockly/block-shareable-procedures

Built with Blockly​

A set of Blockly blocks that allow end-users to define procedures (i.e. functions). These blocks reference explicit backing data models, which allows them to be more easily manipulated, and shared between workspaces.

Note that these blocks have the same names as the built-in procedure blocks, so you can seamlessly upgrade your existing project to use the new blocks.

Installation​

Yarn​

yarn add @blockly/block-shareable-procedures

npm​

npm install @blockly/block-shareable-procedures

Usage​

See docs.blockly.com/guides/create-custom-blocks/procedures/using-procedures for more information about using this plugin.

License​

Apache 2.0

A plugin that adds procedure blocks which are backed by explicit data models.

Classes​

ClassDescription
ObservableParameterModelRepresents a procedure parameter.
ObservableProcedureModelRepresents a procedure signature.
ProcedureBaseThe base event for an event associated with a procedure.
ProcedureChangeReturnNotifies listeners that a procedure's return type/status has changed.
ProcedureCreateNotifies listeners that a procedure data model has been created.
ProcedureDeleteNotifies listeners that a procedure data model has been deleted.
ProcedureParameterBaseThe base event for an event associated with a procedure parameter.
ProcedureParameterCreateNotifies listeners that a parameter has been added to a procedure model.
ProcedureParameterDeleteNotifies listeners that a parameter has been removed from a procedure.
ProcedureParameterRenameNotifies listeners that a procedure parameter was renamed.
ProcedureRenameNotifies listeners that a procedure model has been renamed.

Interfaces​

InterfaceDescription
IProcedureBlockThe interface for a block which models a procedure.
ProcedureBaseJson-
ProcedureChangeReturnJson-
ProcedureCreateJson-
ProcedureParameterBaseJson-
ProcedureParameterCreateJson-
ProcedureParameterDeleteJson-
ProcedureParameterRenameJson-
ProcedureRenameJson-

Type Aliases​

Type AliasDescription
ProcedureDeleteJson-

Variables​

VariableDescription
blocksA dictionary of the block definitions provided by this module.

Functions​

FunctionDescription
isProcedureBlockA type guard which checks if the given block is a procedure block.
registerProcedureSerializerUnregisters any existing procedure serializer, and registers a new one parameterized with the shareable procedure backing data models.
unregisterProcedureBlocksUnregisters all of the procedure blocks.