See the 2022 Blockly Developer Summit site here.

Namespace: workspaces

Methods

load

static

load(state, workspace, param1)

Loads the variable represented by the given state into the given workspace.

Parameter

state

Object with any type properties

The state of the workspace to deserialize into the workspace.

Value must not be null.

workspace

Blockly.Workspace

The workspace to add the new state to.

Value must not be null.

param1

Optional

{recordUndo: (boolean or undefined)}

recordUndo: If true, events triggered by this function will be undo-able by the user. False by default.

save

static

save(workspace) returns Object with any type properties

Returns the state of the workspace as a plain JavaScript object.

Parameter

workspace

Blockly.Workspace

The workspace to serialize.

Value must not be null.

Returns

non-null Object with any type properties The serialized state of the workspace.