UNPKG

1.92 kBTypeScriptView Raw
1/// <reference types="react" />
2import { TableProps as RcTableProps } from 'rc-table/lib/Table';
3import { SpinProps } from '../spin';
4import { TooltipProps } from '../tooltip';
5import { TableRowSelection, ColumnsType, TableCurrentDataSource, SorterResult, GetPopupContainer, TablePaginationConfig, SortOrder, TableLocale, FilterValue } from './interface';
6import { SizeType } from '../config-provider/SizeContext';
7export { ColumnsType, TablePaginationConfig };
8export interface TableProps<RecordType> extends Omit<RcTableProps<RecordType>, 'transformColumns' | 'internalHooks' | 'internalRefs' | 'data' | 'columns' | 'scroll' | 'emptyText'> {
9 dropdownPrefixCls?: string;
10 dataSource?: RcTableProps<RecordType>['data'];
11 columns?: ColumnsType<RecordType>;
12 pagination?: false | TablePaginationConfig;
13 loading?: boolean | SpinProps;
14 size?: SizeType;
15 bordered?: boolean;
16 locale?: TableLocale;
17 onChange?: (pagination: TablePaginationConfig, filters: Record<string, FilterValue | null>, sorter: SorterResult<RecordType> | SorterResult<RecordType>[], extra: TableCurrentDataSource<RecordType>) => void;
18 rowSelection?: TableRowSelection<RecordType>;
19 getPopupContainer?: GetPopupContainer;
20 scroll?: RcTableProps<RecordType>['scroll'] & {
21 scrollToFirstRowOnChange?: boolean;
22 };
23 sortDirections?: SortOrder[];
24 showSorterTooltip?: boolean | TooltipProps;
25}
26declare function Table<RecordType extends object = any>(props: TableProps<RecordType>): JSX.Element;
27declare namespace Table {
28 var defaultProps: {
29 rowKey: string;
30 };
31 var SELECTION_ALL: "SELECT_ALL";
32 var SELECTION_INVERT: "SELECT_INVERT";
33 var SELECTION_NONE: "SELECT_NONE";
34 var Column: typeof import("./Column").default;
35 var ColumnGroup: typeof import("./ColumnGroup").default;
36 var Summary: typeof import("rc-table/lib/Footer/Summary").default;
37}
38export default Table;