import type * as React from 'react'; import type { DeepNamePath } from './namePathType'; /** * ColumnType which applied in antd: https://ant.design/components/table-cn/#Column * - defaultSortOrder * - filterDropdown * - filterDropdownVisible * - filtered * - filteredValue * - filterIcon * - filterMultiple * - filters * - sorter * - sortOrder * - sortDirections * - onFilter * - onFilterDropdownVisibleChange */ export type Key = React.Key; export type FixedType = 'left' | 'right' | boolean; export type DefaultRecordType = Record; export type TableLayout = 'auto' | 'fixed'; export type ScrollConfig = { index?: number; key?: Key; top?: number; }; export type Reference = { nativeElement: HTMLDivElement; scrollTo: (config: ScrollConfig) => void; }; export type RowClassName = (record: RecordType, index: number, indent: number) => string; export interface CellType { key?: Key; className?: string; style?: React.CSSProperties; children?: React.ReactNode; column?: ColumnsType[number]; colSpan?: number; rowSpan?: number; /** Only used for table header */ hasSubColumns?: boolean; colStart?: number; colEnd?: number; } export interface RenderedCell { props?: CellType; children?: React.ReactNode; } export type Direction = 'ltr' | 'rtl'; export type SpecialString = T | (string & {}); export type DataIndex = DeepNamePath | SpecialString | number | (SpecialString | number)[]; export type CellEllipsisType = { showTitle?: boolean; } | boolean; export type ColScopeType = 'col' | 'colgroup'; export type RowScopeType = 'row' | 'rowgroup'; export type ScopeType = ColScopeType | RowScopeType; interface ColumnSharedType { title?: React.ReactNode; key?: Key; className?: string; hidden?: boolean; fixed?: FixedType; onHeaderCell?: GetComponentProps[number]>; ellipsis?: CellEllipsisType; align?: AlignType; rowScope?: RowScopeType; } export interface ColumnGroupType extends ColumnSharedType { children: ColumnsType; } export type AlignType = 'start' | 'end' | 'left' | 'right' | 'center' | 'justify' | 'match-parent'; export interface ColumnType extends ColumnSharedType { colSpan?: number; dataIndex?: DataIndex; render?: (value: any, record: RecordType, index: number) => React.ReactNode | RenderedCell; shouldCellUpdate?: (record: RecordType, prevRecord: RecordType) => boolean; rowSpan?: number; width?: number | string; minWidth?: number; onCell?: GetComponentProps; /** @deprecated Please use `onCell` instead */ onCellClick?: (record: RecordType, e: React.MouseEvent) => void; } export type ColumnsType = readonly (ColumnGroupType | ColumnType)[]; export type GetRowKey = (record: RecordType, index?: number) => Key; export interface StickyOffsets { left: readonly number[]; right: readonly number[]; isSticky?: boolean; } export type GetComponentProps = (data: DataType, index?: number) => React.HTMLAttributes & React.TdHTMLAttributes; type Component

= React.ComponentType

| React.ForwardRefExoticComponent

| React.FC

| keyof React.ReactHTML; export type CustomizeComponent = Component; export type OnCustomizeScroll = (info: { currentTarget?: HTMLElement; scrollLeft?: number; }) => void; export type CustomizeScrollBody = (data: readonly RecordType[], info: { scrollbarSize: number; ref: React.Ref<{ scrollLeft: number; scrollTo?: (scrollConfig: ScrollConfig) => void; }>; onScroll: OnCustomizeScroll; }) => React.ReactNode; export interface TableComponents { table?: CustomizeComponent; header?: { table?: CustomizeComponent; wrapper?: CustomizeComponent; row?: CustomizeComponent; cell?: CustomizeComponent; }; body?: CustomizeScrollBody | { wrapper?: CustomizeComponent; row?: CustomizeComponent; cell?: CustomizeComponent; }; } export type GetComponent = (path: readonly string[], defaultComponent?: CustomizeComponent) => CustomizeComponent; export type ExpandableType = false | 'row' | 'nest'; export interface LegacyExpandableProps { /** @deprecated Use `expandable.expandedRowKeys` instead */ expandedRowKeys?: Key[]; /** @deprecated Use `expandable.defaultExpandedRowKeys` instead */ defaultExpandedRowKeys?: Key[]; /** @deprecated Use `expandable.expandedRowRender` instead */ expandedRowRender?: ExpandedRowRender; /** @deprecated Use `expandable.expandRowByClick` instead */ expandRowByClick?: boolean; /** @deprecated Use `expandable.expandIcon` instead */ expandIcon?: RenderExpandIcon; /** @deprecated Use `expandable.onExpand` instead */ onExpand?: (expanded: boolean, record: RecordType) => void; /** @deprecated Use `expandable.onExpandedRowsChange` instead */ onExpandedRowsChange?: (expandedKeys: Key[]) => void; /** @deprecated Use `expandable.defaultExpandAllRows` instead */ defaultExpandAllRows?: boolean; /** @deprecated Use `expandable.indentSize` instead */ indentSize?: number; /** @deprecated Use `expandable.expandIconColumnIndex` instead */ expandIconColumnIndex?: number; /** @deprecated Use `expandable.expandedRowClassName` instead */ expandedRowClassName?: RowClassName; /** @deprecated Use `expandable.childrenColumnName` instead */ childrenColumnName?: string; title?: PanelRender; } export type ExpandedRowRender = (record: ValueType, index: number, indent: number, expanded: boolean) => React.ReactNode; export interface RenderExpandIconProps { prefixCls: string; expanded: boolean; record: RecordType; expandable: boolean; onExpand: TriggerEventHandler; } export type RenderExpandIcon = (props: RenderExpandIconProps) => React.ReactNode; export interface ExpandableConfig { expandedRowKeys?: readonly Key[]; defaultExpandedRowKeys?: readonly Key[]; expandedRowRender?: ExpandedRowRender; columnTitle?: React.ReactNode; expandRowByClick?: boolean; expandIcon?: RenderExpandIcon; onExpand?: (expanded: boolean, record: RecordType) => void; onExpandedRowsChange?: (expandedKeys: readonly Key[]) => void; defaultExpandAllRows?: boolean; indentSize?: number; /** @deprecated Please use `EXPAND_COLUMN` in `columns` directly */ expandIconColumnIndex?: number; showExpandColumn?: boolean; expandedRowClassName?: string | RowClassName; childrenColumnName?: string; rowExpandable?: (record: RecordType) => boolean; columnWidth?: number | string; fixed?: FixedType; } export type PanelRender = (data: readonly RecordType[]) => React.ReactNode; export type TriggerEventHandler = (record: RecordType, event: React.MouseEvent) => void; export interface TableSticky { offsetHeader?: number; offsetSummary?: number; offsetScroll?: number; getContainer?: () => Window | HTMLElement; } export {};