import { BaseGridPlugin } from '../../core/plugin/base-plugin';
import { ColumnConfig } from '../../core/types';
import { RowReorderConfig } from './types';
/** Field name for the drag handle column */
export declare const ROW_DRAG_HANDLE_FIELD = "__tbw_row_drag";
/**
 * Row Reorder Plugin for tbw-grid
 *
 * Enables row reordering via keyboard shortcuts (Ctrl+Up/Down) and drag-drop.
 * Supports validation callbacks and debounced keyboard moves.
 *
 * ## Installation
 *
 * ```ts
 * import { RowReorderPlugin } from '@toolbox-web/grid/plugins/row-reorder';
 * ```
 *
 * ## Configuration Options
 *
 * | Option | Type | Default | Description |
 * |--------|------|---------|-------------|
 * | `enableKeyboard` | `boolean` | `true` | Enable Ctrl+Up/Down shortcuts |
 * | `showDragHandle` | `boolean` | `true` | Show drag handle column |
 * | `dragHandlePosition` | `'left' \| 'right'` | `'left'` | Drag handle column position |
 * | `dragHandleWidth` | `number` | `40` | Drag handle column width |
 * | `canMove` | `function` | - | Validation callback |
 * | `debounceMs` | `number` | `300` | Debounce time for keyboard moves |
 * | `animation` | `false \| 'flip'` | `'flip'` | Animation for row moves |
 *
 * ## Keyboard Shortcuts
 *
 * | Key | Action |
 * |-----|--------|
 * | `Ctrl + ↑` | Move focused row up |
 * | `Ctrl + ↓` | Move focused row down |
 *
 * ## Events
 *
 * | Event | Detail | Cancelable | Description |
 * |-------|--------|------------|-------------|
 * | `row-move` | `RowMoveDetail` | Yes | Fired when a row move is attempted |
 *
 * @example Basic Row Reordering
 * ```ts
 * import '@toolbox-web/grid';
 * import { RowReorderPlugin } from '@toolbox-web/grid/plugins/row-reorder';
 *
 * const grid = document.querySelector('tbw-grid');
 * grid.gridConfig = {
 *   columns: [
 *     { field: 'id', header: 'ID' },
 *     { field: 'name', header: 'Name' },
 *   ],
 *   plugins: [new RowReorderPlugin()],
 * };
 *
 * grid.addEventListener('row-move', (e) => {
 *   console.log('Row moved from', e.detail.fromIndex, 'to', e.detail.toIndex);
 * });
 * ```
 *
 * @example With Validation
 * ```ts
 * new RowReorderPlugin({
 *   canMove: (row, fromIndex, toIndex, direction) => {
 *     // Prevent moving locked rows
 *     return !row.locked;
 *   },
 * })
 * ```
 *
 * @see {@link RowReorderConfig} for all configuration options
 * @see {@link RowMoveDetail} for the event detail structure
 */
export declare class RowReorderPlugin extends BaseGridPlugin<RowReorderConfig> {
    /** @internal */
    readonly name = "rowReorder";
    /** @internal */
    readonly styles: string;
    /** @internal */
    protected get defaultConfig(): Partial<RowReorderConfig>;
    /**
     * Resolve animation type from plugin config.
     * Uses base class isAnimationEnabled to respect grid-level settings.
     */
    private get animationType();
    private isDragging;
    private draggedRowIndex;
    private dropRowIndex;
    private pendingMove;
    private debounceTimer;
    /** Column index to use when flushing pending move */
    private lastFocusCol;
    /** @internal */
    detach(): void;
    /** @internal */
    processColumns(columns: readonly ColumnConfig[]): ColumnConfig[];
    /** @internal */
    afterRender(): void;
    /**
     * Handle Ctrl+Arrow keyboard shortcuts for row reordering.
     * @internal
     */
    onKeyDown(event: KeyboardEvent): boolean | void;
    /**
     * Flush pending keyboard moves when user clicks a cell.
     * This commits the move immediately so focus works correctly.
     * @internal
     */
    onCellClick(): void;
    /**
     * Move a row to a new position programmatically.
     * @param fromIndex - Current index of the row
     * @param toIndex - Target index
     */
    moveRow(fromIndex: number, toIndex: number): void;
    /**
     * Check if a row can be moved to a position.
     * @param fromIndex - Current index of the row
     * @param toIndex - Target index
     */
    canMoveRow(fromIndex: number, toIndex: number): boolean;
    /**
     * Set up drag start/end listeners on the drag handle element.
     */
    private setupHandleDragListeners;
    /**
     * Set up drop target listeners on a row element.
     * All rows are valid drop targets during drag operations.
     */
    private setupRowDropListeners;
    /**
     * Handle debounced keyboard moves.
     * Rows move immediately for visual feedback, but the event emission is debounced.
     */
    private handleKeyboardMove;
    /**
     * Flush the pending move by emitting the event.
     * Called when debounce timer fires or user clicks elsewhere.
     */
    private flushPendingMove;
    /**
     * Execute a row move and emit the event.
     */
    private executeMove;
    /**
     * Capture row positions before reorder.
     * Maps visual row index to its top position.
     */
    private captureRowPositions;
    /**
     * Apply FLIP animation for row reorder.
     * Uses CSS transitions - JS sets initial transform and toggles class.
     * @param oldPositions - Row positions captured before DOM change
     * @param fromIndex - Original index of moved row
     * @param toIndex - New index of moved row
     */
    private animateFLIP;
    /**
     * Get the row index from a row element by checking data-row attribute on cells.
     * This is consistent with how other plugins retrieve row indices.
     */
    private getRowIndex;
    /**
     * Clear all drag-related classes from rows.
     */
    private clearDragClasses;
    /**
     * Clear the debounce timer.
     */
    private clearDebounceTimer;
}
//# sourceMappingURL=RowReorderPlugin.d.ts.map