UNPKG

1.12 kBTypeScriptView Raw
1import { ComponentChild } from 'preact';
2import Row from './row';
3import { SortConfig } from './view/plugin/sort/sort';
4export declare type ProtoExtends<T, U> = U & Omit<T, keyof U>;
5export declare type OneDArray<T> = T[];
6export declare type TwoDArray<T> = T[][];
7export declare type TCell = number | string | boolean | ComponentChild | HTMLElement;
8export declare type TDataArray = TwoDArray<TCell>;
9export declare type TDataObject = OneDArray<{
10 [key: string]: TCell;
11}>;
12export declare type TData = TDataArray | TDataObject;
13export interface TColumn {
14 id?: string;
15 name: string | ComponentChild;
16 width?: string;
17 sort?: SortConfig;
18 children?: OneDArray<TColumn>;
19 formatter?: (cell: TCell, row: Row, column: TColumn) => ComponentChild;
20}
21export declare type Comparator<T> = (a: T, b: T) => number;
22export interface TColumnSort {
23 index: number;
24 direction?: 1 | -1;
25}
26export declare enum Status {
27 Init = 0,
28 Loading = 1,
29 Loaded = 2,
30 Rendered = 3,
31 Error = 4
32}
33export declare type CSSDeclaration = {
34 [key: string]: string;
35};