export type TSectionFilterItem = { value?: string | number; label?: string; }; type Section = { data: T[]; title: string; selectionLimit?: number; disableItemsOnLimitReached?: boolean; }; type SelectedItemsPerSection = { [X: number]: T[]; }; export type UseSectionFilters = { sections: Section[]; areItemsEqual?: (a: T, b: T) => boolean; selectionLimit?: number; sectionSelectionLimit?: number; disableItemsOnLimitReached?: boolean; initialSelectedItems?: SelectedItemsPerSection; onToggleItem?: (item: T, section: Section) => boolean; }; /** * All selection state is owned internally — this hook is uncontrolled. * Pass `initialSelectedItems` to seed state; after mount, changes are only possible * through `toggleItem` / `clearSelectedItemsWithSection`. * `onToggleItem` can intercept a toggle and return `true` to prevent the internal * state update (useful for controlled scenarios without rewriting the whole hook). * When `selectionLimit === 1` the entire per-section array is replaced on toggle * rather than appended, so de-selecting by re-tapping the same item is not supported * at limit=1 — tapping a new item simply replaces the previous selection. */ export declare function useSectionFilters(props: UseSectionFilters): { isSelected: (item: T) => any; toggleItem: (item: T) => void; findItemSection: (item: T) => { sectionIndex: number; section: null; } | { sectionIndex: null; section: null; } | { sectionIndex: number; section: Section; }; selectedItems: SelectedItemsPerSection; sectionLimitReached: (sectionIndex: number) => boolean; limitReached: () => boolean; disableItemsOnLimitReached: boolean; clearSelectedItemsWithSection: (sectionIndex: number) => void; changed: () => boolean; areItemsEqual: ((a: T, b: T) => boolean) | typeof import("deep-equal"); getAllItems: () => T[]; }; export {}; //# sourceMappingURL=useSectionFilters.d.ts.map