/** @packageDocumentation * @module Core */ import { NodeKey, NodeKeyJSON } from "./hierarchy/Key"; import { Node, NodeJSON, PartialNode, PartialNodeJSON } from "./hierarchy/Node"; /** @alpha */ export declare const UPDATE_FULL = "FULL"; /** @alpha */ export interface UpdateInfoJSON { [imodel: string]: { [rulesetId: string]: { hierarchy?: HierarchyUpdateInfoJSON; content?: ContentUpdateInfo; }; }; } /** @alpha */ export interface UpdateInfo { [imodel: string]: { [rulesetId: string]: { hierarchy?: HierarchyUpdateInfo; content?: ContentUpdateInfo; }; }; } /** @alpha */ export declare namespace UpdateInfo { /** Serialize given object to JSON. */ function toJSON(obj: UpdateInfo): UpdateInfoJSON; /** Deserialize given object from JSON */ function fromJSON(json: UpdateInfoJSON): UpdateInfo; } /** @alpha */ export interface ExpandedNodeUpdateRecordJSON { node: NodeJSON; position: number; } /** @alpha */ export interface HierarchyUpdateRecordJSON { parent?: NodeKeyJSON; nodesCount: number; expandedNodes?: ExpandedNodeUpdateRecordJSON[]; } /** @alpha */ export interface ExpandedNodeUpdateRecord { node: Node; position: number; } /** @alpha */ export interface HierarchyUpdateRecord { parent?: NodeKey; nodesCount: number; expandedNodes?: ExpandedNodeUpdateRecord[]; } /** @alpha */ export declare namespace ExpandedNodeUpdateRecord { /** Serialize given object to JSON. */ function toJSON(obj: ExpandedNodeUpdateRecord): ExpandedNodeUpdateRecordJSON; /** Deserialize given object from JSON */ function fromJSON(json: ExpandedNodeUpdateRecordJSON): ExpandedNodeUpdateRecord; } /** @alpha */ export declare namespace HierarchyUpdateRecord { /** Serialize given object to JSON. */ function toJSON(obj: HierarchyUpdateRecord): HierarchyUpdateRecordJSON; /** Deserialize given object from JSON */ function fromJSON(json: HierarchyUpdateRecordJSON): HierarchyUpdateRecord; } /** @alpha */ export declare type HierarchyUpdateInfoJSON = typeof UPDATE_FULL | HierarchyUpdateRecordJSON[]; /** @alpha */ export declare type HierarchyUpdateInfo = typeof UPDATE_FULL | HierarchyUpdateRecord[]; /** @alpha */ export declare namespace HierarchyUpdateInfo { /** Serialize given object to JSON. */ function toJSON(obj: HierarchyUpdateInfo): HierarchyUpdateInfoJSON; /** Deserialize given object from JSON */ function fromJSON(json: HierarchyUpdateInfoJSON): HierarchyUpdateInfo; } /** @alpha */ export declare type ContentUpdateInfo = typeof UPDATE_FULL; /** * JSON representation of [[PartialHierarchyModification]]. * @public */ export declare type PartialHierarchyModificationJSON = NodeInsertionInfoJSON | NodeDeletionInfoJSON | NodeUpdateInfoJSON; /** * Information about a hierarchy change: insertion, deletion or node update. * @public */ export declare type PartialHierarchyModification = NodeInsertionInfo | NodeDeletionInfo | NodeUpdateInfo; /** @public */ export declare namespace PartialHierarchyModification { /** Serialize given object to JSON. */ function toJSON(obj: PartialHierarchyModification): PartialHierarchyModificationJSON; /** Deserialize given object from JSON */ function fromJSON(json: PartialHierarchyModificationJSON): PartialHierarchyModification; } /** * Information about node insertion. * @public */ export interface NodeInsertionInfo { type: "Insert"; /** Parent node key */ parent?: NodeKey; /** Index of the new node under its parent */ position: number; /** Inserted node */ node: Node; } /** * JSON representation of [[NodeInsertionInfo]]. * @public */ export interface NodeInsertionInfoJSON { type: "Insert"; parent?: NodeKeyJSON; position: number; node: NodeJSON; } /** * Information about node deletion. * @public */ export interface NodeDeletionInfo { type: "Delete"; /** Parent of the deleted node */ parent?: NodeKey; /** Position of the deleted node among its siblings in the initial, not updated tree */ position: number; /** * Key of the deleted node * @deprecated Use `parent` with `position` */ target: NodeKey; } /** * JSON representation of [[NodeDeletionInfo]]. * @public */ export interface NodeDeletionInfoJSON { type: "Delete"; /** Parent of the deleted node */ parent?: NodeKeyJSON; /** Position of the deleted node among its siblings in the initial, not updated tree */ position: number; /** * Key of the deleted node * @deprecated */ target: NodeKeyJSON; } /** * Information about node update. * @public */ export interface NodeUpdateInfo { type: "Update"; /** Key of the updated node */ target: NodeKey; /** Updated node attributes */ changes: PartialNode; } /** * JSON representation of [[NodeUpdateInfo]]. * @public */ export interface NodeUpdateInfoJSON { type: "Update"; target: NodeKeyJSON; changes: PartialNodeJSON; } /** * JSON representation of [[HierarchyCompareInfo]]. * @public */ export interface HierarchyCompareInfoJSON { changes: PartialHierarchyModificationJSON[]; continuationToken?: { prevHierarchyNode: string; currHierarchyNode: string; }; } /** * Information about hierarchy modification / differences. * @public */ export interface HierarchyCompareInfo { /** A list of hierarchy changes */ changes: PartialHierarchyModification[]; /** Continuation token for requesting more changes. */ continuationToken?: { prevHierarchyNode: string; currHierarchyNode: string; }; } /** @public */ export declare namespace HierarchyCompareInfo { /** Serialize given object to JSON. */ function toJSON(obj: HierarchyCompareInfo): HierarchyCompareInfoJSON; /** Deserialize given object from JSON */ function fromJSON(json: HierarchyCompareInfoJSON): HierarchyCompareInfo; } //# sourceMappingURL=Update.d.ts.map