Global

Methods

callGlobalFunction(name, …args) → {any}

Source:

Call a registered global function.

Parameters:
Name Type Attributes Description
name string

Function name.

args any <repeatable>

Arguments.

Returns:
  • Result
Type
any

migrateChangeBlock(targets, srcBlockId, dstBlockId)

Source:

Change a block to another.

Parameters:
Name Type Description
targets any

Scratch project JSON.

srcBlockId string

Source block ID.

dstBlockId string

Destination block ID.

registerGlobalFunction(name, func)

Source:

Register a global function.

Parameters:
Name Type Description
name string

Function name.

func function

Function instance.

unregisterGlobalFunction(name)

Source:

Unregister a global function.

Parameters:
Name Type Description
name string

Function name.

Type Definitions

ExtensionInfo

Source:
Properties:
Name Type Attributes Description
id string

ID.

version string

Version.

author string | Array.<string>

Author(s).

icon string

Icon.

inset_icon string

Inset icon.

default_language string <optional>

[unsupported] Default language.

Extension info, defined in info.json.

Type:
  • object