@deephaven/jsapi-types 1.0.0-dev0.39.1 → 1.0.0-dev0.39.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.
- package/dist/index.d.ts +1937 -1901
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -32,6 +32,22 @@ export namespace dh.storage {
|
|
|
32
32
|
get dirname():string;
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
+
/**
|
|
36
|
+
* Represents a file's contents loaded from the server. If an etag was specified when loading, client should first test
|
|
37
|
+
* if the etag of this instance matches - if so, the contents will be empty, and the client's existing contents should
|
|
38
|
+
* be used.
|
|
39
|
+
*/
|
|
40
|
+
export class FileContents {
|
|
41
|
+
protected constructor();
|
|
42
|
+
|
|
43
|
+
static blob(blob:Blob):FileContents;
|
|
44
|
+
static text(...text:string[]):FileContents;
|
|
45
|
+
static arrayBuffers(...buffers:ArrayBuffer[]):FileContents;
|
|
46
|
+
text():Promise<string>;
|
|
47
|
+
arrayBuffer():Promise<ArrayBuffer>;
|
|
48
|
+
get etag():string;
|
|
49
|
+
}
|
|
50
|
+
|
|
35
51
|
/**
|
|
36
52
|
* Remote service to read and write files on the server. Paths use "/" as a separator, and should not start with "/".
|
|
37
53
|
*/
|
|
@@ -90,22 +106,6 @@ export namespace dh.storage {
|
|
|
90
106
|
createDirectory(path:string):Promise<void>;
|
|
91
107
|
}
|
|
92
108
|
|
|
93
|
-
/**
|
|
94
|
-
* Represents a file's contents loaded from the server. If an etag was specified when loading, client should first test
|
|
95
|
-
* if the etag of this instance matches - if so, the contents will be empty, and the client's existing contents should
|
|
96
|
-
* be used.
|
|
97
|
-
*/
|
|
98
|
-
export class FileContents {
|
|
99
|
-
protected constructor();
|
|
100
|
-
|
|
101
|
-
static blob(blob:Blob):FileContents;
|
|
102
|
-
static text(...text:string[]):FileContents;
|
|
103
|
-
static arrayBuffers(...buffers:ArrayBuffer[]):FileContents;
|
|
104
|
-
text():Promise<string>;
|
|
105
|
-
arrayBuffer():Promise<ArrayBuffer>;
|
|
106
|
-
get etag():string;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
109
|
|
|
110
110
|
type ItemTypeType = string;
|
|
111
111
|
export class ItemType {
|
|
@@ -118,56 +118,60 @@ export namespace dh.storage {
|
|
|
118
118
|
export namespace dh {
|
|
119
119
|
|
|
120
120
|
/**
|
|
121
|
-
* Similar to
|
|
122
|
-
* the
|
|
121
|
+
* Similar to the browser `CustomEvent` type, this class holds only the type of the event, and optionally some
|
|
122
|
+
* details about the event.
|
|
123
|
+
* @typeParam T - the type of the event detail
|
|
123
124
|
*/
|
|
124
|
-
export interface
|
|
125
|
-
get(
|
|
126
|
-
|
|
127
|
-
getFormat(index:LongWrapper|number, column:Column):Format;
|
|
128
|
-
get treeSize():number;
|
|
129
|
-
/**
|
|
130
|
-
* The position of the first returned row within the tree.
|
|
131
|
-
*/
|
|
132
|
-
get offset():number;
|
|
133
|
-
get columns():Array<Column>;
|
|
134
|
-
get rows():Array<TreeRow>;
|
|
135
|
-
}
|
|
136
|
-
export interface RefreshToken {
|
|
137
|
-
get bytes():string;
|
|
138
|
-
get expiry():number;
|
|
125
|
+
export interface Event<T> {
|
|
126
|
+
get detail():T;
|
|
127
|
+
get type():string;
|
|
139
128
|
}
|
|
140
129
|
/**
|
|
141
|
-
* Represents
|
|
142
|
-
* used, if {@link fetch} is not called on this object, then {@link close} must be to ensure server-side resources
|
|
143
|
-
* are correctly freed.
|
|
130
|
+
* Represents statistics for a given table column.
|
|
144
131
|
*/
|
|
145
|
-
export interface
|
|
132
|
+
export interface ColumnStatistics {
|
|
146
133
|
/**
|
|
147
|
-
*
|
|
148
|
-
*
|
|
149
|
-
*
|
|
150
|
-
* @
|
|
134
|
+
* Gets the type of formatting that should be used for given statistic.
|
|
135
|
+
* <p>
|
|
136
|
+
* the format type for a statistic. A null return value means that the column formatting should be used.
|
|
137
|
+
* @param name - the display name of the statistic
|
|
138
|
+
* @return String
|
|
151
139
|
*/
|
|
152
|
-
|
|
153
|
-
|
|
140
|
+
getType(name:string):string;
|
|
154
141
|
/**
|
|
155
|
-
*
|
|
156
|
-
*
|
|
157
|
-
*
|
|
142
|
+
* Gets a map with the name of each unique value as key and the count as the value. A map of each unique value's
|
|
143
|
+
* name to the count of how many times it occurred in the column. This map will be empty for tables containing more
|
|
144
|
+
* than 19 unique values.
|
|
145
|
+
* @return Map of String double
|
|
158
146
|
*/
|
|
159
|
-
|
|
147
|
+
get uniqueValues():Map<string, number>;
|
|
160
148
|
/**
|
|
161
|
-
*
|
|
162
|
-
*
|
|
163
|
-
*
|
|
149
|
+
* Gets a map with the display name of statistics as keys and the numeric stat as a value.
|
|
150
|
+
* <p>
|
|
151
|
+
* A map of each statistic's name to its value.
|
|
152
|
+
* @return Map of String and Object
|
|
164
153
|
*/
|
|
165
|
-
|
|
154
|
+
get statisticsMap():Map<string, object>;
|
|
155
|
+
}
|
|
156
|
+
export interface HasEventHandling {
|
|
166
157
|
/**
|
|
167
|
-
*
|
|
168
|
-
*
|
|
158
|
+
* Listen for events on this object.
|
|
159
|
+
* @param name - the name of the event to listen for
|
|
160
|
+
* @param callback - a function to call when the event occurs
|
|
161
|
+
* @return Returns a cleanup function.
|
|
162
|
+
* @typeParam T - the type of the data that the event will provide
|
|
169
163
|
*/
|
|
170
|
-
|
|
164
|
+
addEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):()=>void;
|
|
165
|
+
nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<Event<T>>;
|
|
166
|
+
hasListeners(name:string):boolean;
|
|
167
|
+
/**
|
|
168
|
+
* Removes an event listener added to this table.
|
|
169
|
+
* @param name -
|
|
170
|
+
* @param callback -
|
|
171
|
+
* @return
|
|
172
|
+
* @typeParam T -
|
|
173
|
+
*/
|
|
174
|
+
removeEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):boolean;
|
|
171
175
|
}
|
|
172
176
|
export interface WorkerHeapInfo {
|
|
173
177
|
/**
|
|
@@ -205,66 +209,36 @@ export namespace dh {
|
|
|
205
209
|
get index():LongWrapper;
|
|
206
210
|
}
|
|
207
211
|
/**
|
|
208
|
-
*
|
|
209
|
-
*
|
|
210
|
-
*
|
|
211
|
-
*
|
|
212
|
-
*
|
|
213
|
-
*
|
|
212
|
+
* Represents the contents of a single widget data message from the server, with a binary data paylod and exported
|
|
213
|
+
* objects. Implemented both by Widget itself and by the `event.details` when data is received by the client.
|
|
214
|
+
*
|
|
215
|
+
* Terminology note: the name of this type should probably use "Data" instead of "Message", and the methods should use
|
|
216
|
+
* "payload" rather than "data" to match other platforms and the protobuf itself. These names are instead used for
|
|
217
|
+
* backwards compatibility and to better follow JS expectations.
|
|
214
218
|
*/
|
|
215
|
-
export interface
|
|
219
|
+
export interface WidgetMessageDetails {
|
|
216
220
|
/**
|
|
217
|
-
*
|
|
218
|
-
* @param index - the position or key to access
|
|
219
|
-
* @return the row at the given location
|
|
221
|
+
* Returns the data from this message as a base64-encoded string.
|
|
220
222
|
*/
|
|
221
|
-
|
|
223
|
+
getDataAsBase64():string;
|
|
222
224
|
/**
|
|
223
|
-
*
|
|
224
|
-
* @param index - the row in the table to get data from
|
|
225
|
-
* @param column - the column to read
|
|
226
|
-
* @return the value in the table
|
|
225
|
+
* Returns the data from this message as a Uint8Array.
|
|
227
226
|
*/
|
|
228
|
-
|
|
227
|
+
getDataAsU8():Uint8Array;
|
|
229
228
|
/**
|
|
230
|
-
*
|
|
231
|
-
* @param index - the row to read
|
|
232
|
-
* @param column - the column to read
|
|
233
|
-
* @return a Format instance with any server-specified details
|
|
229
|
+
* Returns the data from this message as a utf-8 string.
|
|
234
230
|
*/
|
|
235
|
-
|
|
236
|
-
get columns():Array<Column>;
|
|
231
|
+
getDataAsString():string;
|
|
237
232
|
/**
|
|
238
|
-
*
|
|
233
|
+
* Returns an array of exported objects sent from the server. The plugin implementation is now responsible for these
|
|
234
|
+
* objects, and should close them when no longer needed.
|
|
239
235
|
*/
|
|
240
|
-
get
|
|
236
|
+
get exportedObjects():WidgetExportedObject[];
|
|
241
237
|
}
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
/**
|
|
247
|
-
* Gets the type of formatting that should be used for given statistic.
|
|
248
|
-
* <p>
|
|
249
|
-
* the format type for a statistic. A null return value means that the column formatting should be used.
|
|
250
|
-
* @param name - the display name of the statistic
|
|
251
|
-
* @return String
|
|
252
|
-
*/
|
|
253
|
-
getType(name:string):string;
|
|
254
|
-
/**
|
|
255
|
-
* Gets a map with the name of each unique value as key and the count as the value. A map of each unique value's
|
|
256
|
-
* name to the count of how many times it occurred in the column. This map will be empty for tables containing more
|
|
257
|
-
* than 19 unique values.
|
|
258
|
-
* @return Map of String double
|
|
259
|
-
*/
|
|
260
|
-
get uniqueValues():Map<string, number>;
|
|
261
|
-
/**
|
|
262
|
-
* Gets a map with the display name of statistics as keys and the numeric stat as a value.
|
|
263
|
-
* <p>
|
|
264
|
-
* A map of each statistic's name to its value.
|
|
265
|
-
* @return Map of String and Object
|
|
266
|
-
*/
|
|
267
|
-
get statisticsMap():Map<string, object>;
|
|
238
|
+
export interface ColumnGroup {
|
|
239
|
+
get name():string|null;
|
|
240
|
+
get children():string[]|null;
|
|
241
|
+
get color():string|null;
|
|
268
242
|
}
|
|
269
243
|
/**
|
|
270
244
|
* This object may be pooled internally or discarded and not updated. Do not retain references to it.
|
|
@@ -292,133 +266,45 @@ export namespace dh {
|
|
|
292
266
|
readonly numberFormat?:string|null;
|
|
293
267
|
}
|
|
294
268
|
/**
|
|
295
|
-
*
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
*
|
|
306
|
-
*
|
|
307
|
-
*
|
|
308
|
-
* Terminology note: the name of this type should probably use "Data" instead of "Message", and the methods should use
|
|
309
|
-
* "payload" rather than "data" to match other platforms and the protobuf itself. These names are instead used for
|
|
310
|
-
* backwards compatibility and to better follow JS expectations.
|
|
269
|
+
* Event data, describing the indexes that were added/removed/updated, and providing access to Rows (and thus data in
|
|
270
|
+
* columns) either by index, or scanning the complete present index.
|
|
271
|
+
* <p>
|
|
272
|
+
* This class supports two ways of reading the table - checking the changes made since the last update, and reading all
|
|
273
|
+
* data currently in the table. While it is more expensive to always iterate over every single row in the table, it may
|
|
274
|
+
* in some cases actually be cheaper than maintaining state separately and updating only the changes, though both
|
|
275
|
+
* options should be considered.
|
|
276
|
+
* <p>
|
|
277
|
+
* The RangeSet objects allow iterating over the LongWrapper indexes in the table. Note that these "indexes" are not
|
|
278
|
+
* necessarily contiguous and may be negative, and represent some internal state on the server, allowing it to keep
|
|
279
|
+
* track of data efficiently. Those LongWrapper objects can be passed to the various methods on this instance to read
|
|
280
|
+
* specific rows or cells out of the table.
|
|
311
281
|
*/
|
|
312
|
-
export interface
|
|
282
|
+
export interface SubscriptionTableData extends TableData {
|
|
283
|
+
get fullIndex():RangeSet;
|
|
313
284
|
/**
|
|
314
|
-
*
|
|
285
|
+
* The ordered set of row indexes removed since the last update
|
|
286
|
+
* @return the rangeset of removed rows
|
|
315
287
|
*/
|
|
316
|
-
|
|
288
|
+
get removed():RangeSet;
|
|
317
289
|
/**
|
|
318
|
-
*
|
|
290
|
+
* The ordered set of row indexes added since the last update.
|
|
291
|
+
* @return the rangeset of rows added
|
|
319
292
|
*/
|
|
320
|
-
|
|
293
|
+
get added():RangeSet;
|
|
294
|
+
get columns():Array<Column>;
|
|
321
295
|
/**
|
|
322
|
-
*
|
|
296
|
+
* The ordered set of row indexes updated since the last update
|
|
297
|
+
* @return the rnageset of modified rows
|
|
323
298
|
*/
|
|
324
|
-
|
|
299
|
+
get modified():RangeSet;
|
|
325
300
|
/**
|
|
326
|
-
*
|
|
327
|
-
* objects, and should close them when no longer needed.
|
|
301
|
+
* A lazily computed array of all rows available on the client.
|
|
328
302
|
*/
|
|
329
|
-
get
|
|
330
|
-
}
|
|
331
|
-
/**
|
|
332
|
-
* Similar to the browser `CustomEvent` type, this class holds only the type of the event, and optionally some
|
|
333
|
-
* details about the event.
|
|
334
|
-
* @typeParam T - the type of the event detail
|
|
335
|
-
*/
|
|
336
|
-
export interface Event<T> {
|
|
337
|
-
get detail():T;
|
|
338
|
-
get type():string;
|
|
303
|
+
get rows():Array<Row>;
|
|
339
304
|
}
|
|
340
|
-
export interface
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
get hiddenColumns():string[]|null;
|
|
344
|
-
get frozenColumns():string[]|null;
|
|
345
|
-
get columnGroups():ColumnGroup[]|null;
|
|
346
|
-
get areSavedLayoutsAllowed():boolean;
|
|
347
|
-
get frontColumns():string[]|null;
|
|
348
|
-
get backColumns():string[]|null;
|
|
349
|
-
}
|
|
350
|
-
/**
|
|
351
|
-
* This object may be pooled internally or discarded and not updated. Do not retain references to it. Instead,
|
|
352
|
-
* request the viewport again.
|
|
353
|
-
*/
|
|
354
|
-
export interface ViewportRow extends Row {
|
|
355
|
-
get(column:Column):any;
|
|
356
|
-
getFormat(column:Column):Format;
|
|
357
|
-
get index():LongWrapper;
|
|
358
|
-
}
|
|
359
|
-
/**
|
|
360
|
-
* Represents a row available in a subscription/snapshot on the client. Do not retain references to rows - they will
|
|
361
|
-
* not function properly when the event isn't actively going off (or promise resolving). Instead, wait for the next
|
|
362
|
-
* event, or re-request the viewport data.
|
|
363
|
-
*/
|
|
364
|
-
export interface Row {
|
|
365
|
-
get(column:Column):any;
|
|
366
|
-
getFormat(column:Column):Format;
|
|
367
|
-
get index():LongWrapper;
|
|
368
|
-
}
|
|
369
|
-
/**
|
|
370
|
-
* Wrap LocalTime values for use in JS. Provides text formatting for display and access to the underlying value.
|
|
371
|
-
*/
|
|
372
|
-
export interface LocalTimeWrapper {
|
|
373
|
-
valueOf():string;
|
|
374
|
-
getHour():number;
|
|
375
|
-
getMinute():number;
|
|
376
|
-
getSecond():number;
|
|
377
|
-
getNano():number;
|
|
378
|
-
toString():string;
|
|
379
|
-
}
|
|
380
|
-
/**
|
|
381
|
-
* Extends {@link dh.TableData}, but only contains data in the current viewport. The only API change from TableData is that
|
|
382
|
-
* ViewportData also contains the offset to this data, so that the actual row number may be determined.
|
|
383
|
-
* <p>
|
|
384
|
-
* For viewport subscriptions, it is not necessary to read with the key, only with the position.
|
|
385
|
-
* <p>
|
|
386
|
-
* Do not assume that the first row in `rows` is the first visible row, because extra rows may be provided for easier
|
|
387
|
-
* scrolling without going to the server.
|
|
388
|
-
*/
|
|
389
|
-
export interface ViewportData extends TableData {
|
|
390
|
-
/**
|
|
391
|
-
* Reads a row object from the viewport, based on its position in the table.
|
|
392
|
-
*/
|
|
393
|
-
get(index:LongWrapper|number):ViewportRow;
|
|
394
|
-
getData(index:LongWrapper|number, column:Column):any;
|
|
395
|
-
getFormat(index:LongWrapper|number, column:Column):Format;
|
|
396
|
-
/**
|
|
397
|
-
* The position of the first returned row within the table.
|
|
398
|
-
*/
|
|
399
|
-
get offset():number;
|
|
400
|
-
get columns():Array<Column>;
|
|
401
|
-
get rows():Array<ViewportRow>;
|
|
402
|
-
}
|
|
403
|
-
export interface HasEventHandling {
|
|
404
|
-
/**
|
|
405
|
-
* Listen for events on this object.
|
|
406
|
-
* @param name - the name of the event to listen for
|
|
407
|
-
* @param callback - a function to call when the event occurs
|
|
408
|
-
* @return Returns a cleanup function.
|
|
409
|
-
* @typeParam T - the type of the data that the event will provide
|
|
410
|
-
*/
|
|
411
|
-
addEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):()=>void;
|
|
412
|
-
nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<Event<T>>;
|
|
413
|
-
hasListeners(name:string):boolean;
|
|
414
|
-
/**
|
|
415
|
-
* Removes an event listener added to this table.
|
|
416
|
-
* @param name -
|
|
417
|
-
* @param callback -
|
|
418
|
-
* @return
|
|
419
|
-
* @typeParam T -
|
|
420
|
-
*/
|
|
421
|
-
removeEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):boolean;
|
|
305
|
+
export interface RefreshToken {
|
|
306
|
+
get bytes():string;
|
|
307
|
+
get expiry():number;
|
|
422
308
|
}
|
|
423
309
|
/**
|
|
424
310
|
* Represents a table which can be joined to another table. Current implementations are {@link dh.Table} and
|
|
@@ -510,6 +396,104 @@ export namespace dh {
|
|
|
510
396
|
naturalJoin(rightTable:JoinableTable, columnsToMatch:Array<string>, columnsToAdd?:Array<string>|undefined|null):Promise<Table>;
|
|
511
397
|
}
|
|
512
398
|
/**
|
|
399
|
+
* Similar to {@link dh.ViewportData}, but with additional properties to reflect
|
|
400
|
+
* the tree structure.
|
|
401
|
+
*/
|
|
402
|
+
export interface TreeViewportData extends TableData {
|
|
403
|
+
get(index:LongWrapper|number):TreeRow;
|
|
404
|
+
getData(index:LongWrapper|number, column:Column):any;
|
|
405
|
+
getFormat(index:LongWrapper|number, column:Column):Format;
|
|
406
|
+
get treeSize():number;
|
|
407
|
+
/**
|
|
408
|
+
* The position of the first returned row within the tree.
|
|
409
|
+
*/
|
|
410
|
+
get offset():number;
|
|
411
|
+
get columns():Array<Column>;
|
|
412
|
+
get rows():Array<TreeRow>;
|
|
413
|
+
}
|
|
414
|
+
/**
|
|
415
|
+
* Represents a server-side object that may not yet have been fetched by the client. When this object will no longer be
|
|
416
|
+
* used, if {@link fetch} is not called on this object, then {@link close} must be to ensure server-side resources
|
|
417
|
+
* are correctly freed.
|
|
418
|
+
*/
|
|
419
|
+
export interface WidgetExportedObject {
|
|
420
|
+
/**
|
|
421
|
+
* Returns the type of this export, typically one of {@link dh.VariableType}, but may also include plugin types. If
|
|
422
|
+
* null, this object cannot be fetched, but can be passed to the server, such as via
|
|
423
|
+
* {@link Widget.sendMessage}.
|
|
424
|
+
* @return the string type of this server-side object, or null.
|
|
425
|
+
*/
|
|
426
|
+
readonly type?:string|null;
|
|
427
|
+
|
|
428
|
+
/**
|
|
429
|
+
* Exports another copy of this reference, allowing it to be fetched separately. Results in rejection if the ticket
|
|
430
|
+
* was already closed (either by calling {@link WidgetExportedObject.close} or closing the object returned from {@link WidgetExportedObject.fetch}).
|
|
431
|
+
* @return a promise returning a reexported copy of this object, still referencing the same server-side object.
|
|
432
|
+
*/
|
|
433
|
+
reexport():Promise<WidgetExportedObject>;
|
|
434
|
+
/**
|
|
435
|
+
* Returns a promise that will fetch the object represented by this reference. Multiple calls to this will return
|
|
436
|
+
* the same instance.
|
|
437
|
+
* @return a promise that will resolve to a client side object that represents the reference on the server.
|
|
438
|
+
*/
|
|
439
|
+
fetch():Promise<any>;
|
|
440
|
+
/**
|
|
441
|
+
* Releases the server-side resources associated with this object, regardless of whether other client-side objects
|
|
442
|
+
* exist that also use that object. Should not be called after fetch() has been invoked.
|
|
443
|
+
*/
|
|
444
|
+
close():void;
|
|
445
|
+
}
|
|
446
|
+
export interface LayoutHints {
|
|
447
|
+
readonly searchDisplayMode?:SearchDisplayModeType|null;
|
|
448
|
+
|
|
449
|
+
get hiddenColumns():string[]|null;
|
|
450
|
+
get frozenColumns():string[]|null;
|
|
451
|
+
get columnGroups():ColumnGroup[]|null;
|
|
452
|
+
get areSavedLayoutsAllowed():boolean;
|
|
453
|
+
get frontColumns():string[]|null;
|
|
454
|
+
get backColumns():string[]|null;
|
|
455
|
+
}
|
|
456
|
+
/**
|
|
457
|
+
* Wrap LocalTime values for use in JS. Provides text formatting for display and access to the underlying value.
|
|
458
|
+
*/
|
|
459
|
+
export interface LocalTimeWrapper {
|
|
460
|
+
valueOf():string;
|
|
461
|
+
getHour():number;
|
|
462
|
+
getMinute():number;
|
|
463
|
+
getSecond():number;
|
|
464
|
+
getNano():number;
|
|
465
|
+
toString():string;
|
|
466
|
+
}
|
|
467
|
+
/**
|
|
468
|
+
* This object may be pooled internally or discarded and not updated. Do not retain references to it. Instead,
|
|
469
|
+
* request the viewport again.
|
|
470
|
+
*/
|
|
471
|
+
export interface ViewportRow extends Row {
|
|
472
|
+
get(column:Column):any;
|
|
473
|
+
getFormat(column:Column):Format;
|
|
474
|
+
get index():LongWrapper;
|
|
475
|
+
}
|
|
476
|
+
/**
|
|
477
|
+
* Wrap LocalDate values for use in JS. Provides text formatting for display and access to the underlying value.
|
|
478
|
+
*/
|
|
479
|
+
export interface LocalDateWrapper {
|
|
480
|
+
valueOf():string;
|
|
481
|
+
getYear():number;
|
|
482
|
+
getMonthValue():number;
|
|
483
|
+
getDayOfMonth():number;
|
|
484
|
+
toString():string;
|
|
485
|
+
}
|
|
486
|
+
/**
|
|
487
|
+
* Represents a row available in a subscription/snapshot on the client. Do not retain references to rows - they will
|
|
488
|
+
* not function properly when the event isn't actively going off (or promise resolving). Instead, wait for the next
|
|
489
|
+
* event, or re-request the viewport data.
|
|
490
|
+
*/
|
|
491
|
+
export interface Row {
|
|
492
|
+
get(column:Column):any;
|
|
493
|
+
getFormat(column:Column):Format;
|
|
494
|
+
get index():LongWrapper;
|
|
495
|
+
}
|
|
496
|
+
/**
|
|
513
497
|
* Behaves like a Table, but doesn't expose all of its API for changing the internal state. Instead, state is driven by
|
|
514
498
|
* the upstream table - when it changes handle, this listens and updates its own handle accordingly.
|
|
515
499
|
*
|
|
@@ -638,811 +622,779 @@ export namespace dh {
|
|
|
638
622
|
*/
|
|
639
623
|
get isRefreshing():boolean;
|
|
640
624
|
}
|
|
641
|
-
export interface ColumnGroup {
|
|
642
|
-
get name():string|null;
|
|
643
|
-
get children():string[]|null;
|
|
644
|
-
get color():string|null;
|
|
645
|
-
}
|
|
646
625
|
/**
|
|
647
|
-
*
|
|
648
|
-
*
|
|
649
|
-
* <p>
|
|
650
|
-
* This class supports two ways of reading the table - checking the changes made since the last update, and reading all
|
|
651
|
-
* data currently in the table. While it is more expensive to always iterate over every single row in the table, it may
|
|
652
|
-
* in some cases actually be cheaper than maintaining state separately and updating only the changes, though both
|
|
653
|
-
* options should be considered.
|
|
626
|
+
* Common interface for various ways of accessing table data and formatting for viewport or non-viewport subscriptions
|
|
627
|
+
* on tables, data in trees, and snapshots.
|
|
654
628
|
* <p>
|
|
655
|
-
*
|
|
656
|
-
*
|
|
657
|
-
*
|
|
658
|
-
* specific rows or cells out of the table.
|
|
629
|
+
* Generally speaking, it is more efficient to access data in column-major order, rather than iterating through each Row
|
|
630
|
+
* and accessing all columns that it holds. The {@link rows} accessor can be useful to read row data, but may
|
|
631
|
+
* incur other costs - it is likely faster to access data by columns using {@link getData}.
|
|
659
632
|
*/
|
|
660
|
-
export interface
|
|
661
|
-
get fullIndex():RangeSet;
|
|
633
|
+
export interface TableData {
|
|
662
634
|
/**
|
|
663
|
-
*
|
|
664
|
-
* @
|
|
635
|
+
* Reads a row object from the table, from which any subscribed column can be read.
|
|
636
|
+
* @param index - the position or key to access
|
|
637
|
+
* @return the row at the given location
|
|
665
638
|
*/
|
|
666
|
-
get
|
|
639
|
+
get(index:LongWrapper|number):Row;
|
|
667
640
|
/**
|
|
668
|
-
*
|
|
669
|
-
* @
|
|
641
|
+
* Reads a specific cell from the table, by row key and column.
|
|
642
|
+
* @param index - the row in the table to get data from
|
|
643
|
+
* @param column - the column to read
|
|
644
|
+
* @return the value in the table
|
|
670
645
|
*/
|
|
671
|
-
|
|
672
|
-
get columns():Array<Column>;
|
|
646
|
+
getData(index:LongWrapper|number, column:Column):any;
|
|
673
647
|
/**
|
|
674
|
-
* The
|
|
675
|
-
* @
|
|
648
|
+
* The server-specified Format to use for the cell at the given position.
|
|
649
|
+
* @param index - the row to read
|
|
650
|
+
* @param column - the column to read
|
|
651
|
+
* @return a Format instance with any server-specified details
|
|
676
652
|
*/
|
|
677
|
-
|
|
653
|
+
getFormat(index:LongWrapper|number, column:Column):Format;
|
|
654
|
+
get columns():Array<Column>;
|
|
678
655
|
/**
|
|
679
656
|
* A lazily computed array of all rows available on the client.
|
|
680
657
|
*/
|
|
681
658
|
get rows():Array<Row>;
|
|
682
659
|
}
|
|
683
|
-
|
|
684
660
|
/**
|
|
685
|
-
*
|
|
686
|
-
*
|
|
687
|
-
*
|
|
688
|
-
*
|
|
689
|
-
*
|
|
661
|
+
* Extends {@link dh.TableData}, but only contains data in the current viewport. The only API change from TableData is that
|
|
662
|
+
* ViewportData also contains the offset to this data, so that the actual row number may be determined.
|
|
663
|
+
* <p>
|
|
664
|
+
* For viewport subscriptions, it is not necessary to read with the key, only with the position.
|
|
665
|
+
* <p>
|
|
666
|
+
* Do not assume that the first row in `rows` is the first visible row, because extra rows may be provided for easier
|
|
667
|
+
* scrolling without going to the server.
|
|
690
668
|
*/
|
|
691
|
-
export
|
|
692
|
-
/**
|
|
693
|
-
* The column representing the unique ID for each item
|
|
694
|
-
*/
|
|
695
|
-
idColumn:string;
|
|
669
|
+
export interface ViewportData extends TableData {
|
|
696
670
|
/**
|
|
697
|
-
*
|
|
671
|
+
* Reads a row object from the viewport, based on its position in the table.
|
|
698
672
|
*/
|
|
699
|
-
|
|
673
|
+
get(index:LongWrapper|number):ViewportRow;
|
|
674
|
+
getData(index:LongWrapper|number, column:Column):any;
|
|
675
|
+
getFormat(index:LongWrapper|number, column:Column):Format;
|
|
700
676
|
/**
|
|
701
|
-
*
|
|
677
|
+
* The position of the first returned row within the table.
|
|
702
678
|
*/
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
679
|
+
get offset():number;
|
|
680
|
+
get columns():Array<Column>;
|
|
681
|
+
get rows():Array<ViewportRow>;
|
|
706
682
|
}
|
|
707
683
|
|
|
708
684
|
/**
|
|
709
|
-
*
|
|
710
|
-
*
|
|
711
|
-
*
|
|
712
|
-
*
|
|
713
|
-
*
|
|
685
|
+
* This object serves as a "handle" to a subscription, allowing it to be acted on directly or canceled outright. If you
|
|
686
|
+
* retain an instance of this, you have two choices - either only use it to call `close()` on it to stop the table's
|
|
687
|
+
* viewport without creating a new one, or listen directly to this object instead of the table for data events, and
|
|
688
|
+
* always call `close()` when finished. Calling any method on this object other than close() will result in it
|
|
689
|
+
* continuing to live on after `setViewport` is called on the original table, or after the table is modified.
|
|
714
690
|
*/
|
|
715
|
-
export class
|
|
691
|
+
export class TableViewportSubscription implements HasEventHandling {
|
|
716
692
|
protected constructor();
|
|
717
693
|
|
|
718
694
|
/**
|
|
719
|
-
*
|
|
720
|
-
*
|
|
721
|
-
*
|
|
722
|
-
*
|
|
723
|
-
*
|
|
724
|
-
* @param input - the number to wrap as a FilterValue
|
|
725
|
-
* @return an immutable FilterValue that can be built into a filter
|
|
726
|
-
*/
|
|
727
|
-
static ofNumber(input:LongWrapper|number):FilterValue;
|
|
728
|
-
/**
|
|
729
|
-
* a filter condition checking if the current value is equal to the given parameter
|
|
730
|
-
* @param term -
|
|
731
|
-
* @return {@link dh.FilterCondition}
|
|
695
|
+
* Changes the rows and columns set on this viewport. This cannot be used to change the update interval.
|
|
696
|
+
* @param firstRow -
|
|
697
|
+
* @param lastRow -
|
|
698
|
+
* @param columns -
|
|
699
|
+
* @param updateIntervalMs -
|
|
732
700
|
*/
|
|
733
|
-
|
|
701
|
+
setViewport(firstRow:number, lastRow:number, columns?:Column[]|undefined|null, updateIntervalMs?:number|undefined|null, isReverseViewport?:boolean|undefined|null):void;
|
|
734
702
|
/**
|
|
735
|
-
*
|
|
736
|
-
* vs lower case
|
|
737
|
-
* @param term -
|
|
738
|
-
* @return {@link dh.FilterCondition}
|
|
703
|
+
* Stops this viewport from running, stopping all events on itself and on the table that created it.
|
|
739
704
|
*/
|
|
740
|
-
|
|
705
|
+
close():void;
|
|
741
706
|
/**
|
|
742
|
-
*
|
|
743
|
-
* @
|
|
744
|
-
* @return {@link dh.FilterCondition}
|
|
707
|
+
* Gets the data currently visible in this viewport
|
|
708
|
+
* @return Promise of {@link dh.TableData}.
|
|
745
709
|
*/
|
|
746
|
-
|
|
710
|
+
getViewportData():Promise<ViewportData>;
|
|
711
|
+
snapshot(rows:RangeSet, columns:Column[]):Promise<TableData>;
|
|
747
712
|
/**
|
|
748
|
-
*
|
|
749
|
-
*
|
|
750
|
-
* @param
|
|
751
|
-
* @return
|
|
713
|
+
* Listen for events on this object.
|
|
714
|
+
* @param name - the name of the event to listen for
|
|
715
|
+
* @param callback - a function to call when the event occurs
|
|
716
|
+
* @return Returns a cleanup function.
|
|
717
|
+
* @typeParam T - the type of the data that the event will provide
|
|
752
718
|
*/
|
|
753
|
-
|
|
719
|
+
addEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):()=>void;
|
|
720
|
+
nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<Event<T>>;
|
|
721
|
+
hasListeners(name:string):boolean;
|
|
754
722
|
/**
|
|
755
|
-
*
|
|
756
|
-
* @param
|
|
757
|
-
* @
|
|
723
|
+
* Removes an event listener added to this table.
|
|
724
|
+
* @param name -
|
|
725
|
+
* @param callback -
|
|
726
|
+
* @return
|
|
727
|
+
* @typeParam T -
|
|
758
728
|
*/
|
|
759
|
-
|
|
729
|
+
removeEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):boolean;
|
|
730
|
+
}
|
|
731
|
+
|
|
732
|
+
/**
|
|
733
|
+
* Options for custom columns.
|
|
734
|
+
*/
|
|
735
|
+
export class CustomColumnOptions {
|
|
760
736
|
/**
|
|
761
|
-
* a
|
|
762
|
-
*
|
|
763
|
-
* @return {@link dh.FilterCondition}
|
|
737
|
+
* When specified for custom columns on a rollup table, specifies if the formula apply to rollup or constituent
|
|
738
|
+
* nodes.
|
|
764
739
|
*/
|
|
765
|
-
|
|
740
|
+
rollupNodeType?:RollupNodeTypeType|null;
|
|
741
|
+
|
|
742
|
+
constructor();
|
|
743
|
+
}
|
|
744
|
+
|
|
745
|
+
/**
|
|
746
|
+
* Wrap BigInteger values for use in JS. Provides text formatting for display and access to the underlying value.
|
|
747
|
+
*/
|
|
748
|
+
export class BigIntegerWrapper {
|
|
749
|
+
protected constructor();
|
|
750
|
+
|
|
751
|
+
static ofString(str:string):BigIntegerWrapper;
|
|
752
|
+
asNumber():number;
|
|
753
|
+
valueOf():string;
|
|
754
|
+
toString():string;
|
|
755
|
+
equals(o:object):boolean;
|
|
756
|
+
hashCode():number;
|
|
757
|
+
}
|
|
758
|
+
|
|
759
|
+
/**
|
|
760
|
+
* Describes how a Totals Table will be generated from its parent table. Each table has a default (which may be null)
|
|
761
|
+
* indicating how that table was configured when it was declared, and each Totals Table has a similar property
|
|
762
|
+
* describing how it was created. Both the <b>Table.getTotalsTable</b> and <b>Table.getGrandTotalsTable</b> methods take
|
|
763
|
+
* this config as an optional parameter - without it, the table's default will be used, or if null, a default instance
|
|
764
|
+
* of <b>TotalsTableConfig</b> will be supplied.
|
|
765
|
+
*
|
|
766
|
+
* This class has a no-arg constructor, allowing an instance to be made with the default values provided. However, any
|
|
767
|
+
* JS object can be passed in to the methods which accept instances of this type, provided their values adhere to the
|
|
768
|
+
* expected formats.
|
|
769
|
+
*/
|
|
770
|
+
export class TotalsTableConfig {
|
|
766
771
|
/**
|
|
767
|
-
*
|
|
768
|
-
* @param term -
|
|
769
|
-
* @return {@link dh.FilterCondition}
|
|
772
|
+
* @deprecated
|
|
770
773
|
*/
|
|
771
|
-
|
|
774
|
+
static readonly COUNT:string;
|
|
772
775
|
/**
|
|
773
|
-
*
|
|
774
|
-
* @param term -
|
|
775
|
-
* @return {@link dh.FilterCondition}
|
|
776
|
+
* @deprecated
|
|
776
777
|
*/
|
|
777
|
-
|
|
778
|
+
static readonly MIN:string;
|
|
778
779
|
/**
|
|
779
|
-
*
|
|
780
|
-
* @param terms -
|
|
781
|
-
* @return {@link dh.FilterCondition}
|
|
780
|
+
* @deprecated
|
|
782
781
|
*/
|
|
783
|
-
|
|
782
|
+
static readonly MAX:string;
|
|
784
783
|
/**
|
|
785
|
-
*
|
|
786
|
-
* lower case
|
|
787
|
-
* @param terms -
|
|
788
|
-
* @return {@link dh.FilterCondition}
|
|
784
|
+
* @deprecated
|
|
789
785
|
*/
|
|
790
|
-
|
|
786
|
+
static readonly SUM:string;
|
|
791
787
|
/**
|
|
792
|
-
*
|
|
793
|
-
* @param terms -
|
|
794
|
-
* @return {@link dh.FilterCondition}
|
|
788
|
+
* @deprecated
|
|
795
789
|
*/
|
|
796
|
-
|
|
790
|
+
static readonly ABS_SUM:string;
|
|
797
791
|
/**
|
|
798
|
-
*
|
|
799
|
-
* upper vs lower case
|
|
800
|
-
* @param terms -
|
|
801
|
-
* @return {@link dh.FilterCondition}
|
|
792
|
+
* @deprecated
|
|
802
793
|
*/
|
|
803
|
-
|
|
794
|
+
static readonly VAR:string;
|
|
804
795
|
/**
|
|
805
|
-
*
|
|
806
|
-
* @param term -
|
|
807
|
-
* @return {@link dh.FilterCondition}
|
|
796
|
+
* @deprecated
|
|
808
797
|
*/
|
|
809
|
-
|
|
798
|
+
static readonly AVG:string;
|
|
810
799
|
/**
|
|
811
|
-
*
|
|
812
|
-
* lower case
|
|
813
|
-
* @param term -
|
|
814
|
-
* @return {@link dh.FilterCondition}
|
|
800
|
+
* @deprecated
|
|
815
801
|
*/
|
|
816
|
-
|
|
802
|
+
static readonly STD:string;
|
|
817
803
|
/**
|
|
818
|
-
*
|
|
819
|
-
* use Java regex syntax
|
|
820
|
-
* @param pattern -
|
|
821
|
-
* @return {@link dh.FilterCondition}
|
|
804
|
+
* @deprecated
|
|
822
805
|
*/
|
|
823
|
-
|
|
806
|
+
static readonly FIRST:string;
|
|
824
807
|
/**
|
|
825
|
-
*
|
|
826
|
-
* differences of upper vs lower case. Regex patterns use Java regex syntax
|
|
827
|
-
* @param pattern -
|
|
828
|
-
* @return {@link dh.FilterCondition}
|
|
808
|
+
* @deprecated
|
|
829
809
|
*/
|
|
830
|
-
|
|
810
|
+
static readonly LAST:string;
|
|
831
811
|
/**
|
|
832
|
-
*
|
|
833
|
-
* @return {@link dh.FilterCondition}
|
|
812
|
+
* @deprecated
|
|
834
813
|
*/
|
|
835
|
-
|
|
814
|
+
static readonly SKIP:string;
|
|
836
815
|
/**
|
|
837
|
-
* a
|
|
838
|
-
* @return {@link dh.FilterCondition}
|
|
816
|
+
* Specifies if a Totals Table should be expanded by default in the UI. Defaults to false.
|
|
839
817
|
*/
|
|
840
|
-
|
|
818
|
+
showTotalsByDefault:boolean;
|
|
841
819
|
/**
|
|
842
|
-
* a
|
|
843
|
-
* @return {@link dh.FilterCondition}
|
|
820
|
+
* Specifies if a Grand Totals Table should be expanded by default in the UI. Defaults to false.
|
|
844
821
|
*/
|
|
845
|
-
|
|
822
|
+
showGrandTotalsByDefault:boolean;
|
|
846
823
|
/**
|
|
847
|
-
*
|
|
848
|
-
* functions that can be invoked on a String:
|
|
849
|
-
* <ul>
|
|
850
|
-
* <li><b>startsWith</b>: Returns true if the current string value starts with the supplied string argument</li>
|
|
851
|
-
* <li><b>endsWith</b>: Returns true if the current string value ends with the supplied string argument</li>
|
|
852
|
-
* <li><b>matches</b>: Returns true if the current string value matches the supplied string argument used as a Java
|
|
853
|
-
* regular expression</li>
|
|
854
|
-
* <li><b>contains</b>: Returns true if the current string value contains the supplied string argument
|
|
855
|
-
* <p>
|
|
856
|
-
* When invoking against a constant, this should be avoided in favor of FilterValue.contains
|
|
857
|
-
* </p>
|
|
858
|
-
* </li>
|
|
859
|
-
* </ul>
|
|
860
|
-
* @param method -
|
|
861
|
-
* @param args -
|
|
862
|
-
* @return
|
|
824
|
+
* Specifies the default operation for columns that do not have a specific operation applied; defaults to "Sum".
|
|
863
825
|
*/
|
|
864
|
-
|
|
865
|
-
toString():string;
|
|
826
|
+
defaultOperation:AggregationOperationType;
|
|
866
827
|
/**
|
|
867
|
-
*
|
|
868
|
-
*
|
|
869
|
-
* @return
|
|
828
|
+
* Mapping from each column name to the aggregation(s) that should be applied to that column in the resulting Totals
|
|
829
|
+
* Table. If a column is omitted, the defaultOperation is used.
|
|
870
830
|
*/
|
|
871
|
-
|
|
831
|
+
operationMap:{ [key: string]: Array<AggregationOperationType>; };
|
|
872
832
|
/**
|
|
873
|
-
*
|
|
874
|
-
*
|
|
875
|
-
* @return
|
|
833
|
+
* Groupings to use when generating the Totals Table. One row will exist for each unique set of values observed in
|
|
834
|
+
* these columns. See also `Table.selectDistinct`.
|
|
876
835
|
*/
|
|
877
|
-
|
|
878
|
-
}
|
|
836
|
+
groupBy:Array<string>;
|
|
879
837
|
|
|
838
|
+
constructor();
|
|
839
|
+
|
|
840
|
+
toString():string;
|
|
841
|
+
}
|
|
880
842
|
|
|
881
843
|
/**
|
|
882
|
-
*
|
|
883
|
-
*
|
|
884
|
-
*
|
|
844
|
+
* Represents a non-viewport subscription to a table, and all data currently known to be present in the subscribed
|
|
845
|
+
* columns. This class handles incoming snapshots and deltas, and fires events to consumers to notify of data changes.
|
|
846
|
+
*
|
|
847
|
+
* Unlike {@link dh.TableViewportSubscription}, the "original" table does not have a reference to this instance, only the
|
|
848
|
+
* "private" table instance does, since the original cannot modify the subscription, and the private instance must
|
|
849
|
+
* forward data to it.
|
|
850
|
+
*
|
|
851
|
+
* Represents a subscription to the table on the server. Changes made to the table will not be reflected here - the
|
|
852
|
+
* subscription must be closed and a new one optioned to see those changes. The event model is slightly different from
|
|
853
|
+
* viewports to make it less expensive to compute for large tables.
|
|
885
854
|
*/
|
|
886
|
-
export class
|
|
855
|
+
export class TableSubscription implements HasEventHandling {
|
|
887
856
|
protected constructor();
|
|
888
857
|
|
|
889
858
|
/**
|
|
890
|
-
* the
|
|
891
|
-
* @
|
|
859
|
+
* Updates the subscription to use the given columns and update interval.
|
|
860
|
+
* @param columns - the new columns to subscribe to
|
|
861
|
+
* @param updateIntervalMs - the new update interval, or null/omit to use the default of one second
|
|
892
862
|
*/
|
|
893
|
-
|
|
863
|
+
changeSubscription(columns:Array<Column>, updateIntervalMs:number|undefined|null):void;
|
|
864
|
+
get columns():Array<Column>;
|
|
894
865
|
/**
|
|
895
|
-
*
|
|
896
|
-
* @param filters -
|
|
897
|
-
* @return FilterCondition
|
|
866
|
+
* Stops the subscription on the server.
|
|
898
867
|
*/
|
|
899
|
-
|
|
900
|
-
/**
|
|
901
|
-
* a condition representing the current condition logically ORed with the other parameters
|
|
902
|
-
* @param filters -
|
|
903
|
-
* @return FilterCondition.
|
|
904
|
-
*/
|
|
905
|
-
or(...filters:FilterCondition[]):FilterCondition;
|
|
868
|
+
close():void;
|
|
906
869
|
/**
|
|
907
|
-
*
|
|
908
|
-
* @
|
|
870
|
+
* Listen for events on this object.
|
|
871
|
+
* @param name - the name of the event to listen for
|
|
872
|
+
* @param callback - a function to call when the event occurs
|
|
873
|
+
* @return Returns a cleanup function.
|
|
874
|
+
* @typeParam T - the type of the data that the event will provide
|
|
909
875
|
*/
|
|
910
|
-
|
|
911
|
-
|
|
876
|
+
addEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):()=>void;
|
|
877
|
+
nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<Event<T>>;
|
|
878
|
+
hasListeners(name:string):boolean;
|
|
912
879
|
/**
|
|
913
|
-
*
|
|
914
|
-
*
|
|
915
|
-
*
|
|
916
|
-
*
|
|
917
|
-
*
|
|
918
|
-
* <li><b>isInf</b>:Returns true if the given number is <i>infinity</i></li>
|
|
919
|
-
* <li><b>isNaN</b>:Returns true if the given number is <i>not a number</i></li>
|
|
920
|
-
* <li><b>isNormal</b>:Returns true if the given number <i>is not null</i>, <i>is not infinity</i>, and <i>is not
|
|
921
|
-
* "not a number"</i></li>
|
|
922
|
-
* <li><b>startsWith</b>:Returns true if the first string starts with the second string</li>
|
|
923
|
-
* <li><b>endsWith</b>Returns true if the first string ends with the second string</li>
|
|
924
|
-
* <li><b>matches</b>:Returns true if the first string argument matches the second string used as a Java regular
|
|
925
|
-
* expression</li>
|
|
926
|
-
* <li><b>contains</b>:Returns true if the first string argument contains the second string as a substring</li>
|
|
927
|
-
* <li><b>in</b>:Returns true if the first string argument can be found in the second array argument.
|
|
928
|
-
* <p>
|
|
929
|
-
* Note that the array can only be specified as a column reference at this time - typically the `FilterValue.in`
|
|
930
|
-
* method should be used in other cases
|
|
931
|
-
* </p>
|
|
932
|
-
* </li>
|
|
933
|
-
* </ul>
|
|
934
|
-
* @param function -
|
|
935
|
-
* @param args -
|
|
936
|
-
* @return dh.FilterCondition
|
|
880
|
+
* Removes an event listener added to this table.
|
|
881
|
+
* @param name -
|
|
882
|
+
* @param callback -
|
|
883
|
+
* @return
|
|
884
|
+
* @typeParam T -
|
|
937
885
|
*/
|
|
938
|
-
|
|
886
|
+
removeEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):boolean;
|
|
887
|
+
}
|
|
888
|
+
|
|
889
|
+
export class CoreClient implements HasEventHandling {
|
|
890
|
+
static readonly EVENT_CONNECT:string;
|
|
891
|
+
static readonly EVENT_DISCONNECT:string;
|
|
892
|
+
static readonly EVENT_RECONNECT:string;
|
|
893
|
+
static readonly EVENT_RECONNECT_AUTH_FAILED:string;
|
|
894
|
+
static readonly EVENT_REQUEST_FAILED:string;
|
|
895
|
+
static readonly EVENT_REQUEST_STARTED:string;
|
|
896
|
+
static readonly EVENT_REQUEST_SUCCEEDED:string;
|
|
939
897
|
/**
|
|
940
|
-
*
|
|
941
|
-
* this FilterCondition is passed to. This FilterCondition is somewhat unique in that it need not be given a column
|
|
942
|
-
* instance, but will adapt to any table. On numeric columns, with a value passed in which can be parsed as a
|
|
943
|
-
* number, the column will be filtered to numbers which equal, or can be "rounded" effectively to this number. On
|
|
944
|
-
* String columns, the given value will match any column which contains this string in a case-insensitive search. An
|
|
945
|
-
* optional second argument can be passed, an array of `FilterValue` from the columns to limit this search to (see
|
|
946
|
-
* {@link dh.Column.filter}).
|
|
947
|
-
* @param value -
|
|
948
|
-
* @param columns -
|
|
949
|
-
* @return dh.FilterCondition
|
|
898
|
+
* @deprecated
|
|
950
899
|
*/
|
|
951
|
-
static
|
|
900
|
+
static readonly EVENT_REFRESH_TOKEN_UPDATED:string;
|
|
901
|
+
static readonly LOGIN_TYPE_PASSWORD:string;
|
|
902
|
+
static readonly LOGIN_TYPE_ANONYMOUS:string;
|
|
903
|
+
|
|
904
|
+
constructor(serverUrl:string, connectOptions?:ConnectOptions);
|
|
905
|
+
|
|
906
|
+
running():Promise<CoreClient>;
|
|
907
|
+
getServerUrl():string;
|
|
908
|
+
getAuthConfigValues():Promise<string[][]>;
|
|
909
|
+
login(credentials:LoginCredentials):Promise<void>;
|
|
910
|
+
relogin(token:RefreshToken):Promise<void>;
|
|
911
|
+
onConnected(timeoutInMillis?:number):Promise<void>;
|
|
912
|
+
getServerConfigValues():Promise<string[][]>;
|
|
913
|
+
getStorageService():dh.storage.StorageService;
|
|
914
|
+
getAsIdeConnection():Promise<IdeConnection>;
|
|
915
|
+
disconnect():void;
|
|
916
|
+
addEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):()=>void;
|
|
917
|
+
nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<Event<T>>;
|
|
918
|
+
hasListeners(name:string):boolean;
|
|
919
|
+
removeEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):boolean;
|
|
952
920
|
}
|
|
953
921
|
|
|
954
922
|
/**
|
|
955
|
-
* Describes
|
|
956
|
-
*
|
|
957
|
-
* methods return a new Sort instance.
|
|
923
|
+
* Describes the structure of the column, and if desired can be used to get access to the data to be rendered in this
|
|
924
|
+
* column.
|
|
958
925
|
*/
|
|
959
|
-
export class
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
926
|
+
export class Column {
|
|
927
|
+
/**
|
|
928
|
+
* If this column is part of a roll-up tree table, represents the type of the row data that can be found in this
|
|
929
|
+
* column for leaf nodes if includeConstituents is enabled. Otherwise, it is <b>null</b>.
|
|
930
|
+
* @return String
|
|
931
|
+
*/
|
|
932
|
+
readonly constituentType?:string|null;
|
|
933
|
+
readonly description?:string|null;
|
|
963
934
|
|
|
964
935
|
protected constructor();
|
|
965
936
|
|
|
966
937
|
/**
|
|
967
|
-
*
|
|
968
|
-
* @
|
|
938
|
+
* the value for this column in the given row. Type will be consistent with the type of the Column.
|
|
939
|
+
* @param row -
|
|
940
|
+
* @return Any
|
|
969
941
|
*/
|
|
970
|
-
|
|
942
|
+
get(row:Row):any;
|
|
943
|
+
getFormat(row:Row):Format;
|
|
971
944
|
/**
|
|
972
|
-
*
|
|
945
|
+
* Creates a sort builder object, to be used when sorting by this column.
|
|
973
946
|
* @return {@link dh.Sort}
|
|
974
947
|
*/
|
|
975
|
-
|
|
948
|
+
sort():Sort;
|
|
976
949
|
/**
|
|
977
|
-
*
|
|
978
|
-
*
|
|
950
|
+
* Creates a new value for use in filters based on this column. Used either as a parameter to another filter
|
|
951
|
+
* operation, or as a builder to create a filter operation.
|
|
952
|
+
* @return {@link dh.FilterValue}
|
|
979
953
|
*/
|
|
980
|
-
|
|
981
|
-
toString():string;
|
|
954
|
+
filter():FilterValue;
|
|
982
955
|
/**
|
|
983
|
-
*
|
|
984
|
-
* @
|
|
956
|
+
* a <b>CustomColumn</b> object to apply using `applyCustomColumns` with the expression specified.
|
|
957
|
+
* @param expression -
|
|
958
|
+
* @return {@link dh.CustomColumn}
|
|
985
959
|
*/
|
|
986
|
-
|
|
960
|
+
formatColor(expression:string, options?:CustomColumnOptions|undefined|null):CustomColumn;
|
|
987
961
|
/**
|
|
988
|
-
*
|
|
989
|
-
* @
|
|
962
|
+
* a <b>CustomColumn</b> object to apply using <b>applyCustomColumns</b> with the expression specified.
|
|
963
|
+
* @param expression -
|
|
964
|
+
* @return {@link dh.CustomColumn}
|
|
990
965
|
*/
|
|
991
|
-
|
|
966
|
+
formatNumber(expression:string, options?:CustomColumnOptions|undefined|null):CustomColumn;
|
|
992
967
|
/**
|
|
993
|
-
*
|
|
994
|
-
* @
|
|
968
|
+
* a <b>CustomColumn</b> object to apply using <b>applyCustomColumns</b> with the expression specified.
|
|
969
|
+
* @param expression -
|
|
970
|
+
* @return {@link dh.CustomColumn}
|
|
995
971
|
*/
|
|
996
|
-
|
|
997
|
-
}
|
|
998
|
-
|
|
999
|
-
export class LoginCredentials {
|
|
1000
|
-
type?:string|null;
|
|
1001
|
-
username?:string|null;
|
|
1002
|
-
token?:string|null;
|
|
1003
|
-
|
|
1004
|
-
constructor();
|
|
1005
|
-
}
|
|
1006
|
-
|
|
1007
|
-
export class LongWrapper {
|
|
1008
|
-
protected constructor();
|
|
1009
|
-
|
|
1010
|
-
static ofString(str:string):LongWrapper;
|
|
1011
|
-
asNumber():number;
|
|
1012
|
-
valueOf():string;
|
|
1013
|
-
toString():string;
|
|
1014
|
-
}
|
|
1015
|
-
|
|
1016
|
-
export class CustomColumn {
|
|
1017
|
-
static readonly TYPE_FORMAT_COLOR:string;
|
|
1018
|
-
static readonly TYPE_FORMAT_NUMBER:string;
|
|
1019
|
-
static readonly TYPE_FORMAT_DATE:string;
|
|
1020
|
-
static readonly TYPE_NEW:string;
|
|
1021
|
-
|
|
1022
|
-
protected constructor();
|
|
1023
|
-
|
|
1024
|
-
valueOf():string;
|
|
972
|
+
formatDate(expression:string, options?:CustomColumnOptions|undefined|null):CustomColumn;
|
|
1025
973
|
toString():string;
|
|
1026
|
-
static from(columnInfo:string):CustomColumn;
|
|
1027
974
|
/**
|
|
1028
|
-
*
|
|
975
|
+
* Label for this column.
|
|
1029
976
|
* @return String
|
|
1030
977
|
*/
|
|
1031
|
-
get
|
|
978
|
+
get name():string;
|
|
1032
979
|
/**
|
|
1033
|
-
*
|
|
1034
|
-
* @
|
|
980
|
+
* True if this column is a partition column. Partition columns are used for filtering uncoalesced tables - see
|
|
981
|
+
* {@link Table.uncoalesced}.
|
|
982
|
+
* @return true if the column is a partition column
|
|
1035
983
|
*/
|
|
1036
|
-
get
|
|
984
|
+
get isPartitionColumn():boolean;
|
|
1037
985
|
/**
|
|
1038
|
-
*
|
|
1039
|
-
* @
|
|
986
|
+
*
|
|
987
|
+
* @deprecated do not use. Internal index of the column in the table, to be used as a key on the Row.
|
|
988
|
+
* @return int
|
|
1040
989
|
*/
|
|
1041
|
-
get
|
|
990
|
+
get index():number;
|
|
991
|
+
get isSortable():boolean;
|
|
1042
992
|
/**
|
|
1043
|
-
* Type of
|
|
1044
|
-
*
|
|
1045
|
-
* <ul>
|
|
1046
|
-
* <li>FORMAT_COLOR</li>
|
|
1047
|
-
* <li>FORMAT_NUMBER</li>
|
|
1048
|
-
* <li>FORMAT_DATE</li>
|
|
1049
|
-
* <li>NEW</li>
|
|
1050
|
-
* </ul>
|
|
993
|
+
* Type of the row data that can be found in this column.
|
|
1051
994
|
* @return String
|
|
1052
995
|
*/
|
|
1053
996
|
get type():string;
|
|
997
|
+
/**
|
|
998
|
+
* Format entire rows colors using the expression specified. Returns a <b>CustomColumn</b> object to apply to a
|
|
999
|
+
* table using <b>applyCustomColumns</b> with the parameters specified.
|
|
1000
|
+
* @param expression -
|
|
1001
|
+
* @param options -
|
|
1002
|
+
* @return {@link dh.CustomColumn}
|
|
1003
|
+
*/
|
|
1004
|
+
static formatRowColor(expression:string, options?:CustomColumnOptions|undefined|null):CustomColumn;
|
|
1005
|
+
/**
|
|
1006
|
+
* a <b>CustomColumn</b> object to apply using <b>applyCustomColumns</b> with the expression specified.
|
|
1007
|
+
* @param name -
|
|
1008
|
+
* @param expression -
|
|
1009
|
+
* @param options -
|
|
1010
|
+
* @return {@link dh.CustomColumn}
|
|
1011
|
+
*/
|
|
1012
|
+
static createCustomColumn(name:string, expression:string, options?:CustomColumnOptions|undefined|null):CustomColumn;
|
|
1054
1013
|
}
|
|
1055
1014
|
|
|
1056
1015
|
/**
|
|
1057
|
-
*
|
|
1016
|
+
* Exists to keep the dh.TableMap namespace so that the web UI can remain compatible with the DHE API, which still calls
|
|
1017
|
+
* this type TableMap.
|
|
1018
|
+
* @deprecated
|
|
1058
1019
|
*/
|
|
1059
|
-
export class
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
rollupNodeType?:RollupNodeTypeType|null;
|
|
1020
|
+
export class TableMap {
|
|
1021
|
+
static readonly EVENT_KEYADDED:string;
|
|
1022
|
+
static readonly EVENT_DISCONNECT:string;
|
|
1023
|
+
static readonly EVENT_RECONNECT:string;
|
|
1024
|
+
static readonly EVENT_RECONNECTFAILED:string;
|
|
1065
1025
|
|
|
1066
|
-
constructor();
|
|
1026
|
+
protected constructor();
|
|
1067
1027
|
}
|
|
1068
1028
|
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1029
|
+
/**
|
|
1030
|
+
* Describes data that can be filtered, either a column reference or a literal value. Used this way, the type of a value
|
|
1031
|
+
* can be specified so that values which are ambiguous or not well supported in JS will not be confused with Strings or
|
|
1032
|
+
* imprecise numbers (e.g., nanosecond-precision date values). Additionally, once wrapped in this way, methods can be
|
|
1033
|
+
* called on these value literal instances. These instances are immutable - any method called on them returns a new
|
|
1034
|
+
* instance.
|
|
1035
|
+
*/
|
|
1036
|
+
export class FilterValue {
|
|
1073
1037
|
protected constructor();
|
|
1074
1038
|
|
|
1075
1039
|
/**
|
|
1076
|
-
*
|
|
1077
|
-
* @
|
|
1078
|
-
*
|
|
1079
|
-
*
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
* Load the named Figure, including its tables and tablemaps as needed.
|
|
1084
|
-
* @param name -
|
|
1085
|
-
* @return promise of dh.plot.Figure
|
|
1086
|
-
*/
|
|
1087
|
-
getFigure(name:string):Promise<dh.plot.Figure>;
|
|
1088
|
-
/**
|
|
1089
|
-
* Loads the named tree table or roll-up table, with column data populated. All nodes are collapsed by default, and
|
|
1090
|
-
* size is presently not available until the viewport is first set.
|
|
1091
|
-
* @param name -
|
|
1092
|
-
* @return {@link Promise} of {@link dh.TreeTable}
|
|
1093
|
-
*/
|
|
1094
|
-
getTreeTable(name:string):Promise<TreeTable>;
|
|
1095
|
-
getHierarchicalTable(name:string):Promise<TreeTable>;
|
|
1096
|
-
getPartitionedTable(name:string):Promise<PartitionedTable>;
|
|
1097
|
-
getObject(definitionObject:dh.ide.VariableDescriptor):Promise<any>;
|
|
1098
|
-
newTable(columnNames:string[], types:string[], data:string[][], userTimeZone:string):Promise<Table>;
|
|
1099
|
-
/**
|
|
1100
|
-
* Merges the given tables into a single table. Assumes all tables have the same structure.
|
|
1101
|
-
* @param tables -
|
|
1102
|
-
* @return {@link Promise} of {@link dh.Table}
|
|
1103
|
-
*/
|
|
1104
|
-
mergeTables(tables:Table[]):Promise<Table>;
|
|
1105
|
-
bindTableToVariable(table:Table, name:string):Promise<void>;
|
|
1106
|
-
/**
|
|
1107
|
-
* Makes the `object` available to another user or another client on this same server which knows the value of
|
|
1108
|
-
* the `sharedTicketBytes`. Use that sharedTicketBytes value like a one-time use password - any other client
|
|
1109
|
-
* which knows this value can read the same object.
|
|
1110
|
-
* <p>
|
|
1111
|
-
* Shared objects will remain available using the sharedTicketBytes until the client that first shared them
|
|
1112
|
-
* releases/closes their copy of the object. Whatever side-channel is used to share the bytes, be sure to wait until
|
|
1113
|
-
* the remote end has signaled that it has successfully fetched the object before releasing it from this client.
|
|
1114
|
-
* <p>
|
|
1115
|
-
* Be sure to use an unpredictable value for the shared ticket bytes, like a UUID or other large, random value to
|
|
1116
|
-
* prevent access by unauthorized clients.
|
|
1117
|
-
* @param object - the object to share with another client/user
|
|
1118
|
-
* @param sharedTicketBytes - the value which another client/user must know to obtain the object. It may be a unicode
|
|
1119
|
-
* string (will be encoded as utf8 bytes), or a {@link Uint8Array} value.
|
|
1120
|
-
* @return A promise that will resolve to the value passed as sharedTicketBytes when the object is ready to be read
|
|
1121
|
-
* by another client, or will reject if an error occurs.
|
|
1040
|
+
* Constructs a number for the filter API from the given parameter. Can also be used on the values returned from
|
|
1041
|
+
* {@link TableData.get} for DateTime values. To create
|
|
1042
|
+
* a filter with a date, use <b>dh.DateWrapper.ofJsDate</b> or
|
|
1043
|
+
* {@link i18n.DateTimeFormat.parse}. To create a filter with a
|
|
1044
|
+
* 64-bit long integer, use {@link LongWrapper.ofString}.
|
|
1045
|
+
* @param input - the number to wrap as a FilterValue
|
|
1046
|
+
* @return an immutable FilterValue that can be built into a filter
|
|
1122
1047
|
*/
|
|
1123
|
-
|
|
1048
|
+
static ofNumber(input:LongWrapper|number):FilterValue;
|
|
1124
1049
|
/**
|
|
1125
|
-
*
|
|
1126
|
-
*
|
|
1127
|
-
*
|
|
1128
|
-
* The type of the object must be passed so that the object can be read from the server correct - the other client
|
|
1129
|
-
* should provide this information.
|
|
1130
|
-
* @param sharedTicketBytes - the value provided by another client/user to obtain the object. It may be a unicode
|
|
1131
|
-
* string (will be encoded as utf8 bytes), or a {@link Uint8Array} value.
|
|
1132
|
-
* @param type - The type of the object, so it can be correctly read from the server
|
|
1133
|
-
* @return A promise that will resolve to the shared object, or will reject with an error if it cannot be read.
|
|
1050
|
+
* a filter condition checking if the current value is equal to the given parameter
|
|
1051
|
+
* @param term -
|
|
1052
|
+
* @return {@link dh.FilterCondition}
|
|
1134
1053
|
*/
|
|
1135
|
-
|
|
1136
|
-
subscribeToFieldUpdates(callback:(arg0:dh.ide.VariableChanges)=>void):()=>void;
|
|
1137
|
-
close():void;
|
|
1138
|
-
runCode(code:string):Promise<dh.ide.CommandResult>;
|
|
1139
|
-
onLogMessage(callback:(arg0:dh.ide.LogItem)=>void):()=>void;
|
|
1140
|
-
openDocument(params:object):void;
|
|
1141
|
-
changeDocument(params:object):void;
|
|
1142
|
-
getCompletionItems(params:object):Promise<Array<dh.lsp.CompletionItem>>;
|
|
1143
|
-
getSignatureHelp(params:object):Promise<Array<dh.lsp.SignatureInformation>>;
|
|
1144
|
-
getHover(params:object):Promise<dh.lsp.Hover>;
|
|
1145
|
-
closeDocument(params:object):void;
|
|
1054
|
+
eq(term:FilterValue):FilterCondition;
|
|
1146
1055
|
/**
|
|
1147
|
-
*
|
|
1148
|
-
*
|
|
1149
|
-
* @param
|
|
1150
|
-
* @return {@link
|
|
1056
|
+
* a filter condition checking if the current value is equal to the given parameter, ignoring differences of upper
|
|
1057
|
+
* vs lower case
|
|
1058
|
+
* @param term -
|
|
1059
|
+
* @return {@link dh.FilterCondition}
|
|
1151
1060
|
*/
|
|
1152
|
-
|
|
1061
|
+
eqIgnoreCase(term:FilterValue):FilterCondition;
|
|
1153
1062
|
/**
|
|
1154
|
-
*
|
|
1155
|
-
*
|
|
1156
|
-
* @
|
|
1157
|
-
* @param startTime -
|
|
1158
|
-
* @return {@link Promise} of {@link dh.Table}
|
|
1063
|
+
* a filter condition checking if the current value is not equal to the given parameter
|
|
1064
|
+
* @param term -
|
|
1065
|
+
* @return {@link dh.FilterCondition}
|
|
1159
1066
|
*/
|
|
1160
|
-
|
|
1161
|
-
addEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):()=>void;
|
|
1162
|
-
nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<Event<T>>;
|
|
1163
|
-
hasListeners(name:string):boolean;
|
|
1164
|
-
removeEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):boolean;
|
|
1165
|
-
}
|
|
1166
|
-
|
|
1167
|
-
/**
|
|
1168
|
-
* Provides access to data in a table. Note that several methods present their response through Promises. This allows
|
|
1169
|
-
* the client to both avoid actually connecting to the server until necessary, and also will permit some changes not to
|
|
1170
|
-
* inform the UI right away that they have taken place.
|
|
1171
|
-
*/
|
|
1172
|
-
export class Table implements JoinableTable, HasEventHandling {
|
|
1173
|
-
readonly description?:string|null;
|
|
1174
|
-
readonly pluginName?:string|null;
|
|
1175
|
-
readonly layoutHints?:null|LayoutHints;
|
|
1067
|
+
notEq(term:FilterValue):FilterCondition;
|
|
1176
1068
|
/**
|
|
1177
|
-
*
|
|
1069
|
+
* a filter condition checking if the current value is not equal to the given parameter, ignoring differences of
|
|
1070
|
+
* upper vs lower case
|
|
1071
|
+
* @param term -
|
|
1072
|
+
* @return {@link dh.FilterCondition}
|
|
1178
1073
|
*/
|
|
1179
|
-
|
|
1074
|
+
notEqIgnoreCase(term:FilterValue):FilterCondition;
|
|
1180
1075
|
/**
|
|
1181
|
-
*
|
|
1076
|
+
* a filter condition checking if the current value is greater than the given parameter
|
|
1077
|
+
* @param term -
|
|
1078
|
+
* @return {@link dh.FilterCondition}
|
|
1182
1079
|
*/
|
|
1183
|
-
|
|
1080
|
+
greaterThan(term:FilterValue):FilterCondition;
|
|
1184
1081
|
/**
|
|
1185
|
-
*
|
|
1082
|
+
* a filter condition checking if the current value is less than the given parameter
|
|
1083
|
+
* @param term -
|
|
1084
|
+
* @return {@link dh.FilterCondition}
|
|
1186
1085
|
*/
|
|
1187
|
-
|
|
1086
|
+
lessThan(term:FilterValue):FilterCondition;
|
|
1188
1087
|
/**
|
|
1189
|
-
*
|
|
1088
|
+
* a filter condition checking if the current value is greater than or equal to the given parameter
|
|
1089
|
+
* @param term -
|
|
1090
|
+
* @return {@link dh.FilterCondition}
|
|
1190
1091
|
*/
|
|
1191
|
-
|
|
1092
|
+
greaterThanOrEqualTo(term:FilterValue):FilterCondition;
|
|
1192
1093
|
/**
|
|
1193
|
-
*
|
|
1094
|
+
* a filter condition checking if the current value is less than or equal to the given parameter
|
|
1095
|
+
* @param term -
|
|
1096
|
+
* @return {@link dh.FilterCondition}
|
|
1194
1097
|
*/
|
|
1195
|
-
|
|
1098
|
+
lessThanOrEqualTo(term:FilterValue):FilterCondition;
|
|
1196
1099
|
/**
|
|
1197
|
-
*
|
|
1100
|
+
* a filter condition checking if the current value is in the given set of values
|
|
1101
|
+
* @param terms -
|
|
1102
|
+
* @return {@link dh.FilterCondition}
|
|
1198
1103
|
*/
|
|
1199
|
-
|
|
1104
|
+
in(terms:FilterValue[]):FilterCondition;
|
|
1200
1105
|
/**
|
|
1201
|
-
*
|
|
1106
|
+
* a filter condition checking if the current value is in the given set of values, ignoring differences of upper vs
|
|
1107
|
+
* lower case
|
|
1108
|
+
* @param terms -
|
|
1109
|
+
* @return {@link dh.FilterCondition}
|
|
1202
1110
|
*/
|
|
1203
|
-
|
|
1111
|
+
inIgnoreCase(terms:FilterValue[]):FilterCondition;
|
|
1204
1112
|
/**
|
|
1205
|
-
*
|
|
1113
|
+
* a filter condition checking that the current value is not in the given set of values
|
|
1114
|
+
* @param terms -
|
|
1115
|
+
* @return {@link dh.FilterCondition}
|
|
1206
1116
|
*/
|
|
1207
|
-
|
|
1117
|
+
notIn(terms:FilterValue[]):FilterCondition;
|
|
1208
1118
|
/**
|
|
1209
|
-
*
|
|
1119
|
+
* a filter condition checking that the current value is not in the given set of values, ignoring differences of
|
|
1120
|
+
* upper vs lower case
|
|
1121
|
+
* @param terms -
|
|
1122
|
+
* @return {@link dh.FilterCondition}
|
|
1210
1123
|
*/
|
|
1211
|
-
|
|
1124
|
+
notInIgnoreCase(terms:FilterValue[]):FilterCondition;
|
|
1212
1125
|
/**
|
|
1213
|
-
*
|
|
1126
|
+
* a filter condition checking if the given value contains the given string value
|
|
1127
|
+
* @param term -
|
|
1128
|
+
* @return {@link dh.FilterCondition}
|
|
1214
1129
|
*/
|
|
1215
|
-
|
|
1130
|
+
contains(term:FilterValue):FilterCondition;
|
|
1216
1131
|
/**
|
|
1217
|
-
*
|
|
1132
|
+
* a filter condition checking if the given value contains the given string value, ignoring differences of upper vs
|
|
1133
|
+
* lower case
|
|
1134
|
+
* @param term -
|
|
1135
|
+
* @return {@link dh.FilterCondition}
|
|
1218
1136
|
*/
|
|
1219
|
-
|
|
1137
|
+
containsIgnoreCase(term:FilterValue):FilterCondition;
|
|
1220
1138
|
/**
|
|
1221
|
-
*
|
|
1139
|
+
* a filter condition checking if the given value matches the provided regular expressions string. Regex patterns
|
|
1140
|
+
* use Java regex syntax
|
|
1141
|
+
* @param pattern -
|
|
1142
|
+
* @return {@link dh.FilterCondition}
|
|
1222
1143
|
*/
|
|
1223
|
-
|
|
1144
|
+
matches(pattern:FilterValue):FilterCondition;
|
|
1224
1145
|
/**
|
|
1225
|
-
*
|
|
1146
|
+
* a filter condition checking if the given value matches the provided regular expressions string, ignoring
|
|
1147
|
+
* differences of upper vs lower case. Regex patterns use Java regex syntax
|
|
1148
|
+
* @param pattern -
|
|
1149
|
+
* @return {@link dh.FilterCondition}
|
|
1226
1150
|
*/
|
|
1227
|
-
|
|
1151
|
+
matchesIgnoreCase(pattern:FilterValue):FilterCondition;
|
|
1228
1152
|
/**
|
|
1229
|
-
*
|
|
1153
|
+
* a filter condition checking if the current value is a true boolean
|
|
1154
|
+
* @return {@link dh.FilterCondition}
|
|
1230
1155
|
*/
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
protected constructor();
|
|
1234
|
-
|
|
1235
|
-
batch(userCode:(arg0:unknown)=>void):Promise<Table>;
|
|
1156
|
+
isTrue():FilterCondition;
|
|
1236
1157
|
/**
|
|
1237
|
-
*
|
|
1238
|
-
*
|
|
1239
|
-
* @param key -
|
|
1240
|
-
* @return {@link dh.Column}
|
|
1158
|
+
* a filter condition checking if the current value is a false boolean
|
|
1159
|
+
* @return {@link dh.FilterCondition}
|
|
1241
1160
|
*/
|
|
1242
|
-
|
|
1161
|
+
isFalse():FilterCondition;
|
|
1243
1162
|
/**
|
|
1244
|
-
*
|
|
1245
|
-
* @
|
|
1246
|
-
* @return {@link dh.Column} array
|
|
1163
|
+
* a filter condition checking if the current value is a null value
|
|
1164
|
+
* @return {@link dh.FilterCondition}
|
|
1247
1165
|
*/
|
|
1248
|
-
|
|
1249
|
-
isBlinkTable():boolean;
|
|
1166
|
+
isNull():FilterCondition;
|
|
1250
1167
|
/**
|
|
1251
|
-
*
|
|
1252
|
-
*
|
|
1253
|
-
*
|
|
1168
|
+
* a filter condition invoking the given method on the current value, with the given parameters. Currently supported
|
|
1169
|
+
* functions that can be invoked on a String:
|
|
1170
|
+
* <ul>
|
|
1171
|
+
* <li><b>startsWith</b>: Returns true if the current string value starts with the supplied string argument</li>
|
|
1172
|
+
* <li><b>endsWith</b>: Returns true if the current string value ends with the supplied string argument</li>
|
|
1173
|
+
* <li><b>matches</b>: Returns true if the current string value matches the supplied string argument used as a Java
|
|
1174
|
+
* regular expression</li>
|
|
1175
|
+
* <li><b>contains</b>: Returns true if the current string value contains the supplied string argument
|
|
1176
|
+
* <p>
|
|
1177
|
+
* When invoking against a constant, this should be avoided in favor of FilterValue.contains
|
|
1178
|
+
* </p>
|
|
1179
|
+
* </li>
|
|
1180
|
+
* </ul>
|
|
1181
|
+
* @param method -
|
|
1182
|
+
* @param args -
|
|
1183
|
+
* @return
|
|
1254
1184
|
*/
|
|
1255
|
-
|
|
1185
|
+
invoke(method:string, ...args:FilterValue[]):FilterCondition;
|
|
1186
|
+
toString():string;
|
|
1256
1187
|
/**
|
|
1257
|
-
*
|
|
1188
|
+
* Constructs a string for the filter API from the given parameter.
|
|
1189
|
+
* @param input -
|
|
1190
|
+
* @return
|
|
1258
1191
|
*/
|
|
1259
|
-
|
|
1260
|
-
getAttributes():string[];
|
|
1192
|
+
static ofString(input:any):FilterValue;
|
|
1261
1193
|
/**
|
|
1262
|
-
*
|
|
1263
|
-
*
|
|
1264
|
-
* @
|
|
1265
|
-
* @return Object
|
|
1194
|
+
* Constructs a boolean for the filter API from the given parameter.
|
|
1195
|
+
* @param b -
|
|
1196
|
+
* @return
|
|
1266
1197
|
*/
|
|
1267
|
-
|
|
1198
|
+
static ofBoolean(b:boolean):FilterValue;
|
|
1199
|
+
}
|
|
1200
|
+
|
|
1201
|
+
|
|
1202
|
+
/**
|
|
1203
|
+
* Behaves like a {@link dh.Table} externally, but data, state, and viewports are managed by an entirely different
|
|
1204
|
+
* mechanism, and so reimplemented here.
|
|
1205
|
+
* <p>
|
|
1206
|
+
* Any time a change is made, we build a new request and send it to the server, and wait for the updated state.
|
|
1207
|
+
* <p>
|
|
1208
|
+
* Semantics around getting updates from the server are slightly different - we don't "unset" the viewport here after
|
|
1209
|
+
* operations are performed, but encourage the client code to re-set them to the desired position.
|
|
1210
|
+
* <p>
|
|
1211
|
+
* The table size will be -1 until a viewport has been fetched.
|
|
1212
|
+
* <p>
|
|
1213
|
+
* Similar to a table, a Tree Table provides access to subscribed viewport data on the current hierarchy. A different
|
|
1214
|
+
* Row type is used within that viewport, showing the depth of that node within the tree and indicating details about
|
|
1215
|
+
* whether it has children or is expanded. The Tree Table itself then provides the ability to change if a row is
|
|
1216
|
+
* expanded or not. Methods used to control or check if a row should be expanded or not can be invoked on a TreeRow
|
|
1217
|
+
* instance, or on the number of the row (thus allowing for expanding/collapsing rows which are not currently visible in
|
|
1218
|
+
* the viewport).
|
|
1219
|
+
* <p>
|
|
1220
|
+
* Events and viewports are somewhat different from tables, due to the expense of computing the expanded/collapsed rows
|
|
1221
|
+
* and count of children at each level of the hierarchy, and differences in the data that is available.
|
|
1222
|
+
* <p>
|
|
1223
|
+
* <ul>
|
|
1224
|
+
* <li>There is no {@link Table.totalSize | totalSize} property.</li>
|
|
1225
|
+
* <li>The viewport is not un-set when changes are made to filter or sort, but changes will continue to be streamed in.
|
|
1226
|
+
* It is suggested that the viewport be changed to the desired position (usually the first N rows) after any filter/sort
|
|
1227
|
+
* change is made. Likewise, {@link getViewportData} will always return the most recent data, and will not wait if a
|
|
1228
|
+
* new operation is pending.</li>
|
|
1229
|
+
* <li>Custom columns are supported on Rollup tables, but not on Tree tables. If the TreeTable was created client-side,
|
|
1230
|
+
* the original Table can have custom columns applied, and the TreeTable can be recreated.</li>
|
|
1231
|
+
* <li>Whereas Table has a {@link Table.totalsTableConfig} property, it is defined here as a method,
|
|
1232
|
+
* {@link getTotalsTableConfig}. This returns a promise so the config can be fetched asynchronously.</li>
|
|
1233
|
+
* <li>Totals Tables for trees vary in behavior between tree tables and roll-up tables. This behavior is based on the
|
|
1234
|
+
* original flat table used to produce the Tree Table - for a hierarchical table (i.e. Table.treeTable in the query
|
|
1235
|
+
* config), the totals will include non-leaf nodes (since they are themselves actual rows in the table), but in a
|
|
1236
|
+
* roll-up table, the totals only include leaf nodes (as non-leaf nodes are generated through grouping the contents of
|
|
1237
|
+
* the original table). Roll-ups also have the {@link dh.includeConstituents} property, indicating that a
|
|
1238
|
+
* {@link dh.Column} in the tree may have a {@link Column.constituentType} property reflecting that the type of cells
|
|
1239
|
+
* where {@link TreeRowImpl.hasChildren} is false will be different from usual.</li>
|
|
1240
|
+
* </ul>
|
|
1241
|
+
*/
|
|
1242
|
+
export class TreeTable implements HasEventHandling {
|
|
1268
1243
|
/**
|
|
1269
|
-
*
|
|
1270
|
-
* immediately return the new value, but you may receive update events using the old sort before the new sort is
|
|
1271
|
-
* applied, and the <b>sortchanged</b> event fires. Reusing existing, applied sorts may enable this to perform
|
|
1272
|
-
* better on the server. The <b>updated</b> event will also fire, but <b>rowadded</b> and <b>rowremoved</b> will
|
|
1273
|
-
* not.
|
|
1274
|
-
* @param sort -
|
|
1275
|
-
* @return {@link dh.Sort} array
|
|
1244
|
+
* event.detail is the currently visible viewport data based on the active viewport configuration.
|
|
1276
1245
|
*/
|
|
1277
|
-
|
|
1246
|
+
static readonly EVENT_UPDATED:string;
|
|
1278
1247
|
/**
|
|
1279
|
-
*
|
|
1280
|
-
* will immediately return the new value, but you may receive update events using the old filter before the new one
|
|
1281
|
-
* is applied, and the <b>filterchanged</b> event fires. Reusing existing, applied filters may enable this to
|
|
1282
|
-
* perform better on the server. The <b>updated</b> event will also fire, but <b>rowadded</b> and <b>rowremoved</b>
|
|
1283
|
-
* will not.
|
|
1284
|
-
* @param filter -
|
|
1285
|
-
* @return {@link dh.FilterCondition} array
|
|
1248
|
+
* event.detail is the currently visible viewport data based on the active viewport configuration.
|
|
1286
1249
|
*/
|
|
1287
|
-
|
|
1250
|
+
static readonly EVENT_DISCONNECT:string;
|
|
1288
1251
|
/**
|
|
1289
|
-
*
|
|
1290
|
-
* @param customColumns -
|
|
1291
|
-
* @return {@link dh.CustomColumn} array
|
|
1252
|
+
* event.detail is the currently visible viewport data based on the active viewport configuration.
|
|
1292
1253
|
*/
|
|
1293
|
-
|
|
1254
|
+
static readonly EVENT_RECONNECT:string;
|
|
1294
1255
|
/**
|
|
1295
|
-
*
|
|
1296
|
-
* provided, a default of one second will be used. Until this is called, no data will be available. Invoking this
|
|
1297
|
-
* will result in events to be fired once data becomes available, starting with an `updated` event and a
|
|
1298
|
-
* <b>rowadded</b> event per row in that range. The returned object allows the viewport to be closed when no longer
|
|
1299
|
-
* needed.
|
|
1300
|
-
* @param firstRow -
|
|
1301
|
-
* @param lastRow -
|
|
1302
|
-
* @param columns -
|
|
1303
|
-
* @param updateIntervalMs -
|
|
1304
|
-
* @return {@link dh.TableViewportSubscription}
|
|
1256
|
+
* event.detail is the currently visible viewport data based on the active viewport configuration.
|
|
1305
1257
|
*/
|
|
1306
|
-
|
|
1258
|
+
static readonly EVENT_RECONNECTFAILED:string;
|
|
1307
1259
|
/**
|
|
1308
|
-
*
|
|
1309
|
-
* resolve until that data is ready. If this table is closed before the promise resolves, it will be rejected - to
|
|
1310
|
-
* separate the lifespan of this promise from the table itself, call
|
|
1311
|
-
* {@link TableViewportSubscription.getViewportData} on the result from {@link Table.setViewport}.
|
|
1312
|
-
* @return Promise of {@link dh.TableData}
|
|
1260
|
+
* event.detail is the currently visible viewport data based on the active viewport configuration.
|
|
1313
1261
|
*/
|
|
1314
|
-
|
|
1262
|
+
static readonly EVENT_REQUEST_FAILED:string;
|
|
1263
|
+
readonly description?:string|null;
|
|
1264
|
+
readonly layoutHints?:null|LayoutHints;
|
|
1265
|
+
|
|
1266
|
+
protected constructor();
|
|
1267
|
+
|
|
1315
1268
|
/**
|
|
1316
|
-
*
|
|
1317
|
-
*
|
|
1318
|
-
*
|
|
1319
|
-
*
|
|
1320
|
-
*
|
|
1321
|
-
*
|
|
1322
|
-
* @param columns -
|
|
1323
|
-
* @param updateIntervalMs -
|
|
1324
|
-
* @return {@link dh.TableSubscription}
|
|
1269
|
+
* Expands the given node, so that its children are visible when they are in the viewport. The parameter can be the
|
|
1270
|
+
* row index, or the row object itself. The second parameter is a boolean value, false by default, specifying if the
|
|
1271
|
+
* row and all descendants should be fully expanded. Equivalent to `setExpanded(row, true)` with an optional third
|
|
1272
|
+
* boolean parameter.
|
|
1273
|
+
* @param row -
|
|
1274
|
+
* @param expandDescendants -
|
|
1325
1275
|
*/
|
|
1326
|
-
|
|
1276
|
+
expand(row:TreeRow|number, expandDescendants?:boolean):void;
|
|
1327
1277
|
/**
|
|
1328
|
-
*
|
|
1329
|
-
*
|
|
1330
|
-
*
|
|
1331
|
-
* @param columns -
|
|
1332
|
-
* @return Promise of dh.Table
|
|
1278
|
+
* Collapses the given node, so that its children and descendants are not visible in the size or the viewport. The
|
|
1279
|
+
* parameter can be the row index, or the row object itself. Equivalent to <b>setExpanded(row, false, false)</b>.
|
|
1280
|
+
* @param row -
|
|
1333
1281
|
*/
|
|
1334
|
-
|
|
1282
|
+
collapse(row:TreeRow|number):void;
|
|
1335
1283
|
/**
|
|
1336
|
-
*
|
|
1337
|
-
*
|
|
1284
|
+
* Specifies if the given node should be expanded or collapsed. If this node has children, and the value is changed,
|
|
1285
|
+
* the size of the table will change. If node is to be expanded and the third parameter, <b>expandDescendants</b>,
|
|
1286
|
+
* is true, then its children will also be expanded.
|
|
1287
|
+
* @param row - the row to expand or collapse, either the absolute row index or the row object
|
|
1288
|
+
* @param isExpanded - true to expand the row, false to collapse
|
|
1289
|
+
* @param expandDescendants - true to expand the row and all descendants, false to expand only the row, defaults to
|
|
1290
|
+
* false
|
|
1338
1291
|
*/
|
|
1339
|
-
|
|
1292
|
+
setExpanded(row:TreeRow|number, isExpanded:boolean, expandDescendants?:boolean):void;
|
|
1293
|
+
expandAll():void;
|
|
1294
|
+
collapseAll():void;
|
|
1340
1295
|
/**
|
|
1341
|
-
*
|
|
1342
|
-
*
|
|
1343
|
-
*
|
|
1344
|
-
* called on it when not in use.
|
|
1345
|
-
* @param config -
|
|
1346
|
-
* @return Promise of dh.TotalsTable
|
|
1296
|
+
* Tests if the specified row is expanded.
|
|
1297
|
+
* @param row - the row to test, either the absolute row index or the row object
|
|
1298
|
+
* @return boolean true if the row is expanded, false otherwise
|
|
1347
1299
|
*/
|
|
1348
|
-
|
|
1300
|
+
isExpanded(row:TreeRow|number):boolean;
|
|
1301
|
+
setViewport(firstRow:number, lastRow:number, columns?:Array<Column>|undefined|null, updateInterval?:number|undefined|null):void;
|
|
1302
|
+
getViewportData():Promise<TreeViewportData>;
|
|
1349
1303
|
/**
|
|
1350
|
-
*
|
|
1351
|
-
* above for more specifics.
|
|
1352
|
-
* @param config -
|
|
1353
|
-
* @return promise of dh.TotalsTable
|
|
1304
|
+
* Indicates that the table will no longer be used, and server resources can be freed.
|
|
1354
1305
|
*/
|
|
1355
|
-
|
|
1306
|
+
close():void;
|
|
1356
1307
|
/**
|
|
1357
|
-
*
|
|
1358
|
-
*
|
|
1359
|
-
* @
|
|
1360
|
-
* @return Promise of dh.TreeTable
|
|
1308
|
+
* Applies the given sort to all levels of the tree. Returns the previous sort in use.
|
|
1309
|
+
* @param sort -
|
|
1310
|
+
* @return {@link dh.Sort} array
|
|
1361
1311
|
*/
|
|
1362
|
-
|
|
1312
|
+
applySort(sort:Sort[]):Array<Sort>;
|
|
1363
1313
|
/**
|
|
1364
|
-
*
|
|
1365
|
-
*
|
|
1366
|
-
*
|
|
1367
|
-
* @
|
|
1314
|
+
* Applies the given filter to the contents of the tree in such a way that if any node is visible, then any parent
|
|
1315
|
+
* node will be visible as well even if that parent node would not normally be visible due to the filter's
|
|
1316
|
+
* condition. Returns the previous sort in use.
|
|
1317
|
+
* @param filter -
|
|
1318
|
+
* @return {@link dh.FilterCondition} array
|
|
1368
1319
|
*/
|
|
1369
|
-
|
|
1320
|
+
applyFilter(filter:FilterCondition[]):Array<FilterCondition>;
|
|
1370
1321
|
/**
|
|
1371
|
-
*
|
|
1372
|
-
*
|
|
1373
|
-
*
|
|
1374
|
-
* @return
|
|
1322
|
+
* Adding new columns to the table based on other columns using updateView() mechanics. Rollup tables are supported
|
|
1323
|
+
* but Tree tables will throw an {@link java.lang.UnsupportedOperationException} if this function is called.
|
|
1324
|
+
* @param customColumns -
|
|
1325
|
+
* @return {@link dh.CustomColumn} array
|
|
1375
1326
|
*/
|
|
1376
|
-
|
|
1377
|
-
snapshot(baseTable:Table, doInitialSnapshot?:boolean, stampColumns?:string[]):Promise<Table>;
|
|
1327
|
+
applyCustomColumns(customColumns:Array<string|CustomColumn>):Array<CustomColumn>;
|
|
1378
1328
|
/**
|
|
1379
|
-
*
|
|
1380
|
-
* @
|
|
1381
|
-
* @
|
|
1329
|
+
* a column with the given name, or throws an exception if it cannot be found
|
|
1330
|
+
* @param key -
|
|
1331
|
+
* @return {@link dh.Column}
|
|
1382
1332
|
*/
|
|
1383
|
-
|
|
1384
|
-
asOfJoin(rightTable:JoinableTable, columnsToMatch:Array<string>, columnsToAdd?:Array<string>|undefined|null, asOfMatchRule?:string|undefined|null):Promise<Table>;
|
|
1385
|
-
crossJoin(rightTable:JoinableTable, columnsToMatch:Array<string>, columnsToAdd?:Array<string>|undefined|null, reserveBits?:number|undefined|null):Promise<Table>;
|
|
1386
|
-
exactJoin(rightTable:JoinableTable, columnsToMatch:Array<string>, columnsToAdd?:Array<string>):Promise<Table>;
|
|
1387
|
-
naturalJoin(rightTable:JoinableTable, columnsToMatch:Array<string>, columnsToAdd?:Array<string>):Promise<Table>;
|
|
1388
|
-
byExternal(keys:object, dropKeys?:boolean):Promise<PartitionedTable>;
|
|
1333
|
+
findColumn(key:string):Column;
|
|
1389
1334
|
/**
|
|
1390
|
-
*
|
|
1391
|
-
* keys.
|
|
1335
|
+
* an array with all of the named columns in order, or throws an exception if one cannot be found.
|
|
1392
1336
|
* @param keys -
|
|
1393
|
-
* @
|
|
1394
|
-
* @return Promise dh.PartitionedTable
|
|
1337
|
+
* @return {@link dh.Column} array
|
|
1395
1338
|
*/
|
|
1396
|
-
|
|
1339
|
+
findColumns(keys:string[]):Column[];
|
|
1397
1340
|
/**
|
|
1398
|
-
*
|
|
1399
|
-
*
|
|
1400
|
-
*
|
|
1341
|
+
* Provides Table-like selectDistinct functionality, but with a few quirks, since it is only fetching the distinct
|
|
1342
|
+
* values for the given columns in the source table:
|
|
1343
|
+
* <ul>
|
|
1344
|
+
* <li>Rollups may make no sense, since values are aggregated.</li>
|
|
1345
|
+
* <li>Values found on orphaned (and removed) nodes will show up in the resulting table, even though they are not in
|
|
1346
|
+
* the tree.</li>
|
|
1347
|
+
* <li>Values found on parent nodes which are only present in the tree since a child is visible will not be present
|
|
1348
|
+
* in the resulting table.</li>
|
|
1349
|
+
* </ul>
|
|
1401
1350
|
*/
|
|
1402
|
-
|
|
1351
|
+
selectDistinct(columns:Column[]):Promise<Table>;
|
|
1352
|
+
getTotalsTableConfig():Promise<TotalsTableConfig>;
|
|
1353
|
+
getTotalsTable(config?:object):Promise<TotalsTable>;
|
|
1354
|
+
getGrandTotalsTable(config?:object):Promise<TotalsTable>;
|
|
1403
1355
|
/**
|
|
1404
|
-
*
|
|
1405
|
-
*
|
|
1406
|
-
*
|
|
1407
|
-
*
|
|
1408
|
-
* @
|
|
1409
|
-
* @param insensitive - Optional value to flag a search as case-insensitive. Defaults to `false`.
|
|
1410
|
-
* @param contains - Optional value to have the seek value do a contains search instead of exact equality. Defaults to
|
|
1411
|
-
* `false`.
|
|
1412
|
-
* @param isBackwards - Optional value to seek backwards through the table instead of forwards. Defaults to `false`.
|
|
1413
|
-
* @return A promise that resolves to the row value found.
|
|
1356
|
+
* a new copy of this treetable, so it can be sorted and filtered separately, and maintain a different viewport.
|
|
1357
|
+
* Unlike Table, this will _not_ copy the filter or sort, since tree table viewport semantics differ, and without a
|
|
1358
|
+
* viewport set, the treetable doesn't evaluate these settings, and they aren't readable on the properties. Expanded
|
|
1359
|
+
* state is also not copied.
|
|
1360
|
+
* @return Promise of dh.TreeTable
|
|
1414
1361
|
*/
|
|
1415
|
-
|
|
1416
|
-
toString():string;
|
|
1362
|
+
copy():Promise<TreeTable>;
|
|
1417
1363
|
/**
|
|
1418
|
-
*
|
|
1419
|
-
*
|
|
1364
|
+
* The current filter configuration of this Tree Table.
|
|
1365
|
+
* @return {@link dh.FilterCondition} array
|
|
1366
|
+
*/
|
|
1367
|
+
get filter():Array<FilterCondition>;
|
|
1368
|
+
/**
|
|
1369
|
+
* True if this is a roll-up and will provide the original rows that make up each grouping.
|
|
1420
1370
|
* @return boolean
|
|
1421
1371
|
*/
|
|
1422
|
-
get
|
|
1372
|
+
get includeConstituents():boolean;
|
|
1373
|
+
get groupedColumns():Array<Column>;
|
|
1423
1374
|
/**
|
|
1424
|
-
*
|
|
1425
|
-
*
|
|
1426
|
-
* in the table. The size can and will change; see the <b>sizechanged</b> event for details. Size will be negative
|
|
1427
|
-
* in exceptional cases (eg. the table is uncoalesced, see the <b>isUncoalesced</b> property for details).
|
|
1428
|
-
* @return {@link dh.Column} array
|
|
1375
|
+
* True if this table has been closed.
|
|
1376
|
+
* @return boolean
|
|
1429
1377
|
*/
|
|
1430
|
-
get
|
|
1378
|
+
get isClosed():boolean;
|
|
1431
1379
|
/**
|
|
1432
|
-
* The
|
|
1433
|
-
*
|
|
1380
|
+
* The current number of rows given the table's contents and the various expand/collapse states of each node. (No
|
|
1381
|
+
* totalSize is provided at this time; its definition becomes unclear between roll-up and tree tables, especially
|
|
1382
|
+
* when considering collapse/expand states).
|
|
1383
|
+
* @return double
|
|
1434
1384
|
*/
|
|
1435
|
-
get
|
|
1385
|
+
get size():number;
|
|
1436
1386
|
/**
|
|
1437
|
-
*
|
|
1438
|
-
* return
|
|
1439
|
-
|
|
1440
|
-
|
|
1387
|
+
* The columns that can be shown in this Tree Table.
|
|
1388
|
+
* @return {@link dh.Column} array
|
|
1389
|
+
*/
|
|
1390
|
+
get columns():Array<Column>;
|
|
1391
|
+
/**
|
|
1392
|
+
* The current sort configuration of this Tree Table
|
|
1393
|
+
* @return {@link dh.Sort} array.
|
|
1441
1394
|
*/
|
|
1442
1395
|
get sort():Array<Sort>;
|
|
1443
1396
|
/**
|
|
1444
|
-
*
|
|
1445
|
-
* ones. To update, call <b>applyCustomColumns()</b>.
|
|
1397
|
+
* The current list of custom columns added to this Tree Table.
|
|
1446
1398
|
* @return {@link dh.CustomColumn} array
|
|
1447
1399
|
*/
|
|
1448
1400
|
get customColumns():Array<CustomColumn>;
|
|
@@ -1453,46 +1405,6 @@ export namespace dh {
|
|
|
1453
1405
|
*/
|
|
1454
1406
|
get isRefreshing():boolean;
|
|
1455
1407
|
/**
|
|
1456
|
-
* An ordered list of Filters to apply to the table. To update, call applyFilter(). Note that this getter will
|
|
1457
|
-
* return the new value immediately, even though it may take a little time to update on the server. You may listen
|
|
1458
|
-
* for the <b>filterchanged</b> event to know when to update the UI.
|
|
1459
|
-
* @return {@link dh.FilterCondition} array
|
|
1460
|
-
*/
|
|
1461
|
-
get filter():Array<FilterCondition>;
|
|
1462
|
-
/**
|
|
1463
|
-
* The total count of the rows in the table, excluding any filters. Unlike {@link Table.size}, changes to this value
|
|
1464
|
-
* will not result in any event. If the table is unfiltered, this will return the same size as {@link Table.size}.
|
|
1465
|
-
* If this table was uncoalesced before it was filtered, this will return {@link dh.Table.SIZE_UNCOALESCED}.
|
|
1466
|
-
* @return the size of the table before filters, or {@link dh.Table.SIZE_UNCOALESCED}
|
|
1467
|
-
*/
|
|
1468
|
-
get totalSize():number;
|
|
1469
|
-
/**
|
|
1470
|
-
* The total count of rows in the table. If there is a viewport subscription active, this size will be updated when
|
|
1471
|
-
* the subscription updates. If not, and {@link Table.uncoalesced} is true, the size will be
|
|
1472
|
-
* {@link dh.Table.SIZE_UNCOALESCED}. Otherwise, the size will be updated when the server's update graph processes changes.
|
|
1473
|
-
* <p>
|
|
1474
|
-
* When the size changes, the {@link dh.Table.EVENT_SIZECHANGED} event will be fired.
|
|
1475
|
-
* @return the size of the table, or {@link dh.Table.SIZE_UNCOALESCED} if there is no subscription and the table is
|
|
1476
|
-
* uncoalesced.
|
|
1477
|
-
*/
|
|
1478
|
-
get size():number;
|
|
1479
|
-
/**
|
|
1480
|
-
* True if this table has been closed.
|
|
1481
|
-
* @return boolean
|
|
1482
|
-
*/
|
|
1483
|
-
get isClosed():boolean;
|
|
1484
|
-
/**
|
|
1485
|
-
* Read-only. True if this table is uncoalesced, indicating that work must be done before the table can be used.
|
|
1486
|
-
* <p>
|
|
1487
|
-
* Uncoalesced tables are expensive to operate on - filter to a single partition or range of partitions before
|
|
1488
|
-
* subscribing to access only the desired data efficiently. A subscription can be specified without a filter, but
|
|
1489
|
-
* this can be very expensive. To see which partitions are available, check each column on the table to see which
|
|
1490
|
-
* have {@link Column.isPartitionColumn} as `true`, and filter those columns. To read the possible values
|
|
1491
|
-
* for those columns, use {@link Table.selectDistinct}.
|
|
1492
|
-
* @return True if the table is uncoaleced and should be filtered before operating on it, otherwise false.
|
|
1493
|
-
*/
|
|
1494
|
-
get isUncoalesced():boolean;
|
|
1495
|
-
/**
|
|
1496
1408
|
* Listen for events on this object.
|
|
1497
1409
|
* @param name - the name of the event to listen for
|
|
1498
1410
|
* @param callback - a function to call when the event occurs
|
|
@@ -1510,12 +1422,6 @@ export namespace dh {
|
|
|
1510
1422
|
* @typeParam T -
|
|
1511
1423
|
*/
|
|
1512
1424
|
removeEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):boolean;
|
|
1513
|
-
/**
|
|
1514
|
-
* a Sort than can be used to reverse a table. This can be passed into n array in applySort. Note that Tree Tables
|
|
1515
|
-
* do not support reverse.
|
|
1516
|
-
* @return {@link dh.Sort}
|
|
1517
|
-
*/
|
|
1518
|
-
static reverse():Sort;
|
|
1519
1425
|
}
|
|
1520
1426
|
|
|
1521
1427
|
/**
|
|
@@ -1553,169 +1459,34 @@ export namespace dh {
|
|
|
1553
1459
|
* prevent access by unauthorized clients.
|
|
1554
1460
|
* @param object - the object to share with another client/user
|
|
1555
1461
|
* @param sharedTicketBytes - the value which another client/user must know to obtain the object. It may be a unicode
|
|
1556
|
-
* string (will be encoded as utf8 bytes), or a {@link Uint8Array} value.
|
|
1557
|
-
* @return A promise that will resolve to the value passed as sharedTicketBytes when the object is ready to be read
|
|
1558
|
-
* by another client, or will reject if an error occurs.
|
|
1559
|
-
*/
|
|
1560
|
-
shareObject(object:Table|Widget|WidgetExportedObject|PartitionedTable|TotalsTable|TreeTable, sharedTicketBytes:string|Uint8Array):Promise<string|Uint8Array>;
|
|
1561
|
-
/**
|
|
1562
|
-
* Reads an object shared by another client to this server with the `sharedTicketBytes`. Until the other
|
|
1563
|
-
* client releases this object (or their session ends), the object will be available on the server.
|
|
1564
|
-
* <p>
|
|
1565
|
-
* The type of the object must be passed so that the object can be read from the server correct - the other client
|
|
1566
|
-
* should provide this information.
|
|
1567
|
-
* @param sharedTicketBytes - the value provided by another client/user to obtain the object. It may be a unicode
|
|
1568
|
-
* string (will be encoded as utf8 bytes), or a {@link Uint8Array} value.
|
|
1569
|
-
* @param type - The type of the object, so it can be correctly read from the server
|
|
1570
|
-
* @return A promise that will resolve to the shared object, or will reject with an error if it cannot be read.
|
|
1571
|
-
*/
|
|
1572
|
-
getSharedObject(sharedTicketBytes:string|Uint8Array, type:string):Promise<any>;
|
|
1573
|
-
/**
|
|
1574
|
-
* Register a callback function to handle any log messages that are emitted on the server. Returns a function ,
|
|
1575
|
-
* which can be invoked to remove this log handler. Any log handler registered in this way will receive as many old
|
|
1576
|
-
* log messages as are presently available.
|
|
1577
|
-
* @param callback -
|
|
1578
|
-
* @return {@link io.deephaven.web.shared.fu.JsRunnable}
|
|
1579
|
-
*/
|
|
1580
|
-
onLogMessage(callback:(arg0:dh.ide.LogItem)=>void):()=>void;
|
|
1581
|
-
startSession(type:string):Promise<IdeSession>;
|
|
1582
|
-
getConsoleTypes():Promise<Array<string>>;
|
|
1583
|
-
getWorkerHeapInfo():Promise<WorkerHeapInfo>;
|
|
1584
|
-
/**
|
|
1585
|
-
* Listen for events on this object.
|
|
1586
|
-
* @param name - the name of the event to listen for
|
|
1587
|
-
* @param callback - a function to call when the event occurs
|
|
1588
|
-
* @return Returns a cleanup function.
|
|
1589
|
-
* @typeParam T - the type of the data that the event will provide
|
|
1590
|
-
*/
|
|
1591
|
-
addEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):()=>void;
|
|
1592
|
-
nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<Event<T>>;
|
|
1593
|
-
hasListeners(name:string):boolean;
|
|
1594
|
-
/**
|
|
1595
|
-
* Removes an event listener added to this table.
|
|
1596
|
-
* @param name -
|
|
1597
|
-
* @param callback -
|
|
1598
|
-
* @return
|
|
1599
|
-
* @typeParam T -
|
|
1600
|
-
*/
|
|
1601
|
-
removeEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):boolean;
|
|
1602
|
-
}
|
|
1603
|
-
|
|
1604
|
-
/**
|
|
1605
|
-
* A js type for operating on input tables.
|
|
1606
|
-
*
|
|
1607
|
-
* Represents a User Input Table, which can have data added to it from other sources.
|
|
1608
|
-
*
|
|
1609
|
-
* You may add rows using dictionaries of key-value tuples (representing columns by name), add tables containing all the
|
|
1610
|
-
* key/value columns to add, or delete tables containing the keys to delete. Each operation is atomic, and will either
|
|
1611
|
-
* succeed completely or fail completely. To guarantee order of operations, apply an operation and wait for the response
|
|
1612
|
-
* before sending the next operation.
|
|
1613
|
-
*
|
|
1614
|
-
* Each table has one or more key columns, where each unique combination of keys will appear at most once in the table.
|
|
1615
|
-
*
|
|
1616
|
-
* To view the results of the Input Table, you should use standard table operations on the InputTable's source Table
|
|
1617
|
-
* object.
|
|
1618
|
-
*/
|
|
1619
|
-
export class InputTable {
|
|
1620
|
-
protected constructor();
|
|
1621
|
-
|
|
1622
|
-
/**
|
|
1623
|
-
* Adds a single row to the table. For each key or value column name in the Input Table, we retrieve that javascript
|
|
1624
|
-
* property at that name and validate it can be put into the given column type.
|
|
1625
|
-
* @param row -
|
|
1626
|
-
* @param userTimeZone -
|
|
1627
|
-
* @return Promise of dh.InputTable
|
|
1628
|
-
*/
|
|
1629
|
-
addRow(row:{ [key: string]: any; }, userTimeZone?:string):Promise<InputTable>;
|
|
1630
|
-
/**
|
|
1631
|
-
* Add multiple rows to a table.
|
|
1632
|
-
* @param rows -
|
|
1633
|
-
* @param userTimeZone -
|
|
1634
|
-
* @return Promise of dh.InputTable
|
|
1635
|
-
*/
|
|
1636
|
-
addRows(rows:{ [key: string]: any; }[], userTimeZone?:string):Promise<InputTable>;
|
|
1637
|
-
/**
|
|
1638
|
-
* Add an entire table to this Input Table. Only column names that match the definition of the input table will be
|
|
1639
|
-
* copied, and all key columns must have values filled in. This only copies the current state of the source table;
|
|
1640
|
-
* future updates to the source table will not be reflected in the Input Table. The returned promise will be
|
|
1641
|
-
* resolved to the same InputTable instance this method was called upon once the server returns.
|
|
1642
|
-
* @param tableToAdd -
|
|
1643
|
-
* @return Promise of dh.InputTable
|
|
1644
|
-
*/
|
|
1645
|
-
addTable(tableToAdd:Table):Promise<InputTable>;
|
|
1646
|
-
/**
|
|
1647
|
-
* Add multiple tables to this Input Table.
|
|
1648
|
-
* @param tablesToAdd -
|
|
1649
|
-
* @return Promise of dh.InputTable
|
|
1650
|
-
*/
|
|
1651
|
-
addTables(tablesToAdd:Table[]):Promise<InputTable>;
|
|
1652
|
-
/**
|
|
1653
|
-
* Deletes an entire table from this Input Table. Key columns must match the Input Table.
|
|
1654
|
-
* @param tableToDelete -
|
|
1655
|
-
* @return Promise of dh.InputTable
|
|
1656
|
-
*/
|
|
1657
|
-
deleteTable(tableToDelete:Table):Promise<InputTable>;
|
|
1658
|
-
/**
|
|
1659
|
-
* Delete multiple tables from this Input Table.
|
|
1660
|
-
* @param tablesToDelete -
|
|
1661
|
-
* @return
|
|
1662
|
-
*/
|
|
1663
|
-
deleteTables(tablesToDelete:Table[]):Promise<InputTable>;
|
|
1664
|
-
/**
|
|
1665
|
-
* A list of the key columns, by name
|
|
1666
|
-
* @return String array.
|
|
1667
|
-
*/
|
|
1668
|
-
get keys():string[];
|
|
1669
|
-
/**
|
|
1670
|
-
* A list of the value columns, by name
|
|
1671
|
-
* @return String array.
|
|
1672
|
-
*/
|
|
1673
|
-
get values():string[];
|
|
1674
|
-
/**
|
|
1675
|
-
* A list of the key columns.
|
|
1676
|
-
* @return Column array.
|
|
1677
|
-
*/
|
|
1678
|
-
get keyColumns():Column[];
|
|
1679
|
-
/**
|
|
1680
|
-
* A list of the value Column objects
|
|
1681
|
-
* @return {@link dh.Column} array.
|
|
1682
|
-
*/
|
|
1683
|
-
get valueColumns():Column[];
|
|
1684
|
-
/**
|
|
1685
|
-
* The source table for this Input Table
|
|
1686
|
-
* @return dh.table
|
|
1687
|
-
*/
|
|
1688
|
-
get table():Table;
|
|
1689
|
-
}
|
|
1690
|
-
|
|
1691
|
-
/**
|
|
1692
|
-
* This object serves as a "handle" to a subscription, allowing it to be acted on directly or canceled outright. If you
|
|
1693
|
-
* retain an instance of this, you have two choices - either only use it to call `close()` on it to stop the table's
|
|
1694
|
-
* viewport without creating a new one, or listen directly to this object instead of the table for data events, and
|
|
1695
|
-
* always call `close()` when finished. Calling any method on this object other than close() will result in it
|
|
1696
|
-
* continuing to live on after `setViewport` is called on the original table, or after the table is modified.
|
|
1697
|
-
*/
|
|
1698
|
-
export class TableViewportSubscription implements HasEventHandling {
|
|
1699
|
-
protected constructor();
|
|
1700
|
-
|
|
1701
|
-
/**
|
|
1702
|
-
* Changes the rows and columns set on this viewport. This cannot be used to change the update interval.
|
|
1703
|
-
* @param firstRow -
|
|
1704
|
-
* @param lastRow -
|
|
1705
|
-
* @param columns -
|
|
1706
|
-
* @param updateIntervalMs -
|
|
1462
|
+
* string (will be encoded as utf8 bytes), or a {@link Uint8Array} value.
|
|
1463
|
+
* @return A promise that will resolve to the value passed as sharedTicketBytes when the object is ready to be read
|
|
1464
|
+
* by another client, or will reject if an error occurs.
|
|
1707
1465
|
*/
|
|
1708
|
-
|
|
1466
|
+
shareObject(object:Table|Widget|WidgetExportedObject|PartitionedTable|TotalsTable|TreeTable, sharedTicketBytes:string|Uint8Array):Promise<string|Uint8Array>;
|
|
1709
1467
|
/**
|
|
1710
|
-
*
|
|
1468
|
+
* Reads an object shared by another client to this server with the `sharedTicketBytes`. Until the other
|
|
1469
|
+
* client releases this object (or their session ends), the object will be available on the server.
|
|
1470
|
+
* <p>
|
|
1471
|
+
* The type of the object must be passed so that the object can be read from the server correct - the other client
|
|
1472
|
+
* should provide this information.
|
|
1473
|
+
* @param sharedTicketBytes - the value provided by another client/user to obtain the object. It may be a unicode
|
|
1474
|
+
* string (will be encoded as utf8 bytes), or a {@link Uint8Array} value.
|
|
1475
|
+
* @param type - The type of the object, so it can be correctly read from the server
|
|
1476
|
+
* @return A promise that will resolve to the shared object, or will reject with an error if it cannot be read.
|
|
1711
1477
|
*/
|
|
1712
|
-
|
|
1478
|
+
getSharedObject(sharedTicketBytes:string|Uint8Array, type:string):Promise<any>;
|
|
1713
1479
|
/**
|
|
1714
|
-
*
|
|
1715
|
-
*
|
|
1480
|
+
* Register a callback function to handle any log messages that are emitted on the server. Returns a function ,
|
|
1481
|
+
* which can be invoked to remove this log handler. Any log handler registered in this way will receive as many old
|
|
1482
|
+
* log messages as are presently available.
|
|
1483
|
+
* @param callback -
|
|
1484
|
+
* @return {@link io.deephaven.web.shared.fu.JsRunnable}
|
|
1716
1485
|
*/
|
|
1717
|
-
|
|
1718
|
-
|
|
1486
|
+
onLogMessage(callback:(arg0:dh.ide.LogItem)=>void):()=>void;
|
|
1487
|
+
startSession(type:string):Promise<IdeSession>;
|
|
1488
|
+
getConsoleTypes():Promise<Array<string>>;
|
|
1489
|
+
getWorkerHeapInfo():Promise<WorkerHeapInfo>;
|
|
1719
1490
|
/**
|
|
1720
1491
|
* Listen for events on this object.
|
|
1721
1492
|
* @param name - the name of the event to listen for
|
|
@@ -1831,108 +1602,185 @@ export namespace dh {
|
|
|
1831
1602
|
}
|
|
1832
1603
|
|
|
1833
1604
|
/**
|
|
1834
|
-
*
|
|
1835
|
-
* @deprecated
|
|
1836
|
-
*/
|
|
1837
|
-
export class Client {
|
|
1838
|
-
static readonly EVENT_REQUEST_FAILED:string;
|
|
1839
|
-
static readonly EVENT_REQUEST_STARTED:string;
|
|
1840
|
-
static readonly EVENT_REQUEST_SUCCEEDED:string;
|
|
1841
|
-
|
|
1842
|
-
constructor();
|
|
1843
|
-
}
|
|
1844
|
-
|
|
1845
|
-
/**
|
|
1846
|
-
* Describes how a Totals Table will be generated from its parent table. Each table has a default (which may be null)
|
|
1847
|
-
* indicating how that table was configured when it was declared, and each Totals Table has a similar property
|
|
1848
|
-
* describing how it was created. Both the <b>Table.getTotalsTable</b> and <b>Table.getGrandTotalsTable</b> methods take
|
|
1849
|
-
* this config as an optional parameter - without it, the table's default will be used, or if null, a default instance
|
|
1850
|
-
* of <b>TotalsTableConfig</b> will be supplied.
|
|
1605
|
+
* A js type for operating on input tables.
|
|
1851
1606
|
*
|
|
1852
|
-
*
|
|
1853
|
-
*
|
|
1854
|
-
*
|
|
1607
|
+
* Represents a User Input Table, which can have data added to it from other sources.
|
|
1608
|
+
*
|
|
1609
|
+
* You may add rows using dictionaries of key-value tuples (representing columns by name), add tables containing all the
|
|
1610
|
+
* key/value columns to add, or delete tables containing the keys to delete. Each operation is atomic, and will either
|
|
1611
|
+
* succeed completely or fail completely. To guarantee order of operations, apply an operation and wait for the response
|
|
1612
|
+
* before sending the next operation.
|
|
1613
|
+
*
|
|
1614
|
+
* Each table has one or more key columns, where each unique combination of keys will appear at most once in the table.
|
|
1615
|
+
*
|
|
1616
|
+
* To view the results of the Input Table, you should use standard table operations on the InputTable's source Table
|
|
1617
|
+
* object.
|
|
1855
1618
|
*/
|
|
1856
|
-
export class
|
|
1619
|
+
export class InputTable {
|
|
1620
|
+
protected constructor();
|
|
1621
|
+
|
|
1857
1622
|
/**
|
|
1858
|
-
*
|
|
1623
|
+
* Adds a single row to the table. For each key or value column name in the Input Table, we retrieve that javascript
|
|
1624
|
+
* property at that name and validate it can be put into the given column type.
|
|
1625
|
+
* @param row -
|
|
1626
|
+
* @param userTimeZone -
|
|
1627
|
+
* @return Promise of dh.InputTable
|
|
1859
1628
|
*/
|
|
1860
|
-
|
|
1629
|
+
addRow(row:{ [key: string]: any; }, userTimeZone?:string):Promise<InputTable>;
|
|
1861
1630
|
/**
|
|
1862
|
-
*
|
|
1631
|
+
* Add multiple rows to a table.
|
|
1632
|
+
* @param rows -
|
|
1633
|
+
* @param userTimeZone -
|
|
1634
|
+
* @return Promise of dh.InputTable
|
|
1863
1635
|
*/
|
|
1864
|
-
|
|
1636
|
+
addRows(rows:{ [key: string]: any; }[], userTimeZone?:string):Promise<InputTable>;
|
|
1865
1637
|
/**
|
|
1866
|
-
*
|
|
1638
|
+
* Add an entire table to this Input Table. Only column names that match the definition of the input table will be
|
|
1639
|
+
* copied, and all key columns must have values filled in. This only copies the current state of the source table;
|
|
1640
|
+
* future updates to the source table will not be reflected in the Input Table. The returned promise will be
|
|
1641
|
+
* resolved to the same InputTable instance this method was called upon once the server returns.
|
|
1642
|
+
* @param tableToAdd -
|
|
1643
|
+
* @return Promise of dh.InputTable
|
|
1867
1644
|
*/
|
|
1868
|
-
|
|
1645
|
+
addTable(tableToAdd:Table):Promise<InputTable>;
|
|
1869
1646
|
/**
|
|
1870
|
-
*
|
|
1647
|
+
* Add multiple tables to this Input Table.
|
|
1648
|
+
* @param tablesToAdd -
|
|
1649
|
+
* @return Promise of dh.InputTable
|
|
1871
1650
|
*/
|
|
1872
|
-
|
|
1651
|
+
addTables(tablesToAdd:Table[]):Promise<InputTable>;
|
|
1873
1652
|
/**
|
|
1874
|
-
*
|
|
1653
|
+
* Deletes an entire table from this Input Table. Key columns must match the Input Table.
|
|
1654
|
+
* @param tableToDelete -
|
|
1655
|
+
* @return Promise of dh.InputTable
|
|
1875
1656
|
*/
|
|
1876
|
-
|
|
1657
|
+
deleteTable(tableToDelete:Table):Promise<InputTable>;
|
|
1877
1658
|
/**
|
|
1878
|
-
*
|
|
1659
|
+
* Delete multiple tables from this Input Table.
|
|
1660
|
+
* @param tablesToDelete -
|
|
1661
|
+
* @return
|
|
1879
1662
|
*/
|
|
1880
|
-
|
|
1663
|
+
deleteTables(tablesToDelete:Table[]):Promise<InputTable>;
|
|
1881
1664
|
/**
|
|
1882
|
-
*
|
|
1665
|
+
* A list of the key columns, by name
|
|
1666
|
+
* @return String array.
|
|
1883
1667
|
*/
|
|
1884
|
-
|
|
1668
|
+
get keys():string[];
|
|
1885
1669
|
/**
|
|
1886
|
-
*
|
|
1670
|
+
* A list of the value columns, by name
|
|
1671
|
+
* @return String array.
|
|
1887
1672
|
*/
|
|
1888
|
-
|
|
1673
|
+
get values():string[];
|
|
1889
1674
|
/**
|
|
1890
|
-
*
|
|
1675
|
+
* A list of the key columns.
|
|
1676
|
+
* @return Column array.
|
|
1891
1677
|
*/
|
|
1892
|
-
|
|
1678
|
+
get keyColumns():Column[];
|
|
1893
1679
|
/**
|
|
1894
|
-
*
|
|
1680
|
+
* A list of the value Column objects
|
|
1681
|
+
* @return {@link dh.Column} array.
|
|
1895
1682
|
*/
|
|
1896
|
-
|
|
1683
|
+
get valueColumns():Column[];
|
|
1897
1684
|
/**
|
|
1898
|
-
*
|
|
1685
|
+
* The source table for this Input Table
|
|
1686
|
+
* @return dh.table
|
|
1899
1687
|
*/
|
|
1900
|
-
|
|
1688
|
+
get table():Table;
|
|
1689
|
+
}
|
|
1690
|
+
|
|
1691
|
+
/**
|
|
1692
|
+
* Describes a Sort present on the table. No visible constructor, created through the use of Column.sort(), will be tied
|
|
1693
|
+
* to that particular column data. Sort instances are immutable, and use a builder pattern to make modifications. All
|
|
1694
|
+
* methods return a new Sort instance.
|
|
1695
|
+
*/
|
|
1696
|
+
export class Sort {
|
|
1697
|
+
static readonly ASCENDING:string;
|
|
1698
|
+
static readonly DESCENDING:string;
|
|
1699
|
+
static readonly REVERSE:string;
|
|
1700
|
+
|
|
1701
|
+
protected constructor();
|
|
1702
|
+
|
|
1901
1703
|
/**
|
|
1902
|
-
*
|
|
1704
|
+
* Builds a Sort instance to sort values in ascending order.
|
|
1705
|
+
* @return {@link dh.Sort}
|
|
1903
1706
|
*/
|
|
1904
|
-
|
|
1707
|
+
asc():Sort;
|
|
1905
1708
|
/**
|
|
1906
|
-
*
|
|
1709
|
+
* Builds a Sort instance to sort values in descending order.
|
|
1710
|
+
* @return {@link dh.Sort}
|
|
1907
1711
|
*/
|
|
1908
|
-
|
|
1712
|
+
desc():Sort;
|
|
1909
1713
|
/**
|
|
1910
|
-
*
|
|
1714
|
+
* Builds a Sort instance which takes the absolute value before applying order.
|
|
1715
|
+
* @return {@link dh.Sort}
|
|
1911
1716
|
*/
|
|
1912
|
-
|
|
1717
|
+
abs():Sort;
|
|
1718
|
+
toString():string;
|
|
1913
1719
|
/**
|
|
1914
|
-
*
|
|
1915
|
-
*
|
|
1720
|
+
* True if the absolute value of the column should be used when sorting; defaults to false.
|
|
1721
|
+
* @return boolean
|
|
1916
1722
|
*/
|
|
1917
|
-
|
|
1723
|
+
get isAbs():boolean;
|
|
1918
1724
|
/**
|
|
1919
|
-
*
|
|
1920
|
-
*
|
|
1725
|
+
* The column which is sorted.
|
|
1726
|
+
* @return {@link dh.Column}
|
|
1921
1727
|
*/
|
|
1922
|
-
|
|
1728
|
+
get column():Column;
|
|
1729
|
+
/**
|
|
1730
|
+
* The direction of this sort, either <b>ASC</b>, <b>DESC</b>, or <b>REVERSE</b>.
|
|
1731
|
+
* @return String
|
|
1732
|
+
*/
|
|
1733
|
+
get direction():string;
|
|
1734
|
+
}
|
|
1735
|
+
|
|
1736
|
+
/**
|
|
1737
|
+
* Addition optional configuration that can be passed to the {@link dh.CoreClient} constructor.
|
|
1738
|
+
*/
|
|
1739
|
+
export class ConnectOptions {
|
|
1740
|
+
/**
|
|
1741
|
+
* Optional map of http header names and values to send to the server with each request.
|
|
1742
|
+
*/
|
|
1743
|
+
headers?:{ [key: string]: string; }|null;
|
|
1744
|
+
/**
|
|
1745
|
+
* True to enable debug logging. At this time, only enables logging for gRPC calls.
|
|
1746
|
+
*/
|
|
1747
|
+
debug?:boolean|null;
|
|
1748
|
+
/**
|
|
1749
|
+
* Set this to true to force the use of websockets when connecting to the deephaven instance, false to force the use
|
|
1750
|
+
* of `fetch`. Ignored if {@link dh.transportFactory} is set.
|
|
1751
|
+
* <p>
|
|
1752
|
+
* Defaults to null, indicating that the server URL should be checked to see if we connect with fetch or websockets.
|
|
1753
|
+
*/
|
|
1754
|
+
useWebsockets?:boolean|null;
|
|
1755
|
+
/**
|
|
1756
|
+
* The transport factory to use for creating gRPC streams. If specified, the JS API will ignore
|
|
1757
|
+
* {@link dh.useWebsockets} and its own internal logic for determining the appropriate transport to use.
|
|
1758
|
+
* <p>
|
|
1759
|
+
* Defaults to null, indicating that the JS API should determine the appropriate transport to use. If
|
|
1760
|
+
* `useWebsockets` is set to true, the JS API will use websockets, otherwise if the server url begins with
|
|
1761
|
+
* https, it will use fetch, otherwise it will use websockets.
|
|
1762
|
+
*/
|
|
1763
|
+
transportFactory?:dh.grpc.GrpcTransportFactory|null;
|
|
1923
1764
|
|
|
1924
1765
|
constructor();
|
|
1766
|
+
}
|
|
1767
|
+
|
|
1768
|
+
export class LongWrapper {
|
|
1769
|
+
protected constructor();
|
|
1925
1770
|
|
|
1771
|
+
static ofString(str:string):LongWrapper;
|
|
1772
|
+
asNumber():number;
|
|
1773
|
+
valueOf():string;
|
|
1926
1774
|
toString():string;
|
|
1927
1775
|
}
|
|
1928
1776
|
|
|
1929
1777
|
/**
|
|
1930
|
-
* Wrap
|
|
1778
|
+
* Wrap BigDecimal values for use in JS. Provides text formatting for display and access to the underlying value.
|
|
1931
1779
|
*/
|
|
1932
|
-
export class
|
|
1780
|
+
export class BigDecimalWrapper {
|
|
1933
1781
|
protected constructor();
|
|
1934
1782
|
|
|
1935
|
-
static ofString(
|
|
1783
|
+
static ofString(value:string):BigDecimalWrapper;
|
|
1936
1784
|
asNumber():number;
|
|
1937
1785
|
valueOf():string;
|
|
1938
1786
|
toString():string;
|
|
@@ -1940,242 +1788,311 @@ export namespace dh {
|
|
|
1940
1788
|
hashCode():number;
|
|
1941
1789
|
}
|
|
1942
1790
|
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
static readonly EVENT_REQUEST_STARTED:string;
|
|
1950
|
-
static readonly EVENT_REQUEST_SUCCEEDED:string;
|
|
1951
|
-
/**
|
|
1952
|
-
* @deprecated
|
|
1953
|
-
*/
|
|
1954
|
-
static readonly EVENT_REFRESH_TOKEN_UPDATED:string;
|
|
1955
|
-
static readonly LOGIN_TYPE_PASSWORD:string;
|
|
1956
|
-
static readonly LOGIN_TYPE_ANONYMOUS:string;
|
|
1957
|
-
|
|
1958
|
-
constructor(serverUrl:string, connectOptions?:ConnectOptions);
|
|
1959
|
-
|
|
1960
|
-
running():Promise<CoreClient>;
|
|
1961
|
-
getServerUrl():string;
|
|
1962
|
-
getAuthConfigValues():Promise<string[][]>;
|
|
1963
|
-
login(credentials:LoginCredentials):Promise<void>;
|
|
1964
|
-
relogin(token:RefreshToken):Promise<void>;
|
|
1965
|
-
onConnected(timeoutInMillis?:number):Promise<void>;
|
|
1966
|
-
getServerConfigValues():Promise<string[][]>;
|
|
1967
|
-
getStorageService():dh.storage.StorageService;
|
|
1968
|
-
getAsIdeConnection():Promise<IdeConnection>;
|
|
1969
|
-
disconnect():void;
|
|
1970
|
-
addEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):()=>void;
|
|
1971
|
-
nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<Event<T>>;
|
|
1972
|
-
hasListeners(name:string):boolean;
|
|
1973
|
-
removeEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):boolean;
|
|
1974
|
-
}
|
|
1975
|
-
|
|
1976
|
-
export class DateWrapper extends LongWrapper {
|
|
1791
|
+
/**
|
|
1792
|
+
* This class allows iteration over non-contiguous indexes. In the future, this will support the EcmaScript 2015
|
|
1793
|
+
* Iteration protocol, but for now has one method which returns an iterator, and also supports querying the size.
|
|
1794
|
+
* Additionally, we may add support for creating RangeSet objects to better serve some use cases.
|
|
1795
|
+
*/
|
|
1796
|
+
export class RangeSet {
|
|
1977
1797
|
protected constructor();
|
|
1978
1798
|
|
|
1979
|
-
static
|
|
1980
|
-
|
|
1799
|
+
static ofRange(first:number, last:number):RangeSet;
|
|
1800
|
+
static ofItems(rows:number[]):RangeSet;
|
|
1801
|
+
static ofRanges(ranges:RangeSet[]):RangeSet;
|
|
1802
|
+
static ofSortedRanges(ranges:RangeSet[]):RangeSet;
|
|
1803
|
+
/**
|
|
1804
|
+
* a new iterator over all indexes in this collection.
|
|
1805
|
+
* @return Iterator of {@link dh.LongWrapper}
|
|
1806
|
+
*/
|
|
1807
|
+
iterator():Iterator<LongWrapper>;
|
|
1808
|
+
/**
|
|
1809
|
+
* The total count of items contained in this collection. In some cases this can be expensive to compute, and
|
|
1810
|
+
* generally should not be needed except for debugging purposes, or preallocating space (i.e., do not call this
|
|
1811
|
+
* property each time through a loop).
|
|
1812
|
+
* @return double
|
|
1813
|
+
*/
|
|
1814
|
+
get size():number;
|
|
1981
1815
|
}
|
|
1982
1816
|
|
|
1983
1817
|
/**
|
|
1984
|
-
*
|
|
1985
|
-
*
|
|
1986
|
-
*
|
|
1987
|
-
* Any time a change is made, we build a new request and send it to the server, and wait for the updated state.
|
|
1988
|
-
* <p>
|
|
1989
|
-
* Semantics around getting updates from the server are slightly different - we don't "unset" the viewport here after
|
|
1990
|
-
* operations are performed, but encourage the client code to re-set them to the desired position.
|
|
1991
|
-
* <p>
|
|
1992
|
-
* The table size will be -1 until a viewport has been fetched.
|
|
1993
|
-
* <p>
|
|
1994
|
-
* Similar to a table, a Tree Table provides access to subscribed viewport data on the current hierarchy. A different
|
|
1995
|
-
* Row type is used within that viewport, showing the depth of that node within the tree and indicating details about
|
|
1996
|
-
* whether it has children or is expanded. The Tree Table itself then provides the ability to change if a row is
|
|
1997
|
-
* expanded or not. Methods used to control or check if a row should be expanded or not can be invoked on a TreeRow
|
|
1998
|
-
* instance, or on the number of the row (thus allowing for expanding/collapsing rows which are not currently visible in
|
|
1999
|
-
* the viewport).
|
|
2000
|
-
* <p>
|
|
2001
|
-
* Events and viewports are somewhat different from tables, due to the expense of computing the expanded/collapsed rows
|
|
2002
|
-
* and count of children at each level of the hierarchy, and differences in the data that is available.
|
|
2003
|
-
* <p>
|
|
2004
|
-
* <ul>
|
|
2005
|
-
* <li>There is no {@link Table.totalSize | totalSize} property.</li>
|
|
2006
|
-
* <li>The viewport is not un-set when changes are made to filter or sort, but changes will continue to be streamed in.
|
|
2007
|
-
* It is suggested that the viewport be changed to the desired position (usually the first N rows) after any filter/sort
|
|
2008
|
-
* change is made. Likewise, {@link getViewportData} will always return the most recent data, and will not wait if a
|
|
2009
|
-
* new operation is pending.</li>
|
|
2010
|
-
* <li>Custom columns are supported on Rollup tables, but not on Tree tables. If the TreeTable was created client-side,
|
|
2011
|
-
* the original Table can have custom columns applied, and the TreeTable can be recreated.</li>
|
|
2012
|
-
* <li>Whereas Table has a {@link Table.totalsTableConfig} property, it is defined here as a method,
|
|
2013
|
-
* {@link getTotalsTableConfig}. This returns a promise so the config can be fetched asynchronously.</li>
|
|
2014
|
-
* <li>Totals Tables for trees vary in behavior between tree tables and roll-up tables. This behavior is based on the
|
|
2015
|
-
* original flat table used to produce the Tree Table - for a hierarchical table (i.e. Table.treeTable in the query
|
|
2016
|
-
* config), the totals will include non-leaf nodes (since they are themselves actual rows in the table), but in a
|
|
2017
|
-
* roll-up table, the totals only include leaf nodes (as non-leaf nodes are generated through grouping the contents of
|
|
2018
|
-
* the original table). Roll-ups also have the {@link dh.includeConstituents} property, indicating that a
|
|
2019
|
-
* {@link dh.Column} in the tree may have a {@link Column.constituentType} property reflecting that the type of cells
|
|
2020
|
-
* where {@link TreeRowImpl.hasChildren} is false will be different from usual.</li>
|
|
2021
|
-
* </ul>
|
|
1818
|
+
* Provides access to data in a table. Note that several methods present their response through Promises. This allows
|
|
1819
|
+
* the client to both avoid actually connecting to the server until necessary, and also will permit some changes not to
|
|
1820
|
+
* inform the UI right away that they have taken place.
|
|
2022
1821
|
*/
|
|
2023
|
-
export class
|
|
1822
|
+
export class Table implements JoinableTable, HasEventHandling {
|
|
1823
|
+
readonly description?:string|null;
|
|
1824
|
+
readonly pluginName?:string|null;
|
|
1825
|
+
readonly layoutHints?:null|LayoutHints;
|
|
2024
1826
|
/**
|
|
2025
|
-
*
|
|
1827
|
+
* The table size has updated, so live scrollbars and the like can be updated accordingly.
|
|
1828
|
+
*/
|
|
1829
|
+
static readonly EVENT_SIZECHANGED:string;
|
|
1830
|
+
/**
|
|
1831
|
+
* The table size has updated, so live scrollbars and the like can be updated accordingly.
|
|
2026
1832
|
*/
|
|
2027
1833
|
static readonly EVENT_UPDATED:string;
|
|
2028
1834
|
/**
|
|
2029
|
-
*
|
|
1835
|
+
* The table size has updated, so live scrollbars and the like can be updated accordingly.
|
|
1836
|
+
*/
|
|
1837
|
+
static readonly EVENT_ROWADDED:string;
|
|
1838
|
+
/**
|
|
1839
|
+
* The table size has updated, so live scrollbars and the like can be updated accordingly.
|
|
1840
|
+
*/
|
|
1841
|
+
static readonly EVENT_ROWREMOVED:string;
|
|
1842
|
+
/**
|
|
1843
|
+
* The table size has updated, so live scrollbars and the like can be updated accordingly.
|
|
1844
|
+
*/
|
|
1845
|
+
static readonly EVENT_ROWUPDATED:string;
|
|
1846
|
+
/**
|
|
1847
|
+
* The table size has updated, so live scrollbars and the like can be updated accordingly.
|
|
1848
|
+
*/
|
|
1849
|
+
static readonly EVENT_SORTCHANGED:string;
|
|
1850
|
+
/**
|
|
1851
|
+
* The table size has updated, so live scrollbars and the like can be updated accordingly.
|
|
1852
|
+
*/
|
|
1853
|
+
static readonly EVENT_FILTERCHANGED:string;
|
|
1854
|
+
/**
|
|
1855
|
+
* The table size has updated, so live scrollbars and the like can be updated accordingly.
|
|
1856
|
+
*/
|
|
1857
|
+
static readonly EVENT_CUSTOMCOLUMNSCHANGED:string;
|
|
1858
|
+
/**
|
|
1859
|
+
* The table size has updated, so live scrollbars and the like can be updated accordingly.
|
|
2030
1860
|
*/
|
|
2031
1861
|
static readonly EVENT_DISCONNECT:string;
|
|
2032
1862
|
/**
|
|
2033
|
-
*
|
|
1863
|
+
* The table size has updated, so live scrollbars and the like can be updated accordingly.
|
|
2034
1864
|
*/
|
|
2035
1865
|
static readonly EVENT_RECONNECT:string;
|
|
2036
1866
|
/**
|
|
2037
|
-
*
|
|
1867
|
+
* The table size has updated, so live scrollbars and the like can be updated accordingly.
|
|
2038
1868
|
*/
|
|
2039
1869
|
static readonly EVENT_RECONNECTFAILED:string;
|
|
2040
1870
|
/**
|
|
2041
|
-
*
|
|
1871
|
+
* The table size has updated, so live scrollbars and the like can be updated accordingly.
|
|
2042
1872
|
*/
|
|
2043
1873
|
static readonly EVENT_REQUEST_FAILED:string;
|
|
2044
|
-
|
|
2045
|
-
|
|
1874
|
+
/**
|
|
1875
|
+
* The table size has updated, so live scrollbars and the like can be updated accordingly.
|
|
1876
|
+
*/
|
|
1877
|
+
static readonly EVENT_REQUEST_SUCCEEDED:string;
|
|
1878
|
+
/**
|
|
1879
|
+
* The size the table will have if it is uncoalesced.
|
|
1880
|
+
*/
|
|
1881
|
+
static readonly SIZE_UNCOALESCED:number;
|
|
2046
1882
|
|
|
2047
1883
|
protected constructor();
|
|
2048
1884
|
|
|
1885
|
+
batch(userCode:(arg0:unknown)=>void):Promise<Table>;
|
|
2049
1886
|
/**
|
|
2050
|
-
*
|
|
2051
|
-
*
|
|
2052
|
-
*
|
|
2053
|
-
*
|
|
2054
|
-
* @param row -
|
|
2055
|
-
* @param expandDescendants -
|
|
1887
|
+
* Retrieve a column by the given name. You should prefer to always retrieve a new Column instance instead of
|
|
1888
|
+
* caching a returned value.
|
|
1889
|
+
* @param key -
|
|
1890
|
+
* @return {@link dh.Column}
|
|
2056
1891
|
*/
|
|
2057
|
-
|
|
1892
|
+
findColumn(key:string):Column;
|
|
2058
1893
|
/**
|
|
2059
|
-
*
|
|
2060
|
-
*
|
|
2061
|
-
* @
|
|
1894
|
+
* Retrieve multiple columns specified by the given names.
|
|
1895
|
+
* @param keys -
|
|
1896
|
+
* @return {@link dh.Column} array
|
|
2062
1897
|
*/
|
|
2063
|
-
|
|
1898
|
+
findColumns(keys:string[]):Column[];
|
|
1899
|
+
isBlinkTable():boolean;
|
|
2064
1900
|
/**
|
|
2065
|
-
*
|
|
2066
|
-
* the
|
|
2067
|
-
*
|
|
2068
|
-
* @param row - the row to expand or collapse, either the absolute row index or the row object
|
|
2069
|
-
* @param isExpanded - true to expand the row, false to collapse
|
|
2070
|
-
* @param expandDescendants - true to expand the row and all descendants, false to expand only the row, defaults to
|
|
2071
|
-
* false
|
|
1901
|
+
* If .hasInputTable is true, you may call this method to gain access to an InputTable object which can be used to
|
|
1902
|
+
* mutate the data within the table. If the table is not an Input Table, the promise will be immediately rejected.
|
|
1903
|
+
* @return Promise of dh.InputTable
|
|
2072
1904
|
*/
|
|
2073
|
-
|
|
2074
|
-
expandAll():void;
|
|
2075
|
-
collapseAll():void;
|
|
1905
|
+
inputTable():Promise<InputTable>;
|
|
2076
1906
|
/**
|
|
2077
|
-
*
|
|
2078
|
-
* @param row - the row to test, either the absolute row index or the row object
|
|
2079
|
-
* @return boolean true if the row is expanded, false otherwise
|
|
1907
|
+
* Indicates that this Table instance will no longer be used, and its connection to the server can be cleaned up.
|
|
2080
1908
|
*/
|
|
2081
|
-
|
|
2082
|
-
|
|
2083
|
-
getViewportData():Promise<TreeViewportData>;
|
|
1909
|
+
close():void;
|
|
1910
|
+
getAttributes():string[];
|
|
2084
1911
|
/**
|
|
2085
|
-
*
|
|
1912
|
+
* null if no property exists, a string if it is an easily serializable property, or a ```Promise
|
|
1913
|
+
* <Table>``` that will either resolve with a table or error out if the object can't be passed to JS.
|
|
1914
|
+
* @param attributeName -
|
|
1915
|
+
* @return Object
|
|
2086
1916
|
*/
|
|
2087
|
-
|
|
1917
|
+
getAttribute(attributeName:string):unknown|undefined|null;
|
|
2088
1918
|
/**
|
|
2089
|
-
*
|
|
1919
|
+
* Replace the currently set sort on this table. Returns the previously set value. Note that the sort property will
|
|
1920
|
+
* immediately return the new value, but you may receive update events using the old sort before the new sort is
|
|
1921
|
+
* applied, and the <b>sortchanged</b> event fires. Reusing existing, applied sorts may enable this to perform
|
|
1922
|
+
* better on the server. The <b>updated</b> event will also fire, but <b>rowadded</b> and <b>rowremoved</b> will
|
|
1923
|
+
* not.
|
|
2090
1924
|
* @param sort -
|
|
2091
1925
|
* @return {@link dh.Sort} array
|
|
2092
1926
|
*/
|
|
2093
1927
|
applySort(sort:Sort[]):Array<Sort>;
|
|
2094
1928
|
/**
|
|
2095
|
-
*
|
|
2096
|
-
*
|
|
2097
|
-
*
|
|
1929
|
+
* Replace the currently set filters on the table. Returns the previously set value. Note that the filter property
|
|
1930
|
+
* will immediately return the new value, but you may receive update events using the old filter before the new one
|
|
1931
|
+
* is applied, and the <b>filterchanged</b> event fires. Reusing existing, applied filters may enable this to
|
|
1932
|
+
* perform better on the server. The <b>updated</b> event will also fire, but <b>rowadded</b> and <b>rowremoved</b>
|
|
1933
|
+
* will not.
|
|
2098
1934
|
* @param filter -
|
|
2099
1935
|
* @return {@link dh.FilterCondition} array
|
|
2100
1936
|
*/
|
|
2101
1937
|
applyFilter(filter:FilterCondition[]):Array<FilterCondition>;
|
|
2102
1938
|
/**
|
|
2103
|
-
*
|
|
2104
|
-
* but Tree tables will throw an {@link java.lang.UnsupportedOperationException} if this function is called.
|
|
1939
|
+
* used when adding new filter and sort operations to the table, as long as they are present.
|
|
2105
1940
|
* @param customColumns -
|
|
2106
1941
|
* @return {@link dh.CustomColumn} array
|
|
2107
1942
|
*/
|
|
2108
|
-
applyCustomColumns(customColumns:Array<string|CustomColumn>):Array<CustomColumn>;
|
|
1943
|
+
applyCustomColumns(customColumns:Array<string|CustomColumn>):Array<CustomColumn>;
|
|
1944
|
+
/**
|
|
1945
|
+
* If the columns parameter is not provided, all columns will be used. If the updateIntervalMs parameter is not
|
|
1946
|
+
* provided, a default of one second will be used. Until this is called, no data will be available. Invoking this
|
|
1947
|
+
* will result in events to be fired once data becomes available, starting with an `updated` event and a
|
|
1948
|
+
* <b>rowadded</b> event per row in that range. The returned object allows the viewport to be closed when no longer
|
|
1949
|
+
* needed.
|
|
1950
|
+
* @param firstRow -
|
|
1951
|
+
* @param lastRow -
|
|
1952
|
+
* @param columns -
|
|
1953
|
+
* @param updateIntervalMs -
|
|
1954
|
+
* @return {@link dh.TableViewportSubscription}
|
|
1955
|
+
*/
|
|
1956
|
+
setViewport(firstRow:number, lastRow:number, columns?:Array<Column>|undefined|null, updateIntervalMs?:number|undefined|null, isReverseViewport?:boolean|undefined|null):TableViewportSubscription;
|
|
1957
|
+
/**
|
|
1958
|
+
* Gets the currently visible viewport. If the current set of operations has not yet resulted in data, it will not
|
|
1959
|
+
* resolve until that data is ready. If this table is closed before the promise resolves, it will be rejected - to
|
|
1960
|
+
* separate the lifespan of this promise from the table itself, call
|
|
1961
|
+
* {@link TableViewportSubscription.getViewportData} on the result from {@link Table.setViewport}.
|
|
1962
|
+
* @return Promise of {@link dh.TableData}
|
|
1963
|
+
*/
|
|
1964
|
+
getViewportData():Promise<ViewportData>;
|
|
1965
|
+
/**
|
|
1966
|
+
* Creates a subscription to the specified columns, across all rows in the table. The optional parameter
|
|
1967
|
+
* updateIntervalMs may be specified to indicate how often the server should send updates, defaulting to one second
|
|
1968
|
+
* if omitted. Useful for charts or taking a snapshot of the table atomically. The initial snapshot will arrive in a
|
|
1969
|
+
* single event, but later changes will be sent as updates. However, this may still be very expensive to run from a
|
|
1970
|
+
* browser for very large tables. Each call to subscribe creates a new subscription, which must have <b>close()</b>
|
|
1971
|
+
* called on it to stop it, and all events are fired from the TableSubscription instance.
|
|
1972
|
+
* @param columns -
|
|
1973
|
+
* @param updateIntervalMs -
|
|
1974
|
+
* @return {@link dh.TableSubscription}
|
|
1975
|
+
*/
|
|
1976
|
+
subscribe(columns:Array<Column>, updateIntervalMs?:number):TableSubscription;
|
|
1977
|
+
/**
|
|
1978
|
+
* a new table containing the distinct tuples of values from the given columns that are present in the original
|
|
1979
|
+
* table. This table can be manipulated as any other table. Sorting is often desired as the default sort is the
|
|
1980
|
+
* order of appearance of values from the original table.
|
|
1981
|
+
* @param columns -
|
|
1982
|
+
* @return Promise of dh.Table
|
|
1983
|
+
*/
|
|
1984
|
+
selectDistinct(columns:Column[]):Promise<Table>;
|
|
1985
|
+
/**
|
|
1986
|
+
* Creates a new copy of this table, so it can be sorted and filtered separately, and maintain a different viewport.
|
|
1987
|
+
* @return Promise of dh.Table
|
|
1988
|
+
*/
|
|
1989
|
+
copy():Promise<Table>;
|
|
1990
|
+
/**
|
|
1991
|
+
* a promise that will resolve to a Totals Table of this table. This table will obey the configurations provided as
|
|
1992
|
+
* a parameter, or will use the table's default if no parameter is provided, and be updated once per second as
|
|
1993
|
+
* necessary. Note that multiple calls to this method will each produce a new TotalsTable which must have close()
|
|
1994
|
+
* called on it when not in use.
|
|
1995
|
+
* @param config -
|
|
1996
|
+
* @return Promise of dh.TotalsTable
|
|
1997
|
+
*/
|
|
1998
|
+
getTotalsTable(config?:TotalsTableConfig|undefined|null):Promise<TotalsTable>;
|
|
1999
|
+
/**
|
|
2000
|
+
* a promise that will resolve to a Totals Table of this table, ignoring any filters. See <b>getTotalsTable()</b>
|
|
2001
|
+
* above for more specifics.
|
|
2002
|
+
* @param config -
|
|
2003
|
+
* @return promise of dh.TotalsTable
|
|
2004
|
+
*/
|
|
2005
|
+
getGrandTotalsTable(config?:TotalsTableConfig|undefined|null):Promise<TotalsTable>;
|
|
2006
|
+
/**
|
|
2007
|
+
* a promise that will resolve to a new roll-up <b>TreeTable</b> of this table. Multiple calls to this method will
|
|
2008
|
+
* each produce a new <b>TreeTable</b> which must have close() called on it when not in use.
|
|
2009
|
+
* @param configObject -
|
|
2010
|
+
* @return Promise of dh.TreeTable
|
|
2011
|
+
*/
|
|
2012
|
+
rollup(configObject:RollupConfig):Promise<TreeTable>;
|
|
2109
2013
|
/**
|
|
2110
|
-
* a
|
|
2111
|
-
*
|
|
2112
|
-
* @
|
|
2014
|
+
* a promise that will resolve to a new `TreeTable` of this table. Multiple calls to this method will each produce a
|
|
2015
|
+
* new `TreeTable` which must have close() called on it when not in use.
|
|
2016
|
+
* @param configObject -
|
|
2017
|
+
* @return Promise dh.TreeTable
|
|
2113
2018
|
*/
|
|
2114
|
-
|
|
2019
|
+
treeTable(configObject:TreeTableConfig):Promise<TreeTable>;
|
|
2115
2020
|
/**
|
|
2116
|
-
*
|
|
2117
|
-
*
|
|
2118
|
-
*
|
|
2021
|
+
* a "frozen" version of this table (a server-side snapshot of the entire source table). Viewports on the frozen
|
|
2022
|
+
* table will not update. This does not change the original table, and the new table will not have any of the client
|
|
2023
|
+
* side sorts/filters/columns. New client side sorts/filters/columns can be added to the frozen copy.
|
|
2024
|
+
* @return Promise of dh.Table
|
|
2119
2025
|
*/
|
|
2120
|
-
|
|
2026
|
+
freeze():Promise<Table>;
|
|
2027
|
+
snapshot(baseTable:Table, doInitialSnapshot?:boolean, stampColumns?:string[]):Promise<Table>;
|
|
2121
2028
|
/**
|
|
2122
|
-
*
|
|
2123
|
-
*
|
|
2124
|
-
*
|
|
2125
|
-
* <li>Rollups may make no sense, since values are aggregated.</li>
|
|
2126
|
-
* <li>Values found on orphaned (and removed) nodes will show up in the resulting table, even though they are not in
|
|
2127
|
-
* the tree.</li>
|
|
2128
|
-
* <li>Values found on parent nodes which are only present in the tree since a child is visible will not be present
|
|
2129
|
-
* in the resulting table.</li>
|
|
2130
|
-
* </ul>
|
|
2029
|
+
*
|
|
2030
|
+
* @inheritDoc
|
|
2031
|
+
* @deprecated
|
|
2131
2032
|
*/
|
|
2132
|
-
|
|
2133
|
-
|
|
2134
|
-
|
|
2135
|
-
|
|
2033
|
+
join(joinType:string, rightTable:JoinableTable, columnsToMatch:Array<string>, columnsToAdd?:Array<string>|undefined|null, asOfMatchRule?:string|undefined|null):Promise<Table>;
|
|
2034
|
+
asOfJoin(rightTable:JoinableTable, columnsToMatch:Array<string>, columnsToAdd?:Array<string>|undefined|null, asOfMatchRule?:string|undefined|null):Promise<Table>;
|
|
2035
|
+
crossJoin(rightTable:JoinableTable, columnsToMatch:Array<string>, columnsToAdd?:Array<string>|undefined|null, reserveBits?:number|undefined|null):Promise<Table>;
|
|
2036
|
+
exactJoin(rightTable:JoinableTable, columnsToMatch:Array<string>, columnsToAdd?:Array<string>):Promise<Table>;
|
|
2037
|
+
naturalJoin(rightTable:JoinableTable, columnsToMatch:Array<string>, columnsToAdd?:Array<string>):Promise<Table>;
|
|
2038
|
+
byExternal(keys:object, dropKeys?:boolean):Promise<PartitionedTable>;
|
|
2136
2039
|
/**
|
|
2137
|
-
* a new
|
|
2138
|
-
*
|
|
2139
|
-
*
|
|
2140
|
-
*
|
|
2141
|
-
* @return Promise
|
|
2040
|
+
* Creates a new PartitionedTable from the contents of the current table, partitioning data based on the specified
|
|
2041
|
+
* keys.
|
|
2042
|
+
* @param keys -
|
|
2043
|
+
* @param dropKeys -
|
|
2044
|
+
* @return Promise dh.PartitionedTable
|
|
2142
2045
|
*/
|
|
2143
|
-
|
|
2046
|
+
partitionBy(keys:object, dropKeys?:boolean):Promise<PartitionedTable>;
|
|
2144
2047
|
/**
|
|
2145
|
-
*
|
|
2146
|
-
* @
|
|
2048
|
+
* a promise that will resolve to ColumnStatistics for the column of this table.
|
|
2049
|
+
* @param column -
|
|
2050
|
+
* @return Promise of dh.ColumnStatistics
|
|
2147
2051
|
*/
|
|
2148
|
-
|
|
2052
|
+
getColumnStatistics(column:Column):Promise<ColumnStatistics>;
|
|
2149
2053
|
/**
|
|
2150
|
-
*
|
|
2151
|
-
* @
|
|
2054
|
+
* Seek the row matching the data provided
|
|
2055
|
+
* @param startingRow - Row to start the seek from
|
|
2056
|
+
* @param column - Column to seek for value on
|
|
2057
|
+
* @param valueType - Type of value provided
|
|
2058
|
+
* @param seekValue - Value to seek
|
|
2059
|
+
* @param insensitive - Optional value to flag a search as case-insensitive. Defaults to `false`.
|
|
2060
|
+
* @param contains - Optional value to have the seek value do a contains search instead of exact equality. Defaults to
|
|
2061
|
+
* `false`.
|
|
2062
|
+
* @param isBackwards - Optional value to seek backwards through the table instead of forwards. Defaults to `false`.
|
|
2063
|
+
* @return A promise that resolves to the row value found.
|
|
2152
2064
|
*/
|
|
2153
|
-
|
|
2154
|
-
|
|
2065
|
+
seekRow(startingRow:number, column:Column, valueType:ValueTypeType, seekValue:any, insensitive?:boolean|undefined|null, contains?:boolean|undefined|null, isBackwards?:boolean|undefined|null):Promise<number>;
|
|
2066
|
+
toString():string;
|
|
2155
2067
|
/**
|
|
2156
|
-
* True if this table
|
|
2068
|
+
* True if this table represents a user Input Table (created by InputTable.newInputTable). When true, you may call
|
|
2069
|
+
* .inputTable() to add or remove data from the underlying table.
|
|
2157
2070
|
* @return boolean
|
|
2158
2071
|
*/
|
|
2159
|
-
get
|
|
2160
|
-
/**
|
|
2161
|
-
* The current number of rows given the table's contents and the various expand/collapse states of each node. (No
|
|
2162
|
-
* totalSize is provided at this time; its definition becomes unclear between roll-up and tree tables, especially
|
|
2163
|
-
* when considering collapse/expand states).
|
|
2164
|
-
* @return double
|
|
2165
|
-
*/
|
|
2166
|
-
get size():number;
|
|
2072
|
+
get hasInputTable():boolean;
|
|
2167
2073
|
/**
|
|
2168
|
-
* The columns that
|
|
2074
|
+
* The columns that are present on this table. This is always all possible columns. If you specify fewer columns in
|
|
2075
|
+
* .setViewport(), you will get only those columns in your ViewportData. <b>Number size</b> The total count of rows
|
|
2076
|
+
* in the table. The size can and will change; see the <b>sizechanged</b> event for details. Size will be negative
|
|
2077
|
+
* in exceptional cases (eg. the table is uncoalesced, see the <b>isUncoalesced</b> property for details).
|
|
2169
2078
|
* @return {@link dh.Column} array
|
|
2170
2079
|
*/
|
|
2171
2080
|
get columns():Array<Column>;
|
|
2172
2081
|
/**
|
|
2173
|
-
* The
|
|
2174
|
-
* @return
|
|
2082
|
+
* The default configuration to be used when building a <b>TotalsTable</b> for this table.
|
|
2083
|
+
* @return dh.TotalsTableConfig
|
|
2084
|
+
*/
|
|
2085
|
+
get totalsTableConfig():TotalsTableConfig;
|
|
2086
|
+
/**
|
|
2087
|
+
* An ordered list of Sorts to apply to the table. To update, call <b>applySort()</b>. Note that this getter will
|
|
2088
|
+
* return the new value immediately, even though it may take a little time to update on the server. You may listen
|
|
2089
|
+
* for the <b>sortchanged</b> event to know when to update the UI.
|
|
2090
|
+
* @return {@link dh.Sort} array
|
|
2175
2091
|
*/
|
|
2176
2092
|
get sort():Array<Sort>;
|
|
2177
2093
|
/**
|
|
2178
|
-
*
|
|
2094
|
+
* An ordered list of custom column formulas to add to the table, either adding new columns or replacing existing
|
|
2095
|
+
* ones. To update, call <b>applyCustomColumns()</b>.
|
|
2179
2096
|
* @return {@link dh.CustomColumn} array
|
|
2180
2097
|
*/
|
|
2181
2098
|
get customColumns():Array<CustomColumn>;
|
|
@@ -2186,360 +2103,245 @@ export namespace dh {
|
|
|
2186
2103
|
*/
|
|
2187
2104
|
get isRefreshing():boolean;
|
|
2188
2105
|
/**
|
|
2189
|
-
*
|
|
2190
|
-
*
|
|
2191
|
-
*
|
|
2192
|
-
* @return
|
|
2193
|
-
* @typeParam T - the type of the data that the event will provide
|
|
2106
|
+
* An ordered list of Filters to apply to the table. To update, call applyFilter(). Note that this getter will
|
|
2107
|
+
* return the new value immediately, even though it may take a little time to update on the server. You may listen
|
|
2108
|
+
* for the <b>filterchanged</b> event to know when to update the UI.
|
|
2109
|
+
* @return {@link dh.FilterCondition} array
|
|
2194
2110
|
*/
|
|
2195
|
-
|
|
2196
|
-
nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<Event<T>>;
|
|
2197
|
-
hasListeners(name:string):boolean;
|
|
2111
|
+
get filter():Array<FilterCondition>;
|
|
2198
2112
|
/**
|
|
2199
|
-
*
|
|
2200
|
-
*
|
|
2201
|
-
*
|
|
2202
|
-
* @return
|
|
2203
|
-
* @typeParam T -
|
|
2113
|
+
* The total count of the rows in the table, excluding any filters. Unlike {@link Table.size}, changes to this value
|
|
2114
|
+
* will not result in any event. If the table is unfiltered, this will return the same size as {@link Table.size}.
|
|
2115
|
+
* If this table was uncoalesced before it was filtered, this will return {@link dh.Table.SIZE_UNCOALESCED}.
|
|
2116
|
+
* @return the size of the table before filters, or {@link dh.Table.SIZE_UNCOALESCED}
|
|
2204
2117
|
*/
|
|
2205
|
-
|
|
2206
|
-
}
|
|
2207
|
-
|
|
2208
|
-
/**
|
|
2209
|
-
* This class allows iteration over non-contiguous indexes. In the future, this will support the EcmaScript 2015
|
|
2210
|
-
* Iteration protocol, but for now has one method which returns an iterator, and also supports querying the size.
|
|
2211
|
-
* Additionally, we may add support for creating RangeSet objects to better serve some use cases.
|
|
2212
|
-
*/
|
|
2213
|
-
export class RangeSet {
|
|
2214
|
-
protected constructor();
|
|
2215
|
-
|
|
2216
|
-
static ofRange(first:number, last:number):RangeSet;
|
|
2217
|
-
static ofItems(rows:number[]):RangeSet;
|
|
2218
|
-
static ofRanges(ranges:RangeSet[]):RangeSet;
|
|
2219
|
-
static ofSortedRanges(ranges:RangeSet[]):RangeSet;
|
|
2118
|
+
get totalSize():number;
|
|
2220
2119
|
/**
|
|
2221
|
-
*
|
|
2222
|
-
*
|
|
2120
|
+
* The total count of rows in the table. If there is a viewport subscription active, this size will be updated when
|
|
2121
|
+
* the subscription updates. If not, and {@link Table.uncoalesced} is true, the size will be
|
|
2122
|
+
* {@link dh.Table.SIZE_UNCOALESCED}. Otherwise, the size will be updated when the server's update graph processes changes.
|
|
2123
|
+
* <p>
|
|
2124
|
+
* When the size changes, the {@link dh.Table.EVENT_SIZECHANGED} event will be fired.
|
|
2125
|
+
* @return the size of the table, or {@link dh.Table.SIZE_UNCOALESCED} if there is no subscription and the table is
|
|
2126
|
+
* uncoalesced.
|
|
2223
2127
|
*/
|
|
2224
|
-
|
|
2128
|
+
get size():number;
|
|
2225
2129
|
/**
|
|
2226
|
-
*
|
|
2227
|
-
*
|
|
2228
|
-
* property each time through a loop).
|
|
2229
|
-
* @return double
|
|
2130
|
+
* True if this table has been closed.
|
|
2131
|
+
* @return boolean
|
|
2230
2132
|
*/
|
|
2231
|
-
get
|
|
2232
|
-
}
|
|
2233
|
-
|
|
2234
|
-
export class QueryInfo {
|
|
2235
|
-
static readonly EVENT_TABLE_OPENED:string;
|
|
2236
|
-
static readonly EVENT_DISCONNECT:string;
|
|
2237
|
-
static readonly EVENT_RECONNECT:string;
|
|
2238
|
-
static readonly EVENT_CONNECT:string;
|
|
2239
|
-
|
|
2240
|
-
protected constructor();
|
|
2241
|
-
}
|
|
2242
|
-
|
|
2243
|
-
/**
|
|
2244
|
-
* Event fired when a command is issued from the client.
|
|
2245
|
-
*/
|
|
2246
|
-
export class CommandInfo {
|
|
2247
|
-
constructor(code:string, result:Promise<dh.ide.CommandResult>);
|
|
2248
|
-
|
|
2249
|
-
get result():Promise<dh.ide.CommandResult>;
|
|
2250
|
-
get code():string;
|
|
2251
|
-
}
|
|
2252
|
-
|
|
2253
|
-
/**
|
|
2254
|
-
* A Widget represents a server side object that sends one or more responses to the client. The client can then
|
|
2255
|
-
* interpret these responses to see what to render, or how to respond.
|
|
2256
|
-
* <p>
|
|
2257
|
-
* Most custom object types result in a single response being sent to the client, often with other exported objects, but
|
|
2258
|
-
* some will have streamed responses, and allow the client to send follow-up requests of its own. This class's API is
|
|
2259
|
-
* backwards compatible, but as such does not offer a way to tell the difference between a streaming or non-streaming
|
|
2260
|
-
* object type, the client code that handles the payloads is expected to know what to expect. See
|
|
2261
|
-
* {@link dh.WidgetMessageDetails} for more information.
|
|
2262
|
-
* <p>
|
|
2263
|
-
* When the promise that returns this object resolves, it will have the first response assigned to its fields. Later
|
|
2264
|
-
* responses from the server will be emitted as "message" events. When the connection with the server ends, the "close"
|
|
2265
|
-
* event will be emitted. In this way, the connection will behave roughly in the same way as a WebSocket - either side
|
|
2266
|
-
* can close, and after close no more messages will be processed. There can be some latency in closing locally while
|
|
2267
|
-
* remote messages are still pending - it is up to implementations of plugins to handle this case.
|
|
2268
|
-
* <p>
|
|
2269
|
-
* Also like WebSockets, the plugin API doesn't define how to serialize messages, and just handles any binary payloads.
|
|
2270
|
-
* What it does handle however, is allowing those messages to include references to server-side objects with those
|
|
2271
|
-
* payloads. Those server side objects might be tables or other built-in types in the Deephaven JS API, or could be
|
|
2272
|
-
* objects usable through their own plugins. They also might have no plugin at all, allowing the client to hold a
|
|
2273
|
-
* reference to them and pass them back to the server, either to the current plugin instance, or through another API.
|
|
2274
|
-
* The `Widget` type does not specify how those objects should be used or their lifecycle, but leaves that
|
|
2275
|
-
* entirely to the plugin. Messages will arrive in the order they were sent.
|
|
2276
|
-
* <p>
|
|
2277
|
-
* This can suggest several patterns for how plugins operate:
|
|
2278
|
-
* <ul>
|
|
2279
|
-
* <li>The plugin merely exists to transport some other object to the client. This can be useful for objects which can
|
|
2280
|
-
* easily be translated to some other type (like a Table) when the user clicks on it. An example of this is
|
|
2281
|
-
* `pandas.DataFrame` will result in a widget that only contains a static
|
|
2282
|
-
* {@link dh.Table}. Presently, the widget is immediately closed, and only the Table is
|
|
2283
|
-
* provided to the JS API consumer.</li>
|
|
2284
|
-
* <li>The plugin provides references to Tables and other objects, and those objects can live longer than the object
|
|
2285
|
-
* which provided them. One concrete example of this could have been
|
|
2286
|
-
* {@link dh.PartitionedTable} when fetching constituent tables, but it was implemented
|
|
2287
|
-
* before bidirectional plugins were implemented. Another example of this is plugins that serve as a "factory", giving
|
|
2288
|
-
* the user access to table manipulation/creation methods not supported by gRPC or the JS API.</li>
|
|
2289
|
-
* <li>The plugin provides reference to Tables and other objects that only make sense within the context of the widget
|
|
2290
|
-
* instance, so when the widget goes away, those objects should be released as well. This is also an example of
|
|
2291
|
-
* {@link dh.PartitionedTable}, as the partitioned table tracks creation of new keys through
|
|
2292
|
-
* an internal table instance.</li>
|
|
2293
|
-
* </ul>
|
|
2294
|
-
*
|
|
2295
|
-
* Handling server objects in messages also has more than one potential pattern that can be used:
|
|
2296
|
-
* <ul>
|
|
2297
|
-
* <li>One object per message - the message clearly is about that object, no other details required.</li>
|
|
2298
|
-
* <li>Objects indexed within their message - as each message comes with a list of objects, those objects can be
|
|
2299
|
-
* referenced within the payload by index. This is roughly how {@link dh.plot.Figure}
|
|
2300
|
-
* behaves, where the figure descriptor schema includes an index for each created series, describing which table should
|
|
2301
|
-
* be used, which columns should be mapped to each axis.</li>
|
|
2302
|
-
* <li>Objects indexed since widget creation - each message would append its objects to a list created when the widget
|
|
2303
|
-
* was first made, and any new exports that arrive in a new message would be appended to that list. Then, subsequent
|
|
2304
|
-
* messages can reference objects already sent. This imposes a limitation where the client cannot release any exports
|
|
2305
|
-
* without the server somehow signaling that it will never reference that export again.</li>
|
|
2306
|
-
* </ul>
|
|
2307
|
-
*/
|
|
2308
|
-
export class Widget implements WidgetMessageDetails, HasEventHandling {
|
|
2309
|
-
static readonly EVENT_MESSAGE:string;
|
|
2310
|
-
static readonly EVENT_CLOSE:string;
|
|
2311
|
-
|
|
2312
|
-
protected constructor();
|
|
2313
|
-
|
|
2133
|
+
get isClosed():boolean;
|
|
2314
2134
|
/**
|
|
2315
|
-
*
|
|
2135
|
+
* Read-only. True if this table is uncoalesced, indicating that work must be done before the table can be used.
|
|
2136
|
+
* <p>
|
|
2137
|
+
* Uncoalesced tables are expensive to operate on - filter to a single partition or range of partitions before
|
|
2138
|
+
* subscribing to access only the desired data efficiently. A subscription can be specified without a filter, but
|
|
2139
|
+
* this can be very expensive. To see which partitions are available, check each column on the table to see which
|
|
2140
|
+
* have {@link Column.isPartitionColumn} as `true`, and filter those columns. To read the possible values
|
|
2141
|
+
* for those columns, use {@link Table.selectDistinct}.
|
|
2142
|
+
* @return True if the table is uncoaleced and should be filtered before operating on it, otherwise false.
|
|
2316
2143
|
*/
|
|
2317
|
-
|
|
2318
|
-
getDataAsBase64():string;
|
|
2319
|
-
getDataAsU8():Uint8Array;
|
|
2320
|
-
getDataAsString():string;
|
|
2144
|
+
get isUncoalesced():boolean;
|
|
2321
2145
|
/**
|
|
2322
|
-
*
|
|
2323
|
-
* @param
|
|
2324
|
-
* @param
|
|
2146
|
+
* Listen for events on this object.
|
|
2147
|
+
* @param name - the name of the event to listen for
|
|
2148
|
+
* @param callback - a function to call when the event occurs
|
|
2149
|
+
* @return Returns a cleanup function.
|
|
2150
|
+
* @typeParam T - the type of the data that the event will provide
|
|
2325
2151
|
*/
|
|
2326
|
-
sendMessage(msg:string|ArrayBuffer|ArrayBufferView, references?:Array<Table|Widget|WidgetExportedObject|PartitionedTable|TotalsTable|TreeTable>):void;
|
|
2327
2152
|
addEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):()=>void;
|
|
2328
2153
|
nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<Event<T>>;
|
|
2329
2154
|
hasListeners(name:string):boolean;
|
|
2330
|
-
removeEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):boolean;
|
|
2331
2155
|
/**
|
|
2332
|
-
*
|
|
2333
|
-
* @
|
|
2334
|
-
*
|
|
2156
|
+
* Removes an event listener added to this table.
|
|
2157
|
+
* @param name -
|
|
2158
|
+
* @param callback -
|
|
2159
|
+
* @return
|
|
2160
|
+
* @typeParam T -
|
|
2335
2161
|
*/
|
|
2336
|
-
|
|
2162
|
+
removeEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):boolean;
|
|
2337
2163
|
/**
|
|
2338
|
-
*
|
|
2339
|
-
*
|
|
2164
|
+
* a Sort than can be used to reverse a table. This can be passed into n array in applySort. Note that Tree Tables
|
|
2165
|
+
* do not support reverse.
|
|
2166
|
+
* @return {@link dh.Sort}
|
|
2340
2167
|
*/
|
|
2341
|
-
|
|
2168
|
+
static reverse():Sort;
|
|
2342
2169
|
}
|
|
2343
2170
|
|
|
2344
2171
|
/**
|
|
2345
|
-
*
|
|
2172
|
+
* Event fired when a command is issued from the client.
|
|
2346
2173
|
*/
|
|
2347
|
-
export class
|
|
2348
|
-
|
|
2174
|
+
export class CommandInfo {
|
|
2175
|
+
constructor(code:string, result:Promise<dh.ide.CommandResult>);
|
|
2349
2176
|
|
|
2350
|
-
|
|
2351
|
-
|
|
2352
|
-
valueOf():string;
|
|
2353
|
-
toString():string;
|
|
2354
|
-
equals(o:object):boolean;
|
|
2355
|
-
hashCode():number;
|
|
2177
|
+
get result():Promise<dh.ide.CommandResult>;
|
|
2178
|
+
get code():string;
|
|
2356
2179
|
}
|
|
2357
2180
|
|
|
2358
2181
|
/**
|
|
2359
|
-
* Describes
|
|
2360
|
-
*
|
|
2182
|
+
* Describes a filter which can be applied to a table. Replacing these instances may be more expensive than reusing
|
|
2183
|
+
* them. These instances are immutable - all operations that compose them to build bigger expressions return a new
|
|
2184
|
+
* instance.
|
|
2361
2185
|
*/
|
|
2362
|
-
export class
|
|
2363
|
-
/**
|
|
2364
|
-
* If this column is part of a roll-up tree table, represents the type of the row data that can be found in this
|
|
2365
|
-
* column for leaf nodes if includeConstituents is enabled. Otherwise, it is <b>null</b>.
|
|
2366
|
-
* @return String
|
|
2367
|
-
*/
|
|
2368
|
-
readonly constituentType?:string|null;
|
|
2369
|
-
readonly description?:string|null;
|
|
2370
|
-
|
|
2186
|
+
export class FilterCondition {
|
|
2371
2187
|
protected constructor();
|
|
2372
2188
|
|
|
2373
2189
|
/**
|
|
2374
|
-
* the
|
|
2375
|
-
* @
|
|
2376
|
-
* @return Any
|
|
2190
|
+
* the opposite of this condition
|
|
2191
|
+
* @return FilterCondition
|
|
2377
2192
|
*/
|
|
2378
|
-
|
|
2379
|
-
getFormat(row:Row):Format;
|
|
2193
|
+
not():FilterCondition;
|
|
2380
2194
|
/**
|
|
2381
|
-
*
|
|
2382
|
-
* @
|
|
2195
|
+
* a condition representing the current condition logically ANDed with the other parameters
|
|
2196
|
+
* @param filters -
|
|
2197
|
+
* @return FilterCondition
|
|
2383
2198
|
*/
|
|
2384
|
-
|
|
2199
|
+
and(...filters:FilterCondition[]):FilterCondition;
|
|
2385
2200
|
/**
|
|
2386
|
-
*
|
|
2387
|
-
*
|
|
2388
|
-
* @return
|
|
2201
|
+
* a condition representing the current condition logically ORed with the other parameters
|
|
2202
|
+
* @param filters -
|
|
2203
|
+
* @return FilterCondition.
|
|
2389
2204
|
*/
|
|
2390
|
-
|
|
2205
|
+
or(...filters:FilterCondition[]):FilterCondition;
|
|
2391
2206
|
/**
|
|
2392
|
-
* a
|
|
2393
|
-
* @
|
|
2394
|
-
* @return {@link dh.CustomColumn}
|
|
2207
|
+
* a string suitable for debugging showing the details of this condition.
|
|
2208
|
+
* @return String.
|
|
2395
2209
|
*/
|
|
2396
|
-
|
|
2210
|
+
toString():string;
|
|
2211
|
+
get columns():Array<Column>;
|
|
2397
2212
|
/**
|
|
2398
|
-
* a
|
|
2399
|
-
*
|
|
2400
|
-
*
|
|
2213
|
+
* a filter condition invoking a static function with the given parameters. Currently supported Deephaven static
|
|
2214
|
+
* functions:
|
|
2215
|
+
* <ul>
|
|
2216
|
+
* <li><b>inRange</b>: Given three comparable values, returns true if the first is less than the second but greater
|
|
2217
|
+
* than the third</li>
|
|
2218
|
+
* <li><b>isInf</b>:Returns true if the given number is <i>infinity</i></li>
|
|
2219
|
+
* <li><b>isNaN</b>:Returns true if the given number is <i>not a number</i></li>
|
|
2220
|
+
* <li><b>isNormal</b>:Returns true if the given number <i>is not null</i>, <i>is not infinity</i>, and <i>is not
|
|
2221
|
+
* "not a number"</i></li>
|
|
2222
|
+
* <li><b>startsWith</b>:Returns true if the first string starts with the second string</li>
|
|
2223
|
+
* <li><b>endsWith</b>Returns true if the first string ends with the second string</li>
|
|
2224
|
+
* <li><b>matches</b>:Returns true if the first string argument matches the second string used as a Java regular
|
|
2225
|
+
* expression</li>
|
|
2226
|
+
* <li><b>contains</b>:Returns true if the first string argument contains the second string as a substring</li>
|
|
2227
|
+
* <li><b>in</b>:Returns true if the first string argument can be found in the second array argument.
|
|
2228
|
+
* <p>
|
|
2229
|
+
* Note that the array can only be specified as a column reference at this time - typically the `FilterValue.in`
|
|
2230
|
+
* method should be used in other cases
|
|
2231
|
+
* </p>
|
|
2232
|
+
* </li>
|
|
2233
|
+
* </ul>
|
|
2234
|
+
* @param function -
|
|
2235
|
+
* @param args -
|
|
2236
|
+
* @return dh.FilterCondition
|
|
2401
2237
|
*/
|
|
2402
|
-
|
|
2238
|
+
static invoke(func:string, ...args:FilterValue[]):FilterCondition;
|
|
2403
2239
|
/**
|
|
2404
|
-
* a
|
|
2405
|
-
*
|
|
2406
|
-
*
|
|
2240
|
+
* a filter condition which will check if the given value can be found in any supported column on whatever table
|
|
2241
|
+
* this FilterCondition is passed to. This FilterCondition is somewhat unique in that it need not be given a column
|
|
2242
|
+
* instance, but will adapt to any table. On numeric columns, with a value passed in which can be parsed as a
|
|
2243
|
+
* number, the column will be filtered to numbers which equal, or can be "rounded" effectively to this number. On
|
|
2244
|
+
* String columns, the given value will match any column which contains this string in a case-insensitive search. An
|
|
2245
|
+
* optional second argument can be passed, an array of `FilterValue` from the columns to limit this search to (see
|
|
2246
|
+
* {@link dh.Column.filter}).
|
|
2247
|
+
* @param value -
|
|
2248
|
+
* @param columns -
|
|
2249
|
+
* @return dh.FilterCondition
|
|
2407
2250
|
*/
|
|
2408
|
-
|
|
2251
|
+
static search(value:FilterValue, columns?:FilterValue[]):FilterCondition;
|
|
2252
|
+
}
|
|
2253
|
+
|
|
2254
|
+
export class CustomColumn {
|
|
2255
|
+
static readonly TYPE_FORMAT_COLOR:string;
|
|
2256
|
+
static readonly TYPE_FORMAT_NUMBER:string;
|
|
2257
|
+
static readonly TYPE_FORMAT_DATE:string;
|
|
2258
|
+
static readonly TYPE_NEW:string;
|
|
2259
|
+
|
|
2260
|
+
protected constructor();
|
|
2261
|
+
|
|
2262
|
+
valueOf():string;
|
|
2409
2263
|
toString():string;
|
|
2264
|
+
static from(columnInfo:string):CustomColumn;
|
|
2410
2265
|
/**
|
|
2411
|
-
*
|
|
2266
|
+
* The expression to evaluate this custom column.
|
|
2412
2267
|
* @return String
|
|
2413
2268
|
*/
|
|
2414
|
-
get
|
|
2269
|
+
get expression():string;
|
|
2415
2270
|
/**
|
|
2416
|
-
*
|
|
2417
|
-
*
|
|
2418
|
-
* @return true if the column is a partition column
|
|
2271
|
+
* The name of the column to use.
|
|
2272
|
+
* @return String
|
|
2419
2273
|
*/
|
|
2420
|
-
get
|
|
2274
|
+
get name():string;
|
|
2421
2275
|
/**
|
|
2422
|
-
*
|
|
2423
|
-
* @
|
|
2424
|
-
* @return int
|
|
2276
|
+
* The options for this custom column.
|
|
2277
|
+
* @return CustomColumOptions
|
|
2425
2278
|
*/
|
|
2426
|
-
get
|
|
2427
|
-
get isSortable():boolean;
|
|
2279
|
+
get options():CustomColumnOptions;
|
|
2428
2280
|
/**
|
|
2429
|
-
* Type of
|
|
2281
|
+
* Type of custom column. One of
|
|
2282
|
+
*
|
|
2283
|
+
* <ul>
|
|
2284
|
+
* <li>FORMAT_COLOR</li>
|
|
2285
|
+
* <li>FORMAT_NUMBER</li>
|
|
2286
|
+
* <li>FORMAT_DATE</li>
|
|
2287
|
+
* <li>NEW</li>
|
|
2288
|
+
* </ul>
|
|
2430
2289
|
* @return String
|
|
2431
2290
|
*/
|
|
2432
2291
|
get type():string;
|
|
2433
|
-
/**
|
|
2434
|
-
* Format entire rows colors using the expression specified. Returns a <b>CustomColumn</b> object to apply to a
|
|
2435
|
-
* table using <b>applyCustomColumns</b> with the parameters specified.
|
|
2436
|
-
* @param expression -
|
|
2437
|
-
* @param options -
|
|
2438
|
-
* @return {@link dh.CustomColumn}
|
|
2439
|
-
*/
|
|
2440
|
-
static formatRowColor(expression:string, options?:CustomColumnOptions|undefined|null):CustomColumn;
|
|
2441
|
-
/**
|
|
2442
|
-
* a <b>CustomColumn</b> object to apply using <b>applyCustomColumns</b> with the expression specified.
|
|
2443
|
-
* @param name -
|
|
2444
|
-
* @param expression -
|
|
2445
|
-
* @param options -
|
|
2446
|
-
* @return {@link dh.CustomColumn}
|
|
2447
|
-
*/
|
|
2448
|
-
static createCustomColumn(name:string, expression:string, options?:CustomColumnOptions|undefined|null):CustomColumn;
|
|
2449
2292
|
}
|
|
2450
2293
|
|
|
2451
|
-
|
|
2452
|
-
|
|
2453
|
-
|
|
2454
|
-
|
|
2455
|
-
*/
|
|
2456
|
-
export class TableMap {
|
|
2457
|
-
static readonly EVENT_KEYADDED:string;
|
|
2458
|
-
static readonly EVENT_DISCONNECT:string;
|
|
2459
|
-
static readonly EVENT_RECONNECT:string;
|
|
2460
|
-
static readonly EVENT_RECONNECTFAILED:string;
|
|
2294
|
+
export class LoginCredentials {
|
|
2295
|
+
type?:string|null;
|
|
2296
|
+
username?:string|null;
|
|
2297
|
+
token?:string|null;
|
|
2461
2298
|
|
|
2462
|
-
|
|
2299
|
+
constructor();
|
|
2463
2300
|
}
|
|
2464
2301
|
|
|
2465
2302
|
/**
|
|
2466
|
-
*
|
|
2467
|
-
*
|
|
2468
|
-
*
|
|
2469
|
-
* Unlike {@link dh.TableViewportSubscription}, the "original" table does not have a reference to this instance, only the
|
|
2470
|
-
* "private" table instance does, since the original cannot modify the subscription, and the private instance must
|
|
2471
|
-
* forward data to it.
|
|
2472
|
-
*
|
|
2473
|
-
* Represents a subscription to the table on the server. Changes made to the table will not be reflected here - the
|
|
2474
|
-
* subscription must be closed and a new one optioned to see those changes. The event model is slightly different from
|
|
2475
|
-
* viewports to make it less expensive to compute for large tables.
|
|
2303
|
+
* Deprecated for use in Deephaven Core.
|
|
2304
|
+
* @deprecated
|
|
2476
2305
|
*/
|
|
2477
|
-
export class
|
|
2478
|
-
|
|
2479
|
-
|
|
2480
|
-
|
|
2481
|
-
|
|
2482
|
-
|
|
2483
|
-
* @param updateIntervalMs - the new update interval, or null/omit to use the default of one second
|
|
2484
|
-
*/
|
|
2485
|
-
changeSubscription(columns:Array<Column>, updateIntervalMs:number|undefined|null):void;
|
|
2486
|
-
get columns():Array<Column>;
|
|
2487
|
-
/**
|
|
2488
|
-
* Stops the subscription on the server.
|
|
2489
|
-
*/
|
|
2490
|
-
close():void;
|
|
2491
|
-
/**
|
|
2492
|
-
* Listen for events on this object.
|
|
2493
|
-
* @param name - the name of the event to listen for
|
|
2494
|
-
* @param callback - a function to call when the event occurs
|
|
2495
|
-
* @return Returns a cleanup function.
|
|
2496
|
-
* @typeParam T - the type of the data that the event will provide
|
|
2497
|
-
*/
|
|
2498
|
-
addEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):()=>void;
|
|
2499
|
-
nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<Event<T>>;
|
|
2500
|
-
hasListeners(name:string):boolean;
|
|
2501
|
-
/**
|
|
2502
|
-
* Removes an event listener added to this table.
|
|
2503
|
-
* @param name -
|
|
2504
|
-
* @param callback -
|
|
2505
|
-
* @return
|
|
2506
|
-
* @typeParam T -
|
|
2507
|
-
*/
|
|
2508
|
-
removeEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):boolean;
|
|
2306
|
+
export class Client {
|
|
2307
|
+
static readonly EVENT_REQUEST_FAILED:string;
|
|
2308
|
+
static readonly EVENT_REQUEST_STARTED:string;
|
|
2309
|
+
static readonly EVENT_REQUEST_SUCCEEDED:string;
|
|
2310
|
+
|
|
2311
|
+
constructor();
|
|
2509
2312
|
}
|
|
2510
2313
|
|
|
2511
2314
|
/**
|
|
2512
|
-
*
|
|
2315
|
+
* Configuration object for running Table.treeTable to produce a hierarchical view of a given "flat" table.
|
|
2316
|
+
*
|
|
2317
|
+
* Like TotalsTableConfig, `TreeTableConfig` supports an operation map indicating how to aggregate the data, as well as
|
|
2318
|
+
* an array of column names which will be the layers in the roll-up tree, grouped at each level. An additional optional
|
|
2319
|
+
* value can be provided describing the strategy the engine should use when grouping the rows.
|
|
2513
2320
|
*/
|
|
2514
|
-
export class
|
|
2515
|
-
/**
|
|
2516
|
-
* Optional map of http header names and values to send to the server with each request.
|
|
2517
|
-
*/
|
|
2518
|
-
headers?:{ [key: string]: string; }|null;
|
|
2321
|
+
export class TreeTableConfig {
|
|
2519
2322
|
/**
|
|
2520
|
-
*
|
|
2323
|
+
* The column representing the unique ID for each item
|
|
2521
2324
|
*/
|
|
2522
|
-
|
|
2325
|
+
idColumn:string;
|
|
2523
2326
|
/**
|
|
2524
|
-
*
|
|
2525
|
-
* of `fetch`. Ignored if {@link dh.transportFactory} is set.
|
|
2526
|
-
* <p>
|
|
2527
|
-
* Defaults to null, indicating that the server URL should be checked to see if we connect with fetch or websockets.
|
|
2327
|
+
* The column representing the parent ID for each item
|
|
2528
2328
|
*/
|
|
2529
|
-
|
|
2329
|
+
parentColumn:string;
|
|
2530
2330
|
/**
|
|
2531
|
-
*
|
|
2532
|
-
* {@link dh.useWebsockets} and its own internal logic for determining the appropriate transport to use.
|
|
2533
|
-
* <p>
|
|
2534
|
-
* Defaults to null, indicating that the JS API should determine the appropriate transport to use. If
|
|
2535
|
-
* `useWebsockets` is set to true, the JS API will use websockets, otherwise if the server url begins with
|
|
2536
|
-
* https, it will use fetch, otherwise it will use websockets.
|
|
2331
|
+
* Optional parameter indicating if items with an invalid parent ID should be promoted to root. Defaults to false.
|
|
2537
2332
|
*/
|
|
2538
|
-
|
|
2333
|
+
promoteOrphansToRoot:boolean;
|
|
2539
2334
|
|
|
2540
2335
|
constructor();
|
|
2541
2336
|
}
|
|
2542
2337
|
|
|
2338
|
+
export class DateWrapper extends LongWrapper {
|
|
2339
|
+
protected constructor();
|
|
2340
|
+
|
|
2341
|
+
static ofJsDate(date:Date):DateWrapper;
|
|
2342
|
+
asDate():Date;
|
|
2343
|
+
}
|
|
2344
|
+
|
|
2543
2345
|
/**
|
|
2544
2346
|
* Describes a grouping and aggregations for a roll-up table. Pass to the <b>Table.rollup</b> function to create a
|
|
2545
2347
|
* roll-up table.
|
|
@@ -2570,23 +2372,205 @@ export namespace dh {
|
|
|
2570
2372
|
constructor();
|
|
2571
2373
|
}
|
|
2572
2374
|
|
|
2573
|
-
|
|
2574
2375
|
/**
|
|
2575
|
-
* A
|
|
2376
|
+
* A Widget represents a server side object that sends one or more responses to the client. The client can then
|
|
2377
|
+
* interpret these responses to see what to render, or how to respond.
|
|
2378
|
+
* <p>
|
|
2379
|
+
* Most custom object types result in a single response being sent to the client, often with other exported objects, but
|
|
2380
|
+
* some will have streamed responses, and allow the client to send follow-up requests of its own. This class's API is
|
|
2381
|
+
* backwards compatible, but as such does not offer a way to tell the difference between a streaming or non-streaming
|
|
2382
|
+
* object type, the client code that handles the payloads is expected to know what to expect. See
|
|
2383
|
+
* {@link dh.WidgetMessageDetails} for more information.
|
|
2384
|
+
* <p>
|
|
2385
|
+
* When the promise that returns this object resolves, it will have the first response assigned to its fields. Later
|
|
2386
|
+
* responses from the server will be emitted as "message" events. When the connection with the server ends, the "close"
|
|
2387
|
+
* event will be emitted. In this way, the connection will behave roughly in the same way as a WebSocket - either side
|
|
2388
|
+
* can close, and after close no more messages will be processed. There can be some latency in closing locally while
|
|
2389
|
+
* remote messages are still pending - it is up to implementations of plugins to handle this case.
|
|
2390
|
+
* <p>
|
|
2391
|
+
* Also like WebSockets, the plugin API doesn't define how to serialize messages, and just handles any binary payloads.
|
|
2392
|
+
* What it does handle however, is allowing those messages to include references to server-side objects with those
|
|
2393
|
+
* payloads. Those server side objects might be tables or other built-in types in the Deephaven JS API, or could be
|
|
2394
|
+
* objects usable through their own plugins. They also might have no plugin at all, allowing the client to hold a
|
|
2395
|
+
* reference to them and pass them back to the server, either to the current plugin instance, or through another API.
|
|
2396
|
+
* The `Widget` type does not specify how those objects should be used or their lifecycle, but leaves that
|
|
2397
|
+
* entirely to the plugin. Messages will arrive in the order they were sent.
|
|
2398
|
+
* <p>
|
|
2399
|
+
* This can suggest several patterns for how plugins operate:
|
|
2400
|
+
* <ul>
|
|
2401
|
+
* <li>The plugin merely exists to transport some other object to the client. This can be useful for objects which can
|
|
2402
|
+
* easily be translated to some other type (like a Table) when the user clicks on it. An example of this is
|
|
2403
|
+
* `pandas.DataFrame` will result in a widget that only contains a static
|
|
2404
|
+
* {@link dh.Table}. Presently, the widget is immediately closed, and only the Table is
|
|
2405
|
+
* provided to the JS API consumer.</li>
|
|
2406
|
+
* <li>The plugin provides references to Tables and other objects, and those objects can live longer than the object
|
|
2407
|
+
* which provided them. One concrete example of this could have been
|
|
2408
|
+
* {@link dh.PartitionedTable} when fetching constituent tables, but it was implemented
|
|
2409
|
+
* before bidirectional plugins were implemented. Another example of this is plugins that serve as a "factory", giving
|
|
2410
|
+
* the user access to table manipulation/creation methods not supported by gRPC or the JS API.</li>
|
|
2411
|
+
* <li>The plugin provides reference to Tables and other objects that only make sense within the context of the widget
|
|
2412
|
+
* instance, so when the widget goes away, those objects should be released as well. This is also an example of
|
|
2413
|
+
* {@link dh.PartitionedTable}, as the partitioned table tracks creation of new keys through
|
|
2414
|
+
* an internal table instance.</li>
|
|
2415
|
+
* </ul>
|
|
2416
|
+
*
|
|
2417
|
+
* Handling server objects in messages also has more than one potential pattern that can be used:
|
|
2418
|
+
* <ul>
|
|
2419
|
+
* <li>One object per message - the message clearly is about that object, no other details required.</li>
|
|
2420
|
+
* <li>Objects indexed within their message - as each message comes with a list of objects, those objects can be
|
|
2421
|
+
* referenced within the payload by index. This is roughly how {@link dh.plot.Figure}
|
|
2422
|
+
* behaves, where the figure descriptor schema includes an index for each created series, describing which table should
|
|
2423
|
+
* be used, which columns should be mapped to each axis.</li>
|
|
2424
|
+
* <li>Objects indexed since widget creation - each message would append its objects to a list created when the widget
|
|
2425
|
+
* was first made, and any new exports that arrive in a new message would be appended to that list. Then, subsequent
|
|
2426
|
+
* messages can reference objects already sent. This imposes a limitation where the client cannot release any exports
|
|
2427
|
+
* without the server somehow signaling that it will never reference that export again.</li>
|
|
2428
|
+
* </ul>
|
|
2576
2429
|
*/
|
|
2577
|
-
|
|
2578
|
-
|
|
2579
|
-
static readonly
|
|
2580
|
-
|
|
2581
|
-
|
|
2582
|
-
|
|
2583
|
-
|
|
2584
|
-
|
|
2585
|
-
|
|
2586
|
-
|
|
2587
|
-
|
|
2430
|
+
export class Widget implements WidgetMessageDetails, HasEventHandling {
|
|
2431
|
+
static readonly EVENT_MESSAGE:string;
|
|
2432
|
+
static readonly EVENT_CLOSE:string;
|
|
2433
|
+
|
|
2434
|
+
protected constructor();
|
|
2435
|
+
|
|
2436
|
+
/**
|
|
2437
|
+
* Ends the client connection to the server.
|
|
2438
|
+
*/
|
|
2439
|
+
close():void;
|
|
2440
|
+
getDataAsBase64():string;
|
|
2441
|
+
getDataAsU8():Uint8Array;
|
|
2442
|
+
getDataAsString():string;
|
|
2443
|
+
/**
|
|
2444
|
+
* Sends a string/bytes payload to the server, along with references to objects that exist on the server.
|
|
2445
|
+
* @param msg - string/buffer/view instance that represents data to send
|
|
2446
|
+
* @param references - an array of objects that can be safely sent to the server
|
|
2447
|
+
*/
|
|
2448
|
+
sendMessage(msg:string|ArrayBuffer|ArrayBufferView, references?:Array<Table|Widget|WidgetExportedObject|PartitionedTable|TotalsTable|TreeTable>):void;
|
|
2449
|
+
addEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):()=>void;
|
|
2450
|
+
nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<Event<T>>;
|
|
2451
|
+
hasListeners(name:string):boolean;
|
|
2452
|
+
removeEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):boolean;
|
|
2453
|
+
/**
|
|
2454
|
+
*
|
|
2455
|
+
* @return the exported objects sent in the initial message from the server. The client is responsible for closing
|
|
2456
|
+
* them when finished using them.
|
|
2457
|
+
*/
|
|
2458
|
+
get exportedObjects():WidgetExportedObject[];
|
|
2459
|
+
/**
|
|
2460
|
+
*
|
|
2461
|
+
* @return the type of this widget
|
|
2462
|
+
*/
|
|
2463
|
+
get type():string;
|
|
2464
|
+
}
|
|
2465
|
+
|
|
2466
|
+
export class IdeSession implements HasEventHandling {
|
|
2467
|
+
static readonly EVENT_COMMANDSTARTED:string;
|
|
2468
|
+
static readonly EVENT_REQUEST_FAILED:string;
|
|
2469
|
+
|
|
2470
|
+
protected constructor();
|
|
2471
|
+
|
|
2472
|
+
/**
|
|
2473
|
+
* Load the named table, with columns and size information already fully populated.
|
|
2474
|
+
* @param name -
|
|
2475
|
+
* @param applyPreviewColumns - optional boolean
|
|
2476
|
+
* @return {@link Promise} of {@link dh.Table}
|
|
2477
|
+
*/
|
|
2478
|
+
getTable(name:string, applyPreviewColumns?:boolean):Promise<Table>;
|
|
2479
|
+
/**
|
|
2480
|
+
* Load the named Figure, including its tables and tablemaps as needed.
|
|
2481
|
+
* @param name -
|
|
2482
|
+
* @return promise of dh.plot.Figure
|
|
2483
|
+
*/
|
|
2484
|
+
getFigure(name:string):Promise<dh.plot.Figure>;
|
|
2485
|
+
/**
|
|
2486
|
+
* Loads the named tree table or roll-up table, with column data populated. All nodes are collapsed by default, and
|
|
2487
|
+
* size is presently not available until the viewport is first set.
|
|
2488
|
+
* @param name -
|
|
2489
|
+
* @return {@link Promise} of {@link dh.TreeTable}
|
|
2490
|
+
*/
|
|
2491
|
+
getTreeTable(name:string):Promise<TreeTable>;
|
|
2492
|
+
getHierarchicalTable(name:string):Promise<TreeTable>;
|
|
2493
|
+
getPartitionedTable(name:string):Promise<PartitionedTable>;
|
|
2494
|
+
getObject(definitionObject:dh.ide.VariableDescriptor):Promise<any>;
|
|
2495
|
+
newTable(columnNames:string[], types:string[], data:string[][], userTimeZone:string):Promise<Table>;
|
|
2496
|
+
/**
|
|
2497
|
+
* Merges the given tables into a single table. Assumes all tables have the same structure.
|
|
2498
|
+
* @param tables -
|
|
2499
|
+
* @return {@link Promise} of {@link dh.Table}
|
|
2500
|
+
*/
|
|
2501
|
+
mergeTables(tables:Table[]):Promise<Table>;
|
|
2502
|
+
bindTableToVariable(table:Table, name:string):Promise<void>;
|
|
2503
|
+
/**
|
|
2504
|
+
* Makes the `object` available to another user or another client on this same server which knows the value of
|
|
2505
|
+
* the `sharedTicketBytes`. Use that sharedTicketBytes value like a one-time use password - any other client
|
|
2506
|
+
* which knows this value can read the same object.
|
|
2507
|
+
* <p>
|
|
2508
|
+
* Shared objects will remain available using the sharedTicketBytes until the client that first shared them
|
|
2509
|
+
* releases/closes their copy of the object. Whatever side-channel is used to share the bytes, be sure to wait until
|
|
2510
|
+
* the remote end has signaled that it has successfully fetched the object before releasing it from this client.
|
|
2511
|
+
* <p>
|
|
2512
|
+
* Be sure to use an unpredictable value for the shared ticket bytes, like a UUID or other large, random value to
|
|
2513
|
+
* prevent access by unauthorized clients.
|
|
2514
|
+
* @param object - the object to share with another client/user
|
|
2515
|
+
* @param sharedTicketBytes - the value which another client/user must know to obtain the object. It may be a unicode
|
|
2516
|
+
* string (will be encoded as utf8 bytes), or a {@link Uint8Array} value.
|
|
2517
|
+
* @return A promise that will resolve to the value passed as sharedTicketBytes when the object is ready to be read
|
|
2518
|
+
* by another client, or will reject if an error occurs.
|
|
2519
|
+
*/
|
|
2520
|
+
shareObject(object:Table|Widget|WidgetExportedObject|PartitionedTable|TotalsTable|TreeTable, sharedTicketBytes:string|Uint8Array):Promise<string|Uint8Array>;
|
|
2521
|
+
/**
|
|
2522
|
+
* Reads an object shared by another client to this server with the `sharedTicketBytes`. Until the other
|
|
2523
|
+
* client releases this object (or their session ends), the object will be available on the server.
|
|
2524
|
+
* <p>
|
|
2525
|
+
* The type of the object must be passed so that the object can be read from the server correct - the other client
|
|
2526
|
+
* should provide this information.
|
|
2527
|
+
* @param sharedTicketBytes - the value provided by another client/user to obtain the object. It may be a unicode
|
|
2528
|
+
* string (will be encoded as utf8 bytes), or a {@link Uint8Array} value.
|
|
2529
|
+
* @param type - The type of the object, so it can be correctly read from the server
|
|
2530
|
+
* @return A promise that will resolve to the shared object, or will reject with an error if it cannot be read.
|
|
2531
|
+
*/
|
|
2532
|
+
getSharedObject(sharedTicketBytes:string|Uint8Array, type:string):Promise<any>;
|
|
2533
|
+
subscribeToFieldUpdates(callback:(arg0:dh.ide.VariableChanges)=>void):()=>void;
|
|
2534
|
+
close():void;
|
|
2535
|
+
runCode(code:string):Promise<dh.ide.CommandResult>;
|
|
2536
|
+
onLogMessage(callback:(arg0:dh.ide.LogItem)=>void):()=>void;
|
|
2537
|
+
openDocument(params:object):void;
|
|
2538
|
+
changeDocument(params:object):void;
|
|
2539
|
+
getCompletionItems(params:object):Promise<Array<dh.lsp.CompletionItem>>;
|
|
2540
|
+
getSignatureHelp(params:object):Promise<Array<dh.lsp.SignatureInformation>>;
|
|
2541
|
+
getHover(params:object):Promise<dh.lsp.Hover>;
|
|
2542
|
+
closeDocument(params:object):void;
|
|
2543
|
+
/**
|
|
2544
|
+
* Creates an empty table with the specified number of rows. Optionally columns and types may be specified, but all
|
|
2545
|
+
* values will be null.
|
|
2546
|
+
* @param size -
|
|
2547
|
+
* @return {@link Promise} of {@link dh.Table}
|
|
2548
|
+
*/
|
|
2549
|
+
emptyTable(size:number):Promise<Table>;
|
|
2550
|
+
/**
|
|
2551
|
+
* Creates a new table that ticks automatically every "periodNanos" nanoseconds. A start time may be provided; if so
|
|
2552
|
+
* the table will be populated with the interval from the specified date until now.
|
|
2553
|
+
* @param periodNanos -
|
|
2554
|
+
* @param startTime -
|
|
2555
|
+
* @return {@link Promise} of {@link dh.Table}
|
|
2556
|
+
*/
|
|
2557
|
+
timeTable(periodNanos:number, startTime?:DateWrapper):Promise<Table>;
|
|
2558
|
+
addEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):()=>void;
|
|
2559
|
+
nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<Event<T>>;
|
|
2560
|
+
hasListeners(name:string):boolean;
|
|
2561
|
+
removeEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):boolean;
|
|
2562
|
+
}
|
|
2563
|
+
|
|
2564
|
+
export class QueryInfo {
|
|
2565
|
+
static readonly EVENT_TABLE_OPENED:string;
|
|
2566
|
+
static readonly EVENT_DISCONNECT:string;
|
|
2567
|
+
static readonly EVENT_RECONNECT:string;
|
|
2568
|
+
static readonly EVENT_CONNECT:string;
|
|
2569
|
+
|
|
2570
|
+
protected constructor();
|
|
2588
2571
|
}
|
|
2589
2572
|
|
|
2573
|
+
|
|
2590
2574
|
/**
|
|
2591
2575
|
* Describes the type of node in a rollup table.
|
|
2592
2576
|
*/
|
|
@@ -2603,6 +2587,22 @@ export namespace dh {
|
|
|
2603
2587
|
static readonly SEARCH_DISPLAY_SHOW:SearchDisplayModeType;
|
|
2604
2588
|
}
|
|
2605
2589
|
|
|
2590
|
+
/**
|
|
2591
|
+
* A set of string constants that can be used to describe the different objects the JS API can export.
|
|
2592
|
+
*/
|
|
2593
|
+
type VariableTypeType = string;
|
|
2594
|
+
export class VariableType {
|
|
2595
|
+
static readonly TABLE:VariableTypeType;
|
|
2596
|
+
static readonly TREETABLE:VariableTypeType;
|
|
2597
|
+
static readonly HIERARCHICALTABLE:VariableTypeType;
|
|
2598
|
+
static readonly TABLEMAP:VariableTypeType;
|
|
2599
|
+
static readonly PARTITIONEDTABLE:VariableTypeType;
|
|
2600
|
+
static readonly FIGURE:VariableTypeType;
|
|
2601
|
+
static readonly OTHERWIDGET:VariableTypeType;
|
|
2602
|
+
static readonly PANDAS:VariableTypeType;
|
|
2603
|
+
static readonly TREEMAP:VariableTypeType;
|
|
2604
|
+
}
|
|
2605
|
+
|
|
2606
2606
|
type ValueTypeType = string;
|
|
2607
2607
|
export class ValueType {
|
|
2608
2608
|
static readonly STRING:ValueTypeType;
|
|
@@ -2640,53 +2640,28 @@ export namespace dh {
|
|
|
2640
2640
|
export namespace dh.ide {
|
|
2641
2641
|
|
|
2642
2642
|
/**
|
|
2643
|
-
*
|
|
2644
|
-
*
|
|
2645
|
-
* <
|
|
2646
|
-
*
|
|
2643
|
+
* Describes changes in the current set of variables in the script session. Note that variables that changed value
|
|
2644
|
+
* without changing type will be included as <b>updated</b>, but if a new value with one type replaces an old value with
|
|
2645
|
+
* a different type, this will be included as an entry in both <b>removed</b> and <b>created</b> to indicate the old and
|
|
2646
|
+
* new types.
|
|
2647
2647
|
*/
|
|
2648
|
-
export interface
|
|
2649
|
-
get name():string;
|
|
2650
|
-
/**
|
|
2651
|
-
* Optional description for the variable's contents, typically used to provide more detail that wouldn't be
|
|
2652
|
-
* reasonable to put in the title
|
|
2653
|
-
* @return String
|
|
2654
|
-
*/
|
|
2655
|
-
get description():string;
|
|
2656
|
-
/**
|
|
2657
|
-
* An opaque identifier for this variable
|
|
2658
|
-
* @return String
|
|
2659
|
-
*/
|
|
2660
|
-
get id():string;
|
|
2661
|
-
/**
|
|
2662
|
-
* The type of the variable, one of <b>dh.VariableType</b>
|
|
2663
|
-
* @return dh.VariableType.
|
|
2664
|
-
*/
|
|
2665
|
-
get type():dh.VariableTypeType;
|
|
2648
|
+
export interface VariableChanges {
|
|
2666
2649
|
/**
|
|
2667
|
-
*
|
|
2668
|
-
* @return
|
|
2650
|
+
*
|
|
2651
|
+
* @return The variables that no longer exist after this operation, or were replaced by some variable with a
|
|
2652
|
+
* different type.
|
|
2669
2653
|
*/
|
|
2670
|
-
get
|
|
2654
|
+
get removed():Array<VariableDefinition>;
|
|
2671
2655
|
/**
|
|
2672
|
-
*
|
|
2673
|
-
*
|
|
2674
|
-
* @return String
|
|
2656
|
+
*
|
|
2657
|
+
* @return The variables that were created by this operation, or have a new type.
|
|
2675
2658
|
*/
|
|
2676
|
-
get
|
|
2659
|
+
get created():Array<VariableDefinition>;
|
|
2677
2660
|
/**
|
|
2678
|
-
*
|
|
2679
|
-
* @return
|
|
2661
|
+
*
|
|
2662
|
+
* @return The variables that changed value during this operation.
|
|
2680
2663
|
*/
|
|
2681
|
-
get
|
|
2682
|
-
}
|
|
2683
|
-
/**
|
|
2684
|
-
* Specifies a type and either id or name (but not both).
|
|
2685
|
-
*/
|
|
2686
|
-
export interface VariableDescriptor {
|
|
2687
|
-
type:string;
|
|
2688
|
-
id?:string|null;
|
|
2689
|
-
name?:string|null;
|
|
2664
|
+
get updated():Array<VariableDefinition>;
|
|
2690
2665
|
}
|
|
2691
2666
|
/**
|
|
2692
2667
|
* Represents a serialized fishlib LogRecord, suitable for display on javascript clients. A log entry sent from the
|
|
@@ -2710,6 +2685,14 @@ export namespace dh.ide {
|
|
|
2710
2685
|
get message():string;
|
|
2711
2686
|
}
|
|
2712
2687
|
/**
|
|
2688
|
+
* Specifies a type and either id or name (but not both).
|
|
2689
|
+
*/
|
|
2690
|
+
export interface VariableDescriptor {
|
|
2691
|
+
type:string;
|
|
2692
|
+
id?:string|null;
|
|
2693
|
+
name?:string|null;
|
|
2694
|
+
}
|
|
2695
|
+
/**
|
|
2713
2696
|
* Indicates the result of code run on the server.
|
|
2714
2697
|
*/
|
|
2715
2698
|
export interface CommandResult {
|
|
@@ -2725,28 +2708,45 @@ export namespace dh.ide {
|
|
|
2725
2708
|
get error():string;
|
|
2726
2709
|
}
|
|
2727
2710
|
/**
|
|
2728
|
-
*
|
|
2729
|
-
*
|
|
2730
|
-
*
|
|
2731
|
-
*
|
|
2711
|
+
* A format to describe a variable available to be read from the server. Application fields are optional, and only
|
|
2712
|
+
* populated when a variable is provided by application mode.
|
|
2713
|
+
* <p>
|
|
2714
|
+
* APIs which take a VariableDefinition must at least be provided an object with a <b>type</b> and <b>id</b> field.
|
|
2732
2715
|
*/
|
|
2733
|
-
export interface
|
|
2716
|
+
export interface VariableDefinition {
|
|
2717
|
+
get name():string;
|
|
2734
2718
|
/**
|
|
2735
|
-
*
|
|
2736
|
-
*
|
|
2737
|
-
*
|
|
2719
|
+
* Optional description for the variable's contents, typically used to provide more detail that wouldn't be
|
|
2720
|
+
* reasonable to put in the title
|
|
2721
|
+
* @return String
|
|
2738
2722
|
*/
|
|
2739
|
-
get
|
|
2723
|
+
get description():string;
|
|
2740
2724
|
/**
|
|
2741
|
-
*
|
|
2742
|
-
* @return
|
|
2725
|
+
* An opaque identifier for this variable
|
|
2726
|
+
* @return String
|
|
2743
2727
|
*/
|
|
2744
|
-
get
|
|
2728
|
+
get id():string;
|
|
2745
2729
|
/**
|
|
2746
|
-
*
|
|
2747
|
-
* @return
|
|
2730
|
+
* The type of the variable, one of <b>dh.VariableType</b>
|
|
2731
|
+
* @return dh.VariableType.
|
|
2748
2732
|
*/
|
|
2749
|
-
get
|
|
2733
|
+
get type():dh.VariableTypeType;
|
|
2734
|
+
/**
|
|
2735
|
+
* The name of the variable, to be used when rendering it to a user
|
|
2736
|
+
* @return String
|
|
2737
|
+
*/
|
|
2738
|
+
get title():string;
|
|
2739
|
+
/**
|
|
2740
|
+
* Optional description for the variable's contents, typically used to provide more detail that wouldn't be
|
|
2741
|
+
* reasonable to put in the title
|
|
2742
|
+
* @return String
|
|
2743
|
+
*/
|
|
2744
|
+
get applicationId():string;
|
|
2745
|
+
/**
|
|
2746
|
+
* The name of the application which provided this variable
|
|
2747
|
+
* @return String
|
|
2748
|
+
*/
|
|
2749
|
+
get applicationName():string;
|
|
2750
2750
|
}
|
|
2751
2751
|
}
|
|
2752
2752
|
|
|
@@ -2780,24 +2780,6 @@ export namespace dh.grpc {
|
|
|
2780
2780
|
onEnd:(error?:Error|undefined|null)=>void;
|
|
2781
2781
|
}
|
|
2782
2782
|
/**
|
|
2783
|
-
* Factory for creating gRPC transports.
|
|
2784
|
-
*/
|
|
2785
|
-
export interface GrpcTransportFactory {
|
|
2786
|
-
/**
|
|
2787
|
-
* Create a new transport instance.
|
|
2788
|
-
* @param options - options for creating the transport
|
|
2789
|
-
* @return a transport instance to use for gRPC communication
|
|
2790
|
-
*/
|
|
2791
|
-
create(options:GrpcTransportOptions):GrpcTransport;
|
|
2792
|
-
/**
|
|
2793
|
-
* Return true to signal that created transports may have {@link GrpcTransport.sendMessage} called on it
|
|
2794
|
-
* more than once before {@link GrpcTransport.finishSend} should be called.
|
|
2795
|
-
* @return true to signal that the implementation can stream multiple messages, false otherwise indicating that
|
|
2796
|
-
* Open/Next gRPC calls should be used
|
|
2797
|
-
*/
|
|
2798
|
-
get supportsClientStreaming():boolean;
|
|
2799
|
-
}
|
|
2800
|
-
/**
|
|
2801
2783
|
* gRPC transport implementation.
|
|
2802
2784
|
*/
|
|
2803
2785
|
export interface GrpcTransport {
|
|
@@ -2822,6 +2804,24 @@ export namespace dh.grpc {
|
|
|
2822
2804
|
*/
|
|
2823
2805
|
cancel():void;
|
|
2824
2806
|
}
|
|
2807
|
+
/**
|
|
2808
|
+
* Factory for creating gRPC transports.
|
|
2809
|
+
*/
|
|
2810
|
+
export interface GrpcTransportFactory {
|
|
2811
|
+
/**
|
|
2812
|
+
* Create a new transport instance.
|
|
2813
|
+
* @param options - options for creating the transport
|
|
2814
|
+
* @return a transport instance to use for gRPC communication
|
|
2815
|
+
*/
|
|
2816
|
+
create(options:GrpcTransportOptions):GrpcTransport;
|
|
2817
|
+
/**
|
|
2818
|
+
* Return true to signal that created transports may have {@link GrpcTransport.sendMessage} called on it
|
|
2819
|
+
* more than once before {@link GrpcTransport.finishSend} should be called.
|
|
2820
|
+
* @return true to signal that the implementation can stream multiple messages, false otherwise indicating that
|
|
2821
|
+
* Open/Next gRPC calls should be used
|
|
2822
|
+
*/
|
|
2823
|
+
get supportsClientStreaming():boolean;
|
|
2824
|
+
}
|
|
2825
2825
|
}
|
|
2826
2826
|
|
|
2827
2827
|
export namespace dh.i18n {
|
|
@@ -2869,115 +2869,17 @@ export namespace dh.i18n {
|
|
|
2869
2869
|
* @param text -
|
|
2870
2870
|
* @return double
|
|
2871
2871
|
*/
|
|
2872
|
-
parse(text:string):number;
|
|
2873
|
-
/**
|
|
2874
|
-
* Formats the specified number (or Java `long`, `BigInteger` or `BigDecimal` value) using this instance's pattern.
|
|
2875
|
-
* @param number -
|
|
2876
|
-
* @return String
|
|
2877
|
-
*/
|
|
2878
|
-
format(number:number|dh.BigIntegerWrapper|dh.BigDecimalWrapper|dh.LongWrapper):string;
|
|
2879
|
-
toString():string;
|
|
2880
|
-
}
|
|
2881
|
-
|
|
2882
|
-
|
|
2883
|
-
/**
|
|
2884
|
-
* Largely an exported wrapper for the GWT DateFormat, but also includes support for formatting nanoseconds as an
|
|
2885
|
-
* additional 6 decimal places after the rest of the number.
|
|
2886
|
-
*
|
|
2887
|
-
* Other concerns that this handles includes accepting a js Date and ignoring the lack of nanos, accepting a js Number
|
|
2888
|
-
* and assuming it to be a lossy nano value, and parsing into a js Date.
|
|
2889
|
-
*
|
|
2890
|
-
*
|
|
2891
|
-
* Utility class to parse and format various date/time values, using the same format patterns as are supported by the
|
|
2892
|
-
* standard Java implementation used in the Deephaven server and swing client.
|
|
2893
|
-
*
|
|
2894
|
-
* As Deephaven internally uses nanosecond precision to record dates, this API expects nanoseconds in most use cases,
|
|
2895
|
-
* with the one exception of the JS `Date` type, which is not capable of more precision than milliseconds. Note,
|
|
2896
|
-
* however, that when passing nanoseconds as a JS `Number` there is likely to be some loss of precision, though this is
|
|
2897
|
-
* still supported for easier interoperability with other JS code. The values returned by `parse()` will be an opaque
|
|
2898
|
-
* object wrapping the full precision of the specified date, However, this object supports `toString()` and `valueOf()`
|
|
2899
|
-
* to return a string representation of that value, as well as a `asNumber()` to return a JS `Number` value and a
|
|
2900
|
-
* `asDate()` to return a JS `Date` value.
|
|
2901
|
-
*
|
|
2902
|
-
*
|
|
2903
|
-
* Caveats:
|
|
2904
|
-
*
|
|
2905
|
-
*
|
|
2906
|
-
* - The `D` format (for "day of year") is not supported by this implementation at this time. - The `%t` format for
|
|
2907
|
-
* short timezone code is not supported by this implementation at this time, though `z` will work as expected in the
|
|
2908
|
-
* browser to emit the user's own timezone.
|
|
2909
|
-
*/
|
|
2910
|
-
export class DateTimeFormat {
|
|
2911
|
-
static readonly NANOS_PER_MILLI:number;
|
|
2912
|
-
|
|
2913
|
-
/**
|
|
2914
|
-
* Creates a new date/time format instance. This generally should be avoided in favor of the static `getFormat`
|
|
2915
|
-
* function, which will create and cache an instance so that later calls share the same instance.
|
|
2916
|
-
* @param pattern -
|
|
2917
|
-
*/
|
|
2918
|
-
constructor(pattern:string);
|
|
2919
|
-
|
|
2920
|
-
/**
|
|
2921
|
-
*
|
|
2922
|
-
* @param pattern -
|
|
2923
|
-
* @return a date format instance matching the specified format. If this format has not been specified before, a new
|
|
2924
|
-
* instance will be created and stored for later reuse.
|
|
2925
|
-
*/
|
|
2926
|
-
static getFormat(pattern:string):DateTimeFormat;
|
|
2927
|
-
/**
|
|
2928
|
-
* Accepts a variety of input objects to interpret as a date, and formats them using the specified pattern. A
|
|
2929
|
-
* `TimeZone` object can optionally be provided to format this date as the current date/time in that timezone.See
|
|
2930
|
-
* the instance method for more details on input objects.
|
|
2931
|
-
* @param pattern -
|
|
2932
|
-
* @param date -
|
|
2933
|
-
* @param timeZone -
|
|
2934
|
-
* @return
|
|
2935
|
-
*/
|
|
2936
|
-
static format(pattern:string, date:any, timeZone?:TimeZone):string;
|
|
2937
|
-
/**
|
|
2938
|
-
* Parses the given input string using the provided pattern, and returns a JS `Date` object in milliseconds.
|
|
2939
|
-
* @param pattern -
|
|
2940
|
-
* @param text -
|
|
2941
|
-
* @return
|
|
2942
|
-
*/
|
|
2943
|
-
static parseAsDate(pattern:string, text:string):Date;
|
|
2944
|
-
/**
|
|
2945
|
-
* Parses the given input string using the provided pattern, and returns a wrapped Java `long` value in nanoseconds.
|
|
2946
|
-
* A `TimeZone` object can optionally be provided to parse to a desired timezone.
|
|
2947
|
-
* @param pattern -
|
|
2948
|
-
* @param text -
|
|
2949
|
-
* @param tz -
|
|
2950
|
-
* @return
|
|
2951
|
-
*/
|
|
2952
|
-
static parse(pattern:string, text:string, tz?:TimeZone):dh.DateWrapper;
|
|
2953
|
-
/**
|
|
2954
|
-
* Takes a variety of objects to interpret as a date, and formats them using this instance's pattern. Inputs can
|
|
2955
|
-
* include a <b>String</b> value of a number expressed in nanoseconds, a <b>Number</b> value expressed in
|
|
2956
|
-
* nanoseconds, a JS <b>Date</b> object (necessarily in milliseconds), or a wrapped Java <b>long</b> value,
|
|
2957
|
-
* expressed in nanoseconds. A <b>TimeZone</b> object can optionally be provided to format this date as the current
|
|
2958
|
-
* date/time in that timezone.
|
|
2959
|
-
* @param date -
|
|
2960
|
-
* @param timeZone -
|
|
2961
|
-
* @return String
|
|
2962
|
-
*/
|
|
2963
|
-
format(date:any, timeZone?:TimeZone):string;
|
|
2964
|
-
/**
|
|
2965
|
-
* Parses the given string using this instance's pattern, and returns a wrapped Java <b>long</b> value in
|
|
2966
|
-
* nanoseconds. A <b>TimeZone</b> object can optionally be provided to parse to a desired timezone.
|
|
2967
|
-
* @param text -
|
|
2968
|
-
* @param tz -
|
|
2969
|
-
* @return
|
|
2970
|
-
*/
|
|
2971
|
-
parse(text:string, tz?:TimeZone):dh.DateWrapper;
|
|
2872
|
+
parse(text:string):number;
|
|
2972
2873
|
/**
|
|
2973
|
-
*
|
|
2974
|
-
* @param
|
|
2975
|
-
* @return
|
|
2874
|
+
* Formats the specified number (or Java `long`, `BigInteger` or `BigDecimal` value) using this instance's pattern.
|
|
2875
|
+
* @param number -
|
|
2876
|
+
* @return String
|
|
2976
2877
|
*/
|
|
2977
|
-
|
|
2878
|
+
format(number:number|dh.BigIntegerWrapper|dh.BigDecimalWrapper|dh.LongWrapper):string;
|
|
2978
2879
|
toString():string;
|
|
2979
2880
|
}
|
|
2980
2881
|
|
|
2882
|
+
|
|
2981
2883
|
/**
|
|
2982
2884
|
* Represents the timezones supported by Deephaven. Can be used to format dates, taking into account the offset changing
|
|
2983
2885
|
* throughout the year (potentially changing each year). These instances mostly are useful at this time to pass to the
|
|
@@ -3089,10 +2991,153 @@ export namespace dh.i18n {
|
|
|
3089
2991
|
get id():string;
|
|
3090
2992
|
}
|
|
3091
2993
|
|
|
2994
|
+
/**
|
|
2995
|
+
* Largely an exported wrapper for the GWT DateFormat, but also includes support for formatting nanoseconds as an
|
|
2996
|
+
* additional 6 decimal places after the rest of the number.
|
|
2997
|
+
*
|
|
2998
|
+
* Other concerns that this handles includes accepting a js Date and ignoring the lack of nanos, accepting a js Number
|
|
2999
|
+
* and assuming it to be a lossy nano value, and parsing into a js Date.
|
|
3000
|
+
*
|
|
3001
|
+
*
|
|
3002
|
+
* Utility class to parse and format various date/time values, using the same format patterns as are supported by the
|
|
3003
|
+
* standard Java implementation used in the Deephaven server and swing client.
|
|
3004
|
+
*
|
|
3005
|
+
* As Deephaven internally uses nanosecond precision to record dates, this API expects nanoseconds in most use cases,
|
|
3006
|
+
* with the one exception of the JS `Date` type, which is not capable of more precision than milliseconds. Note,
|
|
3007
|
+
* however, that when passing nanoseconds as a JS `Number` there is likely to be some loss of precision, though this is
|
|
3008
|
+
* still supported for easier interoperability with other JS code. The values returned by `parse()` will be an opaque
|
|
3009
|
+
* object wrapping the full precision of the specified date, However, this object supports `toString()` and `valueOf()`
|
|
3010
|
+
* to return a string representation of that value, as well as a `asNumber()` to return a JS `Number` value and a
|
|
3011
|
+
* `asDate()` to return a JS `Date` value.
|
|
3012
|
+
*
|
|
3013
|
+
*
|
|
3014
|
+
* Caveats:
|
|
3015
|
+
*
|
|
3016
|
+
*
|
|
3017
|
+
* - The `D` format (for "day of year") is not supported by this implementation at this time. - The `%t` format for
|
|
3018
|
+
* short timezone code is not supported by this implementation at this time, though `z` will work as expected in the
|
|
3019
|
+
* browser to emit the user's own timezone.
|
|
3020
|
+
*/
|
|
3021
|
+
export class DateTimeFormat {
|
|
3022
|
+
static readonly NANOS_PER_MILLI:number;
|
|
3023
|
+
|
|
3024
|
+
/**
|
|
3025
|
+
* Creates a new date/time format instance. This generally should be avoided in favor of the static `getFormat`
|
|
3026
|
+
* function, which will create and cache an instance so that later calls share the same instance.
|
|
3027
|
+
* @param pattern -
|
|
3028
|
+
*/
|
|
3029
|
+
constructor(pattern:string);
|
|
3030
|
+
|
|
3031
|
+
/**
|
|
3032
|
+
*
|
|
3033
|
+
* @param pattern -
|
|
3034
|
+
* @return a date format instance matching the specified format. If this format has not been specified before, a new
|
|
3035
|
+
* instance will be created and stored for later reuse.
|
|
3036
|
+
*/
|
|
3037
|
+
static getFormat(pattern:string):DateTimeFormat;
|
|
3038
|
+
/**
|
|
3039
|
+
* Accepts a variety of input objects to interpret as a date, and formats them using the specified pattern. A
|
|
3040
|
+
* `TimeZone` object can optionally be provided to format this date as the current date/time in that timezone.See
|
|
3041
|
+
* the instance method for more details on input objects.
|
|
3042
|
+
* @param pattern -
|
|
3043
|
+
* @param date -
|
|
3044
|
+
* @param timeZone -
|
|
3045
|
+
* @return
|
|
3046
|
+
*/
|
|
3047
|
+
static format(pattern:string, date:any, timeZone?:TimeZone):string;
|
|
3048
|
+
/**
|
|
3049
|
+
* Parses the given input string using the provided pattern, and returns a JS `Date` object in milliseconds.
|
|
3050
|
+
* @param pattern -
|
|
3051
|
+
* @param text -
|
|
3052
|
+
* @return
|
|
3053
|
+
*/
|
|
3054
|
+
static parseAsDate(pattern:string, text:string):Date;
|
|
3055
|
+
/**
|
|
3056
|
+
* Parses the given input string using the provided pattern, and returns a wrapped Java `long` value in nanoseconds.
|
|
3057
|
+
* A `TimeZone` object can optionally be provided to parse to a desired timezone.
|
|
3058
|
+
* @param pattern -
|
|
3059
|
+
* @param text -
|
|
3060
|
+
* @param tz -
|
|
3061
|
+
* @return
|
|
3062
|
+
*/
|
|
3063
|
+
static parse(pattern:string, text:string, tz?:TimeZone):dh.DateWrapper;
|
|
3064
|
+
/**
|
|
3065
|
+
* Takes a variety of objects to interpret as a date, and formats them using this instance's pattern. Inputs can
|
|
3066
|
+
* include a <b>String</b> value of a number expressed in nanoseconds, a <b>Number</b> value expressed in
|
|
3067
|
+
* nanoseconds, a JS <b>Date</b> object (necessarily in milliseconds), or a wrapped Java <b>long</b> value,
|
|
3068
|
+
* expressed in nanoseconds. A <b>TimeZone</b> object can optionally be provided to format this date as the current
|
|
3069
|
+
* date/time in that timezone.
|
|
3070
|
+
* @param date -
|
|
3071
|
+
* @param timeZone -
|
|
3072
|
+
* @return String
|
|
3073
|
+
*/
|
|
3074
|
+
format(date:any, timeZone?:TimeZone):string;
|
|
3075
|
+
/**
|
|
3076
|
+
* Parses the given string using this instance's pattern, and returns a wrapped Java <b>long</b> value in
|
|
3077
|
+
* nanoseconds. A <b>TimeZone</b> object can optionally be provided to parse to a desired timezone.
|
|
3078
|
+
* @param text -
|
|
3079
|
+
* @param tz -
|
|
3080
|
+
* @return
|
|
3081
|
+
*/
|
|
3082
|
+
parse(text:string, tz?:TimeZone):dh.DateWrapper;
|
|
3083
|
+
/**
|
|
3084
|
+
* Parses the given string using this instance's pattern, and returns a JS <b>Date</b> object in milliseconds.
|
|
3085
|
+
* @param text -
|
|
3086
|
+
* @return
|
|
3087
|
+
*/
|
|
3088
|
+
parseAsDate(text:string):Date;
|
|
3089
|
+
toString():string;
|
|
3090
|
+
}
|
|
3091
|
+
|
|
3092
3092
|
}
|
|
3093
3093
|
|
|
3094
3094
|
export namespace dh.plot {
|
|
3095
3095
|
|
|
3096
|
+
/**
|
|
3097
|
+
* Describes how to access and display data required within a series.
|
|
3098
|
+
*/
|
|
3099
|
+
export interface SeriesDataSource {
|
|
3100
|
+
/**
|
|
3101
|
+
* the type of data stored in the underlying table's Column.
|
|
3102
|
+
* @return String
|
|
3103
|
+
*/
|
|
3104
|
+
get columnType():string;
|
|
3105
|
+
/**
|
|
3106
|
+
* the axis that this source should be drawn on.
|
|
3107
|
+
* @return dh.plot.Axis
|
|
3108
|
+
*/
|
|
3109
|
+
get axis():Axis;
|
|
3110
|
+
/**
|
|
3111
|
+
* the feature of this series represented by this source. See the <b>SourceType</b> enum for more details.
|
|
3112
|
+
* @return int
|
|
3113
|
+
*/
|
|
3114
|
+
get type():SourceTypeType;
|
|
3115
|
+
}
|
|
3116
|
+
export interface OneClick {
|
|
3117
|
+
setValueForColumn(columnName:string, value:any):void;
|
|
3118
|
+
getValueForColumn(columName:string):any;
|
|
3119
|
+
get requireAllFiltersToDisplay():boolean;
|
|
3120
|
+
get columns():dh.Column[];
|
|
3121
|
+
}
|
|
3122
|
+
export interface FigureDataUpdatedEvent {
|
|
3123
|
+
getArray(series:Series, sourceType:number, mappingFunc?:(arg0:any)=>any):Array<any>;
|
|
3124
|
+
get series():Series[];
|
|
3125
|
+
}
|
|
3126
|
+
/**
|
|
3127
|
+
* Describes a template that will be used to make new series instances when a new table added to a plotBy.
|
|
3128
|
+
*/
|
|
3129
|
+
export interface MultiSeries {
|
|
3130
|
+
/**
|
|
3131
|
+
* The name for this multi-series.
|
|
3132
|
+
* @return String
|
|
3133
|
+
*/
|
|
3134
|
+
get name():string;
|
|
3135
|
+
/**
|
|
3136
|
+
* The plotting style to use for the series that will be created. See <b>SeriesPlotStyle</b> enum for more details.
|
|
3137
|
+
* @return int
|
|
3138
|
+
*/
|
|
3139
|
+
get plotStyle():SeriesPlotStyleType;
|
|
3140
|
+
}
|
|
3096
3141
|
/**
|
|
3097
3142
|
* Provides access to the data for displaying in a figure.
|
|
3098
3143
|
*/
|
|
@@ -3137,10 +3182,6 @@ export namespace dh.plot {
|
|
|
3137
3182
|
get multiSeries():MultiSeries;
|
|
3138
3183
|
get shapeLabel():string;
|
|
3139
3184
|
}
|
|
3140
|
-
export interface FigureDataUpdatedEvent {
|
|
3141
|
-
getArray(series:Series, sourceType:number, mappingFunc?:(arg0:any)=>any):Array<any>;
|
|
3142
|
-
get series():Series[];
|
|
3143
|
-
}
|
|
3144
3185
|
/**
|
|
3145
3186
|
* Defines one axis used with by series. These instances will be found both on the Chart and the Series instances, and
|
|
3146
3187
|
* may be shared between Series instances.
|
|
@@ -3209,72 +3250,86 @@ export namespace dh.plot {
|
|
|
3209
3250
|
get formatType():AxisFormatTypeType;
|
|
3210
3251
|
get minRange():number;
|
|
3211
3252
|
}
|
|
3212
|
-
|
|
3213
|
-
|
|
3214
|
-
|
|
3215
|
-
|
|
3216
|
-
|
|
3217
|
-
|
|
3218
|
-
|
|
3219
|
-
|
|
3220
|
-
|
|
3221
|
-
|
|
3222
|
-
|
|
3223
|
-
|
|
3224
|
-
|
|
3225
|
-
|
|
3226
|
-
|
|
3227
|
-
|
|
3228
|
-
|
|
3229
|
-
|
|
3230
|
-
export interface SeriesDataSource {
|
|
3231
|
-
/**
|
|
3232
|
-
* the type of data stored in the underlying table's Column.
|
|
3233
|
-
* @return String
|
|
3234
|
-
*/
|
|
3235
|
-
get columnType():string;
|
|
3236
|
-
/**
|
|
3237
|
-
* the axis that this source should be drawn on.
|
|
3238
|
-
* @return dh.plot.Axis
|
|
3239
|
-
*/
|
|
3240
|
-
get axis():Axis;
|
|
3241
|
-
/**
|
|
3242
|
-
* the feature of this series represented by this source. See the <b>SourceType</b> enum for more details.
|
|
3243
|
-
* @return int
|
|
3244
|
-
*/
|
|
3245
|
-
get type():SourceTypeType;
|
|
3246
|
-
}
|
|
3247
|
-
export interface OneClick {
|
|
3248
|
-
setValueForColumn(columnName:string, value:any):void;
|
|
3249
|
-
getValueForColumn(columName:string):any;
|
|
3250
|
-
get requireAllFiltersToDisplay():boolean;
|
|
3251
|
-
get columns():dh.Column[];
|
|
3253
|
+
|
|
3254
|
+
export class SeriesDescriptor {
|
|
3255
|
+
plotStyle:string;
|
|
3256
|
+
name?:string|null;
|
|
3257
|
+
linesVisible?:boolean|null;
|
|
3258
|
+
shapesVisible?:boolean|null;
|
|
3259
|
+
gradientVisible?:boolean|null;
|
|
3260
|
+
lineColor?:string|null;
|
|
3261
|
+
pointLabelFormat?:string|null;
|
|
3262
|
+
xToolTipPattern?:string|null;
|
|
3263
|
+
yToolTipPattern?:string|null;
|
|
3264
|
+
shapeLabel?:string|null;
|
|
3265
|
+
shapeSize?:number|null;
|
|
3266
|
+
shapeColor?:string|null;
|
|
3267
|
+
shape?:string|null;
|
|
3268
|
+
dataSources:Array<SourceDescriptor>;
|
|
3269
|
+
|
|
3270
|
+
constructor();
|
|
3252
3271
|
}
|
|
3253
3272
|
|
|
3254
|
-
export class
|
|
3255
|
-
|
|
3273
|
+
export class SourceDescriptor {
|
|
3274
|
+
axis:AxisDescriptor;
|
|
3275
|
+
table:dh.Table;
|
|
3276
|
+
columnName:string;
|
|
3256
3277
|
type:string;
|
|
3257
|
-
position:string;
|
|
3258
|
-
log?:boolean|null;
|
|
3259
|
-
label?:string|null;
|
|
3260
|
-
labelFont?:string|null;
|
|
3261
|
-
ticksFont?:string|null;
|
|
3262
|
-
formatPattern?:string|null;
|
|
3263
|
-
color?:string|null;
|
|
3264
|
-
minRange?:number|null;
|
|
3265
|
-
maxRange?:number|null;
|
|
3266
|
-
minorTicksVisible?:boolean|null;
|
|
3267
|
-
majorTicksVisible?:boolean|null;
|
|
3268
|
-
minorTickCount?:number|null;
|
|
3269
|
-
gapBetweenMajorTicks?:number|null;
|
|
3270
|
-
majorTickLocations?:Array<number>|null;
|
|
3271
|
-
tickLabelAngle?:number|null;
|
|
3272
|
-
invert?:boolean|null;
|
|
3273
|
-
isTimeAxis?:boolean|null;
|
|
3274
3278
|
|
|
3275
3279
|
constructor();
|
|
3276
3280
|
}
|
|
3277
3281
|
|
|
3282
|
+
/**
|
|
3283
|
+
* Helper class to manage snapshots and deltas and keep not only a contiguous JS array of data per column in the
|
|
3284
|
+
* underlying table, but also support a mapping function to let client code translate data in some way for display and
|
|
3285
|
+
* keep that cached as well.
|
|
3286
|
+
*/
|
|
3287
|
+
export class ChartData {
|
|
3288
|
+
constructor(table:dh.Table);
|
|
3289
|
+
|
|
3290
|
+
update(tableData:dh.SubscriptionTableData):void;
|
|
3291
|
+
getColumn(columnName:string, mappingFunc:(arg0:any)=>any, currentUpdate:dh.TableData):Array<any>;
|
|
3292
|
+
/**
|
|
3293
|
+
* Removes some column from the cache, avoiding extra computation on incoming events, and possibly freeing some
|
|
3294
|
+
* memory. If this pair of column name and map function are requested again, it will be recomputed from scratch.
|
|
3295
|
+
*/
|
|
3296
|
+
removeColumn(columnName:string, mappingFunc:(arg0:any)=>any):void;
|
|
3297
|
+
}
|
|
3298
|
+
|
|
3299
|
+
/**
|
|
3300
|
+
* Provides the details for a figure.
|
|
3301
|
+
*
|
|
3302
|
+
* The Deephaven JS API supports automatic lossless downsampling of time-series data, when that data is plotted in one
|
|
3303
|
+
* or more line series. Using a scatter plot or a X-axis of some type other than DateTime will prevent this feature from
|
|
3304
|
+
* being applied to a series. To enable this feature, invoke <b>Axis.range(...)</b> to specify the length in pixels of
|
|
3305
|
+
* the axis on the screen, and the range of values that are visible, and the server will use that width (and range, if
|
|
3306
|
+
* any) to reduce the number of points sent to the client.
|
|
3307
|
+
*
|
|
3308
|
+
* Downsampling can also be controlled when calling either <b>Figure.subscribe()</b> or <b>Series.subscribe()</b> - both
|
|
3309
|
+
* can be given an optional <b>dh.plot.DownsampleOptions</b> argument. Presently only two valid values exist,
|
|
3310
|
+
* <b>DEFAULT</b>, and <b>DISABLE</b>, and if no argument is specified, <b>DEFAULT</b> is assumed. If there are more
|
|
3311
|
+
* than 30,000 rows in a table, downsampling will be encouraged - data will not load without calling
|
|
3312
|
+
* <b>subscribe(DISABLE)</b> or enabling downsampling via <b>Axis.range(...)</b>. If there are more than 200,000 rows,
|
|
3313
|
+
* data will refuse to load without downsampling and <b>subscribe(DISABLE)</b> would have no effect.
|
|
3314
|
+
*
|
|
3315
|
+
* Downsampled data looks like normal data, except that select items have been removed if they would be redundant in the
|
|
3316
|
+
* UI given the current configuration. Individual rows are intact, so that a tooltip or some other UI item is sure to be
|
|
3317
|
+
* accurate and consistent, and at least the highest and lowest value for each axis will be retained as well, to ensure
|
|
3318
|
+
* that the "important" values are visible.
|
|
3319
|
+
*
|
|
3320
|
+
* Four events exist to help with interacting with downsampled data, all fired from the <b>Figure</b> instance itself.
|
|
3321
|
+
* First, <b>downsampleneeded</b> indicates that more than 30,000 rows would be fetched, and so specifying downsampling
|
|
3322
|
+
* is no longer optional - it must either be enabled (calling <b>axis.range(...)</b>), or disabled. If the figure is
|
|
3323
|
+
* configured for downsampling, when a change takes place that requires that the server perform some downsampling work,
|
|
3324
|
+
* the <b>downsamplestarted</b> event will first be fired, which can be used to present a brief loading message,
|
|
3325
|
+
* indicating to the user why data is not ready yet - when the server side process is complete,
|
|
3326
|
+
* <b>downsamplefinished</b> will be fired. These events will repeat when the range changes, such as when zooming,
|
|
3327
|
+
* panning, or resizing the figure. Finally, <b>downsamplefailed</b> indicates that something when wrong when
|
|
3328
|
+
* downsampling, or possibly that downsampling cannot be disabled due to the number of rows in the table.
|
|
3329
|
+
*
|
|
3330
|
+
* At this time, not marked as a ServerObject, due to internal implementation issues which leave the door open to
|
|
3331
|
+
* client-created figures.
|
|
3332
|
+
*/
|
|
3278
3333
|
export class Figure implements dh.HasEventHandling {
|
|
3279
3334
|
/**
|
|
3280
3335
|
* The title of the figure.
|
|
@@ -3318,7 +3373,8 @@ export namespace dh.plot {
|
|
|
3318
3373
|
*/
|
|
3319
3374
|
static readonly EVENT_DOWNSAMPLENEEDED:string;
|
|
3320
3375
|
|
|
3321
|
-
|
|
3376
|
+
protected constructor();
|
|
3377
|
+
|
|
3322
3378
|
subscribe(forceDisableDownsample?:DownsampleOptions):void;
|
|
3323
3379
|
/**
|
|
3324
3380
|
* Disable updates for all series in this figure.
|
|
@@ -3357,6 +3413,81 @@ export namespace dh.plot {
|
|
|
3357
3413
|
* @typeParam T -
|
|
3358
3414
|
*/
|
|
3359
3415
|
removeEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):boolean;
|
|
3416
|
+
static create(config:FigureDescriptor):Promise<Figure>;
|
|
3417
|
+
}
|
|
3418
|
+
|
|
3419
|
+
export class AxisDescriptor {
|
|
3420
|
+
formatType:string;
|
|
3421
|
+
type:string;
|
|
3422
|
+
position:string;
|
|
3423
|
+
log?:boolean|null;
|
|
3424
|
+
label?:string|null;
|
|
3425
|
+
labelFont?:string|null;
|
|
3426
|
+
ticksFont?:string|null;
|
|
3427
|
+
formatPattern?:string|null;
|
|
3428
|
+
color?:string|null;
|
|
3429
|
+
minRange?:number|null;
|
|
3430
|
+
maxRange?:number|null;
|
|
3431
|
+
minorTicksVisible?:boolean|null;
|
|
3432
|
+
majorTicksVisible?:boolean|null;
|
|
3433
|
+
minorTickCount?:number|null;
|
|
3434
|
+
gapBetweenMajorTicks?:number|null;
|
|
3435
|
+
majorTickLocations?:Array<number>|null;
|
|
3436
|
+
tickLabelAngle?:number|null;
|
|
3437
|
+
invert?:boolean|null;
|
|
3438
|
+
isTimeAxis?:boolean|null;
|
|
3439
|
+
|
|
3440
|
+
constructor();
|
|
3441
|
+
}
|
|
3442
|
+
|
|
3443
|
+
export class SeriesDataSourceException {
|
|
3444
|
+
protected constructor();
|
|
3445
|
+
|
|
3446
|
+
get source():SeriesDataSource;
|
|
3447
|
+
get message():string;
|
|
3448
|
+
}
|
|
3449
|
+
|
|
3450
|
+
/**
|
|
3451
|
+
* A descriptor used with JsFigureFactory.create to create a figure from JS.
|
|
3452
|
+
*/
|
|
3453
|
+
export class FigureDescriptor {
|
|
3454
|
+
title?:string|null;
|
|
3455
|
+
titleFont?:string|null;
|
|
3456
|
+
titleColor?:string|null;
|
|
3457
|
+
isResizable?:boolean|null;
|
|
3458
|
+
isDefaultTheme?:boolean|null;
|
|
3459
|
+
updateInterval?:number|null;
|
|
3460
|
+
cols?:number|null;
|
|
3461
|
+
rows?:number|null;
|
|
3462
|
+
charts:Array<ChartDescriptor>;
|
|
3463
|
+
|
|
3464
|
+
constructor();
|
|
3465
|
+
}
|
|
3466
|
+
|
|
3467
|
+
export class DownsampleOptions {
|
|
3468
|
+
/**
|
|
3469
|
+
* Max number of items in the series before DEFAULT will not attempt to load the series without downsampling. Above
|
|
3470
|
+
* this size if downsample fails or is not applicable, the series won't be loaded unless DISABLE is passed to
|
|
3471
|
+
* series.subscribe().
|
|
3472
|
+
*/
|
|
3473
|
+
static MAX_SERIES_SIZE:number;
|
|
3474
|
+
/**
|
|
3475
|
+
* Max number of items in the series where the subscription will be allowed at all. Above this limit, even with
|
|
3476
|
+
* downsampling disabled, the series will not load data.
|
|
3477
|
+
*/
|
|
3478
|
+
static MAX_SUBSCRIPTION_SIZE:number;
|
|
3479
|
+
/**
|
|
3480
|
+
* Flag to let the API decide what data will be available, based on the nature of the data, the series, and how the
|
|
3481
|
+
* axes are configured.
|
|
3482
|
+
*/
|
|
3483
|
+
static readonly DEFAULT:DownsampleOptions;
|
|
3484
|
+
/**
|
|
3485
|
+
* Flat to entirely disable downsampling, and force all data to load, no matter how many items that would be, up to
|
|
3486
|
+
* the limit of MAX_SUBSCRIPTION_SIZE.
|
|
3487
|
+
*/
|
|
3488
|
+
static readonly DISABLE:DownsampleOptions;
|
|
3489
|
+
|
|
3490
|
+
protected constructor();
|
|
3360
3491
|
}
|
|
3361
3492
|
|
|
3362
3493
|
/**
|
|
@@ -3403,6 +3534,13 @@ export namespace dh.plot {
|
|
|
3403
3534
|
get multiSeries():MultiSeries[];
|
|
3404
3535
|
}
|
|
3405
3536
|
|
|
3537
|
+
export class FigureSourceException {
|
|
3538
|
+
table:dh.Table;
|
|
3539
|
+
source:SeriesDataSource;
|
|
3540
|
+
|
|
3541
|
+
protected constructor();
|
|
3542
|
+
}
|
|
3543
|
+
|
|
3406
3544
|
/**
|
|
3407
3545
|
* Helper class for plot downsampling methods.
|
|
3408
3546
|
*/
|
|
@@ -3429,108 +3567,6 @@ export namespace dh.plot {
|
|
|
3429
3567
|
protected constructor();
|
|
3430
3568
|
}
|
|
3431
3569
|
|
|
3432
|
-
/**
|
|
3433
|
-
* Helper class to manage snapshots and deltas and keep not only a contiguous JS array of data per column in the
|
|
3434
|
-
* underlying table, but also support a mapping function to let client code translate data in some way for display and
|
|
3435
|
-
* keep that cached as well.
|
|
3436
|
-
*/
|
|
3437
|
-
export class ChartData {
|
|
3438
|
-
constructor(table:dh.Table);
|
|
3439
|
-
|
|
3440
|
-
update(tableData:dh.SubscriptionTableData):void;
|
|
3441
|
-
getColumn(columnName:string, mappingFunc:(arg0:any)=>any, currentUpdate:dh.TableData):Array<any>;
|
|
3442
|
-
/**
|
|
3443
|
-
* Removes some column from the cache, avoiding extra computation on incoming events, and possibly freeing some
|
|
3444
|
-
* memory. If this pair of column name and map function are requested again, it will be recomputed from scratch.
|
|
3445
|
-
*/
|
|
3446
|
-
removeColumn(columnName:string, mappingFunc:(arg0:any)=>any):void;
|
|
3447
|
-
}
|
|
3448
|
-
|
|
3449
|
-
export class FigureSourceException {
|
|
3450
|
-
table:dh.Table;
|
|
3451
|
-
source:SeriesDataSource;
|
|
3452
|
-
|
|
3453
|
-
protected constructor();
|
|
3454
|
-
}
|
|
3455
|
-
|
|
3456
|
-
export class DownsampleOptions {
|
|
3457
|
-
/**
|
|
3458
|
-
* Max number of items in the series before DEFAULT will not attempt to load the series without downsampling. Above
|
|
3459
|
-
* this size if downsample fails or is not applicable, the series won't be loaded unless DISABLE is passed to
|
|
3460
|
-
* series.subscribe().
|
|
3461
|
-
*/
|
|
3462
|
-
static MAX_SERIES_SIZE:number;
|
|
3463
|
-
/**
|
|
3464
|
-
* Max number of items in the series where the subscription will be allowed at all. Above this limit, even with
|
|
3465
|
-
* downsampling disabled, the series will not load data.
|
|
3466
|
-
*/
|
|
3467
|
-
static MAX_SUBSCRIPTION_SIZE:number;
|
|
3468
|
-
/**
|
|
3469
|
-
* Flag to let the API decide what data will be available, based on the nature of the data, the series, and how the
|
|
3470
|
-
* axes are configured.
|
|
3471
|
-
*/
|
|
3472
|
-
static readonly DEFAULT:DownsampleOptions;
|
|
3473
|
-
/**
|
|
3474
|
-
* Flat to entirely disable downsampling, and force all data to load, no matter how many items that would be, up to
|
|
3475
|
-
* the limit of MAX_SUBSCRIPTION_SIZE.
|
|
3476
|
-
*/
|
|
3477
|
-
static readonly DISABLE:DownsampleOptions;
|
|
3478
|
-
|
|
3479
|
-
protected constructor();
|
|
3480
|
-
}
|
|
3481
|
-
|
|
3482
|
-
export class SeriesDataSourceException {
|
|
3483
|
-
protected constructor();
|
|
3484
|
-
|
|
3485
|
-
get source():SeriesDataSource;
|
|
3486
|
-
get message():string;
|
|
3487
|
-
}
|
|
3488
|
-
|
|
3489
|
-
/**
|
|
3490
|
-
* A descriptor used with JsFigureFactory.create to create a figure from JS.
|
|
3491
|
-
*/
|
|
3492
|
-
export class FigureDescriptor {
|
|
3493
|
-
title?:string|null;
|
|
3494
|
-
titleFont?:string|null;
|
|
3495
|
-
titleColor?:string|null;
|
|
3496
|
-
isResizable?:boolean|null;
|
|
3497
|
-
isDefaultTheme?:boolean|null;
|
|
3498
|
-
updateInterval?:number|null;
|
|
3499
|
-
cols?:number|null;
|
|
3500
|
-
rows?:number|null;
|
|
3501
|
-
charts:Array<ChartDescriptor>;
|
|
3502
|
-
|
|
3503
|
-
constructor();
|
|
3504
|
-
}
|
|
3505
|
-
|
|
3506
|
-
export class SourceDescriptor {
|
|
3507
|
-
axis:AxisDescriptor;
|
|
3508
|
-
table:dh.Table;
|
|
3509
|
-
columnName:string;
|
|
3510
|
-
type:string;
|
|
3511
|
-
|
|
3512
|
-
constructor();
|
|
3513
|
-
}
|
|
3514
|
-
|
|
3515
|
-
export class SeriesDescriptor {
|
|
3516
|
-
plotStyle:string;
|
|
3517
|
-
name?:string|null;
|
|
3518
|
-
linesVisible?:boolean|null;
|
|
3519
|
-
shapesVisible?:boolean|null;
|
|
3520
|
-
gradientVisible?:boolean|null;
|
|
3521
|
-
lineColor?:string|null;
|
|
3522
|
-
pointLabelFormat?:string|null;
|
|
3523
|
-
xToolTipPattern?:string|null;
|
|
3524
|
-
yToolTipPattern?:string|null;
|
|
3525
|
-
shapeLabel?:string|null;
|
|
3526
|
-
shapeSize?:number|null;
|
|
3527
|
-
shapeColor?:string|null;
|
|
3528
|
-
shape?:string|null;
|
|
3529
|
-
dataSources:Array<SourceDescriptor>;
|
|
3530
|
-
|
|
3531
|
-
constructor();
|
|
3532
|
-
}
|
|
3533
|
-
|
|
3534
3570
|
export class ChartDescriptor {
|
|
3535
3571
|
colspan?:number|null;
|
|
3536
3572
|
rowspan?:number|null;
|
|
@@ -3549,6 +3585,12 @@ export namespace dh.plot {
|
|
|
3549
3585
|
}
|
|
3550
3586
|
|
|
3551
3587
|
|
|
3588
|
+
type AxisFormatTypeType = number;
|
|
3589
|
+
export class AxisFormatType {
|
|
3590
|
+
static readonly CATEGORY:AxisFormatTypeType;
|
|
3591
|
+
static readonly NUMBER:AxisFormatTypeType;
|
|
3592
|
+
}
|
|
3593
|
+
|
|
3552
3594
|
type AxisTypeType = number;
|
|
3553
3595
|
export class AxisType {
|
|
3554
3596
|
static readonly X:AxisTypeType;
|
|
@@ -3597,12 +3639,6 @@ export namespace dh.plot {
|
|
|
3597
3639
|
static readonly NONE:AxisPositionType;
|
|
3598
3640
|
}
|
|
3599
3641
|
|
|
3600
|
-
type AxisFormatTypeType = number;
|
|
3601
|
-
export class AxisFormatType {
|
|
3602
|
-
static readonly CATEGORY:AxisFormatTypeType;
|
|
3603
|
-
static readonly NUMBER:AxisFormatTypeType;
|
|
3604
|
-
}
|
|
3605
|
-
|
|
3606
3642
|
type SeriesPlotStyleType = number;
|
|
3607
3643
|
export class SeriesPlotStyle {
|
|
3608
3644
|
static readonly BAR:SeriesPlotStyleType;
|
|
@@ -3638,6 +3674,23 @@ export namespace dh.plot {
|
|
|
3638
3674
|
|
|
3639
3675
|
export namespace dh.lsp {
|
|
3640
3676
|
|
|
3677
|
+
export class CompletionItem {
|
|
3678
|
+
label:string;
|
|
3679
|
+
kind:number;
|
|
3680
|
+
detail:string;
|
|
3681
|
+
documentation:MarkupContent;
|
|
3682
|
+
deprecated:boolean;
|
|
3683
|
+
preselect:boolean;
|
|
3684
|
+
textEdit:TextEdit;
|
|
3685
|
+
sortText:string;
|
|
3686
|
+
filterText:string;
|
|
3687
|
+
insertTextFormat:number;
|
|
3688
|
+
additionalTextEdits:Array<TextEdit>;
|
|
3689
|
+
commitCharacters:Array<string>;
|
|
3690
|
+
|
|
3691
|
+
constructor();
|
|
3692
|
+
}
|
|
3693
|
+
|
|
3641
3694
|
export class ParameterInformation {
|
|
3642
3695
|
label:string;
|
|
3643
3696
|
documentation:MarkupContent;
|
|
@@ -3645,6 +3698,13 @@ export namespace dh.lsp {
|
|
|
3645
3698
|
constructor();
|
|
3646
3699
|
}
|
|
3647
3700
|
|
|
3701
|
+
export class TextEdit {
|
|
3702
|
+
range:Range;
|
|
3703
|
+
text:string;
|
|
3704
|
+
|
|
3705
|
+
constructor();
|
|
3706
|
+
}
|
|
3707
|
+
|
|
3648
3708
|
export class TextDocumentContentChangeEvent {
|
|
3649
3709
|
range:Range;
|
|
3650
3710
|
rangeLength:number;
|
|
@@ -3689,30 +3749,6 @@ export namespace dh.lsp {
|
|
|
3689
3749
|
constructor();
|
|
3690
3750
|
}
|
|
3691
3751
|
|
|
3692
|
-
export class TextEdit {
|
|
3693
|
-
range:Range;
|
|
3694
|
-
text:string;
|
|
3695
|
-
|
|
3696
|
-
constructor();
|
|
3697
|
-
}
|
|
3698
|
-
|
|
3699
|
-
export class CompletionItem {
|
|
3700
|
-
label:string;
|
|
3701
|
-
kind:number;
|
|
3702
|
-
detail:string;
|
|
3703
|
-
documentation:MarkupContent;
|
|
3704
|
-
deprecated:boolean;
|
|
3705
|
-
preselect:boolean;
|
|
3706
|
-
textEdit:TextEdit;
|
|
3707
|
-
sortText:string;
|
|
3708
|
-
filterText:string;
|
|
3709
|
-
insertTextFormat:number;
|
|
3710
|
-
additionalTextEdits:Array<TextEdit>;
|
|
3711
|
-
commitCharacters:Array<string>;
|
|
3712
|
-
|
|
3713
|
-
constructor();
|
|
3714
|
-
}
|
|
3715
|
-
|
|
3716
3752
|
export class Range {
|
|
3717
3753
|
start:Position;
|
|
3718
3754
|
end:Position;
|
|
@@ -3724,7 +3760,6 @@ export namespace dh.lsp {
|
|
|
3724
3760
|
|
|
3725
3761
|
}
|
|
3726
3762
|
|
|
3727
|
-
|
|
3728
3763
|
export namespace dh.calendar {
|
|
3729
3764
|
|
|
3730
3765
|
export interface Holiday {
|
|
@@ -3788,3 +3823,4 @@ export namespace dh.calendar {
|
|
|
3788
3823
|
}
|
|
3789
3824
|
|
|
3790
3825
|
}
|
|
3826
|
+
|