Skip to main content

Interface: JsonBlockDefinition

Defined in: packages/blockly/core/interfaces/i_json_block_definition.ts:34

Defines the JSON structure for a block definition.

Example​

const blockDef: JsonBlockDefinition = {
type: 'custom_block',
message0: 'move %1 steps',
args0: [
{
'type': 'field_number',
'name': 'INPUT',
},
],
previousStatement: null,
nextStatement: null,
};

Indexable​

[key: `message${number}`]: string | undefined
[key: `args${number}`]: JsonBlockArg[] | undefined
[key: `implicitAlign${number}`]: string | undefined

Properties index​

PropertyDescription
type-
style-
colour-
output-
previousStatement-
nextStatement-
outputShape-
inputsInline-
tooltip-
helpUrl-
ariaRoleDescription-
extensions-
mutator-
enableContextMenu-
suppressPrefixSuffix-

Properties​

type​

type: string;

Defined in: packages/blockly/core/interfaces/i_json_block_definition.ts:35


style?​

optional style?: string | null;

Defined in: packages/blockly/core/interfaces/i_json_block_definition.ts:36


colour?​

optional colour?: string | number;

Defined in: packages/blockly/core/interfaces/i_json_block_definition.ts:37


output?​

optional output?: string | string[] | null;

Defined in: packages/blockly/core/interfaces/i_json_block_definition.ts:38


previousStatement?​

optional previousStatement?: string | string[] | null;

Defined in: packages/blockly/core/interfaces/i_json_block_definition.ts:39


nextStatement?​

optional nextStatement?: string | string[] | null;

Defined in: packages/blockly/core/interfaces/i_json_block_definition.ts:40


outputShape?​

optional outputShape?: number;

Defined in: packages/blockly/core/interfaces/i_json_block_definition.ts:41


inputsInline?​

optional inputsInline?: boolean;

Defined in: packages/blockly/core/interfaces/i_json_block_definition.ts:42


tooltip?​

optional tooltip?: string;

Defined in: packages/blockly/core/interfaces/i_json_block_definition.ts:43


helpUrl?​

optional helpUrl?: string;

Defined in: packages/blockly/core/interfaces/i_json_block_definition.ts:44


ariaRoleDescription?​

optional ariaRoleDescription?: string;

Defined in: packages/blockly/core/interfaces/i_json_block_definition.ts:45


extensions?​

optional extensions?: string[];

Defined in: packages/blockly/core/interfaces/i_json_block_definition.ts:46


mutator?​

optional mutator?: string;

Defined in: packages/blockly/core/interfaces/i_json_block_definition.ts:47


enableContextMenu?​

optional enableContextMenu?: boolean;

Defined in: packages/blockly/core/interfaces/i_json_block_definition.ts:48


suppressPrefixSuffix?​

optional suppressPrefixSuffix?: boolean;

Defined in: packages/blockly/core/interfaces/i_json_block_definition.ts:49