hightable
Version:
A dynamic windowed scrolling table component for react
22 lines (21 loc) • 868 B
TypeScript
import { KeyboardEvent, ReactNode } from 'react';
import { Selection } from '../helpers/selection.js';
interface SelectionContextType {
selection?: Selection;
onSelectionChange?: (selection: Selection) => void;
onTableKeyDown?: (event: KeyboardEvent, numRows: number) => void;
}
export declare const SelectionContext: import("react").Context<SelectionContextType>;
interface SelectionProviderProps {
selection?: Selection;
onSelectionChange?: (selection: Selection) => void;
children: ReactNode;
}
export declare function SelectionProvider({ children, selection, onSelectionChange }: SelectionProviderProps): import("react/jsx-runtime").JSX.Element;
type HighTableSelection = SelectionContextType & {
toggleAllRows?: () => void;
};
export declare function useSelection({ numRows }: {
numRows: number;
}): HighTableSelection;
export {};