import type { Feature, Polygon, MultiPolygon } from 'geojson';
import type { EventManager } from './event-manager';
import type { FeatureMetadataSnapshotEntry, LayerSnapshot } from '../types/polydraw-interfaces';
import type { LayerManager } from './layer-manager';
import * as L from 'leaflet';
/**
 * Represents a snapshot of the entire drawing state
 */
export interface HistorySnapshot {
    /**
     * Array of GeoJSON features representing all polygons
     */
    features: Feature<Polygon | MultiPolygon>[];
    /**
     * Timestamp when this snapshot was created
     */
    timestamp: number;
    /**
     * Optional description of the action that created this snapshot
     */
    action?: string;
    /**
     * Approximate serialized size in bytes at save time.
     */
    size?: number;
    /**
     * Optional layer snapshot for restoring layer assignments
     */
    layerSnapshot?: LayerSnapshot;
    /**
     * Optional per-feature metadata snapshot aligned with `features` order.
     */
    featureMetadataSnapshot?: FeatureMetadataSnapshotEntry[];
}
/**
 * HistoryManager handles undo/redo functionality for polygon operations.
 * It stores snapshots of the polygon state as GeoJSON and manages undo/redo stacks.
 */
export declare class HistoryManager {
    private undoStack;
    private redoStack;
    private maxHistorySize;
    private maxSnapshotSize;
    private maxTotalMemory;
    private currentMemoryUsage;
    private eventManager;
    private isRestoring;
    constructor(eventManager: EventManager, maxHistorySize?: number);
    setMaxHistorySize(maxHistorySize: number): void;
    /**
     * Save the current state to the undo stack
     * @param featureGroups - Array of Leaflet feature groups to save
     * @param action - Optional description of the action
     * @param layerManager - Optional layer manager for capturing layer state
     */
    saveState(featureGroups: L.FeatureGroup[], action?: string, layerManager?: LayerManager): void;
    /**
     * Calculate the approximate size of a snapshot in bytes
     */
    private calculateSnapshotSize;
    /**
     * Enforce memory budget by removing oldest snapshots if needed
     */
    private enforceMemoryBudget;
    /**
     * Enforce redo stack size (count-based, not byte-based)
     */
    private enforceRedoMemoryBudget;
    /**
     * Undo the last action
     * @param featureGroups - Current array of feature groups
     * @returns The snapshot to restore, or null if undo stack is empty
     */
    undo(featureGroups: L.FeatureGroup[], layerManager?: LayerManager): HistorySnapshot | null;
    /**
     * Redo the last undone action
     * @param featureGroups - Current array of feature groups
     * @returns The snapshot to restore, or null if redo stack is empty
     */
    redo(featureGroups: L.FeatureGroup[], layerManager?: LayerManager): HistorySnapshot | null;
    /**
     * Check if undo is available
     */
    canUndo(): boolean;
    /**
     * Check if redo is available
     */
    canRedo(): boolean;
    /**
     * Clear all history
     */
    clear(): void;
    /**
     * Set the restoration flag (prevents saving during restore)
     */
    setRestoring(isRestoring: boolean): void;
    /**
     * Create a snapshot from feature groups
     */
    private createSnapshot;
    private captureFeatureMetadataSnapshot;
    private getSnapshotSize;
}
//# sourceMappingURL=history-manager.d.ts.map