UNPKG

hightable

Version:

A dynamic windowed scrolling table component for react

31 lines (30 loc) 1.18 kB
import { CSSProperties, ReactNode } from 'react'; import { MaybeColumnWidth } from '../helpers/width.js'; export type MaybeColumnState = MaybeColumnWidth; interface ColumnStatesContextType { getColumnWidth?: (columnIndex: number) => number | undefined; getColumnStyle?: (columnIndex: number) => CSSProperties; isFixedColumn?: (columnIndex: number) => boolean; setAvailableWidth?: (width: number) => void; forceWidth?: (options: { columnIndex: number; width: number; }) => void; measureWidth?: (options: { columnIndex: number; measured: number; }) => void; removeWidth?: (options: { columnIndex: number; }) => void; } export declare const ColumnStatesContext: import("react").Context<ColumnStatesContextType>; interface ColumnStatesProviderProps { localStorageKey?: string; numColumns: number; minWidth: number; children: ReactNode; } export declare function ColumnStatesProvider({ children, localStorageKey, numColumns, minWidth }: ColumnStatesProviderProps): import("react/jsx-runtime").JSX.Element; export declare function useColumnStates(): ColumnStatesContextType; export {};