Skip to main content

Extensions

Functions

FunctionDescription
registerRegisters a new extension function. Extensions are functions that help initialize blocks, usually adding dynamic behavior such as onchange handlers and mutators. These are applied using Block.applyExtension(), or the JSON "extensions" array attribute.
registerMixinRegisters a new extension function that adds all key/value of mixinObj.
registerMutatorRegisters a new extension function that adds a mutator to the block. At register time this performs some basic sanity checks on the mutator. The wrapper may also add a mutator dialog to the block, if both compose and decompose are defined on the mixin.
unregisterUnregisters the extension registered with the given name.
isRegisteredReturns whether an extension is registered with the given name.
applyApplies an extension method to a block. This should only be called during block construction.
buildTooltipForDropdownBuilds an extension function that will map a dropdown value to a tooltip string.
buildTooltipWithFieldTextBuilds an extension function that will install a dynamic tooltip. The tooltip message should include the string '%1' and that string will be replaced with the text of the named field.

Variables

VariableDescription
TEST_ONLY-