/** * Undo/Redo Manager with History Tracking * Maintains command history with memory constraints and conflict resolution */ import { Command } from './commands'; export interface HistoryState { currentIndex: number; commands: Command[]; totalSize: number; isDirty: boolean; } export declare class UndoRedoManager { private history; private currentIndex; private maxSize; private totalSize; private listeners; private mergeTimeout; private lastCommand; private allowMerge; constructor(maxSize?: number); /** * Execute a command and add to history */ execute(command: Command): void; /** * Undo last command */ undo(): boolean; /** * Redo last undone command */ redo(): boolean; /** * Can undo current state */ canUndo(): boolean; /** * Can redo from current state */ canRedo(): boolean; /** * Get history state */ getState(): HistoryState; /** * Get history for UI display */ getHistory(): Array<{ description: string; timestamp: number; }>; /** * Get description of undo action */ getUndoDescription(): string; /** * Get description of redo action */ getRedoDescription(): string; /** * Clear all history */ clear(): void; /** * Prune old commands when exceeding memory limit */ private pruneHistory; /** * Reset merge timeout to enable command merging */ private resetMergeTimeout; /** * Subscribe to history changes */ subscribe(listener: (state: HistoryState) => void): () => void; /** * Notify all listeners of state change */ private notifyListeners; /** * Jump to specific history index */ jumpTo(index: number): boolean; /** * Get memory usage in bytes */ getMemoryUsage(): { used: number; limit: number; percentage: number; }; } //# sourceMappingURL=manager.d.ts.map