diff --git a/core/block.js b/core/block.js index ae0295d96..ae1e32363 100644 --- a/core/block.js +++ b/core/block.js @@ -279,6 +279,27 @@ Blockly.Block.prototype.colourTertiary_ = null; */ Blockly.Block.prototype.styleName_ = null; +/** + * An optional serialization method for defining how to serialize the + * mutation state. This must be coupled with defining `domToMutation`. + * @type {?function(...):!Element} + */ +Blockly.Block.prototype.mutationToDom; + +/** + * An optional deserialization method for defining how to deserialize the + * mutation state. This must be coupled with defining `mutationToDom`. + * @type {?function(!Element)} + */ +Blockly.Block.prototype.domToMutation; + +/** + * An optional property for suppressing adding STATEMENT_PREFIX and + * STATEMENT_SUFFIX to generated code. + * @type {?boolean} + */ +Blockly.Block.prototype.suppressPrefixSuffix; + /** * Dispose of this block. * @param {boolean} healStack If true, then try to heal any gap by connecting diff --git a/core/block_svg.js b/core/block_svg.js index 748ddd6ce..ebeb2f852 100644 --- a/core/block_svg.js +++ b/core/block_svg.js @@ -208,6 +208,26 @@ Blockly.BlockSvg.TAB_WIDTH = 8; */ Blockly.BlockSvg.START_HAT = false; +/** + * An optional method called when a mutator dialog is first opened. + * This function must create and initialize a top-level block for the mutator + * dialog, and return it. This function should also populate this top-level + * block with any sub-blocks which are appropriate. This method must also be + * coupled with defining a `compose` method for the default mutation dialog + * button and UI to appear. + * @type {?function(Blockly.WorkspaceSvg):!Blockly.BlockSvg} + */ +Blockly.BlockSvg.prototype.decompose; + +/** + * An optional method called when a mutator dialog saves its content. + * This function is called to modify the original block according to new + * settings. This method must also be coupled with defining a `decompose` + * method for the default mutation dialog button and UI to appear. + * @type {?function(!Blockly.BlockSvg)} + */ +Blockly.BlockSvg.prototype.compose; + /** * Create and initialize the SVG representation of the block. * May be called more than once.