import { CellPosition, SelectionRange, SelectionMode, SpreadsheetColumn } from '../types'; export interface UseSelectionOptions { /** Column definitions */ columns: SpreadsheetColumn[]; /** Data rows */ data: T[]; /** Callback when selection changes */ onSelectionChange?: (cell: CellPosition | null, row?: T | null) => void; /** Enable multi-row selection */ multiRowSelection?: boolean; /** Called before selection changes (e.g. to commit pending edits) */ onBeforeSelectionChange?: () => void; } export interface SelectionResult { /** Currently selected cell (anchor) */ selectedCell: CellPosition | null; /** Selection end point (for range) */ selectionEnd: CellPosition | null; /** Calculated selection range */ selectionRange: SelectionRange | null; /** Current selection mode */ selectionMode: SelectionMode; /** Currently editing cell */ editingCell: CellPosition | null; /** Set editing cell */ setEditingCell: React.Dispatch>; /** Column index map */ columnIndexMap: Record; /** First column key */ firstColumnKey: string | undefined; /** Last column key */ lastColumnKey: string | undefined; /** Last row index */ lastRowIndex: number; /** Begin selection */ beginSelection: (rowIndex: number, columnKey: string, options?: { extend?: boolean; mode?: SelectionMode; endCell?: CellPosition; }) => void; /** Extend selection to cell */ extendSelectionTo: (rowIndex: number, columnKey: string) => void; /** Stop selection drag */ stopSelectionDrag: () => void; /** Handle row header mouse down */ handleRowHeaderMouseDown: (event: React.MouseEvent, rowIndex: number) => void; /** Handle column header mouse down */ handleColumnHeaderMouseDown: (event: React.MouseEvent, columnKey: string) => void; /** Handle cell double click */ handleCellDoubleClick: (rowIndex: number, columnKey: string) => void; /** Is dragging selection ref */ isDraggingSelectionRef: React.MutableRefObject; /** Clear selection */ clearSelection: () => void; /** Select all cells */ selectAll: () => void; /** Check if cell is in selection */ isCellInSelection: (rowIndex: number, columnKey: string) => boolean; /** Check if cell is selection edge */ isCellSelectionEdge: (rowIndex: number, columnKey: string) => { left: boolean; right: boolean; top: boolean; bottom: boolean; }; /** Multi-row selection indexes (for Ctrl+click) */ selectedRowIndexes: number[]; /** Toggle row selection (for multi-select) */ toggleRowSelection: (rowIndex: number) => void; /** Set selected cell directly */ setSelectedCell: React.Dispatch>; /** Set selection end directly */ setSelectionEnd: React.Dispatch>; /** Set selection mode directly */ setSelectionMode: React.Dispatch>; } export declare function useSelection(options: UseSelectionOptions): SelectionResult; export default useSelection; //# sourceMappingURL=useSelection.d.ts.map