Options
All
  • Public
  • Public/Protected
  • All
Menu

blockly-plugin-type-blockjson

license

Copyright 2021 yukiya383 SPDX-License-Identifier: Apache-2.0

Index

Type aliases

ArgField: ArgFieldCheckbox | ArgFieldDropdown | ArgFieldNumber | ArgFieldInput | ArgFieldVariable | (ArgFieldCommon & { type: "field_colour" | "field_angle" | "field_date" | "field_label" | "field_image" })

Type for any field added to args property. Fields below does not have proper type yet:

  • "field_angle"
  • "field_colour"
  • "field_date"
  • "field_image"
  • "field_label"
ArgFieldCheckbox: ArgFieldCommon & { checked?: boolean; type: "field_checkbox" }

Type for checkbox field added to args property.

ArgFieldDropdown: ArgFieldCommon & { options: [string, string][]; type: "field_dropdown" }

Type for dropdown field added to args property.

ArgFieldInput: ArgFieldCommon & { text: string; type: "field_input" }

Type for text input field added to args property.

ArgFieldNumber: ArgFieldCommon & { max?: number; min?: number; precision?: number; type: "field_number"; value?: number }

Type for number field added to args property.

ArgFieldVariable: ArgFieldCommon & { defaultType: string; name: string; type: "field_variable"; variable: string; variableTypes: Types }

Type for variable field added to args property.

ArgInput: { check?: string | readonly string[]; name: string; type: "input_value" | "input_statement" | "input_dummy" }

Type for any input added to args property.

Type declaration

  • Optional check?: string | readonly string[]
  • name: string
  • type: "input_value" | "input_statement" | "input_dummy"
ArgInputDummy: ArgInput & { type: "input_dummy" }

Type for dummy input added to args property.

ArgInputField: ArgInput & { type: "input_value" }

Type for value input added to args property.

ArgInputStatement: ArgInput & { type: "input_statement" }

Type for statement input added to args property.

ArgType: ArgField | ArgInput

Type for any argument added to args property.

The type of code generator function for any new block.

The type of JSON object to define a new block. You cannot add both output and previousStatement.

BlockJsonStatement: { nextStatement?: Types; previousStatement?: Types } & BlockJsonBase

The type of JSON object to define a new block without output.

BlockJsonValue: { output: Types } & BlockJsonBase

The type of JSON object to define a new block with output.

BlockWithOutputCodeGen: (block: Blockly.Block) => [string, number]

Type declaration

    • (block: Blockly.Block): [string, number]
    • The type of code generator function for a new block with output.

      Parameters

      • block: Blockly.Block

      Returns [string, number]

BlockWithoutOutputCodeGen: (block: Blockly.Block) => string

Type declaration

    • (block: Blockly.Block): string
    • The type of code generator function for a new block without output.

      Parameters

      • block: Blockly.Block

      Returns string

MutatorMixinObject: { compose?: any; decompose?: any; domToMutation: any; mutationToDom: any; saveConnections?: any }

Type for mixin object for mutators.

Type declaration

  • compose?:function
    • compose(topBlock: Block): void
    • Parameters

      • topBlock: Block

      Returns void

  • decompose?:function
    • decompose(workspace: WorkspaceSvg): Block
    • Parameters

      • workspace: WorkspaceSvg

      Returns Block

  • domToMutation:function
    • domToMutation(xmlElement: Element): void
    • Parameters

      • xmlElement: Element

      Returns void

  • mutationToDom:function
    • mutationToDom(): Element
  • saveConnections?:function
    • saveConnections(containerBlock: Block): void
    • Parameters

      • containerBlock: Block

      Returns void

Types: string | readonly string[] | null

The type representing the value used for typechecking in Blockly.