@deephaven/jsapi-types 1.0.0-dev0.39.3 → 1.0.0-dev0.39.5

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 +1879 -1894
  2. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -1,10 +1,6 @@
1
1
  // Minimum TypeScript Version: 4.3
2
2
  // Generated using com.vertispan.tsdefs.doclet.TsDoclet
3
3
 
4
- export interface IIterableResult<T> {
5
- value:T;
6
- done:boolean;
7
- }
8
4
  /**
9
5
  * This is part of EcmaScript 2015, documented here for completeness. It supports a single method, <b>next()</b>, which
10
6
  * returns an object with a <b>boolean</b> named <b>done</b> (true if there are no more items to return; false
@@ -15,39 +11,12 @@ export interface Iterator<T> {
15
11
  hasNext():boolean;
16
12
  next():IIterableResult<T>;
17
13
  }
14
+ export interface IIterableResult<T> {
15
+ value:T;
16
+ done:boolean;
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
+ * Storage service metadata about files and folders.
80
+ */
81
+ export class ItemDetails {
82
+ protected constructor();
83
+
84
+ toString():string;
85
+ get filename():string;
86
+ get basename():string;
87
+ get size():number;
88
+ get etag():string;
89
+ get type():ItemTypeType;
90
+ get dirname():string;
91
+ }
92
+
93
+ /**
94
+ * Represents a file's contents loaded from the server. If an etag was specified when loading, client should first test
95
+ * if the etag of this instance matches - if so, the contents will be empty, and the client's existing contents should
96
+ * be used.
97
+ */
98
+ export class FileContents {
99
+ protected constructor();
100
+
101
+ static blob(blob:Blob):FileContents;
102
+ static text(...text:string[]):FileContents;
103
+ static arrayBuffers(...buffers:ArrayBuffer[]):FileContents;
104
+ text():Promise<string>;
105
+ arrayBuffer():Promise<ArrayBuffer>;
106
+ get etag():string;
107
+ }
108
+
109
109
 
110
110
  type ItemTypeType = string;
111
111
  export class ItemType {
@@ -118,68 +118,36 @@ export namespace dh.storage {
118
118
  export namespace dh {
119
119
 
120
120
  /**
121
- * Similar to the browser `CustomEvent` type, this class holds only the type of the event, and optionally some
122
- * details about the event.
123
- * @typeParam T - the type of the event detail
124
- */
125
- export interface Event<T> {
126
- get detail():T;
127
- get type():string;
128
- }
129
- /**
130
- * Represents statistics for a given table column.
121
+ * Represents a server-side object that may not yet have been fetched by the client. When this object will no longer be
122
+ * used, if {@link fetch} is not called on this object, then {@link close} must be to ensure server-side resources
123
+ * are correctly freed.
131
124
  */
132
- export interface ColumnStatistics {
133
- /**
134
- * Gets the type of formatting that should be used for given statistic.
135
- * <p>
136
- * the format type for a statistic. A null return value means that the column formatting should be used.
137
- * @param name - the display name of the statistic
138
- * @return String
139
- */
140
- getType(name:string):string;
141
- /**
142
- * Gets a map with the name of each unique value as key and the count as the value. A map of each unique value's
143
- * name to the count of how many times it occurred in the column. This map will be empty for tables containing more
144
- * than 19 unique values.
145
- * @return Map of String double
146
- */
147
- get uniqueValues():Map<string, number>;
125
+ export interface WidgetExportedObject {
148
126
  /**
149
- * Gets a map with the display name of statistics as keys and the numeric stat as a value.
150
- * <p>
151
- * A map of each statistic's name to its value.
152
- * @return Map of String and Object
127
+ * Returns the type of this export, typically one of {@link dh.VariableType}, but may also include plugin types. If
128
+ * null, this object cannot be fetched, but can be passed to the server, such as via
129
+ * {@link Widget.sendMessage}.
130
+ * @return the string type of this server-side object, or null.
153
131
  */
154
- get statisticsMap():Map<string, object>;
155
- }
156
- export interface HasEventHandling {
132
+ readonly type?:string|null;
133
+
157
134
  /**
158
- * Listen for events on this object.
159
- * @param name - the name of the event to listen for
160
- * @param callback - a function to call when the event occurs
161
- * @return Returns a cleanup function.
162
- * @typeParam T - the type of the data that the event will provide
135
+ * Exports another copy of this reference, allowing it to be fetched separately. Results in rejection if the ticket
136
+ * was already closed (either by calling {@link WidgetExportedObject.close} or closing the object returned from {@link WidgetExportedObject.fetch}).
137
+ * @return a promise returning a reexported copy of this object, still referencing the same server-side object.
163
138
  */
164
- addEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):()=>void;
165
- nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<Event<T>>;
166
- hasListeners(name:string):boolean;
139
+ reexport():Promise<WidgetExportedObject>;
167
140
  /**
168
- * Removes an event listener added to this table.
169
- * @param name -
170
- * @param callback -
171
- * @return
172
- * @typeParam T -
141
+ * Returns a promise that will fetch the object represented by this reference. Multiple calls to this will return
142
+ * the same instance.
143
+ * @return a promise that will resolve to a client side object that represents the reference on the server.
173
144
  */
174
- removeEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):boolean;
175
- }
176
- export interface WorkerHeapInfo {
145
+ fetch():Promise<any>;
177
146
  /**
178
- * Total heap size available for this worker.
147
+ * Releases the server-side resources associated with this object, regardless of whether other client-side objects
148
+ * exist that also use that object. Should not be called after fetch() has been invoked.
179
149
  */
180
- get totalHeapSize():number;
181
- get freeMemory():number;
182
- get maximumHeapSize():number;
150
+ close():void;
183
151
  }
184
152
  /**
185
153
  * Row implementation that also provides additional read-only properties. represents visible rows in the table, but
@@ -209,36 +177,13 @@ export namespace dh {
209
177
  get index():LongWrapper;
210
178
  }
211
179
  /**
212
- * Represents the contents of a single widget data message from the server, with a binary data paylod and exported
213
- * objects. Implemented both by Widget itself and by the `event.details` when data is received by the client.
214
- *
215
- * Terminology note: the name of this type should probably use "Data" instead of "Message", and the methods should use
216
- * "payload" rather than "data" to match other platforms and the protobuf itself. These names are instead used for
217
- * backwards compatibility and to better follow JS expectations.
180
+ * Similar to the browser `CustomEvent` type, this class holds only the type of the event, and optionally some
181
+ * details about the event.
182
+ * @typeParam T - the type of the event detail
218
183
  */
219
- export interface WidgetMessageDetails {
220
- /**
221
- * Returns the data from this message as a base64-encoded string.
222
- */
223
- getDataAsBase64():string;
224
- /**
225
- * Returns the data from this message as a Uint8Array.
226
- */
227
- getDataAsU8():Uint8Array;
228
- /**
229
- * Returns the data from this message as a utf-8 string.
230
- */
231
- getDataAsString():string;
232
- /**
233
- * Returns an array of exported objects sent from the server. The plugin implementation is now responsible for these
234
- * objects, and should close them when no longer needed.
235
- */
236
- get exportedObjects():WidgetExportedObject[];
237
- }
238
- export interface ColumnGroup {
239
- get name():string|null;
240
- get children():string[]|null;
241
- get color():string|null;
184
+ export interface Event<T> {
185
+ get detail():T;
186
+ get type():string;
242
187
  }
243
188
  /**
244
189
  * This object may be pooled internally or discarded and not updated. Do not retain references to it.
@@ -302,108 +247,54 @@ export namespace dh {
302
247
  */
303
248
  get rows():Array<Row>;
304
249
  }
305
- export interface RefreshToken {
306
- get bytes():string;
307
- get expiry():number;
250
+ /**
251
+ * Represents a row available in a subscription/snapshot on the client. Do not retain references to rows - they will
252
+ * not function properly when the event isn't actively going off (or promise resolving). Instead, wait for the next
253
+ * event, or re-request the viewport data.
254
+ */
255
+ export interface Row {
256
+ get(column:Column):any;
257
+ getFormat(column:Column):Format;
258
+ get index():LongWrapper;
308
259
  }
309
260
  /**
310
- * Represents a table which can be joined to another table. Current implementations are {@link dh.Table} and
311
- * {@link dh.TotalsTable}.
261
+ * Wrap LocalTime values for use in JS. Provides text formatting for display and access to the underlying value.
312
262
  */
313
- export interface JoinableTable {
314
- freeze():Promise<Table>;
315
- snapshot(baseTable:Table, doInitialSnapshot?:boolean, stampColumns?:string[]):Promise<Table>;
263
+ export interface LocalTimeWrapper {
264
+ valueOf():string;
265
+ getHour():number;
266
+ getMinute():number;
267
+ getSecond():number;
268
+ getNano():number;
269
+ toString():string;
270
+ }
271
+ /**
272
+ * Wrap LocalDate values for use in JS. Provides text formatting for display and access to the underlying value.
273
+ */
274
+ export interface LocalDateWrapper {
275
+ valueOf():string;
276
+ getYear():number;
277
+ getMonthValue():number;
278
+ getDayOfMonth():number;
279
+ toString():string;
280
+ }
281
+ export interface WorkerHeapInfo {
316
282
  /**
317
- * Joins this table to the provided table, using one of the specified join types:
318
- * <ul>
319
- * <li><code>AJ</code>, <code>ReverseAJ</code> (or <code>RAJ</code>) - inexact timeseries joins, based on the
320
- * provided matching rule.</li>
321
- * <li><code>CROSS_JOIN</code> (or <code>Join</code>) - cross join of all rows that have matching values in both
322
- * tables.</li>
323
- * <li><code>EXACT_JOIN</code> (or <code>ExactJoin</code> - matches values in exactly one row in the right table,
324
- * with errors if there is not exactly one.</li>
325
- * <li><code>NATURAL_JOIN</code> (or <code>Natural</code> - matches values in at most one row in the right table,
326
- * with nulls if there is no match or errors if there are multiple matches.</li>
327
- * </ul>
328
- *
329
- * Note that <code>Left</code> join is not supported here, unlike DHE.
330
- * <p>
331
- * See the <a href="https://deephaven.io/core/docs/conceptual/choose-joins/">Choose a join method</a> document for
332
- * more guidance on picking a join operation.
333
- * @deprecated Instead, call the specific method for the join type.
334
- * @param joinType - The type of join to perform, see the list above.
335
- * @param rightTable - The table to match to values in this table
336
- * @param columnsToMatch - Columns that should match
337
- * @param columnsToAdd - Columns from the right table to add to the result - empty/null/absent to add all columns
338
- * @param asOfMatchRule - If joinType is AJ/RAJ/ReverseAJ, the match rule to use
339
- * @return a promise that will resolve to the joined table
283
+ * Total heap size available for this worker.
340
284
  */
341
- join(joinType:string, rightTable:JoinableTable, columnsToMatch:Array<string>, columnsToAdd?:Array<string>|undefined|null, asOfMatchRule?:string|undefined|null):Promise<Table>;
342
- /**
343
- * Performs an inexact timeseries join, where rows in this table will have columns added from the closest matching
344
- * row from the right table.
345
- * <p>
346
- * The `asOfMatchRule` value can be one of:
347
- * <ul>
348
- * <li>LESS_THAN_EQUAL</li>
349
- * <li>LESS_THAN</li>
350
- * <li>GREATER_THAN_EQUAL</li>
351
- * <li>GREATER_THAN</li>
352
- * </ul>
353
- * @param rightTable - the table to match to values in this table
354
- * @param columnsToMatch - the columns that should match, according to the asOfMatchRole
355
- * @param columnsToAdd - columns from the right table to add to the resulting table, empty/null/absent to add all
356
- * columns
357
- * @param asOfMatchRule - the match rule to use, see above
358
- * @return a promise that will resolve to the joined table
359
- */
360
- asOfJoin(rightTable:JoinableTable, columnsToMatch:Array<string>, columnsToAdd?:Array<string>|undefined|null, asOfMatchRule?:string|undefined|null):Promise<Table>;
361
- /**
362
- * a promise that will be resolved with the newly created table holding the results of the specified cross join
363
- * operation. The <b>columnsToAdd</b> parameter is optional, not specifying it will result in all columns from the
364
- * right table being added to the output. The <b>reserveBits</b> optional parameter lets the client control how the
365
- * key space is distributed between the rows in the two tables, see the Java <b>Table</b> class for details.
366
- * @param rightTable - the table to match to values in this table
367
- * @param columnsToMatch - the columns that should match exactly
368
- * @param columnsToAdd - columns from the right table to add to the resulting table, empty/null/absent to add all
369
- * columns
370
- * @param reserveBits - the number of bits of key-space to initially reserve per group, null/absent will let the
371
- * server select a value
372
- * @return a promise that will resolve to the joined table
373
- */
374
- crossJoin(rightTable:JoinableTable, columnsToMatch:Array<string>, columnsToAdd?:Array<string>|undefined|null, reserveBits?:number|undefined|null):Promise<Table>;
375
- /**
376
- * a promise that will be resolved with the newly created table holding the results of the specified exact join
377
- * operation. The `columnsToAdd` parameter is optional, not specifying it will result in all columns from the right
378
- * table being added to the output.
379
- * @param rightTable - the table to match to values in this table
380
- * @param columnsToMatch - the columns that should match exactly
381
- * @param columnsToAdd - columns from the right table to add to the resulting table, empty/null/absent to add all
382
- * columns
383
- * @return a promise that will resolve to the joined table
384
- */
385
- exactJoin(rightTable:JoinableTable, columnsToMatch:Array<string>, columnsToAdd?:Array<string>|undefined|null):Promise<Table>;
386
- /**
387
- * a promise that will be resolved with the newly created table holding the results of the specified natural join
388
- * operation. The <b>columnsToAdd</b> parameter is optional, not specifying it will result in all columns from the
389
- * right table being added to the output.
390
- * @param rightTable - the table to match to values in this table
391
- * @param columnsToMatch - the columns that should match exactly
392
- * @param columnsToAdd - columns from the right table to add to the resulting table, empty/null/absent to add all
393
- * columns
394
- * @return a promise that will resolve to the joined table
395
- */
396
- naturalJoin(rightTable:JoinableTable, columnsToMatch:Array<string>, columnsToAdd?:Array<string>|undefined|null):Promise<Table>;
397
- }
398
- /**
399
- * Similar to {@link dh.ViewportData}, but with additional properties to reflect
400
- * the tree structure.
401
- */
402
- export interface TreeViewportData extends TableData {
403
- get(index:LongWrapper|number):TreeRow;
404
- getData(index:LongWrapper|number, column:Column):any;
405
- getFormat(index:LongWrapper|number, column:Column):Format;
406
- get treeSize():number;
285
+ get totalHeapSize():number;
286
+ get freeMemory():number;
287
+ get maximumHeapSize():number;
288
+ }
289
+ /**
290
+ * Similar to {@link dh.ViewportData}, but with additional properties to reflect
291
+ * the tree structure.
292
+ */
293
+ export interface TreeViewportData extends TableData {
294
+ get(index:LongWrapper|number):TreeRow;
295
+ getData(index:LongWrapper|number, column:Column):any;
296
+ getFormat(index:LongWrapper|number, column:Column):Format;
297
+ get treeSize():number;
407
298
  /**
408
299
  * The position of the first returned row within the tree.
409
300
  */
@@ -411,58 +302,25 @@ export namespace dh {
411
302
  get columns():Array<Column>;
412
303
  get rows():Array<TreeRow>;
413
304
  }
414
- /**
415
- * Represents a server-side object that may not yet have been fetched by the client. When this object will no longer be
416
- * used, if {@link fetch} is not called on this object, then {@link close} must be to ensure server-side resources
417
- * are correctly freed.
418
- */
419
- export interface WidgetExportedObject {
420
- /**
421
- * Returns the type of this export, typically one of {@link dh.VariableType}, but may also include plugin types. If
422
- * null, this object cannot be fetched, but can be passed to the server, such as via
423
- * {@link Widget.sendMessage}.
424
- * @return the string type of this server-side object, or null.
425
- */
426
- readonly type?:string|null;
427
-
428
- /**
429
- * Exports another copy of this reference, allowing it to be fetched separately. Results in rejection if the ticket
430
- * was already closed (either by calling {@link WidgetExportedObject.close} or closing the object returned from {@link WidgetExportedObject.fetch}).
431
- * @return a promise returning a reexported copy of this object, still referencing the same server-side object.
432
- */
433
- reexport():Promise<WidgetExportedObject>;
305
+ export interface HasEventHandling {
434
306
  /**
435
- * Returns a promise that will fetch the object represented by this reference. Multiple calls to this will return
436
- * the same instance.
437
- * @return a promise that will resolve to a client side object that represents the reference on the server.
307
+ * Listen for events on this object.
308
+ * @param name - the name of the event to listen for
309
+ * @param callback - a function to call when the event occurs
310
+ * @return Returns a cleanup function.
311
+ * @typeParam T - the type of the data that the event will provide
438
312
  */
439
- fetch():Promise<any>;
313
+ addEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):()=>void;
314
+ nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<Event<T>>;
315
+ hasListeners(name:string):boolean;
440
316
  /**
441
- * Releases the server-side resources associated with this object, regardless of whether other client-side objects
442
- * exist that also use that object. Should not be called after fetch() has been invoked.
317
+ * Removes an event listener added to this table.
318
+ * @param name -
319
+ * @param callback -
320
+ * @return
321
+ * @typeParam T -
443
322
  */
444
- close():void;
445
- }
446
- export interface LayoutHints {
447
- readonly searchDisplayMode?:SearchDisplayModeType|null;
448
-
449
- get hiddenColumns():string[]|null;
450
- get frozenColumns():string[]|null;
451
- get columnGroups():ColumnGroup[]|null;
452
- get areSavedLayoutsAllowed():boolean;
453
- get frontColumns():string[]|null;
454
- get backColumns():string[]|null;
455
- }
456
- /**
457
- * Wrap LocalTime values for use in JS. Provides text formatting for display and access to the underlying value.
458
- */
459
- export interface LocalTimeWrapper {
460
- valueOf():string;
461
- getHour():number;
462
- getMinute():number;
463
- getSecond():number;
464
- getNano():number;
465
- toString():string;
323
+ removeEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):boolean;
466
324
  }
467
325
  /**
468
326
  * This object may be pooled internally or discarded and not updated. Do not retain references to it. Instead,
@@ -474,26 +332,6 @@ export namespace dh {
474
332
  get index():LongWrapper;
475
333
  }
476
334
  /**
477
- * Wrap LocalDate values for use in JS. Provides text formatting for display and access to the underlying value.
478
- */
479
- export interface LocalDateWrapper {
480
- valueOf():string;
481
- getYear():number;
482
- getMonthValue():number;
483
- getDayOfMonth():number;
484
- toString():string;
485
- }
486
- /**
487
- * Represents a row available in a subscription/snapshot on the client. Do not retain references to rows - they will
488
- * not function properly when the event isn't actively going off (or promise resolving). Instead, wait for the next
489
- * event, or re-request the viewport data.
490
- */
491
- export interface Row {
492
- get(column:Column):any;
493
- getFormat(column:Column):Format;
494
- get index():LongWrapper;
495
- }
496
- /**
497
335
  * Behaves like a Table, but doesn't expose all of its API for changing the internal state. Instead, state is driven by
498
336
  * the upstream table - when it changes handle, this listens and updates its own handle accordingly.
499
337
  *
@@ -658,6 +496,33 @@ export namespace dh {
658
496
  get rows():Array<Row>;
659
497
  }
660
498
  /**
499
+ * Represents the contents of a single widget data message from the server, with a binary data paylod and exported
500
+ * objects. Implemented both by Widget itself and by the `event.details` when data is received by the client.
501
+ *
502
+ * Terminology note: the name of this type should probably use "Data" instead of "Message", and the methods should use
503
+ * "payload" rather than "data" to match other platforms and the protobuf itself. These names are instead used for
504
+ * backwards compatibility and to better follow JS expectations.
505
+ */
506
+ export interface WidgetMessageDetails {
507
+ /**
508
+ * Returns the data from this message as a base64-encoded string.
509
+ */
510
+ getDataAsBase64():string;
511
+ /**
512
+ * Returns the data from this message as a Uint8Array.
513
+ */
514
+ getDataAsU8():Uint8Array;
515
+ /**
516
+ * Returns the data from this message as a utf-8 string.
517
+ */
518
+ getDataAsString():string;
519
+ /**
520
+ * Returns an array of exported objects sent from the server. The plugin implementation is now responsible for these
521
+ * objects, and should close them when no longer needed.
522
+ */
523
+ get exportedObjects():WidgetExportedObject[];
524
+ }
525
+ /**
661
526
  * Extends {@link dh.TableData}, but only contains data in the current viewport. The only API change from TableData is that
662
527
  * ViewportData also contains the offset to this data, so that the actual row number may be determined.
663
528
  * <p>
@@ -680,75 +545,149 @@ export namespace dh {
680
545
  get columns():Array<Column>;
681
546
  get rows():Array<ViewportRow>;
682
547
  }
683
-
684
548
  /**
685
- * This object serves as a "handle" to a subscription, allowing it to be acted on directly or canceled outright. If you
686
- * retain an instance of this, you have two choices - either only use it to call `close()` on it to stop the table's
687
- * viewport without creating a new one, or listen directly to this object instead of the table for data events, and
688
- * always call `close()` when finished. Calling any method on this object other than close() will result in it
689
- * continuing to live on after `setViewport` is called on the original table, or after the table is modified.
549
+ * Represents a table which can be joined to another table. Current implementations are {@link dh.Table} and
550
+ * {@link dh.TotalsTable}.
690
551
  */
691
- export class TableViewportSubscription implements HasEventHandling {
692
- protected constructor();
693
-
552
+ export interface JoinableTable {
553
+ freeze():Promise<Table>;
554
+ snapshot(baseTable:Table, doInitialSnapshot?:boolean, stampColumns?:string[]):Promise<Table>;
694
555
  /**
695
- * Changes the rows and columns set on this viewport. This cannot be used to change the update interval.
696
- * @param firstRow -
697
- * @param lastRow -
698
- * @param columns -
699
- * @param updateIntervalMs -
556
+ * Joins this table to the provided table, using one of the specified join types:
557
+ * <ul>
558
+ * <li><code>AJ</code>, <code>ReverseAJ</code> (or <code>RAJ</code>) - inexact timeseries joins, based on the
559
+ * provided matching rule.</li>
560
+ * <li><code>CROSS_JOIN</code> (or <code>Join</code>) - cross join of all rows that have matching values in both
561
+ * tables.</li>
562
+ * <li><code>EXACT_JOIN</code> (or <code>ExactJoin</code> - matches values in exactly one row in the right table,
563
+ * with errors if there is not exactly one.</li>
564
+ * <li><code>NATURAL_JOIN</code> (or <code>Natural</code> - matches values in at most one row in the right table,
565
+ * with nulls if there is no match or errors if there are multiple matches.</li>
566
+ * </ul>
567
+ *
568
+ * Note that <code>Left</code> join is not supported here, unlike DHE.
569
+ * <p>
570
+ * See the <a href="https://deephaven.io/core/docs/conceptual/choose-joins/">Choose a join method</a> document for
571
+ * more guidance on picking a join operation.
572
+ * @deprecated Instead, call the specific method for the join type.
573
+ * @param joinType - The type of join to perform, see the list above.
574
+ * @param rightTable - The table to match to values in this table
575
+ * @param columnsToMatch - Columns that should match
576
+ * @param columnsToAdd - Columns from the right table to add to the result - empty/null/absent to add all columns
577
+ * @param asOfMatchRule - If joinType is AJ/RAJ/ReverseAJ, the match rule to use
578
+ * @return a promise that will resolve to the joined table
700
579
  */
701
- setViewport(firstRow:number, lastRow:number, columns?:Column[]|undefined|null, updateIntervalMs?:number|undefined|null, isReverseViewport?:boolean|undefined|null):void;
580
+ join(joinType:string, rightTable:JoinableTable, columnsToMatch:Array<string>, columnsToAdd?:Array<string>|undefined|null, asOfMatchRule?:string|undefined|null):Promise<Table>;
702
581
  /**
703
- * Stops this viewport from running, stopping all events on itself and on the table that created it.
582
+ * Performs an inexact timeseries join, where rows in this table will have columns added from the closest matching
583
+ * row from the right table.
584
+ * <p>
585
+ * The `asOfMatchRule` value can be one of:
586
+ * <ul>
587
+ * <li>LESS_THAN_EQUAL</li>
588
+ * <li>LESS_THAN</li>
589
+ * <li>GREATER_THAN_EQUAL</li>
590
+ * <li>GREATER_THAN</li>
591
+ * </ul>
592
+ * @param rightTable - the table to match to values in this table
593
+ * @param columnsToMatch - the columns that should match, according to the asOfMatchRole
594
+ * @param columnsToAdd - columns from the right table to add to the resulting table, empty/null/absent to add all
595
+ * columns
596
+ * @param asOfMatchRule - the match rule to use, see above
597
+ * @return a promise that will resolve to the joined table
704
598
  */
705
- close():void;
599
+ asOfJoin(rightTable:JoinableTable, columnsToMatch:Array<string>, columnsToAdd?:Array<string>|undefined|null, asOfMatchRule?:string|undefined|null):Promise<Table>;
706
600
  /**
707
- * Gets the data currently visible in this viewport
708
- * @return Promise of {@link dh.TableData}.
601
+ * a promise that will be resolved with the newly created table holding the results of the specified cross join
602
+ * operation. The <b>columnsToAdd</b> parameter is optional, not specifying it will result in all columns from the
603
+ * right table being added to the output. The <b>reserveBits</b> optional parameter lets the client control how the
604
+ * key space is distributed between the rows in the two tables, see the Java <b>Table</b> class for details.
605
+ * @param rightTable - the table to match to values in this table
606
+ * @param columnsToMatch - the columns that should match exactly
607
+ * @param columnsToAdd - columns from the right table to add to the resulting table, empty/null/absent to add all
608
+ * columns
609
+ * @param reserveBits - the number of bits of key-space to initially reserve per group, null/absent will let the
610
+ * server select a value
611
+ * @return a promise that will resolve to the joined table
709
612
  */
710
- getViewportData():Promise<ViewportData>;
711
- snapshot(rows:RangeSet, columns:Column[]):Promise<TableData>;
613
+ crossJoin(rightTable:JoinableTable, columnsToMatch:Array<string>, columnsToAdd?:Array<string>|undefined|null, reserveBits?:number|undefined|null):Promise<Table>;
712
614
  /**
713
- * Listen for events on this object.
714
- * @param name - the name of the event to listen for
715
- * @param callback - a function to call when the event occurs
716
- * @return Returns a cleanup function.
717
- * @typeParam T - the type of the data that the event will provide
615
+ * a promise that will be resolved with the newly created table holding the results of the specified exact join
616
+ * operation. The `columnsToAdd` parameter is optional, not specifying it will result in all columns from the right
617
+ * table being added to the output.
618
+ * @param rightTable - the table to match to values in this table
619
+ * @param columnsToMatch - the columns that should match exactly
620
+ * @param columnsToAdd - columns from the right table to add to the resulting table, empty/null/absent to add all
621
+ * columns
622
+ * @return a promise that will resolve to the joined table
718
623
  */
719
- addEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):()=>void;
720
- nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<Event<T>>;
721
- hasListeners(name:string):boolean;
624
+ exactJoin(rightTable:JoinableTable, columnsToMatch:Array<string>, columnsToAdd?:Array<string>|undefined|null):Promise<Table>;
722
625
  /**
723
- * Removes an event listener added to this table.
724
- * @param name -
725
- * @param callback -
726
- * @return
727
- * @typeParam T -
626
+ * a promise that will be resolved with the newly created table holding the results of the specified natural join
627
+ * operation. The <b>columnsToAdd</b> parameter is optional, not specifying it will result in all columns from the
628
+ * right table being added to the output.
629
+ * @param rightTable - the table to match to values in this table
630
+ * @param columnsToMatch - the columns that should match exactly
631
+ * @param columnsToAdd - columns from the right table to add to the resulting table, empty/null/absent to add all
632
+ * columns
633
+ * @return a promise that will resolve to the joined table
728
634
  */
729
- removeEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):boolean;
635
+ naturalJoin(rightTable:JoinableTable, columnsToMatch:Array<string>, columnsToAdd?:Array<string>|undefined|null):Promise<Table>;
730
636
  }
731
-
732
637
  /**
733
- * Options for custom columns.
638
+ * Represents statistics for a given table column.
734
639
  */
735
- export class CustomColumnOptions {
640
+ export interface ColumnStatistics {
736
641
  /**
737
- * When specified for custom columns on a rollup table, specifies if the formula apply to rollup or constituent
738
- * nodes.
642
+ * Gets the type of formatting that should be used for given statistic.
643
+ * <p>
644
+ * the format type for a statistic. A null return value means that the column formatting should be used.
645
+ * @param name - the display name of the statistic
646
+ * @return String
739
647
  */
740
- rollupNodeType?:RollupNodeTypeType|null;
648
+ getType(name:string):string;
649
+ /**
650
+ * 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
651
+ * name to the count of how many times it occurred in the column. This map will be empty for tables containing more
652
+ * than 19 unique values.
653
+ * @return Map of String double
654
+ */
655
+ get uniqueValues():Map<string, number>;
656
+ /**
657
+ * Gets a map with the display name of statistics as keys and the numeric stat as a value.
658
+ * <p>
659
+ * A map of each statistic's name to its value.
660
+ * @return Map of String and Object
661
+ */
662
+ get statisticsMap():Map<string, object>;
663
+ }
664
+ export interface LayoutHints {
665
+ readonly searchDisplayMode?:SearchDisplayModeType|null;
741
666
 
742
- constructor();
667
+ get hiddenColumns():string[]|null;
668
+ get frozenColumns():string[]|null;
669
+ get columnGroups():ColumnGroup[]|null;
670
+ get areSavedLayoutsAllowed():boolean;
671
+ get frontColumns():string[]|null;
672
+ get backColumns():string[]|null;
673
+ }
674
+ export interface RefreshToken {
675
+ get bytes():string;
676
+ get expiry():number;
677
+ }
678
+ export interface ColumnGroup {
679
+ get name():string|null;
680
+ get children():string[]|null;
681
+ get color():string|null;
743
682
  }
744
683
 
745
684
  /**
746
- * Wrap BigInteger values for use in JS. Provides text formatting for display and access to the underlying value.
685
+ * Wrap BigDecimal values for use in JS. Provides text formatting for display and access to the underlying value.
747
686
  */
748
- export class BigIntegerWrapper {
687
+ export class BigDecimalWrapper {
749
688
  protected constructor();
750
689
 
751
- static ofString(str:string):BigIntegerWrapper;
690
+ static ofString(value:string):BigDecimalWrapper;
752
691
  asNumber():number;
753
692
  valueOf():string;
754
693
  toString():string;
@@ -757,115 +696,83 @@ export namespace dh {
757
696
  }
758
697
 
759
698
  /**
760
- * Describes how a Totals Table will be generated from its parent table. Each table has a default (which may be null)
761
- * indicating how that table was configured when it was declared, and each Totals Table has a similar property
762
- * describing how it was created. Both the <b>Table.getTotalsTable</b> and <b>Table.getGrandTotalsTable</b> methods take
763
- * this config as an optional parameter - without it, the table's default will be used, or if null, a default instance
764
- * of <b>TotalsTableConfig</b> will be supplied.
765
- *
766
- * This class has a no-arg constructor, allowing an instance to be made with the default values provided. However, any
767
- * JS object can be passed in to the methods which accept instances of this type, provided their values adhere to the
768
- * expected formats.
699
+ * Presently, this is the entrypoint into the Deephaven JS API. By creating an instance of this with the server URL and
700
+ * some options, JS applications can run code on the server, and interact with available exportable objects.
769
701
  */
770
- export class TotalsTableConfig {
771
- /**
772
- * @deprecated
773
- */
774
- static readonly COUNT:string;
775
- /**
776
- * @deprecated
777
- */
778
- static readonly MIN:string;
779
- /**
780
- * @deprecated
781
- */
782
- static readonly MAX:string;
783
- /**
784
- * @deprecated
785
- */
786
- static readonly SUM:string;
787
- /**
788
- * @deprecated
789
- */
790
- static readonly ABS_SUM:string;
791
- /**
792
- * @deprecated
793
- */
794
- static readonly VAR:string;
795
- /**
796
- * @deprecated
797
- */
798
- static readonly AVG:string;
799
- /**
800
- * @deprecated
801
- */
802
- static readonly STD:string;
803
- /**
804
- * @deprecated
805
- */
806
- static readonly FIRST:string;
807
- /**
808
- * @deprecated
809
- */
810
- static readonly LAST:string;
702
+ export class IdeConnection implements HasEventHandling {
811
703
  /**
812
704
  * @deprecated
813
705
  */
814
- static readonly SKIP:string;
815
- /**
816
- * Specifies if a Totals Table should be expanded by default in the UI. Defaults to false.
817
- */
818
- showTotalsByDefault:boolean;
706
+ static readonly HACK_CONNECTION_FAILURE:string;
707
+ static readonly EVENT_DISCONNECT:string;
708
+ static readonly EVENT_RECONNECT:string;
709
+ static readonly EVENT_SHUTDOWN:string;
710
+
711
+ protected constructor();
712
+
819
713
  /**
820
- * Specifies if a Grand Totals Table should be expanded by default in the UI. Defaults to false.
714
+ * Closes the current connection, releasing any resources on the server or client.
821
715
  */
822
- showGrandTotalsByDefault:boolean;
716
+ close():void;
717
+ running():Promise<IdeConnection>;
823
718
  /**
824
- * Specifies the default operation for columns that do not have a specific operation applied; defaults to "Sum".
719
+ * Load the named table, with columns and size information already fully populated.
720
+ * @param name - the name of the table to fetch
721
+ * @param applyPreviewColumns - false to disable previews, defaults to true
722
+ * @return a {@link Promise} that will resolve to the table, or reject with an error if it cannot be loaded.
723
+ * @deprecated Added to resolve a specific issue, in the future preview will be applied as part of the subscription.
825
724
  */
826
- defaultOperation:AggregationOperationType;
725
+ getTable(name:string, applyPreviewColumns?:boolean):Promise<Table>;
726
+ getObject(definitionObject:dh.ide.VariableDescriptor):Promise<any>;
727
+ subscribeToFieldUpdates(callback:(arg0:dh.ide.VariableChanges)=>void):()=>void;
827
728
  /**
828
- * Mapping from each column name to the aggregation(s) that should be applied to that column in the resulting Totals
829
- * Table. If a column is omitted, the defaultOperation is used.
729
+ * Makes an `object` available to another user or another client on this same server which knows the value of
730
+ * the `sharedTicketBytes`. Use that sharedTicketBytes value like a one-time use password - any other client
731
+ * which knows this value can read the same object.
732
+ * <p>
733
+ * Shared objects will remain available using the sharedTicketBytes until the client that first shared them
734
+ * releases/closes their copy of the object. Whatever side-channel is used to share the bytes, be sure to wait until
735
+ * the remote end has signaled that it has successfully fetched the object before releasing it from this client.
736
+ * <p>
737
+ * Be sure to use an unpredictable value for the shared ticket bytes, like a UUID or other large, random value to
738
+ * prevent access by unauthorized clients.
739
+ * @param object - the object to share with another client/user
740
+ * @param sharedTicketBytes - the value which another client/user must know to obtain the object. It may be a unicode
741
+ * string (will be encoded as utf8 bytes), or a {@link Uint8Array} value.
742
+ * @return A promise that will resolve to the value passed as sharedTicketBytes when the object is ready to be read
743
+ * by another client, or will reject if an error occurs.
830
744
  */
831
- operationMap:{ [key: string]: Array<AggregationOperationType>; };
745
+ shareObject(object:Table|Widget|WidgetExportedObject|PartitionedTable|TotalsTable|TreeTable, sharedTicketBytes:string|Uint8Array):Promise<string|Uint8Array>;
832
746
  /**
833
- * Groupings to use when generating the Totals Table. One row will exist for each unique set of values observed in
834
- * these columns. See also `Table.selectDistinct`.
747
+ * Reads an object shared by another client to this server with the `sharedTicketBytes`. Until the other
748
+ * client releases this object (or their session ends), the object will be available on the server.
749
+ * <p>
750
+ * The type of the object must be passed so that the object can be read from the server correct - the other client
751
+ * should provide this information.
752
+ * @param sharedTicketBytes - the value provided by another client/user to obtain the object. It may be a unicode
753
+ * string (will be encoded as utf8 bytes), or a {@link Uint8Array} value.
754
+ * @param type - The type of the object, so it can be correctly read from the server
755
+ * @return A promise that will resolve to the shared object, or will reject with an error if it cannot be read.
835
756
  */
836
- groupBy:Array<string>;
837
-
838
- constructor();
839
-
840
- toString():string;
841
- }
842
-
843
- /**
844
- * Represents a non-viewport subscription to a table, and all data currently known to be present in the subscribed
845
- * columns. This class handles incoming snapshots and deltas, and fires events to consumers to notify of data changes.
846
- *
847
- * Unlike {@link dh.TableViewportSubscription}, the "original" table does not have a reference to this instance, only the
848
- * "private" table instance does, since the original cannot modify the subscription, and the private instance must
849
- * forward data to it.
850
- *
851
- * Represents a subscription to the table on the server. Changes made to the table will not be reflected here - the
852
- * subscription must be closed and a new one optioned to see those changes. The event model is slightly different from
853
- * viewports to make it less expensive to compute for large tables.
854
- */
855
- export class TableSubscription implements HasEventHandling {
856
- protected constructor();
857
-
757
+ getSharedObject(sharedTicketBytes:string|Uint8Array, type:string):Promise<any>;
758
+ newTable(columnNames:string[], types:string[], data:string[][], userTimeZone:string):Promise<Table>;
858
759
  /**
859
- * Updates the subscription to use the given columns and update interval.
860
- * @param columns - the new columns to subscribe to
861
- * @param updateIntervalMs - the new update interval, or null/omit to use the default of one second
760
+ * Merges the given tables into a single table. Assumes all tables have the same structure.
761
+ * @param tables -
762
+ * @return {@link Promise} of {@link dh.Table}
862
763
  */
863
- changeSubscription(columns:Array<Column>, updateIntervalMs:number|undefined|null):void;
864
- get columns():Array<Column>;
764
+ mergeTables(tables:Table[]):Promise<Table>;
865
765
  /**
866
- * Stops the subscription on the server.
766
+ * Register a callback function to handle any log messages that are emitted on the server. Returns a function ,
767
+ * which can be invoked to remove this log handler. Any log handler registered in this way will receive as many old
768
+ * log messages as are presently available.
769
+ * @param callback -
770
+ * @return {@link io.deephaven.web.shared.fu.JsRunnable}
867
771
  */
868
- close():void;
772
+ onLogMessage(callback:(arg0:dh.ide.LogItem)=>void):()=>void;
773
+ startSession(type:string):Promise<IdeSession>;
774
+ getConsoleTypes():Promise<Array<string>>;
775
+ getWorkerHeapInfo():Promise<WorkerHeapInfo>;
869
776
  /**
870
777
  * Listen for events on this object.
871
778
  * @param name - the name of the event to listen for
@@ -886,316 +793,403 @@ export namespace dh {
886
793
  removeEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):boolean;
887
794
  }
888
795
 
889
- export class CoreClient implements HasEventHandling {
890
- static readonly EVENT_CONNECT:string;
891
- static readonly EVENT_DISCONNECT:string;
892
- static readonly EVENT_RECONNECT:string;
893
- static readonly EVENT_RECONNECT_AUTH_FAILED:string;
894
- static readonly EVENT_REQUEST_FAILED:string;
895
- static readonly EVENT_REQUEST_STARTED:string;
896
- static readonly EVENT_REQUEST_SUCCEEDED:string;
897
- /**
898
- * @deprecated
899
- */
900
- static readonly EVENT_REFRESH_TOKEN_UPDATED:string;
901
- static readonly LOGIN_TYPE_PASSWORD:string;
902
- static readonly LOGIN_TYPE_ANONYMOUS:string;
796
+ /**
797
+ * Describes a Sort present on the table. No visible constructor, created through the use of Column.sort(), will be tied
798
+ * to that particular column data. Sort instances are immutable, and use a builder pattern to make modifications. All
799
+ * methods return a new Sort instance.
800
+ */
801
+ export class Sort {
802
+ static readonly ASCENDING:string;
803
+ static readonly DESCENDING:string;
804
+ static readonly REVERSE:string;
903
805
 
904
- constructor(serverUrl:string, connectOptions?:ConnectOptions);
806
+ protected constructor();
905
807
 
906
- running():Promise<CoreClient>;
907
- getServerUrl():string;
908
- getAuthConfigValues():Promise<string[][]>;
909
- login(credentials:LoginCredentials):Promise<void>;
910
- relogin(token:RefreshToken):Promise<void>;
911
- onConnected(timeoutInMillis?:number):Promise<void>;
912
- getServerConfigValues():Promise<string[][]>;
913
- getStorageService():dh.storage.StorageService;
914
- getAsIdeConnection():Promise<IdeConnection>;
915
- disconnect():void;
916
- addEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):()=>void;
917
- nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<Event<T>>;
918
- hasListeners(name:string):boolean;
919
- removeEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):boolean;
920
- }
921
-
922
- /**
923
- * Describes the structure of the column, and if desired can be used to get access to the data to be rendered in this
924
- * column.
925
- */
926
- export class Column {
927
- /**
928
- * If this column is part of a roll-up tree table, represents the type of the row data that can be found in this
929
- * column for leaf nodes if includeConstituents is enabled. Otherwise, it is <b>null</b>.
930
- * @return String
931
- */
932
- readonly constituentType?:string|null;
933
- readonly description?:string|null;
934
-
935
- protected constructor();
936
-
937
- /**
938
- * the value for this column in the given row. Type will be consistent with the type of the Column.
939
- * @param row -
940
- * @return Any
941
- */
942
- get(row:Row):any;
943
- getFormat(row:Row):Format;
944
808
  /**
945
- * Creates a sort builder object, to be used when sorting by this column.
809
+ * Builds a Sort instance to sort values in ascending order.
946
810
  * @return {@link dh.Sort}
947
811
  */
948
- sort():Sort;
812
+ asc():Sort;
949
813
  /**
950
- * Creates a new value for use in filters based on this column. Used either as a parameter to another filter
951
- * operation, or as a builder to create a filter operation.
952
- * @return {@link dh.FilterValue}
814
+ * Builds a Sort instance to sort values in descending order.
815
+ * @return {@link dh.Sort}
953
816
  */
954
- filter():FilterValue;
817
+ desc():Sort;
955
818
  /**
956
- * a <b>CustomColumn</b> object to apply using `applyCustomColumns` with the expression specified.
957
- * @param expression -
958
- * @return {@link dh.CustomColumn}
819
+ * Builds a Sort instance which takes the absolute value before applying order.
820
+ * @return {@link dh.Sort}
959
821
  */
960
- formatColor(expression:string, options?:CustomColumnOptions|undefined|null):CustomColumn;
822
+ abs():Sort;
823
+ toString():string;
961
824
  /**
962
- * a <b>CustomColumn</b> object to apply using <b>applyCustomColumns</b> with the expression specified.
963
- * @param expression -
964
- * @return {@link dh.CustomColumn}
825
+ * True if the absolute value of the column should be used when sorting; defaults to false.
826
+ * @return boolean
965
827
  */
966
- formatNumber(expression:string, options?:CustomColumnOptions|undefined|null):CustomColumn;
828
+ get isAbs():boolean;
967
829
  /**
968
- * a <b>CustomColumn</b> object to apply using <b>applyCustomColumns</b> with the expression specified.
969
- * @param expression -
970
- * @return {@link dh.CustomColumn}
830
+ * The column which is sorted.
831
+ * @return {@link dh.Column}
971
832
  */
972
- formatDate(expression:string, options?:CustomColumnOptions|undefined|null):CustomColumn;
973
- toString():string;
833
+ get column():Column;
974
834
  /**
975
- * Label for this column.
835
+ * The direction of this sort, either <b>ASC</b>, <b>DESC</b>, or <b>REVERSE</b>.
976
836
  * @return String
977
837
  */
978
- get name():string;
838
+ get direction():string;
839
+ }
840
+
841
+ /**
842
+ * Provides access to data in a table. Note that several methods present their response through Promises. This allows
843
+ * the client to both avoid actually connecting to the server until necessary, and also will permit some changes not to
844
+ * inform the UI right away that they have taken place.
845
+ */
846
+ export class Table implements JoinableTable, HasEventHandling {
847
+ readonly description?:string|null;
848
+ readonly pluginName?:string|null;
849
+ readonly layoutHints?:null|LayoutHints;
979
850
  /**
980
- * True if this column is a partition column. Partition columns are used for filtering uncoalesced tables - see
981
- * {@link Table.uncoalesced}.
982
- * @return true if the column is a partition column
851
+ * The table size has updated, so live scrollbars and the like can be updated accordingly.
983
852
  */
984
- get isPartitionColumn():boolean;
853
+ static readonly EVENT_SIZECHANGED:string;
985
854
  /**
986
- *
987
- * @deprecated do not use. Internal index of the column in the table, to be used as a key on the Row.
988
- * @return int
855
+ * The table size has updated, so live scrollbars and the like can be updated accordingly.
989
856
  */
990
- get index():number;
991
- get isSortable():boolean;
857
+ static readonly EVENT_UPDATED:string;
992
858
  /**
993
- * Type of the row data that can be found in this column.
994
- * @return String
859
+ * The table size has updated, so live scrollbars and the like can be updated accordingly.
995
860
  */
996
- get type():string;
861
+ static readonly EVENT_ROWADDED:string;
997
862
  /**
998
- * Format entire rows colors using the expression specified. Returns a <b>CustomColumn</b> object to apply to a
999
- * table using <b>applyCustomColumns</b> with the parameters specified.
1000
- * @param expression -
1001
- * @param options -
1002
- * @return {@link dh.CustomColumn}
863
+ * The table size has updated, so live scrollbars and the like can be updated accordingly.
1003
864
  */
1004
- static formatRowColor(expression:string, options?:CustomColumnOptions|undefined|null):CustomColumn;
865
+ static readonly EVENT_ROWREMOVED:string;
1005
866
  /**
1006
- * a <b>CustomColumn</b> object to apply using <b>applyCustomColumns</b> with the expression specified.
1007
- * @param name -
1008
- * @param expression -
1009
- * @param options -
1010
- * @return {@link dh.CustomColumn}
867
+ * The table size has updated, so live scrollbars and the like can be updated accordingly.
1011
868
  */
1012
- static createCustomColumn(name:string, expression:string, options?:CustomColumnOptions|undefined|null):CustomColumn;
1013
- }
1014
-
1015
- /**
1016
- * Exists to keep the dh.TableMap namespace so that the web UI can remain compatible with the DHE API, which still calls
1017
- * this type TableMap.
1018
- * @deprecated
1019
- */
1020
- export class TableMap {
1021
- static readonly EVENT_KEYADDED:string;
1022
- static readonly EVENT_DISCONNECT:string;
1023
- static readonly EVENT_RECONNECT:string;
1024
- static readonly EVENT_RECONNECTFAILED:string;
1025
-
1026
- protected constructor();
1027
- }
1028
-
1029
- /**
1030
- * Describes data that can be filtered, either a column reference or a literal value. Used this way, the type of a value
1031
- * can be specified so that values which are ambiguous or not well supported in JS will not be confused with Strings or
1032
- * imprecise numbers (e.g., nanosecond-precision date values). Additionally, once wrapped in this way, methods can be
1033
- * called on these value literal instances. These instances are immutable - any method called on them returns a new
1034
- * instance.
1035
- */
1036
- export class FilterValue {
1037
- protected constructor();
1038
-
869
+ static readonly EVENT_ROWUPDATED:string;
1039
870
  /**
1040
- * Constructs a number for the filter API from the given parameter. Can also be used on the values returned from
1041
- * {@link TableData.get} for DateTime values. To create
1042
- * a filter with a date, use <b>dh.DateWrapper.ofJsDate</b> or
1043
- * {@link i18n.DateTimeFormat.parse}. To create a filter with a
1044
- * 64-bit long integer, use {@link LongWrapper.ofString}.
1045
- * @param input - the number to wrap as a FilterValue
1046
- * @return an immutable FilterValue that can be built into a filter
871
+ * The table size has updated, so live scrollbars and the like can be updated accordingly.
1047
872
  */
1048
- static ofNumber(input:LongWrapper|number):FilterValue;
873
+ static readonly EVENT_SORTCHANGED:string;
1049
874
  /**
1050
- * a filter condition checking if the current value is equal to the given parameter
1051
- * @param term -
1052
- * @return {@link dh.FilterCondition}
875
+ * The table size has updated, so live scrollbars and the like can be updated accordingly.
1053
876
  */
1054
- eq(term:FilterValue):FilterCondition;
877
+ static readonly EVENT_FILTERCHANGED:string;
1055
878
  /**
1056
- * a filter condition checking if the current value is equal to the given parameter, ignoring differences of upper
1057
- * vs lower case
1058
- * @param term -
1059
- * @return {@link dh.FilterCondition}
879
+ * The table size has updated, so live scrollbars and the like can be updated accordingly.
1060
880
  */
1061
- eqIgnoreCase(term:FilterValue):FilterCondition;
881
+ static readonly EVENT_CUSTOMCOLUMNSCHANGED:string;
1062
882
  /**
1063
- * a filter condition checking if the current value is not equal to the given parameter
1064
- * @param term -
1065
- * @return {@link dh.FilterCondition}
883
+ * The table size has updated, so live scrollbars and the like can be updated accordingly.
1066
884
  */
1067
- notEq(term:FilterValue):FilterCondition;
885
+ static readonly EVENT_DISCONNECT:string;
1068
886
  /**
1069
- * a filter condition checking if the current value is not equal to the given parameter, ignoring differences of
1070
- * upper vs lower case
1071
- * @param term -
1072
- * @return {@link dh.FilterCondition}
887
+ * The table size has updated, so live scrollbars and the like can be updated accordingly.
1073
888
  */
1074
- notEqIgnoreCase(term:FilterValue):FilterCondition;
889
+ static readonly EVENT_RECONNECT:string;
1075
890
  /**
1076
- * a filter condition checking if the current value is greater than the given parameter
1077
- * @param term -
1078
- * @return {@link dh.FilterCondition}
891
+ * The table size has updated, so live scrollbars and the like can be updated accordingly.
1079
892
  */
1080
- greaterThan(term:FilterValue):FilterCondition;
893
+ static readonly EVENT_RECONNECTFAILED:string;
1081
894
  /**
1082
- * a filter condition checking if the current value is less than the given parameter
1083
- * @param term -
1084
- * @return {@link dh.FilterCondition}
895
+ * The table size has updated, so live scrollbars and the like can be updated accordingly.
1085
896
  */
1086
- lessThan(term:FilterValue):FilterCondition;
897
+ static readonly EVENT_REQUEST_FAILED:string;
1087
898
  /**
1088
- * a filter condition checking if the current value is greater than or equal to the given parameter
1089
- * @param term -
1090
- * @return {@link dh.FilterCondition}
899
+ * The table size has updated, so live scrollbars and the like can be updated accordingly.
1091
900
  */
1092
- greaterThanOrEqualTo(term:FilterValue):FilterCondition;
901
+ static readonly EVENT_REQUEST_SUCCEEDED:string;
1093
902
  /**
1094
- * a filter condition checking if the current value is less than or equal to the given parameter
1095
- * @param term -
1096
- * @return {@link dh.FilterCondition}
903
+ * The size the table will have if it is uncoalesced.
1097
904
  */
1098
- lessThanOrEqualTo(term:FilterValue):FilterCondition;
905
+ static readonly SIZE_UNCOALESCED:number;
906
+
907
+ protected constructor();
908
+
909
+ batch(userCode:(arg0:unknown)=>void):Promise<Table>;
1099
910
  /**
1100
- * a filter condition checking if the current value is in the given set of values
1101
- * @param terms -
1102
- * @return {@link dh.FilterCondition}
911
+ * Retrieve a column by the given name. You should prefer to always retrieve a new Column instance instead of
912
+ * caching a returned value.
913
+ * @param key -
914
+ * @return {@link dh.Column}
1103
915
  */
1104
- in(terms:FilterValue[]):FilterCondition;
916
+ findColumn(key:string):Column;
1105
917
  /**
1106
- * a filter condition checking if the current value is in the given set of values, ignoring differences of upper vs
1107
- * lower case
1108
- * @param terms -
1109
- * @return {@link dh.FilterCondition}
918
+ * Retrieve multiple columns specified by the given names.
919
+ * @param keys -
920
+ * @return {@link dh.Column} array
1110
921
  */
1111
- inIgnoreCase(terms:FilterValue[]):FilterCondition;
922
+ findColumns(keys:string[]):Column[];
923
+ isBlinkTable():boolean;
1112
924
  /**
1113
- * a filter condition checking that the current value is not in the given set of values
1114
- * @param terms -
1115
- * @return {@link dh.FilterCondition}
925
+ * If .hasInputTable is true, you may call this method to gain access to an InputTable object which can be used to
926
+ * mutate the data within the table. If the table is not an Input Table, the promise will be immediately rejected.
927
+ * @return Promise of dh.InputTable
1116
928
  */
1117
- notIn(terms:FilterValue[]):FilterCondition;
929
+ inputTable():Promise<InputTable>;
1118
930
  /**
1119
- * a filter condition checking that the current value is not in the given set of values, ignoring differences of
1120
- * upper vs lower case
1121
- * @param terms -
1122
- * @return {@link dh.FilterCondition}
931
+ * Indicates that this Table instance will no longer be used, and its connection to the server can be cleaned up.
1123
932
  */
1124
- notInIgnoreCase(terms:FilterValue[]):FilterCondition;
933
+ close():void;
934
+ getAttributes():string[];
1125
935
  /**
1126
- * a filter condition checking if the given value contains the given string value
1127
- * @param term -
1128
- * @return {@link dh.FilterCondition}
936
+ * null if no property exists, a string if it is an easily serializable property, or a ```Promise
937
+ * &lt;Table&gt;``` that will either resolve with a table or error out if the object can't be passed to JS.
938
+ * @param attributeName -
939
+ * @return Object
1129
940
  */
1130
- contains(term:FilterValue):FilterCondition;
941
+ getAttribute(attributeName:string):unknown|undefined|null;
1131
942
  /**
1132
- * a filter condition checking if the given value contains the given string value, ignoring differences of upper vs
1133
- * lower case
1134
- * @param term -
1135
- * @return {@link dh.FilterCondition}
943
+ * Replace the currently set sort on this table. Returns the previously set value. Note that the sort property will
944
+ * immediately return the new value, but you may receive update events using the old sort before the new sort is
945
+ * applied, and the <b>sortchanged</b> event fires. Reusing existing, applied sorts may enable this to perform
946
+ * better on the server. The <b>updated</b> event will also fire, but <b>rowadded</b> and <b>rowremoved</b> will
947
+ * not.
948
+ * @param sort -
949
+ * @return {@link dh.Sort} array
1136
950
  */
1137
- containsIgnoreCase(term:FilterValue):FilterCondition;
951
+ applySort(sort:Sort[]):Array<Sort>;
1138
952
  /**
1139
- * a filter condition checking if the given value matches the provided regular expressions string. Regex patterns
1140
- * use Java regex syntax
1141
- * @param pattern -
1142
- * @return {@link dh.FilterCondition}
953
+ * Replace the currently set filters on the table. Returns the previously set value. Note that the filter property
954
+ * will immediately return the new value, but you may receive update events using the old filter before the new one
955
+ * is applied, and the <b>filterchanged</b> event fires. Reusing existing, applied filters may enable this to
956
+ * perform better on the server. The <b>updated</b> event will also fire, but <b>rowadded</b> and <b>rowremoved</b>
957
+ * will not.
958
+ * @param filter -
959
+ * @return {@link dh.FilterCondition} array
1143
960
  */
1144
- matches(pattern:FilterValue):FilterCondition;
961
+ applyFilter(filter:FilterCondition[]):Array<FilterCondition>;
1145
962
  /**
1146
- * a filter condition checking if the given value matches the provided regular expressions string, ignoring
1147
- * differences of upper vs lower case. Regex patterns use Java regex syntax
1148
- * @param pattern -
1149
- * @return {@link dh.FilterCondition}
963
+ * used when adding new filter and sort operations to the table, as long as they are present.
964
+ * @param customColumns -
965
+ * @return {@link dh.CustomColumn} array
1150
966
  */
1151
- matchesIgnoreCase(pattern:FilterValue):FilterCondition;
967
+ applyCustomColumns(customColumns:Array<string|CustomColumn>):Array<CustomColumn>;
1152
968
  /**
1153
- * a filter condition checking if the current value is a true boolean
1154
- * @return {@link dh.FilterCondition}
969
+ * If the columns parameter is not provided, all columns will be used. If the updateIntervalMs parameter is not
970
+ * provided, a default of one second will be used. Until this is called, no data will be available. Invoking this
971
+ * will result in events to be fired once data becomes available, starting with an `updated` event and a
972
+ * <b>rowadded</b> event per row in that range. The returned object allows the viewport to be closed when no longer
973
+ * needed.
974
+ * @param firstRow -
975
+ * @param lastRow -
976
+ * @param columns -
977
+ * @param updateIntervalMs -
978
+ * @return {@link dh.TableViewportSubscription}
1155
979
  */
1156
- isTrue():FilterCondition;
980
+ setViewport(firstRow:number, lastRow:number, columns?:Array<Column>|undefined|null, updateIntervalMs?:number|undefined|null, isReverseViewport?:boolean|undefined|null):TableViewportSubscription;
1157
981
  /**
1158
- * a filter condition checking if the current value is a false boolean
1159
- * @return {@link dh.FilterCondition}
982
+ * Gets the currently visible viewport. If the current set of operations has not yet resulted in data, it will not
983
+ * resolve until that data is ready. If this table is closed before the promise resolves, it will be rejected - to
984
+ * separate the lifespan of this promise from the table itself, call
985
+ * {@link TableViewportSubscription.getViewportData} on the result from {@link Table.setViewport}.
986
+ * @return Promise of {@link dh.TableData}
1160
987
  */
1161
- isFalse():FilterCondition;
988
+ getViewportData():Promise<ViewportData>;
1162
989
  /**
1163
- * a filter condition checking if the current value is a null value
1164
- * @return {@link dh.FilterCondition}
990
+ * Creates a subscription to the specified columns, across all rows in the table. The optional parameter
991
+ * updateIntervalMs may be specified to indicate how often the server should send updates, defaulting to one second
992
+ * if omitted. Useful for charts or taking a snapshot of the table atomically. The initial snapshot will arrive in a
993
+ * single event, but later changes will be sent as updates. However, this may still be very expensive to run from a
994
+ * browser for very large tables. Each call to subscribe creates a new subscription, which must have <b>close()</b>
995
+ * called on it to stop it, and all events are fired from the TableSubscription instance.
996
+ * @param columns -
997
+ * @param updateIntervalMs -
998
+ * @return {@link dh.TableSubscription}
1165
999
  */
1166
- isNull():FilterCondition;
1000
+ subscribe(columns:Array<Column>, updateIntervalMs?:number):TableSubscription;
1167
1001
  /**
1168
- * a filter condition invoking the given method on the current value, with the given parameters. Currently supported
1169
- * functions that can be invoked on a String:
1170
- * <ul>
1171
- * <li><b>startsWith</b>: Returns true if the current string value starts with the supplied string argument</li>
1172
- * <li><b>endsWith</b>: Returns true if the current string value ends with the supplied string argument</li>
1173
- * <li><b>matches</b>: Returns true if the current string value matches the supplied string argument used as a Java
1174
- * regular expression</li>
1175
- * <li><b>contains</b>: Returns true if the current string value contains the supplied string argument
1176
- * <p>
1177
- * When invoking against a constant, this should be avoided in favor of FilterValue.contains
1178
- * </p>
1179
- * </li>
1180
- * </ul>
1181
- * @param method -
1182
- * @param args -
1183
- * @return
1002
+ * a new table containing the distinct tuples of values from the given columns that are present in the original
1003
+ * table. This table can be manipulated as any other table. Sorting is often desired as the default sort is the
1004
+ * order of appearance of values from the original table.
1005
+ * @param columns -
1006
+ * @return Promise of dh.Table
1184
1007
  */
1185
- invoke(method:string, ...args:FilterValue[]):FilterCondition;
1008
+ selectDistinct(columns:Column[]):Promise<Table>;
1009
+ /**
1010
+ * Creates a new copy of this table, so it can be sorted and filtered separately, and maintain a different viewport.
1011
+ * @return Promise of dh.Table
1012
+ */
1013
+ copy():Promise<Table>;
1014
+ /**
1015
+ * a promise that will resolve to a Totals Table of this table. This table will obey the configurations provided as
1016
+ * a parameter, or will use the table's default if no parameter is provided, and be updated once per second as
1017
+ * necessary. Note that multiple calls to this method will each produce a new TotalsTable which must have close()
1018
+ * called on it when not in use.
1019
+ * @param config -
1020
+ * @return Promise of dh.TotalsTable
1021
+ */
1022
+ getTotalsTable(config?:TotalsTableConfig|undefined|null):Promise<TotalsTable>;
1023
+ /**
1024
+ * a promise that will resolve to a Totals Table of this table, ignoring any filters. See <b>getTotalsTable()</b>
1025
+ * above for more specifics.
1026
+ * @param config -
1027
+ * @return promise of dh.TotalsTable
1028
+ */
1029
+ getGrandTotalsTable(config?:TotalsTableConfig|undefined|null):Promise<TotalsTable>;
1030
+ /**
1031
+ * a promise that will resolve to a new roll-up <b>TreeTable</b> of this table. Multiple calls to this method will
1032
+ * each produce a new <b>TreeTable</b> which must have close() called on it when not in use.
1033
+ * @param configObject -
1034
+ * @return Promise of dh.TreeTable
1035
+ */
1036
+ rollup(configObject:RollupConfig):Promise<TreeTable>;
1037
+ /**
1038
+ * a promise that will resolve to a new `TreeTable` of this table. Multiple calls to this method will each produce a
1039
+ * new `TreeTable` which must have close() called on it when not in use.
1040
+ * @param configObject -
1041
+ * @return Promise dh.TreeTable
1042
+ */
1043
+ treeTable(configObject:TreeTableConfig):Promise<TreeTable>;
1044
+ /**
1045
+ * a "frozen" version of this table (a server-side snapshot of the entire source table). Viewports on the frozen
1046
+ * table will not update. This does not change the original table, and the new table will not have any of the client
1047
+ * side sorts/filters/columns. New client side sorts/filters/columns can be added to the frozen copy.
1048
+ * @return Promise of dh.Table
1049
+ */
1050
+ freeze():Promise<Table>;
1051
+ snapshot(baseTable:Table, doInitialSnapshot?:boolean, stampColumns?:string[]):Promise<Table>;
1052
+ /**
1053
+ *
1054
+ * @inheritDoc
1055
+ * @deprecated
1056
+ */
1057
+ join(joinType:string, rightTable:JoinableTable, columnsToMatch:Array<string>, columnsToAdd?:Array<string>|undefined|null, asOfMatchRule?:string|undefined|null):Promise<Table>;
1058
+ asOfJoin(rightTable:JoinableTable, columnsToMatch:Array<string>, columnsToAdd?:Array<string>|undefined|null, asOfMatchRule?:string|undefined|null):Promise<Table>;
1059
+ crossJoin(rightTable:JoinableTable, columnsToMatch:Array<string>, columnsToAdd?:Array<string>|undefined|null, reserveBits?:number|undefined|null):Promise<Table>;
1060
+ exactJoin(rightTable:JoinableTable, columnsToMatch:Array<string>, columnsToAdd?:Array<string>):Promise<Table>;
1061
+ naturalJoin(rightTable:JoinableTable, columnsToMatch:Array<string>, columnsToAdd?:Array<string>):Promise<Table>;
1062
+ byExternal(keys:object, dropKeys?:boolean):Promise<PartitionedTable>;
1063
+ /**
1064
+ * Creates a new PartitionedTable from the contents of the current table, partitioning data based on the specified
1065
+ * keys.
1066
+ * @param keys -
1067
+ * @param dropKeys -
1068
+ * @return Promise dh.PartitionedTable
1069
+ */
1070
+ partitionBy(keys:object, dropKeys?:boolean):Promise<PartitionedTable>;
1071
+ /**
1072
+ * a promise that will resolve to ColumnStatistics for the column of this table.
1073
+ * @param column -
1074
+ * @return Promise of dh.ColumnStatistics
1075
+ */
1076
+ getColumnStatistics(column:Column):Promise<ColumnStatistics>;
1077
+ /**
1078
+ * Seek the row matching the data provided
1079
+ * @param startingRow - Row to start the seek from
1080
+ * @param column - Column to seek for value on
1081
+ * @param valueType - Type of value provided
1082
+ * @param seekValue - Value to seek
1083
+ * @param insensitive - Optional value to flag a search as case-insensitive. Defaults to `false`.
1084
+ * @param contains - Optional value to have the seek value do a contains search instead of exact equality. Defaults to
1085
+ * `false`.
1086
+ * @param isBackwards - Optional value to seek backwards through the table instead of forwards. Defaults to `false`.
1087
+ * @return A promise that resolves to the row value found.
1088
+ */
1089
+ seekRow(startingRow:number, column:Column, valueType:ValueTypeType, seekValue:any, insensitive?:boolean|undefined|null, contains?:boolean|undefined|null, isBackwards?:boolean|undefined|null):Promise<number>;
1186
1090
  toString():string;
1187
1091
  /**
1188
- * Constructs a string for the filter API from the given parameter.
1189
- * @param input -
1190
- * @return
1092
+ * True if this table represents a user Input Table (created by InputTable.newInputTable). When true, you may call
1093
+ * .inputTable() to add or remove data from the underlying table.
1094
+ * @return boolean
1191
1095
  */
1192
- static ofString(input:any):FilterValue;
1096
+ get hasInputTable():boolean;
1193
1097
  /**
1194
- * Constructs a boolean for the filter API from the given parameter.
1195
- * @param b -
1098
+ * The columns that are present on this table. This is always all possible columns. If you specify fewer columns in
1099
+ * .setViewport(), you will get only those columns in your ViewportData. <b>Number size</b> The total count of rows
1100
+ * in the table. The size can and will change; see the <b>sizechanged</b> event for details. Size will be negative
1101
+ * in exceptional cases (eg. the table is uncoalesced, see the <b>isUncoalesced</b> property for details).
1102
+ * @return {@link dh.Column} array
1103
+ */
1104
+ get columns():Array<Column>;
1105
+ /**
1106
+ * The default configuration to be used when building a <b>TotalsTable</b> for this table.
1107
+ * @return dh.TotalsTableConfig
1108
+ */
1109
+ get totalsTableConfig():TotalsTableConfig;
1110
+ /**
1111
+ * An ordered list of Sorts to apply to the table. To update, call <b>applySort()</b>. Note that this getter will
1112
+ * return the new value immediately, even though it may take a little time to update on the server. You may listen
1113
+ * for the <b>sortchanged</b> event to know when to update the UI.
1114
+ * @return {@link dh.Sort} array
1115
+ */
1116
+ get sort():Array<Sort>;
1117
+ /**
1118
+ * An ordered list of custom column formulas to add to the table, either adding new columns or replacing existing
1119
+ * ones. To update, call <b>applyCustomColumns()</b>.
1120
+ * @return {@link dh.CustomColumn} array
1121
+ */
1122
+ get customColumns():Array<CustomColumn>;
1123
+ /**
1124
+ * True if this table may receive updates from the server, including size changed events, updated events after
1125
+ * initial snapshot.
1126
+ * @return boolean
1127
+ */
1128
+ get isRefreshing():boolean;
1129
+ /**
1130
+ * An ordered list of Filters to apply to the table. To update, call applyFilter(). Note that this getter will
1131
+ * return the new value immediately, even though it may take a little time to update on the server. You may listen
1132
+ * for the <b>filterchanged</b> event to know when to update the UI.
1133
+ * @return {@link dh.FilterCondition} array
1134
+ */
1135
+ get filter():Array<FilterCondition>;
1136
+ /**
1137
+ * The total count of the rows in the table, excluding any filters. Unlike {@link Table.size}, changes to this value
1138
+ * will not result in any event. If the table is unfiltered, this will return the same size as {@link Table.size}.
1139
+ * If this table was uncoalesced before it was filtered, this will return {@link dh.Table.SIZE_UNCOALESCED}.
1140
+ * @return the size of the table before filters, or {@link dh.Table.SIZE_UNCOALESCED}
1141
+ */
1142
+ get totalSize():number;
1143
+ /**
1144
+ * The total count of rows in the table. If there is a viewport subscription active, this size will be updated when
1145
+ * the subscription updates. If not, and {@link Table.uncoalesced} is true, the size will be
1146
+ * {@link dh.Table.SIZE_UNCOALESCED}. Otherwise, the size will be updated when the server's update graph processes changes.
1147
+ * <p>
1148
+ * When the size changes, the {@link dh.Table.EVENT_SIZECHANGED} event will be fired.
1149
+ * @return the size of the table, or {@link dh.Table.SIZE_UNCOALESCED} if there is no subscription and the table is
1150
+ * uncoalesced.
1151
+ */
1152
+ get size():number;
1153
+ /**
1154
+ * True if this table has been closed.
1155
+ * @return boolean
1156
+ */
1157
+ get isClosed():boolean;
1158
+ /**
1159
+ * Read-only. True if this table is uncoalesced, indicating that work must be done before the table can be used.
1160
+ * <p>
1161
+ * Uncoalesced tables are expensive to operate on - filter to a single partition or range of partitions before
1162
+ * subscribing to access only the desired data efficiently. A subscription can be specified without a filter, but
1163
+ * this can be very expensive. To see which partitions are available, check each column on the table to see which
1164
+ * have {@link Column.isPartitionColumn} as `true`, and filter those columns. To read the possible values
1165
+ * for those columns, use {@link Table.selectDistinct}.
1166
+ * @return True if the table is uncoaleced and should be filtered before operating on it, otherwise false.
1167
+ */
1168
+ get isUncoalesced():boolean;
1169
+ /**
1170
+ * Listen for events on this object.
1171
+ * @param name - the name of the event to listen for
1172
+ * @param callback - a function to call when the event occurs
1173
+ * @return Returns a cleanup function.
1174
+ * @typeParam T - the type of the data that the event will provide
1175
+ */
1176
+ addEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):()=>void;
1177
+ nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<Event<T>>;
1178
+ hasListeners(name:string):boolean;
1179
+ /**
1180
+ * Removes an event listener added to this table.
1181
+ * @param name -
1182
+ * @param callback -
1196
1183
  * @return
1184
+ * @typeParam T -
1197
1185
  */
1198
- static ofBoolean(b:boolean):FilterValue;
1186
+ removeEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):boolean;
1187
+ /**
1188
+ * a Sort than can be used to reverse a table. This can be passed into n array in applySort. Note that Tree Tables
1189
+ * do not support reverse.
1190
+ * @return {@link dh.Sort}
1191
+ */
1192
+ static reverse():Sort;
1199
1193
  }
1200
1194
 
1201
1195
 
@@ -1361,28 +1355,10 @@ export namespace dh {
1361
1355
  */
1362
1356
  copy():Promise<TreeTable>;
1363
1357
  /**
1364
- * The current filter configuration of this Tree Table.
1365
- * @return {@link dh.FilterCondition} array
1358
+ * Returns the columns that are aggregated.
1359
+ * @return array of aggregated columns
1366
1360
  */
1367
- get filter():Array<FilterCondition>;
1368
- /**
1369
- * True if this is a roll-up and will provide the original rows that make up each grouping.
1370
- * @return boolean
1371
- */
1372
- get includeConstituents():boolean;
1373
- get groupedColumns():Array<Column>;
1374
- /**
1375
- * True if this table has been closed.
1376
- * @return boolean
1377
- */
1378
- get isClosed():boolean;
1379
- /**
1380
- * The current number of rows given the table's contents and the various expand/collapse states of each node. (No
1381
- * totalSize is provided at this time; its definition becomes unclear between roll-up and tree tables, especially
1382
- * when considering collapse/expand states).
1383
- * @return double
1384
- */
1385
- get size():number;
1361
+ get aggregatedColumns():Array<Column>;
1386
1362
  /**
1387
1363
  * The columns that can be shown in this Tree Table.
1388
1364
  * @return {@link dh.Column} array
@@ -1405,88 +1381,28 @@ export namespace dh {
1405
1381
  */
1406
1382
  get isRefreshing():boolean;
1407
1383
  /**
1408
- * Listen for events on this object.
1409
- * @param name - the name of the event to listen for
1410
- * @param callback - a function to call when the event occurs
1411
- * @return Returns a cleanup function.
1412
- * @typeParam T - the type of the data that the event will provide
1413
- */
1414
- addEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):()=>void;
1415
- nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<Event<T>>;
1416
- hasListeners(name:string):boolean;
1417
- /**
1418
- * Removes an event listener added to this table.
1419
- * @param name -
1420
- * @param callback -
1421
- * @return
1422
- * @typeParam T -
1423
- */
1424
- removeEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):boolean;
1425
- }
1426
-
1427
- /**
1428
- * Presently, this is the entrypoint into the Deephaven JS API. By creating an instance of this with the server URL and
1429
- * some options, JS applications can run code on the server, and interact with available exportable objects.
1430
- */
1431
- export class IdeConnection implements HasEventHandling {
1432
- /**
1433
- * @deprecated
1434
- */
1435
- static readonly HACK_CONNECTION_FAILURE:string;
1436
- static readonly EVENT_DISCONNECT:string;
1437
- static readonly EVENT_RECONNECT:string;
1438
- static readonly EVENT_SHUTDOWN:string;
1439
-
1440
- protected constructor();
1441
-
1442
- /**
1443
- * Closes the current connection, releasing any resources on the server or client.
1384
+ * The current filter configuration of this Tree Table.
1385
+ * @return {@link dh.FilterCondition} array
1444
1386
  */
1445
- close():void;
1446
- running():Promise<IdeConnection>;
1447
- getObject(definitionObject:dh.ide.VariableDescriptor):Promise<any>;
1448
- subscribeToFieldUpdates(callback:(arg0:dh.ide.VariableChanges)=>void):()=>void;
1387
+ get filter():Array<FilterCondition>;
1449
1388
  /**
1450
- * Makes an `object` available to another user or another client on this same server which knows the value of
1451
- * the `sharedTicketBytes`. Use that sharedTicketBytes value like a one-time use password - any other client
1452
- * which knows this value can read the same object.
1453
- * <p>
1454
- * Shared objects will remain available using the sharedTicketBytes until the client that first shared them
1455
- * releases/closes their copy of the object. Whatever side-channel is used to share the bytes, be sure to wait until
1456
- * the remote end has signaled that it has successfully fetched the object before releasing it from this client.
1457
- * <p>
1458
- * Be sure to use an unpredictable value for the shared ticket bytes, like a UUID or other large, random value to
1459
- * prevent access by unauthorized clients.
1460
- * @param object - the object to share with another client/user
1461
- * @param sharedTicketBytes - the value which another client/user must know to obtain the object. It may be a unicode
1462
- * string (will be encoded as utf8 bytes), or a {@link Uint8Array} value.
1463
- * @return A promise that will resolve to the value passed as sharedTicketBytes when the object is ready to be read
1464
- * by another client, or will reject if an error occurs.
1389
+ * True if this is a roll-up and will provide the original rows that make up each grouping.
1390
+ * @return boolean
1465
1391
  */
1466
- shareObject(object:Table|Widget|WidgetExportedObject|PartitionedTable|TotalsTable|TreeTable, sharedTicketBytes:string|Uint8Array):Promise<string|Uint8Array>;
1392
+ get includeConstituents():boolean;
1393
+ get groupedColumns():Array<Column>;
1467
1394
  /**
1468
- * Reads an object shared by another client to this server with the `sharedTicketBytes`. Until the other
1469
- * client releases this object (or their session ends), the object will be available on the server.
1470
- * <p>
1471
- * The type of the object must be passed so that the object can be read from the server correct - the other client
1472
- * should provide this information.
1473
- * @param sharedTicketBytes - the value provided by another client/user to obtain the object. It may be a unicode
1474
- * string (will be encoded as utf8 bytes), or a {@link Uint8Array} value.
1475
- * @param type - The type of the object, so it can be correctly read from the server
1476
- * @return A promise that will resolve to the shared object, or will reject with an error if it cannot be read.
1395
+ * True if this table has been closed.
1396
+ * @return boolean
1477
1397
  */
1478
- getSharedObject(sharedTicketBytes:string|Uint8Array, type:string):Promise<any>;
1398
+ get isClosed():boolean;
1479
1399
  /**
1480
- * Register a callback function to handle any log messages that are emitted on the server. Returns a function ,
1481
- * which can be invoked to remove this log handler. Any log handler registered in this way will receive as many old
1482
- * log messages as are presently available.
1483
- * @param callback -
1484
- * @return {@link io.deephaven.web.shared.fu.JsRunnable}
1400
+ * The current number of rows given the table's contents and the various expand/collapse states of each node. (No
1401
+ * totalSize is provided at this time; its definition becomes unclear between roll-up and tree tables, especially
1402
+ * when considering collapse/expand states).
1403
+ * @return double
1485
1404
  */
1486
- onLogMessage(callback:(arg0:dh.ide.LogItem)=>void):()=>void;
1487
- startSession(type:string):Promise<IdeSession>;
1488
- getConsoleTypes():Promise<Array<string>>;
1489
- getWorkerHeapInfo():Promise<WorkerHeapInfo>;
1405
+ get size():number;
1490
1406
  /**
1491
1407
  * Listen for events on this object.
1492
1408
  * @param name - the name of the event to listen for
@@ -1508,97 +1424,131 @@ export namespace dh {
1508
1424
  }
1509
1425
 
1510
1426
  /**
1511
- * Represents a set of Tables each corresponding to some key. The keys are available locally, but a call must be made to
1512
- * the server to get each Table. All tables will have the same structure.
1427
+ * Describes how a Totals Table will be generated from its parent table. Each table has a default (which may be null)
1428
+ * indicating how that table was configured when it was declared, and each Totals Table has a similar property
1429
+ * describing how it was created. Both the <b>Table.getTotalsTable</b> and <b>Table.getGrandTotalsTable</b> methods take
1430
+ * this config as an optional parameter - without it, the table's default will be used, or if null, a default instance
1431
+ * of <b>TotalsTableConfig</b> will be supplied.
1432
+ *
1433
+ * This class has a no-arg constructor, allowing an instance to be made with the default values provided. However, any
1434
+ * JS object can be passed in to the methods which accept instances of this type, provided their values adhere to the
1435
+ * expected formats.
1513
1436
  */
1514
- export class PartitionedTable implements HasEventHandling {
1437
+ export class TotalsTableConfig {
1438
+ /**
1439
+ * @deprecated
1440
+ */
1441
+ static readonly COUNT:string;
1515
1442
  /**
1516
- * Indicates that a new key has been added to the array of keys, which can now be fetched with getTable.
1443
+ * @deprecated
1517
1444
  */
1518
- static readonly EVENT_KEYADDED:string;
1445
+ static readonly MIN:string;
1519
1446
  /**
1520
- * Indicates that a new key has been added to the array of keys, which can now be fetched with getTable.
1447
+ * @deprecated
1521
1448
  */
1522
- static readonly EVENT_DISCONNECT:string;
1449
+ static readonly MAX:string;
1523
1450
  /**
1524
- * Indicates that a new key has been added to the array of keys, which can now be fetched with getTable.
1451
+ * @deprecated
1525
1452
  */
1526
- static readonly EVENT_RECONNECT:string;
1453
+ static readonly SUM:string;
1527
1454
  /**
1528
- * Indicates that a new key has been added to the array of keys, which can now be fetched with getTable.
1455
+ * @deprecated
1529
1456
  */
1530
- static readonly EVENT_RECONNECTFAILED:string;
1531
-
1532
- protected constructor();
1533
-
1457
+ static readonly ABS_SUM:string;
1534
1458
  /**
1535
- * Fetch the table with the given key. If the key does not exist, returns `null`.
1536
- * @param key - The key to fetch. An array of values for each key column, in the same order as the key columns are.
1537
- * @return Promise of dh.Table, or `null` if the key does not exist.
1459
+ * @deprecated
1538
1460
  */
1539
- getTable(key:object):Promise<Table|undefined|null>;
1461
+ static readonly VAR:string;
1540
1462
  /**
1541
- * Open a new table that is the result of merging all constituent tables. See
1542
- * {@link io.deephaven.engine.table.PartitionedTable.merge} for details.
1543
- * @return A merged representation of the constituent tables.
1463
+ * @deprecated
1544
1464
  */
1545
- getMergedTable():Promise<Table>;
1465
+ static readonly AVG:string;
1546
1466
  /**
1547
- * The set of all currently known keys. This is kept up to date, so getting the list after adding an event listener
1548
- * for <b>keyadded</b> will ensure no keys are missed.
1549
- * @return Set of Object
1467
+ * @deprecated
1550
1468
  */
1551
- getKeys():Set<object>;
1469
+ static readonly STD:string;
1552
1470
  /**
1553
- * Fetch a table containing all the valid keys of the partitioned table.
1554
- * @return Promise of a Table
1555
1471
  * @deprecated
1556
1472
  */
1557
- getKeyTable():Promise<Table>;
1473
+ static readonly FIRST:string;
1558
1474
  /**
1559
- * Fetch the underlying base table of the partitioned table.
1560
- * @return Promise of a Table
1475
+ * @deprecated
1561
1476
  */
1562
- getBaseTable():Promise<Table>;
1477
+ static readonly LAST:string;
1563
1478
  /**
1564
- * Indicates that this PartitionedTable will no longer be used, removing subcriptions to updated keys, etc. This
1565
- * will not affect tables in use.
1479
+ * @deprecated
1566
1480
  */
1567
- close():void;
1481
+ static readonly SKIP:string;
1568
1482
  /**
1569
- * The count of known keys.
1570
- * @return int
1483
+ * Specifies if a Totals Table should be expanded by default in the UI. Defaults to false.
1571
1484
  */
1572
- get size():number;
1485
+ showTotalsByDefault:boolean;
1573
1486
  /**
1574
- * An array of the columns in the tables that can be retrieved from this partitioned table, including both key and
1575
- * non-key columns.
1576
- * @return Array of Column
1487
+ * Specifies if a Grand Totals Table should be expanded by default in the UI. Defaults to false.
1577
1488
  */
1578
- get columns():Column[];
1489
+ showGrandTotalsByDefault:boolean;
1579
1490
  /**
1580
- * An array of all the key columns that the tables are partitioned by.
1581
- * @return Array of Column
1491
+ * Specifies the default operation for columns that do not have a specific operation applied; defaults to "Sum".
1582
1492
  */
1583
- get keyColumns():Column[];
1493
+ defaultOperation:AggregationOperationType;
1584
1494
  /**
1585
- * Listen for events on this object.
1586
- * @param name - the name of the event to listen for
1587
- * @param callback - a function to call when the event occurs
1588
- * @return Returns a cleanup function.
1589
- * @typeParam T - the type of the data that the event will provide
1495
+ * Mapping from each column name to the aggregation(s) that should be applied to that column in the resulting Totals
1496
+ * Table. If a column is omitted, the defaultOperation is used.
1590
1497
  */
1591
- addEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):()=>void;
1592
- nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<Event<T>>;
1593
- hasListeners(name:string):boolean;
1498
+ operationMap:{ [key: string]: Array<AggregationOperationType>; };
1594
1499
  /**
1595
- * Removes an event listener added to this table.
1596
- * @param name -
1597
- * @param callback -
1598
- * @return
1599
- * @typeParam T -
1500
+ * Groupings to use when generating the Totals Table. One row will exist for each unique set of values observed in
1501
+ * these columns. See also `Table.selectDistinct`.
1600
1502
  */
1601
- removeEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):boolean;
1503
+ groupBy:Array<string>;
1504
+
1505
+ constructor();
1506
+
1507
+ toString():string;
1508
+ }
1509
+
1510
+ /**
1511
+ * Exists to keep the dh.TableMap namespace so that the web UI can remain compatible with the DHE API, which still calls
1512
+ * this type TableMap.
1513
+ * @deprecated
1514
+ */
1515
+ export class TableMap {
1516
+ static readonly EVENT_KEYADDED:string;
1517
+ static readonly EVENT_DISCONNECT:string;
1518
+ static readonly EVENT_RECONNECT:string;
1519
+ static readonly EVENT_RECONNECTFAILED:string;
1520
+
1521
+ protected constructor();
1522
+ }
1523
+
1524
+ /**
1525
+ * Describes a grouping and aggregations for a roll-up table. Pass to the <b>Table.rollup</b> function to create a
1526
+ * roll-up table.
1527
+ */
1528
+ export class RollupConfig {
1529
+ /**
1530
+ * Ordered list of columns to group by to form the hierarchy of the resulting roll-up table.
1531
+ */
1532
+ groupingColumns:Array<String>;
1533
+ /**
1534
+ * Mapping from each aggregation name to the ordered list of columns it should be applied to in the resulting
1535
+ * roll-up table.
1536
+ */
1537
+ aggregations:{ [key: string]: Array<string>; };
1538
+ /**
1539
+ * Optional parameter indicating if an extra leaf node should be added at the bottom of the hierarchy, showing the
1540
+ * rows in the underlying table which make up that grouping. Since these values might be a different type from the
1541
+ * rest of the column, any client code must check if TreeRow.hasChildren = false, and if so, interpret those values
1542
+ * as if they were Column.constituentType instead of Column.type. Defaults to false.
1543
+ */
1544
+ includeConstituents:boolean;
1545
+ includeOriginalColumns?:boolean|null;
1546
+ /**
1547
+ * Optional parameter indicating if original column descriptions should be included. Defaults to true.
1548
+ */
1549
+ includeDescriptions:boolean;
1550
+
1551
+ constructor();
1602
1552
  }
1603
1553
 
1604
1554
  /**
@@ -1689,483 +1639,607 @@ export namespace dh {
1689
1639
  }
1690
1640
 
1691
1641
  /**
1692
- * Describes a Sort present on the table. No visible constructor, created through the use of Column.sort(), will be tied
1693
- * to that particular column data. Sort instances are immutable, and use a builder pattern to make modifications. All
1694
- * methods return a new Sort instance.
1695
- */
1696
- export class Sort {
1697
- static readonly ASCENDING:string;
1698
- static readonly DESCENDING:string;
1699
- static readonly REVERSE:string;
1700
-
1701
- protected constructor();
1702
-
1703
- /**
1704
- * Builds a Sort instance to sort values in ascending order.
1705
- * @return {@link dh.Sort}
1706
- */
1707
- asc():Sort;
1708
- /**
1709
- * Builds a Sort instance to sort values in descending order.
1710
- * @return {@link dh.Sort}
1711
- */
1712
- desc():Sort;
1713
- /**
1714
- * Builds a Sort instance which takes the absolute value before applying order.
1715
- * @return {@link dh.Sort}
1716
- */
1717
- abs():Sort;
1718
- toString():string;
1719
- /**
1720
- * True if the absolute value of the column should be used when sorting; defaults to false.
1721
- * @return boolean
1722
- */
1723
- get isAbs():boolean;
1724
- /**
1725
- * The column which is sorted.
1726
- * @return {@link dh.Column}
1727
- */
1728
- get column():Column;
1729
- /**
1730
- * The direction of this sort, either <b>ASC</b>, <b>DESC</b>, or <b>REVERSE</b>.
1731
- * @return String
1732
- */
1733
- get direction():string;
1734
- }
1735
-
1736
- /**
1737
- * Addition optional configuration that can be passed to the {@link dh.CoreClient} constructor.
1642
+ * Options for custom columns.
1738
1643
  */
1739
- export class ConnectOptions {
1740
- /**
1741
- * Optional map of http header names and values to send to the server with each request.
1742
- */
1743
- headers?:{ [key: string]: string; }|null;
1744
- /**
1745
- * True to enable debug logging. At this time, only enables logging for gRPC calls.
1746
- */
1747
- debug?:boolean|null;
1748
- /**
1749
- * Set this to true to force the use of websockets when connecting to the deephaven instance, false to force the use
1750
- * of `fetch`. Ignored if {@link dh.transportFactory} is set.
1751
- * <p>
1752
- * Defaults to null, indicating that the server URL should be checked to see if we connect with fetch or websockets.
1753
- */
1754
- useWebsockets?:boolean|null;
1644
+ export class CustomColumnOptions {
1755
1645
  /**
1756
- * The transport factory to use for creating gRPC streams. If specified, the JS API will ignore
1757
- * {@link dh.useWebsockets} and its own internal logic for determining the appropriate transport to use.
1758
- * <p>
1759
- * Defaults to null, indicating that the JS API should determine the appropriate transport to use. If
1760
- * `useWebsockets` is set to true, the JS API will use websockets, otherwise if the server url begins with
1761
- * https, it will use fetch, otherwise it will use websockets.
1646
+ * When specified for custom columns on a rollup table, specifies if the formula apply to rollup or constituent
1647
+ * nodes.
1762
1648
  */
1763
- transportFactory?:dh.grpc.GrpcTransportFactory|null;
1649
+ rollupNodeType?:RollupNodeTypeType|null;
1764
1650
 
1765
1651
  constructor();
1766
1652
  }
1767
1653
 
1768
- export class LongWrapper {
1654
+ /**
1655
+ * Wrap BigInteger values for use in JS. Provides text formatting for display and access to the underlying value.
1656
+ */
1657
+ export class BigIntegerWrapper {
1769
1658
  protected constructor();
1770
1659
 
1771
- static ofString(str:string):LongWrapper;
1660
+ static ofString(str:string):BigIntegerWrapper;
1772
1661
  asNumber():number;
1773
1662
  valueOf():string;
1774
1663
  toString():string;
1664
+ equals(o:object):boolean;
1665
+ hashCode():number;
1775
1666
  }
1776
1667
 
1777
- /**
1778
- * Wrap BigDecimal values for use in JS. Provides text formatting for display and access to the underlying value.
1779
- */
1780
- export class BigDecimalWrapper {
1668
+ export class LongWrapper {
1781
1669
  protected constructor();
1782
1670
 
1783
- static ofString(value:string):BigDecimalWrapper;
1671
+ static ofString(str:string):LongWrapper;
1784
1672
  asNumber():number;
1785
1673
  valueOf():string;
1786
1674
  toString():string;
1787
- equals(o:object):boolean;
1788
- hashCode():number;
1789
1675
  }
1790
1676
 
1791
1677
  /**
1792
- * This class allows iteration over non-contiguous indexes. In the future, this will support the EcmaScript 2015
1793
- * Iteration protocol, but for now has one method which returns an iterator, and also supports querying the size.
1794
- * Additionally, we may add support for creating RangeSet objects to better serve some use cases.
1678
+ * Describes data that can be filtered, either a column reference or a literal value. Used this way, the type of a value
1679
+ * can be specified so that values which are ambiguous or not well supported in JS will not be confused with Strings or
1680
+ * imprecise numbers (e.g., nanosecond-precision date values). Additionally, once wrapped in this way, methods can be
1681
+ * called on these value literal instances. These instances are immutable - any method called on them returns a new
1682
+ * instance.
1795
1683
  */
1796
- export class RangeSet {
1684
+ export class FilterValue {
1797
1685
  protected constructor();
1798
1686
 
1799
- static ofRange(first:number, last:number):RangeSet;
1800
- static ofItems(rows:number[]):RangeSet;
1801
- static ofRanges(ranges:RangeSet[]):RangeSet;
1802
- static ofSortedRanges(ranges:RangeSet[]):RangeSet;
1803
1687
  /**
1804
- * a new iterator over all indexes in this collection.
1805
- * @return Iterator of {@link dh.LongWrapper}
1688
+ * Constructs a number for the filter API from the given parameter. Can also be used on the values returned from
1689
+ * {@link TableData.get} for DateTime values. To create
1690
+ * a filter with a date, use <b>dh.DateWrapper.ofJsDate</b> or
1691
+ * {@link i18n.DateTimeFormat.parse}. To create a filter with a
1692
+ * 64-bit long integer, use {@link LongWrapper.ofString}.
1693
+ * @param input - the number to wrap as a FilterValue
1694
+ * @return an immutable FilterValue that can be built into a filter
1695
+ */
1696
+ static ofNumber(input:LongWrapper|number):FilterValue;
1697
+ /**
1698
+ * a filter condition checking if the current value is equal to the given parameter
1699
+ * @param term -
1700
+ * @return {@link dh.FilterCondition}
1701
+ */
1702
+ eq(term:FilterValue):FilterCondition;
1703
+ /**
1704
+ * a filter condition checking if the current value is equal to the given parameter, ignoring differences of upper
1705
+ * vs lower case
1706
+ * @param term -
1707
+ * @return {@link dh.FilterCondition}
1806
1708
  */
1807
- iterator():Iterator<LongWrapper>;
1709
+ eqIgnoreCase(term:FilterValue):FilterCondition;
1808
1710
  /**
1809
- * The total count of items contained in this collection. In some cases this can be expensive to compute, and
1810
- * generally should not be needed except for debugging purposes, or preallocating space (i.e., do not call this
1811
- * property each time through a loop).
1812
- * @return double
1711
+ * a filter condition checking if the current value is not equal to the given parameter
1712
+ * @param term -
1713
+ * @return {@link dh.FilterCondition}
1813
1714
  */
1814
- get size():number;
1815
- }
1816
-
1817
- /**
1818
- * Provides access to data in a table. Note that several methods present their response through Promises. This allows
1819
- * the client to both avoid actually connecting to the server until necessary, and also will permit some changes not to
1820
- * inform the UI right away that they have taken place.
1821
- */
1822
- export class Table implements JoinableTable, HasEventHandling {
1823
- readonly description?:string|null;
1824
- readonly pluginName?:string|null;
1825
- readonly layoutHints?:null|LayoutHints;
1715
+ notEq(term:FilterValue):FilterCondition;
1826
1716
  /**
1827
- * The table size has updated, so live scrollbars and the like can be updated accordingly.
1717
+ * a filter condition checking if the current value is not equal to the given parameter, ignoring differences of
1718
+ * upper vs lower case
1719
+ * @param term -
1720
+ * @return {@link dh.FilterCondition}
1828
1721
  */
1829
- static readonly EVENT_SIZECHANGED:string;
1722
+ notEqIgnoreCase(term:FilterValue):FilterCondition;
1830
1723
  /**
1831
- * The table size has updated, so live scrollbars and the like can be updated accordingly.
1724
+ * a filter condition checking if the current value is greater than the given parameter
1725
+ * @param term -
1726
+ * @return {@link dh.FilterCondition}
1832
1727
  */
1833
- static readonly EVENT_UPDATED:string;
1728
+ greaterThan(term:FilterValue):FilterCondition;
1834
1729
  /**
1835
- * The table size has updated, so live scrollbars and the like can be updated accordingly.
1730
+ * a filter condition checking if the current value is less than the given parameter
1731
+ * @param term -
1732
+ * @return {@link dh.FilterCondition}
1836
1733
  */
1837
- static readonly EVENT_ROWADDED:string;
1734
+ lessThan(term:FilterValue):FilterCondition;
1838
1735
  /**
1839
- * The table size has updated, so live scrollbars and the like can be updated accordingly.
1736
+ * a filter condition checking if the current value is greater than or equal to the given parameter
1737
+ * @param term -
1738
+ * @return {@link dh.FilterCondition}
1840
1739
  */
1841
- static readonly EVENT_ROWREMOVED:string;
1740
+ greaterThanOrEqualTo(term:FilterValue):FilterCondition;
1842
1741
  /**
1843
- * The table size has updated, so live scrollbars and the like can be updated accordingly.
1742
+ * a filter condition checking if the current value is less than or equal to the given parameter
1743
+ * @param term -
1744
+ * @return {@link dh.FilterCondition}
1844
1745
  */
1845
- static readonly EVENT_ROWUPDATED:string;
1746
+ lessThanOrEqualTo(term:FilterValue):FilterCondition;
1846
1747
  /**
1847
- * The table size has updated, so live scrollbars and the like can be updated accordingly.
1748
+ * a filter condition checking if the current value is in the given set of values
1749
+ * @param terms -
1750
+ * @return {@link dh.FilterCondition}
1848
1751
  */
1849
- static readonly EVENT_SORTCHANGED:string;
1752
+ in(terms:FilterValue[]):FilterCondition;
1850
1753
  /**
1851
- * The table size has updated, so live scrollbars and the like can be updated accordingly.
1754
+ * a filter condition checking if the current value is in the given set of values, ignoring differences of upper vs
1755
+ * lower case
1756
+ * @param terms -
1757
+ * @return {@link dh.FilterCondition}
1852
1758
  */
1853
- static readonly EVENT_FILTERCHANGED:string;
1759
+ inIgnoreCase(terms:FilterValue[]):FilterCondition;
1854
1760
  /**
1855
- * The table size has updated, so live scrollbars and the like can be updated accordingly.
1761
+ * a filter condition checking that the current value is not in the given set of values
1762
+ * @param terms -
1763
+ * @return {@link dh.FilterCondition}
1856
1764
  */
1857
- static readonly EVENT_CUSTOMCOLUMNSCHANGED:string;
1765
+ notIn(terms:FilterValue[]):FilterCondition;
1858
1766
  /**
1859
- * The table size has updated, so live scrollbars and the like can be updated accordingly.
1767
+ * a filter condition checking that the current value is not in the given set of values, ignoring differences of
1768
+ * upper vs lower case
1769
+ * @param terms -
1770
+ * @return {@link dh.FilterCondition}
1860
1771
  */
1861
- static readonly EVENT_DISCONNECT:string;
1772
+ notInIgnoreCase(terms:FilterValue[]):FilterCondition;
1862
1773
  /**
1863
- * The table size has updated, so live scrollbars and the like can be updated accordingly.
1774
+ * a filter condition checking if the given value contains the given string value
1775
+ * @param term -
1776
+ * @return {@link dh.FilterCondition}
1864
1777
  */
1865
- static readonly EVENT_RECONNECT:string;
1778
+ contains(term:FilterValue):FilterCondition;
1866
1779
  /**
1867
- * The table size has updated, so live scrollbars and the like can be updated accordingly.
1780
+ * a filter condition checking if the given value contains the given string value, ignoring differences of upper vs
1781
+ * lower case
1782
+ * @param term -
1783
+ * @return {@link dh.FilterCondition}
1868
1784
  */
1869
- static readonly EVENT_RECONNECTFAILED:string;
1785
+ containsIgnoreCase(term:FilterValue):FilterCondition;
1870
1786
  /**
1871
- * The table size has updated, so live scrollbars and the like can be updated accordingly.
1787
+ * a filter condition checking if the given value matches the provided regular expressions string. Regex patterns
1788
+ * use Java regex syntax
1789
+ * @param pattern -
1790
+ * @return {@link dh.FilterCondition}
1872
1791
  */
1873
- static readonly EVENT_REQUEST_FAILED:string;
1792
+ matches(pattern:FilterValue):FilterCondition;
1874
1793
  /**
1875
- * The table size has updated, so live scrollbars and the like can be updated accordingly.
1794
+ * a filter condition checking if the given value matches the provided regular expressions string, ignoring
1795
+ * differences of upper vs lower case. Regex patterns use Java regex syntax
1796
+ * @param pattern -
1797
+ * @return {@link dh.FilterCondition}
1876
1798
  */
1877
- static readonly EVENT_REQUEST_SUCCEEDED:string;
1799
+ matchesIgnoreCase(pattern:FilterValue):FilterCondition;
1878
1800
  /**
1879
- * The size the table will have if it is uncoalesced.
1801
+ * a filter condition checking if the current value is a true boolean
1802
+ * @return {@link dh.FilterCondition}
1880
1803
  */
1881
- static readonly SIZE_UNCOALESCED:number;
1882
-
1883
- protected constructor();
1804
+ isTrue():FilterCondition;
1805
+ /**
1806
+ * a filter condition checking if the current value is a false boolean
1807
+ * @return {@link dh.FilterCondition}
1808
+ */
1809
+ isFalse():FilterCondition;
1810
+ /**
1811
+ * a filter condition checking if the current value is a null value
1812
+ * @return {@link dh.FilterCondition}
1813
+ */
1814
+ isNull():FilterCondition;
1815
+ /**
1816
+ * a filter condition invoking the given method on the current value, with the given parameters. Currently supported
1817
+ * functions that can be invoked on a String:
1818
+ * <ul>
1819
+ * <li><b>startsWith</b>: Returns true if the current string value starts with the supplied string argument</li>
1820
+ * <li><b>endsWith</b>: Returns true if the current string value ends with the supplied string argument</li>
1821
+ * <li><b>matches</b>: Returns true if the current string value matches the supplied string argument used as a Java
1822
+ * regular expression</li>
1823
+ * <li><b>contains</b>: Returns true if the current string value contains the supplied string argument
1824
+ * <p>
1825
+ * When invoking against a constant, this should be avoided in favor of FilterValue.contains
1826
+ * </p>
1827
+ * </li>
1828
+ * </ul>
1829
+ * @param method -
1830
+ * @param args -
1831
+ * @return
1832
+ */
1833
+ invoke(method:string, ...args:FilterValue[]):FilterCondition;
1834
+ toString():string;
1835
+ /**
1836
+ * Constructs a string for the filter API from the given parameter.
1837
+ * @param input -
1838
+ * @return
1839
+ */
1840
+ static ofString(input:any):FilterValue;
1841
+ /**
1842
+ * Constructs a boolean for the filter API from the given parameter.
1843
+ * @param b -
1844
+ * @return
1845
+ */
1846
+ static ofBoolean(b:boolean):FilterValue;
1847
+ }
1884
1848
 
1885
- batch(userCode:(arg0:unknown)=>void):Promise<Table>;
1849
+ /**
1850
+ * Configuration object for running Table.treeTable to produce a hierarchical view of a given "flat" table.
1851
+ *
1852
+ * Like TotalsTableConfig, `TreeTableConfig` supports an operation map indicating how to aggregate the data, as well as
1853
+ * an array of column names which will be the layers in the roll-up tree, grouped at each level. An additional optional
1854
+ * value can be provided describing the strategy the engine should use when grouping the rows.
1855
+ */
1856
+ export class TreeTableConfig {
1886
1857
  /**
1887
- * Retrieve a column by the given name. You should prefer to always retrieve a new Column instance instead of
1888
- * caching a returned value.
1889
- * @param key -
1890
- * @return {@link dh.Column}
1858
+ * The column representing the unique ID for each item
1891
1859
  */
1892
- findColumn(key:string):Column;
1860
+ idColumn:string;
1893
1861
  /**
1894
- * Retrieve multiple columns specified by the given names.
1895
- * @param keys -
1896
- * @return {@link dh.Column} array
1862
+ * The column representing the parent ID for each item
1897
1863
  */
1898
- findColumns(keys:string[]):Column[];
1899
- isBlinkTable():boolean;
1864
+ parentColumn:string;
1900
1865
  /**
1901
- * If .hasInputTable is true, you may call this method to gain access to an InputTable object which can be used to
1902
- * mutate the data within the table. If the table is not an Input Table, the promise will be immediately rejected.
1903
- * @return Promise of dh.InputTable
1866
+ * Optional parameter indicating if items with an invalid parent ID should be promoted to root. Defaults to false.
1904
1867
  */
1905
- inputTable():Promise<InputTable>;
1868
+ promoteOrphansToRoot:boolean;
1869
+
1870
+ constructor();
1871
+ }
1872
+
1873
+ /**
1874
+ * A Widget represents a server side object that sends one or more responses to the client. The client can then
1875
+ * interpret these responses to see what to render, or how to respond.
1876
+ * <p>
1877
+ * Most custom object types result in a single response being sent to the client, often with other exported objects, but
1878
+ * some will have streamed responses, and allow the client to send follow-up requests of its own. This class's API is
1879
+ * backwards compatible, but as such does not offer a way to tell the difference between a streaming or non-streaming
1880
+ * object type, the client code that handles the payloads is expected to know what to expect. See
1881
+ * {@link dh.WidgetMessageDetails} for more information.
1882
+ * <p>
1883
+ * When the promise that returns this object resolves, it will have the first response assigned to its fields. Later
1884
+ * responses from the server will be emitted as "message" events. When the connection with the server ends, the "close"
1885
+ * event will be emitted. In this way, the connection will behave roughly in the same way as a WebSocket - either side
1886
+ * can close, and after close no more messages will be processed. There can be some latency in closing locally while
1887
+ * remote messages are still pending - it is up to implementations of plugins to handle this case.
1888
+ * <p>
1889
+ * Also like WebSockets, the plugin API doesn't define how to serialize messages, and just handles any binary payloads.
1890
+ * What it does handle however, is allowing those messages to include references to server-side objects with those
1891
+ * payloads. Those server side objects might be tables or other built-in types in the Deephaven JS API, or could be
1892
+ * objects usable through their own plugins. They also might have no plugin at all, allowing the client to hold a
1893
+ * reference to them and pass them back to the server, either to the current plugin instance, or through another API.
1894
+ * The `Widget` type does not specify how those objects should be used or their lifecycle, but leaves that
1895
+ * entirely to the plugin. Messages will arrive in the order they were sent.
1896
+ * <p>
1897
+ * This can suggest several patterns for how plugins operate:
1898
+ * <ul>
1899
+ * <li>The plugin merely exists to transport some other object to the client. This can be useful for objects which can
1900
+ * easily be translated to some other type (like a Table) when the user clicks on it. An example of this is
1901
+ * `pandas.DataFrame` will result in a widget that only contains a static
1902
+ * {@link dh.Table}. Presently, the widget is immediately closed, and only the Table is
1903
+ * provided to the JS API consumer.</li>
1904
+ * <li>The plugin provides references to Tables and other objects, and those objects can live longer than the object
1905
+ * which provided them. One concrete example of this could have been
1906
+ * {@link dh.PartitionedTable} when fetching constituent tables, but it was implemented
1907
+ * before bidirectional plugins were implemented. Another example of this is plugins that serve as a "factory", giving
1908
+ * the user access to table manipulation/creation methods not supported by gRPC or the JS API.</li>
1909
+ * <li>The plugin provides reference to Tables and other objects that only make sense within the context of the widget
1910
+ * instance, so when the widget goes away, those objects should be released as well. This is also an example of
1911
+ * {@link dh.PartitionedTable}, as the partitioned table tracks creation of new keys through
1912
+ * an internal table instance.</li>
1913
+ * </ul>
1914
+ *
1915
+ * Handling server objects in messages also has more than one potential pattern that can be used:
1916
+ * <ul>
1917
+ * <li>One object per message - the message clearly is about that object, no other details required.</li>
1918
+ * <li>Objects indexed within their message - as each message comes with a list of objects, those objects can be
1919
+ * referenced within the payload by index. This is roughly how {@link dh.plot.Figure}
1920
+ * behaves, where the figure descriptor schema includes an index for each created series, describing which table should
1921
+ * be used, which columns should be mapped to each axis.</li>
1922
+ * <li>Objects indexed since widget creation - each message would append its objects to a list created when the widget
1923
+ * was first made, and any new exports that arrive in a new message would be appended to that list. Then, subsequent
1924
+ * messages can reference objects already sent. This imposes a limitation where the client cannot release any exports
1925
+ * without the server somehow signaling that it will never reference that export again.</li>
1926
+ * </ul>
1927
+ */
1928
+ export class Widget implements WidgetMessageDetails, HasEventHandling {
1929
+ static readonly EVENT_MESSAGE:string;
1930
+ static readonly EVENT_CLOSE:string;
1931
+
1932
+ protected constructor();
1933
+
1906
1934
  /**
1907
- * Indicates that this Table instance will no longer be used, and its connection to the server can be cleaned up.
1935
+ * Ends the client connection to the server.
1908
1936
  */
1909
1937
  close():void;
1910
- getAttributes():string[];
1911
- /**
1912
- * null if no property exists, a string if it is an easily serializable property, or a ```Promise
1913
- * &lt;Table&gt;``` that will either resolve with a table or error out if the object can't be passed to JS.
1914
- * @param attributeName -
1915
- * @return Object
1916
- */
1917
- getAttribute(attributeName:string):unknown|undefined|null;
1938
+ getDataAsBase64():string;
1939
+ getDataAsU8():Uint8Array;
1940
+ getDataAsString():string;
1918
1941
  /**
1919
- * Replace the currently set sort on this table. Returns the previously set value. Note that the sort property will
1920
- * immediately return the new value, but you may receive update events using the old sort before the new sort is
1921
- * applied, and the <b>sortchanged</b> event fires. Reusing existing, applied sorts may enable this to perform
1922
- * better on the server. The <b>updated</b> event will also fire, but <b>rowadded</b> and <b>rowremoved</b> will
1923
- * not.
1924
- * @param sort -
1925
- * @return {@link dh.Sort} array
1942
+ * Sends a string/bytes payload to the server, along with references to objects that exist on the server.
1943
+ * @param msg - string/buffer/view instance that represents data to send
1944
+ * @param references - an array of objects that can be safely sent to the server
1926
1945
  */
1927
- applySort(sort:Sort[]):Array<Sort>;
1946
+ sendMessage(msg:string|ArrayBuffer|ArrayBufferView, references?:Array<Table|Widget|WidgetExportedObject|PartitionedTable|TotalsTable|TreeTable>):void;
1947
+ addEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):()=>void;
1948
+ nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<Event<T>>;
1949
+ hasListeners(name:string):boolean;
1950
+ removeEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):boolean;
1928
1951
  /**
1929
- * Replace the currently set filters on the table. Returns the previously set value. Note that the filter property
1930
- * will immediately return the new value, but you may receive update events using the old filter before the new one
1931
- * is applied, and the <b>filterchanged</b> event fires. Reusing existing, applied filters may enable this to
1932
- * perform better on the server. The <b>updated</b> event will also fire, but <b>rowadded</b> and <b>rowremoved</b>
1933
- * will not.
1934
- * @param filter -
1935
- * @return {@link dh.FilterCondition} array
1952
+ *
1953
+ * @return the exported objects sent in the initial message from the server. The client is responsible for closing
1954
+ * them when finished using them.
1936
1955
  */
1937
- applyFilter(filter:FilterCondition[]):Array<FilterCondition>;
1956
+ get exportedObjects():WidgetExportedObject[];
1938
1957
  /**
1939
- * used when adding new filter and sort operations to the table, as long as they are present.
1940
- * @param customColumns -
1941
- * @return {@link dh.CustomColumn} array
1958
+ *
1959
+ * @return the type of this widget
1942
1960
  */
1943
- applyCustomColumns(customColumns:Array<string|CustomColumn>):Array<CustomColumn>;
1961
+ get type():string;
1962
+ }
1963
+
1964
+ /**
1965
+ * This object serves as a "handle" to a subscription, allowing it to be acted on directly or canceled outright. If you
1966
+ * retain an instance of this, you have two choices - either only use it to call `close()` on it to stop the table's
1967
+ * viewport without creating a new one, or listen directly to this object instead of the table for data events, and
1968
+ * always call `close()` when finished. Calling any method on this object other than close() will result in it
1969
+ * continuing to live on after `setViewport` is called on the original table, or after the table is modified.
1970
+ */
1971
+ export class TableViewportSubscription implements HasEventHandling {
1972
+ protected constructor();
1973
+
1944
1974
  /**
1945
- * If the columns parameter is not provided, all columns will be used. If the updateIntervalMs parameter is not
1946
- * provided, a default of one second will be used. Until this is called, no data will be available. Invoking this
1947
- * will result in events to be fired once data becomes available, starting with an `updated` event and a
1948
- * <b>rowadded</b> event per row in that range. The returned object allows the viewport to be closed when no longer
1949
- * needed.
1975
+ * Changes the rows and columns set on this viewport. This cannot be used to change the update interval.
1950
1976
  * @param firstRow -
1951
1977
  * @param lastRow -
1952
1978
  * @param columns -
1953
1979
  * @param updateIntervalMs -
1954
- * @return {@link dh.TableViewportSubscription}
1955
1980
  */
1956
- setViewport(firstRow:number, lastRow:number, columns?:Array<Column>|undefined|null, updateIntervalMs?:number|undefined|null, isReverseViewport?:boolean|undefined|null):TableViewportSubscription;
1981
+ setViewport(firstRow:number, lastRow:number, columns?:Column[]|undefined|null, updateIntervalMs?:number|undefined|null, isReverseViewport?:boolean|undefined|null):void;
1957
1982
  /**
1958
- * Gets the currently visible viewport. If the current set of operations has not yet resulted in data, it will not
1959
- * resolve until that data is ready. If this table is closed before the promise resolves, it will be rejected - to
1960
- * separate the lifespan of this promise from the table itself, call
1961
- * {@link TableViewportSubscription.getViewportData} on the result from {@link Table.setViewport}.
1962
- * @return Promise of {@link dh.TableData}
1983
+ * Stops this viewport from running, stopping all events on itself and on the table that created it.
1984
+ */
1985
+ close():void;
1986
+ /**
1987
+ * Gets the data currently visible in this viewport
1988
+ * @return Promise of {@link dh.TableData}.
1963
1989
  */
1964
1990
  getViewportData():Promise<ViewportData>;
1991
+ snapshot(rows:RangeSet, columns:Column[]):Promise<TableData>;
1965
1992
  /**
1966
- * Creates a subscription to the specified columns, across all rows in the table. The optional parameter
1967
- * updateIntervalMs may be specified to indicate how often the server should send updates, defaulting to one second
1968
- * if omitted. Useful for charts or taking a snapshot of the table atomically. The initial snapshot will arrive in a
1969
- * single event, but later changes will be sent as updates. However, this may still be very expensive to run from a
1970
- * browser for very large tables. Each call to subscribe creates a new subscription, which must have <b>close()</b>
1971
- * called on it to stop it, and all events are fired from the TableSubscription instance.
1972
- * @param columns -
1973
- * @param updateIntervalMs -
1974
- * @return {@link dh.TableSubscription}
1993
+ * Listen for events on this object.
1994
+ * @param name - the name of the event to listen for
1995
+ * @param callback - a function to call when the event occurs
1996
+ * @return Returns a cleanup function.
1997
+ * @typeParam T - the type of the data that the event will provide
1975
1998
  */
1976
- subscribe(columns:Array<Column>, updateIntervalMs?:number):TableSubscription;
1999
+ addEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):()=>void;
2000
+ nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<Event<T>>;
2001
+ hasListeners(name:string):boolean;
1977
2002
  /**
1978
- * a new table containing the distinct tuples of values from the given columns that are present in the original
1979
- * table. This table can be manipulated as any other table. Sorting is often desired as the default sort is the
1980
- * order of appearance of values from the original table.
1981
- * @param columns -
1982
- * @return Promise of dh.Table
2003
+ * Removes an event listener added to this table.
2004
+ * @param name -
2005
+ * @param callback -
2006
+ * @return
2007
+ * @typeParam T -
1983
2008
  */
1984
- selectDistinct(columns:Column[]):Promise<Table>;
2009
+ removeEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):boolean;
2010
+ }
2011
+
2012
+ /**
2013
+ * Addition optional configuration that can be passed to the {@link dh.CoreClient} constructor.
2014
+ */
2015
+ export class ConnectOptions {
1985
2016
  /**
1986
- * Creates a new copy of this table, so it can be sorted and filtered separately, and maintain a different viewport.
1987
- * @return Promise of dh.Table
2017
+ * Optional map of http header names and values to send to the server with each request.
1988
2018
  */
1989
- copy():Promise<Table>;
2019
+ headers?:{ [key: string]: string; }|null;
1990
2020
  /**
1991
- * a promise that will resolve to a Totals Table of this table. This table will obey the configurations provided as
1992
- * a parameter, or will use the table's default if no parameter is provided, and be updated once per second as
1993
- * necessary. Note that multiple calls to this method will each produce a new TotalsTable which must have close()
1994
- * called on it when not in use.
1995
- * @param config -
1996
- * @return Promise of dh.TotalsTable
2021
+ * True to enable debug logging. At this time, only enables logging for gRPC calls.
1997
2022
  */
1998
- getTotalsTable(config?:TotalsTableConfig|undefined|null):Promise<TotalsTable>;
2023
+ debug?:boolean|null;
1999
2024
  /**
2000
- * a promise that will resolve to a Totals Table of this table, ignoring any filters. See <b>getTotalsTable()</b>
2001
- * above for more specifics.
2002
- * @param config -
2003
- * @return promise of dh.TotalsTable
2025
+ * Set this to true to force the use of websockets when connecting to the deephaven instance, false to force the use
2026
+ * of `fetch`. Ignored if {@link dh.transportFactory} is set.
2027
+ * <p>
2028
+ * Defaults to null, indicating that the server URL should be checked to see if we connect with fetch or websockets.
2004
2029
  */
2005
- getGrandTotalsTable(config?:TotalsTableConfig|undefined|null):Promise<TotalsTable>;
2030
+ useWebsockets?:boolean|null;
2006
2031
  /**
2007
- * a promise that will resolve to a new roll-up <b>TreeTable</b> of this table. Multiple calls to this method will
2008
- * each produce a new <b>TreeTable</b> which must have close() called on it when not in use.
2009
- * @param configObject -
2010
- * @return Promise of dh.TreeTable
2032
+ * The transport factory to use for creating gRPC streams. If specified, the JS API will ignore
2033
+ * {@link dh.useWebsockets} and its own internal logic for determining the appropriate transport to use.
2034
+ * <p>
2035
+ * Defaults to null, indicating that the JS API should determine the appropriate transport to use. If
2036
+ * `useWebsockets` is set to true, the JS API will use websockets, otherwise if the server url begins with
2037
+ * https, it will use fetch, otherwise it will use websockets.
2011
2038
  */
2012
- rollup(configObject:RollupConfig):Promise<TreeTable>;
2039
+ transportFactory?:dh.grpc.GrpcTransportFactory|null;
2040
+
2041
+ constructor();
2042
+ }
2043
+
2044
+ /**
2045
+ * Describes the structure of the column, and if desired can be used to get access to the data to be rendered in this
2046
+ * column.
2047
+ */
2048
+ export class Column {
2013
2049
  /**
2014
- * a promise that will resolve to a new `TreeTable` of this table. Multiple calls to this method will each produce a
2015
- * new `TreeTable` which must have close() called on it when not in use.
2016
- * @param configObject -
2017
- * @return Promise dh.TreeTable
2050
+ * If this column is part of a roll-up tree table, represents the type of the row data that can be found in this
2051
+ * column for leaf nodes if includeConstituents is enabled. Otherwise, it is <b>null</b>.
2052
+ * @return String
2018
2053
  */
2019
- treeTable(configObject:TreeTableConfig):Promise<TreeTable>;
2054
+ readonly constituentType?:string|null;
2055
+ readonly description?:string|null;
2056
+
2057
+ protected constructor();
2058
+
2020
2059
  /**
2021
- * a "frozen" version of this table (a server-side snapshot of the entire source table). Viewports on the frozen
2022
- * table will not update. This does not change the original table, and the new table will not have any of the client
2023
- * side sorts/filters/columns. New client side sorts/filters/columns can be added to the frozen copy.
2024
- * @return Promise of dh.Table
2060
+ * the value for this column in the given row. Type will be consistent with the type of the Column.
2061
+ * @param row -
2062
+ * @return Any
2025
2063
  */
2026
- freeze():Promise<Table>;
2027
- snapshot(baseTable:Table, doInitialSnapshot?:boolean, stampColumns?:string[]):Promise<Table>;
2064
+ get(row:Row):any;
2065
+ getFormat(row:Row):Format;
2028
2066
  /**
2029
- *
2030
- * @inheritDoc
2031
- * @deprecated
2067
+ * Creates a sort builder object, to be used when sorting by this column.
2068
+ * @return {@link dh.Sort}
2032
2069
  */
2033
- join(joinType:string, rightTable:JoinableTable, columnsToMatch:Array<string>, columnsToAdd?:Array<string>|undefined|null, asOfMatchRule?:string|undefined|null):Promise<Table>;
2034
- asOfJoin(rightTable:JoinableTable, columnsToMatch:Array<string>, columnsToAdd?:Array<string>|undefined|null, asOfMatchRule?:string|undefined|null):Promise<Table>;
2035
- crossJoin(rightTable:JoinableTable, columnsToMatch:Array<string>, columnsToAdd?:Array<string>|undefined|null, reserveBits?:number|undefined|null):Promise<Table>;
2036
- exactJoin(rightTable:JoinableTable, columnsToMatch:Array<string>, columnsToAdd?:Array<string>):Promise<Table>;
2037
- naturalJoin(rightTable:JoinableTable, columnsToMatch:Array<string>, columnsToAdd?:Array<string>):Promise<Table>;
2038
- byExternal(keys:object, dropKeys?:boolean):Promise<PartitionedTable>;
2070
+ sort():Sort;
2039
2071
  /**
2040
- * Creates a new PartitionedTable from the contents of the current table, partitioning data based on the specified
2041
- * keys.
2042
- * @param keys -
2043
- * @param dropKeys -
2044
- * @return Promise dh.PartitionedTable
2072
+ * Creates a new value for use in filters based on this column. Used either as a parameter to another filter
2073
+ * operation, or as a builder to create a filter operation.
2074
+ * @return {@link dh.FilterValue}
2045
2075
  */
2046
- partitionBy(keys:object, dropKeys?:boolean):Promise<PartitionedTable>;
2076
+ filter():FilterValue;
2047
2077
  /**
2048
- * a promise that will resolve to ColumnStatistics for the column of this table.
2049
- * @param column -
2050
- * @return Promise of dh.ColumnStatistics
2078
+ * a <b>CustomColumn</b> object to apply using `applyCustomColumns` with the expression specified.
2079
+ * @param expression -
2080
+ * @return {@link dh.CustomColumn}
2051
2081
  */
2052
- getColumnStatistics(column:Column):Promise<ColumnStatistics>;
2082
+ formatColor(expression:string, options?:CustomColumnOptions|undefined|null):CustomColumn;
2053
2083
  /**
2054
- * Seek the row matching the data provided
2055
- * @param startingRow - Row to start the seek from
2056
- * @param column - Column to seek for value on
2057
- * @param valueType - Type of value provided
2058
- * @param seekValue - Value to seek
2059
- * @param insensitive - Optional value to flag a search as case-insensitive. Defaults to `false`.
2060
- * @param contains - Optional value to have the seek value do a contains search instead of exact equality. Defaults to
2061
- * `false`.
2062
- * @param isBackwards - Optional value to seek backwards through the table instead of forwards. Defaults to `false`.
2063
- * @return A promise that resolves to the row value found.
2084
+ * a <b>CustomColumn</b> object to apply using <b>applyCustomColumns</b> with the expression specified.
2085
+ * @param expression -
2086
+ * @return {@link dh.CustomColumn}
2064
2087
  */
2065
- seekRow(startingRow:number, column:Column, valueType:ValueTypeType, seekValue:any, insensitive?:boolean|undefined|null, contains?:boolean|undefined|null, isBackwards?:boolean|undefined|null):Promise<number>;
2088
+ formatNumber(expression:string, options?:CustomColumnOptions|undefined|null):CustomColumn;
2089
+ /**
2090
+ * a <b>CustomColumn</b> object to apply using <b>applyCustomColumns</b> with the expression specified.
2091
+ * @param expression -
2092
+ * @return {@link dh.CustomColumn}
2093
+ */
2094
+ formatDate(expression:string, options?:CustomColumnOptions|undefined|null):CustomColumn;
2066
2095
  toString():string;
2067
2096
  /**
2068
- * True if this table represents a user Input Table (created by InputTable.newInputTable). When true, you may call
2069
- * .inputTable() to add or remove data from the underlying table.
2070
- * @return boolean
2097
+ * Label for this column.
2098
+ * @return String
2071
2099
  */
2072
- get hasInputTable():boolean;
2100
+ get name():string;
2101
+ /**
2102
+ * True if this column is a partition column. Partition columns are used for filtering uncoalesced tables - see
2103
+ * {@link Table.uncoalesced}.
2104
+ * @return true if the column is a partition column
2105
+ */
2106
+ get isPartitionColumn():boolean;
2107
+ /**
2108
+ *
2109
+ * @deprecated do not use. Internal index of the column in the table, to be used as a key on the Row.
2110
+ * @return int
2111
+ */
2112
+ get index():number;
2113
+ get isSortable():boolean;
2073
2114
  /**
2074
- * The columns that are present on this table. This is always all possible columns. If you specify fewer columns in
2075
- * .setViewport(), you will get only those columns in your ViewportData. <b>Number size</b> The total count of rows
2076
- * in the table. The size can and will change; see the <b>sizechanged</b> event for details. Size will be negative
2077
- * in exceptional cases (eg. the table is uncoalesced, see the <b>isUncoalesced</b> property for details).
2078
- * @return {@link dh.Column} array
2115
+ * Type of the row data that can be found in this column.
2116
+ * @return String
2079
2117
  */
2080
- get columns():Array<Column>;
2118
+ get type():string;
2081
2119
  /**
2082
- * The default configuration to be used when building a <b>TotalsTable</b> for this table.
2083
- * @return dh.TotalsTableConfig
2120
+ * Format entire rows colors using the expression specified. Returns a <b>CustomColumn</b> object to apply to a
2121
+ * table using <b>applyCustomColumns</b> with the parameters specified.
2122
+ * @param expression -
2123
+ * @param options -
2124
+ * @return {@link dh.CustomColumn}
2084
2125
  */
2085
- get totalsTableConfig():TotalsTableConfig;
2126
+ static formatRowColor(expression:string, options?:CustomColumnOptions|undefined|null):CustomColumn;
2086
2127
  /**
2087
- * An ordered list of Sorts to apply to the table. To update, call <b>applySort()</b>. Note that this getter will
2088
- * return the new value immediately, even though it may take a little time to update on the server. You may listen
2089
- * for the <b>sortchanged</b> event to know when to update the UI.
2090
- * @return {@link dh.Sort} array
2128
+ * a <b>CustomColumn</b> object to apply using <b>applyCustomColumns</b> with the expression specified.
2129
+ * @param name -
2130
+ * @param expression -
2131
+ * @param options -
2132
+ * @return {@link dh.CustomColumn}
2091
2133
  */
2092
- get sort():Array<Sort>;
2134
+ static createCustomColumn(name:string, expression:string, options?:CustomColumnOptions|undefined|null):CustomColumn;
2135
+ }
2136
+
2137
+ export class IdeSession implements HasEventHandling {
2138
+ static readonly EVENT_COMMANDSTARTED:string;
2139
+ static readonly EVENT_REQUEST_FAILED:string;
2140
+
2141
+ protected constructor();
2142
+
2093
2143
  /**
2094
- * An ordered list of custom column formulas to add to the table, either adding new columns or replacing existing
2095
- * ones. To update, call <b>applyCustomColumns()</b>.
2096
- * @return {@link dh.CustomColumn} array
2144
+ * Load the named table, with columns and size information already fully populated.
2145
+ * @param name - the name of the table to fetch
2146
+ * @param applyPreviewColumns - false to disable previews, defaults to true
2147
+ * @return a {@link Promise} that will resolve to the table, or reject with an error if it cannot be loaded.
2148
+ * @deprecated Added to resolve a specific issue, in the future preview will be applied as part of the subscription.
2097
2149
  */
2098
- get customColumns():Array<CustomColumn>;
2150
+ getTable(name:string, applyPreviewColumns?:boolean):Promise<Table>;
2099
2151
  /**
2100
- * True if this table may receive updates from the server, including size changed events, updated events after
2101
- * initial snapshot.
2102
- * @return boolean
2152
+ * Load the named Figure, including its tables and tablemaps as needed.
2153
+ * @param name -
2154
+ * @return promise of dh.plot.Figure
2103
2155
  */
2104
- get isRefreshing():boolean;
2156
+ getFigure(name:string):Promise<dh.plot.Figure>;
2105
2157
  /**
2106
- * An ordered list of Filters to apply to the table. To update, call applyFilter(). Note that this getter will
2107
- * return the new value immediately, even though it may take a little time to update on the server. You may listen
2108
- * for the <b>filterchanged</b> event to know when to update the UI.
2109
- * @return {@link dh.FilterCondition} array
2158
+ * Loads the named tree table or roll-up table, with column data populated. All nodes are collapsed by default, and
2159
+ * size is presently not available until the viewport is first set.
2160
+ * @param name -
2161
+ * @return {@link Promise} of {@link dh.TreeTable}
2110
2162
  */
2111
- get filter():Array<FilterCondition>;
2163
+ getTreeTable(name:string):Promise<TreeTable>;
2164
+ getHierarchicalTable(name:string):Promise<TreeTable>;
2165
+ getPartitionedTable(name:string):Promise<PartitionedTable>;
2166
+ getObject(definitionObject:dh.ide.VariableDescriptor):Promise<any>;
2167
+ newTable(columnNames:string[], types:string[], data:string[][], userTimeZone:string):Promise<Table>;
2112
2168
  /**
2113
- * The total count of the rows in the table, excluding any filters. Unlike {@link Table.size}, changes to this value
2114
- * will not result in any event. If the table is unfiltered, this will return the same size as {@link Table.size}.
2115
- * If this table was uncoalesced before it was filtered, this will return {@link dh.Table.SIZE_UNCOALESCED}.
2116
- * @return the size of the table before filters, or {@link dh.Table.SIZE_UNCOALESCED}
2169
+ * Merges the given tables into a single table. Assumes all tables have the same structure.
2170
+ * @param tables -
2171
+ * @return {@link Promise} of {@link dh.Table}
2117
2172
  */
2118
- get totalSize():number;
2173
+ mergeTables(tables:Table[]):Promise<Table>;
2174
+ bindTableToVariable(table:Table, name:string):Promise<void>;
2119
2175
  /**
2120
- * The total count of rows in the table. If there is a viewport subscription active, this size will be updated when
2121
- * the subscription updates. If not, and {@link Table.uncoalesced} is true, the size will be
2122
- * {@link dh.Table.SIZE_UNCOALESCED}. Otherwise, the size will be updated when the server's update graph processes changes.
2176
+ * Makes the `object` available to another user or another client on this same server which knows the value of
2177
+ * the `sharedTicketBytes`. Use that sharedTicketBytes value like a one-time use password - any other client
2178
+ * which knows this value can read the same object.
2123
2179
  * <p>
2124
- * When the size changes, the {@link dh.Table.EVENT_SIZECHANGED} event will be fired.
2125
- * @return the size of the table, or {@link dh.Table.SIZE_UNCOALESCED} if there is no subscription and the table is
2126
- * uncoalesced.
2180
+ * Shared objects will remain available using the sharedTicketBytes until the client that first shared them
2181
+ * releases/closes their copy of the object. Whatever side-channel is used to share the bytes, be sure to wait until
2182
+ * the remote end has signaled that it has successfully fetched the object before releasing it from this client.
2183
+ * <p>
2184
+ * Be sure to use an unpredictable value for the shared ticket bytes, like a UUID or other large, random value to
2185
+ * prevent access by unauthorized clients.
2186
+ * @param object - the object to share with another client/user
2187
+ * @param sharedTicketBytes - the value which another client/user must know to obtain the object. It may be a unicode
2188
+ * string (will be encoded as utf8 bytes), or a {@link Uint8Array} value.
2189
+ * @return A promise that will resolve to the value passed as sharedTicketBytes when the object is ready to be read
2190
+ * by another client, or will reject if an error occurs.
2127
2191
  */
2128
- get size():number;
2192
+ shareObject(object:Table|Widget|WidgetExportedObject|PartitionedTable|TotalsTable|TreeTable, sharedTicketBytes:string|Uint8Array):Promise<string|Uint8Array>;
2129
2193
  /**
2130
- * True if this table has been closed.
2131
- * @return boolean
2194
+ * Reads an object shared by another client to this server with the `sharedTicketBytes`. Until the other
2195
+ * client releases this object (or their session ends), the object will be available on the server.
2196
+ * <p>
2197
+ * The type of the object must be passed so that the object can be read from the server correct - the other client
2198
+ * should provide this information.
2199
+ * @param sharedTicketBytes - the value provided by another client/user to obtain the object. It may be a unicode
2200
+ * string (will be encoded as utf8 bytes), or a {@link Uint8Array} value.
2201
+ * @param type - The type of the object, so it can be correctly read from the server
2202
+ * @return A promise that will resolve to the shared object, or will reject with an error if it cannot be read.
2132
2203
  */
2133
- get isClosed():boolean;
2204
+ getSharedObject(sharedTicketBytes:string|Uint8Array, type:string):Promise<any>;
2205
+ subscribeToFieldUpdates(callback:(arg0:dh.ide.VariableChanges)=>void):()=>void;
2206
+ close():void;
2207
+ runCode(code:string):Promise<dh.ide.CommandResult>;
2208
+ onLogMessage(callback:(arg0:dh.ide.LogItem)=>void):()=>void;
2209
+ openDocument(params:object):void;
2210
+ changeDocument(params:object):void;
2211
+ getCompletionItems(params:object):Promise<Array<dh.lsp.CompletionItem>>;
2212
+ getSignatureHelp(params:object):Promise<Array<dh.lsp.SignatureInformation>>;
2213
+ getHover(params:object):Promise<dh.lsp.Hover>;
2214
+ closeDocument(params:object):void;
2134
2215
  /**
2135
- * Read-only. True if this table is uncoalesced, indicating that work must be done before the table can be used.
2136
- * <p>
2137
- * Uncoalesced tables are expensive to operate on - filter to a single partition or range of partitions before
2138
- * subscribing to access only the desired data efficiently. A subscription can be specified without a filter, but
2139
- * this can be very expensive. To see which partitions are available, check each column on the table to see which
2140
- * have {@link Column.isPartitionColumn} as `true`, and filter those columns. To read the possible values
2141
- * for those columns, use {@link Table.selectDistinct}.
2142
- * @return True if the table is uncoaleced and should be filtered before operating on it, otherwise false.
2216
+ * Creates an empty table with the specified number of rows. Optionally columns and types may be specified, but all
2217
+ * values will be null.
2218
+ * @param size -
2219
+ * @return {@link Promise} of {@link dh.Table}
2143
2220
  */
2144
- get isUncoalesced():boolean;
2221
+ emptyTable(size:number):Promise<Table>;
2145
2222
  /**
2146
- * Listen for events on this object.
2147
- * @param name - the name of the event to listen for
2148
- * @param callback - a function to call when the event occurs
2149
- * @return Returns a cleanup function.
2150
- * @typeParam T - the type of the data that the event will provide
2223
+ * Creates a new table that ticks automatically every "periodNanos" nanoseconds. A start time may be provided; if so
2224
+ * the table will be populated with the interval from the specified date until now.
2225
+ * @param periodNanos -
2226
+ * @param startTime -
2227
+ * @return {@link Promise} of {@link dh.Table}
2151
2228
  */
2229
+ timeTable(periodNanos:number, startTime?:DateWrapper):Promise<Table>;
2152
2230
  addEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):()=>void;
2153
2231
  nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<Event<T>>;
2154
2232
  hasListeners(name:string):boolean;
2155
- /**
2156
- * Removes an event listener added to this table.
2157
- * @param name -
2158
- * @param callback -
2159
- * @return
2160
- * @typeParam T -
2161
- */
2162
2233
  removeEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):boolean;
2163
- /**
2164
- * a Sort than can be used to reverse a table. This can be passed into n array in applySort. Note that Tree Tables
2165
- * do not support reverse.
2166
- * @return {@link dh.Sort}
2167
- */
2168
- static reverse():Sort;
2234
+ }
2235
+
2236
+ export class QueryInfo {
2237
+ static readonly EVENT_TABLE_OPENED:string;
2238
+ static readonly EVENT_DISCONNECT:string;
2239
+ static readonly EVENT_RECONNECT:string;
2240
+ static readonly EVENT_CONNECT:string;
2241
+
2242
+ protected constructor();
2169
2243
  }
2170
2244
 
2171
2245
  /**
@@ -2251,52 +2325,44 @@ export namespace dh {
2251
2325
  static search(value:FilterValue, columns?:FilterValue[]):FilterCondition;
2252
2326
  }
2253
2327
 
2254
- export class CustomColumn {
2255
- static readonly TYPE_FORMAT_COLOR:string;
2256
- static readonly TYPE_FORMAT_NUMBER:string;
2257
- static readonly TYPE_FORMAT_DATE:string;
2258
- static readonly TYPE_NEW:string;
2259
-
2260
- protected constructor();
2261
-
2262
- valueOf():string;
2263
- toString():string;
2264
- static from(columnInfo:string):CustomColumn;
2265
- /**
2266
- * The expression to evaluate this custom column.
2267
- * @return String
2268
- */
2269
- get expression():string;
2270
- /**
2271
- * The name of the column to use.
2272
- * @return String
2273
- */
2274
- get name():string;
2275
- /**
2276
- * The options for this custom column.
2277
- * @return CustomColumOptions
2278
- */
2279
- get options():CustomColumnOptions;
2328
+ export class CoreClient implements HasEventHandling {
2329
+ static readonly EVENT_CONNECT:string;
2330
+ static readonly EVENT_DISCONNECT:string;
2331
+ static readonly EVENT_RECONNECT:string;
2332
+ static readonly EVENT_RECONNECT_AUTH_FAILED:string;
2333
+ static readonly EVENT_REQUEST_FAILED:string;
2334
+ static readonly EVENT_REQUEST_STARTED:string;
2335
+ static readonly EVENT_REQUEST_SUCCEEDED:string;
2280
2336
  /**
2281
- * Type of custom column. One of
2282
- *
2283
- * <ul>
2284
- * <li>FORMAT_COLOR</li>
2285
- * <li>FORMAT_NUMBER</li>
2286
- * <li>FORMAT_DATE</li>
2287
- * <li>NEW</li>
2288
- * </ul>
2289
- * @return String
2337
+ * @deprecated
2290
2338
  */
2291
- get type():string;
2339
+ static readonly EVENT_REFRESH_TOKEN_UPDATED:string;
2340
+ static readonly LOGIN_TYPE_PASSWORD:string;
2341
+ static readonly LOGIN_TYPE_ANONYMOUS:string;
2342
+
2343
+ constructor(serverUrl:string, connectOptions?:ConnectOptions);
2344
+
2345
+ running():Promise<CoreClient>;
2346
+ getServerUrl():string;
2347
+ getAuthConfigValues():Promise<string[][]>;
2348
+ login(credentials:LoginCredentials):Promise<void>;
2349
+ relogin(token:RefreshToken):Promise<void>;
2350
+ onConnected(timeoutInMillis?:number):Promise<void>;
2351
+ getServerConfigValues():Promise<string[][]>;
2352
+ getStorageService():dh.storage.StorageService;
2353
+ getAsIdeConnection():Promise<IdeConnection>;
2354
+ disconnect():void;
2355
+ addEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):()=>void;
2356
+ nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<Event<T>>;
2357
+ hasListeners(name:string):boolean;
2358
+ removeEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):boolean;
2292
2359
  }
2293
2360
 
2294
- export class LoginCredentials {
2295
- type?:string|null;
2296
- username?:string|null;
2297
- token?:string|null;
2361
+ export class DateWrapper extends LongWrapper {
2362
+ protected constructor();
2298
2363
 
2299
- constructor();
2364
+ static ofJsDate(date:Date):DateWrapper;
2365
+ asDate():Date;
2300
2366
  }
2301
2367
 
2302
2368
  /**
@@ -2312,273 +2378,219 @@ export namespace dh {
2312
2378
  }
2313
2379
 
2314
2380
  /**
2315
- * Configuration object for running Table.treeTable to produce a hierarchical view of a given "flat" table.
2316
- *
2317
- * Like TotalsTableConfig, `TreeTableConfig` supports an operation map indicating how to aggregate the data, as well as
2318
- * an array of column names which will be the layers in the roll-up tree, grouped at each level. An additional optional
2319
- * value can be provided describing the strategy the engine should use when grouping the rows.
2381
+ * Represents a set of Tables each corresponding to some key. The keys are available locally, but a call must be made to
2382
+ * the server to get each Table. All tables will have the same structure.
2320
2383
  */
2321
- export class TreeTableConfig {
2384
+ export class PartitionedTable implements HasEventHandling {
2385
+ /**
2386
+ * Indicates that a new key has been added to the array of keys, which can now be fetched with getTable.
2387
+ */
2388
+ static readonly EVENT_KEYADDED:string;
2322
2389
  /**
2323
- * The column representing the unique ID for each item
2390
+ * Indicates that a new key has been added to the array of keys, which can now be fetched with getTable.
2324
2391
  */
2325
- idColumn:string;
2392
+ static readonly EVENT_DISCONNECT:string;
2326
2393
  /**
2327
- * The column representing the parent ID for each item
2394
+ * Indicates that a new key has been added to the array of keys, which can now be fetched with getTable.
2328
2395
  */
2329
- parentColumn:string;
2396
+ static readonly EVENT_RECONNECT:string;
2330
2397
  /**
2331
- * Optional parameter indicating if items with an invalid parent ID should be promoted to root. Defaults to false.
2398
+ * Indicates that a new key has been added to the array of keys, which can now be fetched with getTable.
2332
2399
  */
2333
- promoteOrphansToRoot:boolean;
2334
-
2335
- constructor();
2336
- }
2400
+ static readonly EVENT_RECONNECTFAILED:string;
2337
2401
 
2338
- export class DateWrapper extends LongWrapper {
2339
2402
  protected constructor();
2340
2403
 
2341
- static ofJsDate(date:Date):DateWrapper;
2342
- asDate():Date;
2343
- }
2344
-
2345
- /**
2346
- * Describes a grouping and aggregations for a roll-up table. Pass to the <b>Table.rollup</b> function to create a
2347
- * roll-up table.
2348
- */
2349
- export class RollupConfig {
2350
2404
  /**
2351
- * Ordered list of columns to group by to form the hierarchy of the resulting roll-up table.
2405
+ * Fetch the table with the given key. If the key does not exist, returns `null`.
2406
+ * @param key - The key to fetch. An array of values for each key column, in the same order as the key columns are.
2407
+ * @return Promise of dh.Table, or `null` if the key does not exist.
2352
2408
  */
2353
- groupingColumns:Array<String>;
2409
+ getTable(key:object):Promise<Table|undefined|null>;
2354
2410
  /**
2355
- * Mapping from each aggregation name to the ordered list of columns it should be applied to in the resulting
2356
- * roll-up table.
2411
+ * Open a new table that is the result of merging all constituent tables. See
2412
+ * {@link io.deephaven.engine.table.PartitionedTable.merge} for details.
2413
+ * @return A merged representation of the constituent tables.
2357
2414
  */
2358
- aggregations:{ [key: string]: Array<string>; };
2415
+ getMergedTable():Promise<Table>;
2359
2416
  /**
2360
- * Optional parameter indicating if an extra leaf node should be added at the bottom of the hierarchy, showing the
2361
- * rows in the underlying table which make up that grouping. Since these values might be a different type from the
2362
- * rest of the column, any client code must check if TreeRow.hasChildren = false, and if so, interpret those values
2363
- * as if they were Column.constituentType instead of Column.type. Defaults to false.
2417
+ * The set of all currently known keys. This is kept up to date, so getting the list after adding an event listener
2418
+ * for <b>keyadded</b> will ensure no keys are missed.
2419
+ * @return Set of Object
2364
2420
  */
2365
- includeConstituents:boolean;
2366
- includeOriginalColumns?:boolean|null;
2421
+ getKeys():Set<object>;
2367
2422
  /**
2368
- * Optional parameter indicating if original column descriptions should be included. Defaults to true.
2423
+ * Fetch a table containing all the valid keys of the partitioned table.
2424
+ * @return Promise of a Table
2425
+ * @deprecated
2369
2426
  */
2370
- includeDescriptions:boolean;
2371
-
2372
- constructor();
2373
- }
2374
-
2375
- /**
2376
- * A Widget represents a server side object that sends one or more responses to the client. The client can then
2377
- * interpret these responses to see what to render, or how to respond.
2378
- * <p>
2379
- * Most custom object types result in a single response being sent to the client, often with other exported objects, but
2380
- * some will have streamed responses, and allow the client to send follow-up requests of its own. This class's API is
2381
- * backwards compatible, but as such does not offer a way to tell the difference between a streaming or non-streaming
2382
- * object type, the client code that handles the payloads is expected to know what to expect. See
2383
- * {@link dh.WidgetMessageDetails} for more information.
2384
- * <p>
2385
- * When the promise that returns this object resolves, it will have the first response assigned to its fields. Later
2386
- * responses from the server will be emitted as "message" events. When the connection with the server ends, the "close"
2387
- * event will be emitted. In this way, the connection will behave roughly in the same way as a WebSocket - either side
2388
- * can close, and after close no more messages will be processed. There can be some latency in closing locally while
2389
- * remote messages are still pending - it is up to implementations of plugins to handle this case.
2390
- * <p>
2391
- * Also like WebSockets, the plugin API doesn't define how to serialize messages, and just handles any binary payloads.
2392
- * What it does handle however, is allowing those messages to include references to server-side objects with those
2393
- * payloads. Those server side objects might be tables or other built-in types in the Deephaven JS API, or could be
2394
- * objects usable through their own plugins. They also might have no plugin at all, allowing the client to hold a
2395
- * reference to them and pass them back to the server, either to the current plugin instance, or through another API.
2396
- * The `Widget` type does not specify how those objects should be used or their lifecycle, but leaves that
2397
- * entirely to the plugin. Messages will arrive in the order they were sent.
2398
- * <p>
2399
- * This can suggest several patterns for how plugins operate:
2400
- * <ul>
2401
- * <li>The plugin merely exists to transport some other object to the client. This can be useful for objects which can
2402
- * easily be translated to some other type (like a Table) when the user clicks on it. An example of this is
2403
- * `pandas.DataFrame` will result in a widget that only contains a static
2404
- * {@link dh.Table}. Presently, the widget is immediately closed, and only the Table is
2405
- * provided to the JS API consumer.</li>
2406
- * <li>The plugin provides references to Tables and other objects, and those objects can live longer than the object
2407
- * which provided them. One concrete example of this could have been
2408
- * {@link dh.PartitionedTable} when fetching constituent tables, but it was implemented
2409
- * before bidirectional plugins were implemented. Another example of this is plugins that serve as a "factory", giving
2410
- * the user access to table manipulation/creation methods not supported by gRPC or the JS API.</li>
2411
- * <li>The plugin provides reference to Tables and other objects that only make sense within the context of the widget
2412
- * instance, so when the widget goes away, those objects should be released as well. This is also an example of
2413
- * {@link dh.PartitionedTable}, as the partitioned table tracks creation of new keys through
2414
- * an internal table instance.</li>
2415
- * </ul>
2416
- *
2417
- * Handling server objects in messages also has more than one potential pattern that can be used:
2418
- * <ul>
2419
- * <li>One object per message - the message clearly is about that object, no other details required.</li>
2420
- * <li>Objects indexed within their message - as each message comes with a list of objects, those objects can be
2421
- * referenced within the payload by index. This is roughly how {@link dh.plot.Figure}
2422
- * behaves, where the figure descriptor schema includes an index for each created series, describing which table should
2423
- * be used, which columns should be mapped to each axis.</li>
2424
- * <li>Objects indexed since widget creation - each message would append its objects to a list created when the widget
2425
- * was first made, and any new exports that arrive in a new message would be appended to that list. Then, subsequent
2426
- * messages can reference objects already sent. This imposes a limitation where the client cannot release any exports
2427
- * without the server somehow signaling that it will never reference that export again.</li>
2428
- * </ul>
2429
- */
2430
- export class Widget implements WidgetMessageDetails, HasEventHandling {
2431
- static readonly EVENT_MESSAGE:string;
2432
- static readonly EVENT_CLOSE:string;
2433
-
2434
- protected constructor();
2435
-
2427
+ getKeyTable():Promise<Table>;
2436
2428
  /**
2437
- * Ends the client connection to the server.
2429
+ * Fetch the underlying base table of the partitioned table.
2430
+ * @return Promise of a Table
2431
+ */
2432
+ getBaseTable():Promise<Table>;
2433
+ /**
2434
+ * Indicates that this PartitionedTable will no longer be used, removing subcriptions to updated keys, etc. This
2435
+ * will not affect tables in use.
2438
2436
  */
2439
2437
  close():void;
2440
- getDataAsBase64():string;
2441
- getDataAsU8():Uint8Array;
2442
- getDataAsString():string;
2443
2438
  /**
2444
- * Sends a string/bytes payload to the server, along with references to objects that exist on the server.
2445
- * @param msg - string/buffer/view instance that represents data to send
2446
- * @param references - an array of objects that can be safely sent to the server
2439
+ * The count of known keys.
2440
+ * @return int
2441
+ */
2442
+ get size():number;
2443
+ /**
2444
+ * An array of the columns in the tables that can be retrieved from this partitioned table, including both key and
2445
+ * non-key columns.
2446
+ * @return Array of Column
2447
+ */
2448
+ get columns():Column[];
2449
+ /**
2450
+ * An array of all the key columns that the tables are partitioned by.
2451
+ * @return Array of Column
2452
+ */
2453
+ get keyColumns():Column[];
2454
+ /**
2455
+ * Listen for events on this object.
2456
+ * @param name - the name of the event to listen for
2457
+ * @param callback - a function to call when the event occurs
2458
+ * @return Returns a cleanup function.
2459
+ * @typeParam T - the type of the data that the event will provide
2447
2460
  */
2448
- sendMessage(msg:string|ArrayBuffer|ArrayBufferView, references?:Array<Table|Widget|WidgetExportedObject|PartitionedTable|TotalsTable|TreeTable>):void;
2449
2461
  addEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):()=>void;
2450
2462
  nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<Event<T>>;
2451
2463
  hasListeners(name:string):boolean;
2464
+ /**
2465
+ * Removes an event listener added to this table.
2466
+ * @param name -
2467
+ * @param callback -
2468
+ * @return
2469
+ * @typeParam T -
2470
+ */
2452
2471
  removeEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):boolean;
2472
+ }
2473
+
2474
+ /**
2475
+ * This class allows iteration over non-contiguous indexes. In the future, this will support the EcmaScript 2015
2476
+ * Iteration protocol, but for now has one method which returns an iterator, and also supports querying the size.
2477
+ * Additionally, we may add support for creating RangeSet objects to better serve some use cases.
2478
+ */
2479
+ export class RangeSet {
2480
+ protected constructor();
2481
+
2482
+ static ofRange(first:number, last:number):RangeSet;
2483
+ static ofItems(rows:number[]):RangeSet;
2484
+ static ofRanges(ranges:RangeSet[]):RangeSet;
2485
+ static ofSortedRanges(ranges:RangeSet[]):RangeSet;
2453
2486
  /**
2454
- *
2455
- * @return the exported objects sent in the initial message from the server. The client is responsible for closing
2456
- * them when finished using them.
2487
+ * a new iterator over all indexes in this collection.
2488
+ * @return Iterator of {@link dh.LongWrapper}
2457
2489
  */
2458
- get exportedObjects():WidgetExportedObject[];
2490
+ iterator():Iterator<LongWrapper>;
2459
2491
  /**
2460
- *
2461
- * @return the type of this widget
2492
+ * The total count of items contained in this collection. In some cases this can be expensive to compute, and
2493
+ * generally should not be needed except for debugging purposes, or preallocating space (i.e., do not call this
2494
+ * property each time through a loop).
2495
+ * @return double
2462
2496
  */
2463
- get type():string;
2497
+ get size():number;
2464
2498
  }
2465
2499
 
2466
- export class IdeSession implements HasEventHandling {
2467
- static readonly EVENT_COMMANDSTARTED:string;
2468
- static readonly EVENT_REQUEST_FAILED:string;
2500
+ export class CustomColumn {
2501
+ static readonly TYPE_FORMAT_COLOR:string;
2502
+ static readonly TYPE_FORMAT_NUMBER:string;
2503
+ static readonly TYPE_FORMAT_DATE:string;
2504
+ static readonly TYPE_NEW:string;
2469
2505
 
2470
2506
  protected constructor();
2471
2507
 
2508
+ valueOf():string;
2509
+ toString():string;
2510
+ static from(columnInfo:string):CustomColumn;
2472
2511
  /**
2473
- * Load the named table, with columns and size information already fully populated.
2474
- * @param name -
2475
- * @param applyPreviewColumns - optional boolean
2476
- * @return {@link Promise} of {@link dh.Table}
2477
- */
2478
- getTable(name:string, applyPreviewColumns?:boolean):Promise<Table>;
2479
- /**
2480
- * Load the named Figure, including its tables and tablemaps as needed.
2481
- * @param name -
2482
- * @return promise of dh.plot.Figure
2512
+ * The expression to evaluate this custom column.
2513
+ * @return String
2483
2514
  */
2484
- getFigure(name:string):Promise<dh.plot.Figure>;
2515
+ get expression():string;
2485
2516
  /**
2486
- * Loads the named tree table or roll-up table, with column data populated. All nodes are collapsed by default, and
2487
- * size is presently not available until the viewport is first set.
2488
- * @param name -
2489
- * @return {@link Promise} of {@link dh.TreeTable}
2517
+ * The name of the column to use.
2518
+ * @return String
2490
2519
  */
2491
- getTreeTable(name:string):Promise<TreeTable>;
2492
- getHierarchicalTable(name:string):Promise<TreeTable>;
2493
- getPartitionedTable(name:string):Promise<PartitionedTable>;
2494
- getObject(definitionObject:dh.ide.VariableDescriptor):Promise<any>;
2495
- newTable(columnNames:string[], types:string[], data:string[][], userTimeZone:string):Promise<Table>;
2520
+ get name():string;
2496
2521
  /**
2497
- * Merges the given tables into a single table. Assumes all tables have the same structure.
2498
- * @param tables -
2499
- * @return {@link Promise} of {@link dh.Table}
2522
+ * The options for this custom column.
2523
+ * @return CustomColumOptions
2500
2524
  */
2501
- mergeTables(tables:Table[]):Promise<Table>;
2502
- bindTableToVariable(table:Table, name:string):Promise<void>;
2525
+ get options():CustomColumnOptions;
2503
2526
  /**
2504
- * Makes the `object` available to another user or another client on this same server which knows the value of
2505
- * the `sharedTicketBytes`. Use that sharedTicketBytes value like a one-time use password - any other client
2506
- * which knows this value can read the same object.
2507
- * <p>
2508
- * Shared objects will remain available using the sharedTicketBytes until the client that first shared them
2509
- * releases/closes their copy of the object. Whatever side-channel is used to share the bytes, be sure to wait until
2510
- * the remote end has signaled that it has successfully fetched the object before releasing it from this client.
2511
- * <p>
2512
- * Be sure to use an unpredictable value for the shared ticket bytes, like a UUID or other large, random value to
2513
- * prevent access by unauthorized clients.
2514
- * @param object - the object to share with another client/user
2515
- * @param sharedTicketBytes - the value which another client/user must know to obtain the object. It may be a unicode
2516
- * string (will be encoded as utf8 bytes), or a {@link Uint8Array} value.
2517
- * @return A promise that will resolve to the value passed as sharedTicketBytes when the object is ready to be read
2518
- * by another client, or will reject if an error occurs.
2527
+ * Type of custom column. One of
2528
+ *
2529
+ * <ul>
2530
+ * <li>FORMAT_COLOR</li>
2531
+ * <li>FORMAT_NUMBER</li>
2532
+ * <li>FORMAT_DATE</li>
2533
+ * <li>NEW</li>
2534
+ * </ul>
2535
+ * @return String
2519
2536
  */
2520
- shareObject(object:Table|Widget|WidgetExportedObject|PartitionedTable|TotalsTable|TreeTable, sharedTicketBytes:string|Uint8Array):Promise<string|Uint8Array>;
2537
+ get type():string;
2538
+ }
2539
+
2540
+ export class LoginCredentials {
2541
+ type?:string|null;
2542
+ username?:string|null;
2543
+ token?:string|null;
2544
+
2545
+ constructor();
2546
+ }
2547
+
2548
+ /**
2549
+ * Represents a non-viewport subscription to a table, and all data currently known to be present in the subscribed
2550
+ * columns. This class handles incoming snapshots and deltas, and fires events to consumers to notify of data changes.
2551
+ *
2552
+ * Unlike {@link dh.TableViewportSubscription}, the "original" table does not have a reference to this instance, only the
2553
+ * "private" table instance does, since the original cannot modify the subscription, and the private instance must
2554
+ * forward data to it.
2555
+ *
2556
+ * Represents a subscription to the table on the server. Changes made to the table will not be reflected here - the
2557
+ * subscription must be closed and a new one optioned to see those changes. The event model is slightly different from
2558
+ * viewports to make it less expensive to compute for large tables.
2559
+ */
2560
+ export class TableSubscription implements HasEventHandling {
2561
+ protected constructor();
2562
+
2521
2563
  /**
2522
- * Reads an object shared by another client to this server with the `sharedTicketBytes`. Until the other
2523
- * client releases this object (or their session ends), the object will be available on the server.
2524
- * <p>
2525
- * The type of the object must be passed so that the object can be read from the server correct - the other client
2526
- * should provide this information.
2527
- * @param sharedTicketBytes - the value provided by another client/user to obtain the object. It may be a unicode
2528
- * string (will be encoded as utf8 bytes), or a {@link Uint8Array} value.
2529
- * @param type - The type of the object, so it can be correctly read from the server
2530
- * @return A promise that will resolve to the shared object, or will reject with an error if it cannot be read.
2564
+ * Updates the subscription to use the given columns and update interval.
2565
+ * @param columns - the new columns to subscribe to
2566
+ * @param updateIntervalMs - the new update interval, or null/omit to use the default of one second
2531
2567
  */
2532
- getSharedObject(sharedTicketBytes:string|Uint8Array, type:string):Promise<any>;
2533
- subscribeToFieldUpdates(callback:(arg0:dh.ide.VariableChanges)=>void):()=>void;
2534
- close():void;
2535
- runCode(code:string):Promise<dh.ide.CommandResult>;
2536
- onLogMessage(callback:(arg0:dh.ide.LogItem)=>void):()=>void;
2537
- openDocument(params:object):void;
2538
- changeDocument(params:object):void;
2539
- getCompletionItems(params:object):Promise<Array<dh.lsp.CompletionItem>>;
2540
- getSignatureHelp(params:object):Promise<Array<dh.lsp.SignatureInformation>>;
2541
- getHover(params:object):Promise<dh.lsp.Hover>;
2542
- closeDocument(params:object):void;
2568
+ changeSubscription(columns:Array<Column>, updateIntervalMs:number|undefined|null):void;
2569
+ get columns():Array<Column>;
2543
2570
  /**
2544
- * Creates an empty table with the specified number of rows. Optionally columns and types may be specified, but all
2545
- * values will be null.
2546
- * @param size -
2547
- * @return {@link Promise} of {@link dh.Table}
2571
+ * Stops the subscription on the server.
2548
2572
  */
2549
- emptyTable(size:number):Promise<Table>;
2573
+ close():void;
2550
2574
  /**
2551
- * Creates a new table that ticks automatically every "periodNanos" nanoseconds. A start time may be provided; if so
2552
- * the table will be populated with the interval from the specified date until now.
2553
- * @param periodNanos -
2554
- * @param startTime -
2555
- * @return {@link Promise} of {@link dh.Table}
2575
+ * Listen for events on this object.
2576
+ * @param name - the name of the event to listen for
2577
+ * @param callback - a function to call when the event occurs
2578
+ * @return Returns a cleanup function.
2579
+ * @typeParam T - the type of the data that the event will provide
2556
2580
  */
2557
- timeTable(periodNanos:number, startTime?:DateWrapper):Promise<Table>;
2558
2581
  addEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):()=>void;
2559
2582
  nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<Event<T>>;
2560
2583
  hasListeners(name:string):boolean;
2584
+ /**
2585
+ * Removes an event listener added to this table.
2586
+ * @param name -
2587
+ * @param callback -
2588
+ * @return
2589
+ * @typeParam T -
2590
+ */
2561
2591
  removeEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):boolean;
2562
2592
  }
2563
2593
 
2564
- export class QueryInfo {
2565
- static readonly EVENT_TABLE_OPENED:string;
2566
- static readonly EVENT_DISCONNECT:string;
2567
- static readonly EVENT_RECONNECT:string;
2568
- static readonly EVENT_CONNECT:string;
2569
-
2570
- protected constructor();
2571
- }
2572
-
2573
-
2574
- /**
2575
- * Describes the type of node in a rollup table.
2576
- */
2577
- type RollupNodeTypeType = string;
2578
- export class RollupNodeType {
2579
- static readonly ROLLUP_NODE_TYPE_AGGREGATED:RollupNodeTypeType;
2580
- static readonly ROLLUP_NODE_TYPE_CONSTITUENT:RollupNodeTypeType;
2581
- }
2582
2594
 
2583
2595
  type SearchDisplayModeType = string;
2584
2596
  export class SearchDisplayMode {
@@ -2603,16 +2615,6 @@ export namespace dh {
2603
2615
  static readonly TREEMAP:VariableTypeType;
2604
2616
  }
2605
2617
 
2606
- type ValueTypeType = string;
2607
- export class ValueType {
2608
- static readonly STRING:ValueTypeType;
2609
- static readonly NUMBER:ValueTypeType;
2610
- static readonly DOUBLE:ValueTypeType;
2611
- static readonly LONG:ValueTypeType;
2612
- static readonly DATETIME:ValueTypeType;
2613
- static readonly BOOLEAN:ValueTypeType;
2614
- }
2615
-
2616
2618
  /**
2617
2619
  * This enum describes the name of each supported operation/aggregation type when creating a `TreeTable`.
2618
2620
  */
@@ -2635,78 +2637,29 @@ export namespace dh {
2635
2637
  static readonly SKIP:AggregationOperationType;
2636
2638
  }
2637
2639
 
2638
- }
2639
-
2640
- export namespace dh.ide {
2641
-
2642
- /**
2643
- * Describes changes in the current set of variables in the script session. Note that variables that changed value
2644
- * without changing type will be included as <b>updated</b>, but if a new value with one type replaces an old value with
2645
- * a different type, this will be included as an entry in both <b>removed</b> and <b>created</b> to indicate the old and
2646
- * new types.
2647
- */
2648
- export interface VariableChanges {
2649
- /**
2650
- *
2651
- * @return The variables that no longer exist after this operation, or were replaced by some variable with a
2652
- * different type.
2653
- */
2654
- get removed():Array<VariableDefinition>;
2655
- /**
2656
- *
2657
- * @return The variables that were created by this operation, or have a new type.
2658
- */
2659
- get created():Array<VariableDefinition>;
2660
- /**
2661
- *
2662
- * @return The variables that changed value during this operation.
2663
- */
2664
- get updated():Array<VariableDefinition>;
2665
- }
2666
- /**
2667
- * Represents a serialized fishlib LogRecord, suitable for display on javascript clients. A log entry sent from the
2668
- * server.
2669
- */
2670
- export interface LogItem {
2671
- /**
2672
- * The level of the log message, enabling the client to ignore messages.
2673
- * @return String
2674
- */
2675
- get logLevel():string;
2676
- /**
2677
- * Timestamp of the message in microseconds since Jan 1, 1970 UTC.
2678
- * @return double
2679
- */
2680
- get micros():number;
2681
- /**
2682
- * The log message written on the server.
2683
- * @return String
2684
- */
2685
- get message():string;
2686
- }
2687
- /**
2688
- * Specifies a type and either id or name (but not both).
2689
- */
2690
- export interface VariableDescriptor {
2691
- type:string;
2692
- id?:string|null;
2693
- name?:string|null;
2640
+ type ValueTypeType = string;
2641
+ export class ValueType {
2642
+ static readonly STRING:ValueTypeType;
2643
+ static readonly NUMBER:ValueTypeType;
2644
+ static readonly DOUBLE:ValueTypeType;
2645
+ static readonly LONG:ValueTypeType;
2646
+ static readonly DATETIME:ValueTypeType;
2647
+ static readonly BOOLEAN:ValueTypeType;
2694
2648
  }
2649
+
2695
2650
  /**
2696
- * Indicates the result of code run on the server.
2651
+ * Describes the type of node in a rollup table.
2697
2652
  */
2698
- export interface CommandResult {
2699
- /**
2700
- * Describes changes made in the course of this command.
2701
- * @return {@link dh.ide.VariableChanges}.
2702
- */
2703
- get changes():VariableChanges;
2704
- /**
2705
- * If the command failed, the error message will be provided here.
2706
- * @return String
2707
- */
2708
- get error():string;
2653
+ type RollupNodeTypeType = string;
2654
+ export class RollupNodeType {
2655
+ static readonly ROLLUP_NODE_TYPE_AGGREGATED:RollupNodeTypeType;
2656
+ static readonly ROLLUP_NODE_TYPE_CONSTITUENT:RollupNodeTypeType;
2709
2657
  }
2658
+
2659
+ }
2660
+
2661
+ export namespace dh.ide {
2662
+
2710
2663
  /**
2711
2664
  * A format to describe a variable available to be read from the server. Application fields are optional, and only
2712
2665
  * populated when a variable is provided by application mode.
@@ -2722,163 +2675,103 @@ export namespace dh.ide {
2722
2675
  */
2723
2676
  get description():string;
2724
2677
  /**
2725
- * An opaque identifier for this variable
2726
- * @return String
2727
- */
2728
- get id():string;
2729
- /**
2730
- * The type of the variable, one of <b>dh.VariableType</b>
2731
- * @return dh.VariableType.
2732
- */
2733
- get type():dh.VariableTypeType;
2734
- /**
2735
- * The name of the variable, to be used when rendering it to a user
2736
- * @return String
2737
- */
2738
- get title():string;
2739
- /**
2740
- * Optional description for the variable's contents, typically used to provide more detail that wouldn't be
2741
- * reasonable to put in the title
2742
- * @return String
2743
- */
2744
- get applicationId():string;
2745
- /**
2746
- * The name of the application which provided this variable
2747
- * @return String
2748
- */
2749
- get applicationName():string;
2750
- }
2751
- }
2752
-
2753
- export namespace dh.grpc {
2754
-
2755
- /**
2756
- * Options for creating a gRPC stream transport instance.
2757
- */
2758
- export interface GrpcTransportOptions {
2759
- /**
2760
- * The gRPC method URL.
2761
- */
2762
- url:URL;
2763
- /**
2764
- * True to enable debug logging for this stream.
2765
- */
2766
- debug:boolean;
2767
- /**
2768
- * Callback for when headers and status are received. The headers are a map of header names to values, and the
2769
- * status is the HTTP status code. If the connection could not be made, the status should be 0.
2770
- */
2771
- onHeaders:(headers:{ [key: string]: string|Array<string>; },status:number)=>void;
2772
- /**
2773
- * Callback for when a chunk of data is received.
2774
- */
2775
- onChunk:(chunk:Uint8Array)=>void;
2776
- /**
2777
- * Callback for when the stream ends, with an error instance if it can be provided. Note that the present
2778
- * implementation does not consume errors, even if provided.
2779
- */
2780
- onEnd:(error?:Error|undefined|null)=>void;
2781
- }
2782
- /**
2783
- * gRPC transport implementation.
2784
- */
2785
- export interface GrpcTransport {
2678
+ * An opaque identifier for this variable
2679
+ * @return String
2680
+ */
2681
+ get id():string;
2786
2682
  /**
2787
- * Starts the stream, sending metadata to the server.
2788
- * @param metadata - the headers to send the server when opening the connection
2683
+ * The type of the variable, one of <b>dh.VariableType</b>
2684
+ * @return dh.VariableType.
2789
2685
  */
2790
- start(metadata:{ [key: string]: string|Array<string>; }):void;
2686
+ get type():dh.VariableTypeType;
2791
2687
  /**
2792
- * Sends a message to the server.
2793
- * @param msgBytes - bytes to send to the server
2688
+ * The name of the variable, to be used when rendering it to a user
2689
+ * @return String
2794
2690
  */
2795
- sendMessage(msgBytes:Uint8Array):void;
2691
+ get title():string;
2796
2692
  /**
2797
- * "Half close" the stream, signaling to the server that no more messages will be sent, but that the client is still
2798
- * open to receiving messages.
2693
+ * Optional description for the variable's contents, typically used to provide more detail that wouldn't be
2694
+ * reasonable to put in the title
2695
+ * @return String
2799
2696
  */
2800
- finishSend():void;
2697
+ get applicationId():string;
2801
2698
  /**
2802
- * End the stream, both notifying the server that no more messages will be sent nor received, and preventing the
2803
- * client from receiving any more events.
2699
+ * The name of the application which provided this variable
2700
+ * @return String
2804
2701
  */
2805
- cancel():void;
2702
+ get applicationName():string;
2806
2703
  }
2807
2704
  /**
2808
- * Factory for creating gRPC transports.
2705
+ * Describes changes in the current set of variables in the script session. Note that variables that changed value
2706
+ * without changing type will be included as <b>updated</b>, but if a new value with one type replaces an old value with
2707
+ * a different type, this will be included as an entry in both <b>removed</b> and <b>created</b> to indicate the old and
2708
+ * new types.
2809
2709
  */
2810
- export interface GrpcTransportFactory {
2710
+ export interface VariableChanges {
2811
2711
  /**
2812
- * Create a new transport instance.
2813
- * @param options - options for creating the transport
2814
- * @return a transport instance to use for gRPC communication
2712
+ *
2713
+ * @return The variables that no longer exist after this operation, or were replaced by some variable with a
2714
+ * different type.
2815
2715
  */
2816
- create(options:GrpcTransportOptions):GrpcTransport;
2716
+ get removed():Array<VariableDefinition>;
2817
2717
  /**
2818
- * Return true to signal that created transports may have {@link GrpcTransport.sendMessage} called on it
2819
- * more than once before {@link GrpcTransport.finishSend} should be called.
2820
- * @return true to signal that the implementation can stream multiple messages, false otherwise indicating that
2821
- * Open/Next gRPC calls should be used
2718
+ *
2719
+ * @return The variables that were created by this operation, or have a new type.
2822
2720
  */
2823
- get supportsClientStreaming():boolean;
2721
+ get created():Array<VariableDefinition>;
2722
+ /**
2723
+ *
2724
+ * @return The variables that changed value during this operation.
2725
+ */
2726
+ get updated():Array<VariableDefinition>;
2824
2727
  }
2825
- }
2826
-
2827
- export namespace dh.i18n {
2828
-
2829
2728
  /**
2830
- * Exported wrapper of the GWT NumberFormat, plus LongWrapper support
2831
- *
2832
- * Utility class to parse and format numbers, using the same format patterns as are supported by the standard Java
2833
- * implementation used in the Deephaven server and swing client. Works for numeric types including BigInteger and
2834
- * BigDecimal.
2729
+ * Represents a serialized fishlib LogRecord, suitable for display on javascript clients. A log entry sent from the
2730
+ * server.
2835
2731
  */
2836
- export class NumberFormat {
2837
- /**
2838
- * Creates a new number format instance. This generally should be avoided in favor of the static `getFormat`
2839
- * function, which will create and cache an instance so that later calls share the same instance.
2840
- * @param pattern -
2841
- */
2842
- constructor(pattern:string);
2843
-
2732
+ export interface LogItem {
2844
2733
  /**
2845
- * a number format instance matching the specified format. If this format has not been specified before, a new
2846
- * instance will be created and cached for later reuse. Prefer this method to calling the constructor directly to
2847
- * take advantage of caching
2848
- * @param pattern -
2849
- * @return dh.i18n.NumberFormat
2734
+ * The level of the log message, enabling the client to ignore messages.
2735
+ * @return String
2850
2736
  */
2851
- static getFormat(pattern:string):NumberFormat;
2737
+ get logLevel():string;
2852
2738
  /**
2853
- * Parses the given text using the cached format matching the given pattern.
2854
- * @param pattern -
2855
- * @param text -
2739
+ * Timestamp of the message in microseconds since Jan 1, 1970 UTC.
2856
2740
  * @return double
2857
2741
  */
2858
- static parse(pattern:string, text:string):number;
2742
+ get micros():number;
2859
2743
  /**
2860
- * Formats the specified number (or Java <b>long</b>, <b>BigInteger</b> or <b>BigDecimal</b> value) using the cached
2861
- * format matching the given pattern string.
2862
- * @param pattern -
2863
- * @param number -
2744
+ * The log message written on the server.
2864
2745
  * @return String
2865
2746
  */
2866
- static format(pattern:string, number:number|dh.BigIntegerWrapper|dh.BigDecimalWrapper|dh.LongWrapper):string;
2747
+ get message():string;
2748
+ }
2749
+ /**
2750
+ * Indicates the result of code run on the server.
2751
+ */
2752
+ export interface CommandResult {
2867
2753
  /**
2868
- * Parses the given text using this instance's pattern into a JS Number.
2869
- * @param text -
2870
- * @return double
2754
+ * Describes changes made in the course of this command.
2755
+ * @return {@link dh.ide.VariableChanges}.
2871
2756
  */
2872
- parse(text:string):number;
2757
+ get changes():VariableChanges;
2873
2758
  /**
2874
- * Formats the specified number (or Java `long`, `BigInteger` or `BigDecimal` value) using this instance's pattern.
2875
- * @param number -
2759
+ * If the command failed, the error message will be provided here.
2876
2760
  * @return String
2877
2761
  */
2878
- format(number:number|dh.BigIntegerWrapper|dh.BigDecimalWrapper|dh.LongWrapper):string;
2879
- toString():string;
2762
+ get error():string;
2763
+ }
2764
+ /**
2765
+ * Specifies a type and either id or name (but not both).
2766
+ */
2767
+ export interface VariableDescriptor {
2768
+ type:string;
2769
+ id?:string|null;
2770
+ name?:string|null;
2880
2771
  }
2772
+ }
2881
2773
 
2774
+ export namespace dh.i18n {
2882
2775
 
2883
2776
  /**
2884
2777
  * Represents the timezones supported by Deephaven. Can be used to format dates, taking into account the offset changing
@@ -3079,16 +2972,144 @@ export namespace dh.i18n {
3079
2972
  * @param tz -
3080
2973
  * @return
3081
2974
  */
3082
- parse(text:string, tz?:TimeZone):dh.DateWrapper;
2975
+ parse(text:string, tz?:TimeZone):dh.DateWrapper;
2976
+ /**
2977
+ * Parses the given string using this instance's pattern, and returns a JS <b>Date</b> object in milliseconds.
2978
+ * @param text -
2979
+ * @return
2980
+ */
2981
+ parseAsDate(text:string):Date;
2982
+ toString():string;
2983
+ }
2984
+
2985
+ /**
2986
+ * Exported wrapper of the GWT NumberFormat, plus LongWrapper support
2987
+ *
2988
+ * Utility class to parse and format numbers, using the same format patterns as are supported by the standard Java
2989
+ * implementation used in the Deephaven server and swing client. Works for numeric types including BigInteger and
2990
+ * BigDecimal.
2991
+ */
2992
+ export class NumberFormat {
2993
+ /**
2994
+ * Creates a new number format instance. This generally should be avoided in favor of the static `getFormat`
2995
+ * function, which will create and cache an instance so that later calls share the same instance.
2996
+ * @param pattern -
2997
+ */
2998
+ constructor(pattern:string);
2999
+
3000
+ /**
3001
+ * a number format instance matching the specified format. If this format has not been specified before, a new
3002
+ * instance will be created and cached for later reuse. Prefer this method to calling the constructor directly to
3003
+ * take advantage of caching
3004
+ * @param pattern -
3005
+ * @return dh.i18n.NumberFormat
3006
+ */
3007
+ static getFormat(pattern:string):NumberFormat;
3008
+ /**
3009
+ * Parses the given text using the cached format matching the given pattern.
3010
+ * @param pattern -
3011
+ * @param text -
3012
+ * @return double
3013
+ */
3014
+ static parse(pattern:string, text:string):number;
3015
+ /**
3016
+ * Formats the specified number (or Java <b>long</b>, <b>BigInteger</b> or <b>BigDecimal</b> value) using the cached
3017
+ * format matching the given pattern string.
3018
+ * @param pattern -
3019
+ * @param number -
3020
+ * @return String
3021
+ */
3022
+ static format(pattern:string, number:number|dh.BigIntegerWrapper|dh.BigDecimalWrapper|dh.LongWrapper):string;
3023
+ /**
3024
+ * Parses the given text using this instance's pattern into a JS Number.
3025
+ * @param text -
3026
+ * @return double
3027
+ */
3028
+ parse(text:string):number;
3029
+ /**
3030
+ * Formats the specified number (or Java `long`, `BigInteger` or `BigDecimal` value) using this instance's pattern.
3031
+ * @param number -
3032
+ * @return String
3033
+ */
3034
+ format(number:number|dh.BigIntegerWrapper|dh.BigDecimalWrapper|dh.LongWrapper):string;
3035
+ toString():string;
3036
+ }
3037
+
3038
+
3039
+ }
3040
+
3041
+ export namespace dh.grpc {
3042
+
3043
+ /**
3044
+ * Options for creating a gRPC stream transport instance.
3045
+ */
3046
+ export interface GrpcTransportOptions {
3047
+ /**
3048
+ * The gRPC method URL.
3049
+ */
3050
+ url:URL;
3051
+ /**
3052
+ * True to enable debug logging for this stream.
3053
+ */
3054
+ debug:boolean;
3055
+ /**
3056
+ * Callback for when headers and status are received. The headers are a map of header names to values, and the
3057
+ * status is the HTTP status code. If the connection could not be made, the status should be 0.
3058
+ */
3059
+ onHeaders:(headers:{ [key: string]: string|Array<string>; },status:number)=>void;
3060
+ /**
3061
+ * Callback for when a chunk of data is received.
3062
+ */
3063
+ onChunk:(chunk:Uint8Array)=>void;
3064
+ /**
3065
+ * Callback for when the stream ends, with an error instance if it can be provided. Note that the present
3066
+ * implementation does not consume errors, even if provided.
3067
+ */
3068
+ onEnd:(error?:Error|undefined|null)=>void;
3069
+ }
3070
+ /**
3071
+ * Factory for creating gRPC transports.
3072
+ */
3073
+ export interface GrpcTransportFactory {
3074
+ /**
3075
+ * Create a new transport instance.
3076
+ * @param options - options for creating the transport
3077
+ * @return a transport instance to use for gRPC communication
3078
+ */
3079
+ create(options:GrpcTransportOptions):GrpcTransport;
3080
+ /**
3081
+ * Return true to signal that created transports may have {@link GrpcTransport.sendMessage} called on it
3082
+ * more than once before {@link GrpcTransport.finishSend} should be called.
3083
+ * @return true to signal that the implementation can stream multiple messages, false otherwise indicating that
3084
+ * Open/Next gRPC calls should be used
3085
+ */
3086
+ get supportsClientStreaming():boolean;
3087
+ }
3088
+ /**
3089
+ * gRPC transport implementation.
3090
+ */
3091
+ export interface GrpcTransport {
3092
+ /**
3093
+ * Starts the stream, sending metadata to the server.
3094
+ * @param metadata - the headers to send the server when opening the connection
3095
+ */
3096
+ start(metadata:{ [key: string]: string|Array<string>; }):void;
3097
+ /**
3098
+ * Sends a message to the server.
3099
+ * @param msgBytes - bytes to send to the server
3100
+ */
3101
+ sendMessage(msgBytes:Uint8Array):void;
3102
+ /**
3103
+ * "Half close" the stream, signaling to the server that no more messages will be sent, but that the client is still
3104
+ * open to receiving messages.
3105
+ */
3106
+ finishSend():void;
3083
3107
  /**
3084
- * Parses the given string using this instance's pattern, and returns a JS <b>Date</b> object in milliseconds.
3085
- * @param text -
3086
- * @return
3108
+ * End the stream, both notifying the server that no more messages will be sent nor received, and preventing the
3109
+ * client from receiving any more events.
3087
3110
  */
3088
- parseAsDate(text:string):Date;
3089
- toString():string;
3111
+ cancel():void;
3090
3112
  }
3091
-
3092
3113
  }
3093
3114
 
3094
3115
  export namespace dh.plot {
@@ -3113,12 +3134,6 @@ export namespace dh.plot {
3113
3134
  */
3114
3135
  get type():SourceTypeType;
3115
3136
  }
3116
- export interface OneClick {
3117
- setValueForColumn(columnName:string, value:any):void;
3118
- getValueForColumn(columName:string):any;
3119
- get requireAllFiltersToDisplay():boolean;
3120
- get columns():dh.Column[];
3121
- }
3122
3137
  export interface FigureDataUpdatedEvent {
3123
3138
  getArray(series:Series, sourceType:number, mappingFunc?:(arg0:any)=>any):Array<any>;
3124
3139
  get series():Series[];
@@ -3139,50 +3154,6 @@ export namespace dh.plot {
3139
3154
  get plotStyle():SeriesPlotStyleType;
3140
3155
  }
3141
3156
  /**
3142
- * Provides access to the data for displaying in a figure.
3143
- */
3144
- export interface Series {
3145
- readonly isLinesVisible?:boolean|null;
3146
- readonly pointLabelFormat?:string|null;
3147
- readonly yToolTipPattern?:string|null;
3148
- readonly shapeSize?:number|null;
3149
- readonly xToolTipPattern?:string|null;
3150
- readonly isShapesVisible?:boolean|null;
3151
-
3152
- subscribe(forceDisableDownsample?:DownsampleOptions):void;
3153
- /**
3154
- * Disable updates for this Series.
3155
- */
3156
- unsubscribe():void;
3157
- get shape():string;
3158
- /**
3159
- * Contains details on how to access data within the chart for this series. keyed with the way that this series uses
3160
- * the axis.
3161
- * @return {@link dh.plot.SeriesDataSource}
3162
- */
3163
- get sources():SeriesDataSource[];
3164
- get lineColor():string;
3165
- /**
3166
- * The plotting style to use for this series. See <b>SeriesPlotStyle</b> enum for more details.
3167
- * @return int
3168
- */
3169
- get plotStyle():SeriesPlotStyleType;
3170
- get oneClick():OneClick;
3171
- get gradientVisible():boolean;
3172
- get shapeColor():string;
3173
- /**
3174
- * The name for this series.
3175
- * @return String
3176
- */
3177
- get name():string;
3178
- /**
3179
- * indicates that this series belongs to a MultiSeries, null otherwise
3180
- * @return dh.plot.MultiSeries
3181
- */
3182
- get multiSeries():MultiSeries;
3183
- get shapeLabel():string;
3184
- }
3185
- /**
3186
3157
  * Defines one axis used with by series. These instances will be found both on the Chart and the Series instances, and
3187
3158
  * may be shared between Series instances.
3188
3159
  */
@@ -3250,6 +3221,149 @@ export namespace dh.plot {
3250
3221
  get formatType():AxisFormatTypeType;
3251
3222
  get minRange():number;
3252
3223
  }
3224
+ export interface OneClick {
3225
+ setValueForColumn(columnName:string, value:any):void;
3226
+ getValueForColumn(columName:string):any;
3227
+ get requireAllFiltersToDisplay():boolean;
3228
+ get columns():dh.Column[];
3229
+ }
3230
+ /**
3231
+ * Provides access to the data for displaying in a figure.
3232
+ */
3233
+ export interface Series {
3234
+ readonly isLinesVisible?:boolean|null;
3235
+ readonly pointLabelFormat?:string|null;
3236
+ readonly yToolTipPattern?:string|null;
3237
+ readonly shapeSize?:number|null;
3238
+ readonly xToolTipPattern?:string|null;
3239
+ readonly isShapesVisible?:boolean|null;
3240
+
3241
+ subscribe(forceDisableDownsample?:DownsampleOptions):void;
3242
+ /**
3243
+ * Disable updates for this Series.
3244
+ */
3245
+ unsubscribe():void;
3246
+ get shape():string;
3247
+ /**
3248
+ * Contains details on how to access data within the chart for this series. keyed with the way that this series uses
3249
+ * the axis.
3250
+ * @return {@link dh.plot.SeriesDataSource}
3251
+ */
3252
+ get sources():SeriesDataSource[];
3253
+ get lineColor():string;
3254
+ /**
3255
+ * The plotting style to use for this series. See <b>SeriesPlotStyle</b> enum for more details.
3256
+ * @return int
3257
+ */
3258
+ get plotStyle():SeriesPlotStyleType;
3259
+ get oneClick():OneClick;
3260
+ get gradientVisible():boolean;
3261
+ get shapeColor():string;
3262
+ /**
3263
+ * The name for this series.
3264
+ * @return String
3265
+ */
3266
+ get name():string;
3267
+ /**
3268
+ * indicates that this series belongs to a MultiSeries, null otherwise
3269
+ * @return dh.plot.MultiSeries
3270
+ */
3271
+ get multiSeries():MultiSeries;
3272
+ get shapeLabel():string;
3273
+ }
3274
+
3275
+ /**
3276
+ * Helper class to manage snapshots and deltas and keep not only a contiguous JS array of data per column in the
3277
+ * underlying table, but also support a mapping function to let client code translate data in some way for display and
3278
+ * keep that cached as well.
3279
+ */
3280
+ export class ChartData {
3281
+ constructor(table:dh.Table);
3282
+
3283
+ update(tableData:dh.SubscriptionTableData):void;
3284
+ getColumn(columnName:string, mappingFunc:(arg0:any)=>any, currentUpdate:dh.TableData):Array<any>;
3285
+ /**
3286
+ * Removes some column from the cache, avoiding extra computation on incoming events, and possibly freeing some
3287
+ * memory. If this pair of column name and map function are requested again, it will be recomputed from scratch.
3288
+ */
3289
+ removeColumn(columnName:string, mappingFunc:(arg0:any)=>any):void;
3290
+ }
3291
+
3292
+ export class DownsampleOptions {
3293
+ /**
3294
+ * Max number of items in the series before DEFAULT will not attempt to load the series without downsampling. Above
3295
+ * this size if downsample fails or is not applicable, the series won't be loaded unless DISABLE is passed to
3296
+ * series.subscribe().
3297
+ */
3298
+ static MAX_SERIES_SIZE:number;
3299
+ /**
3300
+ * Max number of items in the series where the subscription will be allowed at all. Above this limit, even with
3301
+ * downsampling disabled, the series will not load data.
3302
+ */
3303
+ static MAX_SUBSCRIPTION_SIZE:number;
3304
+ /**
3305
+ * Flag to let the API decide what data will be available, based on the nature of the data, the series, and how the
3306
+ * axes are configured.
3307
+ */
3308
+ static readonly DEFAULT:DownsampleOptions;
3309
+ /**
3310
+ * Flat to entirely disable downsampling, and force all data to load, no matter how many items that would be, up to
3311
+ * the limit of MAX_SUBSCRIPTION_SIZE.
3312
+ */
3313
+ static readonly DISABLE:DownsampleOptions;
3314
+
3315
+ protected constructor();
3316
+ }
3317
+
3318
+ export class SourceDescriptor {
3319
+ axis:AxisDescriptor;
3320
+ table:dh.Table;
3321
+ columnName:string;
3322
+ type:string;
3323
+
3324
+ constructor();
3325
+ }
3326
+
3327
+ /**
3328
+ * A descriptor used with JsFigureFactory.create to create a figure from JS.
3329
+ */
3330
+ export class FigureDescriptor {
3331
+ title?:string|null;
3332
+ titleFont?:string|null;
3333
+ titleColor?:string|null;
3334
+ isResizable?:boolean|null;
3335
+ isDefaultTheme?:boolean|null;
3336
+ updateInterval?:number|null;
3337
+ cols?:number|null;
3338
+ rows?:number|null;
3339
+ charts:Array<ChartDescriptor>;
3340
+
3341
+ constructor();
3342
+ }
3343
+
3344
+ export class AxisDescriptor {
3345
+ formatType:string;
3346
+ type:string;
3347
+ position:string;
3348
+ log?:boolean|null;
3349
+ label?:string|null;
3350
+ labelFont?:string|null;
3351
+ ticksFont?:string|null;
3352
+ formatPattern?:string|null;
3353
+ color?:string|null;
3354
+ minRange?:number|null;
3355
+ maxRange?:number|null;
3356
+ minorTicksVisible?:boolean|null;
3357
+ majorTicksVisible?:boolean|null;
3358
+ minorTickCount?:number|null;
3359
+ gapBetweenMajorTicks?:number|null;
3360
+ majorTickLocations?:Array<number>|null;
3361
+ tickLabelAngle?:number|null;
3362
+ invert?:boolean|null;
3363
+ isTimeAxis?:boolean|null;
3364
+
3365
+ constructor();
3366
+ }
3253
3367
 
3254
3368
  export class SeriesDescriptor {
3255
3369
  plotStyle:string;
@@ -3270,66 +3384,42 @@ export namespace dh.plot {
3270
3384
  constructor();
3271
3385
  }
3272
3386
 
3273
- export class SourceDescriptor {
3274
- axis:AxisDescriptor;
3275
- table:dh.Table;
3276
- columnName:string;
3277
- type:string;
3387
+ export class ChartDescriptor {
3388
+ colspan?:number|null;
3389
+ rowspan?:number|null;
3390
+ series:Array<SeriesDescriptor>;
3391
+ axes:Array<AxisDescriptor>;
3392
+ chartType:string;
3393
+ title?:string|null;
3394
+ titleFont?:string|null;
3395
+ titleColor?:string|null;
3396
+ showLegend?:boolean|null;
3397
+ legendFont?:string|null;
3398
+ legendColor?:string|null;
3399
+ is3d?:boolean|null;
3278
3400
 
3279
3401
  constructor();
3280
3402
  }
3281
3403
 
3282
3404
  /**
3283
- * Helper class to manage snapshots and deltas and keep not only a contiguous JS array of data per column in the
3284
- * underlying table, but also support a mapping function to let client code translate data in some way for display and
3285
- * keep that cached as well.
3405
+ * Helper class for plot downsampling methods.
3286
3406
  */
3287
- export class ChartData {
3288
- constructor(table:dh.Table);
3407
+ export class Downsample {
3408
+ protected constructor();
3289
3409
 
3290
- update(tableData:dh.SubscriptionTableData):void;
3291
- getColumn(columnName:string, mappingFunc:(arg0:any)=>any, currentUpdate:dh.TableData):Array<any>;
3292
3410
  /**
3293
- * Removes some column from the cache, avoiding extra computation on incoming events, and possibly freeing some
3294
- * memory. If this pair of column name and map function are requested again, it will be recomputed from scratch.
3411
+ * Downsamples a table so that the data can be used for a time-series line plot. The downsampled table should have
3412
+ * the same visual fidelity as the original table, but with fewer rows.
3413
+ * @param table - The table to downsample.
3414
+ * @param xCol - The name of the X column to downsample. Must be an Instant or long.
3415
+ * @param yCols - The names of the Y columns to downsample.
3416
+ * @param width - The width of the visible area in pixels.
3417
+ * @param xRange - The visible range as `[start, end]` or null to always use all data.
3418
+ * @return A promise that resolves to the downsampled table.
3295
3419
  */
3296
- removeColumn(columnName:string, mappingFunc:(arg0:any)=>any):void;
3420
+ static runChartDownsample(table:dh.Table, xCol:string, yCols:string[], width:number, xRange?:dh.LongWrapper[]|undefined|null):Promise<dh.Table>;
3297
3421
  }
3298
3422
 
3299
- /**
3300
- * Provides the details for a figure.
3301
- *
3302
- * The Deephaven JS API supports automatic lossless downsampling of time-series data, when that data is plotted in one
3303
- * or more line series. Using a scatter plot or a X-axis of some type other than DateTime will prevent this feature from
3304
- * being applied to a series. To enable this feature, invoke <b>Axis.range(...)</b> to specify the length in pixels of
3305
- * the axis on the screen, and the range of values that are visible, and the server will use that width (and range, if
3306
- * any) to reduce the number of points sent to the client.
3307
- *
3308
- * Downsampling can also be controlled when calling either <b>Figure.subscribe()</b> or <b>Series.subscribe()</b> - both
3309
- * can be given an optional <b>dh.plot.DownsampleOptions</b> argument. Presently only two valid values exist,
3310
- * <b>DEFAULT</b>, and <b>DISABLE</b>, and if no argument is specified, <b>DEFAULT</b> is assumed. If there are more
3311
- * than 30,000 rows in a table, downsampling will be encouraged - data will not load without calling
3312
- * <b>subscribe(DISABLE)</b> or enabling downsampling via <b>Axis.range(...)</b>. If there are more than 200,000 rows,
3313
- * data will refuse to load without downsampling and <b>subscribe(DISABLE)</b> would have no effect.
3314
- *
3315
- * Downsampled data looks like normal data, except that select items have been removed if they would be redundant in the
3316
- * UI given the current configuration. Individual rows are intact, so that a tooltip or some other UI item is sure to be
3317
- * accurate and consistent, and at least the highest and lowest value for each axis will be retained as well, to ensure
3318
- * that the "important" values are visible.
3319
- *
3320
- * Four events exist to help with interacting with downsampled data, all fired from the <b>Figure</b> instance itself.
3321
- * First, <b>downsampleneeded</b> indicates that more than 30,000 rows would be fetched, and so specifying downsampling
3322
- * is no longer optional - it must either be enabled (calling <b>axis.range(...)</b>), or disabled. If the figure is
3323
- * configured for downsampling, when a change takes place that requires that the server perform some downsampling work,
3324
- * the <b>downsamplestarted</b> event will first be fired, which can be used to present a brief loading message,
3325
- * indicating to the user why data is not ready yet - when the server side process is complete,
3326
- * <b>downsamplefinished</b> will be fired. These events will repeat when the range changes, such as when zooming,
3327
- * panning, or resizing the figure. Finally, <b>downsamplefailed</b> indicates that something when wrong when
3328
- * downsampling, or possibly that downsampling cannot be disabled due to the number of rows in the table.
3329
- *
3330
- * At this time, not marked as a ServerObject, due to internal implementation issues which leave the door open to
3331
- * client-created figures.
3332
- */
3333
3423
  export class Figure implements dh.HasEventHandling {
3334
3424
  /**
3335
3425
  * The title of the figure.
@@ -3373,8 +3463,7 @@ export namespace dh.plot {
3373
3463
  */
3374
3464
  static readonly EVENT_DOWNSAMPLENEEDED:string;
3375
3465
 
3376
- protected constructor();
3377
-
3466
+ static create(config:FigureDescriptor):Promise<Figure>;
3378
3467
  subscribe(forceDisableDownsample?:DownsampleOptions):void;
3379
3468
  /**
3380
3469
  * Disable updates for all series in this figure.
@@ -3413,81 +3502,6 @@ export namespace dh.plot {
3413
3502
  * @typeParam T -
3414
3503
  */
3415
3504
  removeEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):boolean;
3416
- static create(config:FigureDescriptor):Promise<Figure>;
3417
- }
3418
-
3419
- export class AxisDescriptor {
3420
- formatType:string;
3421
- type:string;
3422
- position:string;
3423
- log?:boolean|null;
3424
- label?:string|null;
3425
- labelFont?:string|null;
3426
- ticksFont?:string|null;
3427
- formatPattern?:string|null;
3428
- color?:string|null;
3429
- minRange?:number|null;
3430
- maxRange?:number|null;
3431
- minorTicksVisible?:boolean|null;
3432
- majorTicksVisible?:boolean|null;
3433
- minorTickCount?:number|null;
3434
- gapBetweenMajorTicks?:number|null;
3435
- majorTickLocations?:Array<number>|null;
3436
- tickLabelAngle?:number|null;
3437
- invert?:boolean|null;
3438
- isTimeAxis?:boolean|null;
3439
-
3440
- constructor();
3441
- }
3442
-
3443
- export class SeriesDataSourceException {
3444
- protected constructor();
3445
-
3446
- get source():SeriesDataSource;
3447
- get message():string;
3448
- }
3449
-
3450
- /**
3451
- * A descriptor used with JsFigureFactory.create to create a figure from JS.
3452
- */
3453
- export class FigureDescriptor {
3454
- title?:string|null;
3455
- titleFont?:string|null;
3456
- titleColor?:string|null;
3457
- isResizable?:boolean|null;
3458
- isDefaultTheme?:boolean|null;
3459
- updateInterval?:number|null;
3460
- cols?:number|null;
3461
- rows?:number|null;
3462
- charts:Array<ChartDescriptor>;
3463
-
3464
- constructor();
3465
- }
3466
-
3467
- export class DownsampleOptions {
3468
- /**
3469
- * Max number of items in the series before DEFAULT will not attempt to load the series without downsampling. Above
3470
- * this size if downsample fails or is not applicable, the series won't be loaded unless DISABLE is passed to
3471
- * series.subscribe().
3472
- */
3473
- static MAX_SERIES_SIZE:number;
3474
- /**
3475
- * Max number of items in the series where the subscription will be allowed at all. Above this limit, even with
3476
- * downsampling disabled, the series will not load data.
3477
- */
3478
- static MAX_SUBSCRIPTION_SIZE:number;
3479
- /**
3480
- * Flag to let the API decide what data will be available, based on the nature of the data, the series, and how the
3481
- * axes are configured.
3482
- */
3483
- static readonly DEFAULT:DownsampleOptions;
3484
- /**
3485
- * Flat to entirely disable downsampling, and force all data to load, no matter how many items that would be, up to
3486
- * the limit of MAX_SUBSCRIPTION_SIZE.
3487
- */
3488
- static readonly DISABLE:DownsampleOptions;
3489
-
3490
- protected constructor();
3491
3505
  }
3492
3506
 
3493
3507
  /**
@@ -3534,30 +3548,11 @@ export namespace dh.plot {
3534
3548
  get multiSeries():MultiSeries[];
3535
3549
  }
3536
3550
 
3537
- export class FigureSourceException {
3538
- table:dh.Table;
3539
- source:SeriesDataSource;
3540
-
3541
- protected constructor();
3542
- }
3543
-
3544
- /**
3545
- * Helper class for plot downsampling methods.
3546
- */
3547
- export class Downsample {
3551
+ export class SeriesDataSourceException {
3548
3552
  protected constructor();
3549
3553
 
3550
- /**
3551
- * Downsamples a table so that the data can be used for a time-series line plot. The downsampled table should have
3552
- * the same visual fidelity as the original table, but with fewer rows.
3553
- * @param table - The table to downsample.
3554
- * @param xCol - The name of the X column to downsample. Must be an Instant or long.
3555
- * @param yCols - The names of the Y columns to downsample.
3556
- * @param width - The width of the visible area in pixels.
3557
- * @param xRange - The visible range as `[start, end]` or null to always use all data.
3558
- * @return A promise that resolves to the downsampled table.
3559
- */
3560
- static runChartDownsample(table:dh.Table, xCol:string, yCols:string[], width:number, xRange?:dh.LongWrapper[]|undefined|null):Promise<dh.Table>;
3554
+ get source():SeriesDataSource;
3555
+ get message():string;
3561
3556
  }
3562
3557
 
3563
3558
  export class FigureFetchError {
@@ -3567,40 +3562,29 @@ export namespace dh.plot {
3567
3562
  protected constructor();
3568
3563
  }
3569
3564
 
3570
- export class ChartDescriptor {
3571
- colspan?:number|null;
3572
- rowspan?:number|null;
3573
- series:Array<SeriesDescriptor>;
3574
- axes:Array<AxisDescriptor>;
3575
- chartType:string;
3576
- title?:string|null;
3577
- titleFont?:string|null;
3578
- titleColor?:string|null;
3579
- showLegend?:boolean|null;
3580
- legendFont?:string|null;
3581
- legendColor?:string|null;
3582
- is3d?:boolean|null;
3565
+ export class FigureSourceException {
3566
+ table:dh.Table;
3567
+ source:SeriesDataSource;
3583
3568
 
3584
- constructor();
3569
+ protected constructor();
3585
3570
  }
3586
3571
 
3587
3572
 
3573
+ type AxisPositionType = number;
3574
+ export class AxisPosition {
3575
+ static readonly TOP:AxisPositionType;
3576
+ static readonly BOTTOM:AxisPositionType;
3577
+ static readonly LEFT:AxisPositionType;
3578
+ static readonly RIGHT:AxisPositionType;
3579
+ static readonly NONE:AxisPositionType;
3580
+ }
3581
+
3588
3582
  type AxisFormatTypeType = number;
3589
3583
  export class AxisFormatType {
3590
3584
  static readonly CATEGORY:AxisFormatTypeType;
3591
3585
  static readonly NUMBER:AxisFormatTypeType;
3592
3586
  }
3593
3587
 
3594
- type AxisTypeType = number;
3595
- export class AxisType {
3596
- static readonly X:AxisTypeType;
3597
- static readonly Y:AxisTypeType;
3598
- static readonly SHAPE:AxisTypeType;
3599
- static readonly SIZE:AxisTypeType;
3600
- static readonly LABEL:AxisTypeType;
3601
- static readonly COLOR:AxisTypeType;
3602
- }
3603
-
3604
3588
  /**
3605
3589
  * This enum describes the source it is in, and how this aspect of the data in the series should be used to render the
3606
3590
  * item. For example, a point in a error-bar plot might have a X value, three Y values (Y, Y_LOW, Y_HIGH), and some
@@ -3630,13 +3614,29 @@ export namespace dh.plot {
3630
3614
  static readonly HOVER_TEXT:SourceTypeType;
3631
3615
  }
3632
3616
 
3633
- type AxisPositionType = number;
3634
- export class AxisPosition {
3635
- static readonly TOP:AxisPositionType;
3636
- static readonly BOTTOM:AxisPositionType;
3637
- static readonly LEFT:AxisPositionType;
3638
- static readonly RIGHT:AxisPositionType;
3639
- static readonly NONE:AxisPositionType;
3617
+ /**
3618
+ * This enum describes what kind of chart is being drawn. This may limit what kinds of series can be found on it, or how
3619
+ * those series should be rendered.
3620
+ */
3621
+ type ChartTypeType = number;
3622
+ export class ChartType {
3623
+ static readonly XY:ChartTypeType;
3624
+ static readonly PIE:ChartTypeType;
3625
+ static readonly OHLC:ChartTypeType;
3626
+ static readonly CATEGORY:ChartTypeType;
3627
+ static readonly XYZ:ChartTypeType;
3628
+ static readonly CATEGORY_3D:ChartTypeType;
3629
+ static readonly TREEMAP:ChartTypeType;
3630
+ }
3631
+
3632
+ type AxisTypeType = number;
3633
+ export class AxisType {
3634
+ static readonly X:AxisTypeType;
3635
+ static readonly Y:AxisTypeType;
3636
+ static readonly SHAPE:AxisTypeType;
3637
+ static readonly SIZE:AxisTypeType;
3638
+ static readonly LABEL:AxisTypeType;
3639
+ static readonly COLOR:AxisTypeType;
3640
3640
  }
3641
3641
 
3642
3642
  type SeriesPlotStyleType = number;
@@ -3655,25 +3655,26 @@ export namespace dh.plot {
3655
3655
  static readonly TREEMAP:SeriesPlotStyleType;
3656
3656
  }
3657
3657
 
3658
- /**
3659
- * This enum describes what kind of chart is being drawn. This may limit what kinds of series can be found on it, or how
3660
- * those series should be rendered.
3661
- */
3662
- type ChartTypeType = number;
3663
- export class ChartType {
3664
- static readonly XY:ChartTypeType;
3665
- static readonly PIE:ChartTypeType;
3666
- static readonly OHLC:ChartTypeType;
3667
- static readonly CATEGORY:ChartTypeType;
3668
- static readonly XYZ:ChartTypeType;
3669
- static readonly CATEGORY_3D:ChartTypeType;
3670
- static readonly TREEMAP:ChartTypeType;
3671
- }
3672
-
3673
3658
  }
3674
3659
 
3675
3660
  export namespace dh.lsp {
3676
3661
 
3662
+ export class MarkupContent {
3663
+ kind:string;
3664
+ value:string;
3665
+
3666
+ constructor();
3667
+ }
3668
+
3669
+ export class SignatureInformation {
3670
+ label:string;
3671
+ documentation:MarkupContent;
3672
+ parameters:Array<ParameterInformation>;
3673
+ activeParameter:number;
3674
+
3675
+ constructor();
3676
+ }
3677
+
3677
3678
  export class CompletionItem {
3678
3679
  label:string;
3679
3680
  kind:number;
@@ -3691,28 +3692,6 @@ export namespace dh.lsp {
3691
3692
  constructor();
3692
3693
  }
3693
3694
 
3694
- export class ParameterInformation {
3695
- label:string;
3696
- documentation:MarkupContent;
3697
-
3698
- constructor();
3699
- }
3700
-
3701
- export class TextEdit {
3702
- range:Range;
3703
- text:string;
3704
-
3705
- constructor();
3706
- }
3707
-
3708
- export class TextDocumentContentChangeEvent {
3709
- range:Range;
3710
- rangeLength:number;
3711
- text:string;
3712
-
3713
- constructor();
3714
- }
3715
-
3716
3695
  export class Position {
3717
3696
  line:number;
3718
3697
  character:number;
@@ -3726,6 +3705,13 @@ export namespace dh.lsp {
3726
3705
  copy():Position;
3727
3706
  }
3728
3707
 
3708
+ export class TextEdit {
3709
+ range:Range;
3710
+ text:string;
3711
+
3712
+ constructor();
3713
+ }
3714
+
3729
3715
  export class Hover {
3730
3716
  contents:MarkupContent;
3731
3717
  range:Range;
@@ -3733,35 +3719,38 @@ export namespace dh.lsp {
3733
3719
  constructor();
3734
3720
  }
3735
3721
 
3736
- export class MarkupContent {
3737
- kind:string;
3738
- value:string;
3722
+ export class Range {
3723
+ start:Position;
3724
+ end:Position;
3739
3725
 
3740
3726
  constructor();
3727
+
3728
+ isInside(innerStart:Position, innerEnd:Position):boolean;
3741
3729
  }
3742
3730
 
3743
- export class SignatureInformation {
3731
+ export class ParameterInformation {
3744
3732
  label:string;
3745
3733
  documentation:MarkupContent;
3746
- parameters:Array<ParameterInformation>;
3747
- activeParameter:number;
3748
3734
 
3749
3735
  constructor();
3750
3736
  }
3751
3737
 
3752
- export class Range {
3753
- start:Position;
3754
- end:Position;
3738
+ export class TextDocumentContentChangeEvent {
3739
+ range:Range;
3740
+ rangeLength:number;
3741
+ text:string;
3755
3742
 
3756
3743
  constructor();
3757
-
3758
- isInside(innerStart:Position, innerEnd:Position):boolean;
3759
3744
  }
3760
3745
 
3761
3746
  }
3762
3747
 
3763
3748
  export namespace dh.calendar {
3764
3749
 
3750
+ export interface BusinessPeriod {
3751
+ get close():string;
3752
+ get open():string;
3753
+ }
3765
3754
  export interface Holiday {
3766
3755
  /**
3767
3756
  * The date of the Holiday.
@@ -3804,10 +3793,6 @@ export namespace dh.calendar {
3804
3793
  */
3805
3794
  get businessPeriods():Array<BusinessPeriod>;
3806
3795
  }
3807
- export interface BusinessPeriod {
3808
- get close():string;
3809
- get open():string;
3810
- }
3811
3796
 
3812
3797
  type DayOfWeekType = string;
3813
3798
  export class DayOfWeek {