import { default as React } from 'react'; import { ITableColumnProps } from '../../table'; import { ColumnActionHandler, DraggableHandler, RowsSelectionHandler, SortingState, TableSize, CellEditHandler } from '../types'; import { TableStyle } from '../../table/types'; /** * Data Table Static Context Value interface * Contains shared state and callbacks to eliminate props drilling */ type DataTableStaticContextValue = { hasColumnSeparator?: boolean; size?: TableSize; tableHeight?: number; rowHeight?: number; rowKey?: keyof T; styles?: TableStyle; rowsSelection?: RowsSelectionHandler; columns: ITableColumnProps[]; columnAction?: ColumnActionHandler; sorting?: SortingState; setSorting?: (sorting: SortingState | undefined) => void; handleAutoResize?: (columnKey: keyof T) => void; handleAutoResizeAll?: () => void; columnOrder: string[]; setColumnOrder?: React.Dispatch>; draggable?: DraggableHandler; cellEdit?: CellEditHandler; onRowClick?: (record: T) => void; onHeaderClick?: (headerTitle: string, column: ITableColumnProps) => void; }; export default DataTableStaticContextValue;