Stay organized with collections Save and categorize content based on your preferences.

blockly > serialization > blocks > save

serialization.blocks.save() function

Returns the state of the given block as a plain JavaScript object.

Signature:

export declare function save(block: Block, { addCoordinates, addInputBlocks, addNextBlocks, doFullSerialization, }?: {
    addCoordinates?: boolean;
    addInputBlocks?: boolean;
    addNextBlocks?: boolean;
    doFullSerialization?: boolean;
}): State | null;

Parameters

Parameter Type Description
block Block The block to serialize.
{ addCoordinates, addInputBlocks, addNextBlocks, doFullSerialization, } { addCoordinates?: boolean; addInputBlocks?: boolean; addNextBlocks?: boolean; doFullSerialization?: boolean; } (Optional)

Returns:

State | null

The serialized state of the block, or null if the block could not be serialied (eg it was an insertion marker).