@zeainc/zea-ux
Version:
45 lines • 1.48 kB
TypeScript
import Change from '../Change.js';
import { TreeItem } from '@zeainc/zea-engine';
/**
* Class representing a `Move TreeItem` Change(Moving a TreeItem from one parent to another).
*
* @extends Change
*/
declare class TreeItemMoveChange extends Change {
treeItem: TreeItem;
oldOwner: TreeItem;
oldOwnerIndex: number;
newOwner: TreeItem;
/**
* Creates an instance of TreeItemMoveChange.
*
* @param treeItem - The item to move.
* @param newOwner - The new owner item.
* @memberof TreeItemMoveChange
*/
constructor(treeItem: TreeItem, newOwner: TreeItem);
/**
* Inserts back the moved TreeItem in the old owner item(Rollbacks the move action).
*/
undo(): void;
/**
* Executes the move action inserting the TreeItem back to the new owner item.
*/
redo(): void;
/**
* Returns a JSON object with the specifications of the change(Typically used for replication).
*
* @param context - The context value
* @return {object} - JSON object of the change
*/
toJSON(context: Record<string, any>): Record<string, any>;
/**
* Restores the Change state from the specified JSON object.
*
* @param j - The serialized object with the change data.
* @param context - The context value
*/
fromJSON(j: Record<string, any>, context: Record<string, any>): void;
}
export { TreeItemMoveChange };
//# sourceMappingURL=TreeItemMoveChange.d.ts.map