Interface ToolboxBlockDefinition

interface ToolboxBlockDefinition {
    advanced?: boolean;
    blockId?: string;
    blockXml?: string;
    group?: string;
    jsDoc?: string;
    name: string;
    pySnippet?: string;
    pySnippetName?: string;
    retType?: string;
    snippet?: string;
    snippetName?: string;
    snippetOnly?: boolean;
    weight?: number;
}

Properties

advanced?: boolean

Indicates an advanced API. Advanced APIs appear after basic ones in the toolbox

blockId?: string

The Blockly block id used to identify this block.

blockXml?: string

The block definition in XML for the blockly toolbox.

group?: string

Group label used to categorize block. Blocks are arranged with other blocks that share the same group.

jsDoc?: string

Description of code to appear in the hover text

name: string

Internal id used to refer to this block or snippet, must be unique

pySnippet?: string

Python snippet of code to insert when dragged into editor

pySnippetName?: string

Python name used for highlighting the snippet, uses name if not defined

retType?: string

The return type of the block. This is used to determine the shape of the block rendered.

snippet?: string

TypeScript snippet of code to insert when dragged into editor

snippetName?: string

TypeScript name used for highlighting the snippet, uses name if not defined

snippetOnly?: boolean

Display just the snippet and nothing else. Should be set to true for language constructs (eg. for-loops) and to false for function calls (eg. Math.random())

weight?: number

The weight for the block. Blocks are arranged in order of they appear in the category definition's array but the weight can be specified in the case that other APIs are dynamically added to the category (eg. loops.forever())