1 | import React, { ReactNode } from 'react';
|
2 | export declare const TABLE_CLASS = "jp-sortable-table";
|
3 |
|
4 |
|
5 |
|
6 | export declare namespace Table {
|
7 | |
8 |
|
9 |
|
10 | interface ISortState {
|
11 | sortKey?: string | null;
|
12 | sortDirection: -1 | 1;
|
13 | }
|
14 | |
15 |
|
16 |
|
17 | interface IOptions<T> extends Partial<ISortState> {
|
18 | rows: IRow<T>[];
|
19 | columns: IColumn<T>[];
|
20 | onRowClick?: React.MouseEventHandler<HTMLTableRowElement>;
|
21 | blankIndicator: () => ReactNode;
|
22 | }
|
23 | |
24 |
|
25 |
|
26 | interface IRow<T> {
|
27 | data: T;
|
28 | key: string;
|
29 | }
|
30 | |
31 |
|
32 |
|
33 | interface IColumn<T> {
|
34 | id: string;
|
35 | label: string;
|
36 | renderCell(data: T): ReactNode;
|
37 | sort(a: T, b: T): number | undefined;
|
38 | isAvailable?(): boolean;
|
39 | isHidden?: boolean;
|
40 | }
|
41 | }
|
42 |
|
43 |
|
44 |
|
45 |
|
46 |
|
47 | export declare function Table<T>(props: Table.IOptions<T>): JSX.Element;
|