/** * Base interface for all undoable changes. * Contains the path from the tracked root to the changed node. */ export interface UndoableChangeBase { readonly path: readonly string[]; } /** * Represents adding a new property to an object. */ export type UndoableObjectAddChange = Readonly; /** * Represents updating an existing property on an object. */ export type UndoableObjectUpdateChange = Readonly; /** * Represents removing a property from an object. */ export type UndoableObjectRemoveChange = Readonly; /** * Union of all object change types. */ export type UndoableObjectChange = UndoableObjectAddChange | UndoableObjectUpdateChange | UndoableObjectRemoveChange; /** * Represents splicing elements into/from an array. */ export type UndoableArraySpliceChange = Readonly; /** * Represents updating an element in an array. */ export type UndoableArrayUpdateChange = Readonly; /** * Union of all array change types. */ export type UndoableArrayChange = UndoableArraySpliceChange | UndoableArrayUpdateChange; /** * Union of all undoable change types. */ export type UndoableChange = UndoableObjectChange | UndoableArrayChange;