import React from "react"; import { TooltipProps } from "../Tooltip/index"; interface ColumnsType { /** * sortable 排序的受控属性,外界可用此控制列的排序,可设置为 ascend descend false */ sortable?: boolean | string; /** * Tooltip props */ tooltip: TooltipProps; /** * title 列头显示文字 */ title: React.ReactNode; /** * dataIndex 列数据在数据项中对应的路径 */ dataIndex: string; /** * 列表的数据类型,决定 column 内容的对齐方式 */ contentType: "text" | "numeric"; /** * render 生成复杂数据的渲染函数,参数分别为当前行的值,当前行数据,行索引 */ render?: (text: string, record: object, index: number) => React.ReactNode; } declare type tableProps = { /** * columns 表格列的配置描述。 */ columns: ColumnsType[]; /** * dataSource 数据数组 */ dataSource: object[]; /** * rowKey 表格行key的取值,唯一性 */ rowKey: string; /** * 使表格行有 hover 状态,默认为 true */ hoverable: boolean; /** * 表格尺寸,可选 lg 和 sm,默认 lg */ size: "lg" | "sm"; /** * 每页展示条数,默认为 10 */ pageSize?: number; }; declare const Table: { (props: tableProps): JSX.Element; defaultProps: { readonly rowKey: "address"; readonly hoverable: true; readonly size: "lg"; readonly pageSize: 10; }; }; export default Table;