import React from "react"; import type { ColumnProps as AntColumnsProps, TableProps as AntTableProps } from "antd/es/table"; import type { TableRowSelection } from "antd/es/table/interface"; import type { StringKey } from "../../internal/type"; declare enum SortOrder { DESC = "DESC", ASC = "ASC" } type RenderedCell = Exclude["render"]>>, React.ReactNode>; export type { TableRowSelection }; export interface TableHandler { scrollTo: (index: number) => void; } export interface TableColumn { title: React.ReactElement | string | number; renderData: (record: RowType, index: number) => React.ReactNode | RenderedCell | undefined; align?: "left" | "right" | "center"; colSpan?: number; width?: string | number; className?: string; fixed?: "left" | "right"; sortField?: OrderByFieldType | true; onHeaderClick?: () => void; hidden?: boolean; customizedKey?: string | { key: string; defaultValue: boolean; }; onCell?: (data: RowType, index?: number) => React.HTMLAttributes | React.TdHTMLAttributes; } export type TableColumns = Array>; export interface TableSorter { currentOrder: SortOrder; onSortChange: (sortOrder: SortOrder, orderBy: OrderByFieldType | undefined) => void; currentOrderBy?: OrderByFieldType; } export interface TableProps extends Omit, "scroll" | "locale" | "virtual"> { columns: TableColumns; dataSource: RowType[]; /** * Attention: * Use {rowKey: "index"} only if you are certain that the data source is immutable. */ rowKey: StringKey | ((record: RowType, index?: number) => string) | "index"; onRowClick?: (record: RowType, index?: number) => void; scrollX?: string | number; scrollY?: string | number; loading?: boolean; emptyPlaceholder?: React.ReactElement | string | number; emptyIcon?: React.ReactElement | string | number; emptyText?: string; emptyNodeStyle?: React.CSSProperties; sortConfig?: TableSorter; /** * Just adding to props, without any usage, so that it could trigger re-render when it changes. * A similar API is: https://facebook.github.io/react-native/docs/flatlist#extradata */ shouldRenderIfUpdate?: any; /** * key for column customization */ customizedStorageKey?: string; minHeaderHeight?: number; tableRef?: React.Ref; } export declare const Table: (props: TableProps) => React.JSX.Element;