1 | import { ComponentChild } from 'preact';
|
2 | import Row from './row';
|
3 | import { SortConfig } from './view/plugin/sort/sort';
|
4 | import { JSXInternal } from 'preact/src/jsx';
|
5 | import { Plugin } from './plugin';
|
6 | export type OneDArray<T> = T[];
|
7 | export type TwoDArray<T> = T[][];
|
8 | export type TCell = number | string | boolean | ComponentChild | HTMLElement;
|
9 | export type TDataArrayRow = OneDArray<TCell>;
|
10 | export type TDataArray = OneDArray<TDataArrayRow>;
|
11 | export type TDataObjectRow = {
|
12 | [key: string]: TCell;
|
13 | };
|
14 | export type TDataObject = OneDArray<TDataObjectRow>;
|
15 | export type TData = TDataArray | TDataObject;
|
16 | export interface TColumn {
|
17 | id?: string;
|
18 | data?: ((row: TDataArrayRow | TDataObjectRow) => TCell) | TCell;
|
19 | name?: string | ComponentChild;
|
20 | plugin?: Plugin<any>;
|
21 | width?: string;
|
22 | minWidth?: string;
|
23 | sort?: SortConfig;
|
24 | columns?: OneDArray<TColumn>;
|
25 | resizable?: boolean;
|
26 | hidden?: boolean;
|
27 | formatter?: (cell: TCell, row: Row, column: TColumn) => ComponentChild;
|
28 | attributes?: ((cell: TCell | null, row: Row | null, column: TColumn) => JSXInternal.HTMLAttributes<HTMLTableCellElement>) | JSXInternal.HTMLAttributes<HTMLTableCellElement>;
|
29 | }
|
30 | export type Comparator<T> = (a: T, b: T) => number;
|
31 | export interface TColumnSort {
|
32 | index: number;
|
33 | direction?: 1 | -1;
|
34 | }
|
35 | export declare enum Status {
|
36 | Init = 0,
|
37 | Loading = 1,
|
38 | Loaded = 2,
|
39 | Rendered = 3,
|
40 | Error = 4
|
41 | }
|
42 | export type CSSDeclaration = {
|
43 | [key: string]: string | number;
|
44 | };
|