export type SelectableState = { /** * The localised ids that have been checked. */ checked: number[]; /** * Whether all list items are checked. */ allChecked: boolean; /** * Whether any single row item is checked. */ anyChecked: boolean; /** * Equal to the data length of the table, i.e. the maximum number of checked items. */ maxChecked: number; /** * Indicates where a selection begins, i.e. the last selection where the Shift key was **not pressed** */ selectionStart: number; /** * Indicates the most recent selection range where the Shift key was pressed. * This provides the ability to uncheck ids that are not part of a new selection range, but were in the previous selection range, * mimicking behaviour such as that in macOS * e.g. [2, 3, 4] indicates ids from 2 to 4 were selected the last time the Shift key was pressed. */ previousSelection: number[]; }; export type SelectableActions = { setAll: () => void; removeAll: () => void; toggleSelection: (id: number, shiftHeld: boolean) => void; setMax: (max: number) => void; }; export declare const defaultSelectableState: SelectableState; declare function useSelectable(): [SelectableState, SelectableActions]; export default useSelectable;