Files
blockly/core/interfaces/i_serializer.ts
Aaron Dodson f70f82327b refactor: Remove some uses of AnyDuringMigration (#6307)
* refactor: Remove uses of AnyDuringMigration from trashcan.ts.

* refactor: Remove uses of AnyDuringMigration in bubble.ts.

* refactor: Remove uses of AnyDuringMigration from connection_checker.ts.

* refactor: Remove uses of AnyDuringMigration from connection_db.ts.

* refactor: Remove uses of AnyDuringMigration in contextmenu_items.ts.

* refactor: Remove uses of AnyDuringMigration from grid.ts.

* refactor: Remove uses of AnyDuringMigration from i_drag_target.ts.

* refactor: Remove uses of AnyDuringMigration from i_ast_node_location_svg.ts.

* refactor: Remove uses of AnyDuringMigration from i_ast_node_location_with_block.ts.

* refactor: Remove uses of AnyDuringMigration from i_autohideable.ts.

* refactor: Remove uses of AnyDuringMigration from i_block_dragger.ts.

* refactor: Remove uses of AnyDuringMigration from i_bounded_element.ts.

* refactor: Remove uses of AnyDuringMigration from i_bubble.ts.

* refactor: Remove uses of AnyDuringMigration from i_collapsible_toolbox_item.ts.

* refactor: Remove uses of AnyDuringMigration from i_connection_checker.ts.

* refactor: Remove uses of AnyDuringMigration from i_contextmenu.ts.

* refactor: Remove uses of AnyDuringMigration in i_copyable.ts.

* refactor: Remove uses of AnyDuringMigration from i_deleteable.ts.

* refactor: Remove uses of AnyDuringMigration from i_delete_area.ts.

* refactor: Remove uses of AnyDuringMigration in i_flyout.ts.

* refactor: Remove uses of AnyDuringMigration in i_keyboard_accessible.ts.

* refactor: Remove uses of AnyDuringMigration in i_metrics_manager.ts.

* refactor: Remove uses of AnyDuringMigration from i_movable.ts.

* refactor: Remove uses of AnyDuringMigration in i_positionable.ts.

* refactor: Remove uses of AnyDuringMigration in i_selectable_toolbox_item.ts.

* refactor: Remove uses of AnyDuringMigration from i_selectable.ts.

* refactor: Remove uses of AnyDuringMigration in i_serializer.ts.

* refactor: Remove uses of AnyDuringMigration from i_styleable.ts.

* refactor: Remove uses of AnyDuringMigration in i_toolbox.ts.

* refactor: Make non-null checks explicit.
2022-08-04 10:09:24 -07:00

66 lines
1.9 KiB
TypeScript

/**
* @license
* Copyright 2021 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
/**
* @fileoverview The record type for an object containing functions for
* serializing part of the workspace.
*/
/**
* The record type for an object containing functions for
* serializing part of the workspace.
* @namespace Blockly.serialization.ISerializer
*/
import * as goog from '../../closure/goog/goog.js';
goog.declareModuleId('Blockly.serialization.ISerializer');
import type {Workspace} from '../workspace.js';
/**
* Serializes and deserializes a plugin or system.
* @alias Blockly.serialization.ISerializer.ISerializer
*/
export interface ISerializer {
/**
* 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.
*/
priority: number;
/* eslint-disable no-unused-vars, valid-jsdoc */
/**
* Saves the state of the plugin or system.
* @param workspace The workspace the system to serialize is associated with.
* @return A JS object containing the system's state, or null if there is no
* state to record.
*/
save(workspace: Workspace): Object|null;
/* eslint-enable valid-jsdoc */
/**
* Loads the state of the plugin or system.
* @param state The state of the system to deserialize. This will always be
* non-null.
* @param workspace The workspace the system to deserialize is associated
* with.
*/
load(state: Object, workspace: Workspace): void;
/**
* Clears the state of the plugin or system.
* @param workspace The workspace the system to clear the state of is
* associated with.
*/
clear(workspace: Workspace): void;
}
/* eslint-enable no-unused-vars */