See the 2022 Blockly Developer Summit site here.

Class: VariableSerializer

Constructor

VariableSerializer

new VariableSerializer()

Implements
Blockly.serialization.ISerializer

Property

priority

number

The priority for deserializing variables.

Methods

clear

clear(workspace)

Disposes of any variables that exist on the workspace.

Parameter

workspace

Blockly.Workspace

The workspace to clear the variables of.

Value must not be null.

load

load(state, workspace)

Deserializes the variable defined by the given state into the given workspace.

Parameter

state

Array of non-null State

The state of the variables to deserialize.

Value must not be null.

workspace

Blockly.Workspace

The workspace to deserialize into.

Value must not be null.

save

save(workspace) returns Array of non-null State

Serializes the variables of the given workspace.

Parameter

workspace

Blockly.Workspace

The workspace to save the variables of.

Value must not be null.

Returns

nullable Array of non-null State The state of the workspace's variables, or null if there are no variables.