@blockly/block-shareable-procedures
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
| Class | Description |
|---|---|
| ObservableParameterModel | Represents a procedure parameter. |
| ObservableProcedureModel | Represents a procedure signature. |
| ProcedureBase | The base event for an event associated with a procedure. |
| ProcedureChangeReturn | Notifies listeners that a procedure's return type/status has changed. |
| ProcedureCreate | Notifies listeners that a procedure data model has been created. |
| ProcedureDelete | Notifies listeners that a procedure data model has been deleted. |
| ProcedureParameterBase | The base event for an event associated with a procedure parameter. |
| ProcedureParameterCreate | Notifies listeners that a parameter has been added to a procedure model. |
| ProcedureParameterDelete | Notifies listeners that a parameter has been removed from a procedure. |
| ProcedureParameterRename | Notifies listeners that a procedure parameter was renamed. |
| ProcedureRename | Notifies listeners that a procedure model has been renamed. |
Interfaces
| Interface | Description |
|---|---|
| IProcedureBlock | The interface for a block which models a procedure. |
| ProcedureBaseJson | - |
| ProcedureChangeReturnJson | - |
| ProcedureCreateJson | - |
| ProcedureParameterBaseJson | - |
| ProcedureParameterCreateJson | - |
| ProcedureParameterDeleteJson | - |
| ProcedureParameterRenameJson | - |
| ProcedureRenameJson | - |
Type Aliases
| Type Alias | Description |
|---|---|
| ProcedureDeleteJson | - |
Variables
| Variable | Description |
|---|---|
| blocks | A dictionary of the block definitions provided by this module. |
Functions
| Function | Description |
|---|---|
| isProcedureBlock | A type guard which checks if the given block is a procedure block. |
| registerProcedureSerializer | Unregisters any existing procedure serializer, and registers a new one parameterized with the shareable procedure backing data models. |
| unregisterProcedureBlocks | Unregisters all of the procedure blocks. |