Skip to main content

Home > blockly > serialization > blocks > BlockSerializer > save

serialization.blocks.BlockSerializer.save() method

Serializes the blocks of the given workspace.

Signature:

save(workspace: Workspace): {
languageVersion: number;
blocks: State[];
} | null;

Parameters

ParameterTypeDescription
workspaceWorkspaceThe workspace to save the blocks of.

Returns:

{ languageVersion: number; blocks: State[]; } | null

The state of the workspace's blocks, or null if there are no blocks.