@douyinfe/semi-ui
Version:
A modern, comprehensive, flexible design system and UI library. Connect DesignOps & DevOps. Quickly build beautiful React apps. Maintained by Douyin-fe team.
23 lines (22 loc) • 1.27 kB
TypeScript
import React from 'react';
import { ColumnProps, GetVirtualizedListRef, RowKey } from './interface';
import { BaseHeadWidth } from '@douyinfe/semi-foundation/lib/es/table/foundation';
import type { ContextValue } from '../configProvider/context';
export interface TableContextProps {
children?: React.ReactNode;
anyColumnFixed?: boolean;
flattenedColumns?: ColumnProps[];
tableWidth?: number;
headWidths?: BaseHeadWidth[][];
setHeadWidths?: (headWidth?: BaseHeadWidth[], index?: number) => void;
getHeadWidths?: (index?: number) => number[];
getCellWidths?: (flattenColumns: ColumnProps[], flattenedWidths?: number[], ignoreScrollBarKey?: boolean) => number[];
handleRowExpanded?: (expanded: boolean, realKey: RowKey<any>, domEvent: React.MouseEvent<HTMLElement>) => void;
renderExpandIcon?: (record: Record<string, any>, isNested?: boolean, groupKey?: string | number) => React.ReactNode;
renderSelection?: (record?: Record<string, any>, isHeader?: boolean) => React.ReactNode;
getVirtualizedListRef?: GetVirtualizedListRef;
setBodyHasScrollbar?: (bodyHasScrollBar: boolean) => void;
direction?: ContextValue['direction'];
}
declare const TableContext: React.Context<TableContextProps>;
export default TableContext;