import { TableRowData, TableRowId, TableRowSelectable } from '../Table.types';
/**
 * Configuration for `useTableSelection`.
 */
export type UseTableSelectionOptions<RowType extends TableRowData> = {
    /**
     * Data rows that participate in active-row and selection state.
     */
    rows: RowType[];
    /**
     * Optional key accessor used to derive stable row ids.
     *
     * If omitted, the row index is used as a fallback.
     */
    rowKey?: keyof RowType | ((row: RowType, rowIndex: number) => TableRowId);
    /**
     * Optional initially active row id.
     */
    initialActiveRowId?: TableRowId;
    /**
     * Optional predicate to exclude rows from selection.
     */
    isRowSelectable?: TableRowSelectable<RowType>;
    /**
     * Optional initially selected row ids.
     */
    initialSelectedRowIds?: TableRowId[];
};
/**
 * Selection and active-row state returned by `useTableSelection`.
 */
export type UseTableSelectionReturn = {
    /**
     * Currently active row id.
     */
    activeRowId?: TableRowId;
    /**
     * Currently selected row ids.
     */
    selectedRowIds: TableRowId[];
    /**
     * Whether at least one row is currently selected.
     */
    hasSelection: boolean;
    /**
     * Whether all current rows are selected.
     */
    isAllSelected: boolean;
    /**
     * Checks whether a given row id is currently selected.
     */
    isRowSelected: (rowId: TableRowId) => boolean;
    /**
     * Sets the current active row id.
     */
    setActiveRowId: (rowId: TableRowId | undefined) => void;
    /**
     * Replaces the current selection with the provided row ids.
     */
    setSelectedRowIds: (rowIds: TableRowId[]) => void;
    /**
     * Toggles selection state for a single row id.
     */
    toggleRowSelection: (rowId: TableRowId) => void;
    /**
     * Selects or deselects all current rows.
     *
     * If `shouldSelect` is omitted, the hook toggles based on the current
     * all-selected state.
     */
    toggleAllSelection: (shouldSelect?: boolean) => void;
    /**
     * Clears the current selection.
     */
    clearSelection: () => void;
};
/**
 * Small helper hook for controlled table demos and simple table integrations
 * that need active-row state plus checkbox selection state.
 *
 * The hook derives stable row ids from `rows` and `rowKey`, keeps the active
 * row and selection in sync when rows change, and provides convenience helpers
 * for single-row and all-row toggling.
 */
declare const useTableSelection: <RowType extends TableRowData>(props: UseTableSelectionOptions<RowType>) => UseTableSelectionReturn;
export default useTableSelection;
