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 { ComponentChild, RefObject } from 'preact';
|
13 | import { EventEmitter } from './util/eventEmitter';
|
14 | import { GridEvents } from './events';
|
15 | export interface Config {
|
16 | eventEmitter: EventEmitter<GridEvents>;
|
17 | dispatcher: Dispatcher<any>;
|
18 |
|
19 | container?: Element;
|
20 |
|
21 | tempRef?: RefObject<HTMLDivElement>;
|
22 | data?: TData | (() => TData) | (() => Promise<TData>);
|
23 | server?: ServerStorageOptions;
|
24 | header?: Header;
|
25 | /** to parse a HTML table and load the data */
|
26 | from: HTMLElement;
|
27 | storage: Storage<any>;
|
28 | pipeline: Pipeline<Tabular>;
|
29 | /** to automatically calculate the columns width */
|
30 | autoWidth: boolean;
|
31 | /** sets the width of the container and table */
|
32 | width: string;
|
33 | search: SearchConfig;
|
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 | td: string;
|
49 | container: string;
|
50 | footer: string;
|
51 | header: string;
|
52 | }>;
|
53 | }
|
54 | interface UserConfigExtend {
|
55 | columns?: OneDArray<TColumn | string | ComponentChild>;
|
56 | search: SearchConfig | boolean;
|
57 | pagination: PaginationConfig | boolean;
|
58 | sort: GenericSortConfig | boolean;
|
59 | language: Language;
|
60 | }
|
61 | export declare type UserConfig = ProtoExtends<Partial<Config>, Partial<UserConfigExtend>>;
|
62 | export declare class Config {
|
63 | private _userConfig;
|
64 | constructor(config?: Partial<Config>);
|
65 | /**
|
66 | * Assigns `updatedConfig` keys to the current config file
|
67 | *
|
68 | * @param updatedConfig
|
69 | */
|
70 | assign(updatedConfig: Partial<Config>): Config;
|
71 | /**
|
72 | * Updates the config from a UserConfig
|
73 | *
|
74 | * @param userConfig
|
75 | */
|
76 | update(userConfig: Partial<UserConfig>): Config;
|
77 | static defaultConfig(): Config;
|
78 | static fromUserConfig(userConfig: UserConfig): Config;
|
79 | }
|
80 | export {};
|
81 |
|
\ | No newline at end of file |