Interface: ISerializer
Defined in: packages/blockly/core/interfaces/i_serializer.ts:14
Serializes and deserializes a plugin or system.
Properties index
| Property | Description |
|---|---|
| priority | A priority value used to determine the order of deserializing state. More positive priorities are deserialized before less positive priorities. Eg if you have priorities (0, -10, 10, 100) the order of deserialiation will be (100, 10, 0, -10). If two serializers have the same priority, they are deserialized in an arbitrary order relative to each other. |
Methods index
| Method | Description |
|---|---|
| save | Saves the state of the plugin or system. |
| load | Loads the state of the plugin or system. |
| clear | Clears the state of the plugin or system. |
Properties
priority
priority: number;
Defined in: packages/blockly/core/interfaces/i_serializer.ts:23
A priority value used to determine the order of deserializing state. More positive priorities are deserialized before less positive priorities. Eg if you have priorities (0, -10, 10, 100) the order of deserialiation will be (100, 10, 0, -10). If two serializers have the same priority, they are deserialized in an arbitrary order relative to each other.
Methods
save()
save(workspace): object | null;
Defined in: packages/blockly/core/interfaces/i_serializer.ts:32
Saves the state of the plugin or system.
Parameters
| Parameter | Type | Description |
|---|---|---|
workspace | Workspace | The workspace the system to serialize is associated with. |
Returns
object | null
A JS object containing the system's state, or null if there is no state to record.
load()
load(state, workspace): void;
Defined in: packages/blockly/core/interfaces/i_serializer.ts:42
Loads the state of the plugin or system.
Parameters
| Parameter | Type | Description |
|---|---|---|
state | object | The state of the system to deserialize. This will always be non-null. |
workspace | Workspace | The workspace the system to deserialize is associated with. |
Returns
void
clear()
clear(workspace): void;
Defined in: packages/blockly/core/interfaces/i_serializer.ts:50
Clears the state of the plugin or system.
Parameters
| Parameter | Type | Description |
|---|---|---|
workspace | Workspace | The workspace the system to clear the state of is associated with. |
Returns
void