import type { CSSProperties, PropsWithChildren, ReactElement, ReactNode, Ref } from 'react'; import type { TablePaginationConfig, TableProps as AntdTableProps, TagProps as AntdTagProps, WatermarkProps as AntdWatermarkProps } from 'antd'; import type { ColumnGroupType, ColumnType } from 'antd/lib/table'; import type { CellEllipsisType, RenderedCell } from 'rc-table/lib/interface'; export type TableInstance = HTMLDivElement; export type Render = (value: any, record: RecordType, index: number) => ReactNode | RenderedCell; export type ColumnEllipsis = 'antd' | CellEllipsisType | boolean | number | Render; export type Column = (Omit | ColumnGroupType, 'dataIndex' | 'ellipsis' | 'align'> & { dataIndex?: ColumnType['dataIndex']; align?: ColumnGroupType['align']; children?: Columns; } & { /** 颜色 */ color?: CSSProperties['color']; /** 包裹Tag标签 */ tag?: boolean | AntdTagProps['color'] | AntdTagProps; /** 标题单位 */ unit?: string; /** 原ellipsis扩展 */ ellipsis?: ColumnEllipsis; /** 标题单位 */ formatter?: (value: any) => ReactNode; /** 字体粗细 */ fontWeight?: CSSProperties['fontWeight']; } & Record) | null | undefined; export type Columns = (Column | null | undefined)[]; export type DataSourceItem = T & { readonly TABLE_INDEX_KEY?: number; readonly key?: string | number; readonly id?: string | number; } & Record; export type DataSource = DataSourceItem[]; export type TableProps = Omit, 'columns'> & { columns?: Columns; dataSource?: DataSource; toolbar?: ReactNode | ((props: Pick) => ReactNode); transformEmptyData?: boolean | ((v: any) => string | number); /** 开启footer浮动 */ floatFooter?: boolean; /** 水印 */ watermark?: AntdWatermarkProps; /** * @description 组件是基于antd.Table的扩展,这个配置可以修改一些根本元素 */ baseConfig?: { /** * @description 配置为其他antd.Table的扩展 */ component?: any; /** * @description 配置其他扩展的默认props */ defaultProps?: any; /** * @description 其他扩展的默认props是否优先 * @default true */ defaultPropsPriority?: boolean; }; } & Record; export type TableStaticInterface = { displayName: string; INDEX: string; }; export type InternalTableType = (props: PropsWithChildren> & { ref?: Ref; }) => ReactElement; export type TableInterface = InternalTableType & TableStaticInterface; export declare const mergeDefaultPagination: (pagination: TablePaginationConfig) => TablePaginationConfig; declare const Table: TableInterface; export default Table;