@deephaven/jsapi-types 1.0.0-dev0.40.0 → 1.0.0-dev0.40.1

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.
Files changed (2) hide show
  1. package/dist/index.d.ts +1811 -1811
  2. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -17,37 +17,6 @@ export interface IIterableResult<T> {
17
17
  }
18
18
  export namespace dh.storage {
19
19
 
20
- /**
21
- * Storage service metadata about files and folders.
22
- */
23
- export class ItemDetails {
24
- protected constructor();
25
-
26
- toString():string;
27
- get filename():string;
28
- get basename():string;
29
- get size():number;
30
- get etag():string;
31
- get type():ItemTypeType;
32
- get dirname():string;
33
- }
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
-
51
20
  /**
52
21
  * Remote service to read and write files on the server. Paths use "/" as a separator, and should not start with "/".
53
22
  */
@@ -106,6 +75,37 @@ export namespace dh.storage {
106
75
  createDirectory(path:string):Promise<void>;
107
76
  }
108
77
 
78
+ /**
79
+ * Represents a file's contents loaded from the server. If an etag was specified when loading, client should first test
80
+ * if the etag of this instance matches - if so, the contents will be empty, and the client's existing contents should
81
+ * be used.
82
+ */
83
+ export class FileContents {
84
+ protected constructor();
85
+
86
+ static blob(blob:Blob):FileContents;
87
+ static text(...text:string[]):FileContents;
88
+ static arrayBuffers(...buffers:ArrayBuffer[]):FileContents;
89
+ text():Promise<string>;
90
+ arrayBuffer():Promise<ArrayBuffer>;
91
+ get etag():string;
92
+ }
93
+
94
+ /**
95
+ * Storage service metadata about files and folders.
96
+ */
97
+ export class ItemDetails {
98
+ protected constructor();
99
+
100
+ toString():string;
101
+ get filename():string;
102
+ get basename():string;
103
+ get size():number;
104
+ get etag():string;
105
+ get type():ItemTypeType;
106
+ get dirname():string;
107
+ }
108
+
109
109
 
110
110
  type ItemTypeType = string;
111
111
  export class ItemType {
@@ -117,172 +117,6 @@ export namespace dh.storage {
117
117
 
118
118
  export namespace dh {
119
119
 
120
- /**
121
- * Options for requesting a viewport subscription to a table.
122
- */
123
- export interface ViewportSubscriptionOptions extends SubscriptionOptions {
124
- /**
125
- * If true, the viewport will be filled starting from the end of the table, where 0 is the last row of the
126
- * table. Default is false.
127
- */
128
- isReverseViewport?:boolean|null;
129
- /**
130
- * The rows to include in the viewport. This can be either a {@link dh.RangeSet} or a single range with
131
- * `first` and `last` properties.
132
- */
133
- rows:RangeSet|SimpleRange;
134
- }
135
- /**
136
- * Event data, describing the indexes that were added/removed/updated, and providing access to Rows (and thus data in
137
- * columns) either by index, or scanning the complete present index.
138
- * <p>
139
- * This class supports two ways of reading the table - checking the changes made since the last update, and reading all
140
- * data currently in the table. While it is more expensive to always iterate over every single row in the table, it may
141
- * in some cases actually be cheaper than maintaining state separately and updating only the changes, though both
142
- * options should be considered.
143
- * <p>
144
- * The RangeSet objects allow iterating over the LongWrapper indexes in the table. Note that these "indexes" are not
145
- * necessarily contiguous and may be negative, and represent some internal state on the server, allowing it to keep
146
- * track of data efficiently. Those LongWrapper objects can be passed to the various methods on this instance to read
147
- * specific rows or cells out of the table.
148
- */
149
- export interface SubscriptionTableData extends TableData {
150
- get fullIndex():RangeSet;
151
- /**
152
- * The ordered set of row indexes removed since the last update
153
- * @return the rangeset of removed rows
154
- */
155
- get removed():RangeSet;
156
- /**
157
- * The ordered set of row indexes added since the last update.
158
- * @return the rangeset of rows added
159
- */
160
- get added():RangeSet;
161
- get columns():Array<Column>;
162
- /**
163
- * The ordered set of row indexes updated since the last update
164
- * @return the rnageset of modified rows
165
- */
166
- get modified():RangeSet;
167
- /**
168
- * A lazily computed array of all rows available on the client.
169
- */
170
- get rows():Array<Row>;
171
- }
172
- /**
173
- * This object may be pooled internally or discarded and not updated. Do not retain references to it.
174
- */
175
- export interface Format {
176
- /**
177
- * The format string to apply to the value of this cell.
178
- * @return String
179
- */
180
- readonly formatString?:string|null;
181
- /**
182
- * Color to apply to the cell's background, in <b>#rrggbb</b> format.
183
- * @return String
184
- */
185
- readonly backgroundColor?:string|null;
186
- /**
187
- * Color to apply to the text, in <b>#rrggbb</b> format.
188
- * @return String
189
- */
190
- readonly color?:string|null;
191
- /**
192
- *
193
- * @deprecated Prefer formatString. Number format string to apply to the value in this cell.
194
- */
195
- readonly numberFormat?:string|null;
196
- }
197
- /**
198
- * Represents a table which can be joined to another table. Current implementations are {@link dh.Table} and
199
- * {@link dh.TotalsTable}.
200
- */
201
- export interface JoinableTable {
202
- freeze():Promise<Table>;
203
- snapshot(baseTable:Table, doInitialSnapshot?:boolean, stampColumns?:string[]):Promise<Table>;
204
- /**
205
- * Joins this table to the provided table, using one of the specified join types:
206
- * <ul>
207
- * <li><code>AJ</code>, <code>ReverseAJ</code> (or <code>RAJ</code>) - inexact timeseries joins, based on the
208
- * provided matching rule.</li>
209
- * <li><code>CROSS_JOIN</code> (or <code>Join</code>) - cross join of all rows that have matching values in both
210
- * tables.</li>
211
- * <li><code>EXACT_JOIN</code> (or <code>ExactJoin</code> - matches values in exactly one row in the right table,
212
- * with errors if there is not exactly one.</li>
213
- * <li><code>NATURAL_JOIN</code> (or <code>Natural</code> - matches values in at most one row in the right table,
214
- * with nulls if there is no match or errors if there are multiple matches.</li>
215
- * </ul>
216
- *
217
- * Note that <code>Left</code> join is not supported here, unlike DHE.
218
- * <p>
219
- * See the <a href="https://deephaven.io/core/docs/conceptual/choose-joins/">Choose a join method</a> document for
220
- * more guidance on picking a join operation.
221
- * @deprecated Instead, call the specific method for the join type.
222
- * @param joinType - The type of join to perform, see the list above.
223
- * @param rightTable - The table to match to values in this table
224
- * @param columnsToMatch - Columns that should match
225
- * @param columnsToAdd - Columns from the right table to add to the result - empty/null/absent to add all columns
226
- * @param asOfMatchRule - If joinType is AJ/RAJ/ReverseAJ, the match rule to use
227
- * @return a promise that will resolve to the joined table
228
- */
229
- join(joinType:string, rightTable:JoinableTable, columnsToMatch:Array<string>, columnsToAdd?:Array<string>|undefined|null, asOfMatchRule?:string|undefined|null):Promise<Table>;
230
- /**
231
- * Performs an inexact timeseries join, where rows in this table will have columns added from the closest matching
232
- * row from the right table.
233
- * <p>
234
- * The `asOfMatchRule` value can be one of:
235
- * <ul>
236
- * <li>LESS_THAN_EQUAL</li>
237
- * <li>LESS_THAN</li>
238
- * <li>GREATER_THAN_EQUAL</li>
239
- * <li>GREATER_THAN</li>
240
- * </ul>
241
- * @param rightTable - the table to match to values in this table
242
- * @param columnsToMatch - the columns that should match, according to the asOfMatchRole
243
- * @param columnsToAdd - columns from the right table to add to the resulting table, empty/null/absent to add all
244
- * columns
245
- * @param asOfMatchRule - the match rule to use, see above
246
- * @return a promise that will resolve to the joined table
247
- */
248
- asOfJoin(rightTable:JoinableTable, columnsToMatch:Array<string>, columnsToAdd?:Array<string>|undefined|null, asOfMatchRule?:string|undefined|null):Promise<Table>;
249
- /**
250
- * a promise that will be resolved with the newly created table holding the results of the specified cross join
251
- * operation. The <b>columnsToAdd</b> parameter is optional, not specifying it will result in all columns from the
252
- * right table being added to the output. The <b>reserveBits</b> optional parameter lets the client control how the
253
- * key space is distributed between the rows in the two tables, see the Java <b>Table</b> class for details.
254
- * @param rightTable - the table to match to values in this table
255
- * @param columnsToMatch - the columns that should match exactly
256
- * @param columnsToAdd - columns from the right table to add to the resulting table, empty/null/absent to add all
257
- * columns
258
- * @param reserveBits - the number of bits of key-space to initially reserve per group, null/absent will let the
259
- * server select a value
260
- * @return a promise that will resolve to the joined table
261
- */
262
- crossJoin(rightTable:JoinableTable, columnsToMatch:Array<string>, columnsToAdd?:Array<string>|undefined|null, reserveBits?:number|undefined|null):Promise<Table>;
263
- /**
264
- * a promise that will be resolved with the newly created table holding the results of the specified exact join
265
- * operation. The `columnsToAdd` parameter is optional, not specifying it will result in all columns from the right
266
- * table being added to the output.
267
- * @param rightTable - the table to match to values in this table
268
- * @param columnsToMatch - the columns that should match exactly
269
- * @param columnsToAdd - columns from the right table to add to the resulting table, empty/null/absent to add all
270
- * columns
271
- * @return a promise that will resolve to the joined table
272
- */
273
- exactJoin(rightTable:JoinableTable, columnsToMatch:Array<string>, columnsToAdd?:Array<string>|undefined|null):Promise<Table>;
274
- /**
275
- * a promise that will be resolved with the newly created table holding the results of the specified natural join
276
- * operation. The <b>columnsToAdd</b> parameter is optional, not specifying it will result in all columns from the
277
- * right table being added to the output.
278
- * @param rightTable - the table to match to values in this table
279
- * @param columnsToMatch - the columns that should match exactly
280
- * @param columnsToAdd - columns from the right table to add to the resulting table, empty/null/absent to add all
281
- * columns
282
- * @return a promise that will resolve to the joined table
283
- */
284
- naturalJoin(rightTable:JoinableTable, columnsToMatch:Array<string>, columnsToAdd?:Array<string>|undefined|null):Promise<Table>;
285
- }
286
120
  /**
287
121
  * Behaves like a Table, but doesn't expose all of its API for changing the internal state. Instead, state is driven by
288
122
  * the upstream table - when it changes handle, this listens and updates its own handle accordingly.
@@ -438,80 +272,51 @@ export namespace dh {
438
272
  get isRefreshing():boolean;
439
273
  }
440
274
  /**
441
- * Options for requesting a full-table subscription to a table.
275
+ * Wrap LocalTime values for use in JS. Provides text formatting for display and access to the underlying value.
442
276
  */
443
- export interface SubscriptionOptions extends DataOptions {
444
- /**
445
- * Minimum interval between updates, in milliseconds. If not specified, the server default will be used,
446
- * typically 1000ms.
447
- * <p>
448
- * Note that setting this to smaller values will not necessarily result in more frequent updates - the server
449
- * may not propagate updates that frequently, or there may be no updates to propagate.
450
- */
451
- updateIntervalMs?:number|null;
277
+ export interface LocalTimeWrapper {
278
+ valueOf():string;
279
+ getHour():number;
280
+ getMinute():number;
281
+ getSecond():number;
282
+ getNano():number;
283
+ toString():string;
452
284
  }
453
- /**
454
- * Similar to {@link dh.ViewportData}, but with additional properties to reflect
455
- * the tree structure.
456
- */
457
- export interface TreeViewportData extends TableData {
458
- get(index:LongWrapper|number):TreeRow;
459
- getData(index:LongWrapper|number, column:Column):any;
460
- getFormat(index:LongWrapper|number, column:Column):Format;
461
- get treeSize():number;
285
+ export interface HasEventHandling {
462
286
  /**
463
- * The position of the first returned row within the tree.
464
- */
465
- get offset():number;
466
- get columns():Array<Column>;
467
- get rows():Array<TreeRow>;
468
- }
469
- export interface RefreshToken {
470
- get bytes():string;
471
- get expiry():number;
472
- }
473
- /**
474
- * Represents statistics for a given table column.
475
- */
476
- export interface ColumnStatistics {
477
- /**
478
- * Gets the type of formatting that should be used for given statistic.
479
- * <p>
480
- * the format type for a statistic. A null return value means that the column formatting should be used.
481
- * @param name - the display name of the statistic
482
- * @return String
483
- */
484
- getType(name:string):string;
485
- /**
486
- * 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
487
- * name to the count of how many times it occurred in the column. This map will be empty for tables containing more
488
- * than 19 unique values.
489
- * @return Map of String double
287
+ * Listen for events on this object.
288
+ * @param name - the name of the event to listen for
289
+ * @param callback - a function to call when the event occurs
290
+ * @return Returns a cleanup function.
291
+ * @typeParam T - the type of the data that the event will provide
490
292
  */
491
- get uniqueValues():Map<string, number>;
293
+ addEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):()=>void;
294
+ nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<Event<T>>;
295
+ hasListeners(name:string):boolean;
492
296
  /**
493
- * Gets a map with the display name of statistics as keys and the numeric stat as a value.
494
- * <p>
495
- * A map of each statistic's name to its value.
496
- * @return Map of String and Object
297
+ * Removes an event listener added to this table.
298
+ * @param name -
299
+ * @param callback -
300
+ * @return
301
+ * @typeParam T -
497
302
  */
498
- get statisticsMap():Map<string, object>;
303
+ removeEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):boolean;
499
304
  }
500
305
  /**
501
- * Simple range consisting only of start and end numbers. Will be migrated to deephaven-core in the near future, and
502
- * subsequently removed from this the coreplus namespace.
306
+ * Similar to {@link dh.ViewportData}, but with additional properties to reflect
307
+ * the tree structure.
503
308
  */
504
- export interface SimpleRange {
505
- first:number;
506
- last:number;
507
- }
508
- export interface WorkerHeapInfo {
309
+ export interface TreeViewportData extends TableData {
310
+ get(index:LongWrapper|number):TreeRow;
311
+ getData(index:LongWrapper|number, column:Column):any;
312
+ getFormat(index:LongWrapper|number, column:Column):Format;
313
+ get treeSize():number;
509
314
  /**
510
- * Total heap size available for this worker.
315
+ * The position of the first returned row within the tree.
511
316
  */
512
- get totalHeapSize():number;
513
- get freeMemory():number;
514
- get maximumHeapSize():number;
317
+ get offset():number;
318
+ get columns():Array<Column>;
319
+ get rows():Array<TreeRow>;
515
320
  }
516
321
  /**
517
322
  * This object may be pooled internally or discarded and not updated. Do not retain references to it. Instead,
@@ -523,132 +328,259 @@ export namespace dh {
523
328
  get index():LongWrapper;
524
329
  }
525
330
  /**
526
- * Wrap LocalDate values for use in JS. Provides text formatting for display and access to the underlying value.
331
+ * Options for requesting a preview of columns when requesting table data. The two properties
332
+ * {@link dh.convertArrayToString} and {@link dh.array} are mutually exclusive.
527
333
  */
528
- export interface LocalDateWrapper {
529
- valueOf():string;
530
- getYear():number;
531
- getMonthValue():number;
532
- getDayOfMonth():number;
533
- toString():string;
334
+ export interface PreviewOptions {
335
+ /**
336
+ * If true, any array columns will be converted to strings for preview purposes. This is the legacy behavior.
337
+ */
338
+ convertArrayToString?:boolean|null;
339
+ /**
340
+ * Specifies the length of the array to serialize. If the array is longer than this length, one extra element
341
+ * will be included - the client is expected to truncate the array and append "..." to indicate that there are
342
+ * additional elements. Negative values indicate that the values should be counted from the end of the array
343
+ * rather than the beginning. Zero or null indicate that the entire array should be serialized. The default is
344
+ * null.
345
+ */
346
+ array?:number|null;
534
347
  }
535
348
  /**
536
- * Common interface for various ways of accessing table data and formatting for viewport or non-viewport subscriptions
537
- * on tables, data in trees, and snapshots.
349
+ * Event data, describing the indexes that were added/removed/updated, and providing access to Rows (and thus data in
350
+ * columns) either by index, or scanning the complete present index.
538
351
  * <p>
539
- * Generally speaking, it is more efficient to access data in column-major order, rather than iterating through each Row
540
- * and accessing all columns that it holds. The {@link rows} accessor can be useful to read row data, but may
541
- * incur other costs - it is likely faster to access data by columns using {@link getData}.
352
+ * This class supports two ways of reading the table - checking the changes made since the last update, and reading all
353
+ * data currently in the table. While it is more expensive to always iterate over every single row in the table, it may
354
+ * in some cases actually be cheaper than maintaining state separately and updating only the changes, though both
355
+ * options should be considered.
356
+ * <p>
357
+ * The RangeSet objects allow iterating over the LongWrapper indexes in the table. Note that these "indexes" are not
358
+ * necessarily contiguous and may be negative, and represent some internal state on the server, allowing it to keep
359
+ * track of data efficiently. Those LongWrapper objects can be passed to the various methods on this instance to read
360
+ * specific rows or cells out of the table.
542
361
  */
543
- export interface TableData {
362
+ export interface SubscriptionTableData extends TableData {
363
+ get fullIndex():RangeSet;
544
364
  /**
545
- * Reads a row object from the table, from which any subscribed column can be read.
546
- * @param index - the position or key to access
547
- * @return the row at the given location
365
+ * The ordered set of row indexes removed since the last update
366
+ * @return the rangeset of removed rows
548
367
  */
549
- get(index:LongWrapper|number):Row;
368
+ get removed():RangeSet;
550
369
  /**
551
- * Reads a specific cell from the table, by row key and column.
552
- * @param index - the row in the table to get data from
553
- * @param column - the column to read
554
- * @return the value in the table
370
+ * The ordered set of row indexes added since the last update.
371
+ * @return the rangeset of rows added
555
372
  */
556
- getData(index:LongWrapper|number, column:Column):any;
373
+ get added():RangeSet;
374
+ get columns():Array<Column>;
557
375
  /**
558
- * The server-specified Format to use for the cell at the given position.
559
- * @param index - the row to read
560
- * @param column - the column to read
561
- * @return a Format instance with any server-specified details
376
+ * The ordered set of row indexes updated since the last update
377
+ * @return the rnageset of modified rows
562
378
  */
563
- getFormat(index:LongWrapper|number, column:Column):Format;
564
- get columns():Array<Column>;
379
+ get modified():RangeSet;
565
380
  /**
566
381
  * A lazily computed array of all rows available on the client.
567
382
  */
568
383
  get rows():Array<Row>;
569
384
  }
570
385
  /**
571
- * Represents the contents of a single widget data message from the server, with a binary data paylod and exported
572
- * objects. Implemented both by Widget itself and by the `event.details` when data is received by the client.
573
- *
574
- * Terminology note: the name of this type should probably use "Data" instead of "Message", and the methods should use
575
- * "payload" rather than "data" to match other platforms and the protobuf itself. These names are instead used for
576
- * backwards compatibility and to better follow JS expectations.
386
+ * Similar to the browser `CustomEvent` type, this class holds only the type of the event, and optionally some
387
+ * details about the event.
388
+ * @typeParam T - the type of the event detail
577
389
  */
578
- export interface WidgetMessageDetails {
390
+ export interface Event<T> {
391
+ get detail():T;
392
+ get type():string;
393
+ }
394
+ /**
395
+ * This object may be pooled internally or discarded and not updated. Do not retain references to it.
396
+ */
397
+ export interface Format {
579
398
  /**
580
- * Returns the data from this message as a base64-encoded string.
399
+ * The format string to apply to the value of this cell.
400
+ * @return String
581
401
  */
582
- getDataAsBase64():string;
402
+ readonly formatString?:string|null;
583
403
  /**
584
- * Returns the data from this message as a Uint8Array.
404
+ * Color to apply to the cell's background, in <b>#rrggbb</b> format.
405
+ * @return String
585
406
  */
586
- getDataAsU8():Uint8Array;
407
+ readonly backgroundColor?:string|null;
587
408
  /**
588
- * Returns the data from this message as a utf-8 string.
409
+ * Color to apply to the text, in <b>#rrggbb</b> format.
410
+ * @return String
589
411
  */
590
- getDataAsString():string;
412
+ readonly color?:string|null;
591
413
  /**
592
- * Returns an array of exported objects sent from the server. The plugin implementation is now responsible for these
593
- * objects, and should close them when no longer needed.
414
+ *
415
+ * @deprecated Prefer formatString. Number format string to apply to the value in this cell.
594
416
  */
595
- get exportedObjects():WidgetExportedObject[];
417
+ readonly numberFormat?:string|null;
596
418
  }
597
419
  /**
598
- * Options for requesting table data, either as a snapshot or a subscription. See subtypes for more specific options:
599
- * <ul>
600
- * <li>{@link dh.SnapshotOptions} for snapshot-specific options</li>
601
- * <li>{@link dh.SubscriptionOptions} for full-table subscription-specific options</li>
602
- * <li>{@link dh.ViewportSubscriptionOptions} for viewport subscription-specific options</li>
603
- * </ul>
420
+ * Options for requesting a full-table subscription to a table.
604
421
  */
605
- export interface DataOptions {
422
+ export interface SubscriptionOptions extends DataOptions {
606
423
  /**
607
- * Optional preview instructions for columns in the table data.
424
+ * Minimum interval between updates, in milliseconds. If not specified, the server default will be used,
425
+ * typically 1000ms.
426
+ * <p>
427
+ * Note that setting this to smaller values will not necessarily result in more frequent updates - the server
428
+ * may not propagate updates that frequently, or there may be no updates to propagate.
608
429
  */
609
- previewOptions?:PreviewOptions|null;
430
+ updateIntervalMs?:number|null;
431
+ }
432
+ /**
433
+ * Represents a row available in a subscription/snapshot on the client. Do not retain references to rows - they will
434
+ * not function properly when the event isn't actively going off (or promise resolving). Instead, wait for the next
435
+ * event, or re-request the viewport data.
436
+ */
437
+ export interface Row {
438
+ get(column:Column):any;
439
+ getFormat(column:Column):Format;
440
+ get index():LongWrapper;
441
+ }
442
+ /**
443
+ * Represents statistics for a given table column.
444
+ */
445
+ export interface ColumnStatistics {
610
446
  /**
611
- * Required property to indicate which columns should be included in the table data.
447
+ * Gets the type of formatting that should be used for given statistic.
448
+ * <p>
449
+ * the format type for a statistic. A null return value means that the column formatting should be used.
450
+ * @param name - the display name of the statistic
451
+ * @return String
612
452
  */
613
- columns:Array<Column>;
614
- }
615
- export interface HasEventHandling {
453
+ getType(name:string):string;
616
454
  /**
617
- * Listen for events on this object.
618
- * @param name - the name of the event to listen for
619
- * @param callback - a function to call when the event occurs
620
- * @return Returns a cleanup function.
621
- * @typeParam T - the type of the data that the event will provide
455
+ * 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
456
+ * name to the count of how many times it occurred in the column. This map will be empty for tables containing more
457
+ * than 19 unique values.
458
+ * @return Map of String double
622
459
  */
623
- addEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):()=>void;
624
- nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<Event<T>>;
625
- hasListeners(name:string):boolean;
460
+ get uniqueValues():Map<string, number>;
626
461
  /**
627
- * Removes an event listener added to this table.
628
- * @param name -
629
- * @param callback -
630
- * @return
631
- * @typeParam T -
462
+ * Gets a map with the display name of statistics as keys and the numeric stat as a value.
463
+ * <p>
464
+ * A map of each statistic's name to its value.
465
+ * @return Map of String and Object
632
466
  */
633
- removeEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):boolean;
634
- }
635
- export interface LayoutHints {
636
- readonly searchDisplayMode?:SearchDisplayModeType|null;
637
-
638
- get hiddenColumns():string[]|null;
639
- get frozenColumns():string[]|null;
640
- get columnGroups():ColumnGroup[]|null;
641
- get areSavedLayoutsAllowed():boolean;
642
- get frontColumns():string[]|null;
643
- get backColumns():string[]|null;
467
+ get statisticsMap():Map<string, object>;
644
468
  }
645
469
  /**
646
- * Extends {@link dh.TableData}, but only contains data in the current viewport. The only API change from TableData is that
647
- * ViewportData also contains the offset to this data, so that the actual row number may be determined.
648
- * <p>
649
- * For viewport subscriptions, it is not necessary to read with the key, only with the position.
650
- * <p>
651
- * Do not assume that the first row in `rows` is the first visible row, because extra rows may be provided for easier
470
+ * Options for requesting a snapshot of a table.
471
+ */
472
+ export interface SnapshotOptions extends DataOptions {
473
+ /**
474
+ * If true, the snapshot will be filled starting from the end of the table, where 0 is the last row of the
475
+ * table. Default is false.
476
+ */
477
+ isReverseViewport?:boolean|null;
478
+ /**
479
+ * The rows to include in the snapshot. This can be either a {@link dh.RangeSet} or a single range with
480
+ * `first` and `last` properties.
481
+ */
482
+ rows:RangeSet|SimpleRange;
483
+ }
484
+ export interface RefreshToken {
485
+ get bytes():string;
486
+ get expiry():number;
487
+ }
488
+ /**
489
+ * Represents a table which can be joined to another table. Current implementations are {@link dh.Table} and
490
+ * {@link dh.TotalsTable}.
491
+ */
492
+ export interface JoinableTable {
493
+ freeze():Promise<Table>;
494
+ snapshot(baseTable:Table, doInitialSnapshot?:boolean, stampColumns?:string[]):Promise<Table>;
495
+ /**
496
+ * Joins this table to the provided table, using one of the specified join types:
497
+ * <ul>
498
+ * <li><code>AJ</code>, <code>ReverseAJ</code> (or <code>RAJ</code>) - inexact timeseries joins, based on the
499
+ * provided matching rule.</li>
500
+ * <li><code>CROSS_JOIN</code> (or <code>Join</code>) - cross join of all rows that have matching values in both
501
+ * tables.</li>
502
+ * <li><code>EXACT_JOIN</code> (or <code>ExactJoin</code> - matches values in exactly one row in the right table,
503
+ * with errors if there is not exactly one.</li>
504
+ * <li><code>NATURAL_JOIN</code> (or <code>Natural</code> - matches values in at most one row in the right table,
505
+ * with nulls if there is no match or errors if there are multiple matches.</li>
506
+ * </ul>
507
+ *
508
+ * Note that <code>Left</code> join is not supported here, unlike DHE.
509
+ * <p>
510
+ * See the <a href="https://deephaven.io/core/docs/conceptual/choose-joins/">Choose a join method</a> document for
511
+ * more guidance on picking a join operation.
512
+ * @deprecated Instead, call the specific method for the join type.
513
+ * @param joinType - The type of join to perform, see the list above.
514
+ * @param rightTable - The table to match to values in this table
515
+ * @param columnsToMatch - Columns that should match
516
+ * @param columnsToAdd - Columns from the right table to add to the result - empty/null/absent to add all columns
517
+ * @param asOfMatchRule - If joinType is AJ/RAJ/ReverseAJ, the match rule to use
518
+ * @return a promise that will resolve to the joined table
519
+ */
520
+ join(joinType:string, rightTable:JoinableTable, columnsToMatch:Array<string>, columnsToAdd?:Array<string>|undefined|null, asOfMatchRule?:string|undefined|null):Promise<Table>;
521
+ /**
522
+ * Performs an inexact timeseries join, where rows in this table will have columns added from the closest matching
523
+ * row from the right table.
524
+ * <p>
525
+ * The `asOfMatchRule` value can be one of:
526
+ * <ul>
527
+ * <li>LESS_THAN_EQUAL</li>
528
+ * <li>LESS_THAN</li>
529
+ * <li>GREATER_THAN_EQUAL</li>
530
+ * <li>GREATER_THAN</li>
531
+ * </ul>
532
+ * @param rightTable - the table to match to values in this table
533
+ * @param columnsToMatch - the columns that should match, according to the asOfMatchRole
534
+ * @param columnsToAdd - columns from the right table to add to the resulting table, empty/null/absent to add all
535
+ * columns
536
+ * @param asOfMatchRule - the match rule to use, see above
537
+ * @return a promise that will resolve to the joined table
538
+ */
539
+ asOfJoin(rightTable:JoinableTable, columnsToMatch:Array<string>, columnsToAdd?:Array<string>|undefined|null, asOfMatchRule?:string|undefined|null):Promise<Table>;
540
+ /**
541
+ * a promise that will be resolved with the newly created table holding the results of the specified cross join
542
+ * operation. The <b>columnsToAdd</b> parameter is optional, not specifying it will result in all columns from the
543
+ * right table being added to the output. The <b>reserveBits</b> optional parameter lets the client control how the
544
+ * key space is distributed between the rows in the two tables, see the Java <b>Table</b> class for details.
545
+ * @param rightTable - the table to match to values in this table
546
+ * @param columnsToMatch - the columns that should match exactly
547
+ * @param columnsToAdd - columns from the right table to add to the resulting table, empty/null/absent to add all
548
+ * columns
549
+ * @param reserveBits - the number of bits of key-space to initially reserve per group, null/absent will let the
550
+ * server select a value
551
+ * @return a promise that will resolve to the joined table
552
+ */
553
+ crossJoin(rightTable:JoinableTable, columnsToMatch:Array<string>, columnsToAdd?:Array<string>|undefined|null, reserveBits?:number|undefined|null):Promise<Table>;
554
+ /**
555
+ * a promise that will be resolved with the newly created table holding the results of the specified exact join
556
+ * operation. The `columnsToAdd` parameter is optional, not specifying it will result in all columns from the right
557
+ * table being added to the output.
558
+ * @param rightTable - the table to match to values in this table
559
+ * @param columnsToMatch - the columns that should match exactly
560
+ * @param columnsToAdd - columns from the right table to add to the resulting table, empty/null/absent to add all
561
+ * columns
562
+ * @return a promise that will resolve to the joined table
563
+ */
564
+ exactJoin(rightTable:JoinableTable, columnsToMatch:Array<string>, columnsToAdd?:Array<string>|undefined|null):Promise<Table>;
565
+ /**
566
+ * a promise that will be resolved with the newly created table holding the results of the specified natural join
567
+ * operation. The <b>columnsToAdd</b> parameter is optional, not specifying it will result in all columns from the
568
+ * right table being added to the output.
569
+ * @param rightTable - the table to match to values in this table
570
+ * @param columnsToMatch - the columns that should match exactly
571
+ * @param columnsToAdd - columns from the right table to add to the resulting table, empty/null/absent to add all
572
+ * columns
573
+ * @return a promise that will resolve to the joined table
574
+ */
575
+ naturalJoin(rightTable:JoinableTable, columnsToMatch:Array<string>, columnsToAdd?:Array<string>|undefined|null):Promise<Table>;
576
+ }
577
+ /**
578
+ * Extends {@link dh.TableData}, but only contains data in the current viewport. The only API change from TableData is that
579
+ * ViewportData also contains the offset to this data, so that the actual row number may be determined.
580
+ * <p>
581
+ * For viewport subscriptions, it is not necessary to read with the key, only with the position.
582
+ * <p>
583
+ * Do not assume that the first row in `rows` is the first visible row, because extra rows may be provided for easier
652
584
  * scrolling without going to the server.
653
585
  */
654
586
  export interface ViewportData extends TableData {
@@ -665,10 +597,83 @@ export namespace dh {
665
597
  get columns():Array<Column>;
666
598
  get rows():Array<ViewportRow>;
667
599
  }
668
- export interface ColumnGroup {
669
- get name():string|null;
670
- get children():string[]|null;
671
- get color():string|null;
600
+ /**
601
+ * Options for requesting table data, either as a snapshot or a subscription. See subtypes for more specific options:
602
+ * <ul>
603
+ * <li>{@link dh.SnapshotOptions} for snapshot-specific options</li>
604
+ * <li>{@link dh.SubscriptionOptions} for full-table subscription-specific options</li>
605
+ * <li>{@link dh.ViewportSubscriptionOptions} for viewport subscription-specific options</li>
606
+ * </ul>
607
+ */
608
+ export interface DataOptions {
609
+ /**
610
+ * Optional preview instructions for columns in the table data.
611
+ */
612
+ previewOptions?:PreviewOptions|null;
613
+ /**
614
+ * Required property to indicate which columns should be included in the table data.
615
+ */
616
+ columns:Array<Column>;
617
+ }
618
+ /**
619
+ * Options for requesting a viewport subscription to a table.
620
+ */
621
+ export interface ViewportSubscriptionOptions extends SubscriptionOptions {
622
+ /**
623
+ * If true, the viewport will be filled starting from the end of the table, where 0 is the last row of the
624
+ * table. Default is false.
625
+ */
626
+ isReverseViewport?:boolean|null;
627
+ /**
628
+ * The rows to include in the viewport. This can be either a {@link dh.RangeSet} or a single range with
629
+ * `first` and `last` properties.
630
+ */
631
+ rows:RangeSet|SimpleRange;
632
+ }
633
+ /**
634
+ * Common interface for various ways of accessing table data and formatting for viewport or non-viewport subscriptions
635
+ * on tables, data in trees, and snapshots.
636
+ * <p>
637
+ * Generally speaking, it is more efficient to access data in column-major order, rather than iterating through each Row
638
+ * and accessing all columns that it holds. The {@link rows} accessor can be useful to read row data, but may
639
+ * incur other costs - it is likely faster to access data by columns using {@link getData}.
640
+ */
641
+ export interface TableData {
642
+ /**
643
+ * Reads a row object from the table, from which any subscribed column can be read.
644
+ * @param index - the position or key to access
645
+ * @return the row at the given location
646
+ */
647
+ get(index:LongWrapper|number):Row;
648
+ /**
649
+ * Reads a specific cell from the table, by row key and column.
650
+ * @param index - the row in the table to get data from
651
+ * @param column - the column to read
652
+ * @return the value in the table
653
+ */
654
+ getData(index:LongWrapper|number, column:Column):any;
655
+ /**
656
+ * The server-specified Format to use for the cell at the given position.
657
+ * @param index - the row to read
658
+ * @param column - the column to read
659
+ * @return a Format instance with any server-specified details
660
+ */
661
+ getFormat(index:LongWrapper|number, column:Column):Format;
662
+ get columns():Array<Column>;
663
+ /**
664
+ * A lazily computed array of all rows available on the client.
665
+ */
666
+ get rows():Array<Row>;
667
+ }
668
+ /**
669
+ * Wrap LocalDate values for use in JS. Provides text formatting for display and access to the underlying value.
670
+ */
671
+ export interface LocalDateWrapper {
672
+ valueOf():string;
673
+ getYear():number;
674
+ getMonthValue():number;
675
+ getDayOfMonth():number;
676
+ toString():string;
672
677
  }
673
678
  /**
674
679
  * Represents a server-side object that may not yet have been fetched by the client. When this object will no longer be
@@ -703,34 +708,31 @@ export namespace dh {
703
708
  close():void;
704
709
  }
705
710
  /**
706
- * Wrap LocalTime values for use in JS. Provides text formatting for display and access to the underlying value.
707
- */
708
- export interface LocalTimeWrapper {
709
- valueOf():string;
710
- getHour():number;
711
- getMinute():number;
712
- getSecond():number;
713
- getNano():number;
714
- toString():string;
715
- }
716
- /**
717
- * Similar to the browser `CustomEvent` type, this class holds only the type of the event, and optionally some
718
- * details about the event.
719
- * @typeParam T - the type of the event detail
720
- */
721
- export interface Event<T> {
722
- get detail():T;
723
- get type():string;
724
- }
725
- /**
726
- * Represents a row available in a subscription/snapshot on the client. Do not retain references to rows - they will
727
- * not function properly when the event isn't actively going off (or promise resolving). Instead, wait for the next
728
- * event, or re-request the viewport data.
711
+ * Represents the contents of a single widget data message from the server, with a binary data paylod and exported
712
+ * objects. Implemented both by Widget itself and by the `event.details` when data is received by the client.
713
+ *
714
+ * Terminology note: the name of this type should probably use "Data" instead of "Message", and the methods should use
715
+ * "payload" rather than "data" to match other platforms and the protobuf itself. These names are instead used for
716
+ * backwards compatibility and to better follow JS expectations.
729
717
  */
730
- export interface Row {
731
- get(column:Column):any;
732
- getFormat(column:Column):Format;
733
- get index():LongWrapper;
718
+ export interface WidgetMessageDetails {
719
+ /**
720
+ * Returns the data from this message as a base64-encoded string.
721
+ */
722
+ getDataAsBase64():string;
723
+ /**
724
+ * Returns the data from this message as a Uint8Array.
725
+ */
726
+ getDataAsU8():Uint8Array;
727
+ /**
728
+ * Returns the data from this message as a utf-8 string.
729
+ */
730
+ getDataAsString():string;
731
+ /**
732
+ * Returns an array of exported objects sent from the server. The plugin implementation is now responsible for these
733
+ * objects, and should close them when no longer needed.
734
+ */
735
+ get exportedObjects():WidgetExportedObject[];
734
736
  }
735
737
  /**
736
738
  * Row implementation that also provides additional read-only properties. represents visible rows in the table, but
@@ -759,149 +761,458 @@ export namespace dh {
759
761
  get hasChildren():boolean;
760
762
  get index():LongWrapper;
761
763
  }
764
+ export interface ColumnGroup {
765
+ get name():string|null;
766
+ get children():string[]|null;
767
+ get color():string|null;
768
+ }
762
769
  /**
763
- * Options for requesting a preview of columns when requesting table data. The two properties
764
- * {@link dh.convertArrayToString} and {@link dh.array} are mutually exclusive.
770
+ * Simple range consisting only of start and end numbers. Will be migrated to deephaven-core in the near future, and
771
+ * subsequently removed from this the coreplus namespace.
765
772
  */
766
- export interface PreviewOptions {
767
- /**
768
- * If true, any array columns will be converted to strings for preview purposes. This is the legacy behavior.
769
- */
770
- convertArrayToString?:boolean|null;
773
+ export interface SimpleRange {
774
+ first:number;
775
+ last:number;
776
+ }
777
+ export interface LayoutHints {
778
+ readonly searchDisplayMode?:SearchDisplayModeType|null;
779
+
780
+ get hiddenColumns():string[]|null;
781
+ get frozenColumns():string[]|null;
782
+ get columnGroups():ColumnGroup[]|null;
783
+ get areSavedLayoutsAllowed():boolean;
784
+ get frontColumns():string[]|null;
785
+ get backColumns():string[]|null;
786
+ }
787
+ export interface WorkerHeapInfo {
771
788
  /**
772
- * Specifies the length of the array to serialize. If the array is longer than this length, one extra element
773
- * will be included - the client is expected to truncate the array and append "..." to indicate that there are
774
- * additional elements. Negative values indicate that the values should be counted from the end of the array
775
- * rather than the beginning. Zero or null indicate that the entire array should be serialized. The default is
776
- * null.
789
+ * Total heap size available for this worker.
777
790
  */
778
- array?:number|null;
791
+ get totalHeapSize():number;
792
+ get freeMemory():number;
793
+ get maximumHeapSize():number;
779
794
  }
795
+
780
796
  /**
781
- * Options for requesting a snapshot of a table.
797
+ * A Widget represents a server side object that sends one or more responses to the client. The client can then
798
+ * interpret these responses to see what to render, or how to respond.
799
+ * <p>
800
+ * Most custom object types result in a single response being sent to the client, often with other exported objects, but
801
+ * some will have streamed responses, and allow the client to send follow-up requests of its own. This class's API is
802
+ * backwards compatible, but as such does not offer a way to tell the difference between a streaming or non-streaming
803
+ * object type, the client code that handles the payloads is expected to know what to expect. See
804
+ * {@link dh.WidgetMessageDetails} for more information.
805
+ * <p>
806
+ * When the promise that returns this object resolves, it will have the first response assigned to its fields. Later
807
+ * responses from the server will be emitted as "message" events. When the connection with the server ends, the "close"
808
+ * event will be emitted. In this way, the connection will behave roughly in the same way as a WebSocket - either side
809
+ * can close, and after close no more messages will be processed. There can be some latency in closing locally while
810
+ * remote messages are still pending - it is up to implementations of plugins to handle this case.
811
+ * <p>
812
+ * Also like WebSockets, the plugin API doesn't define how to serialize messages, and just handles any binary payloads.
813
+ * What it does handle however, is allowing those messages to include references to server-side objects with those
814
+ * payloads. Those server side objects might be tables or other built-in types in the Deephaven JS API, or could be
815
+ * objects usable through their own plugins. They also might have no plugin at all, allowing the client to hold a
816
+ * reference to them and pass them back to the server, either to the current plugin instance, or through another API.
817
+ * The `Widget` type does not specify how those objects should be used or their lifecycle, but leaves that
818
+ * entirely to the plugin. Messages will arrive in the order they were sent.
819
+ * <p>
820
+ * This can suggest several patterns for how plugins operate:
821
+ * <ul>
822
+ * <li>The plugin merely exists to transport some other object to the client. This can be useful for objects which can
823
+ * easily be translated to some other type (like a Table) when the user clicks on it. An example of this is
824
+ * `pandas.DataFrame` will result in a widget that only contains a static
825
+ * {@link dh.Table}. Presently, the widget is immediately closed, and only the Table is
826
+ * provided to the JS API consumer.</li>
827
+ * <li>The plugin provides references to Tables and other objects, and those objects can live longer than the object
828
+ * which provided them. One concrete example of this could have been
829
+ * {@link dh.PartitionedTable} when fetching constituent tables, but it was implemented
830
+ * before bidirectional plugins were implemented. Another example of this is plugins that serve as a "factory", giving
831
+ * the user access to table manipulation/creation methods not supported by gRPC or the JS API.</li>
832
+ * <li>The plugin provides reference to Tables and other objects that only make sense within the context of the widget
833
+ * instance, so when the widget goes away, those objects should be released as well. This is also an example of
834
+ * {@link dh.PartitionedTable}, as the partitioned table tracks creation of new keys through
835
+ * an internal table instance.</li>
836
+ * </ul>
837
+ *
838
+ * Handling server objects in messages also has more than one potential pattern that can be used:
839
+ * <ul>
840
+ * <li>One object per message - the message clearly is about that object, no other details required.</li>
841
+ * <li>Objects indexed within their message - as each message comes with a list of objects, those objects can be
842
+ * referenced within the payload by index. This is roughly how {@link dh.plot.Figure}
843
+ * behaves, where the figure descriptor schema includes an index for each created series, describing which table should
844
+ * be used, which columns should be mapped to each axis.</li>
845
+ * <li>Objects indexed since widget creation - each message would append its objects to a list created when the widget
846
+ * was first made, and any new exports that arrive in a new message would be appended to that list. Then, subsequent
847
+ * messages can reference objects already sent. This imposes a limitation where the client cannot release any exports
848
+ * without the server somehow signaling that it will never reference that export again.</li>
849
+ * </ul>
782
850
  */
783
- export interface SnapshotOptions extends DataOptions {
851
+ export class Widget implements WidgetMessageDetails, HasEventHandling {
852
+ static readonly EVENT_MESSAGE:string;
853
+ static readonly EVENT_CLOSE:string;
854
+
855
+ protected constructor();
856
+
784
857
  /**
785
- * If true, the snapshot will be filled starting from the end of the table, where 0 is the last row of the
786
- * table. Default is false.
858
+ * Ends the client connection to the server.
787
859
  */
788
- isReverseViewport?:boolean|null;
860
+ close():void;
861
+ getDataAsBase64():string;
862
+ getDataAsU8():Uint8Array;
863
+ getDataAsString():string;
789
864
  /**
790
- * The rows to include in the snapshot. This can be either a {@link dh.RangeSet} or a single range with
791
- * `first` and `last` properties.
865
+ * Sends a string/bytes payload to the server, along with references to objects that exist on the server.
866
+ * @param msg - string/buffer/view instance that represents data to send
867
+ * @param references - an array of objects that can be safely sent to the server
792
868
  */
793
- rows:RangeSet|SimpleRange;
869
+ sendMessage(msg:string|ArrayBuffer|ArrayBufferView, references?:Array<Table|Widget|WidgetExportedObject|PartitionedTable|TotalsTable|TreeTable>):void;
870
+ addEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):()=>void;
871
+ nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<Event<T>>;
872
+ hasListeners(name:string):boolean;
873
+ removeEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):boolean;
874
+ /**
875
+ *
876
+ * @return the exported objects sent in the initial message from the server. The client is responsible for closing
877
+ * them when finished using them.
878
+ */
879
+ get exportedObjects():WidgetExportedObject[];
880
+ /**
881
+ *
882
+ * @return the type of this widget
883
+ */
884
+ get type():string;
794
885
  }
795
886
 
887
+
796
888
  /**
797
- * Provides access to data in a table. Note that several methods present their response through Promises. This allows
798
- * the client to both avoid actually connecting to the server until necessary, and also will permit some changes not to
799
- * inform the UI right away that they have taken place.
889
+ * Describes how a Totals Table will be generated from its parent table. Each table has a default (which may be null)
890
+ * indicating how that table was configured when it was declared, and each Totals Table has a similar property
891
+ * describing how it was created. Both the <b>Table.getTotalsTable</b> and <b>Table.getGrandTotalsTable</b> methods take
892
+ * this config as an optional parameter - without it, the table's default will be used, or if null, a default instance
893
+ * of <b>TotalsTableConfig</b> will be supplied.
894
+ *
895
+ * This class has a no-arg constructor, allowing an instance to be made with the default values provided. However, any
896
+ * JS object can be passed in to the methods which accept instances of this type, provided their values adhere to the
897
+ * expected formats.
800
898
  */
801
- export class Table implements JoinableTable, HasEventHandling {
802
- readonly description?:string|null;
803
- readonly pluginName?:string|null;
804
- readonly layoutHints?:null|LayoutHints;
899
+ export class TotalsTableConfig {
805
900
  /**
806
- * The table size has updated, so live scrollbars and the like can be updated accordingly.
901
+ * @deprecated
807
902
  */
808
- static readonly EVENT_SIZECHANGED:string;
903
+ static readonly COUNT:string;
809
904
  /**
810
- * The table size has updated, so live scrollbars and the like can be updated accordingly.
905
+ * @deprecated
811
906
  */
812
- static readonly EVENT_UPDATED:string;
907
+ static readonly MIN:string;
813
908
  /**
814
- * The table size has updated, so live scrollbars and the like can be updated accordingly.
909
+ * @deprecated
815
910
  */
816
- static readonly EVENT_ROWADDED:string;
911
+ static readonly MAX:string;
817
912
  /**
818
- * The table size has updated, so live scrollbars and the like can be updated accordingly.
913
+ * @deprecated
819
914
  */
820
- static readonly EVENT_ROWREMOVED:string;
915
+ static readonly SUM:string;
821
916
  /**
822
- * The table size has updated, so live scrollbars and the like can be updated accordingly.
917
+ * @deprecated
823
918
  */
824
- static readonly EVENT_ROWUPDATED:string;
919
+ static readonly ABS_SUM:string;
825
920
  /**
826
- * The table size has updated, so live scrollbars and the like can be updated accordingly.
921
+ * @deprecated
827
922
  */
828
- static readonly EVENT_SORTCHANGED:string;
923
+ static readonly VAR:string;
829
924
  /**
830
- * The table size has updated, so live scrollbars and the like can be updated accordingly.
925
+ * @deprecated
831
926
  */
832
- static readonly EVENT_FILTERCHANGED:string;
927
+ static readonly AVG:string;
833
928
  /**
834
- * The table size has updated, so live scrollbars and the like can be updated accordingly.
929
+ * @deprecated
835
930
  */
836
- static readonly EVENT_CUSTOMCOLUMNSCHANGED:string;
931
+ static readonly STD:string;
837
932
  /**
838
- * The table size has updated, so live scrollbars and the like can be updated accordingly.
933
+ * @deprecated
839
934
  */
840
- static readonly EVENT_DISCONNECT:string;
935
+ static readonly FIRST:string;
841
936
  /**
842
- * The table size has updated, so live scrollbars and the like can be updated accordingly.
937
+ * @deprecated
843
938
  */
844
- static readonly EVENT_RECONNECT:string;
939
+ static readonly LAST:string;
845
940
  /**
846
- * The table size has updated, so live scrollbars and the like can be updated accordingly.
941
+ * @deprecated
847
942
  */
848
- static readonly EVENT_RECONNECTFAILED:string;
943
+ static readonly SKIP:string;
849
944
  /**
850
- * The table size has updated, so live scrollbars and the like can be updated accordingly.
945
+ * Specifies if a Totals Table should be expanded by default in the UI. Defaults to false.
851
946
  */
852
- static readonly EVENT_REQUEST_FAILED:string;
947
+ showTotalsByDefault:boolean;
853
948
  /**
854
- * The table size has updated, so live scrollbars and the like can be updated accordingly.
949
+ * Specifies if a Grand Totals Table should be expanded by default in the UI. Defaults to false.
855
950
  */
856
- static readonly EVENT_REQUEST_SUCCEEDED:string;
951
+ showGrandTotalsByDefault:boolean;
857
952
  /**
858
- * The size the table will have if it is uncoalesced.
953
+ * Specifies the default operation for columns that do not have a specific operation applied; defaults to "Sum".
859
954
  */
860
- static readonly SIZE_UNCOALESCED:number;
861
-
862
- protected constructor();
863
-
864
- batch(userCode:(arg0:unknown)=>void):Promise<Table>;
955
+ defaultOperation:AggregationOperationType;
865
956
  /**
866
- * Retrieve a column by the given name. You should prefer to always retrieve a new Column instance instead of
867
- * caching a returned value.
868
- * @param key -
869
- * @return {@link dh.Column}
957
+ * Mapping from each column name to the aggregation(s) that should be applied to that column in the resulting Totals
958
+ * Table. If a column is omitted, the defaultOperation is used.
870
959
  */
871
- findColumn(key:string):Column;
960
+ operationMap:{ [key: string]: Array<AggregationOperationType>; };
872
961
  /**
873
- * Retrieve multiple columns specified by the given names.
874
- * @param keys -
875
- * @return {@link dh.Column} array
962
+ * Groupings to use when generating the Totals Table. One row will exist for each unique set of values observed in
963
+ * these columns. See also `Table.selectDistinct`.
876
964
  */
877
- findColumns(keys:string[]):Column[];
878
- isBlinkTable():boolean;
965
+ groupBy:Array<string>;
966
+
967
+ constructor();
968
+
969
+ toString():string;
970
+ }
971
+
972
+ /**
973
+ * Describes a grouping and aggregations for a roll-up table. Pass to the <b>Table.rollup</b> function to create a
974
+ * roll-up table.
975
+ */
976
+ export class RollupConfig {
879
977
  /**
880
- * If .hasInputTable is true, you may call this method to gain access to an InputTable object which can be used to
881
- * mutate the data within the table. If the table is not an Input Table, the promise will be immediately rejected.
882
- * @return Promise of dh.InputTable
978
+ * Ordered list of columns to group by to form the hierarchy of the resulting roll-up table.
883
979
  */
884
- inputTable():Promise<InputTable>;
980
+ groupingColumns:Array<String>;
885
981
  /**
886
- * Indicates that this Table instance will no longer be used, and its connection to the server can be cleaned up.
982
+ * Mapping from each aggregation name to the ordered list of columns it should be applied to in the resulting
983
+ * roll-up table.
887
984
  */
888
- close():void;
889
- getAttributes():string[];
985
+ aggregations:{ [key: string]: Array<string>; };
890
986
  /**
891
- * null if no property exists, a string if it is an easily serializable property, or a ```Promise
892
- * &lt;Table&gt;``` that will either resolve with a table or error out if the object can't be passed to JS.
893
- * @param attributeName -
894
- * @return Object
987
+ * Optional parameter indicating if an extra leaf node should be added at the bottom of the hierarchy, showing the
988
+ * rows in the underlying table which make up that grouping. Since these values might be a different type from the
989
+ * rest of the column, any client code must check if TreeRow.hasChildren = false, and if so, interpret those values
990
+ * as if they were Column.constituentType instead of Column.type. Defaults to false.
895
991
  */
896
- getAttribute(attributeName:string):unknown|undefined|null;
992
+ includeConstituents:boolean;
993
+ includeOriginalColumns?:boolean|null;
897
994
  /**
898
- * Replace the currently set sort on this table. Returns the previously set value. Note that the sort property will
899
- * immediately return the new value, but you may receive update events using the old sort before the new sort is
900
- * applied, and the <b>sortchanged</b> event fires. Reusing existing, applied sorts may enable this to perform
901
- * better on the server. The <b>updated</b> event will also fire, but <b>rowadded</b> and <b>rowremoved</b> will
902
- * not.
903
- * @param sort -
904
- * @return {@link dh.Sort} array
995
+ * Optional parameter indicating if original column descriptions should be included. Defaults to true.
996
+ */
997
+ includeDescriptions:boolean;
998
+
999
+ constructor();
1000
+ }
1001
+
1002
+ /**
1003
+ * Event fired when a command is issued from the client.
1004
+ */
1005
+ export class CommandInfo {
1006
+ constructor(code:string, result:Promise<dh.ide.CommandResult>);
1007
+
1008
+ get result():Promise<dh.ide.CommandResult>;
1009
+ get code():string;
1010
+ }
1011
+
1012
+ export class LoginCredentials {
1013
+ type?:string|null;
1014
+ username?:string|null;
1015
+ token?:string|null;
1016
+
1017
+ constructor();
1018
+ }
1019
+
1020
+ /**
1021
+ * A js type for operating on input tables.
1022
+ *
1023
+ * Represents a User Input Table, which can have data added to it from other sources.
1024
+ *
1025
+ * You may add rows using dictionaries of key-value tuples (representing columns by name), add tables containing all the
1026
+ * key/value columns to add, or delete tables containing the keys to delete. Each operation is atomic, and will either
1027
+ * succeed completely or fail completely. To guarantee order of operations, apply an operation and wait for the response
1028
+ * before sending the next operation.
1029
+ *
1030
+ * Each table has one or more key columns, where each unique combination of keys will appear at most once in the table.
1031
+ *
1032
+ * To view the results of the Input Table, you should use standard table operations on the InputTable's source Table
1033
+ * object.
1034
+ */
1035
+ export class InputTable {
1036
+ protected constructor();
1037
+
1038
+ /**
1039
+ * Adds a single row to the table. For each key or value column name in the Input Table, we retrieve that javascript
1040
+ * property at that name and validate it can be put into the given column type.
1041
+ * @param row -
1042
+ * @param userTimeZone -
1043
+ * @return Promise of dh.InputTable
1044
+ */
1045
+ addRow(row:{ [key: string]: any; }, userTimeZone?:string):Promise<InputTable>;
1046
+ /**
1047
+ * Add multiple rows to a table.
1048
+ * @param rows -
1049
+ * @param userTimeZone -
1050
+ * @return Promise of dh.InputTable
1051
+ */
1052
+ addRows(rows:{ [key: string]: any; }[], userTimeZone?:string):Promise<InputTable>;
1053
+ /**
1054
+ * Add an entire table to this Input Table. Only column names that match the definition of the input table will be
1055
+ * copied, and all key columns must have values filled in. This only copies the current state of the source table;
1056
+ * future updates to the source table will not be reflected in the Input Table. The returned promise will be
1057
+ * resolved to the same InputTable instance this method was called upon once the server returns.
1058
+ * @param tableToAdd -
1059
+ * @return Promise of dh.InputTable
1060
+ */
1061
+ addTable(tableToAdd:Table):Promise<InputTable>;
1062
+ /**
1063
+ * Add multiple tables to this Input Table.
1064
+ * @param tablesToAdd -
1065
+ * @return Promise of dh.InputTable
1066
+ */
1067
+ addTables(tablesToAdd:Table[]):Promise<InputTable>;
1068
+ /**
1069
+ * Deletes an entire table from this Input Table. Key columns must match the Input Table.
1070
+ * @param tableToDelete -
1071
+ * @return Promise of dh.InputTable
1072
+ */
1073
+ deleteTable(tableToDelete:Table):Promise<InputTable>;
1074
+ /**
1075
+ * Delete multiple tables from this Input Table.
1076
+ * @param tablesToDelete -
1077
+ * @return
1078
+ */
1079
+ deleteTables(tablesToDelete:Table[]):Promise<InputTable>;
1080
+ /**
1081
+ * A list of the key columns, by name
1082
+ * @return String array.
1083
+ */
1084
+ get keys():string[];
1085
+ /**
1086
+ * A list of the value columns, by name
1087
+ * @return String array.
1088
+ */
1089
+ get values():string[];
1090
+ /**
1091
+ * A list of the key columns.
1092
+ * @return Column array.
1093
+ */
1094
+ get keyColumns():Column[];
1095
+ /**
1096
+ * A list of the value Column objects
1097
+ * @return {@link dh.Column} array.
1098
+ */
1099
+ get valueColumns():Column[];
1100
+ /**
1101
+ * The source table for this Input Table
1102
+ * @return dh.table
1103
+ */
1104
+ get table():Table;
1105
+ }
1106
+
1107
+ /**
1108
+ * Provides access to data in a table. Note that several methods present their response through Promises. This allows
1109
+ * the client to both avoid actually connecting to the server until necessary, and also will permit some changes not to
1110
+ * inform the UI right away that they have taken place.
1111
+ */
1112
+ export class Table implements JoinableTable, HasEventHandling {
1113
+ readonly description?:string|null;
1114
+ readonly pluginName?:string|null;
1115
+ readonly layoutHints?:null|LayoutHints;
1116
+ /**
1117
+ * The table size has updated, so live scrollbars and the like can be updated accordingly.
1118
+ */
1119
+ static readonly EVENT_SIZECHANGED:string;
1120
+ /**
1121
+ * The table size has updated, so live scrollbars and the like can be updated accordingly.
1122
+ */
1123
+ static readonly EVENT_UPDATED:string;
1124
+ /**
1125
+ * The table size has updated, so live scrollbars and the like can be updated accordingly.
1126
+ */
1127
+ static readonly EVENT_ROWADDED:string;
1128
+ /**
1129
+ * The table size has updated, so live scrollbars and the like can be updated accordingly.
1130
+ */
1131
+ static readonly EVENT_ROWREMOVED:string;
1132
+ /**
1133
+ * The table size has updated, so live scrollbars and the like can be updated accordingly.
1134
+ */
1135
+ static readonly EVENT_ROWUPDATED:string;
1136
+ /**
1137
+ * The table size has updated, so live scrollbars and the like can be updated accordingly.
1138
+ */
1139
+ static readonly EVENT_SORTCHANGED:string;
1140
+ /**
1141
+ * The table size has updated, so live scrollbars and the like can be updated accordingly.
1142
+ */
1143
+ static readonly EVENT_FILTERCHANGED:string;
1144
+ /**
1145
+ * The table size has updated, so live scrollbars and the like can be updated accordingly.
1146
+ */
1147
+ static readonly EVENT_CUSTOMCOLUMNSCHANGED:string;
1148
+ /**
1149
+ * The table size has updated, so live scrollbars and the like can be updated accordingly.
1150
+ */
1151
+ static readonly EVENT_DISCONNECT:string;
1152
+ /**
1153
+ * The table size has updated, so live scrollbars and the like can be updated accordingly.
1154
+ */
1155
+ static readonly EVENT_RECONNECT:string;
1156
+ /**
1157
+ * The table size has updated, so live scrollbars and the like can be updated accordingly.
1158
+ */
1159
+ static readonly EVENT_RECONNECTFAILED:string;
1160
+ /**
1161
+ * The table size has updated, so live scrollbars and the like can be updated accordingly.
1162
+ */
1163
+ static readonly EVENT_REQUEST_FAILED:string;
1164
+ /**
1165
+ * The table size has updated, so live scrollbars and the like can be updated accordingly.
1166
+ */
1167
+ static readonly EVENT_REQUEST_SUCCEEDED:string;
1168
+ /**
1169
+ * The size the table will have if it is uncoalesced.
1170
+ */
1171
+ static readonly SIZE_UNCOALESCED:number;
1172
+
1173
+ protected constructor();
1174
+
1175
+ batch(userCode:(arg0:unknown)=>void):Promise<Table>;
1176
+ /**
1177
+ * Retrieve a column by the given name. You should prefer to always retrieve a new Column instance instead of
1178
+ * caching a returned value.
1179
+ * @param key -
1180
+ * @return {@link dh.Column}
1181
+ */
1182
+ findColumn(key:string):Column;
1183
+ /**
1184
+ * Retrieve multiple columns specified by the given names.
1185
+ * @param keys -
1186
+ * @return {@link dh.Column} array
1187
+ */
1188
+ findColumns(keys:string[]):Column[];
1189
+ isBlinkTable():boolean;
1190
+ /**
1191
+ * If .hasInputTable is true, you may call this method to gain access to an InputTable object which can be used to
1192
+ * mutate the data within the table. If the table is not an Input Table, the promise will be immediately rejected.
1193
+ * @return Promise of dh.InputTable
1194
+ */
1195
+ inputTable():Promise<InputTable>;
1196
+ /**
1197
+ * Indicates that this Table instance will no longer be used, and its connection to the server can be cleaned up.
1198
+ */
1199
+ close():void;
1200
+ getAttributes():string[];
1201
+ /**
1202
+ * null if no property exists, a string if it is an easily serializable property, or a ```Promise
1203
+ * &lt;Table&gt;``` that will either resolve with a table or error out if the object can't be passed to JS.
1204
+ * @param attributeName -
1205
+ * @return Object
1206
+ */
1207
+ getAttribute(attributeName:string):unknown|undefined|null;
1208
+ /**
1209
+ * Replace the currently set sort on this table. Returns the previously set value. Note that the sort property will
1210
+ * immediately return the new value, but you may receive update events using the old sort before the new sort is
1211
+ * applied, and the <b>sortchanged</b> event fires. Reusing existing, applied sorts may enable this to perform
1212
+ * better on the server. The <b>updated</b> event will also fire, but <b>rowadded</b> and <b>rowremoved</b> will
1213
+ * not.
1214
+ * @param sort -
1215
+ * @return {@link dh.Sort} array
905
1216
  */
906
1217
  applySort(sort:Sort[]):Array<Sort>;
907
1218
  /**
@@ -1179,85 +1490,39 @@ export namespace dh {
1179
1490
  static reverse():Sort;
1180
1491
  }
1181
1492
 
1182
-
1183
1493
  /**
1184
- * This class allows iteration over non-contiguous indexes. In the future, this will support the EcmaScript 2015
1185
- * Iteration protocol, but for now has one method which returns an iterator, and also supports querying the size.
1186
- * Additionally, we may add support for creating RangeSet objects to better serve some use cases.
1494
+ * Represents a non-viewport subscription to a table, and all data currently known to be present in the subscribed
1495
+ * columns. This class handles incoming snapshots and deltas, and fires events to consumers to notify of data changes.
1496
+ * <p>
1497
+ * Unlike {@link dh.TableViewportSubscription}, the "original" table does not have a reference to this instance, only the
1498
+ * "private" table instance does, since the original cannot modify the subscription, and the private instance must
1499
+ * forward data to it.
1500
+ * <p>
1501
+ * Represents a subscription to the table on the server. Changes made to the table will not be reflected here - the
1502
+ * subscription must be closed and a new one optioned to see those changes. The event model is slightly different from
1503
+ * viewports to make it less expensive to compute for large tables.
1187
1504
  */
1188
- export class RangeSet {
1505
+ export class TableSubscription implements HasEventHandling {
1189
1506
  protected constructor();
1190
1507
 
1191
- static ofRange(first:number, last:number):RangeSet;
1192
- static ofItems(rows:number[]):RangeSet;
1193
- static ofRanges(ranges:RangeSet[]):RangeSet;
1194
- static ofSortedRanges(ranges:RangeSet[]):RangeSet;
1508
+ static createTableSubscription(options:SubscriptionOptions, existingTable:Table):TableSubscription;
1195
1509
  /**
1196
- * a new iterator over all indexes in this collection.
1197
- * @return Iterator of {@link dh.LongWrapper}
1510
+ * Updates the subscription to use the given columns and update interval.
1511
+ * @param columns - the new columns to subscribe to
1512
+ * @param updateIntervalMs - the new update interval, or null/omit to use the default of one second
1198
1513
  */
1199
- iterator():Iterator<LongWrapper>;
1514
+ changeSubscription(columns:Array<Column>, updateIntervalMs:number|undefined|null):void;
1200
1515
  /**
1201
- * The total count of items contained in this collection. In some cases this can be expensive to compute, and
1202
- * generally should not be needed except for debugging purposes, or preallocating space (i.e., do not call this
1203
- * property each time through a loop).
1204
- * @return double
1516
+ * Update the options for this viewport subscription. This cannot alter the update interval or preview options.
1517
+ * @param options - the subscription options
1205
1518
  */
1206
- get size():number;
1207
- }
1208
-
1209
- /**
1210
- * Wrap BigInteger values for use in JS. Provides text formatting for display and access to the underlying value.
1211
- */
1212
- export class BigIntegerWrapper {
1213
- protected constructor();
1214
-
1215
- static ofString(str:string):BigIntegerWrapper;
1216
- asNumber():number;
1217
- valueOf():string;
1218
- toString():string;
1219
- equals(o:object):boolean;
1220
- hashCode():number;
1221
- }
1222
-
1223
- /**
1224
- * This object serves as a "handle" to a subscription, allowing it to be acted on directly or canceled outright. If you
1225
- * retain an instance of this, you have two choices - either only use it to call `close()` on it to stop the table's
1226
- * viewport without creating a new one, or listen directly to this object instead of the table for data events, and
1227
- * always call `close()` when finished. Calling any method on this object other than close() will result in it
1228
- * continuing to live on after `setViewport` is called on the original table, or after the table is modified.
1229
- */
1230
- export class TableViewportSubscription implements HasEventHandling {
1231
- protected constructor();
1232
-
1233
- /**
1234
- * Changes the rows and columns set on this viewport. This cannot be used to change the update interval.
1235
- * @param firstRow -
1236
- * @param lastRow -
1237
- * @param columns -
1238
- * @param updateIntervalMs -
1239
- * @deprecated use {@link #update(Object)} instead
1240
- */
1241
- setViewport(firstRow:number, lastRow:number, columns?:Column[]|undefined|null, updateIntervalMs?:number|undefined|null, isReverseViewport?:boolean|undefined|null):void;
1242
- /**
1243
- * Update the options for this viewport subscription. This cannot alter the update interval or preview options.
1244
- * @param options - the subscription options
1245
- */
1246
- update(options:ViewportSubscriptionOptions):void;
1519
+ update(options:SubscriptionOptions):void;
1520
+ get columns():Array<Column>;
1247
1521
  /**
1248
- * Stops this viewport from running, stopping all events on itself and on the table that created it.
1522
+ * Stops the subscription on the server.
1249
1523
  */
1250
1524
  close():void;
1251
1525
  /**
1252
- * Gets the data currently visible in this viewport
1253
- * @return Promise of {@link dh.TableData}.
1254
- */
1255
- getViewportData():Promise<ViewportData>;
1256
- /**
1257
- * @deprecated
1258
- */
1259
- snapshot(rows:RangeSet, columns:Column[]):Promise<TableData>;
1260
- /**
1261
1526
  * Listen for events on this object.
1262
1527
  * @param name - the name of the event to listen for
1263
1528
  * @param callback - a function to call when the event occurs
@@ -1278,126 +1543,125 @@ export namespace dh {
1278
1543
  }
1279
1544
 
1280
1545
  /**
1281
- * Describes the structure of the column, and if desired can be used to get access to the data to be rendered in this
1282
- * column.
1546
+ * Options for custom columns.
1283
1547
  */
1284
- export class Column {
1548
+ export class CustomColumnOptions {
1285
1549
  /**
1286
- * If this column is part of a roll-up tree table, represents the type of the row data that can be found in this
1287
- * column for leaf nodes if includeConstituents is enabled. Otherwise, it is <b>null</b>.
1288
- * @return String
1550
+ * When specified for custom columns on a rollup table, specifies if the formula apply to rollup or constituent
1551
+ * nodes.
1289
1552
  */
1290
- readonly constituentType?:string|null;
1291
- readonly description?:string|null;
1553
+ rollupNodeType?:RollupNodeTypeType|null;
1554
+
1555
+ constructor();
1556
+ }
1292
1557
 
1558
+ /**
1559
+ * This class allows iteration over non-contiguous indexes. In the future, this will support the EcmaScript 2015
1560
+ * Iteration protocol, but for now has one method which returns an iterator, and also supports querying the size.
1561
+ * Additionally, we may add support for creating RangeSet objects to better serve some use cases.
1562
+ */
1563
+ export class RangeSet {
1293
1564
  protected constructor();
1294
1565
 
1566
+ static ofRange(first:number, last:number):RangeSet;
1567
+ static ofItems(rows:number[]):RangeSet;
1568
+ static ofRanges(ranges:RangeSet[]):RangeSet;
1569
+ static ofSortedRanges(ranges:RangeSet[]):RangeSet;
1295
1570
  /**
1296
- * the value for this column in the given row. Type will be consistent with the type of the Column.
1297
- * @param row -
1298
- * @return Any
1571
+ * a new iterator over all indexes in this collection.
1572
+ * @return Iterator of {@link dh.LongWrapper}
1299
1573
  */
1300
- get(row:Row):any;
1301
- getFormat(row:Row):Format;
1574
+ iterator():Iterator<LongWrapper>;
1302
1575
  /**
1303
- * Creates a sort builder object, to be used when sorting by this column.
1304
- * @return {@link dh.Sort}
1576
+ * The total count of items contained in this collection. In some cases this can be expensive to compute, and
1577
+ * generally should not be needed except for debugging purposes, or preallocating space (i.e., do not call this
1578
+ * property each time through a loop).
1579
+ * @return double
1305
1580
  */
1306
- sort():Sort;
1581
+ get size():number;
1582
+ }
1583
+
1584
+ /**
1585
+ * Describes a filter which can be applied to a table. Replacing these instances may be more expensive than reusing
1586
+ * them. These instances are immutable - all operations that compose them to build bigger expressions return a new
1587
+ * instance.
1588
+ */
1589
+ export class FilterCondition {
1590
+ protected constructor();
1591
+
1307
1592
  /**
1308
- * Creates a new value for use in filters based on this column. Used either as a parameter to another filter
1309
- * operation, or as a builder to create a filter operation.
1310
- * @return {@link dh.FilterValue}
1593
+ * the opposite of this condition
1594
+ * @return FilterCondition
1311
1595
  */
1312
- filter():FilterValue;
1596
+ not():FilterCondition;
1313
1597
  /**
1314
- * a <b>CustomColumn</b> object to apply using `applyCustomColumns` with the expression specified.
1315
- * @param expression -
1316
- * @return {@link dh.CustomColumn}
1598
+ * a condition representing the current condition logically ANDed with the other parameters
1599
+ * @param filters -
1600
+ * @return FilterCondition
1317
1601
  */
1318
- formatColor(expression:string, options?:CustomColumnOptions|undefined|null):CustomColumn;
1602
+ and(...filters:FilterCondition[]):FilterCondition;
1319
1603
  /**
1320
- * a <b>CustomColumn</b> object to apply using <b>applyCustomColumns</b> with the expression specified.
1321
- * @param expression -
1322
- * @return {@link dh.CustomColumn}
1604
+ * a condition representing the current condition logically ORed with the other parameters
1605
+ * @param filters -
1606
+ * @return FilterCondition.
1323
1607
  */
1324
- formatNumber(expression:string, options?:CustomColumnOptions|undefined|null):CustomColumn;
1608
+ or(...filters:FilterCondition[]):FilterCondition;
1325
1609
  /**
1326
- * a <b>CustomColumn</b> object to apply using <b>applyCustomColumns</b> with the expression specified.
1327
- * @param expression -
1328
- * @return {@link dh.CustomColumn}
1610
+ * a string suitable for debugging showing the details of this condition.
1611
+ * @return String.
1329
1612
  */
1330
- formatDate(expression:string, options?:CustomColumnOptions|undefined|null):CustomColumn;
1331
1613
  toString():string;
1614
+ get columns():Array<Column>;
1332
1615
  /**
1333
- * Label for this column.
1334
- * @return String
1335
- */
1336
- get name():string;
1337
- /**
1338
- * True if this column is a partition column. Partition columns are used for filtering uncoalesced tables - see
1339
- * {@link Table.uncoalesced}.
1340
- * @return true if the column is a partition column
1341
- */
1342
- get isPartitionColumn():boolean;
1343
- /**
1344
- *
1345
- * @deprecated do not use. Internal index of the column in the table, to be used as a key on the Row.
1346
- * @return int
1347
- */
1348
- get index():number;
1349
- get isSortable():boolean;
1350
- /**
1351
- * Type of the row data that can be found in this column.
1352
- * @return String
1353
- */
1354
- get type():string;
1355
- /**
1356
- * Format entire rows colors using the expression specified. Returns a <b>CustomColumn</b> object to apply to a
1357
- * table using <b>applyCustomColumns</b> with the parameters specified.
1358
- * @param expression -
1359
- * @param options -
1360
- * @return {@link dh.CustomColumn}
1616
+ * a filter condition invoking a static function with the given parameters. Currently supported Deephaven static
1617
+ * functions:
1618
+ * <ul>
1619
+ * <li><b>inRange</b>: Given three comparable values, returns true if the first is less than the second but greater
1620
+ * than the third</li>
1621
+ * <li><b>isInf</b>:Returns true if the given number is <i>infinity</i></li>
1622
+ * <li><b>isNaN</b>:Returns true if the given number is <i>not a number</i></li>
1623
+ * <li><b>isNormal</b>:Returns true if the given number <i>is not null</i>, <i>is not infinity</i>, and <i>is not
1624
+ * "not a number"</i></li>
1625
+ * <li><b>startsWith</b>:Returns true if the first string starts with the second string</li>
1626
+ * <li><b>endsWith</b>Returns true if the first string ends with the second string</li>
1627
+ * <li><b>matches</b>:Returns true if the first string argument matches the second string used as a Java regular
1628
+ * expression</li>
1629
+ * <li><b>contains</b>:Returns true if the first string argument contains the second string as a substring</li>
1630
+ * <li><b>in</b>:Returns true if the first string argument can be found in the second array argument.
1631
+ * <p>
1632
+ * Note that the array can only be specified as a column reference at this time - typically the `FilterValue.in`
1633
+ * method should be used in other cases
1634
+ * </p>
1635
+ * </li>
1636
+ * </ul>
1637
+ * @param function -
1638
+ * @param args -
1639
+ * @return dh.FilterCondition
1361
1640
  */
1362
- static formatRowColor(expression:string, options?:CustomColumnOptions|undefined|null):CustomColumn;
1641
+ static invoke(func:string, ...args:FilterValue[]):FilterCondition;
1363
1642
  /**
1364
- * a <b>CustomColumn</b> object to apply using <b>applyCustomColumns</b> with the expression specified.
1365
- * @param name -
1366
- * @param expression -
1367
- * @param options -
1368
- * @return {@link dh.CustomColumn}
1643
+ * a filter condition which will check if the given value can be found in any supported column on whatever table
1644
+ * this FilterCondition is passed to. This FilterCondition is somewhat unique in that it need not be given a column
1645
+ * instance, but will adapt to any table. On numeric columns, with a value passed in which can be parsed as a
1646
+ * number, the column will be filtered to numbers which equal, or can be "rounded" effectively to this number. On
1647
+ * String columns, the given value will match any column which contains this string in a case-insensitive search. An
1648
+ * optional second argument can be passed, an array of `FilterValue` from the columns to limit this search to (see
1649
+ * {@link dh.Column.filter}).
1650
+ * @param value -
1651
+ * @param columns -
1652
+ * @return dh.FilterCondition
1369
1653
  */
1370
- static createCustomColumn(name:string, expression:string, options?:CustomColumnOptions|undefined|null):CustomColumn;
1654
+ static search(value:FilterValue, columns?:FilterValue[]):FilterCondition;
1371
1655
  }
1372
1656
 
1373
1657
  /**
1374
- * Addition optional configuration that can be passed to the {@link dh.CoreClient} constructor.
1658
+ * Deprecated for use in Deephaven Core.
1659
+ * @deprecated
1375
1660
  */
1376
- export class ConnectOptions {
1377
- /**
1378
- * Optional map of http header names and values to send to the server with each request.
1379
- */
1380
- headers?:{ [key: string]: string; }|null;
1381
- /**
1382
- * True to enable debug logging. At this time, only enables logging for gRPC calls.
1383
- */
1384
- debug?:boolean|null;
1385
- /**
1386
- * Set this to true to force the use of websockets when connecting to the deephaven instance, false to force the use
1387
- * of `fetch`. Ignored if {@link dh.transportFactory} is set.
1388
- * <p>
1389
- * Defaults to null, indicating that the server URL should be checked to see if we connect with fetch or websockets.
1390
- */
1391
- useWebsockets?:boolean|null;
1392
- /**
1393
- * The transport factory to use for creating gRPC streams. If specified, the JS API will ignore
1394
- * {@link dh.useWebsockets} and its own internal logic for determining the appropriate transport to use.
1395
- * <p>
1396
- * Defaults to null, indicating that the JS API should determine the appropriate transport to use. If
1397
- * `useWebsockets` is set to true, the JS API will use websockets, otherwise if the server url begins with
1398
- * https, it will use fetch, otherwise it will use websockets.
1399
- */
1400
- transportFactory?:dh.grpc.GrpcTransportFactory|null;
1661
+ export class Client {
1662
+ static readonly EVENT_REQUEST_FAILED:string;
1663
+ static readonly EVENT_REQUEST_STARTED:string;
1664
+ static readonly EVENT_REQUEST_SUCCEEDED:string;
1401
1665
 
1402
1666
  constructor();
1403
1667
  }
@@ -1411,15 +1675,6 @@ export namespace dh {
1411
1675
  protected constructor();
1412
1676
  }
1413
1677
 
1414
- export class LongWrapper {
1415
- protected constructor();
1416
-
1417
- static ofString(str:string):LongWrapper;
1418
- asNumber():number;
1419
- valueOf():string;
1420
- toString():string;
1421
- }
1422
-
1423
1678
  /**
1424
1679
  * Presently, this is the entrypoint into the Deephaven JS API. By creating an instance of this with the server URL and
1425
1680
  * some options, JS applications can run code on the server, and interact with available exportable objects.
@@ -1519,14 +1774,107 @@ export namespace dh {
1519
1774
  }
1520
1775
 
1521
1776
  /**
1522
- * Represents a set of Tables each corresponding to some key. The keys are available locally, but a call must be made to
1523
- * the server to get each Table. All tables will have the same structure.
1777
+ * Describes the structure of the column, and if desired can be used to get access to the data to be rendered in this
1778
+ * column.
1524
1779
  */
1525
- export class PartitionedTable implements HasEventHandling {
1780
+ export class Column {
1526
1781
  /**
1527
- * Indicates that a new key has been added to the array of keys, which can now be fetched with getTable.
1528
- */
1529
- static readonly EVENT_KEYADDED:string;
1782
+ * If this column is part of a roll-up tree table, represents the type of the row data that can be found in this
1783
+ * column for leaf nodes if includeConstituents is enabled. Otherwise, it is <b>null</b>.
1784
+ * @return String
1785
+ */
1786
+ readonly constituentType?:string|null;
1787
+ readonly description?:string|null;
1788
+
1789
+ protected constructor();
1790
+
1791
+ /**
1792
+ * the value for this column in the given row. Type will be consistent with the type of the Column.
1793
+ * @param row -
1794
+ * @return Any
1795
+ */
1796
+ get(row:Row):any;
1797
+ getFormat(row:Row):Format;
1798
+ /**
1799
+ * Creates a sort builder object, to be used when sorting by this column.
1800
+ * @return {@link dh.Sort}
1801
+ */
1802
+ sort():Sort;
1803
+ /**
1804
+ * Creates a new value for use in filters based on this column. Used either as a parameter to another filter
1805
+ * operation, or as a builder to create a filter operation.
1806
+ * @return {@link dh.FilterValue}
1807
+ */
1808
+ filter():FilterValue;
1809
+ /**
1810
+ * a <b>CustomColumn</b> object to apply using `applyCustomColumns` with the expression specified.
1811
+ * @param expression -
1812
+ * @return {@link dh.CustomColumn}
1813
+ */
1814
+ formatColor(expression:string, options?:CustomColumnOptions|undefined|null):CustomColumn;
1815
+ /**
1816
+ * a <b>CustomColumn</b> object to apply using <b>applyCustomColumns</b> with the expression specified.
1817
+ * @param expression -
1818
+ * @return {@link dh.CustomColumn}
1819
+ */
1820
+ formatNumber(expression:string, options?:CustomColumnOptions|undefined|null):CustomColumn;
1821
+ /**
1822
+ * a <b>CustomColumn</b> object to apply using <b>applyCustomColumns</b> with the expression specified.
1823
+ * @param expression -
1824
+ * @return {@link dh.CustomColumn}
1825
+ */
1826
+ formatDate(expression:string, options?:CustomColumnOptions|undefined|null):CustomColumn;
1827
+ toString():string;
1828
+ /**
1829
+ * Label for this column.
1830
+ * @return String
1831
+ */
1832
+ get name():string;
1833
+ /**
1834
+ * True if this column is a partition column. Partition columns are used for filtering uncoalesced tables - see
1835
+ * {@link Table.uncoalesced}.
1836
+ * @return true if the column is a partition column
1837
+ */
1838
+ get isPartitionColumn():boolean;
1839
+ /**
1840
+ *
1841
+ * @deprecated do not use. Internal index of the column in the table, to be used as a key on the Row.
1842
+ * @return int
1843
+ */
1844
+ get index():number;
1845
+ get isSortable():boolean;
1846
+ /**
1847
+ * Type of the row data that can be found in this column.
1848
+ * @return String
1849
+ */
1850
+ get type():string;
1851
+ /**
1852
+ * Format entire rows colors using the expression specified. Returns a <b>CustomColumn</b> object to apply to a
1853
+ * table using <b>applyCustomColumns</b> with the parameters specified.
1854
+ * @param expression -
1855
+ * @param options -
1856
+ * @return {@link dh.CustomColumn}
1857
+ */
1858
+ static formatRowColor(expression:string, options?:CustomColumnOptions|undefined|null):CustomColumn;
1859
+ /**
1860
+ * a <b>CustomColumn</b> object to apply using <b>applyCustomColumns</b> with the expression specified.
1861
+ * @param name -
1862
+ * @param expression -
1863
+ * @param options -
1864
+ * @return {@link dh.CustomColumn}
1865
+ */
1866
+ static createCustomColumn(name:string, expression:string, options?:CustomColumnOptions|undefined|null):CustomColumn;
1867
+ }
1868
+
1869
+ /**
1870
+ * Represents a set of Tables each corresponding to some key. The keys are available locally, but a call must be made to
1871
+ * the server to get each Table. All tables will have the same structure.
1872
+ */
1873
+ export class PartitionedTable implements HasEventHandling {
1874
+ /**
1875
+ * Indicates that a new key has been added to the array of keys, which can now be fetched with getTable.
1876
+ */
1877
+ static readonly EVENT_KEYADDED:string;
1530
1878
  /**
1531
1879
  * Indicates that a new key has been added to the array of keys, which can now be fetched with getTable.
1532
1880
  */
@@ -1612,318 +1960,111 @@ export namespace dh {
1612
1960
  removeEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):boolean;
1613
1961
  }
1614
1962
 
1615
- export class DateWrapper extends LongWrapper {
1616
- protected constructor();
1617
-
1618
- static ofJsDate(date:Date):DateWrapper;
1619
- asDate():Date;
1620
- }
1621
-
1622
1963
  /**
1623
- * Configuration object for running Table.treeTable to produce a hierarchical view of a given "flat" table.
1624
- *
1625
- * Like TotalsTableConfig, `TreeTableConfig` supports an operation map indicating how to aggregate the data, as well as
1626
- * an array of column names which will be the layers in the roll-up tree, grouped at each level. An additional optional
1627
- * value can be provided describing the strategy the engine should use when grouping the rows.
1964
+ * Behaves like a {@link dh.Table} externally, but data, state, and viewports are managed by an entirely different
1965
+ * mechanism, and so reimplemented here.
1966
+ * <p>
1967
+ * Any time a change is made, we build a new request and send it to the server, and wait for the updated state.
1968
+ * <p>
1969
+ * Semantics around getting updates from the server are slightly different - we don't "unset" the viewport here after
1970
+ * operations are performed, but encourage the client code to re-set them to the desired position.
1971
+ * <p>
1972
+ * The table size will be -1 until a viewport has been fetched.
1973
+ * <p>
1974
+ * Similar to a table, a Tree Table provides access to subscribed viewport data on the current hierarchy. A different
1975
+ * Row type is used within that viewport, showing the depth of that node within the tree and indicating details about
1976
+ * whether it has children or is expanded. The Tree Table itself then provides the ability to change if a row is
1977
+ * expanded or not. Methods used to control or check if a row should be expanded or not can be invoked on a TreeRow
1978
+ * instance, or on the number of the row (thus allowing for expanding/collapsing rows which are not currently visible in
1979
+ * the viewport).
1980
+ * <p>
1981
+ * Events and viewports are somewhat different from tables, due to the expense of computing the expanded/collapsed rows
1982
+ * and count of children at each level of the hierarchy, and differences in the data that is available.
1983
+ * <p>
1984
+ * <ul>
1985
+ * <li>There is no {@link Table.totalSize | totalSize} property.</li>
1986
+ * <li>The viewport is not un-set when changes are made to filter or sort, but changes will continue to be streamed in.
1987
+ * It is suggested that the viewport be changed to the desired position (usually the first N rows) after any filter/sort
1988
+ * change is made. Likewise, {@link getViewportData} will always return the most recent data, and will not wait if a
1989
+ * new operation is pending.</li>
1990
+ * <li>Custom columns are supported on Rollup tables, but not on Tree tables. If the TreeTable was created client-side,
1991
+ * the original Table can have custom columns applied, and the TreeTable can be recreated.</li>
1992
+ * <li>Whereas Table has a {@link Table.totalsTableConfig} property, it is defined here as a method,
1993
+ * {@link getTotalsTableConfig}. This returns a promise so the config can be fetched asynchronously.</li>
1994
+ * <li>Totals Tables for trees vary in behavior between tree tables and roll-up tables. This behavior is based on the
1995
+ * original flat table used to produce the Tree Table - for a hierarchical table (i.e. Table.treeTable in the query
1996
+ * config), the totals will include non-leaf nodes (since they are themselves actual rows in the table), but in a
1997
+ * roll-up table, the totals only include leaf nodes (as non-leaf nodes are generated through grouping the contents of
1998
+ * the original table). Roll-ups also have the {@link dh.includeConstituents} property, indicating that a
1999
+ * {@link dh.Column} in the tree may have a {@link Column.constituentType} property reflecting that the type of cells
2000
+ * where {@link TreeRowImpl.hasChildren} is false will be different from usual.</li>
2001
+ * </ul>
1628
2002
  */
1629
- export class TreeTableConfig {
2003
+ export class TreeTable implements HasEventHandling {
1630
2004
  /**
1631
- * The column representing the unique ID for each item
2005
+ * event.detail is the currently visible viewport data based on the active viewport configuration.
1632
2006
  */
1633
- idColumn:string;
2007
+ static readonly EVENT_UPDATED:string;
1634
2008
  /**
1635
- * The column representing the parent ID for each item
2009
+ * event.detail is the currently visible viewport data based on the active viewport configuration.
1636
2010
  */
1637
- parentColumn:string;
2011
+ static readonly EVENT_DISCONNECT:string;
1638
2012
  /**
1639
- * Optional parameter indicating if items with an invalid parent ID should be promoted to root. Defaults to false.
2013
+ * event.detail is the currently visible viewport data based on the active viewport configuration.
2014
+ */
2015
+ static readonly EVENT_RECONNECT:string;
2016
+ /**
2017
+ * event.detail is the currently visible viewport data based on the active viewport configuration.
2018
+ */
2019
+ static readonly EVENT_RECONNECTFAILED:string;
2020
+ /**
2021
+ * event.detail is the currently visible viewport data based on the active viewport configuration.
1640
2022
  */
1641
- promoteOrphansToRoot:boolean;
1642
-
1643
- constructor();
1644
- }
1645
-
1646
- /**
1647
- * Deprecated for use in Deephaven Core.
1648
- * @deprecated
1649
- */
1650
- export class Client {
1651
2023
  static readonly EVENT_REQUEST_FAILED:string;
1652
- static readonly EVENT_REQUEST_STARTED:string;
1653
- static readonly EVENT_REQUEST_SUCCEEDED:string;
1654
-
1655
- constructor();
1656
- }
1657
-
1658
- /**
1659
- * Wrap BigDecimal values for use in JS. Provides text formatting for display and access to the underlying value.
1660
- */
1661
- export class BigDecimalWrapper {
1662
- protected constructor();
1663
-
1664
- static ofString(value:string):BigDecimalWrapper;
1665
- asNumber():number;
1666
- valueOf():string;
1667
- toString():string;
1668
- equals(o:object):boolean;
1669
- hashCode():number;
1670
- }
1671
-
1672
- /**
1673
- * Describes a Sort present on the table. No visible constructor, created through the use of Column.sort(), will be tied
1674
- * to that particular column data. Sort instances are immutable, and use a builder pattern to make modifications. All
1675
- * methods return a new Sort instance.
1676
- */
1677
- export class Sort {
1678
- static readonly ASCENDING:string;
1679
- static readonly DESCENDING:string;
1680
- static readonly REVERSE:string;
2024
+ readonly description?:string|null;
2025
+ readonly layoutHints?:null|LayoutHints;
1681
2026
 
1682
2027
  protected constructor();
1683
2028
 
1684
2029
  /**
1685
- * Builds a Sort instance to sort values in ascending order.
1686
- * @return {@link dh.Sort}
2030
+ * Expands the given node, so that its children are visible when they are in the viewport. The parameter can be the
2031
+ * row index, or the row object itself. The second parameter is a boolean value, false by default, specifying if the
2032
+ * row and all descendants should be fully expanded. Equivalent to `setExpanded(row, true)` with an optional third
2033
+ * boolean parameter.
2034
+ * @param row -
2035
+ * @param expandDescendants -
1687
2036
  */
1688
- asc():Sort;
2037
+ expand(row:TreeRow|number, expandDescendants?:boolean):void;
1689
2038
  /**
1690
- * Builds a Sort instance to sort values in descending order.
1691
- * @return {@link dh.Sort}
2039
+ * Collapses the given node, so that its children and descendants are not visible in the size or the viewport. The
2040
+ * parameter can be the row index, or the row object itself. Equivalent to <b>setExpanded(row, false, false)</b>.
2041
+ * @param row -
1692
2042
  */
1693
- desc():Sort;
2043
+ collapse(row:TreeRow|number):void;
1694
2044
  /**
1695
- * Builds a Sort instance which takes the absolute value before applying order.
1696
- * @return {@link dh.Sort}
2045
+ * Specifies if the given node should be expanded or collapsed. If this node has children, and the value is changed,
2046
+ * the size of the table will change. If node is to be expanded and the third parameter, <b>expandDescendants</b>,
2047
+ * is true, then its children will also be expanded.
2048
+ * @param row - the row to expand or collapse, either the absolute row index or the row object
2049
+ * @param isExpanded - true to expand the row, false to collapse
2050
+ * @param expandDescendants - true to expand the row and all descendants, false to expand only the row, defaults to
2051
+ * false
1697
2052
  */
1698
- abs():Sort;
1699
- toString():string;
2053
+ setExpanded(row:TreeRow|number, isExpanded:boolean, expandDescendants?:boolean):void;
2054
+ expandAll():void;
2055
+ collapseAll():void;
1700
2056
  /**
1701
- * True if the absolute value of the column should be used when sorting; defaults to false.
1702
- * @return boolean
2057
+ * Tests if the specified row is expanded.
2058
+ * @param row - the row to test, either the absolute row index or the row object
2059
+ * @return boolean true if the row is expanded, false otherwise
1703
2060
  */
1704
- get isAbs():boolean;
2061
+ isExpanded(row:TreeRow|number):boolean;
2062
+ setViewport(firstRow:number, lastRow:number, columns?:Array<Column>|undefined|null, updateInterval?:number|undefined|null):void;
2063
+ getViewportData():Promise<TreeViewportData>;
1705
2064
  /**
1706
- * The column which is sorted.
1707
- * @return {@link dh.Column}
2065
+ * Indicates that the table will no longer be used, and server resources can be freed.
1708
2066
  */
1709
- get column():Column;
1710
- /**
1711
- * The direction of this sort, either <b>ASC</b>, <b>DESC</b>, or <b>REVERSE</b>.
1712
- * @return String
1713
- */
1714
- get direction():string;
1715
- }
1716
-
1717
- export class LoginCredentials {
1718
- type?:string|null;
1719
- username?:string|null;
1720
- token?:string|null;
1721
-
1722
- constructor();
1723
- }
1724
-
1725
- /**
1726
- * A js type for operating on input tables.
1727
- *
1728
- * Represents a User Input Table, which can have data added to it from other sources.
1729
- *
1730
- * You may add rows using dictionaries of key-value tuples (representing columns by name), add tables containing all the
1731
- * key/value columns to add, or delete tables containing the keys to delete. Each operation is atomic, and will either
1732
- * succeed completely or fail completely. To guarantee order of operations, apply an operation and wait for the response
1733
- * before sending the next operation.
1734
- *
1735
- * Each table has one or more key columns, where each unique combination of keys will appear at most once in the table.
1736
- *
1737
- * To view the results of the Input Table, you should use standard table operations on the InputTable's source Table
1738
- * object.
1739
- */
1740
- export class InputTable {
1741
- protected constructor();
1742
-
1743
- /**
1744
- * Adds a single row to the table. For each key or value column name in the Input Table, we retrieve that javascript
1745
- * property at that name and validate it can be put into the given column type.
1746
- * @param row -
1747
- * @param userTimeZone -
1748
- * @return Promise of dh.InputTable
1749
- */
1750
- addRow(row:{ [key: string]: any; }, userTimeZone?:string):Promise<InputTable>;
1751
- /**
1752
- * Add multiple rows to a table.
1753
- * @param rows -
1754
- * @param userTimeZone -
1755
- * @return Promise of dh.InputTable
1756
- */
1757
- addRows(rows:{ [key: string]: any; }[], userTimeZone?:string):Promise<InputTable>;
1758
- /**
1759
- * Add an entire table to this Input Table. Only column names that match the definition of the input table will be
1760
- * copied, and all key columns must have values filled in. This only copies the current state of the source table;
1761
- * future updates to the source table will not be reflected in the Input Table. The returned promise will be
1762
- * resolved to the same InputTable instance this method was called upon once the server returns.
1763
- * @param tableToAdd -
1764
- * @return Promise of dh.InputTable
1765
- */
1766
- addTable(tableToAdd:Table):Promise<InputTable>;
1767
- /**
1768
- * Add multiple tables to this Input Table.
1769
- * @param tablesToAdd -
1770
- * @return Promise of dh.InputTable
1771
- */
1772
- addTables(tablesToAdd:Table[]):Promise<InputTable>;
1773
- /**
1774
- * Deletes an entire table from this Input Table. Key columns must match the Input Table.
1775
- * @param tableToDelete -
1776
- * @return Promise of dh.InputTable
1777
- */
1778
- deleteTable(tableToDelete:Table):Promise<InputTable>;
1779
- /**
1780
- * Delete multiple tables from this Input Table.
1781
- * @param tablesToDelete -
1782
- * @return
1783
- */
1784
- deleteTables(tablesToDelete:Table[]):Promise<InputTable>;
1785
- /**
1786
- * A list of the key columns, by name
1787
- * @return String array.
1788
- */
1789
- get keys():string[];
1790
- /**
1791
- * A list of the value columns, by name
1792
- * @return String array.
1793
- */
1794
- get values():string[];
1795
- /**
1796
- * A list of the key columns.
1797
- * @return Column array.
1798
- */
1799
- get keyColumns():Column[];
1800
- /**
1801
- * A list of the value Column objects
1802
- * @return {@link dh.Column} array.
1803
- */
1804
- get valueColumns():Column[];
1805
- /**
1806
- * The source table for this Input Table
1807
- * @return dh.table
1808
- */
1809
- get table():Table;
1810
- }
1811
-
1812
- /**
1813
- * Event fired when a command is issued from the client.
1814
- */
1815
- export class CommandInfo {
1816
- constructor(code:string, result:Promise<dh.ide.CommandResult>);
1817
-
1818
- get result():Promise<dh.ide.CommandResult>;
1819
- get code():string;
1820
- }
1821
-
1822
- /**
1823
- * Behaves like a {@link dh.Table} externally, but data, state, and viewports are managed by an entirely different
1824
- * mechanism, and so reimplemented here.
1825
- * <p>
1826
- * Any time a change is made, we build a new request and send it to the server, and wait for the updated state.
1827
- * <p>
1828
- * Semantics around getting updates from the server are slightly different - we don't "unset" the viewport here after
1829
- * operations are performed, but encourage the client code to re-set them to the desired position.
1830
- * <p>
1831
- * The table size will be -1 until a viewport has been fetched.
1832
- * <p>
1833
- * Similar to a table, a Tree Table provides access to subscribed viewport data on the current hierarchy. A different
1834
- * Row type is used within that viewport, showing the depth of that node within the tree and indicating details about
1835
- * whether it has children or is expanded. The Tree Table itself then provides the ability to change if a row is
1836
- * expanded or not. Methods used to control or check if a row should be expanded or not can be invoked on a TreeRow
1837
- * instance, or on the number of the row (thus allowing for expanding/collapsing rows which are not currently visible in
1838
- * the viewport).
1839
- * <p>
1840
- * Events and viewports are somewhat different from tables, due to the expense of computing the expanded/collapsed rows
1841
- * and count of children at each level of the hierarchy, and differences in the data that is available.
1842
- * <p>
1843
- * <ul>
1844
- * <li>There is no {@link Table.totalSize | totalSize} property.</li>
1845
- * <li>The viewport is not un-set when changes are made to filter or sort, but changes will continue to be streamed in.
1846
- * It is suggested that the viewport be changed to the desired position (usually the first N rows) after any filter/sort
1847
- * change is made. Likewise, {@link getViewportData} will always return the most recent data, and will not wait if a
1848
- * new operation is pending.</li>
1849
- * <li>Custom columns are supported on Rollup tables, but not on Tree tables. If the TreeTable was created client-side,
1850
- * the original Table can have custom columns applied, and the TreeTable can be recreated.</li>
1851
- * <li>Whereas Table has a {@link Table.totalsTableConfig} property, it is defined here as a method,
1852
- * {@link getTotalsTableConfig}. This returns a promise so the config can be fetched asynchronously.</li>
1853
- * <li>Totals Tables for trees vary in behavior between tree tables and roll-up tables. This behavior is based on the
1854
- * original flat table used to produce the Tree Table - for a hierarchical table (i.e. Table.treeTable in the query
1855
- * config), the totals will include non-leaf nodes (since they are themselves actual rows in the table), but in a
1856
- * roll-up table, the totals only include leaf nodes (as non-leaf nodes are generated through grouping the contents of
1857
- * the original table). Roll-ups also have the {@link dh.includeConstituents} property, indicating that a
1858
- * {@link dh.Column} in the tree may have a {@link Column.constituentType} property reflecting that the type of cells
1859
- * where {@link TreeRowImpl.hasChildren} is false will be different from usual.</li>
1860
- * </ul>
1861
- */
1862
- export class TreeTable implements HasEventHandling {
1863
- /**
1864
- * event.detail is the currently visible viewport data based on the active viewport configuration.
1865
- */
1866
- static readonly EVENT_UPDATED:string;
1867
- /**
1868
- * event.detail is the currently visible viewport data based on the active viewport configuration.
1869
- */
1870
- static readonly EVENT_DISCONNECT:string;
1871
- /**
1872
- * event.detail is the currently visible viewport data based on the active viewport configuration.
1873
- */
1874
- static readonly EVENT_RECONNECT:string;
1875
- /**
1876
- * event.detail is the currently visible viewport data based on the active viewport configuration.
1877
- */
1878
- static readonly EVENT_RECONNECTFAILED:string;
1879
- /**
1880
- * event.detail is the currently visible viewport data based on the active viewport configuration.
1881
- */
1882
- static readonly EVENT_REQUEST_FAILED:string;
1883
- readonly description?:string|null;
1884
- readonly layoutHints?:null|LayoutHints;
1885
-
1886
- protected constructor();
1887
-
1888
- /**
1889
- * Expands the given node, so that its children are visible when they are in the viewport. The parameter can be the
1890
- * row index, or the row object itself. The second parameter is a boolean value, false by default, specifying if the
1891
- * row and all descendants should be fully expanded. Equivalent to `setExpanded(row, true)` with an optional third
1892
- * boolean parameter.
1893
- * @param row -
1894
- * @param expandDescendants -
1895
- */
1896
- expand(row:TreeRow|number, expandDescendants?:boolean):void;
1897
- /**
1898
- * Collapses the given node, so that its children and descendants are not visible in the size or the viewport. The
1899
- * parameter can be the row index, or the row object itself. Equivalent to <b>setExpanded(row, false, false)</b>.
1900
- * @param row -
1901
- */
1902
- collapse(row:TreeRow|number):void;
1903
- /**
1904
- * Specifies if the given node should be expanded or collapsed. If this node has children, and the value is changed,
1905
- * the size of the table will change. If node is to be expanded and the third parameter, <b>expandDescendants</b>,
1906
- * is true, then its children will also be expanded.
1907
- * @param row - the row to expand or collapse, either the absolute row index or the row object
1908
- * @param isExpanded - true to expand the row, false to collapse
1909
- * @param expandDescendants - true to expand the row and all descendants, false to expand only the row, defaults to
1910
- * false
1911
- */
1912
- setExpanded(row:TreeRow|number, isExpanded:boolean, expandDescendants?:boolean):void;
1913
- expandAll():void;
1914
- collapseAll():void;
1915
- /**
1916
- * Tests if the specified row is expanded.
1917
- * @param row - the row to test, either the absolute row index or the row object
1918
- * @return boolean true if the row is expanded, false otherwise
1919
- */
1920
- isExpanded(row:TreeRow|number):boolean;
1921
- setViewport(firstRow:number, lastRow:number, columns?:Array<Column>|undefined|null, updateInterval?:number|undefined|null):void;
1922
- getViewportData():Promise<TreeViewportData>;
1923
- /**
1924
- * Indicates that the table will no longer be used, and server resources can be freed.
1925
- */
1926
- close():void;
2067
+ close():void;
1927
2068
  /**
1928
2069
  * Applies the given sort to all levels of the tree. Returns the previous sort in use.
1929
2070
  * @param sort -
@@ -1968,513 +2109,125 @@ export namespace dh {
1968
2109
  * in the resulting table.</li>
1969
2110
  * </ul>
1970
2111
  */
1971
- selectDistinct(columns:Column[]):Promise<Table>;
1972
- getTotalsTableConfig():Promise<TotalsTableConfig>;
1973
- getTotalsTable(config?:object):Promise<TotalsTable>;
1974
- getGrandTotalsTable(config?:object):Promise<TotalsTable>;
1975
- /**
1976
- * a new copy of this treetable, so it can be sorted and filtered separately, and maintain a different viewport.
1977
- * Unlike Table, this will _not_ copy the filter or sort, since tree table viewport semantics differ, and without a
1978
- * viewport set, the treetable doesn't evaluate these settings, and they aren't readable on the properties. Expanded
1979
- * state is also not copied.
1980
- * @return Promise of dh.TreeTable
1981
- */
1982
- copy():Promise<TreeTable>;
1983
- /**
1984
- * Returns the columns that are aggregated.
1985
- * @return array of aggregated columns
1986
- */
1987
- get aggregatedColumns():Array<Column>;
1988
- /**
1989
- * The columns that can be shown in this Tree Table.
1990
- * @return {@link dh.Column} array
1991
- */
1992
- get columns():Array<Column>;
1993
- /**
1994
- * The current sort configuration of this Tree Table
1995
- * @return {@link dh.Sort} array.
1996
- */
1997
- get sort():Array<Sort>;
1998
- /**
1999
- * The current list of custom columns added to this Tree Table.
2000
- * @return {@link dh.CustomColumn} array
2001
- */
2002
- get customColumns():Array<CustomColumn>;
2003
- /**
2004
- * True if this table may receive updates from the server, including size changed events, updated events after
2005
- * initial snapshot.
2006
- * @return boolean
2007
- */
2008
- get isRefreshing():boolean;
2009
- /**
2010
- * The current filter configuration of this Tree Table.
2011
- * @return {@link dh.FilterCondition} array
2012
- */
2013
- get filter():Array<FilterCondition>;
2014
- /**
2015
- * True if this is a roll-up and will provide the original rows that make up each grouping.
2016
- * @return boolean
2017
- */
2018
- get includeConstituents():boolean;
2019
- get groupedColumns():Array<Column>;
2020
- /**
2021
- * True if this table has been closed.
2022
- * @return boolean
2023
- */
2024
- get isClosed():boolean;
2025
- /**
2026
- * The current number of rows given the table's contents and the various expand/collapse states of each node. (No
2027
- * totalSize is provided at this time; its definition becomes unclear between roll-up and tree tables, especially
2028
- * when considering collapse/expand states).
2029
- * @return double
2030
- */
2031
- get size():number;
2032
- /**
2033
- * Listen for events on this object.
2034
- * @param name - the name of the event to listen for
2035
- * @param callback - a function to call when the event occurs
2036
- * @return Returns a cleanup function.
2037
- * @typeParam T - the type of the data that the event will provide
2038
- */
2039
- addEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):()=>void;
2040
- nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<Event<T>>;
2041
- hasListeners(name:string):boolean;
2042
- /**
2043
- * Removes an event listener added to this table.
2044
- * @param name -
2045
- * @param callback -
2046
- * @return
2047
- * @typeParam T -
2048
- */
2049
- removeEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):boolean;
2050
- }
2051
-
2052
- /**
2053
- * Exists to keep the dh.TableMap namespace so that the web UI can remain compatible with the DHE API, which still calls
2054
- * this type TableMap.
2055
- * @deprecated
2056
- */
2057
- export class TableMap {
2058
- static readonly EVENT_KEYADDED:string;
2059
- static readonly EVENT_DISCONNECT:string;
2060
- static readonly EVENT_RECONNECT:string;
2061
- static readonly EVENT_RECONNECTFAILED:string;
2062
-
2063
- protected constructor();
2064
- }
2065
-
2066
- /**
2067
- * A Widget represents a server side object that sends one or more responses to the client. The client can then
2068
- * interpret these responses to see what to render, or how to respond.
2069
- * <p>
2070
- * Most custom object types result in a single response being sent to the client, often with other exported objects, but
2071
- * some will have streamed responses, and allow the client to send follow-up requests of its own. This class's API is
2072
- * backwards compatible, but as such does not offer a way to tell the difference between a streaming or non-streaming
2073
- * object type, the client code that handles the payloads is expected to know what to expect. See
2074
- * {@link dh.WidgetMessageDetails} for more information.
2075
- * <p>
2076
- * When the promise that returns this object resolves, it will have the first response assigned to its fields. Later
2077
- * responses from the server will be emitted as "message" events. When the connection with the server ends, the "close"
2078
- * event will be emitted. In this way, the connection will behave roughly in the same way as a WebSocket - either side
2079
- * can close, and after close no more messages will be processed. There can be some latency in closing locally while
2080
- * remote messages are still pending - it is up to implementations of plugins to handle this case.
2081
- * <p>
2082
- * Also like WebSockets, the plugin API doesn't define how to serialize messages, and just handles any binary payloads.
2083
- * What it does handle however, is allowing those messages to include references to server-side objects with those
2084
- * payloads. Those server side objects might be tables or other built-in types in the Deephaven JS API, or could be
2085
- * objects usable through their own plugins. They also might have no plugin at all, allowing the client to hold a
2086
- * reference to them and pass them back to the server, either to the current plugin instance, or through another API.
2087
- * The `Widget` type does not specify how those objects should be used or their lifecycle, but leaves that
2088
- * entirely to the plugin. Messages will arrive in the order they were sent.
2089
- * <p>
2090
- * This can suggest several patterns for how plugins operate:
2091
- * <ul>
2092
- * <li>The plugin merely exists to transport some other object to the client. This can be useful for objects which can
2093
- * easily be translated to some other type (like a Table) when the user clicks on it. An example of this is
2094
- * `pandas.DataFrame` will result in a widget that only contains a static
2095
- * {@link dh.Table}. Presently, the widget is immediately closed, and only the Table is
2096
- * provided to the JS API consumer.</li>
2097
- * <li>The plugin provides references to Tables and other objects, and those objects can live longer than the object
2098
- * which provided them. One concrete example of this could have been
2099
- * {@link dh.PartitionedTable} when fetching constituent tables, but it was implemented
2100
- * before bidirectional plugins were implemented. Another example of this is plugins that serve as a "factory", giving
2101
- * the user access to table manipulation/creation methods not supported by gRPC or the JS API.</li>
2102
- * <li>The plugin provides reference to Tables and other objects that only make sense within the context of the widget
2103
- * instance, so when the widget goes away, those objects should be released as well. This is also an example of
2104
- * {@link dh.PartitionedTable}, as the partitioned table tracks creation of new keys through
2105
- * an internal table instance.</li>
2106
- * </ul>
2107
- *
2108
- * Handling server objects in messages also has more than one potential pattern that can be used:
2109
- * <ul>
2110
- * <li>One object per message - the message clearly is about that object, no other details required.</li>
2111
- * <li>Objects indexed within their message - as each message comes with a list of objects, those objects can be
2112
- * referenced within the payload by index. This is roughly how {@link dh.plot.Figure}
2113
- * behaves, where the figure descriptor schema includes an index for each created series, describing which table should
2114
- * be used, which columns should be mapped to each axis.</li>
2115
- * <li>Objects indexed since widget creation - each message would append its objects to a list created when the widget
2116
- * was first made, and any new exports that arrive in a new message would be appended to that list. Then, subsequent
2117
- * messages can reference objects already sent. This imposes a limitation where the client cannot release any exports
2118
- * without the server somehow signaling that it will never reference that export again.</li>
2119
- * </ul>
2120
- */
2121
- export class Widget implements WidgetMessageDetails, HasEventHandling {
2122
- static readonly EVENT_MESSAGE:string;
2123
- static readonly EVENT_CLOSE:string;
2124
-
2125
- protected constructor();
2126
-
2127
- /**
2128
- * Ends the client connection to the server.
2129
- */
2130
- close():void;
2131
- getDataAsBase64():string;
2132
- getDataAsU8():Uint8Array;
2133
- getDataAsString():string;
2134
- /**
2135
- * Sends a string/bytes payload to the server, along with references to objects that exist on the server.
2136
- * @param msg - string/buffer/view instance that represents data to send
2137
- * @param references - an array of objects that can be safely sent to the server
2138
- */
2139
- sendMessage(msg:string|ArrayBuffer|ArrayBufferView, references?:Array<Table|Widget|WidgetExportedObject|PartitionedTable|TotalsTable|TreeTable>):void;
2140
- addEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):()=>void;
2141
- nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<Event<T>>;
2142
- hasListeners(name:string):boolean;
2143
- removeEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):boolean;
2144
- /**
2145
- *
2146
- * @return the exported objects sent in the initial message from the server. The client is responsible for closing
2147
- * them when finished using them.
2148
- */
2149
- get exportedObjects():WidgetExportedObject[];
2150
- /**
2151
- *
2152
- * @return the type of this widget
2153
- */
2154
- get type():string;
2155
- }
2156
-
2157
- export class IdeSession implements HasEventHandling {
2158
- static readonly EVENT_COMMANDSTARTED:string;
2159
- static readonly EVENT_REQUEST_FAILED:string;
2160
-
2161
- protected constructor();
2162
-
2163
- /**
2164
- * Load the named table, with columns and size information already fully populated.
2165
- * @param name - the name of the table to fetch
2166
- * @param applyPreviewColumns - false to disable previews, defaults to true
2167
- * @return a {@link Promise} that will resolve to the table, or reject with an error if it cannot be loaded.
2168
- * @deprecated Added to resolve a specific issue, in the future preview will be applied as part of the subscription.
2169
- */
2170
- getTable(name:string, applyPreviewColumns?:boolean):Promise<Table>;
2171
- /**
2172
- * Load the named Figure, including its tables and tablemaps as needed.
2173
- * @param name -
2174
- * @return promise of dh.plot.Figure
2175
- */
2176
- getFigure(name:string):Promise<dh.plot.Figure>;
2177
- /**
2178
- * Loads the named tree table or roll-up table, with column data populated. All nodes are collapsed by default, and
2179
- * size is presently not available until the viewport is first set.
2180
- * @param name -
2181
- * @return {@link Promise} of {@link dh.TreeTable}
2182
- */
2183
- getTreeTable(name:string):Promise<TreeTable>;
2184
- getHierarchicalTable(name:string):Promise<TreeTable>;
2185
- getPartitionedTable(name:string):Promise<PartitionedTable>;
2186
- getObject(definitionObject:dh.ide.VariableDescriptor):Promise<any>;
2187
- newTable(columnNames:string[], types:string[], data:string[][], userTimeZone:string):Promise<Table>;
2188
- /**
2189
- * Merges the given tables into a single table. Assumes all tables have the same structure.
2190
- * @param tables -
2191
- * @return {@link Promise} of {@link dh.Table}
2192
- */
2193
- mergeTables(tables:Table[]):Promise<Table>;
2194
- bindTableToVariable(table:Table, name:string):Promise<void>;
2195
- /**
2196
- * Makes the `object` available to another user or another client on this same server which knows the value of
2197
- * the `sharedTicketBytes`. Use that sharedTicketBytes value like a one-time use password - any other client
2198
- * which knows this value can read the same object.
2199
- * <p>
2200
- * Shared objects will remain available using the sharedTicketBytes until the client that first shared them
2201
- * releases/closes their copy of the object. Whatever side-channel is used to share the bytes, be sure to wait until
2202
- * the remote end has signaled that it has successfully fetched the object before releasing it from this client.
2203
- * <p>
2204
- * Be sure to use an unpredictable value for the shared ticket bytes, like a UUID or other large, random value to
2205
- * prevent access by unauthorized clients.
2206
- * @param object - the object to share with another client/user
2207
- * @param sharedTicketBytes - the value which another client/user must know to obtain the object. It may be a unicode
2208
- * string (will be encoded as utf8 bytes), or a {@link Uint8Array} value.
2209
- * @return A promise that will resolve to the value passed as sharedTicketBytes when the object is ready to be read
2210
- * by another client, or will reject if an error occurs.
2211
- */
2212
- shareObject(object:Table|Widget|WidgetExportedObject|PartitionedTable|TotalsTable|TreeTable, sharedTicketBytes:string|Uint8Array):Promise<string|Uint8Array>;
2213
- /**
2214
- * Reads an object shared by another client to this server with the `sharedTicketBytes`. Until the other
2215
- * client releases this object (or their session ends), the object will be available on the server.
2216
- * <p>
2217
- * The type of the object must be passed so that the object can be read from the server correct - the other client
2218
- * should provide this information.
2219
- * @param sharedTicketBytes - the value provided by another client/user to obtain the object. It may be a unicode
2220
- * string (will be encoded as utf8 bytes), or a {@link Uint8Array} value.
2221
- * @param type - The type of the object, so it can be correctly read from the server
2222
- * @return A promise that will resolve to the shared object, or will reject with an error if it cannot be read.
2223
- */
2224
- getSharedObject(sharedTicketBytes:string|Uint8Array, type:string):Promise<any>;
2225
- subscribeToFieldUpdates(callback:(arg0:dh.ide.VariableChanges)=>void):()=>void;
2226
- close():void;
2227
- runCode(code:string):Promise<dh.ide.CommandResult>;
2228
- onLogMessage(callback:(arg0:dh.ide.LogItem)=>void):()=>void;
2229
- openDocument(params:object):void;
2230
- changeDocument(params:object):void;
2231
- getCompletionItems(params:object):Promise<Array<dh.lsp.CompletionItem>>;
2232
- getSignatureHelp(params:object):Promise<Array<dh.lsp.SignatureInformation>>;
2233
- getHover(params:object):Promise<dh.lsp.Hover>;
2234
- closeDocument(params:object):void;
2235
- /**
2236
- * Creates an empty table with the specified number of rows. Optionally columns and types may be specified, but all
2237
- * values will be null.
2238
- * @param size -
2239
- * @return {@link Promise} of {@link dh.Table}
2240
- */
2241
- emptyTable(size:number):Promise<Table>;
2242
- /**
2243
- * Creates a new table that ticks automatically every "periodNanos" nanoseconds. A start time may be provided; if so
2244
- * the table will be populated with the interval from the specified date until now.
2245
- * @param periodNanos -
2246
- * @param startTime -
2247
- * @return {@link Promise} of {@link dh.Table}
2248
- */
2249
- timeTable(periodNanos:number, startTime?:DateWrapper):Promise<Table>;
2250
- addEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):()=>void;
2251
- nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<Event<T>>;
2252
- hasListeners(name:string):boolean;
2253
- removeEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):boolean;
2254
- }
2255
-
2256
- export class CustomColumn {
2257
- static readonly TYPE_FORMAT_COLOR:string;
2258
- static readonly TYPE_FORMAT_NUMBER:string;
2259
- static readonly TYPE_FORMAT_DATE:string;
2260
- static readonly TYPE_NEW:string;
2261
-
2262
- protected constructor();
2263
-
2264
- valueOf():string;
2265
- toString():string;
2266
- static from(columnInfo:string):CustomColumn;
2267
- /**
2268
- * The expression to evaluate this custom column.
2269
- * @return String
2270
- */
2271
- get expression():string;
2272
- /**
2273
- * The name of the column to use.
2274
- * @return String
2275
- */
2276
- get name():string;
2277
- /**
2278
- * The options for this custom column.
2279
- * @return CustomColumOptions
2280
- */
2281
- get options():CustomColumnOptions;
2282
- /**
2283
- * Type of custom column. One of
2284
- *
2285
- * <ul>
2286
- * <li>FORMAT_COLOR</li>
2287
- * <li>FORMAT_NUMBER</li>
2288
- * <li>FORMAT_DATE</li>
2289
- * <li>NEW</li>
2290
- * </ul>
2291
- * @return String
2292
- */
2293
- get type():string;
2294
- }
2295
-
2296
- /**
2297
- * Describes a filter which can be applied to a table. Replacing these instances may be more expensive than reusing
2298
- * them. These instances are immutable - all operations that compose them to build bigger expressions return a new
2299
- * instance.
2300
- */
2301
- export class FilterCondition {
2302
- protected constructor();
2303
-
2304
- /**
2305
- * the opposite of this condition
2306
- * @return FilterCondition
2307
- */
2308
- not():FilterCondition;
2112
+ selectDistinct(columns:Column[]):Promise<Table>;
2113
+ getTotalsTableConfig():Promise<TotalsTableConfig>;
2114
+ getTotalsTable(config?:object):Promise<TotalsTable>;
2115
+ getGrandTotalsTable(config?:object):Promise<TotalsTable>;
2309
2116
  /**
2310
- * a condition representing the current condition logically ANDed with the other parameters
2311
- * @param filters -
2312
- * @return FilterCondition
2117
+ * a new copy of this treetable, so it can be sorted and filtered separately, and maintain a different viewport.
2118
+ * Unlike Table, this will _not_ copy the filter or sort, since tree table viewport semantics differ, and without a
2119
+ * viewport set, the treetable doesn't evaluate these settings, and they aren't readable on the properties. Expanded
2120
+ * state is also not copied.
2121
+ * @return Promise of dh.TreeTable
2313
2122
  */
2314
- and(...filters:FilterCondition[]):FilterCondition;
2123
+ copy():Promise<TreeTable>;
2315
2124
  /**
2316
- * a condition representing the current condition logically ORed with the other parameters
2317
- * @param filters -
2318
- * @return FilterCondition.
2125
+ * Returns the columns that are aggregated.
2126
+ * @return array of aggregated columns
2319
2127
  */
2320
- or(...filters:FilterCondition[]):FilterCondition;
2128
+ get aggregatedColumns():Array<Column>;
2321
2129
  /**
2322
- * a string suitable for debugging showing the details of this condition.
2323
- * @return String.
2130
+ * The columns that can be shown in this Tree Table.
2131
+ * @return {@link dh.Column} array
2324
2132
  */
2325
- toString():string;
2326
2133
  get columns():Array<Column>;
2327
2134
  /**
2328
- * a filter condition invoking a static function with the given parameters. Currently supported Deephaven static
2329
- * functions:
2330
- * <ul>
2331
- * <li><b>inRange</b>: Given three comparable values, returns true if the first is less than the second but greater
2332
- * than the third</li>
2333
- * <li><b>isInf</b>:Returns true if the given number is <i>infinity</i></li>
2334
- * <li><b>isNaN</b>:Returns true if the given number is <i>not a number</i></li>
2335
- * <li><b>isNormal</b>:Returns true if the given number <i>is not null</i>, <i>is not infinity</i>, and <i>is not
2336
- * "not a number"</i></li>
2337
- * <li><b>startsWith</b>:Returns true if the first string starts with the second string</li>
2338
- * <li><b>endsWith</b>Returns true if the first string ends with the second string</li>
2339
- * <li><b>matches</b>:Returns true if the first string argument matches the second string used as a Java regular
2340
- * expression</li>
2341
- * <li><b>contains</b>:Returns true if the first string argument contains the second string as a substring</li>
2342
- * <li><b>in</b>:Returns true if the first string argument can be found in the second array argument.
2343
- * <p>
2344
- * Note that the array can only be specified as a column reference at this time - typically the `FilterValue.in`
2345
- * method should be used in other cases
2346
- * </p>
2347
- * </li>
2348
- * </ul>
2349
- * @param function -
2350
- * @param args -
2351
- * @return dh.FilterCondition
2135
+ * The current sort configuration of this Tree Table
2136
+ * @return {@link dh.Sort} array.
2352
2137
  */
2353
- static invoke(func:string, ...args:FilterValue[]):FilterCondition;
2138
+ get sort():Array<Sort>;
2354
2139
  /**
2355
- * a filter condition which will check if the given value can be found in any supported column on whatever table
2356
- * this FilterCondition is passed to. This FilterCondition is somewhat unique in that it need not be given a column
2357
- * instance, but will adapt to any table. On numeric columns, with a value passed in which can be parsed as a
2358
- * number, the column will be filtered to numbers which equal, or can be "rounded" effectively to this number. On
2359
- * String columns, the given value will match any column which contains this string in a case-insensitive search. An
2360
- * optional second argument can be passed, an array of `FilterValue` from the columns to limit this search to (see
2361
- * {@link dh.Column.filter}).
2362
- * @param value -
2363
- * @param columns -
2364
- * @return dh.FilterCondition
2140
+ * The current list of custom columns added to this Tree Table.
2141
+ * @return {@link dh.CustomColumn} array
2365
2142
  */
2366
- static search(value:FilterValue, columns?:FilterValue[]):FilterCondition;
2367
- }
2368
-
2369
- export class CoreClient implements HasEventHandling {
2370
- static readonly EVENT_CONNECT:string;
2371
- static readonly EVENT_DISCONNECT:string;
2372
- static readonly EVENT_RECONNECT:string;
2373
- static readonly EVENT_RECONNECT_AUTH_FAILED:string;
2374
- static readonly EVENT_REQUEST_FAILED:string;
2375
- static readonly EVENT_REQUEST_STARTED:string;
2376
- static readonly EVENT_REQUEST_SUCCEEDED:string;
2143
+ get customColumns():Array<CustomColumn>;
2377
2144
  /**
2378
- * @deprecated
2145
+ * True if this table may receive updates from the server, including size changed events, updated events after
2146
+ * initial snapshot.
2147
+ * @return boolean
2379
2148
  */
2380
- static readonly EVENT_REFRESH_TOKEN_UPDATED:string;
2381
- static readonly LOGIN_TYPE_PASSWORD:string;
2382
- static readonly LOGIN_TYPE_ANONYMOUS:string;
2383
-
2384
- constructor(serverUrl:string, connectOptions?:ConnectOptions);
2385
-
2386
- running():Promise<CoreClient>;
2387
- getServerUrl():string;
2388
- getAuthConfigValues():Promise<string[][]>;
2389
- login(credentials:LoginCredentials):Promise<void>;
2390
- relogin(token:RefreshToken):Promise<void>;
2391
- onConnected(timeoutInMillis?:number):Promise<void>;
2392
- getServerConfigValues():Promise<string[][]>;
2393
- getStorageService():dh.storage.StorageService;
2394
- getAsIdeConnection():Promise<IdeConnection>;
2395
- disconnect():void;
2396
- addEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):()=>void;
2397
- nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<Event<T>>;
2398
- hasListeners(name:string):boolean;
2399
- removeEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):boolean;
2400
- }
2401
-
2402
- /**
2403
- * Describes a grouping and aggregations for a roll-up table. Pass to the <b>Table.rollup</b> function to create a
2404
- * roll-up table.
2405
- */
2406
- export class RollupConfig {
2149
+ get isRefreshing():boolean;
2407
2150
  /**
2408
- * Ordered list of columns to group by to form the hierarchy of the resulting roll-up table.
2151
+ * The current filter configuration of this Tree Table.
2152
+ * @return {@link dh.FilterCondition} array
2409
2153
  */
2410
- groupingColumns:Array<String>;
2154
+ get filter():Array<FilterCondition>;
2411
2155
  /**
2412
- * Mapping from each aggregation name to the ordered list of columns it should be applied to in the resulting
2413
- * roll-up table.
2156
+ * True if this is a roll-up and will provide the original rows that make up each grouping.
2157
+ * @return boolean
2414
2158
  */
2415
- aggregations:{ [key: string]: Array<string>; };
2159
+ get includeConstituents():boolean;
2160
+ get groupedColumns():Array<Column>;
2416
2161
  /**
2417
- * Optional parameter indicating if an extra leaf node should be added at the bottom of the hierarchy, showing the
2418
- * rows in the underlying table which make up that grouping. Since these values might be a different type from the
2419
- * rest of the column, any client code must check if TreeRow.hasChildren = false, and if so, interpret those values
2420
- * as if they were Column.constituentType instead of Column.type. Defaults to false.
2162
+ * True if this table has been closed.
2163
+ * @return boolean
2421
2164
  */
2422
- includeConstituents:boolean;
2423
- includeOriginalColumns?:boolean|null;
2165
+ get isClosed():boolean;
2424
2166
  /**
2425
- * Optional parameter indicating if original column descriptions should be included. Defaults to true.
2167
+ * The current number of rows given the table's contents and the various expand/collapse states of each node. (No
2168
+ * totalSize is provided at this time; its definition becomes unclear between roll-up and tree tables, especially
2169
+ * when considering collapse/expand states).
2170
+ * @return double
2426
2171
  */
2427
- includeDescriptions:boolean;
2428
-
2429
- constructor();
2430
- }
2431
-
2432
- /**
2433
- * Options for custom columns.
2434
- */
2435
- export class CustomColumnOptions {
2172
+ get size():number;
2436
2173
  /**
2437
- * When specified for custom columns on a rollup table, specifies if the formula apply to rollup or constituent
2438
- * nodes.
2174
+ * Listen for events on this object.
2175
+ * @param name - the name of the event to listen for
2176
+ * @param callback - a function to call when the event occurs
2177
+ * @return Returns a cleanup function.
2178
+ * @typeParam T - the type of the data that the event will provide
2439
2179
  */
2440
- rollupNodeType?:RollupNodeTypeType|null;
2441
-
2442
- constructor();
2180
+ addEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):()=>void;
2181
+ nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<Event<T>>;
2182
+ hasListeners(name:string):boolean;
2183
+ /**
2184
+ * Removes an event listener added to this table.
2185
+ * @param name -
2186
+ * @param callback -
2187
+ * @return
2188
+ * @typeParam T -
2189
+ */
2190
+ removeEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):boolean;
2443
2191
  }
2444
2192
 
2445
2193
  /**
2446
- * Represents a non-viewport subscription to a table, and all data currently known to be present in the subscribed
2447
- * columns. This class handles incoming snapshots and deltas, and fires events to consumers to notify of data changes.
2448
- * <p>
2449
- * Unlike {@link dh.TableViewportSubscription}, the "original" table does not have a reference to this instance, only the
2450
- * "private" table instance does, since the original cannot modify the subscription, and the private instance must
2451
- * forward data to it.
2452
- * <p>
2453
- * Represents a subscription to the table on the server. Changes made to the table will not be reflected here - the
2454
- * subscription must be closed and a new one optioned to see those changes. The event model is slightly different from
2455
- * viewports to make it less expensive to compute for large tables.
2194
+ * This object serves as a "handle" to a subscription, allowing it to be acted on directly or canceled outright. If you
2195
+ * retain an instance of this, you have two choices - either only use it to call `close()` on it to stop the table's
2196
+ * viewport without creating a new one, or listen directly to this object instead of the table for data events, and
2197
+ * always call `close()` when finished. Calling any method on this object other than close() will result in it
2198
+ * continuing to live on after `setViewport` is called on the original table, or after the table is modified.
2456
2199
  */
2457
- export class TableSubscription implements HasEventHandling {
2200
+ export class TableViewportSubscription implements HasEventHandling {
2458
2201
  protected constructor();
2459
2202
 
2460
- static createTableSubscription(options:SubscriptionOptions, existingTable:Table):TableSubscription;
2461
2203
  /**
2462
- * Updates the subscription to use the given columns and update interval.
2463
- * @param columns - the new columns to subscribe to
2464
- * @param updateIntervalMs - the new update interval, or null/omit to use the default of one second
2204
+ * Changes the rows and columns set on this viewport. This cannot be used to change the update interval.
2205
+ * @param firstRow -
2206
+ * @param lastRow -
2207
+ * @param columns -
2208
+ * @param updateIntervalMs -
2209
+ * @deprecated use {@link #update(Object)} instead
2465
2210
  */
2466
- changeSubscription(columns:Array<Column>, updateIntervalMs:number|undefined|null):void;
2211
+ setViewport(firstRow:number, lastRow:number, columns?:Column[]|undefined|null, updateIntervalMs?:number|undefined|null, isReverseViewport?:boolean|undefined|null):void;
2467
2212
  /**
2468
2213
  * Update the options for this viewport subscription. This cannot alter the update interval or preview options.
2469
2214
  * @param options - the subscription options
2470
2215
  */
2471
- update(options:SubscriptionOptions):void;
2472
- get columns():Array<Column>;
2216
+ update(options:ViewportSubscriptionOptions):void;
2473
2217
  /**
2474
- * Stops the subscription on the server.
2218
+ * Stops this viewport from running, stopping all events on itself and on the table that created it.
2475
2219
  */
2476
2220
  close():void;
2477
2221
  /**
2222
+ * Gets the data currently visible in this viewport
2223
+ * @return Promise of {@link dh.TableData}.
2224
+ */
2225
+ getViewportData():Promise<ViewportData>;
2226
+ /**
2227
+ * @deprecated
2228
+ */
2229
+ snapshot(rows:RangeSet, columns:Column[]):Promise<TableData>;
2230
+ /**
2478
2231
  * Listen for events on this object.
2479
2232
  * @param name - the name of the event to listen for
2480
2233
  * @param callback - a function to call when the event occurs
@@ -2495,87 +2248,133 @@ export namespace dh {
2495
2248
  }
2496
2249
 
2497
2250
  /**
2498
- * Describes how a Totals Table will be generated from its parent table. Each table has a default (which may be null)
2499
- * indicating how that table was configured when it was declared, and each Totals Table has a similar property
2500
- * describing how it was created. Both the <b>Table.getTotalsTable</b> and <b>Table.getGrandTotalsTable</b> methods take
2501
- * this config as an optional parameter - without it, the table's default will be used, or if null, a default instance
2502
- * of <b>TotalsTableConfig</b> will be supplied.
2251
+ * Configuration object for running Table.treeTable to produce a hierarchical view of a given "flat" table.
2503
2252
  *
2504
- * This class has a no-arg constructor, allowing an instance to be made with the default values provided. However, any
2505
- * JS object can be passed in to the methods which accept instances of this type, provided their values adhere to the
2506
- * expected formats.
2253
+ * Like TotalsTableConfig, `TreeTableConfig` supports an operation map indicating how to aggregate the data, as well as
2254
+ * an array of column names which will be the layers in the roll-up tree, grouped at each level. An additional optional
2255
+ * value can be provided describing the strategy the engine should use when grouping the rows.
2507
2256
  */
2508
- export class TotalsTableConfig {
2509
- /**
2510
- * @deprecated
2511
- */
2512
- static readonly COUNT:string;
2513
- /**
2514
- * @deprecated
2515
- */
2516
- static readonly MIN:string;
2517
- /**
2518
- * @deprecated
2519
- */
2520
- static readonly MAX:string;
2257
+ export class TreeTableConfig {
2521
2258
  /**
2522
- * @deprecated
2259
+ * The column representing the unique ID for each item
2523
2260
  */
2524
- static readonly SUM:string;
2261
+ idColumn:string;
2525
2262
  /**
2526
- * @deprecated
2263
+ * The column representing the parent ID for each item
2527
2264
  */
2528
- static readonly ABS_SUM:string;
2265
+ parentColumn:string;
2529
2266
  /**
2530
- * @deprecated
2267
+ * Optional parameter indicating if items with an invalid parent ID should be promoted to root. Defaults to false.
2531
2268
  */
2532
- static readonly VAR:string;
2269
+ promoteOrphansToRoot:boolean;
2270
+
2271
+ constructor();
2272
+ }
2273
+
2274
+ export class DateWrapper extends LongWrapper {
2275
+ protected constructor();
2276
+
2277
+ static ofJsDate(date:Date):DateWrapper;
2278
+ asDate():Date;
2279
+ }
2280
+
2281
+ /**
2282
+ * Describes a Sort present on the table. No visible constructor, created through the use of Column.sort(), will be tied
2283
+ * to that particular column data. Sort instances are immutable, and use a builder pattern to make modifications. All
2284
+ * methods return a new Sort instance.
2285
+ */
2286
+ export class Sort {
2287
+ static readonly ASCENDING:string;
2288
+ static readonly DESCENDING:string;
2289
+ static readonly REVERSE:string;
2290
+
2291
+ protected constructor();
2292
+
2533
2293
  /**
2534
- * @deprecated
2294
+ * Builds a Sort instance to sort values in ascending order.
2295
+ * @return {@link dh.Sort}
2535
2296
  */
2536
- static readonly AVG:string;
2297
+ asc():Sort;
2537
2298
  /**
2538
- * @deprecated
2299
+ * Builds a Sort instance to sort values in descending order.
2300
+ * @return {@link dh.Sort}
2539
2301
  */
2540
- static readonly STD:string;
2302
+ desc():Sort;
2541
2303
  /**
2542
- * @deprecated
2304
+ * Builds a Sort instance which takes the absolute value before applying order.
2305
+ * @return {@link dh.Sort}
2543
2306
  */
2544
- static readonly FIRST:string;
2307
+ abs():Sort;
2308
+ toString():string;
2545
2309
  /**
2546
- * @deprecated
2310
+ * True if the absolute value of the column should be used when sorting; defaults to false.
2311
+ * @return boolean
2547
2312
  */
2548
- static readonly LAST:string;
2313
+ get isAbs():boolean;
2549
2314
  /**
2550
- * @deprecated
2315
+ * The column which is sorted.
2316
+ * @return {@link dh.Column}
2551
2317
  */
2552
- static readonly SKIP:string;
2318
+ get column():Column;
2553
2319
  /**
2554
- * Specifies if a Totals Table should be expanded by default in the UI. Defaults to false.
2320
+ * The direction of this sort, either <b>ASC</b>, <b>DESC</b>, or <b>REVERSE</b>.
2321
+ * @return String
2555
2322
  */
2556
- showTotalsByDefault:boolean;
2323
+ get direction():string;
2324
+ }
2325
+
2326
+ export class CustomColumn {
2327
+ static readonly TYPE_FORMAT_COLOR:string;
2328
+ static readonly TYPE_FORMAT_NUMBER:string;
2329
+ static readonly TYPE_FORMAT_DATE:string;
2330
+ static readonly TYPE_NEW:string;
2331
+
2332
+ protected constructor();
2333
+
2334
+ valueOf():string;
2335
+ toString():string;
2336
+ static from(columnInfo:string):CustomColumn;
2557
2337
  /**
2558
- * Specifies if a Grand Totals Table should be expanded by default in the UI. Defaults to false.
2338
+ * The expression to evaluate this custom column.
2339
+ * @return String
2559
2340
  */
2560
- showGrandTotalsByDefault:boolean;
2341
+ get expression():string;
2561
2342
  /**
2562
- * Specifies the default operation for columns that do not have a specific operation applied; defaults to "Sum".
2343
+ * The name of the column to use.
2344
+ * @return String
2563
2345
  */
2564
- defaultOperation:AggregationOperationType;
2346
+ get name():string;
2565
2347
  /**
2566
- * Mapping from each column name to the aggregation(s) that should be applied to that column in the resulting Totals
2567
- * Table. If a column is omitted, the defaultOperation is used.
2348
+ * The options for this custom column.
2349
+ * @return CustomColumOptions
2568
2350
  */
2569
- operationMap:{ [key: string]: Array<AggregationOperationType>; };
2351
+ get options():CustomColumnOptions;
2570
2352
  /**
2571
- * Groupings to use when generating the Totals Table. One row will exist for each unique set of values observed in
2572
- * these columns. See also `Table.selectDistinct`.
2353
+ * Type of custom column. One of
2354
+ *
2355
+ * <ul>
2356
+ * <li>FORMAT_COLOR</li>
2357
+ * <li>FORMAT_NUMBER</li>
2358
+ * <li>FORMAT_DATE</li>
2359
+ * <li>NEW</li>
2360
+ * </ul>
2361
+ * @return String
2573
2362
  */
2574
- groupBy:Array<string>;
2363
+ get type():string;
2364
+ }
2575
2365
 
2576
- constructor();
2366
+ /**
2367
+ * Wrap BigDecimal values for use in JS. Provides text formatting for display and access to the underlying value.
2368
+ */
2369
+ export class BigDecimalWrapper {
2370
+ protected constructor();
2577
2371
 
2372
+ static ofString(value:string):BigDecimalWrapper;
2373
+ asNumber():number;
2374
+ valueOf():string;
2578
2375
  toString():string;
2376
+ equals(o:object):boolean;
2377
+ hashCode():number;
2579
2378
  }
2580
2379
 
2581
2380
  /**
@@ -2726,73 +2525,232 @@ export namespace dh {
2726
2525
  * regular expression</li>
2727
2526
  * <li><b>contains</b>: Returns true if the current string value contains the supplied string argument
2728
2527
  * <p>
2729
- * When invoking against a constant, this should be avoided in favor of FilterValue.contains
2730
- * </p>
2731
- * </li>
2732
- * </ul>
2733
- * @param method -
2734
- * @param args -
2735
- * @return
2528
+ * When invoking against a constant, this should be avoided in favor of FilterValue.contains
2529
+ * </p>
2530
+ * </li>
2531
+ * </ul>
2532
+ * @param method -
2533
+ * @param args -
2534
+ * @return
2535
+ */
2536
+ invoke(method:string, ...args:FilterValue[]):FilterCondition;
2537
+ toString():string;
2538
+ /**
2539
+ * Constructs a string for the filter API from the given parameter.
2540
+ * @param input -
2541
+ * @return
2542
+ */
2543
+ static ofString(input:any):FilterValue;
2544
+ /**
2545
+ * Constructs a boolean for the filter API from the given parameter.
2546
+ * @param b -
2547
+ * @return
2548
+ */
2549
+ static ofBoolean(b:boolean):FilterValue;
2550
+ }
2551
+
2552
+ export class CoreClient implements HasEventHandling {
2553
+ static readonly EVENT_CONNECT:string;
2554
+ static readonly EVENT_DISCONNECT:string;
2555
+ static readonly EVENT_RECONNECT:string;
2556
+ static readonly EVENT_RECONNECT_AUTH_FAILED:string;
2557
+ static readonly EVENT_REQUEST_FAILED:string;
2558
+ static readonly EVENT_REQUEST_STARTED:string;
2559
+ static readonly EVENT_REQUEST_SUCCEEDED:string;
2560
+ /**
2561
+ * @deprecated
2562
+ */
2563
+ static readonly EVENT_REFRESH_TOKEN_UPDATED:string;
2564
+ static readonly LOGIN_TYPE_PASSWORD:string;
2565
+ static readonly LOGIN_TYPE_ANONYMOUS:string;
2566
+
2567
+ constructor(serverUrl:string, connectOptions?:ConnectOptions);
2568
+
2569
+ running():Promise<CoreClient>;
2570
+ getServerUrl():string;
2571
+ getAuthConfigValues():Promise<string[][]>;
2572
+ login(credentials:LoginCredentials):Promise<void>;
2573
+ relogin(token:RefreshToken):Promise<void>;
2574
+ onConnected(timeoutInMillis?:number):Promise<void>;
2575
+ getServerConfigValues():Promise<string[][]>;
2576
+ getStorageService():dh.storage.StorageService;
2577
+ getAsIdeConnection():Promise<IdeConnection>;
2578
+ disconnect():void;
2579
+ addEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):()=>void;
2580
+ nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<Event<T>>;
2581
+ hasListeners(name:string):boolean;
2582
+ removeEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):boolean;
2583
+ }
2584
+
2585
+ export class LongWrapper {
2586
+ protected constructor();
2587
+
2588
+ static ofString(str:string):LongWrapper;
2589
+ asNumber():number;
2590
+ valueOf():string;
2591
+ toString():string;
2592
+ }
2593
+
2594
+ /**
2595
+ * Addition optional configuration that can be passed to the {@link dh.CoreClient} constructor.
2596
+ */
2597
+ export class ConnectOptions {
2598
+ /**
2599
+ * Optional map of http header names and values to send to the server with each request.
2600
+ */
2601
+ headers?:{ [key: string]: string; }|null;
2602
+ /**
2603
+ * True to enable debug logging. At this time, only enables logging for gRPC calls.
2604
+ */
2605
+ debug?:boolean|null;
2606
+ /**
2607
+ * Set this to true to force the use of websockets when connecting to the deephaven instance, false to force the use
2608
+ * of `fetch`. Ignored if {@link dh.transportFactory} is set.
2609
+ * <p>
2610
+ * Defaults to null, indicating that the server URL should be checked to see if we connect with fetch or websockets.
2611
+ */
2612
+ useWebsockets?:boolean|null;
2613
+ /**
2614
+ * The transport factory to use for creating gRPC streams. If specified, the JS API will ignore
2615
+ * {@link dh.useWebsockets} and its own internal logic for determining the appropriate transport to use.
2616
+ * <p>
2617
+ * Defaults to null, indicating that the JS API should determine the appropriate transport to use. If
2618
+ * `useWebsockets` is set to true, the JS API will use websockets, otherwise if the server url begins with
2619
+ * https, it will use fetch, otherwise it will use websockets.
2620
+ */
2621
+ transportFactory?:dh.grpc.GrpcTransportFactory|null;
2622
+
2623
+ constructor();
2624
+ }
2625
+
2626
+ export class IdeSession implements HasEventHandling {
2627
+ static readonly EVENT_COMMANDSTARTED:string;
2628
+ static readonly EVENT_REQUEST_FAILED:string;
2629
+
2630
+ protected constructor();
2631
+
2632
+ /**
2633
+ * Load the named table, with columns and size information already fully populated.
2634
+ * @param name - the name of the table to fetch
2635
+ * @param applyPreviewColumns - false to disable previews, defaults to true
2636
+ * @return a {@link Promise} that will resolve to the table, or reject with an error if it cannot be loaded.
2637
+ * @deprecated Added to resolve a specific issue, in the future preview will be applied as part of the subscription.
2638
+ */
2639
+ getTable(name:string, applyPreviewColumns?:boolean):Promise<Table>;
2640
+ /**
2641
+ * Load the named Figure, including its tables and tablemaps as needed.
2642
+ * @param name -
2643
+ * @return promise of dh.plot.Figure
2644
+ */
2645
+ getFigure(name:string):Promise<dh.plot.Figure>;
2646
+ /**
2647
+ * Loads the named tree table or roll-up table, with column data populated. All nodes are collapsed by default, and
2648
+ * size is presently not available until the viewport is first set.
2649
+ * @param name -
2650
+ * @return {@link Promise} of {@link dh.TreeTable}
2651
+ */
2652
+ getTreeTable(name:string):Promise<TreeTable>;
2653
+ getHierarchicalTable(name:string):Promise<TreeTable>;
2654
+ getPartitionedTable(name:string):Promise<PartitionedTable>;
2655
+ getObject(definitionObject:dh.ide.VariableDescriptor):Promise<any>;
2656
+ newTable(columnNames:string[], types:string[], data:string[][], userTimeZone:string):Promise<Table>;
2657
+ /**
2658
+ * Merges the given tables into a single table. Assumes all tables have the same structure.
2659
+ * @param tables -
2660
+ * @return {@link Promise} of {@link dh.Table}
2661
+ */
2662
+ mergeTables(tables:Table[]):Promise<Table>;
2663
+ bindTableToVariable(table:Table, name:string):Promise<void>;
2664
+ /**
2665
+ * Makes the `object` available to another user or another client on this same server which knows the value of
2666
+ * the `sharedTicketBytes`. Use that sharedTicketBytes value like a one-time use password - any other client
2667
+ * which knows this value can read the same object.
2668
+ * <p>
2669
+ * Shared objects will remain available using the sharedTicketBytes until the client that first shared them
2670
+ * releases/closes their copy of the object. Whatever side-channel is used to share the bytes, be sure to wait until
2671
+ * the remote end has signaled that it has successfully fetched the object before releasing it from this client.
2672
+ * <p>
2673
+ * Be sure to use an unpredictable value for the shared ticket bytes, like a UUID or other large, random value to
2674
+ * prevent access by unauthorized clients.
2675
+ * @param object - the object to share with another client/user
2676
+ * @param sharedTicketBytes - the value which another client/user must know to obtain the object. It may be a unicode
2677
+ * string (will be encoded as utf8 bytes), or a {@link Uint8Array} value.
2678
+ * @return A promise that will resolve to the value passed as sharedTicketBytes when the object is ready to be read
2679
+ * by another client, or will reject if an error occurs.
2680
+ */
2681
+ shareObject(object:Table|Widget|WidgetExportedObject|PartitionedTable|TotalsTable|TreeTable, sharedTicketBytes:string|Uint8Array):Promise<string|Uint8Array>;
2682
+ /**
2683
+ * Reads an object shared by another client to this server with the `sharedTicketBytes`. Until the other
2684
+ * client releases this object (or their session ends), the object will be available on the server.
2685
+ * <p>
2686
+ * The type of the object must be passed so that the object can be read from the server correct - the other client
2687
+ * should provide this information.
2688
+ * @param sharedTicketBytes - the value provided by another client/user to obtain the object. It may be a unicode
2689
+ * string (will be encoded as utf8 bytes), or a {@link Uint8Array} value.
2690
+ * @param type - The type of the object, so it can be correctly read from the server
2691
+ * @return A promise that will resolve to the shared object, or will reject with an error if it cannot be read.
2736
2692
  */
2737
- invoke(method:string, ...args:FilterValue[]):FilterCondition;
2738
- toString():string;
2693
+ getSharedObject(sharedTicketBytes:string|Uint8Array, type:string):Promise<any>;
2694
+ subscribeToFieldUpdates(callback:(arg0:dh.ide.VariableChanges)=>void):()=>void;
2695
+ close():void;
2696
+ runCode(code:string):Promise<dh.ide.CommandResult>;
2697
+ onLogMessage(callback:(arg0:dh.ide.LogItem)=>void):()=>void;
2698
+ openDocument(params:object):void;
2699
+ changeDocument(params:object):void;
2700
+ getCompletionItems(params:object):Promise<Array<dh.lsp.CompletionItem>>;
2701
+ getSignatureHelp(params:object):Promise<Array<dh.lsp.SignatureInformation>>;
2702
+ getHover(params:object):Promise<dh.lsp.Hover>;
2703
+ closeDocument(params:object):void;
2739
2704
  /**
2740
- * Constructs a string for the filter API from the given parameter.
2741
- * @param input -
2742
- * @return
2705
+ * Creates an empty table with the specified number of rows. Optionally columns and types may be specified, but all
2706
+ * values will be null.
2707
+ * @param size -
2708
+ * @return {@link Promise} of {@link dh.Table}
2743
2709
  */
2744
- static ofString(input:any):FilterValue;
2710
+ emptyTable(size:number):Promise<Table>;
2745
2711
  /**
2746
- * Constructs a boolean for the filter API from the given parameter.
2747
- * @param b -
2748
- * @return
2712
+ * Creates a new table that ticks automatically every "periodNanos" nanoseconds. A start time may be provided; if so
2713
+ * the table will be populated with the interval from the specified date until now.
2714
+ * @param periodNanos -
2715
+ * @param startTime -
2716
+ * @return {@link Promise} of {@link dh.Table}
2749
2717
  */
2750
- static ofBoolean(b:boolean):FilterValue;
2718
+ timeTable(periodNanos:number, startTime?:DateWrapper):Promise<Table>;
2719
+ addEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):()=>void;
2720
+ nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<Event<T>>;
2721
+ hasListeners(name:string):boolean;
2722
+ removeEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):boolean;
2751
2723
  }
2752
2724
 
2753
-
2754
2725
  /**
2755
- * Describes the type of node in a rollup table.
2726
+ * Wrap BigInteger values for use in JS. Provides text formatting for display and access to the underlying value.
2756
2727
  */
2757
- type RollupNodeTypeType = string;
2758
- export class RollupNodeType {
2759
- static readonly ROLLUP_NODE_TYPE_AGGREGATED:RollupNodeTypeType;
2760
- static readonly ROLLUP_NODE_TYPE_CONSTITUENT:RollupNodeTypeType;
2761
- }
2728
+ export class BigIntegerWrapper {
2729
+ protected constructor();
2762
2730
 
2763
- type SearchDisplayModeType = string;
2764
- export class SearchDisplayMode {
2765
- static readonly SEARCH_DISPLAY_DEFAULT:SearchDisplayModeType;
2766
- static readonly SEARCH_DISPLAY_HIDE:SearchDisplayModeType;
2767
- static readonly SEARCH_DISPLAY_SHOW:SearchDisplayModeType;
2731
+ static ofString(str:string):BigIntegerWrapper;
2732
+ asNumber():number;
2733
+ valueOf():string;
2734
+ toString():string;
2735
+ equals(o:object):boolean;
2736
+ hashCode():number;
2768
2737
  }
2769
2738
 
2770
2739
  /**
2771
- * A set of string constants that can be used to describe the different objects the JS API can export.
2740
+ * Exists to keep the dh.TableMap namespace so that the web UI can remain compatible with the DHE API, which still calls
2741
+ * this type TableMap.
2742
+ * @deprecated
2772
2743
  */
2773
- type VariableTypeType = string;
2774
- export class VariableType {
2775
- static readonly TABLE:VariableTypeType;
2776
- static readonly TREETABLE:VariableTypeType;
2777
- static readonly HIERARCHICALTABLE:VariableTypeType;
2778
- static readonly TABLEMAP:VariableTypeType;
2779
- static readonly PARTITIONEDTABLE:VariableTypeType;
2780
- static readonly FIGURE:VariableTypeType;
2781
- static readonly OTHERWIDGET:VariableTypeType;
2782
- static readonly PANDAS:VariableTypeType;
2783
- static readonly TREEMAP:VariableTypeType;
2784
- }
2744
+ export class TableMap {
2745
+ static readonly EVENT_KEYADDED:string;
2746
+ static readonly EVENT_DISCONNECT:string;
2747
+ static readonly EVENT_RECONNECT:string;
2748
+ static readonly EVENT_RECONNECTFAILED:string;
2785
2749
 
2786
- type ValueTypeType = string;
2787
- export class ValueType {
2788
- static readonly STRING:ValueTypeType;
2789
- static readonly NUMBER:ValueTypeType;
2790
- static readonly DOUBLE:ValueTypeType;
2791
- static readonly LONG:ValueTypeType;
2792
- static readonly DATETIME:ValueTypeType;
2793
- static readonly BOOLEAN:ValueTypeType;
2750
+ protected constructor();
2794
2751
  }
2795
2752
 
2753
+
2796
2754
  /**
2797
2755
  * This enum describes the name of each supported operation/aggregation type when creating a `TreeTable`.
2798
2756
  */
@@ -2815,6 +2773,48 @@ export namespace dh {
2815
2773
  static readonly SKIP:AggregationOperationType;
2816
2774
  }
2817
2775
 
2776
+ type SearchDisplayModeType = string;
2777
+ export class SearchDisplayMode {
2778
+ static readonly SEARCH_DISPLAY_DEFAULT:SearchDisplayModeType;
2779
+ static readonly SEARCH_DISPLAY_HIDE:SearchDisplayModeType;
2780
+ static readonly SEARCH_DISPLAY_SHOW:SearchDisplayModeType;
2781
+ }
2782
+
2783
+ type ValueTypeType = string;
2784
+ export class ValueType {
2785
+ static readonly STRING:ValueTypeType;
2786
+ static readonly NUMBER:ValueTypeType;
2787
+ static readonly DOUBLE:ValueTypeType;
2788
+ static readonly LONG:ValueTypeType;
2789
+ static readonly DATETIME:ValueTypeType;
2790
+ static readonly BOOLEAN:ValueTypeType;
2791
+ }
2792
+
2793
+ /**
2794
+ * Describes the type of node in a rollup table.
2795
+ */
2796
+ type RollupNodeTypeType = string;
2797
+ export class RollupNodeType {
2798
+ static readonly ROLLUP_NODE_TYPE_AGGREGATED:RollupNodeTypeType;
2799
+ static readonly ROLLUP_NODE_TYPE_CONSTITUENT:RollupNodeTypeType;
2800
+ }
2801
+
2802
+ /**
2803
+ * A set of string constants that can be used to describe the different objects the JS API can export.
2804
+ */
2805
+ type VariableTypeType = string;
2806
+ export class VariableType {
2807
+ static readonly TABLE:VariableTypeType;
2808
+ static readonly TREETABLE:VariableTypeType;
2809
+ static readonly HIERARCHICALTABLE:VariableTypeType;
2810
+ static readonly TABLEMAP:VariableTypeType;
2811
+ static readonly PARTITIONEDTABLE:VariableTypeType;
2812
+ static readonly FIGURE:VariableTypeType;
2813
+ static readonly OTHERWIDGET:VariableTypeType;
2814
+ static readonly PANDAS:VariableTypeType;
2815
+ static readonly TREEMAP:VariableTypeType;
2816
+ }
2817
+
2818
2818
  }
2819
2819
 
2820
2820
  export namespace dh.ide {
@@ -2828,21 +2828,6 @@ export namespace dh.ide {
2828
2828
  name?:string|null;
2829
2829
  }
2830
2830
  /**
2831
- * Indicates the result of code run on the server.
2832
- */
2833
- export interface CommandResult {
2834
- /**
2835
- * Describes changes made in the course of this command.
2836
- * @return {@link dh.ide.VariableChanges}.
2837
- */
2838
- get changes():VariableChanges;
2839
- /**
2840
- * If the command failed, the error message will be provided here.
2841
- * @return String
2842
- */
2843
- get error():string;
2844
- }
2845
- /**
2846
2831
  * A format to describe a variable available to be read from the server. Application fields are optional, and only
2847
2832
  * populated when a variable is provided by application mode.
2848
2833
  * <p>
@@ -2884,6 +2869,45 @@ export namespace dh.ide {
2884
2869
  get applicationName():string;
2885
2870
  }
2886
2871
  /**
2872
+ * Describes changes in the current set of variables in the script session. Note that variables that changed value
2873
+ * without changing type will be included as <b>updated</b>, but if a new value with one type replaces an old value with
2874
+ * a different type, this will be included as an entry in both <b>removed</b> and <b>created</b> to indicate the old and
2875
+ * new types.
2876
+ */
2877
+ export interface VariableChanges {
2878
+ /**
2879
+ *
2880
+ * @return The variables that no longer exist after this operation, or were replaced by some variable with a
2881
+ * different type.
2882
+ */
2883
+ get removed():Array<VariableDefinition>;
2884
+ /**
2885
+ *
2886
+ * @return The variables that were created by this operation, or have a new type.
2887
+ */
2888
+ get created():Array<VariableDefinition>;
2889
+ /**
2890
+ *
2891
+ * @return The variables that changed value during this operation.
2892
+ */
2893
+ get updated():Array<VariableDefinition>;
2894
+ }
2895
+ /**
2896
+ * Indicates the result of code run on the server.
2897
+ */
2898
+ export interface CommandResult {
2899
+ /**
2900
+ * Describes changes made in the course of this command.
2901
+ * @return {@link dh.ide.VariableChanges}.
2902
+ */
2903
+ get changes():VariableChanges;
2904
+ /**
2905
+ * If the command failed, the error message will be provided here.
2906
+ * @return String
2907
+ */
2908
+ get error():string;
2909
+ }
2910
+ /**
2887
2911
  * Represents a serialized fishlib LogRecord, suitable for display on javascript clients. A log entry sent from the
2888
2912
  * server.
2889
2913
  */
@@ -2892,41 +2916,91 @@ export namespace dh.ide {
2892
2916
  * The level of the log message, enabling the client to ignore messages.
2893
2917
  * @return String
2894
2918
  */
2895
- get logLevel():string;
2919
+ get logLevel():string;
2920
+ /**
2921
+ * Timestamp of the message in microseconds since Jan 1, 1970 UTC.
2922
+ * @return double
2923
+ */
2924
+ get micros():number;
2925
+ /**
2926
+ * The log message written on the server.
2927
+ * @return String
2928
+ */
2929
+ get message():string;
2930
+ }
2931
+ }
2932
+
2933
+ export namespace dh.grpc {
2934
+
2935
+ /**
2936
+ * gRPC transport implementation.
2937
+ */
2938
+ export interface GrpcTransport {
2939
+ /**
2940
+ * Starts the stream, sending metadata to the server.
2941
+ * @param metadata - the headers to send the server when opening the connection
2942
+ */
2943
+ start(metadata:{ [key: string]: string|Array<string>; }):void;
2944
+ /**
2945
+ * Sends a message to the server.
2946
+ * @param msgBytes - bytes to send to the server
2947
+ */
2948
+ sendMessage(msgBytes:Uint8Array):void;
2949
+ /**
2950
+ * "Half close" the stream, signaling to the server that no more messages will be sent, but that the client is still
2951
+ * open to receiving messages.
2952
+ */
2953
+ finishSend():void;
2954
+ /**
2955
+ * End the stream, both notifying the server that no more messages will be sent nor received, and preventing the
2956
+ * client from receiving any more events.
2957
+ */
2958
+ cancel():void;
2959
+ }
2960
+ /**
2961
+ * Options for creating a gRPC stream transport instance.
2962
+ */
2963
+ export interface GrpcTransportOptions {
2964
+ /**
2965
+ * The gRPC method URL.
2966
+ */
2967
+ url:URL;
2968
+ /**
2969
+ * True to enable debug logging for this stream.
2970
+ */
2971
+ debug:boolean;
2972
+ /**
2973
+ * Callback for when headers and status are received. The headers are a map of header names to values, and the
2974
+ * status is the HTTP status code. If the connection could not be made, the status should be 0.
2975
+ */
2976
+ onHeaders:(headers:{ [key: string]: string|Array<string>; },status:number)=>void;
2896
2977
  /**
2897
- * Timestamp of the message in microseconds since Jan 1, 1970 UTC.
2898
- * @return double
2978
+ * Callback for when a chunk of data is received.
2899
2979
  */
2900
- get micros():number;
2980
+ onChunk:(chunk:Uint8Array)=>void;
2901
2981
  /**
2902
- * The log message written on the server.
2903
- * @return String
2982
+ * Callback for when the stream ends, with an error instance if it can be provided. Note that the present
2983
+ * implementation does not consume errors, even if provided.
2904
2984
  */
2905
- get message():string;
2985
+ onEnd:(error?:Error|undefined|null)=>void;
2906
2986
  }
2907
2987
  /**
2908
- * Describes changes in the current set of variables in the script session. Note that variables that changed value
2909
- * without changing type will be included as <b>updated</b>, but if a new value with one type replaces an old value with
2910
- * a different type, this will be included as an entry in both <b>removed</b> and <b>created</b> to indicate the old and
2911
- * new types.
2988
+ * Factory for creating gRPC transports.
2912
2989
  */
2913
- export interface VariableChanges {
2914
- /**
2915
- *
2916
- * @return The variables that no longer exist after this operation, or were replaced by some variable with a
2917
- * different type.
2918
- */
2919
- get removed():Array<VariableDefinition>;
2990
+ export interface GrpcTransportFactory {
2920
2991
  /**
2921
- *
2922
- * @return The variables that were created by this operation, or have a new type.
2992
+ * Create a new transport instance.
2993
+ * @param options - options for creating the transport
2994
+ * @return a transport instance to use for gRPC communication
2923
2995
  */
2924
- get created():Array<VariableDefinition>;
2996
+ create(options:GrpcTransportOptions):GrpcTransport;
2925
2997
  /**
2926
- *
2927
- * @return The variables that changed value during this operation.
2998
+ * Return true to signal that created transports may have {@link GrpcTransport.sendMessage} called on it
2999
+ * more than once before {@link GrpcTransport.finishSend} should be called.
3000
+ * @return true to signal that the implementation can stream multiple messages, false otherwise indicating that
3001
+ * Open/Next gRPC calls should be used
2928
3002
  */
2929
- get updated():Array<VariableDefinition>;
3003
+ get supportsClientStreaming():boolean;
2930
3004
  }
2931
3005
  }
2932
3006
 
@@ -3197,96 +3271,11 @@ export namespace dh.i18n {
3197
3271
 
3198
3272
  }
3199
3273
 
3200
- export namespace dh.grpc {
3201
-
3202
- /**
3203
- * Options for creating a gRPC stream transport instance.
3204
- */
3205
- export interface GrpcTransportOptions {
3206
- /**
3207
- * The gRPC method URL.
3208
- */
3209
- url:URL;
3210
- /**
3211
- * True to enable debug logging for this stream.
3212
- */
3213
- debug:boolean;
3214
- /**
3215
- * Callback for when headers and status are received. The headers are a map of header names to values, and the
3216
- * status is the HTTP status code. If the connection could not be made, the status should be 0.
3217
- */
3218
- onHeaders:(headers:{ [key: string]: string|Array<string>; },status:number)=>void;
3219
- /**
3220
- * Callback for when a chunk of data is received.
3221
- */
3222
- onChunk:(chunk:Uint8Array)=>void;
3223
- /**
3224
- * Callback for when the stream ends, with an error instance if it can be provided. Note that the present
3225
- * implementation does not consume errors, even if provided.
3226
- */
3227
- onEnd:(error?:Error|undefined|null)=>void;
3228
- }
3229
- /**
3230
- * Factory for creating gRPC transports.
3231
- */
3232
- export interface GrpcTransportFactory {
3233
- /**
3234
- * Create a new transport instance.
3235
- * @param options - options for creating the transport
3236
- * @return a transport instance to use for gRPC communication
3237
- */
3238
- create(options:GrpcTransportOptions):GrpcTransport;
3239
- /**
3240
- * Return true to signal that created transports may have {@link GrpcTransport.sendMessage} called on it
3241
- * more than once before {@link GrpcTransport.finishSend} should be called.
3242
- * @return true to signal that the implementation can stream multiple messages, false otherwise indicating that
3243
- * Open/Next gRPC calls should be used
3244
- */
3245
- get supportsClientStreaming():boolean;
3246
- }
3247
- /**
3248
- * gRPC transport implementation.
3249
- */
3250
- export interface GrpcTransport {
3251
- /**
3252
- * Starts the stream, sending metadata to the server.
3253
- * @param metadata - the headers to send the server when opening the connection
3254
- */
3255
- start(metadata:{ [key: string]: string|Array<string>; }):void;
3256
- /**
3257
- * Sends a message to the server.
3258
- * @param msgBytes - bytes to send to the server
3259
- */
3260
- sendMessage(msgBytes:Uint8Array):void;
3261
- /**
3262
- * "Half close" the stream, signaling to the server that no more messages will be sent, but that the client is still
3263
- * open to receiving messages.
3264
- */
3265
- finishSend():void;
3266
- /**
3267
- * End the stream, both notifying the server that no more messages will be sent nor received, and preventing the
3268
- * client from receiving any more events.
3269
- */
3270
- cancel():void;
3271
- }
3272
- }
3273
-
3274
3274
  export namespace dh.plot {
3275
3275
 
3276
- /**
3277
- * Describes a template that will be used to make new series instances when a new table added to a plotBy.
3278
- */
3279
- export interface MultiSeries {
3280
- /**
3281
- * The name for this multi-series.
3282
- * @return String
3283
- */
3284
- get name():string;
3285
- /**
3286
- * The plotting style to use for the series that will be created. See <b>SeriesPlotStyle</b> enum for more details.
3287
- * @return int
3288
- */
3289
- get plotStyle():SeriesPlotStyleType;
3276
+ export interface FigureDataUpdatedEvent {
3277
+ getArray(series:Series, sourceType:number, mappingFunc?:(arg0:any)=>any):Array<any>;
3278
+ get series():Series[];
3290
3279
  }
3291
3280
  /**
3292
3281
  * Provides access to the data for displaying in a figure.
@@ -3400,6 +3389,27 @@ export namespace dh.plot {
3400
3389
  get formatType():AxisFormatTypeType;
3401
3390
  get minRange():number;
3402
3391
  }
3392
+ export interface OneClick {
3393
+ setValueForColumn(columnName:string, value:any):void;
3394
+ getValueForColumn(columName:string):any;
3395
+ get requireAllFiltersToDisplay():boolean;
3396
+ get columns():dh.Column[];
3397
+ }
3398
+ /**
3399
+ * Describes a template that will be used to make new series instances when a new table added to a plotBy.
3400
+ */
3401
+ export interface MultiSeries {
3402
+ /**
3403
+ * The name for this multi-series.
3404
+ * @return String
3405
+ */
3406
+ get name():string;
3407
+ /**
3408
+ * The plotting style to use for the series that will be created. See <b>SeriesPlotStyle</b> enum for more details.
3409
+ * @return int
3410
+ */
3411
+ get plotStyle():SeriesPlotStyleType;
3412
+ }
3403
3413
  /**
3404
3414
  * Describes how to access and display data required within a series.
3405
3415
  */
@@ -3420,50 +3430,6 @@ export namespace dh.plot {
3420
3430
  */
3421
3431
  get type():SourceTypeType;
3422
3432
  }
3423
- export interface OneClick {
3424
- setValueForColumn(columnName:string, value:any):void;
3425
- getValueForColumn(columName:string):any;
3426
- get requireAllFiltersToDisplay():boolean;
3427
- get columns():dh.Column[];
3428
- }
3429
- export interface FigureDataUpdatedEvent {
3430
- getArray(series:Series, sourceType:number, mappingFunc?:(arg0:any)=>any):Array<any>;
3431
- get series():Series[];
3432
- }
3433
-
3434
- export class ChartDescriptor {
3435
- colspan?:number|null;
3436
- rowspan?:number|null;
3437
- series:Array<SeriesDescriptor>;
3438
- axes:Array<AxisDescriptor>;
3439
- chartType:string;
3440
- title?:string|null;
3441
- titleFont?:string|null;
3442
- titleColor?:string|null;
3443
- showLegend?:boolean|null;
3444
- legendFont?:string|null;
3445
- legendColor?:string|null;
3446
- is3d?:boolean|null;
3447
-
3448
- constructor();
3449
- }
3450
-
3451
- /**
3452
- * A descriptor used with JsFigureFactory.create to create a figure from JS.
3453
- */
3454
- export class FigureDescriptor {
3455
- title?:string|null;
3456
- titleFont?:string|null;
3457
- titleColor?:string|null;
3458
- isResizable?:boolean|null;
3459
- isDefaultTheme?:boolean|null;
3460
- updateInterval?:number|null;
3461
- cols?:number|null;
3462
- rows?:number|null;
3463
- charts:Array<ChartDescriptor>;
3464
-
3465
- constructor();
3466
- }
3467
3433
 
3468
3434
  /**
3469
3435
  * Provides the details for a figure.
@@ -3585,62 +3551,63 @@ export namespace dh.plot {
3585
3551
  static create(config:FigureDescriptor):Promise<Figure>;
3586
3552
  }
3587
3553
 
3588
- export class FigureSourceException {
3589
- table:dh.Table;
3590
- source:SeriesDataSource;
3591
-
3554
+ export class SeriesDataSourceException {
3592
3555
  protected constructor();
3556
+
3557
+ get source():SeriesDataSource;
3558
+ get message():string;
3593
3559
  }
3594
3560
 
3595
- export class FigureFetchError {
3596
- error:object;
3597
- errors:Array<string>;
3561
+ export class FigureSourceException {
3562
+ table:dh.Table;
3563
+ source:SeriesDataSource;
3598
3564
 
3599
3565
  protected constructor();
3600
3566
  }
3601
3567
 
3602
3568
  /**
3603
- * Provide the details for a chart.
3569
+ * Helper class for plot downsampling methods.
3604
3570
  */
3605
- export class Chart implements dh.HasEventHandling {
3606
- /**
3607
- * a new series was added to this chart as part of a multi-series. The series instance is the detail for this event.
3608
- */
3609
- static readonly EVENT_SERIES_ADDED:string;
3571
+ export class Downsample {
3572
+ protected constructor();
3573
+
3610
3574
  /**
3611
- * The title of the chart.
3612
- * @return String
3575
+ * Downsamples a table so that the data can be used for a time-series line plot. The downsampled table should have
3576
+ * the same visual fidelity as the original table, but with fewer rows.
3577
+ * @param table - The table to downsample.
3578
+ * @param xCol - The name of the X column to downsample. Must be an Instant or long.
3579
+ * @param yCols - The names of the Y columns to downsample.
3580
+ * @param width - The width of the visible area in pixels.
3581
+ * @param xRange - The visible range as `[start, end]` or null to always use all data.
3582
+ * @return A promise that resolves to the downsampled table.
3613
3583
  */
3614
- readonly title?:string|null;
3584
+ static runChartDownsample(table:dh.Table, xCol:string, yCols:string[], width:number, xRange?:dh.LongWrapper[]|undefined|null):Promise<dh.Table>;
3585
+ }
3615
3586
 
3616
- protected constructor();
3587
+ export class SourceDescriptor {
3588
+ axis:AxisDescriptor;
3589
+ table:dh.Table;
3590
+ columnName:string;
3591
+ type:string;
3592
+
3593
+ constructor();
3594
+ }
3595
+
3596
+ /**
3597
+ * A descriptor used with JsFigureFactory.create to create a figure from JS.
3598
+ */
3599
+ export class FigureDescriptor {
3600
+ title?:string|null;
3601
+ titleFont?:string|null;
3602
+ titleColor?:string|null;
3603
+ isResizable?:boolean|null;
3604
+ isDefaultTheme?:boolean|null;
3605
+ updateInterval?:number|null;
3606
+ cols?:number|null;
3607
+ rows?:number|null;
3608
+ charts:Array<ChartDescriptor>;
3617
3609
 
3618
- addEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):()=>void;
3619
- nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<dh.Event<T>>;
3620
- hasListeners(name:string):boolean;
3621
- removeEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):boolean;
3622
- get column():number;
3623
- get showLegend():boolean;
3624
- /**
3625
- * The axes used in this chart.
3626
- * @return dh.plot.Axis
3627
- */
3628
- get axes():Axis[];
3629
- get is3d():boolean;
3630
- get titleFont():string;
3631
- get colspan():number;
3632
- get titleColor():string;
3633
- get series():Series[];
3634
- get rowspan():number;
3635
- /**
3636
- * The type of this chart, see <b>ChartType</b> enum for more details.
3637
- * @return int
3638
- */
3639
- get chartType():ChartTypeType;
3640
- get row():number;
3641
- get legendColor():string;
3642
- get legendFont():string;
3643
- get multiSeries():MultiSeries[];
3610
+ constructor();
3644
3611
  }
3645
3612
 
3646
3613
  export class DownsampleOptions {
@@ -3693,41 +3660,23 @@ export namespace dh.plot {
3693
3660
  constructor();
3694
3661
  }
3695
3662
 
3696
- export class SeriesDataSourceException {
3697
- protected constructor();
3698
-
3699
- get source():SeriesDataSource;
3700
- get message():string;
3701
- }
3702
-
3703
- export class SourceDescriptor {
3704
- axis:AxisDescriptor;
3705
- table:dh.Table;
3706
- columnName:string;
3707
- type:string;
3663
+ export class ChartDescriptor {
3664
+ colspan?:number|null;
3665
+ rowspan?:number|null;
3666
+ series:Array<SeriesDescriptor>;
3667
+ axes:Array<AxisDescriptor>;
3668
+ chartType:string;
3669
+ title?:string|null;
3670
+ titleFont?:string|null;
3671
+ titleColor?:string|null;
3672
+ showLegend?:boolean|null;
3673
+ legendFont?:string|null;
3674
+ legendColor?:string|null;
3675
+ is3d?:boolean|null;
3708
3676
 
3709
3677
  constructor();
3710
3678
  }
3711
3679
 
3712
- /**
3713
- * Helper class for plot downsampling methods.
3714
- */
3715
- export class Downsample {
3716
- protected constructor();
3717
-
3718
- /**
3719
- * Downsamples a table so that the data can be used for a time-series line plot. The downsampled table should have
3720
- * the same visual fidelity as the original table, but with fewer rows.
3721
- * @param table - The table to downsample.
3722
- * @param xCol - The name of the X column to downsample. Must be an Instant or long.
3723
- * @param yCols - The names of the Y columns to downsample.
3724
- * @param width - The width of the visible area in pixels.
3725
- * @param xRange - The visible range as `[start, end]` or null to always use all data.
3726
- * @return A promise that resolves to the downsampled table.
3727
- */
3728
- static runChartDownsample(table:dh.Table, xCol:string, yCols:string[], width:number, xRange?:dh.LongWrapper[]|undefined|null):Promise<dh.Table>;
3729
- }
3730
-
3731
3680
  export class SeriesDescriptor {
3732
3681
  plotStyle:string;
3733
3682
  name?:string|null;
@@ -3747,6 +3696,13 @@ export namespace dh.plot {
3747
3696
  constructor();
3748
3697
  }
3749
3698
 
3699
+ export class FigureFetchError {
3700
+ error:object;
3701
+ errors:Array<string>;
3702
+
3703
+ protected constructor();
3704
+ }
3705
+
3750
3706
  /**
3751
3707
  * Helper class to manage snapshots and deltas and keep not only a contiguous JS array of data per column in the
3752
3708
  * underlying table, but also support a mapping function to let client code translate data in some way for display and
@@ -3764,23 +3720,51 @@ export namespace dh.plot {
3764
3720
  removeColumn(columnName:string, mappingFunc:(arg0:any)=>any):void;
3765
3721
  }
3766
3722
 
3723
+ /**
3724
+ * Provide the details for a chart.
3725
+ */
3726
+ export class Chart implements dh.HasEventHandling {
3727
+ /**
3728
+ * a new series was added to this chart as part of a multi-series. The series instance is the detail for this event.
3729
+ */
3730
+ static readonly EVENT_SERIES_ADDED:string;
3731
+ /**
3732
+ * The title of the chart.
3733
+ * @return String
3734
+ */
3735
+ readonly title?:string|null;
3767
3736
 
3768
- type AxisTypeType = number;
3769
- export class AxisType {
3770
- static readonly X:AxisTypeType;
3771
- static readonly Y:AxisTypeType;
3772
- static readonly SHAPE:AxisTypeType;
3773
- static readonly SIZE:AxisTypeType;
3774
- static readonly LABEL:AxisTypeType;
3775
- static readonly COLOR:AxisTypeType;
3776
- }
3737
+ protected constructor();
3777
3738
 
3778
- type AxisFormatTypeType = number;
3779
- export class AxisFormatType {
3780
- static readonly CATEGORY:AxisFormatTypeType;
3781
- static readonly NUMBER:AxisFormatTypeType;
3739
+ addEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):()=>void;
3740
+ nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<dh.Event<T>>;
3741
+ hasListeners(name:string):boolean;
3742
+ removeEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):boolean;
3743
+ get column():number;
3744
+ get showLegend():boolean;
3745
+ /**
3746
+ * The axes used in this chart.
3747
+ * @return dh.plot.Axis
3748
+ */
3749
+ get axes():Axis[];
3750
+ get is3d():boolean;
3751
+ get titleFont():string;
3752
+ get colspan():number;
3753
+ get titleColor():string;
3754
+ get series():Series[];
3755
+ get rowspan():number;
3756
+ /**
3757
+ * The type of this chart, see <b>ChartType</b> enum for more details.
3758
+ * @return int
3759
+ */
3760
+ get chartType():ChartTypeType;
3761
+ get row():number;
3762
+ get legendColor():string;
3763
+ get legendFont():string;
3764
+ get multiSeries():MultiSeries[];
3782
3765
  }
3783
3766
 
3767
+
3784
3768
  type SeriesPlotStyleType = number;
3785
3769
  export class SeriesPlotStyle {
3786
3770
  static readonly BAR:SeriesPlotStyleType;
@@ -3826,13 +3810,20 @@ export namespace dh.plot {
3826
3810
  static readonly HOVER_TEXT:SourceTypeType;
3827
3811
  }
3828
3812
 
3829
- type AxisPositionType = number;
3830
- export class AxisPosition {
3831
- static readonly TOP:AxisPositionType;
3832
- static readonly BOTTOM:AxisPositionType;
3833
- static readonly LEFT:AxisPositionType;
3834
- static readonly RIGHT:AxisPositionType;
3835
- static readonly NONE:AxisPositionType;
3813
+ type AxisTypeType = number;
3814
+ export class AxisType {
3815
+ static readonly X:AxisTypeType;
3816
+ static readonly Y:AxisTypeType;
3817
+ static readonly SHAPE:AxisTypeType;
3818
+ static readonly SIZE:AxisTypeType;
3819
+ static readonly LABEL:AxisTypeType;
3820
+ static readonly COLOR:AxisTypeType;
3821
+ }
3822
+
3823
+ type AxisFormatTypeType = number;
3824
+ export class AxisFormatType {
3825
+ static readonly CATEGORY:AxisFormatTypeType;
3826
+ static readonly NUMBER:AxisFormatTypeType;
3836
3827
  }
3837
3828
 
3838
3829
  /**
@@ -3850,28 +3841,48 @@ export namespace dh.plot {
3850
3841
  static readonly TREEMAP:ChartTypeType;
3851
3842
  }
3852
3843
 
3844
+ type AxisPositionType = number;
3845
+ export class AxisPosition {
3846
+ static readonly TOP:AxisPositionType;
3847
+ static readonly BOTTOM:AxisPositionType;
3848
+ static readonly LEFT:AxisPositionType;
3849
+ static readonly RIGHT:AxisPositionType;
3850
+ static readonly NONE:AxisPositionType;
3851
+ }
3852
+
3853
3853
  }
3854
3854
 
3855
3855
  export namespace dh.lsp {
3856
3856
 
3857
- export class Position {
3858
- line:number;
3859
- character:number;
3857
+ export class CompletionItem {
3858
+ label:string;
3859
+ kind:number;
3860
+ detail:string;
3861
+ documentation:MarkupContent;
3862
+ deprecated:boolean;
3863
+ preselect:boolean;
3864
+ textEdit:TextEdit;
3865
+ sortText:string;
3866
+ filterText:string;
3867
+ insertTextFormat:number;
3868
+ additionalTextEdits:Array<TextEdit>;
3869
+ commitCharacters:Array<string>;
3860
3870
 
3861
3871
  constructor();
3872
+ }
3862
3873
 
3863
- lessThan(start:Position):boolean;
3864
- lessOrEqual(start:Position):boolean;
3865
- greaterThan(end:Position):boolean;
3866
- greaterOrEqual(end:Position):boolean;
3867
- copy():Position;
3874
+ export class Range {
3875
+ start:Position;
3876
+ end:Position;
3877
+
3878
+ constructor();
3879
+
3880
+ isInside(innerStart:Position, innerEnd:Position):boolean;
3868
3881
  }
3869
3882
 
3870
- export class SignatureInformation {
3871
- label:string;
3872
- documentation:MarkupContent;
3873
- parameters:Array<ParameterInformation>;
3874
- activeParameter:number;
3883
+ export class Hover {
3884
+ contents:MarkupContent;
3885
+ range:Range;
3875
3886
 
3876
3887
  constructor();
3877
3888
  }
@@ -3883,42 +3894,32 @@ export namespace dh.lsp {
3883
3894
  constructor();
3884
3895
  }
3885
3896
 
3886
- export class Range {
3887
- start:Position;
3888
- end:Position;
3897
+ export class Position {
3898
+ line:number;
3899
+ character:number;
3889
3900
 
3890
3901
  constructor();
3891
3902
 
3892
- isInside(innerStart:Position, innerEnd:Position):boolean;
3903
+ lessThan(start:Position):boolean;
3904
+ lessOrEqual(start:Position):boolean;
3905
+ greaterThan(end:Position):boolean;
3906
+ greaterOrEqual(end:Position):boolean;
3907
+ copy():Position;
3893
3908
  }
3894
3909
 
3895
- export class CompletionItem {
3896
- label:string;
3897
- kind:number;
3898
- detail:string;
3899
- documentation:MarkupContent;
3900
- deprecated:boolean;
3901
- preselect:boolean;
3902
- textEdit:TextEdit;
3903
- sortText:string;
3904
- filterText:string;
3905
- insertTextFormat:number;
3906
- additionalTextEdits:Array<TextEdit>;
3907
- commitCharacters:Array<string>;
3910
+ export class TextDocumentContentChangeEvent {
3911
+ range:Range;
3912
+ rangeLength:number;
3913
+ text:string;
3908
3914
 
3909
3915
  constructor();
3910
3916
  }
3911
3917
 
3912
- export class ParameterInformation {
3918
+ export class SignatureInformation {
3913
3919
  label:string;
3914
3920
  documentation:MarkupContent;
3915
-
3916
- constructor();
3917
- }
3918
-
3919
- export class Hover {
3920
- contents:MarkupContent;
3921
- range:Range;
3921
+ parameters:Array<ParameterInformation>;
3922
+ activeParameter:number;
3922
3923
 
3923
3924
  constructor();
3924
3925
  }
@@ -3930,10 +3931,9 @@ export namespace dh.lsp {
3930
3931
  constructor();
3931
3932
  }
3932
3933
 
3933
- export class TextDocumentContentChangeEvent {
3934
- range:Range;
3935
- rangeLength:number;
3936
- text:string;
3934
+ export class ParameterInformation {
3935
+ label:string;
3936
+ documentation:MarkupContent;
3937
3937
 
3938
3938
  constructor();
3939
3939
  }
@@ -3955,10 +3955,6 @@ export namespace dh.calendar {
3955
3955
  */
3956
3956
  get businessPeriods():Array<BusinessPeriod>;
3957
3957
  }
3958
- export interface BusinessPeriod {
3959
- get close():string;
3960
- get open():string;
3961
- }
3962
3958
  /**
3963
3959
  * Defines a calendar with business hours and holidays.
3964
3960
  */
@@ -3989,6 +3985,10 @@ export namespace dh.calendar {
3989
3985
  */
3990
3986
  get businessPeriods():Array<BusinessPeriod>;
3991
3987
  }
3988
+ export interface BusinessPeriod {
3989
+ get close():string;
3990
+ get open():string;
3991
+ }
3992
3992
 
3993
3993
  type DayOfWeekType = string;
3994
3994
  export class DayOfWeek {