exceeddata-sdk-vdata 2.10.5-1 → 2.10.5-2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,546 +1,575 @@
1
- /**
2
- * A seekable reader class for wrapping around byte array when data file has already been
3
- read into byte array.
4
- */
5
- export class VDataByteReader {
6
- /**
7
- * The constructor for seekable byte array reader.
8
- *
9
- * @param {Uint8Array} _uint8array byte array
10
- */
11
- constructor(_uint8array: Uint8Array);
12
- _data: Uint8Array<ArrayBuffer>;
13
- _length: number;
14
- _pos: number;
15
- /**
16
- * Read bytes by the specified length.
17
- *
18
- * @param {number} length
19
- * @returns {Uint8Array}
20
- */
21
- read(length: number): Uint8Array;
22
- /**
23
- * Seek to the target position. If the target position is less than or equals to zero,
24
- * seek to the zero position. If the target position is more than the length of the
25
- * underlying byte array, seek to the end of the byte array.
26
- *
27
- * @param {number} pos the target position
28
- */
29
- seek(pos: number): void;
30
- /**
31
- * Skip the specified length. If the ending position is more than the length of the
32
- * underlying byte array, skip to the end of the byte array.
33
- *
34
- * @param {number} length the length to skip
35
- */
36
- skip(length: number): void;
37
- /**
38
- * Close the reader.
39
- */
40
- close(): void;
41
- }
42
- /**
43
- * A class to read to read and decode data according to format specification.
44
- *
45
- * Examples:
46
- * let reader = factory.open();
47
- * let frame = reader.df();
48
- */
49
- export class VDataReader {
50
- static readInt8(_bytes: any): number;
51
- static readUint16(_bytes: any): number;
52
- static readInt32(_bytes: any): number;
53
- static readLong(_bytes: any): number;
54
- static readInt64(_bytes: any): any;
55
- /**
56
- * Static method to read the metadata info from a seekable reader.
57
- *
58
- * @param {VDataByteReader} _reader the byte reader
59
- * @returns {VDataMeta}
60
- */
61
- static getMeta(_reader: VDataByteReader): VDataMeta;
62
- /**
63
- * The constructor for data reader. Deprecated since 2.7.1. Use VDataReaderFactory instead.
64
- *
65
- * @param {Uint8Array[]} readers seekable byte readers
66
- * @param {string} [signals=null] provide a selected list of signals instead of all signals
67
- * @param {boolean} [insensitiveCase=false] whether to ignore case sensitivity\
68
- * @param {boolean} [queryFilter=true] whether to apply query range filter
69
- * @param {number} [queryStartTime=0] the start time of the query filter (inclusive)
70
- * @param {number} [queryEndTime=0] the end time of the query filter (inclusive)
71
- * @param {boolean} [readLivingData=true] whether to read living (non-finalized) bucket
72
- * @param {string} [columnExpandMode=null] the column expand mode
73
- * @param {string} [signalQueueMode=null] the signal queue mode
74
- */
75
- constructor(readers: Uint8Array[], signals?: string, insensitiveCase?: boolean, queryFilter?: boolean, queryStartTime?: number, queryEndTime?: number, readLivingData?: boolean, columnExpandMode?: string, signalQueueMode?: string, signalDecoders?: any);
76
- _readers: Uint8Array<ArrayBuffer>[];
77
- _columnExpandMode: number;
78
- _signalQueueMode: string;
79
- _frame: VDataFrame;
80
- _decoders: any[];
81
- _livingDataBuffer: number;
82
- _signalDecoders: any;
83
- filterSignals(signals: any): VDataSignalFilter;
84
- /**
85
- * Get the data frame.
86
- *
87
- * @returns {VDataFrame}
88
- */
89
- df(): VDataFrame;
90
- }
91
- /**
92
- * A factory class for building VDataReader.
93
- *
94
- * Examples:
95
- * let uint8arry = new VDataByteReader(new Uint8Array(e.target.result)); //file upload
96
- * let factory = new VDataReaderFactory();
97
- * factory.setDataReaders(uint8arry);
98
- * factory.setSignals(signals);
99
- *
100
- * let reader = factory.open();
101
- */
102
- export class VDataReaderFactory {
103
- _readers: VDataByteReader[];
104
- _signals: string;
105
- _insensitiveCase: boolean;
106
- _readLivingData: boolean;
107
- _queryFilter: boolean;
108
- _queryStartTime: number;
109
- _queryEndTime: number;
110
- _columnExpandMode: any;
111
- _signalQueueMode: string;
112
- _signalDecoders: any;
113
- /**
114
- * Set a list of binary readers to vdata file contents.
115
- *
116
- * @param {VDataByteReader[]} readers array of byte readers
117
- */
118
- setDataReaders(readers: VDataByteReader[]): void;
119
- /**
120
- * Set the list of signals to select from data contents.
121
- *
122
- * @param {string} signals comma-separated string of signal names or prefixes
123
- */
124
- setSignals(signals: string): void;
125
- /**
126
- * Set whether to read signal names as case insensitive. If true, it will read the names as lower-case;
127
- * if false, it will read signal names as recorded in vdata. Default is false.
128
- *
129
- * @param {boolean} insensitiveCase true or false
130
- */
131
- setInsensitiveCase(insensitiveCase: boolean): void;
132
- /**
133
- * Set whether to read vdata's living (not finalized) buckets. Default is true.
134
- *
135
- * @param {boolean} readLiving true or false
136
- */
137
- setReadLivingData(readLiving: boolean): void;
138
- /**
139
- * Set whether to apply query start-end time filter to data contents (including custom start-end
140
- * time and query start-time settings inside data files). Default is true.
141
- *
142
- * @param {boolean} filter true or false
143
- */
144
- setQueryFilter(filter: boolean): void;
145
- /**
146
- * Set whether to apply a custom query start time (inclusive) to data contents. This setting is on
147
- * only if queryFilter is true and this value is non-zero. If on, only signal values with time equal
148
- * to or later than this start time will be output. Default is 0.
149
- *
150
- * @param {number} time millisecond since EPOCH
151
- */
152
- setQueryStartTime(time: number): void;
153
- /**
154
- * Set whether to apply a custom query end time (inclusive) to data contents. This setting is on
155
- * only if queryFilter is true and this value is non-zero. If on, only signal values with time equal
156
- * to or earlier than this end time will be output. Default is 0.
157
- *
158
- * @param {number} time millisecond since EPOCH
159
- */
160
- setQueryEndTime(time: number): void;
161
- /**
162
- * Set the column expand mode for expanding sub-items of complex type signals (array/struct) to individual
163
- * signals. Supported values are 'none', 'flat', 'full'.
164
- *
165
- * 'none' means the complex type signal will be output as array and will not expand to individual sub-items,
166
- * 'flat' means the complex type signal will be expanded to individual sub-items and each sub-item's defined
167
- * name will be used, 'full' means the complex type signal will be expanded to individual sub-items but the
168
- * sub-items will use a qualified naming 'signal_name.sub_name'.
169
- *
170
- * @param {*} mode the column expand mode
171
- */
172
- setColumnExpandMode(mode: any): void;
173
- /**
174
- * Set the queue mode for value triage when there are mutiple values at same time. Supported values are
175
- * 'last', 'first', 'all'.
176
- *
177
- * 'last' means the last-read value is used, 'first' means the first-read value is used, and 'all' means for
178
- * each value read a new row will be generated thereby maintaining all read values in the output.
179
- *
180
- * @param {string} mode the signal queue mode
181
- */
182
- setSignalQueueMode(mode: string): void;
183
- /**
184
- * Set the customer Decoder for blob signals map.
185
- * @param {Map} signalDecoders name to SignalDecoderImplementaion instance for blob
186
- */
187
- setSignalDeocders(signalDecoders: Map): void;
188
- /**
189
- * Create the data reader.
190
- *
191
- * @returns {VDataReader}
192
- */
193
- open(): VDataReader;
194
- }
195
- /**
196
- * A class for two-dimensional tabular data frame that holds signal time-values.
197
- * Column names can be accessed via method cols(), and signal time-values can be
198
- * accessed through methods values(), objects(), sampling(), object1s depending
199
- * on the usage scenario.
200
- *
201
- * Examples:
202
- * let reader = factory.open();
203
- * let frame = reader.df();
204
- * let cols = frame.cols(true);
205
- * let values = frame.objects();
206
- */
207
- export class VDataFrame {
208
- /**
209
- * The constructor for the data frame. It is called via VDataReader.
210
- *
211
- * @param {VDataBucket[]} buckets the list of buckets
212
- * @param {Map} series the map of signal series
213
- * @param {VDataSignalFilter} [signalFilter=null] the signal filter
214
- * @param {string} [columnExpandMode=null] the column expand mode
215
- * @param {string} [signalQueueMode=null] the signal queue mode
216
- */
217
- constructor(buckets: VDataBucket[], series: Map, signalFilter?: VDataSignalFilter, columnExpandMode?: string, signalQueueMode?: string);
218
- _signalFilter: VDataSignalFilter;
219
- _columnExpandMode: number;
220
- _qualifiedExpandName: boolean;
221
- _signalQueueMode: string;
222
- _startTime: number;
223
- _endTime: number;
224
- _buckets: VDataBucket[];
225
- _series: {};
226
- /**
227
- * Get the signal filter.
228
- *
229
- * @returns {VDataSignalFilter}
230
- */
231
- getSignalFilter(): VDataSignalFilter;
232
- /**
233
- * Set the signal filter.
234
- *
235
- * @param {VDataSignalFilter} signalFilter the filter
236
- */
237
- setSignalFilter(signalFilter: VDataSignalFilter): void;
238
- /**
239
- * Get the column expand mode for expanding complex type.
240
- *
241
- * @returns {number}
242
- */
243
- getColumnExpandMode(): number;
244
- /**
245
- * Get the signal queue mode for value triage when there are multiple
246
- * values at the same time.
247
- *
248
- * @returns {string}
249
- */
250
- getColumnExpandMode(): string;
251
- /**
252
- * Set the column expand mode for expanding complex type.
253
- *
254
- * @param {number} mode the expand mode
255
- */
256
- setColumnExpandMode(mode: number): void;
257
- /**
258
- * Set the signal queue mode for value triage when there are multiple
259
- * values at the same time.
260
- *
261
- * @param {string} mode the queue mode
262
- */
263
- setSignalQueueMode(mode: string): void;
264
- /**
265
- * Get the earliest time of signals in the frame. Note that this time may be
266
- * the evenly-split start time of the first bucket and slightly different
267
- * from the actual first signal time.
268
- *
269
- * @returns {number} millisecond since EPOCH
270
- */
271
- getStartTime(): number;
272
- /**
273
- * Set the start time of the frame.
274
- *
275
- * @param {number} time millisecond since EPOCH
276
- */
277
- setStartTime(time: number): void;
278
- /**
279
- * Get the last time of signals in the frame. Note that this time may be
280
- * the evenly-split end time of the last bucket and slightly different
281
- * from the actual last signal time.
282
- *
283
- * @returns {number} millisecond since EPOCH
284
- */
285
- getEndTime(): number;
286
- /**
287
- * Set the end time of the frame.
288
- *
289
- * @param {number} time millisecond since EPOCH
290
- */
291
- setEndTime(time: number): void;
292
- /**
293
- * Get a list of column names. The order of the column names is same as order
294
- * of signal values in each row. To include the time column at first index set
295
- * the includeTime parameter to true.
296
- *
297
- * @param {boolean} [includeTime=false] whether to include time column at first index
298
- * @returns {string[]} array of column names
299
- */
300
- cols(includeTime?: boolean): string[];
301
- /**
302
- * Get a map of all selected signal series.
303
- *
304
- * @returns {Map} map of series by their names
305
- */
306
- series(): Map;
307
- /**
308
- * Get a sorted 2-d array (row-columns) of time and all data values. The values are
309
- * read via a iterator-like processing which is more memory-efficient but consumes
310
- * more CPU. Therefore, this method is suitable for reading data files larger than 10MB.
311
- *
312
- * The first item of each row is time, followed by values.
313
- *
314
- * @param {*} [densifyRowsAhead=0] number of rows to look ahead to fill sparse data
315
- * @param {*} [densifyOutputItv=0] millis interval to down-sample data
316
- * @param {*} [signalQueueRows=0] number of rows to hold in queue for sorting
317
- * @returns {Object[]}
318
- */
319
- values(densifyRowsAhead?: any, densifyOutputItv?: any, signalQueueRows?: any): any[];
320
- put(values: any, poll: any): void;
321
- tut(templateable: any, values: any, poll: any): void;
322
- /**
323
- * Get a sorted 2-d array (row-columns) of time and all data values. The values are
324
- * read all into memory and avoid sorting. It is CPU-efficient but consumes more memory.
325
- * Therefore, this method is suitable for reading data files smaller than 10MB.
326
- *
327
- * The first item of each row is time, followed by values.
328
- *
329
- * @param {*} [densifyRowsAhead=0] number of rows to look ahead to fill sparse data
330
- * @param {*} [densifyOutputItv=0] millis interval to down-sample data
331
- * @returns {Object[]}
332
- */
333
- objects(densifyRowsAhead?: any, densifyOutputItv?: any): any[];
334
- /**
335
- * Return a sorted 2-d array (row-columns) of all data objects at the sampled 1-Hz interval.
336
- *
337
- * The first item of each row is time, followed by values.
338
- *
339
- * @returns {Object[]}
340
- */
341
- object1s(): any[];
342
- /**
343
- * Return a sorted 2-d array (row-columns) of all data objects sampled down to the specified
344
- * frequency in milliseconds. For example, 1-Hz equals a frequency of 1000 (ms).
345
- *
346
- * The first item of each row is time, followed by values.
347
- *
348
- * @param {number} frequency the sampled frequency with value greater than 1
349
- * @returns {Object[]}
350
- */
351
- sampling(frequency: number): any[];
352
- cutoffInterval(time: any, interval: any): any;
353
- }
354
- /**
355
- * A class for the metadata info of data files.
356
- */
357
- export class VDataMeta {
358
- /**
359
- * The constructor for the meta info. For valid values see VData format specification.
360
- *
361
- * @param {number} formatVersion format version
362
- * @param {number} compressMethod compress method
363
- * @param {number} encryptMethod compress method
364
- * @param {number} blocksCount count of bucket blocks in the data
365
- * @param {number} storageStartTime earliest time in the data
366
- * @param {number} storageEndTime last time in the data
367
- * @param {number} queryStartTime start time filter (inclusive) if the data is generated from an algorithm trigger
368
- * @param {number} queryEndTime end time filter (inclusive) if the data is generated from an algorithm trigger
369
- * @param {Uint8Array} extendedInfo extended info whereby implementation may add project-customized information
370
- */
371
- constructor(formatVersion?: number, compressMethod?: number, encryptMethod?: number, blocksCount?: number, storageStartTime?: number, storageEndTime?: number, queryStartTime?: number, queryEndTime?: number, extendedInfo?: Uint8Array, pageSizeCode?: number, keyTypeCode?: number, reserved?: number);
372
- _formatVersion: number;
373
- _compressMethod: number;
374
- _encryptMethod: number;
375
- _blocksCount: number;
376
- _storageStartTime: number;
377
- _storageEndTime: number;
378
- _queryStartTime: number;
379
- _queryEndTime: number;
380
- _extendedInfo: Uint8Array<ArrayBuffer>;
381
- _pageSizeCode: number;
382
- _keyTypeCode: number;
383
- _reserved: number;
384
- /**
385
- * Get the data's format version.
386
- *
387
- * @returns {number}
388
- */
389
- formatVersion(): number;
390
- /**
391
- * Get the data's compress method.
392
- *
393
- * @returns {number}
394
- */
395
- compressMethod(): number;
396
- /**
397
- * Get the data's encryption method.
398
- *
399
- * @returns {number}
400
- */
401
- encryptMethod(): number;
402
- /**
403
- * Get the count of bucket blocks in data.
404
- *
405
- * @returns {number}
406
- */
407
- blocksCount(): number;
408
- /**
409
- * Get the data's earliest signal time (millisecond) in data. Note that this time
410
- * may be the evenly-split starting time of the first bucket and slightly
411
- * different from the actual first signal time.
412
- *
413
- * @returns {number} millisecond since EPOCH
414
- */
415
- storageStartTime(): number;
416
- /**
417
- * Get the data's last signal time (millisecond) in data. Note that this time
418
- * may be the evenly-split ending time of the last bucket. Also in living bucket
419
- * this time may be slightly different from the actual last signal time.
420
- *
421
- * @returns {number} millisecond since EPOCH
422
- */
423
- storageEndTime(): number;
424
- /**
425
- * Get the query start time if the data is generated through an algorithm trigger.
426
- *
427
- * @returns {number} millisecond since EPOCH
428
- */
429
- queryStartTime(): number;
430
- /**
431
- * Get the query end time if the data is generated through an algorithm trigger.
432
- *
433
- * @returns {number} millisecond since EPOCH
434
- */
435
- queryEndTime(): number;
436
- /**
437
- * Get the extended info. Custom-implementation may add contents into this part of
438
- * data buffer.
439
- *
440
- * @returns {Uint8Array}
441
- */
442
- extendedInfo(): Uint8Array;
443
- /**
444
- * Get the page size .
445
- *
446
- * @returns {number} page size in bytes
447
- */
448
- pageSize(): number;
449
- /**
450
- * Get the storage id length .
451
- *
452
- * @returns {number} storage id size in bytes
453
- */
454
- storageIdLength(): number;
455
- /**
456
- * Get the first timestamp length in bits.
457
- *
458
- * @returns {number} first timestamp length in bits
459
- */
460
- seriesTimestampLength(): number;
461
- }
462
- export namespace DExpand {
463
- let NONE: number;
464
- let FLAT: number;
465
- let FULL: number;
466
- }
467
- export class VDataSignalDecoder {
468
- decode(data: any): any;
469
- getSubNames(): string;
470
- getSubValues(object: any): any;
471
- }
472
- /**
473
- * A class for filter conditions on the signal names.
474
- */
475
- declare class VDataSignalFilter {
476
- _signals: any;
477
- _prefixes: any;
478
- _signal_names: any[];
479
- /**
480
- * Get the set of signal names to filter on.
481
- *
482
- * @returns {Set.<string>}
483
- */
484
- getSignals(): Set<string>;
485
- /**
486
- * Set the list of signal names to filter on.
487
- *
488
- * @param {string[]} signals signal names
489
- */
490
- setSignals(signals: string[]): void;
491
- /**
492
- * Get the set of signal prefixes to match on.
493
- *
494
- * @returns Set.<string>
495
- */
496
- getPrefixes(): any;
497
- /**
498
- * Set the list of signal prefixes to match on.
499
- *
500
- * @param {string[]} prefixes signal prefixes
501
- */
502
- setPrefixes(prefixes: string[]): void;
503
- /**
504
- * Get an ordered list of signal names that is same as the order of the signal name filter.
505
- *
506
- * @returns list of names
507
- */
508
- getSignalNames(): any[];
509
- /**
510
- * True if no filter at all, otherwise False.
511
- *
512
- * @returns {boolean}
513
- */
514
- isEmpty(): boolean;
515
- /**
516
- * True if the filter only applies on exact signal name and no prefix matching, False otherwise.
517
- *
518
- * @returns {boolean}
519
- */
520
- hasNameFilterOnly(): boolean;
521
- }
522
- declare class VDataBucket {
523
- startTime: number;
524
- endTime: number;
525
- living: number;
526
- notime: number;
527
- cycle: number;
528
- crc: number;
529
- seriesBuckets: any[];
530
- getStartTime(): number;
531
- setStartTime(time: any): void;
532
- getEndTime(): number;
533
- setEndTime(time: any): void;
534
- getCycle(): number;
535
- setCycle(cycle: any): void;
536
- isLiving(): number;
537
- setLiving(living: any): void;
538
- getCrc(): number;
539
- setCrc(crc: any): void;
540
- setNotime(notime: any): void;
541
- getSeriesBuckets(): any[];
542
- addSeriesBucket(seriesBucket: any): void;
543
- intersects(b: any): boolean;
544
- merge(b: any): this;
545
- }
546
- export {};
1
+ /**
2
+ * A seekable reader class for wrapping around byte array when data file has already been
3
+ read into byte array.
4
+ */
5
+ export class VDataByteReader {
6
+ /**
7
+ * The constructor for seekable byte array reader.
8
+ *
9
+ * @param {Uint8Array} _uint8array byte array
10
+ */
11
+ constructor(_uint8array: Uint8Array);
12
+ _data: Uint8Array<ArrayBufferLike>;
13
+ _length: number;
14
+ _pos: number;
15
+ /**
16
+ * Read bytes by the specified length.
17
+ *
18
+ * @param {number} length
19
+ * @returns {Uint8Array}
20
+ */
21
+ read(length: number): Uint8Array;
22
+ /**
23
+ * Seek to the target position. If the target position is less than or equals to zero,
24
+ * seek to the zero position. If the target position is more than the length of the
25
+ * underlying byte array, seek to the end of the byte array.
26
+ *
27
+ * @param {number} pos the target position
28
+ */
29
+ seek(pos: number): void;
30
+ /**
31
+ * Skip the specified length. If the ending position is more than the length of the
32
+ * underlying byte array, skip to the end of the byte array.
33
+ *
34
+ * @param {number} length the length to skip
35
+ */
36
+ skip(length: number): void;
37
+ /**
38
+ * Close the reader.
39
+ */
40
+ close(): void;
41
+ }
42
+ /**
43
+ * A class to read to read and decode data according to format specification.
44
+ *
45
+ * Examples:
46
+ * let reader = factory.open();
47
+ * let frame = reader.df();
48
+ */
49
+ export class VDataReader {
50
+ static readInt8(_bytes: any): number;
51
+ static readUint16(_bytes: any): number;
52
+ static readInt32(_bytes: any): number;
53
+ static readUInt32(_bytes: any): number;
54
+ static readLong(_bytes: any): number;
55
+ static readInt64(_bytes: any): bigint;
56
+ /**
57
+ * Static method to read the metadata info from a seekable reader.
58
+ *
59
+ * @param {VDataByteReader} _reader the byte reader
60
+ * @returns {VDataMeta}
61
+ */
62
+ static getMeta(_reader: VDataByteReader): VDataMeta;
63
+ /**
64
+ * The constructor for data reader. Deprecated since 2.7.1. Use VDataReaderFactory instead.
65
+ *
66
+ * @param {VDataByteReader[]} readers seekable byte readers
67
+ * @param {string|string[]|Set<string>} [signals=null] provide a selected list of signals instead of all signals
68
+ * @param {boolean} [insensitiveCase=false] whether to ignore case sensitivity\
69
+ * @param {boolean} [queryFilter=true] whether to apply query range filter
70
+ * @param {number} [queryStartTime=0] the start time of the query filter (inclusive)
71
+ * @param {number} [queryEndTime=0] the end time of the query filter (inclusive)
72
+ * @param {boolean} [readLivingData=true] whether to read living (non-finalized) bucket
73
+ * @param {string|number} [columnExpandMode=null] the column expand mode
74
+ * @param {string} [signalQueueMode=null] the signal queue mode
75
+ */
76
+ constructor(readers: VDataByteReader[], signals?: string | string[] | Set<string>, insensitiveCase?: boolean, queryFilter?: boolean, queryStartTime?: number, queryEndTime?: number, readLivingData?: boolean, columnExpandMode?: string | number, signalQueueMode?: string, signalDecoders?: any);
77
+ _readers: VDataByteReader[];
78
+ _columnExpandMode: number;
79
+ _signalQueueMode: string;
80
+ _frame: VDataFrame;
81
+ _decoders: any[];
82
+ _livingDataBuffer: number;
83
+ _signalDecoders: any;
84
+ filterSignals(signals: any): VDataSignalFilter;
85
+ /**
86
+ * Get the data frame.
87
+ *
88
+ * @returns {VDataFrame}
89
+ */
90
+ df(): VDataFrame;
91
+ }
92
+ /**
93
+ * A factory class for building VDataReader.
94
+ *
95
+ * Examples:
96
+ * let uint8arry = new VDataByteReader(new Uint8Array(e.target.result)); //file upload
97
+ * let factory = new VDataReaderFactory();
98
+ * factory.setDataReaders(uint8arry);
99
+ * factory.setSignals(signals);
100
+ *
101
+ * let reader = factory.open();
102
+ */
103
+ export class VDataReaderFactory {
104
+ _readers: VDataByteReader[];
105
+ _signals: string;
106
+ _insensitiveCase: boolean;
107
+ _readLivingData: boolean;
108
+ _queryFilter: boolean;
109
+ _queryStartTime: number;
110
+ _queryEndTime: number;
111
+ _columnExpandMode: any;
112
+ _signalQueueMode: string;
113
+ _signalDecoders: {
114
+ [x: string]: VDataSignalDecoder;
115
+ };
116
+ /**
117
+ * Set a list of binary readers to vdata file contents.
118
+ *
119
+ * @param {VDataByteReader[]} readers array of byte readers
120
+ */
121
+ setDataReaders(readers: VDataByteReader[]): void;
122
+ /**
123
+ * Set the list of signals to select from data contents.
124
+ *
125
+ * @param {string} signals comma-separated string of signal names or prefixes
126
+ */
127
+ setSignals(signals: string): void;
128
+ /**
129
+ * Set whether to read signal names as case insensitive. If true, it will read the names as lower-case;
130
+ * if false, it will read signal names as recorded in vdata. Default is false.
131
+ *
132
+ * @param {boolean} insensitiveCase true or false
133
+ */
134
+ setInsensitiveCase(insensitiveCase: boolean): void;
135
+ /**
136
+ * Set whether to read vdata's living (not finalized) buckets. Default is true.
137
+ *
138
+ * @param {boolean} readLiving true or false
139
+ */
140
+ setReadLivingData(readLiving: boolean): void;
141
+ /**
142
+ * Set whether to apply query start-end time filter to data contents (including custom start-end
143
+ * time and query start-time settings inside data files). Default is true.
144
+ *
145
+ * @param {boolean} filter true or false
146
+ */
147
+ setQueryFilter(filter: boolean): void;
148
+ /**
149
+ * Set whether to apply a custom query start time (inclusive) to data contents. This setting is on
150
+ * only if queryFilter is true and this value is non-zero. If on, only signal values with time equal
151
+ * to or later than this start time will be output. Default is 0.
152
+ *
153
+ * @param {number} time millisecond since EPOCH
154
+ */
155
+ setQueryStartTime(time: number): void;
156
+ /**
157
+ * Set whether to apply a custom query end time (inclusive) to data contents. This setting is on
158
+ * only if queryFilter is true and this value is non-zero. If on, only signal values with time equal
159
+ * to or earlier than this end time will be output. Default is 0.
160
+ *
161
+ * @param {number} time millisecond since EPOCH
162
+ */
163
+ setQueryEndTime(time: number): void;
164
+ /**
165
+ * Set the column expand mode for expanding sub-items of complex type signals (array/struct) to individual
166
+ * signals. Supported values are 'none', 'flat', 'full'.
167
+ *
168
+ * 'none' means the complex type signal will be output as array and will not expand to individual sub-items,
169
+ * 'flat' means the complex type signal will be expanded to individual sub-items and each sub-item's defined
170
+ * name will be used, 'full' means the complex type signal will be expanded to individual sub-items but the
171
+ * sub-items will use a qualified naming 'signal_name.sub_name'.
172
+ *
173
+ * @param {*} mode the column expand mode
174
+ */
175
+ setColumnExpandMode(mode: any): void;
176
+ /**
177
+ * Set the queue mode for value triage when there are mutiple values at same time. Supported values are
178
+ * 'last', 'first', 'all'.
179
+ *
180
+ * 'last' means the last-read value is used, 'first' means the first-read value is used, and 'all' means for
181
+ * each value read a new row will be generated thereby maintaining all read values in the output.
182
+ *
183
+ * @param {string} mode the signal queue mode
184
+ */
185
+ setSignalQueueMode(mode: string): void;
186
+ /**
187
+ * Set the customer Decoder for blob signals map.
188
+ * @param {Object<string, VDataSignalDecoder>} signalDecoders name to SignalDecoderImplementaion instance for blob
189
+ */
190
+ setSignalDeocders(signalDecoders: {
191
+ [x: string]: VDataSignalDecoder;
192
+ }): void;
193
+ /**
194
+ * Create the data reader.
195
+ *
196
+ * @returns {VDataReader}
197
+ */
198
+ open(): VDataReader;
199
+ }
200
+ /**
201
+ * A class for two-dimensional tabular data frame that holds signal time-values.
202
+ * Column names can be accessed via method cols(), and signal time-values can be
203
+ * accessed through methods values(), objects(), sampling(), object1s depending
204
+ * on the usage scenario.
205
+ *
206
+ * Examples:
207
+ * let reader = factory.open();
208
+ * let frame = reader.df();
209
+ * let cols = frame.cols(true);
210
+ * let values = frame.objects();
211
+ */
212
+ export class VDataFrame {
213
+ /**
214
+ * The constructor for the data frame. It is called via VDataReader.
215
+ *
216
+ * @param {VDataBucket[]} buckets the list of buckets
217
+ * @param {Object<string, VDataSeries>} series the map of signal series
218
+ * @param {VDataSignalFilter} [signalFilter=null] the signal filter
219
+ * @param {string|number} [columnExpandMode=null] the column expand mode
220
+ * @param {string} [signalQueueMode=null] the signal queue mode
221
+ */
222
+ constructor(buckets: VDataBucket[], series: {
223
+ [x: string]: VDataSeries;
224
+ }, signalFilter?: VDataSignalFilter, columnExpandMode?: string | number, signalQueueMode?: string);
225
+ _signalFilter: VDataSignalFilter;
226
+ _columnExpandMode: number;
227
+ _qualifiedExpandName: boolean;
228
+ _signalQueueMode: string;
229
+ _startTime: number;
230
+ _endTime: number;
231
+ _buckets: VDataBucket[];
232
+ _series: {};
233
+ /**
234
+ * Get the signal filter.
235
+ *
236
+ * @returns {VDataSignalFilter}
237
+ */
238
+ getSignalFilter(): VDataSignalFilter;
239
+ /**
240
+ * Set the signal filter.
241
+ *
242
+ * @param {VDataSignalFilter} signalFilter the filter
243
+ */
244
+ setSignalFilter(signalFilter: VDataSignalFilter): void;
245
+ /**
246
+ * Get the column expand mode for expanding complex type.
247
+ *
248
+ * @returns {number}
249
+ */
250
+ getColumnExpandMode(): number;
251
+ /**
252
+ * Set the column expand mode for expanding complex type.
253
+ *
254
+ * @param {number} mode the expand mode
255
+ */
256
+ setColumnExpandMode(mode: number): void;
257
+ /**
258
+ * Get the signal queue mode for value triage when there are multiple
259
+ * values at the same time.
260
+ *
261
+ * @returns {string}
262
+ */
263
+ getSignalQueueMode(): string;
264
+ /**
265
+ * Set the signal queue mode for value triage when there are multiple
266
+ * values at the same time.
267
+ *
268
+ * @param {string} mode the queue mode
269
+ */
270
+ setSignalQueueMode(mode: string): void;
271
+ /**
272
+ * Get the earliest time of signals in the frame. Note that this time may be
273
+ * the evenly-split start time of the first bucket and slightly different
274
+ * from the actual first signal time.
275
+ *
276
+ * @returns {number} millisecond since EPOCH
277
+ */
278
+ getStartTime(): number;
279
+ /**
280
+ * Set the start time of the frame.
281
+ *
282
+ * @param {number} time millisecond since EPOCH
283
+ */
284
+ setStartTime(time: number): void;
285
+ /**
286
+ * Get the last time of signals in the frame. Note that this time may be
287
+ * the evenly-split end time of the last bucket and slightly different
288
+ * from the actual last signal time.
289
+ *
290
+ * @returns {number} millisecond since EPOCH
291
+ */
292
+ getEndTime(): number;
293
+ /**
294
+ * Set the end time of the frame.
295
+ *
296
+ * @param {number} time millisecond since EPOCH
297
+ */
298
+ setEndTime(time: number): void;
299
+ /**
300
+ * Get a list of column names. The order of the column names is same as order
301
+ * of signal values in each row. To include the time column at first index set
302
+ * the includeTime parameter to true.
303
+ *
304
+ * @param {boolean} [includeTime=false] whether to include time column at first index
305
+ * @returns {string[]} array of column names
306
+ */
307
+ cols(includeTime?: boolean): string[];
308
+ /**
309
+ * Get a map of all selected signal series.
310
+ *
311
+ * @returns {Object<string, VDataSeries>} map of series by their names
312
+ */
313
+ series(): {
314
+ [x: string]: VDataSeries;
315
+ };
316
+ /**
317
+ * Get a sorted 2-d array (row-columns) of time and all data values. The values are
318
+ * read via a iterator-like processing which is more memory-efficient but consumes
319
+ * more CPU. Therefore, this method is suitable for reading data files larger than 10MB.
320
+ *
321
+ * The first item of each row is time, followed by values.
322
+ *
323
+ * @param {*} [densifyRowsAhead=0] number of rows to look ahead to fill sparse data
324
+ * @param {*} [densifyOutputItv=0] millis interval to down-sample data
325
+ * @param {*} [signalQueueRows=0] number of rows to hold in queue for sorting
326
+ * @returns {Object[]}
327
+ */
328
+ values(densifyRowsAhead?: any, densifyOutputItv?: any, signalQueueRows?: any): any[];
329
+ put(values: any, poll: any): void;
330
+ tut(templateable: any, values: any, poll: any): void;
331
+ /**
332
+ * Get a sorted 2-d array (row-columns) of time and all data values. The values are
333
+ * read all into memory and avoid sorting. It is CPU-efficient but consumes more memory.
334
+ * Therefore, this method is suitable for reading data files smaller than 10MB.
335
+ *
336
+ * The first item of each row is time, followed by values.
337
+ *
338
+ * @param {*} [densifyRowsAhead=0] number of rows to look ahead to fill sparse data
339
+ * @param {*} [densifyOutputItv=0] millis interval to down-sample data
340
+ * @returns {Object[]}
341
+ */
342
+ objects(densifyRowsAhead?: any, densifyOutputItv?: any): any[];
343
+ /**
344
+ * Return a sorted 2-d array (row-columns) of all data objects at the sampled 1-Hz interval.
345
+ *
346
+ * The first item of each row is time, followed by values.
347
+ *
348
+ * @returns {Object[]}
349
+ */
350
+ object1s(): any[];
351
+ /**
352
+ * Return a sorted 2-d array (row-columns) of all data objects sampled down to the specified
353
+ * frequency in milliseconds. For example, 1-Hz equals a frequency of 1000 (ms).
354
+ *
355
+ * The first item of each row is time, followed by values.
356
+ *
357
+ * @param {number} frequency the sampled frequency with value greater than 1
358
+ * @returns {Object[]}
359
+ */
360
+ sampling(frequency: number): any[];
361
+ cutoffInterval(time: any, interval: any): any;
362
+ get [Symbol.toStringTag](): string[];
363
+ }
364
+ /**
365
+ * A class for the metadata info of data files.
366
+ */
367
+ export class VDataMeta {
368
+ /**
369
+ * The constructor for the meta info. For valid values see VData format specification.
370
+ *
371
+ * @param {number} formatVersion format version
372
+ * @param {number} compressMethod compress method
373
+ * @param {number} encryptMethod compress method
374
+ * @param {number} blocksCount count of bucket blocks in the data
375
+ * @param {number} storageStartTime earliest time in the data
376
+ * @param {number} storageEndTime last time in the data
377
+ * @param {number} queryStartTime start time filter (inclusive) if the data is generated from an algorithm trigger
378
+ * @param {number} queryEndTime end time filter (inclusive) if the data is generated from an algorithm trigger
379
+ * @param {Uint8Array} extendedInfo extended info whereby implementation may add project-customized information
380
+ * @param {number} pageSizeCode code for page size
381
+ * @param {number} keyTypeCode the code for key type
382
+ * @param {number} flag the flag code
383
+ */
384
+ constructor(formatVersion?: number, compressMethod?: number, encryptMethod?: number, blocksCount?: number, storageStartTime?: number, storageEndTime?: number, queryStartTime?: number, queryEndTime?: number, extendedInfo?: Uint8Array, pageSizeCode?: number, keyTypeCode?: number, flag?: number);
385
+ _formatVersion: number;
386
+ _compressMethod: number;
387
+ _encryptMethod: number;
388
+ _blocksCount: number;
389
+ _storageStartTime: number;
390
+ _storageEndTime: number;
391
+ _queryStartTime: number;
392
+ _queryEndTime: number;
393
+ _extendedInfo: Uint8Array<ArrayBufferLike>;
394
+ _pageSizeCode: number;
395
+ _keyTypeCode: number;
396
+ _flag: number;
397
+ /**
398
+ * Get the data's format version.
399
+ *
400
+ * @returns {number}
401
+ */
402
+ formatVersion(): number;
403
+ /**
404
+ * Get the data's compress method.
405
+ *
406
+ * @returns {number}
407
+ */
408
+ compressMethod(): number;
409
+ /**
410
+ * Get the data's encryption method.
411
+ *
412
+ * @returns {number}
413
+ */
414
+ encryptMethod(): number;
415
+ /**
416
+ * Get the count of bucket blocks in data.
417
+ *
418
+ * @returns {number}
419
+ */
420
+ blocksCount(): number;
421
+ /**
422
+ * Get the data's earliest signal time (millisecond) in data. Note that this time
423
+ * may be the evenly-split starting time of the first bucket and slightly
424
+ * different from the actual first signal time.
425
+ *
426
+ * @returns {number} millisecond since EPOCH
427
+ */
428
+ storageStartTime(): number;
429
+ /**
430
+ * Get the data's last signal time (millisecond) in data. Note that this time
431
+ * may be the evenly-split ending time of the last bucket. Also in living bucket
432
+ * this time may be slightly different from the actual last signal time.
433
+ *
434
+ * @returns {number} millisecond since EPOCH
435
+ */
436
+ storageEndTime(): number;
437
+ /**
438
+ * Get the query start time if the data is generated through an algorithm trigger.
439
+ *
440
+ * @returns {number} millisecond since EPOCH
441
+ */
442
+ queryStartTime(): number;
443
+ /**
444
+ * Get the query end time if the data is generated through an algorithm trigger.
445
+ *
446
+ * @returns {number} millisecond since EPOCH
447
+ */
448
+ queryEndTime(): number;
449
+ /**
450
+ * Get the extended info. Custom-implementation may add contents into this part of
451
+ * data buffer.
452
+ *
453
+ * @returns {Uint8Array}
454
+ */
455
+ extendedInfo(): Uint8Array;
456
+ /**
457
+ * Get the page size .
458
+ *
459
+ * @returns {number} page size in bytes
460
+ */
461
+ pageSize(): number;
462
+ /**
463
+ * Get the storage id length .
464
+ *
465
+ * @returns {number} storage id size in bytes
466
+ */
467
+ storageIdLength(): number;
468
+ /**
469
+ * Get the first timestamp length in bits.
470
+ *
471
+ * @returns {number} first timestamp length in bits
472
+ */
473
+ seriesTimestampLength(): number;
474
+ }
475
+ export namespace DExpand {
476
+ let NONE: number;
477
+ let FLAT: number;
478
+ let FULL: number;
479
+ }
480
+ export class VDataSignalDecoder {
481
+ decode(data: any): any;
482
+ getSubNames(): string;
483
+ getSubValues(object: any): any;
484
+ }
485
+ /**
486
+ * A class for filter conditions on the signal names.
487
+ */
488
+ declare class VDataSignalFilter {
489
+ _signals: Set<any>;
490
+ _prefixes: Set<any>;
491
+ _signal_names: any[];
492
+ /**
493
+ * Get the set of signal names to filter on.
494
+ *
495
+ * @returns {Set.<string>}
496
+ */
497
+ getSignals(): Set<string>;
498
+ /**
499
+ * Set the list of signal names to filter on.
500
+ *
501
+ * @param {string[]} signals signal names
502
+ */
503
+ setSignals(signals: string[]): void;
504
+ /**
505
+ * Get the set of signal prefixes to match on.
506
+ *
507
+ * @returns Set.<string>
508
+ */
509
+ getPrefixes(): Set<any>;
510
+ /**
511
+ * Set the list of signal prefixes to match on.
512
+ *
513
+ * @param {string[]} prefixes signal prefixes
514
+ */
515
+ setPrefixes(prefixes: string[]): void;
516
+ /**
517
+ * Get an ordered list of signal names that is same as the order of the signal name filter.
518
+ *
519
+ * @returns list of names
520
+ */
521
+ getSignalNames(): any[];
522
+ /**
523
+ * True if no filter at all, otherwise False.
524
+ *
525
+ * @returns {boolean}
526
+ */
527
+ isEmpty(): boolean;
528
+ /**
529
+ * True if the filter only applies on exact signal name and no prefix matching, False otherwise.
530
+ *
531
+ * @returns {boolean}
532
+ */
533
+ hasNameFilterOnly(): boolean;
534
+ }
535
+ declare class VDataBucket {
536
+ startTime: number;
537
+ endTime: number;
538
+ living: number;
539
+ notime: number;
540
+ cycle: number;
541
+ crc: number;
542
+ seriesBuckets: any[];
543
+ getStartTime(): number;
544
+ setStartTime(time: any): void;
545
+ getEndTime(): number;
546
+ setEndTime(time: any): void;
547
+ getCycle(): number;
548
+ setCycle(cycle: any): void;
549
+ isLiving(): number;
550
+ setLiving(living: any): void;
551
+ getCrc(): number;
552
+ setCrc(crc: any): void;
553
+ setNotime(notime: any): void;
554
+ getSeriesBuckets(): any[];
555
+ addSeriesBucket(seriesBucket: any): void;
556
+ intersects(b: any): boolean;
557
+ merge(b: any): this;
558
+ get [Symbol.toStringTag](): string;
559
+ }
560
+ declare class VDataSeries {
561
+ constructor(name: any, buckets?: any, itemCounts?: any);
562
+ _name: any;
563
+ _buckets: any;
564
+ _itemCounts: any;
565
+ name(): any;
566
+ buckets(): any;
567
+ itemCounts(): any;
568
+ numBuckets(): any;
569
+ getMaxBucketItemCount(): number;
570
+ updateBucketItemCounts(bucketNum: any, itemCount: any): void;
571
+ addBucket(bucket: any): void;
572
+ formula(): any;
573
+ get [Symbol.toStringTag](): string;
574
+ }
575
+ export {};