import { PluginManifest, BaseGridPlugin, CellClickEvent, GridElement } from '../../core/plugin/base-plugin';
import { ColumnConfig, RowElementInternal } from '../../core/types';
import { EditingConfig } from './types';
/**
 * CSS selector for focusable editor elements within a cell.
 */
export declare const FOCUSABLE_EDITOR_SELECTOR = "input,select,textarea,[contenteditable=\"true\"],[contenteditable=\"\"],[tabindex]:not([tabindex=\"-1\"])";
/**
 * Check if a row element has any cells in editing mode.
 */
export declare function hasEditingCells(rowEl: RowElementInternal): boolean;
/**
 * Clear all editing state from a row element.
 */
export declare function clearEditingState(rowEl: RowElementInternal): void;
/**
 * Editing Plugin for tbw-grid
 *
 * Enables inline cell editing in the grid. Provides built-in editors for common data types
 * and supports custom editor functions for specialized input scenarios.
 *
 * ## Why Opt-In?
 *
 * Editing is delivered as a plugin rather than built into the core grid:
 *
 * - **Smaller bundle** — Apps that only display data don't pay for editing code
 * - **Clear intent** — Explicit plugin registration makes editing capability obvious
 * - **Runtime validation** — Using `editable: true` without the plugin throws a helpful error
 *
 * ## Installation
 *
 * ```ts
 * import { EditingPlugin } from '@toolbox-web/grid/plugins/editing';
 * ```
 *
 * ## Edit Triggers
 *
 * Configure how editing is triggered with the `editOn` option:
 *
 * | Value | Behavior |
 * |-------|----------|
 * | `'click'` | Single click enters edit mode (default) |
 * | `'dblclick'` | Double-click enters edit mode |
 *
 * ## Keyboard Shortcuts
 *
 * | Key | Action |
 * |-----|--------|
 * | `Enter` | Commit edit and move down |
 * | `Tab` | Commit edit and move right |
 * | `Escape` | Cancel edit, restore original value |
 * | `Arrow Keys` | Navigate between cells (when not editing) |
 *
 * @example Basic editing with double-click trigger
 * ```ts
 * grid.gridConfig = {
 *   columns: [
 *     { field: 'name', editable: true },
 *     { field: 'price', type: 'number', editable: true },
 *     { field: 'active', type: 'boolean', editable: true },
 *   ],
 *   plugins: [new EditingPlugin({ editOn: 'dblclick' })],
 * };
 *
 * grid.addEventListener('cell-commit', (e) => {
 *   const { field, oldValue, newValue } = e.detail;
 *   console.log(`${field}: ${oldValue} → ${newValue}`);
 * });
 * ```
 *
 * @example Custom editor function
 * ```ts
 * columns: [
 *   {
 *     field: 'status',
 *     editable: true,
 *     editor: (ctx) => {
 *       const select = document.createElement('select');
 *       ['pending', 'active', 'completed'].forEach(opt => {
 *         const option = document.createElement('option');
 *         option.value = opt;
 *         option.textContent = opt;
 *         option.selected = ctx.value === opt;
 *         select.appendChild(option);
 *       });
 *       select.addEventListener('change', () => ctx.commit(select.value));
 *       return select;
 *     },
 *   },
 * ]
 * ```
 *
 * @see {@link EditingConfig} for configuration options
 * @see {@link EditorContext} for custom editor context
 * @see [Live Demos](?path=/docs/grid-plugins-editing--docs) for interactive examples
 */
export declare class EditingPlugin<T = unknown> extends BaseGridPlugin<EditingConfig> {
    #private;
    /**
     * Plugin manifest - declares owned properties for configuration validation.
     * @internal
     */
    static readonly manifest: PluginManifest;
    /** @internal */
    readonly name = "editing";
    /** @internal */
    readonly styles: string;
    /** @internal */
    protected get defaultConfig(): Partial<EditingConfig>;
    /** @internal */
    attach(grid: GridElement): void;
    /** @internal */
    detach(): void;
    /**
     * Handle cell clicks - start editing if configured for click mode.
     * Both click and dblclick events come through this handler.
     * Starts row-based editing (all editable cells in the row get editors).
     * @internal
     */
    onCellClick(event: CellClickEvent): boolean | void;
    /**
     * Handle keyboard events for edit lifecycle.
     * @internal
     */
    onKeyDown(event: KeyboardEvent): boolean | void;
    /**
     * Process columns to merge type-level editorParams with column-level.
     * Column-level params take precedence.
     * @internal
     */
    processColumns(columns: ColumnConfig<T>[]): ColumnConfig<T>[];
    /**
     * After render, reapply editors to cells in edit mode.
     * This handles virtualization - when a row scrolls back into view,
     * we need to re-inject the editor.
     * @internal
     */
    afterRender(): void;
    /**
     * On scroll render, reapply editors to recycled cells.
     * @internal
     */
    onScrollRender(): void;
    /**
     * Get all rows that have been modified.
     * Uses ID-based lookup for stability when rows are reordered.
     */
    get changedRows(): T[];
    /**
     * Get IDs of all modified rows.
     */
    get changedRowIds(): string[];
    /**
     * Get the currently active edit row index, or -1 if not editing.
     */
    get activeEditRow(): number;
    /**
     * Get the currently active edit column index, or -1 if not editing.
     */
    get activeEditCol(): number;
    /**
     * Check if a specific row is currently being edited.
     */
    isRowEditing(rowIndex: number): boolean;
    /**
     * Check if a specific cell is currently being edited.
     */
    isCellEditing(rowIndex: number, colIndex: number): boolean;
    /**
     * Check if a specific row has been modified.
     * @param rowIndex - Row index to check (will be converted to ID internally)
     */
    isRowChanged(rowIndex: number): boolean;
    /**
     * Check if a row with the given ID has been modified.
     * @param rowId - Row ID to check
     */
    isRowChangedById(rowId: string): boolean;
    /**
     * Reset all change tracking.
     * @param silent - If true, suppresses the `changed-rows-reset` event
     * @fires changed-rows-reset - Emitted when tracking is reset (unless silent)
     */
    resetChangedRows(silent?: boolean): void;
    /**
     * Programmatically begin editing a cell.
     * @param rowIndex - Index of the row to edit
     * @param field - Field name of the column to edit
     * @fires cell-commit - Emitted when the cell value is committed (on blur or Enter)
     */
    beginCellEdit(rowIndex: number, field: string): void;
    /**
     * Programmatically begin editing all editable cells in a row.
     * @param rowIndex - Index of the row to edit
     * @fires cell-commit - Emitted for each cell value that is committed
     * @fires row-commit - Emitted when focus leaves the row
     */
    beginBulkEdit(rowIndex: number): void;
    /**
     * Commit the currently active row edit.
     * @fires row-commit - Emitted after the row edit is committed
     */
    commitActiveRowEdit(): void;
    /**
     * Cancel the currently active row edit.
     */
    cancelActiveRowEdit(): void;
}
//# sourceMappingURL=EditingPlugin.d.ts.map