import type { TablePlugin } from '../../types';
/**
 * Sort direction for a single column.
 */
export type TableSortDirection = 'ascending' | 'descending';
/**
 * A single sort entry in the sort state array.
 */
export interface TableSortEntry<TSortKey extends string = string> {
    /** The sort key identifying which column (or derived value) to sort by. */
    sortKey: TSortKey;
    /** The sort direction. */
    direction: TableSortDirection;
}
/**
 * Complete sort state — an ordered array of sort entries.
 * The first entry is the primary sort; subsequent entries are tiebreakers.
 * Empty array = no sort applied.
 *
 * @example
 * ```
 * const sort: TableSortState = [
 *   { sortKey: 'name', direction: 'ascending' },
 *   { sortKey: 'age', direction: 'descending' },
 * ];
 * ```
 */
export type TableSortState<TSortKey extends string = string> = TableSortEntry<TSortKey>[];
/**
 * Configuration for useTableSortable.
 *
 * Follows Astryx headless plugin conventions: the consumer owns all state
 * and provides callbacks. The plugin never holds internal sort state.
 *
 * @template TSortKey - Union of valid sort key strings
 *
 * @example
 * ```
 * const [sort, setSort] = useState<TableSortState>([
 *   { sortKey: 'name', direction: 'ascending' },
 * ]);
 * const sortPlugin = useTableSortable({ sort, onSortChange: setSort });
 * <Table plugins={{ sort: sortPlugin }} columns={columns} data={data} />
 * ```
 */
export interface UseTableSortableConfig<TSortKey extends string = string> {
    /** Current sort state — ordered array of active sort entries. */
    sort: TableSortState<TSortKey>;
    /**
     * Called when the user changes sort via header click.
     * Receives the complete new sort state array.
     */
    onSortChange: (sort: TableSortState<TSortKey>) => void;
    /**
     * Allow returning to unsorted state.
     * When true, clicking a sorted column cycles: asc → desc → unsorted.
     * When false, clicking cycles: asc → desc → asc.
     *
     * @default true
     */
    allowUnsortedState?: boolean;
    /**
     * Enable multi-sort via modifier key (Shift+click).
     * When true, Shift+click adds/toggles a column as a secondary sort.
     * Regular click still replaces the entire sort state (single-sort behavior).
     *
     * @default false
     */
    isMultiSortEnabled?: boolean;
}
/**
 * useTableSortable — table plugin for column sorting.
 *
 * Returns a stable TablePlugin<T> that transforms header cells to add
 * clickable sort indicators. Follows the headless pattern: consumer owns
 * sort state, plugin provides UI and interaction.
 *
 * @example
 * ```
 * const [sort, setSort] = useState<TableSortState>([]);
 * const sortPlugin = useTableSortable({ sort, onSortChange: setSort });
 * <Table
 *   data={users}
 *   columns={[
 *     { key: 'name', header: 'Name', sortable: true },
 *     { key: 'age', header: 'Age', sortable: true },
 *   ]}
 *   plugins={{ sort: sortPlugin }}
 * />
 * ```
 */
export declare function useTableSortable<T extends Record<string, unknown>, TSortKey extends string = string>(config: UseTableSortableConfig<TSortKey>): TablePlugin<T>;
//# sourceMappingURL=useTableSortable.d.ts.map