1 | import { CSSDeclaration, OneDArray, ProtoExtends, TColumn, TData } from './types';
|
2 | import Storage from './storage/storage';
|
3 | import Pipeline from './pipeline/pipeline';
|
4 | import Tabular from './tabular';
|
5 | import { SearchConfig } from './view/plugin/search/search';
|
6 | import { PaginationConfig } from './view/plugin/pagination';
|
7 | import Header from './header';
|
8 | import { ServerStorageOptions } from './storage/server';
|
9 | import Dispatcher from './util/dispatcher';
|
10 | import { GenericSortConfig } from './view/plugin/sort/sort';
|
11 | import { Language, Translator } from './i18n/language';
|
12 | import { Component, ComponentChild, RefObject } from 'preact';
|
13 | import { EventEmitter } from './util/eventEmitter';
|
14 | import { GridEvents } from './events';
|
15 | import { PluginManager, Plugin } from './plugin';
|
16 | import Grid from './grid';
|
17 | export interface Config {
|
18 | instance: Grid;
|
19 | eventEmitter: EventEmitter<GridEvents>;
|
20 | dispatcher: Dispatcher<any>;
|
21 | plugin: PluginManager;
|
22 | container?: Element;
|
23 | tableRef?: RefObject<Component>;
|
24 | tempRef?: RefObject<HTMLDivElement>;
|
25 | data?: TData | (() => TData) | (() => Promise<TData>);
|
26 | server?: ServerStorageOptions;
|
27 | header?: Header;
|
28 | from: HTMLElement;
|
29 | storage: Storage<any>;
|
30 | pipeline: Pipeline<Tabular>;
|
31 | autoWidth: boolean;
|
32 | width: string;
|
33 | height: string;
|
34 | pagination: PaginationConfig;
|
35 | sort: GenericSortConfig;
|
36 | translator: Translator;
|
37 | style?: Partial<{
|
38 | table: CSSDeclaration;
|
39 | td: CSSDeclaration;
|
40 | th: CSSDeclaration;
|
41 | container: CSSDeclaration;
|
42 | header: CSSDeclaration;
|
43 | footer: CSSDeclaration;
|
44 | }>;
|
45 | className?: Partial<{
|
46 | table: string;
|
47 | th: string;
|
48 | thead: string;
|
49 | tbody: string;
|
50 | tr: string;
|
51 | td: string;
|
52 | container: string;
|
53 | footer: string;
|
54 | header: string;
|
55 | search: string;
|
56 | sort: string;
|
57 | pagination: string;
|
58 | paginationSummary: string;
|
59 | paginationButton: string;
|
60 | paginationButtonNext: string;
|
61 | paginationButtonCurrent: string;
|
62 | paginationButtonPrev: string;
|
63 | loading: string;
|
64 | notfound: string;
|
65 | error: string;
|
66 | }>;
|
67 | }
|
68 | interface UserConfigExtend {
|
69 | fixedHeader: boolean;
|
70 | resizable: boolean;
|
71 | columns: OneDArray<TColumn | string | ComponentChild>;
|
72 | search: SearchConfig | boolean;
|
73 | pagination: PaginationConfig | boolean;
|
74 | sort: GenericSortConfig | boolean;
|
75 | language: Language;
|
76 | plugins?: Plugin<any>[];
|
77 | }
|
78 | export declare type UserConfig = ProtoExtends<Partial<Config>, Partial<UserConfigExtend>>;
|
79 | export declare class Config {
|
80 | private _userConfig;
|
81 | constructor(config?: Partial<Config>);
|
82 | assign(updatedConfig: Partial<Config>): Config;
|
83 | update(userConfig: Partial<UserConfig>): Config;
|
84 | static defaultConfig(): Config;
|
85 | static fromUserConfig(userConfig: UserConfig): Config;
|
86 | }
|
87 | export {};
|
88 |
|
\ | No newline at end of file |