1 | import EventEmitter from 'wolfy87-eventemitter';
|
2 | import { View, ViewOptions } from './view';
|
3 | export interface DataSetOptions {
|
4 | state: Record<string, any>;
|
5 | }
|
6 |
|
7 |
|
8 |
|
9 |
|
10 | export declare class DataSet extends EventEmitter {
|
11 | |
12 |
|
13 |
|
14 | static CONSTANTS: {
|
15 | HIERARCHY: string;
|
16 | GEO: string;
|
17 | HEX: string;
|
18 | GRAPH: string;
|
19 | TABLE: string;
|
20 | GEO_GRATICULE: string;
|
21 | STATISTICS_METHODS: string[];
|
22 | };
|
23 | |
24 |
|
25 |
|
26 | static connectors: Record<string, any>;
|
27 | |
28 |
|
29 |
|
30 | static transforms: Record<string, any>;
|
31 | |
32 |
|
33 |
|
34 |
|
35 |
|
36 | static registerConnector(name: string, connector: (data: any, options: any, view: View) => any): void;
|
37 | static getConnector(name: string): Function;
|
38 | |
39 |
|
40 |
|
41 |
|
42 |
|
43 | static registerTransform(name: string, transform: any): void;
|
44 | static getTransform(name?: string): Function;
|
45 | static DataSet: typeof DataSet;
|
46 | static DataView: typeof View;
|
47 | static View: typeof View;
|
48 | static version: string;
|
49 | |
50 |
|
51 |
|
52 | isDataSet: boolean;
|
53 | private _onChangeTimer;
|
54 | |
55 |
|
56 |
|
57 | views: Record<string, View>;
|
58 | |
59 |
|
60 |
|
61 | state: Record<string, any>;
|
62 | |
63 |
|
64 |
|
65 | constructor(initialProps?: DataSetOptions);
|
66 | private _getUniqueViewName;
|
67 | /**
|
68 | * 创建并返回一个数据视图实例
|
69 | * @param name - 数据视图名称
|
70 | * @param options - 视图配置
|
71 | */
|
72 | createView(name: ViewOptions): View;
|
73 | createView(name?: string, options?: ViewOptions): View;
|
74 | /**
|
75 | * 返回 name 对应的数据视图实例
|
76 | * @param name - name
|
77 | */
|
78 | getView(name: string): View;
|
79 | /**
|
80 | * 设置 name 对应的数据视图实例为 dv
|
81 | * @param name - 名称
|
82 | * @param view - data view
|
83 | */
|
84 | setView(name: string, view: View): void;
|
85 | /**
|
86 | * 设置状态量 name 的值为 value
|
87 | * @param name - 状态名
|
88 | * @param value - 值
|
89 | */
|
90 | setState(name: string, value: any): void;
|
91 | }
|