Files
site/node_modules/terra-draw/dist/modes/undo-redo.behavior.d.ts
T
site-admin 3ac81d5a52
deploy / build-and-publish (push) Successful in 1m37s
the editable site (validation-lab)
2026-11-21 08:03:55 +01:00

34 lines
1.1 KiB
TypeScript

type UndoRedoHistoryEntry<Coordinates> = {
featureCoordinates: Coordinates;
currentCoordinate: number;
};
type UndoStepResult<Coordinates> = {
undoneEntry: UndoRedoHistoryEntry<Coordinates>;
previousEntry: UndoRedoHistoryEntry<Coordinates> | undefined;
};
type UndoRedoBehaviorOptions = {
maxStackSize?: number;
};
export declare class UndoRedoBehavior<Coordinates> {
private undoHistory;
private redoHistory;
private cloneCoordinatesFunction;
private maxStackSize;
constructor(options?: UndoRedoBehaviorOptions);
setMaxStackSize(maxStackSize: number): void;
private trimHistoryToMax;
private pushUndoEntry;
private pushRedoEntry;
private cloneRecursively;
cloneCoordinates(coordinates: Coordinates): Coordinates;
private cloneEntry;
clear(): void;
undoSize(): number;
redoSize(): number;
recordSnapshot(entry: UndoRedoHistoryEntry<Coordinates>): void;
beginUndo(): UndoStepResult<Coordinates> | undefined;
takeRedo(): UndoRedoHistoryEntry<Coordinates> | undefined;
commitRedo(entry: UndoRedoHistoryEntry<Coordinates>): void;
}
export {};