/** * History is a class that manages the undo and redo stacks. * @see https://github.com/excalidraw/excalidraw/blob/master/packages/excalidraw/history.ts * @see https://docs.excalidraw.com/docs/@excalidraw/excalidraw/api/props/excalidraw-api#history */ import { AppState } from '../context'; import { AppStateChange } from './AppStateChange'; import { ElementsChange, SceneElementsMap } from './ElementsChange'; import { Snapshot } from './Snapshot'; export declare class History { #private; private static pop; private static push; get isUndoStackEmpty(): boolean; get isRedoStackEmpty(): boolean; clear(): void; /** * Record a local change which will go into the history */ record(elementsChange: ElementsChange, appStateChange: AppStateChange): void; undo(elements: SceneElementsMap, appState: AppState, snapshot: Readonly): void | [SceneElementsMap, AppState]; redo(elements: SceneElementsMap, appState: AppState, snapshot: Readonly): void | [SceneElementsMap, AppState]; private perform; } export declare class HistoryEntry { readonly appStateChange: AppStateChange; readonly elementsChange: ElementsChange; private constructor(); static create(appStateChange: AppStateChange, elementsChange: ElementsChange): HistoryEntry; inverse(): HistoryEntry; applyTo(elements: SceneElementsMap, appState: AppState, snapshot: Readonly): [SceneElementsMap, AppState, boolean]; /** * Apply latest (remote) changes to the history entry, creates new instance of `HistoryEntry`. */ applyLatestChanges(elements: SceneElementsMap): HistoryEntry; isEmpty(): boolean; }