1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 | export declare interface Action {
|
12 | type: ActionType;
|
13 | field: string | null;
|
14 | as: string | null;
|
15 | options?: FillNullOptions;
|
16 | }
|
17 |
|
18 |
|
19 |
|
20 |
|
21 | export declare type ActionType = AggregationType | ConversionType | FillType;
|
22 |
|
23 |
|
24 |
|
25 |
|
26 |
|
27 |
|
28 |
|
29 |
|
30 | export declare function aggregate(rows: RowData[], options: AggregateParams): RowData[];
|
31 |
|
32 |
|
33 |
|
34 |
|
35 | export declare interface AggregateParams {
|
36 | as: string[];
|
37 | fields?: string[];
|
38 | groupBy?: string | string[];
|
39 | op: Operations[];
|
40 | }
|
41 |
|
42 |
|
43 |
|
44 |
|
45 | export declare const AGGREGATION: ["sum", "max", "min", "average", "avg", "median", "count", "distinct", "countd"];
|
46 |
|
47 |
|
48 |
|
49 |
|
50 | export declare type AggregationType = typeof AGGREGATION[number];
|
51 |
|
52 |
|
53 |
|
54 |
|
55 | export declare function autoSchema(data: RowData[], renameOption?: RenameOption): TransformSchema[];
|
56 |
|
57 |
|
58 |
|
59 |
|
60 | export declare function autoTransform(data: RowData[], renameOption?: RenameOption): AutoTransformResult;
|
61 |
|
62 |
|
63 |
|
64 |
|
65 | export declare interface AutoTransformResult {
|
66 | result: RowData;
|
67 | schemas: TransformSchema[];
|
68 | }
|
69 |
|
70 |
|
71 |
|
72 |
|
73 | export declare const CONVERSION: ["toString", "toFloat", "toInt"];
|
74 |
|
75 |
|
76 |
|
77 |
|
78 | export declare type ConversionType = typeof CONVERSION[number];
|
79 |
|
80 |
|
81 |
|
82 |
|
83 | export declare const FILL: ["fillNull", "removeNull"];
|
84 |
|
85 |
|
86 |
|
87 |
|
88 | export declare type FillNullOptions = FillNullOptionsBySmart | FillNullOptionsByAgg | FillNullOptionsByValue;
|
89 |
|
90 |
|
91 |
|
92 |
|
93 | export declare interface FillNullOptionsByAgg {
|
94 | type: Extract<FillNullType, 'byAgg'>;
|
95 | cfg: {
|
96 | agg: AggregationType;
|
97 | };
|
98 | }
|
99 |
|
100 |
|
101 |
|
102 |
|
103 | export declare interface FillNullOptionsBySmart {
|
104 | type: Extract<FillNullType, 'bySmart'>;
|
105 | }
|
106 |
|
107 |
|
108 |
|
109 |
|
110 | export declare interface FillNullOptionsByValue {
|
111 | type: Extract<FillNullType, 'byValue'>;
|
112 | cfg: {
|
113 | value: string | number;
|
114 | };
|
115 | }
|
116 |
|
117 |
|
118 |
|
119 |
|
120 | export declare type FillNullType = 'bySmart' | 'byAgg' | 'byValue';
|
121 |
|
122 |
|
123 |
|
124 |
|
125 | export declare type FillType = typeof FILL[number];
|
126 |
|
127 |
|
128 |
|
129 |
|
130 |
|
131 | export declare type Operations = 'sum' | 'average' | 'avg' | 'mean' | 'min' | 'max' | 'median' | 'variance' | 'stdevp' | 'stdev' | 'mode' | 'product' | 'count' | 'distinct' | 'countd' | 'valid';
|
132 |
|
133 |
|
134 |
|
135 |
|
136 | export declare function parse(data: RowData[], schemas: TransformSchema | TransformSchema[]): RowData[];
|
137 |
|
138 |
|
139 |
|
140 |
|
141 | export declare type RenameOption = boolean | 'origin' | 'brackets' | 'underline' | Function;
|
142 |
|
143 |
|
144 |
|
145 |
|
146 |
|
147 | export declare type RowData = Record<string, any>;
|
148 |
|
149 |
|
150 |
|
151 |
|
152 | export declare interface TransformSchema {
|
153 | groupBy?: string[];
|
154 | actions: Action[];
|
155 | }
|
156 |
|
157 | export { }
|