blockly > serialization > blocks > State
serialization.blocks.State interface
Represents the state of a given block.
Signature:
export interface State
Properties
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-09-18 UTC.
[null,null,["Last updated 2024-09-18 UTC."],[[["The `serialization.blocks.State` interface represents the complete state of a Blockly block, including properties like position, connections, and internal data."],["It defines properties to describe a block's visual and functional attributes such as its type, ID, position (x, y), collapsed state, editability, and more."],["Block connections are represented by `ConnectionState` for inputs and next connections."],["All properties within the `State` interface are optional, allowing flexibility in representing different aspects of a block's state as needed."],["Developers can use this interface to serialize and deserialize block states, enabling them to save and restore workspaces or individual blocks."]]],["The `serialization.blocks.State` interface defines the state of a block, encompassing various optional properties. These include: `collapsed`, `data`, `deletable`, `disabledReasons`, `editable`, `enabled`, and `extraState`. Additional properties cover `fields`, `icons`, `id`, `inline`, `inputs`, `movable`, `next`, `x`, and `y`, each with specific data types. The `type` property is a mandatory string, representing the block's type. The interface allows a comprehensive representation of a block's status and configuration.\n"]]