Skip to main content

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

Parameter

Type

Description

workspace

Workspace

The 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.