UNPKG

1.72 kBTypeScriptView Raw
1import * as React from 'react';
2
3export class Unstable_StatefulDataTable extends React.Component<any, any> {}
4
5export function AnchorColumn(options: any): any;
6export function BooleanColumn(options: any): any;
7export function CategoricalColumn(options: any): any;
8export function DatetimeColumn(options: any): any;
9export function CustomColumn<ValueT, FilterParamsT>(options: any): any;
10export function NumericalColumn(options: any): any;
11export function StringColumn(options: any): any;
12
13export interface COLUMNS {
14 ANCHOR: 'ANCHOR';
15 CATEGORICAL: 'CATEGORICAL';
16 DATETIME: 'DATETIME';
17 NUMERICAL: 'NUMERICAL';
18 BOOLEAN: 'BOOLEAN';
19 STRING: 'STRING';
20 CUSTOM: 'CUSTOM';
21}
22export const COLUMNS: COLUMNS;
23
24export interface NUMERICAL_FORMATS {
25 DEFAULT: 'DEFAULT';
26 ACCOUNTING: 'ACCOUNTING';
27 PERCENTAGE: 'PERCENTAGE';
28}
29export const NUMERICAL_FORMATS: NUMERICAL_FORMATS;
30
31export interface SORT_DIRECTIONS {
32 ASC: 'ASC';
33 DESC: 'DESC';
34}
35export const SORT_DIRECTIONS: SORT_DIRECTIONS;
36
37export type SortDirectionsT =
38 | SORT_DIRECTIONS['ASC']
39 | SORT_DIRECTIONS['DESC']
40 | null;
41export type ColumnT = any;
42export type RowT = {
43 id: number | string;
44 data: any;
45};
46
47export type BatchActionT = {
48 label: string;
49 onClick: (params: {
50 clearSelection: () => any;
51 event: React.MouseEvent<HTMLButtonElement>;
52 selection: RowT[];
53 }) => any;
54 renderIcon?: any;
55};
56
57export type RowActionT = {
58 label: string;
59 onClick: (params: {
60 event: React.MouseEvent<HTMLButtonElement>;
61 row: RowT;
62 }) => any;
63 renderIcon: any;
64};
65
66export type Props = {
67 batchActions?: BatchActionT[];
68 rowActions?: RowActionT[];
69 columns: ColumnT[];
70 onSelectionChange?: (rows: RowT[]) => any;
71 rows: RowT[];
72};