import type { HistoryEntry, HistoryEntrySummary, PushPatchOptions } from "./types/history"; import type { HistoryState } from "./types/events"; import type { Layer } from "./Layer"; import type { Brush } from "./Brush"; export interface HistoryContext { getLayer(layerId: string): Layer | undefined; getLayers(): readonly Layer[]; getActiveLayer(): Layer; setActiveLayer(layerId: string): void; renderLayers(): void; getBrush(): Brush; deleteLayerOnly(layerId: string): void; insertLayerOnly(layer: Layer, index: number): void; moveLayerOnly(layerId: string, index: number): void; } export declare class HistoryManager { private undoStack; private redoStack; private maxStackSize; private context?; onHistoryChange?: () => void; constructor(maxStackSize?: number, context?: HistoryContext); setContext(context: HistoryContext): void; push(entry: HistoryEntry): void; undo(): void; redo(): void; clear(): void; canUndo(): boolean; canRedo(): boolean; getHistoryState(): HistoryState; getEntries(): readonly HistoryEntrySummary[]; goTo(index: number): void; pushPatch(options: PushPatchOptions): void; pushPatch(beforeData: ImageData, afterData: ImageData, x?: number, y?: number, layerId?: string, description?: string): void; private toSummary; } export declare class CanvasStateHistoryEntry implements HistoryEntry { private layerId; private beforeData; private afterData; private context; private x; private y; description: string; type: string; id: string; timestamp: number; constructor(layerId: string, beforeData: ImageData, afterData: ImageData, context: HistoryContext, x?: number, y?: number, description?: string, type?: string); getSummary(): HistoryEntrySummary; undo(): void; redo(): void; } export declare class LayerCreatedHistoryEntry implements HistoryEntry { private layer; private context; private index?; id: string; timestamp: number; type: string; description: string; constructor(layer: Layer, context: HistoryContext, index?: number | undefined, description?: string); getSummary(): HistoryEntrySummary; undo(): void; redo(): void; } export declare class LayerDeletedHistoryEntry implements HistoryEntry { private layer; private index; private wasActive; private context; id: string; timestamp: number; type: string; description: string; constructor(layer: Layer, index: number, wasActive: boolean, context: HistoryContext, description?: string); getSummary(): HistoryEntrySummary; undo(): void; redo(): void; } export declare class LayerPropertyHistoryEntry implements HistoryEntry { private layerId; private propertyName; private beforeValue; private afterValue; private context; id: string; timestamp: number; type: string; description: string; constructor(layerId: string, propertyName: "name" | "visible" | "opacity" | "blendMode" | "alphaLock" | "locked", beforeValue: string | number | boolean, afterValue: string | number | boolean, context: HistoryContext, description?: string); getSummary(): HistoryEntrySummary; undo(): void; redo(): void; } export declare class MoveLayerHistoryEntry implements HistoryEntry { private layerId; private beforeIndex; private afterIndex; private context; id: string; timestamp: number; type: string; description: string; constructor(layerId: string, beforeIndex: number, afterIndex: number, context: HistoryContext, description?: string); getSummary(): HistoryEntrySummary; undo(): void; redo(): void; } //# sourceMappingURL=HistoryManager.d.ts.map