blockly > ContextMenu > callbackFactory
Funktion ContextMenu.callbackFactory()
Erstellen Sie eine Callback-Funktion, mit der ein Block erstellt und konfiguriert wird. Anschließend wird der neue Block neben dem Original platziert und zurückgegeben.
Unterschrift:
export declare function callbackFactory(block: Block, state: Element | serializationBlocks.State): () => BlockSvg;
Parameter
Parameter | Typ | Beschreibung |
---|---|---|
Blocken | Blockieren | Ursprünglicher Block. |
state | Element | serializationBlocks.State | XML- oder JSON-Objektdarstellung des neuen Blocks. |
Gibt zurück:
() => BlockSvg
Funktion, die einen Block erstellt.