import { BaseGridPlugin, PluginDependency } from '../../core/plugin/base-plugin';
import { EditAction, UndoRedoConfig } from './types';
/**
 * Undo/Redo Plugin for tbw-grid
 *
 * Tracks all cell edits and lets users revert or replay changes with familiar keyboard
 * shortcuts (Ctrl+Z / Ctrl+Y). Maintains an in-memory history stack with configurable
 * depth—perfect for data entry workflows where mistakes happen.
 *
 * > **Required Dependency:** This plugin requires EditingPlugin to be loaded first.
 * > UndoRedo tracks the edit history that EditingPlugin creates.
 *
 * ## Installation
 *
 * ```ts
 * import { EditingPlugin } from '@toolbox-web/grid/plugins/editing';
 * import { UndoRedoPlugin } from '@toolbox-web/grid/plugins/undo-redo';
 * ```
 *
 * ## Configuration Options
 *
 * | Option | Type | Default | Description |
 * |--------|------|---------|-------------|
 * | `maxHistorySize` | `number` | `100` | Maximum actions in history stack |
 *
 * ## Keyboard Shortcuts
 *
 * | Shortcut | Action |
 * |----------|--------|
 * | `Ctrl+Z` / `Cmd+Z` | Undo last edit |
 * | `Ctrl+Y` / `Cmd+Shift+Z` | Redo last undone edit |
 *
 * ## Programmatic API
 *
 * | Method | Signature | Description |
 * |--------|-----------|-------------|
 * | `undo` | `() => void` | Undo the last edit |
 * | `redo` | `() => void` | Redo the last undone edit |
 * | `canUndo` | `() => boolean` | Check if undo is available |
 * | `canRedo` | `() => boolean` | Check if redo is available |
 * | `clearHistory` | `() => void` | Clear the entire history stack |
 *
 * @example Basic Usage with EditingPlugin
 * ```ts
 * import '@toolbox-web/grid';
 * import { EditingPlugin } from '@toolbox-web/grid/plugins/editing';
 * import { UndoRedoPlugin } from '@toolbox-web/grid/plugins/undo-redo';
 *
 * const grid = document.querySelector('tbw-grid');
 * grid.gridConfig = {
 *   columns: [
 *     { field: 'name', header: 'Name', editable: true },
 *     { field: 'price', header: 'Price', type: 'number', editable: true },
 *   ],
 *   plugins: [
 *     new EditingPlugin({ editOn: 'dblclick' }), // Required - must be first
 *     new UndoRedoPlugin({ maxHistorySize: 50 }),
 *   ],
 * };
 * ```
 *
 * @see {@link UndoRedoConfig} for configuration options
 * @see {@link EditingPlugin} for the required dependency
 *
 * @internal Extends BaseGridPlugin
 */
export declare class UndoRedoPlugin extends BaseGridPlugin<UndoRedoConfig> {
    /**
     * Plugin dependencies - UndoRedoPlugin requires EditingPlugin to track edits.
     *
     * The EditingPlugin must be loaded BEFORE this plugin in the plugins array.
     * @internal
     */
    static readonly dependencies: PluginDependency[];
    /** @internal */
    readonly name = "undoRedo";
    /** @internal */
    protected get defaultConfig(): Partial<UndoRedoConfig>;
    private undoStack;
    private redoStack;
    /**
     * Clean up state when plugin is detached.
     * @internal
     */
    detach(): void;
    /**
     * Handle keyboard shortcuts for undo/redo.
     * - Ctrl+Z / Cmd+Z: Undo
     * - Ctrl+Y / Cmd+Y / Ctrl+Shift+Z / Cmd+Shift+Z: Redo
     * @internal
     */
    onKeyDown(event: KeyboardEvent): boolean;
    /**
     * Record a cell edit for undo/redo tracking.
     * Call this when a cell value changes.
     *
     * @param rowIndex - The row index where the edit occurred
     * @param field - The field (column key) that was edited
     * @param oldValue - The value before the edit
     * @param newValue - The value after the edit
     */
    recordEdit(rowIndex: number, field: string, oldValue: unknown, newValue: unknown): void;
    /**
     * Programmatically undo the last action.
     *
     * @returns The undone action, or null if nothing to undo
     */
    undo(): EditAction | null;
    /**
     * Programmatically redo the last undone action.
     *
     * @returns The redone action, or null if nothing to redo
     */
    redo(): EditAction | null;
    /**
     * Check if there are any actions that can be undone.
     */
    canUndo(): boolean;
    /**
     * Check if there are any actions that can be redone.
     */
    canRedo(): boolean;
    /**
     * Clear all undo/redo history.
     */
    clearHistory(): void;
    /**
     * Get a copy of the current undo stack.
     */
    getUndoStack(): EditAction[];
    /**
     * Get a copy of the current redo stack.
     */
    getRedoStack(): EditAction[];
}
//# sourceMappingURL=UndoRedoPlugin.d.ts.map