1 | import * as React from 'react';
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 |
|
18 | export declare type Key = React.Key;
|
19 | export declare type FixedType = 'left' | 'right' | boolean;
|
20 | export declare type DefaultRecordType = Record<string, any>;
|
21 | export declare type TableLayout = 'auto' | 'fixed';
|
22 | export declare type RowClassName<RecordType> = (record: RecordType, index: number, indent: number) => string;
|
23 | export interface CellType<RecordType> {
|
24 | key?: Key;
|
25 | className?: string;
|
26 | style?: React.CSSProperties;
|
27 | children?: React.ReactNode;
|
28 | column?: ColumnsType<RecordType>[number];
|
29 | colSpan?: number;
|
30 | rowSpan?: number;
|
31 |
|
32 | hasSubColumns?: boolean;
|
33 | colStart?: number;
|
34 | colEnd?: number;
|
35 | }
|
36 | export interface RenderedCell<RecordType> {
|
37 | props?: CellType<RecordType>;
|
38 | children?: React.ReactNode;
|
39 | }
|
40 | export declare type DataIndex = string | number | (string | number)[];
|
41 | interface ColumnSharedType<RecordType> {
|
42 | title?: React.ReactNode;
|
43 | key?: Key;
|
44 | className?: string;
|
45 | fixed?: FixedType;
|
46 | onHeaderCell?: GetComponentProps<ColumnsType<RecordType>[number]>;
|
47 | ellipsis?: boolean;
|
48 | align?: AlignType;
|
49 | }
|
50 | export interface ColumnGroupType<RecordType> extends ColumnSharedType<RecordType> {
|
51 | children: ColumnsType<RecordType>;
|
52 | }
|
53 | export declare type AlignType = 'left' | 'center' | 'right';
|
54 | export interface ColumnType<RecordType> extends ColumnSharedType<RecordType> {
|
55 | colSpan?: number;
|
56 | dataIndex?: DataIndex;
|
57 | render?: (value: any, record: RecordType, index: number) => React.ReactNode | RenderedCell<RecordType>;
|
58 | shouldCellUpdate?: (record: RecordType) => boolean;
|
59 | rowSpan?: number;
|
60 | width?: number | string;
|
61 | onCell?: GetComponentProps<RecordType>;
|
62 |
|
63 | onCellClick?: (record: RecordType, e: React.MouseEvent<HTMLElement>) => void;
|
64 | }
|
65 | export declare type ColumnsType<RecordType = unknown> = (ColumnGroupType<RecordType> | ColumnType<RecordType>)[];
|
66 | export declare type GetRowKey<RecordType> = (record: RecordType, index?: number) => Key;
|
67 | export interface StickyOffsets {
|
68 | left: number[];
|
69 | right: number[];
|
70 | }
|
71 | export declare type GetComponentProps<DataType> = (data: DataType, index?: number) => React.HTMLAttributes<HTMLElement>;
|
72 | declare type Component<P> = React.ComponentType<P> | React.ForwardRefExoticComponent<P> | React.FC<P> | keyof React.ReactHTML;
|
73 | export declare type CustomizeComponent = Component<any>;
|
74 | export declare type CustomizeScrollBody<RecordType> = (data: RecordType[], info: {
|
75 | scrollbarSize: number;
|
76 | ref: React.Ref<{
|
77 | scrollLeft: number;
|
78 | }>;
|
79 | onScroll: (info: {
|
80 | currentTarget?: HTMLElement;
|
81 | scrollLeft?: number;
|
82 | }) => void;
|
83 | }) => React.ReactNode;
|
84 | export interface TableComponents<RecordType> {
|
85 | table?: CustomizeComponent;
|
86 | header?: {
|
87 | wrapper?: CustomizeComponent;
|
88 | row?: CustomizeComponent;
|
89 | cell?: CustomizeComponent;
|
90 | };
|
91 | body?: CustomizeScrollBody<RecordType> | {
|
92 | wrapper?: CustomizeComponent;
|
93 | row?: CustomizeComponent;
|
94 | cell?: CustomizeComponent;
|
95 | };
|
96 | }
|
97 | export declare type GetComponent = (path: string[], defaultComponent?: CustomizeComponent) => CustomizeComponent;
|
98 | export declare type ExpandableType = false | 'row' | 'nest';
|
99 | export interface LegacyExpandableProps<RecordType> {
|
100 |
|
101 | expandedRowKeys?: Key[];
|
102 |
|
103 | defaultExpandedRowKeys?: Key[];
|
104 |
|
105 | expandedRowRender?: ExpandedRowRender<RecordType>;
|
106 |
|
107 | expandRowByClick?: boolean;
|
108 |
|
109 | expandIcon?: RenderExpandIcon<RecordType>;
|
110 |
|
111 | onExpand?: (expanded: boolean, record: RecordType) => void;
|
112 |
|
113 | onExpandedRowsChange?: (expandedKeys: Key[]) => void;
|
114 |
|
115 | defaultExpandAllRows?: boolean;
|
116 |
|
117 | indentSize?: number;
|
118 |
|
119 | expandIconColumnIndex?: number;
|
120 |
|
121 | expandedRowClassName?: RowClassName<RecordType>;
|
122 |
|
123 | childrenColumnName?: string;
|
124 | }
|
125 | export declare type ExpandedRowRender<ValueType> = (record: ValueType, index: number, indent: number, expanded: boolean) => React.ReactNode;
|
126 | export interface RenderExpandIconProps<RecordType> {
|
127 | prefixCls: string;
|
128 | expanded: boolean;
|
129 | record: RecordType;
|
130 | expandable: boolean;
|
131 | onExpand: TriggerEventHandler<RecordType>;
|
132 | }
|
133 | export declare type RenderExpandIcon<RecordType> = (props: RenderExpandIconProps<RecordType>) => React.ReactNode;
|
134 | export interface ExpandableConfig<RecordType> extends LegacyExpandableProps<RecordType> {
|
135 | rowExpandable?: (record: RecordType) => boolean;
|
136 | }
|
137 | export declare type PanelRender<RecordType> = (data: RecordType[]) => React.ReactNode;
|
138 | export declare type TriggerEventHandler<RecordType> = (record: RecordType, event: React.MouseEvent<HTMLElement>) => void;
|
139 | export {};
|