import { ReactElement, ReactNode } from 'react'; export type GetIdFn = (item: T, index: number) => Id; export interface SelectionState { selectionMap: Map; setSelection: (items: Array<{ id: Id; item: T; }>) => void; toggleSelection: (item: T, id: Id) => void; removeFromSelection: (id: Id) => void; clearSelection: () => void; isSelected: (item: T, index: number) => boolean; } export interface SelectionProviderProps { children: ReactNode; } export interface UseSelectionOptions { getId?: GetIdFn; } /** * Provides selection state to descendant components. */ export declare function SelectionProvider({ children }: SelectionProviderProps): ReactElement; /** * Hook to access selection state from context. * If used outside of a SelectionProvider, returns no-op functions and an empty selection map. * * @param options Optional configuration for the selection hook. * @param options.getId Function to get the unique identifier for an item, this allows the selection state to identify items. */ export declare function useSelection(options?: UseSelectionOptions): SelectionState & { hasContext: boolean; }; //# sourceMappingURL=SelectionProvider.d.ts.map