@deephaven/jsapi-types 41.6.0 → 41.8.0

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 +1629 -1629
  2. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -1,6 +1,10 @@
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
+ }
4
8
  /**
5
9
  * This is part of EcmaScript 2015, documented here for completeness. It supports a single method, <b>next()</b>, which
6
10
  * returns an object with a <b>boolean</b> named <b>done</b> (true if there are no more items to return; false
@@ -11,10 +15,6 @@ export interface Iterator<T> {
11
15
  hasNext():boolean;
12
16
  next():IIterableResult<T>;
13
17
  }
14
- export interface IIterableResult<T> {
15
- value:T;
16
- done:boolean;
17
- }
18
18
  export namespace dh.storage {
19
19
 
20
20
  /**
@@ -32,22 +32,6 @@ export namespace dh.storage {
32
32
  get dirname():string;
33
33
  }
34
34
 
35
- /**
36
- * Represents a file's contents loaded from the server. If an etag was specified when loading, client should first test
37
- * if the etag of this instance matches - if so, the contents will be empty, and the client's existing contents should
38
- * be used.
39
- */
40
- export class FileContents {
41
- protected constructor();
42
-
43
- static blob(blob:Blob):FileContents;
44
- static text(...text:string[]):FileContents;
45
- static arrayBuffers(...buffers:ArrayBuffer[]):FileContents;
46
- text():Promise<string>;
47
- arrayBuffer():Promise<ArrayBuffer>;
48
- get etag():string;
49
- }
50
-
51
35
  /**
52
36
  * Remote service to read and write files on the server. Paths use "/" as a separator, and should not start with "/".
53
37
  */
@@ -106,6 +90,22 @@ export namespace dh.storage {
106
90
  createDirectory(path:string):Promise<void>;
107
91
  }
108
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 {
@@ -117,6 +117,179 @@ export namespace dh.storage {
117
117
 
118
118
  export namespace dh {
119
119
 
120
+ /**
121
+ * Wrap LocalTime values for use in JS. Provides text formatting for display and access to the underlying value.
122
+ */
123
+ export interface LocalTimeWrapper {
124
+ valueOf():string;
125
+ getHour():number;
126
+ getMinute():number;
127
+ getSecond():number;
128
+ getNano():number;
129
+ toString():string;
130
+ }
131
+ /**
132
+ * Similar to {@link dh.ViewportData}, but with additional properties to reflect
133
+ * the tree structure.
134
+ */
135
+ export interface TreeViewportData extends TableData {
136
+ get(index:LongWrapper|number):TreeRow;
137
+ getData(index:LongWrapper|number, column:Column):any;
138
+ getFormat(index:LongWrapper|number, column:Column):Format;
139
+ get treeSize():number;
140
+ /**
141
+ * The position of the first returned row within the tree.
142
+ */
143
+ get offset():number;
144
+ get columns():Array<Column>;
145
+ get rows():Array<TreeRow>;
146
+ }
147
+ export interface HasEventHandling {
148
+ /**
149
+ * Listen for events on this object.
150
+ * @param name - the name of the event to listen for
151
+ * @param callback - a function to call when the event occurs
152
+ * @return Returns a cleanup function.
153
+ * @typeParam T - the type of the data that the event will provide
154
+ */
155
+ addEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):()=>void;
156
+ nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<Event<T>>;
157
+ hasListeners(name:string):boolean;
158
+ /**
159
+ * Removes an event listener added to this table.
160
+ * @param name -
161
+ * @param callback -
162
+ * @return
163
+ * @typeParam T -
164
+ */
165
+ removeEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):boolean;
166
+ }
167
+ /**
168
+ * Options for requesting table data, either as a snapshot or a subscription. See subtypes for more specific options:
169
+ * <ul>
170
+ * <li>{@link dh.SnapshotOptions} for snapshot-specific options</li>
171
+ * <li>{@link dh.SubscriptionOptions} for full-table subscription-specific options</li>
172
+ * <li>{@link dh.ViewportSubscriptionOptions} for viewport subscription-specific options</li>
173
+ * </ul>
174
+ */
175
+ export interface DataOptions {
176
+ /**
177
+ * Optional preview instructions for columns in the table data.
178
+ */
179
+ previewOptions?:PreviewOptions|null;
180
+ /**
181
+ * Required property to indicate which columns should be included in the table data.
182
+ */
183
+ columns:Array<Column>;
184
+ }
185
+ /**
186
+ * Represents the contents of a single widget data message from the server, with a binary data paylod and exported
187
+ * objects. Implemented both by Widget itself and by the `event.details` when data is received by the client.
188
+ *
189
+ * Terminology note: the name of this type should probably use "Data" instead of "Message", and the methods should use
190
+ * "payload" rather than "data" to match other platforms and the protobuf itself. These names are instead used for
191
+ * backwards compatibility and to better follow JS expectations.
192
+ */
193
+ export interface WidgetMessageDetails {
194
+ /**
195
+ * Returns the data from this message as a base64-encoded string.
196
+ */
197
+ getDataAsBase64():string;
198
+ /**
199
+ * Returns the data from this message as a Uint8Array.
200
+ */
201
+ getDataAsU8():Uint8Array;
202
+ /**
203
+ * Returns the data from this message as a utf-8 string.
204
+ */
205
+ getDataAsString():string;
206
+ /**
207
+ * Returns an array of exported objects sent from the server. The plugin implementation is now responsible for these
208
+ * objects, and should close them when no longer needed.
209
+ */
210
+ get exportedObjects():WidgetExportedObject[];
211
+ }
212
+ /**
213
+ * Wrap LocalDate values for use in JS. Provides text formatting for display and access to the underlying value.
214
+ */
215
+ export interface LocalDateWrapper {
216
+ valueOf():string;
217
+ getYear():number;
218
+ getMonthValue():number;
219
+ getDayOfMonth():number;
220
+ toString():string;
221
+ }
222
+ /**
223
+ * Options for requesting a viewport subscription to a table.
224
+ */
225
+ export interface ViewportSubscriptionOptions extends SubscriptionOptions {
226
+ /**
227
+ * If true, the viewport will be filled starting from the end of the table, where 0 is the last row of the
228
+ * table. Default is false.
229
+ */
230
+ isReverseViewport?:boolean|null;
231
+ /**
232
+ * The rows to include in the viewport. This can be either a {@link dh.RangeSet} or a single range with
233
+ * `first` and `last` properties.
234
+ */
235
+ rows:RangeSet|SimpleRange;
236
+ }
237
+ /**
238
+ * Similar to the browser `CustomEvent` type, this class holds only the type of the event, and optionally some
239
+ * details about the event.
240
+ * @typeParam T - the type of the event detail
241
+ */
242
+ export interface Event<T> {
243
+ get detail():T;
244
+ get type():string;
245
+ }
246
+ /**
247
+ * Represents a server-side object that may not yet have been fetched by the client. When this object will no longer be
248
+ * used, if {@link fetch} is not called on this object, then {@link close} must be to ensure server-side resources
249
+ * are correctly freed.
250
+ */
251
+ export interface WidgetExportedObject {
252
+ /**
253
+ * Returns the type of this export, typically one of {@link dh.VariableType}, but may also include plugin types. If
254
+ * null, this object cannot be fetched, but can be passed to the server, such as via
255
+ * {@link Widget.sendMessage}.
256
+ * @return the string type of this server-side object, or null.
257
+ */
258
+ readonly type?:string|null;
259
+
260
+ /**
261
+ * Exports another copy of this reference, allowing it to be fetched separately. Results in rejection if the ticket
262
+ * was already closed (either by calling {@link WidgetExportedObject.close} or closing the object returned from {@link WidgetExportedObject.fetch}).
263
+ * @return a promise returning a reexported copy of this object, still referencing the same server-side object.
264
+ */
265
+ reexport():Promise<WidgetExportedObject>;
266
+ /**
267
+ * Returns a promise that will fetch the object represented by this reference. Multiple calls to this will return
268
+ * the same instance.
269
+ * @return a promise that will resolve to a client side object that represents the reference on the server.
270
+ */
271
+ fetch():Promise<any>;
272
+ /**
273
+ * Releases the server-side resources associated with this object, regardless of whether other client-side objects
274
+ * exist that also use that object. Should not be called after fetch() has been invoked.
275
+ */
276
+ close():void;
277
+ }
278
+ /**
279
+ * Options for requesting a snapshot of a table.
280
+ */
281
+ export interface SnapshotOptions extends DataOptions {
282
+ /**
283
+ * If true, the snapshot will be filled starting from the end of the table, where 0 is the last row of the
284
+ * table. Default is false.
285
+ */
286
+ isReverseViewport?:boolean|null;
287
+ /**
288
+ * The rows to include in the snapshot. This can be either a {@link dh.RangeSet} or a single range with
289
+ * `first` and `last` properties.
290
+ */
291
+ rows:RangeSet|SimpleRange;
292
+ }
120
293
  /**
121
294
  * Behaves like a Table, but doesn't expose all of its API for changing the internal state. Instead, state is driven by
122
295
  * the upstream table - when it changes handle, this listens and updates its own handle accordingly.
@@ -271,13 +444,10 @@ export namespace dh {
271
444
  */
272
445
  get isRefreshing():boolean;
273
446
  }
274
- /**
275
- * Simple range consisting only of start and end numbers. Will be migrated to deephaven-core in the near future, and
276
- * subsequently removed from this the coreplus namespace.
277
- */
278
- export interface SimpleRange {
279
- first:number;
280
- last:number;
447
+ export interface ColumnGroup {
448
+ get name():string|null;
449
+ get children():string[]|null;
450
+ get color():string|null;
281
451
  }
282
452
  /**
283
453
  * This object may be pooled internally or discarded and not updated. Do not retain references to it. Instead,
@@ -289,272 +459,58 @@ export namespace dh {
289
459
  get index():LongWrapper;
290
460
  }
291
461
  /**
292
- * Wrap LocalDate values for use in JS. Provides text formatting for display and access to the underlying value.
293
- */
294
- export interface LocalDateWrapper {
295
- valueOf():string;
296
- getYear():number;
297
- getMonthValue():number;
298
- getDayOfMonth():number;
299
- toString():string;
300
- }
301
- /**
302
- * Options for requesting a preview of columns when requesting table data. The two properties
303
- * {@link dh.convertArrayToString} and {@link dh.array} are mutually exclusive.
462
+ * Represents statistics for a given table column.
304
463
  */
305
- export interface PreviewOptions {
464
+ export interface ColumnStatistics {
306
465
  /**
307
- * If true, any array columns will be converted to strings for preview purposes. This is the legacy behavior.
466
+ * Gets the type of formatting that should be used for given statistic.
467
+ * <p>
468
+ * the format type for a statistic. A null return value means that the column formatting should be used.
469
+ * @param name - the display name of the statistic
470
+ * @return String
308
471
  */
309
- convertArrayToString?:boolean|null;
472
+ getType(name:string):string;
310
473
  /**
311
- * Specifies the length of the array to serialize. If the array is longer than this length, one extra element
312
- * will be included - the client is expected to truncate the array and append "..." to indicate that there are
313
- * additional elements. Negative values indicate that the values should be counted from the end of the array
314
- * rather than the beginning. Zero or null indicate that the entire array should be serialized. The default is
315
- * null.
474
+ * 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
475
+ * name to the count of how many times it occurred in the column. This map will be empty for tables containing more
476
+ * than 19 unique values.
477
+ * @return Map of String double
316
478
  */
317
- array?:number|null;
318
- }
319
- /**
320
- * Similar to {@link dh.ViewportData}, but with additional properties to reflect
321
- * the tree structure.
322
- */
323
- export interface TreeViewportData extends TableData {
324
- get(index:LongWrapper|number):TreeRow;
325
- getData(index:LongWrapper|number, column:Column):any;
326
- getFormat(index:LongWrapper|number, column:Column):Format;
327
- get treeSize():number;
328
- /**
329
- * The position of the first returned row within the tree.
330
- */
331
- get offset():number;
332
- get columns():Array<Column>;
333
- get rows():Array<TreeRow>;
334
- }
335
- export interface ColumnGroup {
336
- get name():string|null;
337
- get children():string[]|null;
338
- get color():string|null;
339
- }
340
- /**
341
- * Common interface for various ways of accessing table data and formatting for viewport or non-viewport subscriptions
342
- * on tables, data in trees, and snapshots.
343
- * <p>
344
- * Generally speaking, it is more efficient to access data in column-major order, rather than iterating through each Row
345
- * and accessing all columns that it holds. The {@link rows} accessor can be useful to read row data, but may
346
- * incur other costs - it is likely faster to access data by columns using {@link getData}.
347
- */
348
- export interface TableData {
349
- /**
350
- * Reads a row object from the table, from which any subscribed column can be read.
351
- * @param index - the position or key to access
352
- * @return the row at the given location
353
- */
354
- get(index:LongWrapper|number):Row;
355
- /**
356
- * Reads a specific cell from the table, by row key and column.
357
- * @param index - the row in the table to get data from
358
- * @param column - the column to read
359
- * @return the value in the table
360
- */
361
- getData(index:LongWrapper|number, column:Column):any;
362
- /**
363
- * The server-specified Format to use for the cell at the given position.
364
- * @param index - the row to read
365
- * @param column - the column to read
366
- * @return a Format instance with any server-specified details
367
- */
368
- getFormat(index:LongWrapper|number, column:Column):Format;
369
- get columns():Array<Column>;
370
- /**
371
- * A lazily computed array of all rows available on the client.
372
- */
373
- get rows():Array<Row>;
374
- }
375
- export interface WorkerHeapInfo {
376
- /**
377
- * Total heap size available for this worker.
378
- */
379
- get totalHeapSize():number;
380
- get freeMemory():number;
381
- get maximumHeapSize():number;
382
- }
383
- export interface HasEventHandling {
384
- /**
385
- * Listen for events on this object.
386
- * @param name - the name of the event to listen for
387
- * @param callback - a function to call when the event occurs
388
- * @return Returns a cleanup function.
389
- * @typeParam T - the type of the data that the event will provide
390
- */
391
- addEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):()=>void;
392
- nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<Event<T>>;
393
- hasListeners(name:string):boolean;
394
- /**
395
- * Removes an event listener added to this table.
396
- * @param name -
397
- * @param callback -
398
- * @return
399
- * @typeParam T -
400
- */
401
- removeEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):boolean;
402
- }
403
- /**
404
- * Options for requesting a full-table subscription to a table.
405
- */
406
- export interface SubscriptionOptions extends DataOptions {
479
+ get uniqueValues():Map<string, number>;
407
480
  /**
408
- * Minimum interval between updates, in milliseconds. If not specified, the server default will be used,
409
- * typically 1000ms.
481
+ * Gets a map with the display name of statistics as keys and the numeric stat as a value.
410
482
  * <p>
411
- * Note that setting this to smaller values will not necessarily result in more frequent updates - the server
412
- * may not propagate updates that frequently, or there may be no updates to propagate.
413
- */
414
- updateIntervalMs?:number|null;
415
- }
416
- /**
417
- * Represents a row available in a subscription/snapshot on the client. Do not retain references to rows - they will
418
- * not function properly when the event isn't actively going off (or promise resolving). Instead, wait for the next
419
- * event, or re-request the viewport data.
420
- */
421
- export interface Row {
422
- get(column:Column):any;
423
- getFormat(column:Column):Format;
424
- get index():LongWrapper;
425
- }
426
- /**
427
- * Options for requesting table data, either as a snapshot or a subscription. See subtypes for more specific options:
428
- * <ul>
429
- * <li>{@link dh.SnapshotOptions} for snapshot-specific options</li>
430
- * <li>{@link dh.SubscriptionOptions} for full-table subscription-specific options</li>
431
- * <li>{@link dh.ViewportSubscriptionOptions} for viewport subscription-specific options</li>
432
- * </ul>
433
- */
434
- export interface DataOptions {
435
- /**
436
- * Optional preview instructions for columns in the table data.
437
- */
438
- previewOptions?:PreviewOptions|null;
439
- /**
440
- * Required property to indicate which columns should be included in the table data.
483
+ * A map of each statistic's name to its value.
484
+ * @return Map of String and Object
441
485
  */
442
- columns:Array<Column>;
486
+ get statisticsMap():Map<string, object>;
443
487
  }
444
488
  /**
445
- * Event data, describing the indexes that were added/removed/updated, and providing access to Rows (and thus data in
446
- * columns) either by index, or scanning the complete present index.
489
+ * Extends {@link dh.TableData}, but only contains data in the current viewport. The only API change from TableData is that
490
+ * ViewportData also contains the offset to this data, so that the actual row number may be determined.
447
491
  * <p>
448
- * This class supports two ways of reading the table - checking the changes made since the last update, and reading all
449
- * data currently in the table. While it is more expensive to always iterate over every single row in the table, it may
450
- * in some cases actually be cheaper than maintaining state separately and updating only the changes, though both
451
- * options should be considered.
492
+ * For viewport subscriptions, it is not necessary to read with the key, only with the position.
452
493
  * <p>
453
- * The RangeSet objects allow iterating over the LongWrapper indexes in the table. Note that these "indexes" are not
454
- * necessarily contiguous and may be negative, and represent some internal state on the server, allowing it to keep
455
- * track of data efficiently. Those LongWrapper objects can be passed to the various methods on this instance to read
456
- * specific rows or cells out of the table.
494
+ * Do not assume that the first row in `rows` is the first visible row, because extra rows may be provided for easier
495
+ * scrolling without going to the server.
457
496
  */
458
- export interface SubscriptionTableData extends TableData {
459
- get fullIndex():RangeSet;
497
+ export interface ViewportData extends TableData {
460
498
  /**
461
- * The ordered set of row indexes removed since the last update
462
- * @return the rangeset of removed rows
499
+ * Reads a row object from the viewport, based on its position in the table.
463
500
  */
464
- get removed():RangeSet;
501
+ get(index:LongWrapper|number):ViewportRow;
502
+ getData(index:LongWrapper|number, column:Column):any;
503
+ getFormat(index:LongWrapper|number, column:Column):Format;
465
504
  /**
466
- * The ordered set of row indexes added since the last update.
467
- * @return the rangeset of rows added
505
+ * The position of the first returned row within the table.
468
506
  */
469
- get added():RangeSet;
507
+ get offset():number;
470
508
  get columns():Array<Column>;
471
- /**
472
- * The ordered set of row indexes updated since the last update
473
- * @return the rnageset of modified rows
474
- */
475
- get modified():RangeSet;
476
- /**
477
- * A lazily computed array of all rows available on the client.
478
- */
479
- get rows():Array<Row>;
480
- }
481
- /**
482
- * Wrap LocalTime values for use in JS. Provides text formatting for display and access to the underlying value.
483
- */
484
- export interface LocalTimeWrapper {
485
- valueOf():string;
486
- getHour():number;
487
- getMinute():number;
488
- getSecond():number;
489
- getNano():number;
490
- toString():string;
491
- }
492
- /**
493
- * This object may be pooled internally or discarded and not updated. Do not retain references to it.
494
- */
495
- export interface Format {
496
- /**
497
- * The format string to apply to the value of this cell.
498
- * @return String
499
- */
500
- readonly formatString?:string|null;
501
- /**
502
- * Color to apply to the cell's background, in <b>#rrggbb</b> format.
503
- * @return String
504
- */
505
- readonly backgroundColor?:string|null;
506
- /**
507
- * Color to apply to the text, in <b>#rrggbb</b> format.
508
- * @return String
509
- */
510
- readonly color?:string|null;
511
- /**
512
- *
513
- * @deprecated Prefer formatString. Number format string to apply to the value in this cell.
514
- */
515
- readonly numberFormat?:string|null;
516
- }
517
- /**
518
- * Represents the contents of a single widget data message from the server, with a binary data paylod and exported
519
- * objects. Implemented both by Widget itself and by the `event.details` when data is received by the client.
520
- *
521
- * Terminology note: the name of this type should probably use "Data" instead of "Message", and the methods should use
522
- * "payload" rather than "data" to match other platforms and the protobuf itself. These names are instead used for
523
- * backwards compatibility and to better follow JS expectations.
524
- */
525
- export interface WidgetMessageDetails {
526
- /**
527
- * Returns the data from this message as a base64-encoded string.
528
- */
529
- getDataAsBase64():string;
530
- /**
531
- * Returns the data from this message as a Uint8Array.
532
- */
533
- getDataAsU8():Uint8Array;
534
- /**
535
- * Returns the data from this message as a utf-8 string.
536
- */
537
- getDataAsString():string;
538
- /**
539
- * Returns an array of exported objects sent from the server. The plugin implementation is now responsible for these
540
- * objects, and should close them when no longer needed.
541
- */
542
- get exportedObjects():WidgetExportedObject[];
509
+ get rows():Array<ViewportRow>;
543
510
  }
544
- /**
545
- * Options for requesting a snapshot of a table.
546
- */
547
- export interface SnapshotOptions extends DataOptions {
548
- /**
549
- * If true, the snapshot will be filled starting from the end of the table, where 0 is the last row of the
550
- * table. Default is false.
551
- */
552
- isReverseViewport?:boolean|null;
553
- /**
554
- * The rows to include in the snapshot. This can be either a {@link dh.RangeSet} or a single range with
555
- * `first` and `last` properties.
556
- */
557
- rows:RangeSet|SimpleRange;
511
+ export interface RefreshToken {
512
+ get bytes():string;
513
+ get expiry():number;
558
514
  }
559
515
  /**
560
516
  * Represents a table which can be joined to another table. Current implementations are {@link dh.Table} and
@@ -646,13 +602,49 @@ export namespace dh {
646
602
  naturalJoin(rightTable:JoinableTable, columnsToMatch:Array<string>, columnsToAdd?:Array<string>|undefined|null):Promise<Table>;
647
603
  }
648
604
  /**
649
- * Similar to the browser `CustomEvent` type, this class holds only the type of the event, and optionally some
650
- * details about the event.
651
- * @typeParam T - the type of the event detail
605
+ * Row implementation that also provides additional read-only properties. represents visible rows in the table, but
606
+ * with additional properties to reflect the tree structure.
652
607
  */
653
- export interface Event<T> {
654
- get detail():T;
655
- get type():string;
608
+ export interface TreeRow extends Row {
609
+ get(column:Column):any;
610
+ getFormat(column:Column):Format;
611
+ /**
612
+ * True if this node is currently expanded to show its children; false otherwise. Those children will be the
613
+ * rows below this one with a greater depth than this one.
614
+ * @return boolean
615
+ */
616
+ get isExpanded():boolean;
617
+ /**
618
+ * The number of levels above this node; zero for top level nodes. Generally used by the UI to indent the row
619
+ * and its expand/collapse icon.
620
+ * @return int
621
+ */
622
+ get depth():number;
623
+ /**
624
+ * True if this node has children and can be expanded; false otherwise. Note that this value may change when the
625
+ * table updates, depending on the table's configuration.
626
+ * @return boolean
627
+ */
628
+ get hasChildren():boolean;
629
+ get index():LongWrapper;
630
+ }
631
+ export interface WorkerHeapInfo {
632
+ /**
633
+ * Total heap size available for this worker.
634
+ */
635
+ get totalHeapSize():number;
636
+ get freeMemory():number;
637
+ get maximumHeapSize():number;
638
+ }
639
+ /**
640
+ * Represents a row available in a subscription/snapshot on the client. Do not retain references to rows - they will
641
+ * not function properly when the event isn't actively going off (or promise resolving). Instead, wait for the next
642
+ * event, or re-request the viewport data.
643
+ */
644
+ export interface Row {
645
+ get(column:Column):any;
646
+ getFormat(column:Column):Format;
647
+ get index():LongWrapper;
656
648
  }
657
649
  export interface LayoutHints {
658
650
  readonly searchDisplayMode?:SearchDisplayModeType|null;
@@ -665,324 +657,565 @@ export namespace dh {
665
657
  get backColumns():string[]|null;
666
658
  }
667
659
  /**
668
- * Extends {@link dh.TableData}, but only contains data in the current viewport. The only API change from TableData is that
669
- * ViewportData also contains the offset to this data, so that the actual row number may be determined.
670
- * <p>
671
- * For viewport subscriptions, it is not necessary to read with the key, only with the position.
672
- * <p>
673
- * Do not assume that the first row in `rows` is the first visible row, because extra rows may be provided for easier
674
- * scrolling without going to the server.
660
+ * This object may be pooled internally or discarded and not updated. Do not retain references to it.
675
661
  */
676
- export interface ViewportData extends TableData {
662
+ export interface Format {
677
663
  /**
678
- * Reads a row object from the viewport, based on its position in the table.
664
+ * The format string to apply to the value of this cell.
665
+ * @return String
679
666
  */
680
- get(index:LongWrapper|number):ViewportRow;
681
- getData(index:LongWrapper|number, column:Column):any;
682
- getFormat(index:LongWrapper|number, column:Column):Format;
667
+ readonly formatString?:string|null;
683
668
  /**
684
- * The position of the first returned row within the table.
669
+ * Color to apply to the cell's background, in <b>#rrggbb</b> format.
670
+ * @return String
685
671
  */
686
- get offset():number;
687
- get columns():Array<Column>;
688
- get rows():Array<ViewportRow>;
689
- }
690
- /**
691
- * Represents statistics for a given table column.
692
- */
693
- export interface ColumnStatistics {
672
+ readonly backgroundColor?:string|null;
694
673
  /**
695
- * Gets the type of formatting that should be used for given statistic.
696
- * <p>
697
- * the format type for a statistic. A null return value means that the column formatting should be used.
698
- * @param name - the display name of the statistic
674
+ * Color to apply to the text, in <b>#rrggbb</b> format.
699
675
  * @return String
700
676
  */
701
- getType(name:string):string;
677
+ readonly color?:string|null;
702
678
  /**
703
- * 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
704
- * name to the count of how many times it occurred in the column. This map will be empty for tables containing more
705
- * than 19 unique values.
706
- * @return Map of String double
679
+ *
680
+ * @deprecated Prefer formatString. Number format string to apply to the value in this cell.
707
681
  */
708
- get uniqueValues():Map<string, number>;
682
+ readonly numberFormat?:string|null;
683
+ }
684
+ /**
685
+ * Options for requesting a full-table subscription to a table.
686
+ */
687
+ export interface SubscriptionOptions extends DataOptions {
709
688
  /**
710
- * Gets a map with the display name of statistics as keys and the numeric stat as a value.
689
+ * Minimum interval between updates, in milliseconds. If not specified, the server default will be used,
690
+ * typically 1000ms.
711
691
  * <p>
712
- * A map of each statistic's name to its value.
713
- * @return Map of String and Object
692
+ * Note that setting this to smaller values will not necessarily result in more frequent updates - the server
693
+ * may not propagate updates that frequently, or there may be no updates to propagate.
714
694
  */
715
- get statisticsMap():Map<string, object>;
695
+ updateIntervalMs?:number|null;
716
696
  }
717
697
  /**
718
- * Options for requesting a viewport subscription to a table.
698
+ * Options for requesting a preview of columns when requesting table data. The two properties
699
+ * {@link dh.convertArrayToString} and {@link dh.array} are mutually exclusive.
719
700
  */
720
- export interface ViewportSubscriptionOptions extends SubscriptionOptions {
701
+ export interface PreviewOptions {
721
702
  /**
722
- * If true, the viewport will be filled starting from the end of the table, where 0 is the last row of the
723
- * table. Default is false.
703
+ * If true, any array columns will be converted to strings for preview purposes. This is the legacy behavior.
724
704
  */
725
- isReverseViewport?:boolean|null;
705
+ convertArrayToString?:boolean|null;
726
706
  /**
727
- * The rows to include in the viewport. This can be either a {@link dh.RangeSet} or a single range with
728
- * `first` and `last` properties.
707
+ * Specifies the length of the array to serialize. If the array is longer than this length, one extra element
708
+ * will be included - the client is expected to truncate the array and append "..." to indicate that there are
709
+ * additional elements. Negative values indicate that the values should be counted from the end of the array
710
+ * rather than the beginning. Zero or null indicate that the entire array should be serialized. The default is
711
+ * null.
729
712
  */
730
- rows:RangeSet|SimpleRange;
713
+ array?:number|null;
731
714
  }
732
715
  /**
733
- * Represents a server-side object that may not yet have been fetched by the client. When this object will no longer be
734
- * used, if {@link fetch} is not called on this object, then {@link close} must be to ensure server-side resources
735
- * are correctly freed.
716
+ * Common interface for various ways of accessing table data and formatting for viewport or non-viewport subscriptions
717
+ * on tables, data in trees, and snapshots.
718
+ * <p>
719
+ * Generally speaking, it is more efficient to access data in column-major order, rather than iterating through each Row
720
+ * and accessing all columns that it holds. The {@link rows} accessor can be useful to read row data, but may
721
+ * incur other costs - it is likely faster to access data by columns using {@link getData}.
736
722
  */
737
- export interface WidgetExportedObject {
723
+ export interface TableData {
738
724
  /**
739
- * Returns the type of this export, typically one of {@link dh.VariableType}, but may also include plugin types. If
740
- * null, this object cannot be fetched, but can be passed to the server, such as via
741
- * {@link Widget.sendMessage}.
742
- * @return the string type of this server-side object, or null.
725
+ * Reads a row object from the table, from which any subscribed column can be read.
726
+ * @param index - the position or key to access
727
+ * @return the row at the given location
743
728
  */
744
- readonly type?:string|null;
745
-
729
+ get(index:LongWrapper|number):Row;
746
730
  /**
747
- * Exports another copy of this reference, allowing it to be fetched separately. Results in rejection if the ticket
748
- * was already closed (either by calling {@link WidgetExportedObject.close} or closing the object returned from {@link WidgetExportedObject.fetch}).
749
- * @return a promise returning a reexported copy of this object, still referencing the same server-side object.
731
+ * Reads a specific cell from the table, by row key and column.
732
+ * @param index - the row in the table to get data from
733
+ * @param column - the column to read
734
+ * @return the value in the table
750
735
  */
751
- reexport():Promise<WidgetExportedObject>;
736
+ getData(index:LongWrapper|number, column:Column):any;
752
737
  /**
753
- * Returns a promise that will fetch the object represented by this reference. Multiple calls to this will return
754
- * the same instance.
755
- * @return a promise that will resolve to a client side object that represents the reference on the server.
738
+ * The server-specified Format to use for the cell at the given position.
739
+ * @param index - the row to read
740
+ * @param column - the column to read
741
+ * @return a Format instance with any server-specified details
756
742
  */
757
- fetch():Promise<any>;
743
+ getFormat(index:LongWrapper|number, column:Column):Format;
744
+ get columns():Array<Column>;
758
745
  /**
759
- * Releases the server-side resources associated with this object, regardless of whether other client-side objects
760
- * exist that also use that object. Should not be called after fetch() has been invoked.
746
+ * A lazily computed array of all rows available on the client.
761
747
  */
762
- close():void;
748
+ get rows():Array<Row>;
763
749
  }
764
750
  /**
765
- * Row implementation that also provides additional read-only properties. represents visible rows in the table, but
766
- * with additional properties to reflect the tree structure.
751
+ * Event data, describing the indexes that were added/removed/updated, and providing access to Rows (and thus data in
752
+ * columns) either by index, or scanning the complete present index.
753
+ * <p>
754
+ * This class supports two ways of reading the table - checking the changes made since the last update, and reading all
755
+ * data currently in the table. While it is more expensive to always iterate over every single row in the table, it may
756
+ * in some cases actually be cheaper than maintaining state separately and updating only the changes, though both
757
+ * options should be considered.
758
+ * <p>
759
+ * The RangeSet objects allow iterating over the LongWrapper indexes in the table. Note that these "indexes" are not
760
+ * necessarily contiguous and may be negative, and represent some internal state on the server, allowing it to keep
761
+ * track of data efficiently. Those LongWrapper objects can be passed to the various methods on this instance to read
762
+ * specific rows or cells out of the table.
767
763
  */
768
- export interface TreeRow extends Row {
769
- get(column:Column):any;
770
- getFormat(column:Column):Format;
764
+ export interface SubscriptionTableData extends TableData {
765
+ get fullIndex():RangeSet;
771
766
  /**
772
- * True if this node is currently expanded to show its children; false otherwise. Those children will be the
773
- * rows below this one with a greater depth than this one.
774
- * @return boolean
767
+ * The ordered set of row indexes removed since the last update
768
+ * @return the rangeset of removed rows
775
769
  */
776
- get isExpanded():boolean;
770
+ get removed():RangeSet;
777
771
  /**
778
- * The number of levels above this node; zero for top level nodes. Generally used by the UI to indent the row
779
- * and its expand/collapse icon.
780
- * @return int
772
+ * The ordered set of row indexes added since the last update.
773
+ * @return the rangeset of rows added
781
774
  */
782
- get depth():number;
775
+ get added():RangeSet;
776
+ get columns():Array<Column>;
783
777
  /**
784
- * True if this node has children and can be expanded; false otherwise. Note that this value may change when the
785
- * table updates, depending on the table's configuration.
786
- * @return boolean
778
+ * The ordered set of row indexes updated since the last update
779
+ * @return the rnageset of modified rows
787
780
  */
788
- get hasChildren():boolean;
789
- get index():LongWrapper;
781
+ get modified():RangeSet;
782
+ /**
783
+ * A lazily computed array of all rows available on the client.
784
+ */
785
+ get rows():Array<Row>;
790
786
  }
791
- export interface RefreshToken {
792
- get bytes():string;
793
- get expiry():number;
787
+ /**
788
+ * Simple range consisting only of start and end numbers. Will be migrated to deephaven-core in the near future, and
789
+ * subsequently removed from this the coreplus namespace.
790
+ */
791
+ export interface SimpleRange {
792
+ first:number;
793
+ last:number;
794
794
  }
795
795
 
796
- export class IdeSession implements HasEventHandling {
797
- static readonly EVENT_COMMANDSTARTED:string;
798
- static readonly EVENT_REQUEST_FAILED:string;
796
+ export class DateWrapper extends LongWrapper {
797
+ protected constructor();
798
+
799
+ static ofJsDate(date:Date):DateWrapper;
800
+ asDate():Date;
801
+ }
799
802
 
803
+ export class LongWrapper {
800
804
  protected constructor();
801
805
 
806
+ static ofString(str:string):LongWrapper;
807
+ asNumber():number;
808
+ valueOf():string;
809
+ toString():string;
810
+ }
811
+
812
+ /**
813
+ * Describes a grouping and aggregations for a roll-up table. Pass to the <b>Table.rollup</b> function to create a
814
+ * roll-up table.
815
+ */
816
+ export class RollupConfig {
802
817
  /**
803
- * Load the named table, with columns and size information already fully populated.
804
- * @param name - the name of the table to fetch
805
- * @param applyPreviewColumns - false to disable previews, defaults to true
806
- * @return a {@link Promise} that will resolve to the table, or reject with an error if it cannot be loaded.
807
- * @deprecated Added to resolve a specific issue, in the future preview will be applied as part of the subscription.
818
+ * Ordered list of columns to group by to form the hierarchy of the resulting roll-up table.
808
819
  */
809
- getTable(name:string, applyPreviewColumns?:boolean):Promise<Table>;
820
+ groupingColumns:Array<String>;
810
821
  /**
811
- * Load the named Figure, including its tables and tablemaps as needed.
812
- * @param name -
813
- * @return promise of dh.plot.Figure
822
+ * Mapping from each aggregation name to the ordered list of columns it should be applied to in the resulting
823
+ * roll-up table.
814
824
  */
815
- getFigure(name:string):Promise<dh.plot.Figure>;
825
+ aggregations:{ [key: string]: Array<string>; };
816
826
  /**
817
- * Loads the named tree table or roll-up table, with column data populated. All nodes are collapsed by default, and
818
- * size is presently not available until the viewport is first set.
819
- * @param name -
820
- * @return {@link Promise} of {@link dh.TreeTable}
827
+ * Optional parameter indicating if an extra leaf node should be added at the bottom of the hierarchy, showing the
828
+ * rows in the underlying table which make up that grouping. Since these values might be a different type from the
829
+ * rest of the column, any client code must check if TreeRow.hasChildren = false, and if so, interpret those values
830
+ * as if they were Column.constituentType instead of Column.type. Defaults to false.
821
831
  */
822
- getTreeTable(name:string):Promise<TreeTable>;
823
- getHierarchicalTable(name:string):Promise<TreeTable>;
824
- getPartitionedTable(name:string):Promise<PartitionedTable>;
825
- getObject(definitionObject:dh.ide.VariableDescriptor):Promise<any>;
826
- newTable(columnNames:string[], types:string[], data:string[][], userTimeZone:string):Promise<Table>;
832
+ includeConstituents:boolean;
833
+ includeOriginalColumns?:boolean|null;
827
834
  /**
828
- * Merges the given tables into a single table. Assumes all tables have the same structure.
829
- * @param tables -
830
- * @return {@link Promise} of {@link dh.Table}
835
+ * Optional parameter indicating if original column descriptions should be included. Defaults to true.
831
836
  */
832
- mergeTables(tables:Table[]):Promise<Table>;
833
- bindTableToVariable(table:Table, name:string):Promise<void>;
837
+ includeDescriptions:boolean;
838
+
839
+ constructor();
840
+ }
841
+
842
+ /**
843
+ * Wrap BigInteger values for use in JS. Provides text formatting for display and access to the underlying value.
844
+ */
845
+ export class BigIntegerWrapper {
846
+ protected constructor();
847
+
848
+ static ofString(str:string):BigIntegerWrapper;
849
+ asNumber():number;
850
+ valueOf():string;
851
+ toString():string;
852
+ equals(o:object):boolean;
853
+ hashCode():number;
854
+ }
855
+
856
+ /**
857
+ * Describes how a Totals Table will be generated from its parent table. Each table has a default (which may be null)
858
+ * indicating how that table was configured when it was declared, and each Totals Table has a similar property
859
+ * describing how it was created. Both the <b>Table.getTotalsTable</b> and <b>Table.getGrandTotalsTable</b> methods take
860
+ * this config as an optional parameter - without it, the table's default will be used, or if null, a default instance
861
+ * of <b>TotalsTableConfig</b> will be supplied.
862
+ *
863
+ * This class has a no-arg constructor, allowing an instance to be made with the default values provided. However, any
864
+ * JS object can be passed in to the methods which accept instances of this type, provided their values adhere to the
865
+ * expected formats.
866
+ */
867
+ export class TotalsTableConfig {
834
868
  /**
835
- * Makes the `object` available to another user or another client on this same server which knows the value of
836
- * the `sharedTicketBytes`. Use that sharedTicketBytes value like a one-time use password - any other client
837
- * which knows this value can read the same object.
838
- * <p>
839
- * Shared objects will remain available using the sharedTicketBytes until the client that first shared them
840
- * releases/closes their copy of the object. Whatever side-channel is used to share the bytes, be sure to wait until
841
- * the remote end has signaled that it has successfully fetched the object before releasing it from this client.
842
- * <p>
843
- * Be sure to use an unpredictable value for the shared ticket bytes, like a UUID or other large, random value to
844
- * prevent access by unauthorized clients.
845
- * @param object - the object to share with another client/user
846
- * @param sharedTicketBytes - the value which another client/user must know to obtain the object. It may be a unicode
847
- * string (will be encoded as utf8 bytes), or a {@link Uint8Array} value.
848
- * @return A promise that will resolve to the value passed as sharedTicketBytes when the object is ready to be read
849
- * by another client, or will reject if an error occurs.
869
+ * @deprecated
850
870
  */
851
- shareObject(object:Table|Widget|WidgetExportedObject|PartitionedTable|TotalsTable|TreeTable, sharedTicketBytes:string|Uint8Array):Promise<string|Uint8Array>;
871
+ static readonly COUNT:string;
852
872
  /**
853
- * Reads an object shared by another client to this server with the `sharedTicketBytes`. Until the other
854
- * client releases this object (or their session ends), the object will be available on the server.
855
- * <p>
856
- * The type of the object must be passed so that the object can be read from the server correct - the other client
857
- * should provide this information.
858
- * @param sharedTicketBytes - the value provided by another client/user to obtain the object. It may be a unicode
859
- * string (will be encoded as utf8 bytes), or a {@link Uint8Array} value.
860
- * @param type - The type of the object, so it can be correctly read from the server
861
- * @return A promise that will resolve to the shared object, or will reject with an error if it cannot be read.
873
+ * @deprecated
862
874
  */
863
- getSharedObject(sharedTicketBytes:string|Uint8Array, type:string):Promise<any>;
864
- subscribeToFieldUpdates(callback:(arg0:dh.ide.VariableChanges)=>void):()=>void;
865
- close():void;
866
- runCode(code:string):Promise<dh.ide.CommandResult>;
867
- onLogMessage(callback:(arg0:dh.ide.LogItem)=>void):()=>void;
868
- openDocument(params:object):void;
869
- changeDocument(params:object):void;
870
- getCompletionItems(params:object):Promise<Array<dh.lsp.CompletionItem>>;
871
- getSignatureHelp(params:object):Promise<Array<dh.lsp.SignatureInformation>>;
872
- getHover(params:object):Promise<dh.lsp.Hover>;
873
- closeDocument(params:object):void;
875
+ static readonly MIN:string;
874
876
  /**
875
- * Creates an empty table with the specified number of rows. Optionally columns and types may be specified, but all
876
- * values will be null.
877
- * @param size -
878
- * @return {@link Promise} of {@link dh.Table}
877
+ * @deprecated
879
878
  */
880
- emptyTable(size:number):Promise<Table>;
879
+ static readonly MAX:string;
881
880
  /**
882
- * Creates a new table that ticks automatically every "periodNanos" nanoseconds. A start time may be provided; if so
883
- * the table will be populated with the interval from the specified date until now.
884
- * @param periodNanos -
885
- * @param startTime -
886
- * @return {@link Promise} of {@link dh.Table}
881
+ * @deprecated
887
882
  */
888
- timeTable(periodNanos:number, startTime?:DateWrapper):Promise<Table>;
889
- addEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):()=>void;
890
- nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<Event<T>>;
891
- hasListeners(name:string):boolean;
892
- removeEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):boolean;
883
+ static readonly SUM:string;
884
+ /**
885
+ * @deprecated
886
+ */
887
+ static readonly ABS_SUM:string;
888
+ /**
889
+ * @deprecated
890
+ */
891
+ static readonly VAR:string;
892
+ /**
893
+ * @deprecated
894
+ */
895
+ static readonly AVG:string;
896
+ /**
897
+ * @deprecated
898
+ */
899
+ static readonly STD:string;
900
+ /**
901
+ * @deprecated
902
+ */
903
+ static readonly FIRST:string;
904
+ /**
905
+ * @deprecated
906
+ */
907
+ static readonly LAST:string;
908
+ /**
909
+ * @deprecated
910
+ */
911
+ static readonly SKIP:string;
912
+ /**
913
+ * Specifies if a Totals Table should be expanded by default in the UI. Defaults to false.
914
+ */
915
+ showTotalsByDefault:boolean;
916
+ /**
917
+ * Specifies if a Grand Totals Table should be expanded by default in the UI. Defaults to false.
918
+ */
919
+ showGrandTotalsByDefault:boolean;
920
+ /**
921
+ * Specifies the default operation for columns that do not have a specific operation applied; defaults to "Sum".
922
+ */
923
+ defaultOperation:AggregationOperationType;
924
+ /**
925
+ * Mapping from each column name to the aggregation(s) that should be applied to that column in the resulting Totals
926
+ * Table. If a column is omitted, the defaultOperation is used.
927
+ */
928
+ operationMap:{ [key: string]: Array<AggregationOperationType>; };
929
+ /**
930
+ * Groupings to use when generating the Totals Table. One row will exist for each unique set of values observed in
931
+ * these columns. See also `Table.selectDistinct`.
932
+ */
933
+ groupBy:Array<string>;
934
+
935
+ constructor();
936
+
937
+ toString():string;
938
+ }
939
+
940
+ export class QueryInfo {
941
+ static readonly EVENT_TABLE_OPENED:string;
942
+ static readonly EVENT_DISCONNECT:string;
943
+ static readonly EVENT_RECONNECT:string;
944
+ static readonly EVENT_CONNECT:string;
945
+
946
+ protected constructor();
893
947
  }
894
948
 
895
949
  /**
896
- * Describes the structure of the column, and if desired can be used to get access to the data to be rendered in this
897
- * column.
950
+ * A js type for operating on input tables.
951
+ *
952
+ * Represents a User Input Table, which can have data added to it from other sources.
953
+ *
954
+ * You may add rows using dictionaries of key-value tuples (representing columns by name), add tables containing all the
955
+ * key/value columns to add, or delete tables containing the keys to delete. Each operation is atomic, and will either
956
+ * succeed completely or fail completely. To guarantee order of operations, apply an operation and wait for the response
957
+ * before sending the next operation.
958
+ *
959
+ * Each table has one or more key columns, where each unique combination of keys will appear at most once in the table.
960
+ *
961
+ * To view the results of the Input Table, you should use standard table operations on the InputTable's source Table
962
+ * object.
898
963
  */
899
- export class Column {
900
- /**
901
- * If this column is part of a roll-up tree table, represents the type of the row data that can be found in this
902
- * column for leaf nodes if includeConstituents is enabled. Otherwise, it is <b>null</b>.
903
- * @return String
904
- */
905
- readonly constituentType?:string|null;
906
- readonly description?:string|null;
907
-
964
+ export class InputTable {
908
965
  protected constructor();
909
966
 
910
967
  /**
911
- * the value for this column in the given row. Type will be consistent with the type of the Column.
968
+ * Adds a single row to the table. For each key or value column name in the Input Table, we retrieve that javascript
969
+ * property at that name and validate it can be put into the given column type.
912
970
  * @param row -
913
- * @return Any
971
+ * @param userTimeZone -
972
+ * @return Promise of dh.InputTable
914
973
  */
915
- get(row:Row):any;
916
- getFormat(row:Row):Format;
974
+ addRow(row:{ [key: string]: any; }, userTimeZone?:string):Promise<InputTable>;
917
975
  /**
918
- * Creates a sort builder object, to be used when sorting by this column.
919
- * @return {@link dh.Sort}
976
+ * Add multiple rows to a table.
977
+ * @param rows -
978
+ * @param userTimeZone -
979
+ * @return Promise of dh.InputTable
920
980
  */
921
- sort():Sort;
981
+ addRows(rows:{ [key: string]: any; }[], userTimeZone?:string):Promise<InputTable>;
922
982
  /**
923
- * Creates a new value for use in filters based on this column. Used either as a parameter to another filter
924
- * operation, or as a builder to create a filter operation.
925
- * @return {@link dh.FilterValue}
983
+ * Add an entire table to this Input Table. Only column names that match the definition of the input table will be
984
+ * copied, and all key columns must have values filled in. This only copies the current state of the source table;
985
+ * future updates to the source table will not be reflected in the Input Table. The returned promise will be
986
+ * resolved to the same InputTable instance this method was called upon once the server returns.
987
+ * @param tableToAdd -
988
+ * @return Promise of dh.InputTable
926
989
  */
927
- filter():FilterValue;
990
+ addTable(tableToAdd:Table):Promise<InputTable>;
928
991
  /**
929
- * a <b>CustomColumn</b> object to apply using `applyCustomColumns` with the expression specified.
930
- * @param expression -
931
- * @return {@link dh.CustomColumn}
992
+ * Add multiple tables to this Input Table.
993
+ * @param tablesToAdd -
994
+ * @return Promise of dh.InputTable
932
995
  */
933
- formatColor(expression:string, options?:CustomColumnOptions|undefined|null):CustomColumn;
996
+ addTables(tablesToAdd:Table[]):Promise<InputTable>;
934
997
  /**
935
- * a <b>CustomColumn</b> object to apply using <b>applyCustomColumns</b> with the expression specified.
936
- * @param expression -
937
- * @return {@link dh.CustomColumn}
998
+ * Deletes an entire table from this Input Table. Key columns must match the Input Table.
999
+ * @param tableToDelete -
1000
+ * @return Promise of dh.InputTable
938
1001
  */
939
- formatNumber(expression:string, options?:CustomColumnOptions|undefined|null):CustomColumn;
1002
+ deleteTable(tableToDelete:Table):Promise<InputTable>;
940
1003
  /**
941
- * a <b>CustomColumn</b> object to apply using <b>applyCustomColumns</b> with the expression specified.
942
- * @param expression -
943
- * @return {@link dh.CustomColumn}
1004
+ * Delete multiple tables from this Input Table.
1005
+ * @param tablesToDelete -
1006
+ * @return
944
1007
  */
945
- formatDate(expression:string, options?:CustomColumnOptions|undefined|null):CustomColumn;
1008
+ deleteTables(tablesToDelete:Table[]):Promise<InputTable>;
1009
+ /**
1010
+ * A list of the key columns, by name
1011
+ * @return String array.
1012
+ */
1013
+ get keys():string[];
1014
+ /**
1015
+ * A list of the value columns, by name
1016
+ * @return String array.
1017
+ */
1018
+ get values():string[];
1019
+ /**
1020
+ * A list of the key columns.
1021
+ * @return Column array.
1022
+ */
1023
+ get keyColumns():Column[];
1024
+ /**
1025
+ * A list of the value Column objects
1026
+ * @return {@link dh.Column} array.
1027
+ */
1028
+ get valueColumns():Column[];
1029
+ /**
1030
+ * The source table for this Input Table
1031
+ * @return dh.table
1032
+ */
1033
+ get table():Table;
1034
+ }
1035
+
1036
+ export class CustomColumn {
1037
+ static readonly TYPE_FORMAT_COLOR:string;
1038
+ static readonly TYPE_FORMAT_NUMBER:string;
1039
+ static readonly TYPE_FORMAT_DATE:string;
1040
+ static readonly TYPE_NEW:string;
1041
+
1042
+ protected constructor();
1043
+
1044
+ valueOf():string;
946
1045
  toString():string;
1046
+ static from(columnInfo:string):CustomColumn;
947
1047
  /**
948
- * Label for this column.
1048
+ * The expression to evaluate this custom column.
949
1049
  * @return String
950
1050
  */
951
- get name():string;
1051
+ get expression():string;
952
1052
  /**
953
- * True if this column is a partition column. Partition columns are used for filtering uncoalesced tables - see
954
- * {@link Table.uncoalesced}.
955
- * @return true if the column is a partition column
1053
+ * The name of the column to use.
1054
+ * @return String
956
1055
  */
957
- get isPartitionColumn():boolean;
1056
+ get name():string;
958
1057
  /**
959
- *
960
- * @deprecated do not use. Internal index of the column in the table, to be used as a key on the Row.
961
- * @return int
1058
+ * The options for this custom column.
1059
+ * @return CustomColumOptions
962
1060
  */
963
- get index():number;
964
- get isSortable():boolean;
1061
+ get options():CustomColumnOptions;
965
1062
  /**
966
- * Type of the row data that can be found in this column.
1063
+ * Type of custom column. One of
1064
+ *
1065
+ * <ul>
1066
+ * <li>FORMAT_COLOR</li>
1067
+ * <li>FORMAT_NUMBER</li>
1068
+ * <li>FORMAT_DATE</li>
1069
+ * <li>NEW</li>
1070
+ * </ul>
967
1071
  * @return String
968
1072
  */
969
1073
  get type():string;
1074
+ }
1075
+
1076
+ /**
1077
+ * Describes a filter which can be applied to a table. Replacing these instances may be more expensive than reusing
1078
+ * them. These instances are immutable - all operations that compose them to build bigger expressions return a new
1079
+ * instance.
1080
+ */
1081
+ export class FilterCondition {
1082
+ protected constructor();
1083
+
970
1084
  /**
971
- * Format entire rows colors using the expression specified. Returns a <b>CustomColumn</b> object to apply to a
972
- * table using <b>applyCustomColumns</b> with the parameters specified.
973
- * @param expression -
974
- * @param options -
975
- * @return {@link dh.CustomColumn}
1085
+ * the opposite of this condition
1086
+ * @return FilterCondition
976
1087
  */
977
- static formatRowColor(expression:string, options?:CustomColumnOptions|undefined|null):CustomColumn;
1088
+ not():FilterCondition;
1089
+ /**
1090
+ * a condition representing the current condition logically ANDed with the other parameters
1091
+ * @param filters -
1092
+ * @return FilterCondition
1093
+ */
1094
+ and(...filters:FilterCondition[]):FilterCondition;
1095
+ /**
1096
+ * a condition representing the current condition logically ORed with the other parameters
1097
+ * @param filters -
1098
+ * @return FilterCondition.
1099
+ */
1100
+ or(...filters:FilterCondition[]):FilterCondition;
1101
+ /**
1102
+ * a string suitable for debugging showing the details of this condition.
1103
+ * @return String.
1104
+ */
1105
+ toString():string;
1106
+ get columns():Array<Column>;
1107
+ /**
1108
+ * a filter condition invoking a static function with the given parameters. Currently supported Deephaven static
1109
+ * functions:
1110
+ * <ul>
1111
+ * <li><b>inRange</b>: Given three comparable values, returns true if the first is less than the second but greater
1112
+ * than the third</li>
1113
+ * <li><b>isInf</b>:Returns true if the given number is <i>infinity</i></li>
1114
+ * <li><b>isNaN</b>:Returns true if the given number is <i>not a number</i></li>
1115
+ * <li><b>isNormal</b>:Returns true if the given number <i>is not null</i>, <i>is not infinity</i>, and <i>is not
1116
+ * "not a number"</i></li>
1117
+ * <li><b>startsWith</b>:Returns true if the first string starts with the second string</li>
1118
+ * <li><b>endsWith</b>Returns true if the first string ends with the second string</li>
1119
+ * <li><b>matches</b>:Returns true if the first string argument matches the second string used as a Java regular
1120
+ * expression</li>
1121
+ * <li><b>contains</b>:Returns true if the first string argument contains the second string as a substring</li>
1122
+ * <li><b>in</b>:Returns true if the first string argument can be found in the second array argument.
1123
+ * <p>
1124
+ * Note that the array can only be specified as a column reference at this time - typically the `FilterValue.in`
1125
+ * method should be used in other cases
1126
+ * </p>
1127
+ * </li>
1128
+ * </ul>
1129
+ * @param function -
1130
+ * @param args -
1131
+ * @return dh.FilterCondition
1132
+ */
1133
+ static invoke(func:string, ...args:FilterValue[]):FilterCondition;
1134
+ /**
1135
+ * a filter condition which will check if the given value can be found in any supported column on whatever table
1136
+ * this FilterCondition is passed to. This FilterCondition is somewhat unique in that it need not be given a column
1137
+ * instance, but will adapt to any table. On numeric columns, with a value passed in which can be parsed as a
1138
+ * number, the column will be filtered to numbers which equal, or can be "rounded" effectively to this number. On
1139
+ * String columns, the given value will match any column which contains this string in a case-insensitive search. An
1140
+ * optional second argument can be passed, an array of `FilterValue` from the columns to limit this search to (see
1141
+ * {@link dh.Column.filter}).
1142
+ * @param value -
1143
+ * @param columns -
1144
+ * @return dh.FilterCondition
1145
+ */
1146
+ static search(value:FilterValue, columns?:FilterValue[]):FilterCondition;
1147
+ }
1148
+
1149
+ /**
1150
+ * Describes a Sort present on the table. No visible constructor, created through the use of Column.sort(), will be tied
1151
+ * to that particular column data. Sort instances are immutable, and use a builder pattern to make modifications. All
1152
+ * methods return a new Sort instance.
1153
+ */
1154
+ export class Sort {
1155
+ static readonly ASCENDING:string;
1156
+ static readonly DESCENDING:string;
1157
+ static readonly REVERSE:string;
1158
+
1159
+ protected constructor();
1160
+
1161
+ /**
1162
+ * Builds a Sort instance to sort values in ascending order.
1163
+ * @return {@link dh.Sort}
1164
+ */
1165
+ asc():Sort;
1166
+ /**
1167
+ * Builds a Sort instance to sort values in descending order.
1168
+ * @return {@link dh.Sort}
1169
+ */
1170
+ desc():Sort;
1171
+ /**
1172
+ * Builds a Sort instance which takes the absolute value before applying order.
1173
+ * @return {@link dh.Sort}
1174
+ */
1175
+ abs():Sort;
1176
+ toString():string;
1177
+ /**
1178
+ * True if the absolute value of the column should be used when sorting; defaults to false.
1179
+ * @return boolean
1180
+ */
1181
+ get isAbs():boolean;
1182
+ /**
1183
+ * The column which is sorted.
1184
+ * @return {@link dh.Column}
1185
+ */
1186
+ get column():Column;
1187
+ /**
1188
+ * The direction of this sort, either <b>ASC</b>, <b>DESC</b>, or <b>REVERSE</b>.
1189
+ * @return String
1190
+ */
1191
+ get direction():string;
1192
+ }
1193
+
1194
+ /**
1195
+ * Options for custom columns.
1196
+ */
1197
+ export class CustomColumnOptions {
978
1198
  /**
979
- * a <b>CustomColumn</b> object to apply using <b>applyCustomColumns</b> with the expression specified.
980
- * @param name -
981
- * @param expression -
982
- * @param options -
983
- * @return {@link dh.CustomColumn}
1199
+ * When specified for custom columns on a rollup table, specifies if the formula apply to rollup or constituent
1200
+ * nodes.
984
1201
  */
985
- static createCustomColumn(name:string, expression:string, options?:CustomColumnOptions|undefined|null):CustomColumn;
1202
+ rollupNodeType?:RollupNodeTypeType|null;
1203
+
1204
+ constructor();
1205
+ }
1206
+
1207
+ /**
1208
+ * Exists to keep the dh.TableMap namespace so that the web UI can remain compatible with the DHE API, which still calls
1209
+ * this type TableMap.
1210
+ * @deprecated
1211
+ */
1212
+ export class TableMap {
1213
+ static readonly EVENT_KEYADDED:string;
1214
+ static readonly EVENT_DISCONNECT:string;
1215
+ static readonly EVENT_RECONNECT:string;
1216
+ static readonly EVENT_RECONNECTFAILED:string;
1217
+
1218
+ protected constructor();
986
1219
  }
987
1220
 
988
1221
  /**
@@ -1364,482 +1597,88 @@ export namespace dh {
1364
1597
  */
1365
1598
  removeEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):boolean;
1366
1599
  /**
1367
- * a Sort than can be used to reverse a table. This can be passed into n array in applySort. Note that Tree Tables
1368
- * do not support reverse.
1369
- * @return {@link dh.Sort}
1370
- */
1371
- static reverse():Sort;
1372
- }
1373
-
1374
-
1375
- export class DateWrapper extends LongWrapper {
1376
- protected constructor();
1377
-
1378
- static ofJsDate(date:Date):DateWrapper;
1379
- asDate():Date;
1380
- }
1381
-
1382
- export class LoginCredentials {
1383
- type?:string|null;
1384
- username?:string|null;
1385
- token?:string|null;
1386
-
1387
- constructor();
1388
- }
1389
-
1390
- /**
1391
- * Describes a filter which can be applied to a table. Replacing these instances may be more expensive than reusing
1392
- * them. These instances are immutable - all operations that compose them to build bigger expressions return a new
1393
- * instance.
1394
- */
1395
- export class FilterCondition {
1396
- protected constructor();
1397
-
1398
- /**
1399
- * the opposite of this condition
1400
- * @return FilterCondition
1401
- */
1402
- not():FilterCondition;
1403
- /**
1404
- * a condition representing the current condition logically ANDed with the other parameters
1405
- * @param filters -
1406
- * @return FilterCondition
1407
- */
1408
- and(...filters:FilterCondition[]):FilterCondition;
1409
- /**
1410
- * a condition representing the current condition logically ORed with the other parameters
1411
- * @param filters -
1412
- * @return FilterCondition.
1413
- */
1414
- or(...filters:FilterCondition[]):FilterCondition;
1415
- /**
1416
- * a string suitable for debugging showing the details of this condition.
1417
- * @return String.
1418
- */
1419
- toString():string;
1420
- get columns():Array<Column>;
1421
- /**
1422
- * a filter condition invoking a static function with the given parameters. Currently supported Deephaven static
1423
- * functions:
1424
- * <ul>
1425
- * <li><b>inRange</b>: Given three comparable values, returns true if the first is less than the second but greater
1426
- * than the third</li>
1427
- * <li><b>isInf</b>:Returns true if the given number is <i>infinity</i></li>
1428
- * <li><b>isNaN</b>:Returns true if the given number is <i>not a number</i></li>
1429
- * <li><b>isNormal</b>:Returns true if the given number <i>is not null</i>, <i>is not infinity</i>, and <i>is not
1430
- * "not a number"</i></li>
1431
- * <li><b>startsWith</b>:Returns true if the first string starts with the second string</li>
1432
- * <li><b>endsWith</b>Returns true if the first string ends with the second string</li>
1433
- * <li><b>matches</b>:Returns true if the first string argument matches the second string used as a Java regular
1434
- * expression</li>
1435
- * <li><b>contains</b>:Returns true if the first string argument contains the second string as a substring</li>
1436
- * <li><b>in</b>:Returns true if the first string argument can be found in the second array argument.
1437
- * <p>
1438
- * Note that the array can only be specified as a column reference at this time - typically the `FilterValue.in`
1439
- * method should be used in other cases
1440
- * </p>
1441
- * </li>
1442
- * </ul>
1443
- * @param function -
1444
- * @param args -
1445
- * @return dh.FilterCondition
1446
- */
1447
- static invoke(func:string, ...args:FilterValue[]):FilterCondition;
1448
- /**
1449
- * a filter condition which will check if the given value can be found in any supported column on whatever table
1450
- * this FilterCondition is passed to. This FilterCondition is somewhat unique in that it need not be given a column
1451
- * instance, but will adapt to any table. On numeric columns, with a value passed in which can be parsed as a
1452
- * number, the column will be filtered to numbers which equal, or can be "rounded" effectively to this number. On
1453
- * String columns, the given value will match any column which contains this string in a case-insensitive search. An
1454
- * optional second argument can be passed, an array of `FilterValue` from the columns to limit this search to (see
1455
- * {@link dh.Column.filter}).
1456
- * @param value -
1457
- * @param columns -
1458
- * @return dh.FilterCondition
1459
- */
1460
- static search(value:FilterValue, columns?:FilterValue[]):FilterCondition;
1461
- }
1462
-
1463
- /**
1464
- * Describes how a Totals Table will be generated from its parent table. Each table has a default (which may be null)
1465
- * indicating how that table was configured when it was declared, and each Totals Table has a similar property
1466
- * describing how it was created. Both the <b>Table.getTotalsTable</b> and <b>Table.getGrandTotalsTable</b> methods take
1467
- * this config as an optional parameter - without it, the table's default will be used, or if null, a default instance
1468
- * of <b>TotalsTableConfig</b> will be supplied.
1469
- *
1470
- * This class has a no-arg constructor, allowing an instance to be made with the default values provided. However, any
1471
- * JS object can be passed in to the methods which accept instances of this type, provided their values adhere to the
1472
- * expected formats.
1473
- */
1474
- export class TotalsTableConfig {
1475
- /**
1476
- * @deprecated
1477
- */
1478
- static readonly COUNT:string;
1479
- /**
1480
- * @deprecated
1481
- */
1482
- static readonly MIN:string;
1483
- /**
1484
- * @deprecated
1485
- */
1486
- static readonly MAX:string;
1487
- /**
1488
- * @deprecated
1489
- */
1490
- static readonly SUM:string;
1491
- /**
1492
- * @deprecated
1493
- */
1494
- static readonly ABS_SUM:string;
1495
- /**
1496
- * @deprecated
1497
- */
1498
- static readonly VAR:string;
1499
- /**
1500
- * @deprecated
1501
- */
1502
- static readonly AVG:string;
1503
- /**
1504
- * @deprecated
1505
- */
1506
- static readonly STD:string;
1507
- /**
1508
- * @deprecated
1509
- */
1510
- static readonly FIRST:string;
1511
- /**
1512
- * @deprecated
1513
- */
1514
- static readonly LAST:string;
1515
- /**
1516
- * @deprecated
1517
- */
1518
- static readonly SKIP:string;
1519
- /**
1520
- * Specifies if a Totals Table should be expanded by default in the UI. Defaults to false.
1521
- */
1522
- showTotalsByDefault:boolean;
1523
- /**
1524
- * Specifies if a Grand Totals Table should be expanded by default in the UI. Defaults to false.
1525
- */
1526
- showGrandTotalsByDefault:boolean;
1527
- /**
1528
- * Specifies the default operation for columns that do not have a specific operation applied; defaults to "Sum".
1529
- */
1530
- defaultOperation:AggregationOperationType;
1531
- /**
1532
- * Mapping from each column name to the aggregation(s) that should be applied to that column in the resulting Totals
1533
- * Table. If a column is omitted, the defaultOperation is used.
1534
- */
1535
- operationMap:{ [key: string]: Array<AggregationOperationType>; };
1536
- /**
1537
- * Groupings to use when generating the Totals Table. One row will exist for each unique set of values observed in
1538
- * these columns. See also `Table.selectDistinct`.
1539
- */
1540
- groupBy:Array<string>;
1541
-
1542
- constructor();
1543
-
1544
- toString():string;
1545
- }
1546
-
1547
- /**
1548
- * Represents a non-viewport subscription to a table, and all data currently known to be present in the subscribed
1549
- * columns. This class handles incoming snapshots and deltas, and fires events to consumers to notify of data changes.
1550
- * <p>
1551
- * Unlike {@link dh.TableViewportSubscription}, the "original" table does not have a reference to this instance, only the
1552
- * "private" table instance does, since the original cannot modify the subscription, and the private instance must
1553
- * forward data to it.
1554
- * <p>
1555
- * Represents a subscription to the table on the server. Changes made to the table will not be reflected here - the
1556
- * subscription must be closed and a new one optioned to see those changes. The event model is slightly different from
1557
- * viewports to make it less expensive to compute for large tables.
1558
- */
1559
- export class TableSubscription implements HasEventHandling {
1560
- protected constructor();
1561
-
1562
- static createTableSubscription(options:SubscriptionOptions, existingTable:Table):TableSubscription;
1563
- /**
1564
- * Updates the subscription to use the given columns and update interval.
1565
- * @param columns - the new columns to subscribe to
1566
- * @param updateIntervalMs - the new update interval, or null/omit to use the default of one second
1567
- */
1568
- changeSubscription(columns:Array<Column>, updateIntervalMs:number|undefined|null):void;
1569
- /**
1570
- * Update the options for this viewport subscription. This cannot alter the update interval or preview options.
1571
- * @param options - the subscription options
1572
- */
1573
- update(options:SubscriptionOptions):void;
1574
- get columns():Array<Column>;
1575
- /**
1576
- * Stops the subscription on the server.
1577
- */
1578
- close():void;
1579
- /**
1580
- * Listen for events on this object.
1581
- * @param name - the name of the event to listen for
1582
- * @param callback - a function to call when the event occurs
1583
- * @return Returns a cleanup function.
1584
- * @typeParam T - the type of the data that the event will provide
1585
- */
1586
- addEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):()=>void;
1587
- nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<Event<T>>;
1588
- hasListeners(name:string):boolean;
1589
- /**
1590
- * Removes an event listener added to this table.
1591
- * @param name -
1592
- * @param callback -
1593
- * @return
1594
- * @typeParam T -
1595
- */
1596
- removeEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):boolean;
1597
- }
1598
-
1599
- /**
1600
- * A Widget represents a server side object that sends one or more responses to the client. The client can then
1601
- * interpret these responses to see what to render, or how to respond.
1602
- * <p>
1603
- * Most custom object types result in a single response being sent to the client, often with other exported objects, but
1604
- * some will have streamed responses, and allow the client to send follow-up requests of its own. This class's API is
1605
- * backwards compatible, but as such does not offer a way to tell the difference between a streaming or non-streaming
1606
- * object type, the client code that handles the payloads is expected to know what to expect. See
1607
- * {@link dh.WidgetMessageDetails} for more information.
1608
- * <p>
1609
- * When the promise that returns this object resolves, it will have the first response assigned to its fields. Later
1610
- * responses from the server will be emitted as "message" events. When the connection with the server ends, the "close"
1611
- * event will be emitted. In this way, the connection will behave roughly in the same way as a WebSocket - either side
1612
- * can close, and after close no more messages will be processed. There can be some latency in closing locally while
1613
- * remote messages are still pending - it is up to implementations of plugins to handle this case.
1614
- * <p>
1615
- * Also like WebSockets, the plugin API doesn't define how to serialize messages, and just handles any binary payloads.
1616
- * What it does handle however, is allowing those messages to include references to server-side objects with those
1617
- * payloads. Those server side objects might be tables or other built-in types in the Deephaven JS API, or could be
1618
- * objects usable through their own plugins. They also might have no plugin at all, allowing the client to hold a
1619
- * reference to them and pass them back to the server, either to the current plugin instance, or through another API.
1620
- * The `Widget` type does not specify how those objects should be used or their lifecycle, but leaves that
1621
- * entirely to the plugin. Messages will arrive in the order they were sent.
1622
- * <p>
1623
- * This can suggest several patterns for how plugins operate:
1624
- * <ul>
1625
- * <li>The plugin merely exists to transport some other object to the client. This can be useful for objects which can
1626
- * easily be translated to some other type (like a Table) when the user clicks on it. An example of this is
1627
- * `pandas.DataFrame` will result in a widget that only contains a static
1628
- * {@link dh.Table}. Presently, the widget is immediately closed, and only the Table is
1629
- * provided to the JS API consumer.</li>
1630
- * <li>The plugin provides references to Tables and other objects, and those objects can live longer than the object
1631
- * which provided them. One concrete example of this could have been
1632
- * {@link dh.PartitionedTable} when fetching constituent tables, but it was implemented
1633
- * before bidirectional plugins were implemented. Another example of this is plugins that serve as a "factory", giving
1634
- * the user access to table manipulation/creation methods not supported by gRPC or the JS API.</li>
1635
- * <li>The plugin provides reference to Tables and other objects that only make sense within the context of the widget
1636
- * instance, so when the widget goes away, those objects should be released as well. This is also an example of
1637
- * {@link dh.PartitionedTable}, as the partitioned table tracks creation of new keys through
1638
- * an internal table instance.</li>
1639
- * </ul>
1640
- *
1641
- * Handling server objects in messages also has more than one potential pattern that can be used:
1642
- * <ul>
1643
- * <li>One object per message - the message clearly is about that object, no other details required.</li>
1644
- * <li>Objects indexed within their message - as each message comes with a list of objects, those objects can be
1645
- * referenced within the payload by index. This is roughly how {@link dh.plot.Figure}
1646
- * behaves, where the figure descriptor schema includes an index for each created series, describing which table should
1647
- * be used, which columns should be mapped to each axis.</li>
1648
- * <li>Objects indexed since widget creation - each message would append its objects to a list created when the widget
1649
- * was first made, and any new exports that arrive in a new message would be appended to that list. Then, subsequent
1650
- * messages can reference objects already sent. This imposes a limitation where the client cannot release any exports
1651
- * without the server somehow signaling that it will never reference that export again.</li>
1652
- * </ul>
1653
- */
1654
- export class Widget implements WidgetMessageDetails, HasEventHandling {
1655
- static readonly EVENT_MESSAGE:string;
1656
- static readonly EVENT_CLOSE:string;
1657
-
1658
- protected constructor();
1659
-
1660
- /**
1661
- * Ends the client connection to the server.
1662
- */
1663
- close():void;
1664
- getDataAsBase64():string;
1665
- getDataAsU8():Uint8Array;
1666
- getDataAsString():string;
1667
- /**
1668
- * Sends a string/bytes payload to the server, along with references to objects that exist on the server.
1669
- * @param msg - string/buffer/view instance that represents data to send
1670
- * @param references - an array of objects that can be safely sent to the server
1671
- */
1672
- sendMessage(msg:string|ArrayBuffer|ArrayBufferView, references?:Array<Table|Widget|WidgetExportedObject|PartitionedTable|TotalsTable|TreeTable>):void;
1673
- addEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):()=>void;
1674
- nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<Event<T>>;
1675
- hasListeners(name:string):boolean;
1676
- removeEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):boolean;
1677
- /**
1678
- *
1679
- * @return the exported objects sent in the initial message from the server. The client is responsible for closing
1680
- * them when finished using them.
1681
- */
1682
- get exportedObjects():WidgetExportedObject[];
1683
- /**
1684
- *
1685
- * @return the type of this widget
1600
+ * a Sort than can be used to reverse a table. This can be passed into n array in applySort. Note that Tree Tables
1601
+ * do not support reverse.
1602
+ * @return {@link dh.Sort}
1686
1603
  */
1687
- get type():string;
1688
- }
1689
-
1690
- /**
1691
- * Wrap BigInteger values for use in JS. Provides text formatting for display and access to the underlying value.
1692
- */
1693
- export class BigIntegerWrapper {
1694
- protected constructor();
1695
-
1696
- static ofString(str:string):BigIntegerWrapper;
1697
- asNumber():number;
1698
- valueOf():string;
1699
- toString():string;
1700
- equals(o:object):boolean;
1701
- hashCode():number;
1604
+ static reverse():Sort;
1702
1605
  }
1703
1606
 
1704
- /**
1705
- * Wrap BigDecimal values for use in JS. Provides text formatting for display and access to the underlying value.
1706
- */
1707
- export class BigDecimalWrapper {
1708
- protected constructor();
1709
-
1710
- static ofString(value:string):BigDecimalWrapper;
1711
- asNumber():number;
1712
- valueOf():string;
1713
- toString():string;
1714
- equals(o:object):boolean;
1715
- hashCode():number;
1716
- }
1717
1607
 
1718
1608
  /**
1719
- * A js type for operating on input tables.
1720
- *
1721
- * Represents a User Input Table, which can have data added to it from other sources.
1722
- *
1723
- * You may add rows using dictionaries of key-value tuples (representing columns by name), add tables containing all the
1724
- * key/value columns to add, or delete tables containing the keys to delete. Each operation is atomic, and will either
1725
- * succeed completely or fail completely. To guarantee order of operations, apply an operation and wait for the response
1726
- * before sending the next operation.
1727
- *
1728
- * Each table has one or more key columns, where each unique combination of keys will appear at most once in the table.
1729
- *
1730
- * To view the results of the Input Table, you should use standard table operations on the InputTable's source Table
1731
- * object.
1609
+ * Represents a set of Tables each corresponding to some key. The keys are available locally, but a call must be made to
1610
+ * the server to get each Table. All tables will have the same structure.
1732
1611
  */
1733
- export class InputTable {
1734
- protected constructor();
1735
-
1736
- /**
1737
- * Adds a single row to the table. For each key or value column name in the Input Table, we retrieve that javascript
1738
- * property at that name and validate it can be put into the given column type.
1739
- * @param row -
1740
- * @param userTimeZone -
1741
- * @return Promise of dh.InputTable
1742
- */
1743
- addRow(row:{ [key: string]: any; }, userTimeZone?:string):Promise<InputTable>;
1744
- /**
1745
- * Add multiple rows to a table.
1746
- * @param rows -
1747
- * @param userTimeZone -
1748
- * @return Promise of dh.InputTable
1749
- */
1750
- addRows(rows:{ [key: string]: any; }[], userTimeZone?:string):Promise<InputTable>;
1751
- /**
1752
- * Add an entire table to this Input Table. Only column names that match the definition of the input table will be
1753
- * copied, and all key columns must have values filled in. This only copies the current state of the source table;
1754
- * future updates to the source table will not be reflected in the Input Table. The returned promise will be
1755
- * resolved to the same InputTable instance this method was called upon once the server returns.
1756
- * @param tableToAdd -
1757
- * @return Promise of dh.InputTable
1758
- */
1759
- addTable(tableToAdd:Table):Promise<InputTable>;
1612
+ export class PartitionedTable implements HasEventHandling {
1760
1613
  /**
1761
- * Add multiple tables to this Input Table.
1762
- * @param tablesToAdd -
1763
- * @return Promise of dh.InputTable
1614
+ * Indicates that a new key has been added to the array of keys, which can now be fetched with getTable.
1764
1615
  */
1765
- addTables(tablesToAdd:Table[]):Promise<InputTable>;
1616
+ static readonly EVENT_KEYADDED:string;
1766
1617
  /**
1767
- * Deletes an entire table from this Input Table. Key columns must match the Input Table.
1768
- * @param tableToDelete -
1769
- * @return Promise of dh.InputTable
1618
+ * Indicates that a new key has been added to the array of keys, which can now be fetched with getTable.
1770
1619
  */
1771
- deleteTable(tableToDelete:Table):Promise<InputTable>;
1620
+ static readonly EVENT_DISCONNECT:string;
1772
1621
  /**
1773
- * Delete multiple tables from this Input Table.
1774
- * @param tablesToDelete -
1775
- * @return
1622
+ * Indicates that a new key has been added to the array of keys, which can now be fetched with getTable.
1776
1623
  */
1777
- deleteTables(tablesToDelete:Table[]):Promise<InputTable>;
1624
+ static readonly EVENT_RECONNECT:string;
1778
1625
  /**
1779
- * A list of the key columns, by name
1780
- * @return String array.
1626
+ * Indicates that a new key has been added to the array of keys, which can now be fetched with getTable.
1781
1627
  */
1782
- get keys():string[];
1628
+ static readonly EVENT_RECONNECTFAILED:string;
1629
+
1630
+ protected constructor();
1631
+
1783
1632
  /**
1784
- * A list of the value columns, by name
1785
- * @return String array.
1633
+ * Fetch the table with the given key. If the key does not exist, returns `null`.
1634
+ * @param key - The key to fetch. An array of values for each key column, in the same order as the key columns are.
1635
+ * @return Promise of dh.Table, or `null` if the key does not exist.
1786
1636
  */
1787
- get values():string[];
1637
+ getTable(key:object):Promise<Table|undefined|null>;
1788
1638
  /**
1789
- * A list of the key columns.
1790
- * @return Column array.
1639
+ * Open a new table that is the result of merging all constituent tables. See
1640
+ * {@link io.deephaven.engine.table.PartitionedTable.merge} for details.
1641
+ * @return A merged representation of the constituent tables.
1791
1642
  */
1792
- get keyColumns():Column[];
1643
+ getMergedTable():Promise<Table>;
1793
1644
  /**
1794
- * A list of the value Column objects
1795
- * @return {@link dh.Column} array.
1645
+ * The set of all currently known keys. This is kept up to date, so getting the list after adding an event listener
1646
+ * for <b>keyadded</b> will ensure no keys are missed.
1647
+ * @return Set of Object
1796
1648
  */
1797
- get valueColumns():Column[];
1649
+ getKeys():Set<object>;
1798
1650
  /**
1799
- * The source table for this Input Table
1800
- * @return dh.table
1651
+ * Fetch a table containing all the valid keys of the partitioned table.
1652
+ * @return Promise of a Table
1653
+ * @deprecated
1801
1654
  */
1802
- get table():Table;
1803
- }
1804
-
1805
- /**
1806
- * This object serves as a "handle" to a subscription, allowing it to be acted on directly or canceled outright. If you
1807
- * retain an instance of this, you have two choices - either only use it to call `close()` on it to stop the table's
1808
- * viewport without creating a new one, or listen directly to this object instead of the table for data events, and
1809
- * always call `close()` when finished. Calling any method on this object other than close() will result in it
1810
- * continuing to live on after `setViewport` is called on the original table, or after the table is modified.
1811
- */
1812
- export class TableViewportSubscription implements HasEventHandling {
1813
- protected constructor();
1814
-
1655
+ getKeyTable():Promise<Table>;
1815
1656
  /**
1816
- * Changes the rows and columns set on this viewport. This cannot be used to change the update interval.
1817
- * @param firstRow -
1818
- * @param lastRow -
1819
- * @param columns -
1820
- * @param updateIntervalMs -
1821
- * @deprecated use {@link #update(Object)} instead
1657
+ * Fetch the underlying base table of the partitioned table.
1658
+ * @return Promise of a Table
1822
1659
  */
1823
- setViewport(firstRow:number, lastRow:number, columns?:Column[]|undefined|null, updateIntervalMs?:number|undefined|null, isReverseViewport?:boolean|undefined|null):void;
1660
+ getBaseTable():Promise<Table>;
1824
1661
  /**
1825
- * Update the options for this viewport subscription. This cannot alter the update interval or preview options.
1826
- * @param options - the subscription options
1662
+ * Indicates that this PartitionedTable will no longer be used, removing subcriptions to updated keys, etc. This
1663
+ * will not affect tables in use.
1827
1664
  */
1828
- update(options:ViewportSubscriptionOptions):void;
1665
+ close():void;
1829
1666
  /**
1830
- * Stops this viewport from running, stopping all events on itself and on the table that created it.
1667
+ * The count of known keys.
1668
+ * @return int
1831
1669
  */
1832
- close():void;
1670
+ get size():number;
1833
1671
  /**
1834
- * Gets the data currently visible in this viewport
1835
- * @return Promise of {@link dh.TableData}.
1672
+ * An array of the columns in the tables that can be retrieved from this partitioned table, including both key and
1673
+ * non-key columns.
1674
+ * @return Array of Column
1836
1675
  */
1837
- getViewportData():Promise<ViewportData>;
1676
+ get columns():Column[];
1838
1677
  /**
1839
- *
1840
- * @deprecated Use {@link JsTable#createSnapshot(Object)} instead
1678
+ * An array of all the key columns that the tables are partitioned by.
1679
+ * @return Array of Column
1841
1680
  */
1842
- snapshot(rows:RangeSet, columns:Column[]):Promise<TableData>;
1681
+ get keyColumns():Column[];
1843
1682
  /**
1844
1683
  * Listen for events on this object.
1845
1684
  * @param name - the name of the event to listen for
@@ -2090,6 +1929,48 @@ export namespace dh {
2090
1929
  removeEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):boolean;
2091
1930
  }
2092
1931
 
1932
+ /**
1933
+ * Addition optional configuration that can be passed to the {@link dh.CoreClient} constructor.
1934
+ */
1935
+ export class ConnectOptions {
1936
+ /**
1937
+ * Optional map of http header names and values to send to the server with each request.
1938
+ */
1939
+ headers?:{ [key: string]: string; }|null;
1940
+ /**
1941
+ * True to enable debug logging. At this time, only enables logging for gRPC calls.
1942
+ */
1943
+ debug?:boolean|null;
1944
+ /**
1945
+ * Set this to true to force the use of websockets when connecting to the deephaven instance, false to force the use
1946
+ * of `fetch`. Ignored if {@link dh.transportFactory} is set.
1947
+ * <p>
1948
+ * Defaults to null, indicating that the server URL should be checked to see if we connect with fetch or websockets.
1949
+ */
1950
+ useWebsockets?:boolean|null;
1951
+ /**
1952
+ * The transport factory to use for creating gRPC streams. If specified, the JS API will ignore
1953
+ * {@link dh.useWebsockets} and its own internal logic for determining the appropriate transport to use.
1954
+ * <p>
1955
+ * Defaults to null, indicating that the JS API should determine the appropriate transport to use. If
1956
+ * `useWebsockets` is set to true, the JS API will use websockets, otherwise if the server url begins with
1957
+ * https, it will use fetch, otherwise it will use websockets.
1958
+ */
1959
+ transportFactory?:dh.grpc.GrpcTransportFactory|null;
1960
+
1961
+ constructor();
1962
+ }
1963
+
1964
+ /**
1965
+ * Event fired when a command is issued from the client.
1966
+ */
1967
+ export class CommandInfo {
1968
+ constructor(code:string, result:Promise<dh.ide.CommandResult>);
1969
+
1970
+ get result():Promise<dh.ide.CommandResult>;
1971
+ get code():string;
1972
+ }
1973
+
2093
1974
  /**
2094
1975
  * Describes data that can be filtered, either a column reference or a literal value. Used this way, the type of a value
2095
1976
  * can be specified so that values which are ambiguous or not well supported in JS will not be confused with Strings or
@@ -2263,299 +2144,150 @@ export namespace dh {
2263
2144
  }
2264
2145
 
2265
2146
  /**
2266
- * Describes a grouping and aggregations for a roll-up table. Pass to the <b>Table.rollup</b> function to create a
2267
- * roll-up table.
2268
- */
2269
- export class RollupConfig {
2270
- /**
2271
- * Ordered list of columns to group by to form the hierarchy of the resulting roll-up table.
2272
- */
2273
- groupingColumns:Array<String>;
2274
- /**
2275
- * Mapping from each aggregation name to the ordered list of columns it should be applied to in the resulting
2276
- * roll-up table.
2277
- */
2278
- aggregations:{ [key: string]: Array<string>; };
2279
- /**
2280
- * Optional parameter indicating if an extra leaf node should be added at the bottom of the hierarchy, showing the
2281
- * rows in the underlying table which make up that grouping. Since these values might be a different type from the
2282
- * rest of the column, any client code must check if TreeRow.hasChildren = false, and if so, interpret those values
2283
- * as if they were Column.constituentType instead of Column.type. Defaults to false.
2284
- */
2285
- includeConstituents:boolean;
2286
- includeOriginalColumns?:boolean|null;
2287
- /**
2288
- * Optional parameter indicating if original column descriptions should be included. Defaults to true.
2289
- */
2290
- includeDescriptions:boolean;
2291
-
2292
- constructor();
2293
- }
2294
-
2295
- /**
2296
- * Describes a Sort present on the table. No visible constructor, created through the use of Column.sort(), will be tied
2297
- * to that particular column data. Sort instances are immutable, and use a builder pattern to make modifications. All
2298
- * methods return a new Sort instance.
2299
- */
2300
- export class Sort {
2301
- static readonly ASCENDING:string;
2302
- static readonly DESCENDING:string;
2303
- static readonly REVERSE:string;
2304
-
2305
- protected constructor();
2306
-
2307
- /**
2308
- * Builds a Sort instance to sort values in ascending order.
2309
- * @return {@link dh.Sort}
2310
- */
2311
- asc():Sort;
2312
- /**
2313
- * Builds a Sort instance to sort values in descending order.
2314
- * @return {@link dh.Sort}
2315
- */
2316
- desc():Sort;
2317
- /**
2318
- * Builds a Sort instance which takes the absolute value before applying order.
2319
- * @return {@link dh.Sort}
2320
- */
2321
- abs():Sort;
2322
- toString():string;
2323
- /**
2324
- * True if the absolute value of the column should be used when sorting; defaults to false.
2325
- * @return boolean
2326
- */
2327
- get isAbs():boolean;
2328
- /**
2329
- * The column which is sorted.
2330
- * @return {@link dh.Column}
2331
- */
2332
- get column():Column;
2333
- /**
2334
- * The direction of this sort, either <b>ASC</b>, <b>DESC</b>, or <b>REVERSE</b>.
2335
- * @return String
2336
- */
2337
- get direction():string;
2338
- }
2339
-
2340
- export class CoreClient implements HasEventHandling {
2341
- static readonly EVENT_CONNECT:string;
2342
- static readonly EVENT_DISCONNECT:string;
2343
- static readonly EVENT_RECONNECT:string;
2344
- static readonly EVENT_RECONNECT_AUTH_FAILED:string;
2345
- static readonly EVENT_REQUEST_FAILED:string;
2346
- static readonly EVENT_REQUEST_STARTED:string;
2347
- static readonly EVENT_REQUEST_SUCCEEDED:string;
2348
- /**
2349
- * @deprecated
2350
- */
2351
- static readonly EVENT_REFRESH_TOKEN_UPDATED:string;
2352
- static readonly LOGIN_TYPE_PASSWORD:string;
2353
- static readonly LOGIN_TYPE_ANONYMOUS:string;
2354
-
2355
- constructor(serverUrl:string, connectOptions?:ConnectOptions);
2356
-
2357
- running():Promise<CoreClient>;
2358
- getServerUrl():string;
2359
- getAuthConfigValues():Promise<string[][]>;
2360
- login(credentials:LoginCredentials):Promise<void>;
2361
- relogin(token:RefreshToken):Promise<void>;
2362
- onConnected(timeoutInMillis?:number):Promise<void>;
2363
- getServerConfigValues():Promise<string[][]>;
2364
- getStorageService():dh.storage.StorageService;
2365
- getAsIdeConnection():Promise<IdeConnection>;
2366
- disconnect():void;
2367
- addEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):()=>void;
2368
- nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<Event<T>>;
2369
- hasListeners(name:string):boolean;
2370
- removeEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):boolean;
2371
- }
2372
-
2373
- /**
2374
- * Deprecated for use in Deephaven Core.
2375
- * @deprecated
2376
- */
2377
- export class Client {
2378
- static readonly EVENT_REQUEST_FAILED:string;
2379
- static readonly EVENT_REQUEST_STARTED:string;
2380
- static readonly EVENT_REQUEST_SUCCEEDED:string;
2381
-
2382
- constructor();
2383
- }
2384
-
2385
- /**
2386
- * Exists to keep the dh.TableMap namespace so that the web UI can remain compatible with the DHE API, which still calls
2387
- * this type TableMap.
2388
- * @deprecated
2147
+ * Wrap BigDecimal values for use in JS. Provides text formatting for display and access to the underlying value.
2389
2148
  */
2390
- export class TableMap {
2391
- static readonly EVENT_KEYADDED:string;
2392
- static readonly EVENT_DISCONNECT:string;
2393
- static readonly EVENT_RECONNECT:string;
2394
- static readonly EVENT_RECONNECTFAILED:string;
2395
-
2396
- protected constructor();
2397
- }
2398
-
2399
- export class CustomColumn {
2400
- static readonly TYPE_FORMAT_COLOR:string;
2401
- static readonly TYPE_FORMAT_NUMBER:string;
2402
- static readonly TYPE_FORMAT_DATE:string;
2403
- static readonly TYPE_NEW:string;
2404
-
2149
+ export class BigDecimalWrapper {
2405
2150
  protected constructor();
2406
2151
 
2407
- valueOf():string;
2408
- toString():string;
2409
- static from(columnInfo:string):CustomColumn;
2410
- /**
2411
- * The expression to evaluate this custom column.
2412
- * @return String
2413
- */
2414
- get expression():string;
2415
- /**
2416
- * The name of the column to use.
2417
- * @return String
2418
- */
2419
- get name():string;
2420
- /**
2421
- * The options for this custom column.
2422
- * @return CustomColumOptions
2423
- */
2424
- get options():CustomColumnOptions;
2425
- /**
2426
- * Type of custom column. One of
2427
- *
2428
- * <ul>
2429
- * <li>FORMAT_COLOR</li>
2430
- * <li>FORMAT_NUMBER</li>
2431
- * <li>FORMAT_DATE</li>
2432
- * <li>NEW</li>
2433
- * </ul>
2434
- * @return String
2435
- */
2436
- get type():string;
2437
- }
2438
-
2439
- /**
2440
- * Configuration object for running Table.treeTable to produce a hierarchical view of a given "flat" table.
2441
- *
2442
- * Like TotalsTableConfig, `TreeTableConfig` supports an operation map indicating how to aggregate the data, as well as
2443
- * an array of column names which will be the layers in the roll-up tree, grouped at each level. An additional optional
2444
- * value can be provided describing the strategy the engine should use when grouping the rows.
2445
- */
2446
- export class TreeTableConfig {
2447
- /**
2448
- * The column representing the unique ID for each item
2449
- */
2450
- idColumn:string;
2451
- /**
2452
- * The column representing the parent ID for each item
2453
- */
2454
- parentColumn:string;
2455
- /**
2456
- * Optional parameter indicating if items with an invalid parent ID should be promoted to root. Defaults to false.
2457
- */
2458
- promoteOrphansToRoot:boolean;
2459
-
2460
- constructor();
2461
- }
2462
-
2463
- /**
2464
- * Options for custom columns.
2465
- */
2466
- export class CustomColumnOptions {
2467
- /**
2468
- * When specified for custom columns on a rollup table, specifies if the formula apply to rollup or constituent
2469
- * nodes.
2470
- */
2471
- rollupNodeType?:RollupNodeTypeType|null;
2472
-
2473
- constructor();
2152
+ static ofString(value:string):BigDecimalWrapper;
2153
+ asNumber():number;
2154
+ valueOf():string;
2155
+ toString():string;
2156
+ equals(o:object):boolean;
2157
+ hashCode():number;
2474
2158
  }
2475
2159
 
2476
- export class QueryInfo {
2477
- static readonly EVENT_TABLE_OPENED:string;
2478
- static readonly EVENT_DISCONNECT:string;
2479
- static readonly EVENT_RECONNECT:string;
2480
- static readonly EVENT_CONNECT:string;
2160
+ export class IdeSession implements HasEventHandling {
2161
+ static readonly EVENT_COMMANDSTARTED:string;
2162
+ static readonly EVENT_REQUEST_FAILED:string;
2481
2163
 
2482
2164
  protected constructor();
2483
- }
2484
2165
 
2485
- /**
2486
- * Represents a set of Tables each corresponding to some key. The keys are available locally, but a call must be made to
2487
- * the server to get each Table. All tables will have the same structure.
2488
- */
2489
- export class PartitionedTable implements HasEventHandling {
2490
- /**
2491
- * Indicates that a new key has been added to the array of keys, which can now be fetched with getTable.
2492
- */
2493
- static readonly EVENT_KEYADDED:string;
2494
2166
  /**
2495
- * Indicates that a new key has been added to the array of keys, which can now be fetched with getTable.
2496
- */
2497
- static readonly EVENT_DISCONNECT:string;
2498
- /**
2499
- * Indicates that a new key has been added to the array of keys, which can now be fetched with getTable.
2167
+ * Load the named table, with columns and size information already fully populated.
2168
+ * @param name - the name of the table to fetch
2169
+ * @param applyPreviewColumns - false to disable previews, defaults to true
2170
+ * @return a {@link Promise} that will resolve to the table, or reject with an error if it cannot be loaded.
2171
+ * @deprecated Added to resolve a specific issue, in the future preview will be applied as part of the subscription.
2500
2172
  */
2501
- static readonly EVENT_RECONNECT:string;
2173
+ getTable(name:string, applyPreviewColumns?:boolean):Promise<Table>;
2502
2174
  /**
2503
- * Indicates that a new key has been added to the array of keys, which can now be fetched with getTable.
2175
+ * Load the named Figure, including its tables and tablemaps as needed.
2176
+ * @param name -
2177
+ * @return promise of dh.plot.Figure
2504
2178
  */
2505
- static readonly EVENT_RECONNECTFAILED:string;
2506
-
2507
- protected constructor();
2508
-
2179
+ getFigure(name:string):Promise<dh.plot.Figure>;
2509
2180
  /**
2510
- * Fetch the table with the given key. If the key does not exist, returns `null`.
2511
- * @param key - The key to fetch. An array of values for each key column, in the same order as the key columns are.
2512
- * @return Promise of dh.Table, or `null` if the key does not exist.
2181
+ * Loads the named tree table or roll-up table, with column data populated. All nodes are collapsed by default, and
2182
+ * size is presently not available until the viewport is first set.
2183
+ * @param name -
2184
+ * @return {@link Promise} of {@link dh.TreeTable}
2513
2185
  */
2514
- getTable(key:object):Promise<Table|undefined|null>;
2186
+ getTreeTable(name:string):Promise<TreeTable>;
2187
+ getHierarchicalTable(name:string):Promise<TreeTable>;
2188
+ getPartitionedTable(name:string):Promise<PartitionedTable>;
2189
+ getObject(definitionObject:dh.ide.VariableDescriptor):Promise<any>;
2190
+ newTable(columnNames:string[], types:string[], data:string[][], userTimeZone:string):Promise<Table>;
2515
2191
  /**
2516
- * Open a new table that is the result of merging all constituent tables. See
2517
- * {@link io.deephaven.engine.table.PartitionedTable.merge} for details.
2518
- * @return A merged representation of the constituent tables.
2192
+ * Merges the given tables into a single table. Assumes all tables have the same structure.
2193
+ * @param tables -
2194
+ * @return {@link Promise} of {@link dh.Table}
2519
2195
  */
2520
- getMergedTable():Promise<Table>;
2196
+ mergeTables(tables:Table[]):Promise<Table>;
2197
+ bindTableToVariable(table:Table, name:string):Promise<void>;
2521
2198
  /**
2522
- * The set of all currently known keys. This is kept up to date, so getting the list after adding an event listener
2523
- * for <b>keyadded</b> will ensure no keys are missed.
2524
- * @return Set of Object
2199
+ * Makes the `object` available to another user or another client on this same server which knows the value of
2200
+ * the `sharedTicketBytes`. Use that sharedTicketBytes value like a one-time use password - any other client
2201
+ * which knows this value can read the same object.
2202
+ * <p>
2203
+ * Shared objects will remain available using the sharedTicketBytes until the client that first shared them
2204
+ * releases/closes their copy of the object. Whatever side-channel is used to share the bytes, be sure to wait until
2205
+ * the remote end has signaled that it has successfully fetched the object before releasing it from this client.
2206
+ * <p>
2207
+ * Be sure to use an unpredictable value for the shared ticket bytes, like a UUID or other large, random value to
2208
+ * prevent access by unauthorized clients.
2209
+ * @param object - the object to share with another client/user
2210
+ * @param sharedTicketBytes - the value which another client/user must know to obtain the object. It may be a unicode
2211
+ * string (will be encoded as utf8 bytes), or a {@link Uint8Array} value.
2212
+ * @return A promise that will resolve to the value passed as sharedTicketBytes when the object is ready to be read
2213
+ * by another client, or will reject if an error occurs.
2525
2214
  */
2526
- getKeys():Set<object>;
2215
+ shareObject(object:Table|Widget|WidgetExportedObject|PartitionedTable|TotalsTable|TreeTable, sharedTicketBytes:string|Uint8Array):Promise<string|Uint8Array>;
2527
2216
  /**
2528
- * Fetch a table containing all the valid keys of the partitioned table.
2529
- * @return Promise of a Table
2530
- * @deprecated
2217
+ * Reads an object shared by another client to this server with the `sharedTicketBytes`. Until the other
2218
+ * client releases this object (or their session ends), the object will be available on the server.
2219
+ * <p>
2220
+ * The type of the object must be passed so that the object can be read from the server correct - the other client
2221
+ * should provide this information.
2222
+ * @param sharedTicketBytes - the value provided by another client/user to obtain the object. It may be a unicode
2223
+ * string (will be encoded as utf8 bytes), or a {@link Uint8Array} value.
2224
+ * @param type - The type of the object, so it can be correctly read from the server
2225
+ * @return A promise that will resolve to the shared object, or will reject with an error if it cannot be read.
2531
2226
  */
2532
- getKeyTable():Promise<Table>;
2227
+ getSharedObject(sharedTicketBytes:string|Uint8Array, type:string):Promise<any>;
2228
+ subscribeToFieldUpdates(callback:(arg0:dh.ide.VariableChanges)=>void):()=>void;
2229
+ close():void;
2230
+ runCode(code:string):Promise<dh.ide.CommandResult>;
2231
+ onLogMessage(callback:(arg0:dh.ide.LogItem)=>void):()=>void;
2232
+ openDocument(params:object):void;
2233
+ changeDocument(params:object):void;
2234
+ getCompletionItems(params:object):Promise<Array<dh.lsp.CompletionItem>>;
2235
+ getSignatureHelp(params:object):Promise<Array<dh.lsp.SignatureInformation>>;
2236
+ getHover(params:object):Promise<dh.lsp.Hover>;
2237
+ closeDocument(params:object):void;
2533
2238
  /**
2534
- * Fetch the underlying base table of the partitioned table.
2535
- * @return Promise of a Table
2239
+ * Creates an empty table with the specified number of rows. Optionally columns and types may be specified, but all
2240
+ * values will be null.
2241
+ * @param size -
2242
+ * @return {@link Promise} of {@link dh.Table}
2536
2243
  */
2537
- getBaseTable():Promise<Table>;
2244
+ emptyTable(size:number):Promise<Table>;
2538
2245
  /**
2539
- * Indicates that this PartitionedTable will no longer be used, removing subcriptions to updated keys, etc. This
2540
- * will not affect tables in use.
2246
+ * Creates a new table that ticks automatically every "periodNanos" nanoseconds. A start time may be provided; if so
2247
+ * the table will be populated with the interval from the specified date until now.
2248
+ * @param periodNanos -
2249
+ * @param startTime -
2250
+ * @return {@link Promise} of {@link dh.Table}
2541
2251
  */
2542
- close():void;
2252
+ timeTable(periodNanos:number, startTime?:DateWrapper):Promise<Table>;
2253
+ addEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):()=>void;
2254
+ nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<Event<T>>;
2255
+ hasListeners(name:string):boolean;
2256
+ removeEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):boolean;
2257
+ }
2258
+
2259
+ /**
2260
+ * Represents a non-viewport subscription to a table, and all data currently known to be present in the subscribed
2261
+ * columns. This class handles incoming snapshots and deltas, and fires events to consumers to notify of data changes.
2262
+ * <p>
2263
+ * Unlike {@link dh.TableViewportSubscription}, the "original" table does not have a reference to this instance, only the
2264
+ * "private" table instance does, since the original cannot modify the subscription, and the private instance must
2265
+ * forward data to it.
2266
+ * <p>
2267
+ * Represents a subscription to the table on the server. Changes made to the table will not be reflected here - the
2268
+ * subscription must be closed and a new one optioned to see those changes. The event model is slightly different from
2269
+ * viewports to make it less expensive to compute for large tables.
2270
+ */
2271
+ export class TableSubscription implements HasEventHandling {
2272
+ protected constructor();
2273
+
2274
+ static createTableSubscription(options:SubscriptionOptions, existingTable:Table):TableSubscription;
2543
2275
  /**
2544
- * The count of known keys.
2545
- * @return int
2276
+ * Updates the subscription to use the given columns and update interval.
2277
+ * @param columns - the new columns to subscribe to
2278
+ * @param updateIntervalMs - the new update interval, or null/omit to use the default of one second
2546
2279
  */
2547
- get size():number;
2280
+ changeSubscription(columns:Array<Column>, updateIntervalMs:number|undefined|null):void;
2548
2281
  /**
2549
- * An array of the columns in the tables that can be retrieved from this partitioned table, including both key and
2550
- * non-key columns.
2551
- * @return Array of Column
2282
+ * Update the options for this viewport subscription. This cannot alter the update interval or preview options.
2283
+ * @param options - the subscription options
2552
2284
  */
2553
- get columns():Column[];
2285
+ update(options:SubscriptionOptions):void;
2286
+ get columns():Array<Column>;
2554
2287
  /**
2555
- * An array of all the key columns that the tables are partitioned by.
2556
- * @return Array of Column
2288
+ * Stops the subscription on the server.
2557
2289
  */
2558
- get keyColumns():Column[];
2290
+ close():void;
2559
2291
  /**
2560
2292
  * Listen for events on this object.
2561
2293
  * @param name - the name of the event to listen for
@@ -2577,22 +2309,101 @@ export namespace dh {
2577
2309
  }
2578
2310
 
2579
2311
  /**
2580
- * Event fired when a command is issued from the client.
2312
+ * Presently, this is the entrypoint into the Deephaven JS API. By creating an instance of this with the server URL and
2313
+ * some options, JS applications can run code on the server, and interact with available exportable objects.
2581
2314
  */
2582
- export class CommandInfo {
2583
- constructor(code:string, result:Promise<dh.ide.CommandResult>);
2584
-
2585
- get result():Promise<dh.ide.CommandResult>;
2586
- get code():string;
2587
- }
2315
+ export class IdeConnection implements HasEventHandling {
2316
+ /**
2317
+ * @deprecated
2318
+ */
2319
+ static readonly HACK_CONNECTION_FAILURE:string;
2320
+ static readonly EVENT_DISCONNECT:string;
2321
+ static readonly EVENT_RECONNECT:string;
2322
+ static readonly EVENT_SHUTDOWN:string;
2588
2323
 
2589
- export class LongWrapper {
2590
2324
  protected constructor();
2591
2325
 
2592
- static ofString(str:string):LongWrapper;
2593
- asNumber():number;
2594
- valueOf():string;
2595
- toString():string;
2326
+ /**
2327
+ * Closes the current connection, releasing any resources on the server or client.
2328
+ */
2329
+ close():void;
2330
+ running():Promise<IdeConnection>;
2331
+ /**
2332
+ * Load the named table, with columns and size information already fully populated.
2333
+ * @param name - the name of the table to fetch
2334
+ * @param applyPreviewColumns - false to disable previews, defaults to true
2335
+ * @return a {@link Promise} that will resolve to the table, or reject with an error if it cannot be loaded.
2336
+ * @deprecated Added to resolve a specific issue, in the future preview will be applied as part of the subscription.
2337
+ */
2338
+ getTable(name:string, applyPreviewColumns?:boolean):Promise<Table>;
2339
+ getObject(definitionObject:dh.ide.VariableDescriptor):Promise<any>;
2340
+ subscribeToFieldUpdates(callback:(arg0:dh.ide.VariableChanges)=>void):()=>void;
2341
+ /**
2342
+ * Makes an `object` available to another user or another client on this same server which knows the value of
2343
+ * the `sharedTicketBytes`. Use that sharedTicketBytes value like a one-time use password - any other client
2344
+ * which knows this value can read the same object.
2345
+ * <p>
2346
+ * Shared objects will remain available using the sharedTicketBytes until the client that first shared them
2347
+ * releases/closes their copy of the object. Whatever side-channel is used to share the bytes, be sure to wait until
2348
+ * the remote end has signaled that it has successfully fetched the object before releasing it from this client.
2349
+ * <p>
2350
+ * Be sure to use an unpredictable value for the shared ticket bytes, like a UUID or other large, random value to
2351
+ * prevent access by unauthorized clients.
2352
+ * @param object - the object to share with another client/user
2353
+ * @param sharedTicketBytes - the value which another client/user must know to obtain the object. It may be a unicode
2354
+ * string (will be encoded as utf8 bytes), or a {@link Uint8Array} value.
2355
+ * @return A promise that will resolve to the value passed as sharedTicketBytes when the object is ready to be read
2356
+ * by another client, or will reject if an error occurs.
2357
+ */
2358
+ shareObject(object:Table|Widget|WidgetExportedObject|PartitionedTable|TotalsTable|TreeTable, sharedTicketBytes:string|Uint8Array):Promise<string|Uint8Array>;
2359
+ /**
2360
+ * Reads an object shared by another client to this server with the `sharedTicketBytes`. Until the other
2361
+ * client releases this object (or their session ends), the object will be available on the server.
2362
+ * <p>
2363
+ * The type of the object must be passed so that the object can be read from the server correct - the other client
2364
+ * should provide this information.
2365
+ * @param sharedTicketBytes - the value provided by another client/user to obtain the object. It may be a unicode
2366
+ * string (will be encoded as utf8 bytes), or a {@link Uint8Array} value.
2367
+ * @param type - The type of the object, so it can be correctly read from the server
2368
+ * @return A promise that will resolve to the shared object, or will reject with an error if it cannot be read.
2369
+ */
2370
+ getSharedObject(sharedTicketBytes:string|Uint8Array, type:string):Promise<any>;
2371
+ newTable(columnNames:string[], types:string[], data:string[][], userTimeZone:string):Promise<Table>;
2372
+ /**
2373
+ * Merges the given tables into a single table. Assumes all tables have the same structure.
2374
+ * @param tables -
2375
+ * @return {@link Promise} of {@link dh.Table}
2376
+ */
2377
+ mergeTables(tables:Table[]):Promise<Table>;
2378
+ /**
2379
+ * Register a callback function to handle any log messages that are emitted on the server. Returns a function ,
2380
+ * which can be invoked to remove this log handler. Any log handler registered in this way will receive as many old
2381
+ * log messages as are presently available.
2382
+ * @param callback -
2383
+ * @return {@link io.deephaven.web.shared.fu.JsRunnable}
2384
+ */
2385
+ onLogMessage(callback:(arg0:dh.ide.LogItem)=>void):()=>void;
2386
+ startSession(type:string):Promise<IdeSession>;
2387
+ getConsoleTypes():Promise<Array<string>>;
2388
+ getWorkerHeapInfo():Promise<WorkerHeapInfo>;
2389
+ /**
2390
+ * Listen for events on this object.
2391
+ * @param name - the name of the event to listen for
2392
+ * @param callback - a function to call when the event occurs
2393
+ * @return Returns a cleanup function.
2394
+ * @typeParam T - the type of the data that the event will provide
2395
+ */
2396
+ addEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):()=>void;
2397
+ nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<Event<T>>;
2398
+ hasListeners(name:string):boolean;
2399
+ /**
2400
+ * Removes an event listener added to this table.
2401
+ * @param name -
2402
+ * @param callback -
2403
+ * @return
2404
+ * @typeParam T -
2405
+ */
2406
+ removeEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):boolean;
2596
2407
  }
2597
2408
 
2598
2409
  /**
@@ -2621,116 +2432,281 @@ export namespace dh {
2621
2432
  get size():number;
2622
2433
  }
2623
2434
 
2435
+ export class LoginCredentials {
2436
+ type?:string|null;
2437
+ username?:string|null;
2438
+ token?:string|null;
2439
+
2440
+ constructor();
2441
+ }
2442
+
2624
2443
  /**
2625
- * Addition optional configuration that can be passed to the {@link dh.CoreClient} constructor.
2444
+ * Describes the structure of the column, and if desired can be used to get access to the data to be rendered in this
2445
+ * column.
2626
2446
  */
2627
- export class ConnectOptions {
2447
+ export class Column {
2628
2448
  /**
2629
- * Optional map of http header names and values to send to the server with each request.
2449
+ * If this column is part of a roll-up tree table, represents the type of the row data that can be found in this
2450
+ * column for leaf nodes if includeConstituents is enabled. Otherwise, it is <b>null</b>.
2451
+ * @return String
2630
2452
  */
2631
- headers?:{ [key: string]: string; }|null;
2453
+ readonly constituentType?:string|null;
2454
+ readonly description?:string|null;
2455
+
2456
+ protected constructor();
2457
+
2632
2458
  /**
2633
- * True to enable debug logging. At this time, only enables logging for gRPC calls.
2459
+ * the value for this column in the given row. Type will be consistent with the type of the Column.
2460
+ * @param row -
2461
+ * @return Any
2634
2462
  */
2635
- debug?:boolean|null;
2463
+ get(row:Row):any;
2464
+ getFormat(row:Row):Format;
2636
2465
  /**
2637
- * Set this to true to force the use of websockets when connecting to the deephaven instance, false to force the use
2638
- * of `fetch`. Ignored if {@link dh.transportFactory} is set.
2639
- * <p>
2640
- * Defaults to null, indicating that the server URL should be checked to see if we connect with fetch or websockets.
2466
+ * Creates a sort builder object, to be used when sorting by this column.
2467
+ * @return {@link dh.Sort}
2641
2468
  */
2642
- useWebsockets?:boolean|null;
2469
+ sort():Sort;
2643
2470
  /**
2644
- * The transport factory to use for creating gRPC streams. If specified, the JS API will ignore
2645
- * {@link dh.useWebsockets} and its own internal logic for determining the appropriate transport to use.
2646
- * <p>
2647
- * Defaults to null, indicating that the JS API should determine the appropriate transport to use. If
2648
- * `useWebsockets` is set to true, the JS API will use websockets, otherwise if the server url begins with
2649
- * https, it will use fetch, otherwise it will use websockets.
2471
+ * Creates a new value for use in filters based on this column. Used either as a parameter to another filter
2472
+ * operation, or as a builder to create a filter operation.
2473
+ * @return {@link dh.FilterValue}
2650
2474
  */
2651
- transportFactory?:dh.grpc.GrpcTransportFactory|null;
2475
+ filter():FilterValue;
2476
+ /**
2477
+ * a <b>CustomColumn</b> object to apply using `applyCustomColumns` with the expression specified.
2478
+ * @param expression -
2479
+ * @return {@link dh.CustomColumn}
2480
+ */
2481
+ formatColor(expression:string, options?:CustomColumnOptions|undefined|null):CustomColumn;
2482
+ /**
2483
+ * a <b>CustomColumn</b> object to apply using <b>applyCustomColumns</b> with the expression specified.
2484
+ * @param expression -
2485
+ * @return {@link dh.CustomColumn}
2486
+ */
2487
+ formatNumber(expression:string, options?:CustomColumnOptions|undefined|null):CustomColumn;
2488
+ /**
2489
+ * a <b>CustomColumn</b> object to apply using <b>applyCustomColumns</b> with the expression specified.
2490
+ * @param expression -
2491
+ * @return {@link dh.CustomColumn}
2492
+ */
2493
+ formatDate(expression:string, options?:CustomColumnOptions|undefined|null):CustomColumn;
2494
+ toString():string;
2495
+ /**
2496
+ * Label for this column.
2497
+ * @return String
2498
+ */
2499
+ get name():string;
2500
+ /**
2501
+ * True if this column is a partition column. Partition columns are used for filtering uncoalesced tables - see
2502
+ * {@link Table.uncoalesced}.
2503
+ * @return true if the column is a partition column
2504
+ */
2505
+ get isPartitionColumn():boolean;
2506
+ /**
2507
+ *
2508
+ * @deprecated do not use. Internal index of the column in the table, to be used as a key on the Row.
2509
+ * @return int
2510
+ */
2511
+ get index():number;
2512
+ get isSortable():boolean;
2513
+ /**
2514
+ * Type of the row data that can be found in this column.
2515
+ * @return String
2516
+ */
2517
+ get type():string;
2518
+ /**
2519
+ * Format entire rows colors using the expression specified. Returns a <b>CustomColumn</b> object to apply to a
2520
+ * table using <b>applyCustomColumns</b> with the parameters specified.
2521
+ * @param expression -
2522
+ * @param options -
2523
+ * @return {@link dh.CustomColumn}
2524
+ */
2525
+ static formatRowColor(expression:string, options?:CustomColumnOptions|undefined|null):CustomColumn;
2526
+ /**
2527
+ * a <b>CustomColumn</b> object to apply using <b>applyCustomColumns</b> with the expression specified.
2528
+ * @param name -
2529
+ * @param expression -
2530
+ * @param options -
2531
+ * @return {@link dh.CustomColumn}
2532
+ */
2533
+ static createCustomColumn(name:string, expression:string, options?:CustomColumnOptions|undefined|null):CustomColumn;
2534
+ }
2535
+
2536
+ /**
2537
+ * Deprecated for use in Deephaven Core.
2538
+ * @deprecated
2539
+ */
2540
+ export class Client {
2541
+ static readonly EVENT_REQUEST_FAILED:string;
2542
+ static readonly EVENT_REQUEST_STARTED:string;
2543
+ static readonly EVENT_REQUEST_SUCCEEDED:string;
2652
2544
 
2653
2545
  constructor();
2654
2546
  }
2655
2547
 
2548
+ export class CoreClient implements HasEventHandling {
2549
+ static readonly EVENT_CONNECT:string;
2550
+ static readonly EVENT_DISCONNECT:string;
2551
+ static readonly EVENT_RECONNECT:string;
2552
+ static readonly EVENT_RECONNECT_AUTH_FAILED:string;
2553
+ static readonly EVENT_REQUEST_FAILED:string;
2554
+ static readonly EVENT_REQUEST_STARTED:string;
2555
+ static readonly EVENT_REQUEST_SUCCEEDED:string;
2556
+ /**
2557
+ * @deprecated
2558
+ */
2559
+ static readonly EVENT_REFRESH_TOKEN_UPDATED:string;
2560
+ static readonly LOGIN_TYPE_PASSWORD:string;
2561
+ static readonly LOGIN_TYPE_ANONYMOUS:string;
2562
+
2563
+ constructor(serverUrl:string, connectOptions?:ConnectOptions);
2564
+
2565
+ running():Promise<CoreClient>;
2566
+ getServerUrl():string;
2567
+ getAuthConfigValues():Promise<string[][]>;
2568
+ login(credentials:LoginCredentials):Promise<void>;
2569
+ relogin(token:RefreshToken):Promise<void>;
2570
+ onConnected(timeoutInMillis?:number):Promise<void>;
2571
+ getServerConfigValues():Promise<string[][]>;
2572
+ getStorageService():dh.storage.StorageService;
2573
+ getAsIdeConnection():Promise<IdeConnection>;
2574
+ disconnect():void;
2575
+ addEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):()=>void;
2576
+ nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<Event<T>>;
2577
+ hasListeners(name:string):boolean;
2578
+ removeEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):boolean;
2579
+ }
2580
+
2656
2581
  /**
2657
- * Presently, this is the entrypoint into the Deephaven JS API. By creating an instance of this with the server URL and
2658
- * some options, JS applications can run code on the server, and interact with available exportable objects.
2582
+ * A Widget represents a server side object that sends one or more responses to the client. The client can then
2583
+ * interpret these responses to see what to render, or how to respond.
2584
+ * <p>
2585
+ * Most custom object types result in a single response being sent to the client, often with other exported objects, but
2586
+ * some will have streamed responses, and allow the client to send follow-up requests of its own. This class's API is
2587
+ * backwards compatible, but as such does not offer a way to tell the difference between a streaming or non-streaming
2588
+ * object type, the client code that handles the payloads is expected to know what to expect. See
2589
+ * {@link dh.WidgetMessageDetails} for more information.
2590
+ * <p>
2591
+ * When the promise that returns this object resolves, it will have the first response assigned to its fields. Later
2592
+ * responses from the server will be emitted as "message" events. When the connection with the server ends, the "close"
2593
+ * event will be emitted. In this way, the connection will behave roughly in the same way as a WebSocket - either side
2594
+ * can close, and after close no more messages will be processed. There can be some latency in closing locally while
2595
+ * remote messages are still pending - it is up to implementations of plugins to handle this case.
2596
+ * <p>
2597
+ * Also like WebSockets, the plugin API doesn't define how to serialize messages, and just handles any binary payloads.
2598
+ * What it does handle however, is allowing those messages to include references to server-side objects with those
2599
+ * payloads. Those server side objects might be tables or other built-in types in the Deephaven JS API, or could be
2600
+ * objects usable through their own plugins. They also might have no plugin at all, allowing the client to hold a
2601
+ * reference to them and pass them back to the server, either to the current plugin instance, or through another API.
2602
+ * The `Widget` type does not specify how those objects should be used or their lifecycle, but leaves that
2603
+ * entirely to the plugin. Messages will arrive in the order they were sent.
2604
+ * <p>
2605
+ * This can suggest several patterns for how plugins operate:
2606
+ * <ul>
2607
+ * <li>The plugin merely exists to transport some other object to the client. This can be useful for objects which can
2608
+ * easily be translated to some other type (like a Table) when the user clicks on it. An example of this is
2609
+ * `pandas.DataFrame` will result in a widget that only contains a static
2610
+ * {@link dh.Table}. Presently, the widget is immediately closed, and only the Table is
2611
+ * provided to the JS API consumer.</li>
2612
+ * <li>The plugin provides references to Tables and other objects, and those objects can live longer than the object
2613
+ * which provided them. One concrete example of this could have been
2614
+ * {@link dh.PartitionedTable} when fetching constituent tables, but it was implemented
2615
+ * before bidirectional plugins were implemented. Another example of this is plugins that serve as a "factory", giving
2616
+ * the user access to table manipulation/creation methods not supported by gRPC or the JS API.</li>
2617
+ * <li>The plugin provides reference to Tables and other objects that only make sense within the context of the widget
2618
+ * instance, so when the widget goes away, those objects should be released as well. This is also an example of
2619
+ * {@link dh.PartitionedTable}, as the partitioned table tracks creation of new keys through
2620
+ * an internal table instance.</li>
2621
+ * </ul>
2622
+ *
2623
+ * Handling server objects in messages also has more than one potential pattern that can be used:
2624
+ * <ul>
2625
+ * <li>One object per message - the message clearly is about that object, no other details required.</li>
2626
+ * <li>Objects indexed within their message - as each message comes with a list of objects, those objects can be
2627
+ * referenced within the payload by index. This is roughly how {@link dh.plot.Figure}
2628
+ * behaves, where the figure descriptor schema includes an index for each created series, describing which table should
2629
+ * be used, which columns should be mapped to each axis.</li>
2630
+ * <li>Objects indexed since widget creation - each message would append its objects to a list created when the widget
2631
+ * was first made, and any new exports that arrive in a new message would be appended to that list. Then, subsequent
2632
+ * messages can reference objects already sent. This imposes a limitation where the client cannot release any exports
2633
+ * without the server somehow signaling that it will never reference that export again.</li>
2634
+ * </ul>
2659
2635
  */
2660
- export class IdeConnection implements HasEventHandling {
2636
+ export class Widget implements WidgetMessageDetails, HasEventHandling {
2637
+ static readonly EVENT_MESSAGE:string;
2638
+ static readonly EVENT_CLOSE:string;
2639
+
2640
+ protected constructor();
2641
+
2661
2642
  /**
2662
- * @deprecated
2643
+ * Ends the client connection to the server.
2663
2644
  */
2664
- static readonly HACK_CONNECTION_FAILURE:string;
2665
- static readonly EVENT_DISCONNECT:string;
2666
- static readonly EVENT_RECONNECT:string;
2667
- static readonly EVENT_SHUTDOWN:string;
2645
+ close():void;
2646
+ getDataAsBase64():string;
2647
+ getDataAsU8():Uint8Array;
2648
+ getDataAsString():string;
2649
+ /**
2650
+ * Sends a string/bytes payload to the server, along with references to objects that exist on the server.
2651
+ * @param msg - string/buffer/view instance that represents data to send
2652
+ * @param references - an array of objects that can be safely sent to the server
2653
+ */
2654
+ sendMessage(msg:string|ArrayBuffer|ArrayBufferView, references?:Array<Table|Widget|WidgetExportedObject|PartitionedTable|TotalsTable|TreeTable>):void;
2655
+ addEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):()=>void;
2656
+ nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<Event<T>>;
2657
+ hasListeners(name:string):boolean;
2658
+ removeEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):boolean;
2659
+ /**
2660
+ *
2661
+ * @return the exported objects sent in the initial message from the server. The client is responsible for closing
2662
+ * them when finished using them.
2663
+ */
2664
+ get exportedObjects():WidgetExportedObject[];
2665
+ /**
2666
+ *
2667
+ * @return the type of this widget
2668
+ */
2669
+ get type():string;
2670
+ }
2668
2671
 
2672
+ /**
2673
+ * This object serves as a "handle" to a subscription, allowing it to be acted on directly or canceled outright. If you
2674
+ * retain an instance of this, you have two choices - either only use it to call `close()` on it to stop the table's
2675
+ * viewport without creating a new one, or listen directly to this object instead of the table for data events, and
2676
+ * always call `close()` when finished. Calling any method on this object other than close() will result in it
2677
+ * continuing to live on after `setViewport` is called on the original table, or after the table is modified.
2678
+ */
2679
+ export class TableViewportSubscription implements HasEventHandling {
2669
2680
  protected constructor();
2670
2681
 
2671
2682
  /**
2672
- * Closes the current connection, releasing any resources on the server or client.
2673
- */
2674
- close():void;
2675
- running():Promise<IdeConnection>;
2676
- /**
2677
- * Load the named table, with columns and size information already fully populated.
2678
- * @param name - the name of the table to fetch
2679
- * @param applyPreviewColumns - false to disable previews, defaults to true
2680
- * @return a {@link Promise} that will resolve to the table, or reject with an error if it cannot be loaded.
2681
- * @deprecated Added to resolve a specific issue, in the future preview will be applied as part of the subscription.
2683
+ * Changes the rows and columns set on this viewport. This cannot be used to change the update interval.
2684
+ * @param firstRow -
2685
+ * @param lastRow -
2686
+ * @param columns -
2687
+ * @param updateIntervalMs -
2688
+ * @deprecated use {@link #update(Object)} instead
2682
2689
  */
2683
- getTable(name:string, applyPreviewColumns?:boolean):Promise<Table>;
2684
- getObject(definitionObject:dh.ide.VariableDescriptor):Promise<any>;
2685
- subscribeToFieldUpdates(callback:(arg0:dh.ide.VariableChanges)=>void):()=>void;
2690
+ setViewport(firstRow:number, lastRow:number, columns?:Column[]|undefined|null, updateIntervalMs?:number|undefined|null, isReverseViewport?:boolean|undefined|null):void;
2686
2691
  /**
2687
- * Makes an `object` available to another user or another client on this same server which knows the value of
2688
- * the `sharedTicketBytes`. Use that sharedTicketBytes value like a one-time use password - any other client
2689
- * which knows this value can read the same object.
2690
- * <p>
2691
- * Shared objects will remain available using the sharedTicketBytes until the client that first shared them
2692
- * releases/closes their copy of the object. Whatever side-channel is used to share the bytes, be sure to wait until
2693
- * the remote end has signaled that it has successfully fetched the object before releasing it from this client.
2694
- * <p>
2695
- * Be sure to use an unpredictable value for the shared ticket bytes, like a UUID or other large, random value to
2696
- * prevent access by unauthorized clients.
2697
- * @param object - the object to share with another client/user
2698
- * @param sharedTicketBytes - the value which another client/user must know to obtain the object. It may be a unicode
2699
- * string (will be encoded as utf8 bytes), or a {@link Uint8Array} value.
2700
- * @return A promise that will resolve to the value passed as sharedTicketBytes when the object is ready to be read
2701
- * by another client, or will reject if an error occurs.
2692
+ * Update the options for this viewport subscription. This cannot alter the update interval or preview options.
2693
+ * @param options - the subscription options
2702
2694
  */
2703
- shareObject(object:Table|Widget|WidgetExportedObject|PartitionedTable|TotalsTable|TreeTable, sharedTicketBytes:string|Uint8Array):Promise<string|Uint8Array>;
2695
+ update(options:ViewportSubscriptionOptions):void;
2704
2696
  /**
2705
- * Reads an object shared by another client to this server with the `sharedTicketBytes`. Until the other
2706
- * client releases this object (or their session ends), the object will be available on the server.
2707
- * <p>
2708
- * The type of the object must be passed so that the object can be read from the server correct - the other client
2709
- * should provide this information.
2710
- * @param sharedTicketBytes - the value provided by another client/user to obtain the object. It may be a unicode
2711
- * string (will be encoded as utf8 bytes), or a {@link Uint8Array} value.
2712
- * @param type - The type of the object, so it can be correctly read from the server
2713
- * @return A promise that will resolve to the shared object, or will reject with an error if it cannot be read.
2697
+ * Stops this viewport from running, stopping all events on itself and on the table that created it.
2714
2698
  */
2715
- getSharedObject(sharedTicketBytes:string|Uint8Array, type:string):Promise<any>;
2716
- newTable(columnNames:string[], types:string[], data:string[][], userTimeZone:string):Promise<Table>;
2699
+ close():void;
2717
2700
  /**
2718
- * Merges the given tables into a single table. Assumes all tables have the same structure.
2719
- * @param tables -
2720
- * @return {@link Promise} of {@link dh.Table}
2701
+ * Gets the data currently visible in this viewport
2702
+ * @return Promise of {@link dh.TableData}.
2721
2703
  */
2722
- mergeTables(tables:Table[]):Promise<Table>;
2704
+ getViewportData():Promise<ViewportData>;
2723
2705
  /**
2724
- * Register a callback function to handle any log messages that are emitted on the server. Returns a function ,
2725
- * which can be invoked to remove this log handler. Any log handler registered in this way will receive as many old
2726
- * log messages as are presently available.
2727
- * @param callback -
2728
- * @return {@link io.deephaven.web.shared.fu.JsRunnable}
2706
+ *
2707
+ * @deprecated Use {@link JsTable#createSnapshot(Object)} instead
2729
2708
  */
2730
- onLogMessage(callback:(arg0:dh.ide.LogItem)=>void):()=>void;
2731
- startSession(type:string):Promise<IdeSession>;
2732
- getConsoleTypes():Promise<Array<string>>;
2733
- getWorkerHeapInfo():Promise<WorkerHeapInfo>;
2709
+ snapshot(rows:RangeSet, columns:Column[]):Promise<TableData>;
2734
2710
  /**
2735
2711
  * Listen for events on this object.
2736
2712
  * @param name - the name of the event to listen for
@@ -2751,6 +2727,30 @@ export namespace dh {
2751
2727
  removeEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):boolean;
2752
2728
  }
2753
2729
 
2730
+ /**
2731
+ * Configuration object for running Table.treeTable to produce a hierarchical view of a given "flat" table.
2732
+ *
2733
+ * Like TotalsTableConfig, `TreeTableConfig` supports an operation map indicating how to aggregate the data, as well as
2734
+ * an array of column names which will be the layers in the roll-up tree, grouped at each level. An additional optional
2735
+ * value can be provided describing the strategy the engine should use when grouping the rows.
2736
+ */
2737
+ export class TreeTableConfig {
2738
+ /**
2739
+ * The column representing the unique ID for each item
2740
+ */
2741
+ idColumn:string;
2742
+ /**
2743
+ * The column representing the parent ID for each item
2744
+ */
2745
+ parentColumn:string;
2746
+ /**
2747
+ * Optional parameter indicating if items with an invalid parent ID should be promoted to root. Defaults to false.
2748
+ */
2749
+ promoteOrphansToRoot:boolean;
2750
+
2751
+ constructor();
2752
+ }
2753
+
2754
2754
 
2755
2755
  type ValueTypeType = string;
2756
2756
  export class ValueType {
@@ -2762,6 +2762,31 @@ export namespace dh {
2762
2762
  static readonly BOOLEAN:ValueTypeType;
2763
2763
  }
2764
2764
 
2765
+ /**
2766
+ * A set of string constants that can be used to describe the different objects the JS API can export.
2767
+ */
2768
+ type VariableTypeType = string;
2769
+ export class VariableType {
2770
+ static readonly TABLE:VariableTypeType;
2771
+ static readonly TREETABLE:VariableTypeType;
2772
+ static readonly HIERARCHICALTABLE:VariableTypeType;
2773
+ static readonly TABLEMAP:VariableTypeType;
2774
+ static readonly PARTITIONEDTABLE:VariableTypeType;
2775
+ static readonly FIGURE:VariableTypeType;
2776
+ static readonly OTHERWIDGET:VariableTypeType;
2777
+ static readonly PANDAS:VariableTypeType;
2778
+ static readonly TREEMAP:VariableTypeType;
2779
+ }
2780
+
2781
+ /**
2782
+ * Describes the type of node in a rollup table.
2783
+ */
2784
+ type RollupNodeTypeType = string;
2785
+ export class RollupNodeType {
2786
+ static readonly ROLLUP_NODE_TYPE_AGGREGATED:RollupNodeTypeType;
2787
+ static readonly ROLLUP_NODE_TYPE_CONSTITUENT:RollupNodeTypeType;
2788
+ }
2789
+
2765
2790
  /**
2766
2791
  * This enum describes the name of each supported operation/aggregation type when creating a `TreeTable`.
2767
2792
  */
@@ -2784,15 +2809,6 @@ export namespace dh {
2784
2809
  static readonly SKIP:AggregationOperationType;
2785
2810
  }
2786
2811
 
2787
- /**
2788
- * Describes the type of node in a rollup table.
2789
- */
2790
- type RollupNodeTypeType = string;
2791
- export class RollupNodeType {
2792
- static readonly ROLLUP_NODE_TYPE_AGGREGATED:RollupNodeTypeType;
2793
- static readonly ROLLUP_NODE_TYPE_CONSTITUENT:RollupNodeTypeType;
2794
- }
2795
-
2796
2812
  type SearchDisplayModeType = string;
2797
2813
  export class SearchDisplayMode {
2798
2814
  static readonly SEARCH_DISPLAY_DEFAULT:SearchDisplayModeType;
@@ -2800,26 +2816,59 @@ export namespace dh {
2800
2816
  static readonly SEARCH_DISPLAY_SHOW:SearchDisplayModeType;
2801
2817
  }
2802
2818
 
2803
- /**
2804
- * A set of string constants that can be used to describe the different objects the JS API can export.
2805
- */
2806
- type VariableTypeType = string;
2807
- export class VariableType {
2808
- static readonly TABLE:VariableTypeType;
2809
- static readonly TREETABLE:VariableTypeType;
2810
- static readonly HIERARCHICALTABLE:VariableTypeType;
2811
- static readonly TABLEMAP:VariableTypeType;
2812
- static readonly PARTITIONEDTABLE:VariableTypeType;
2813
- static readonly FIGURE:VariableTypeType;
2814
- static readonly OTHERWIDGET:VariableTypeType;
2815
- static readonly PANDAS:VariableTypeType;
2816
- static readonly TREEMAP:VariableTypeType;
2817
- }
2818
-
2819
2819
  }
2820
2820
 
2821
2821
  export namespace dh.ide {
2822
2822
 
2823
+ /**
2824
+ * Describes changes in the current set of variables in the script session. Note that variables that changed value
2825
+ * without changing type will be included as <b>updated</b>, but if a new value with one type replaces an old value with
2826
+ * a different type, this will be included as an entry in both <b>removed</b> and <b>created</b> to indicate the old and
2827
+ * new types.
2828
+ */
2829
+ export interface VariableChanges {
2830
+ /**
2831
+ *
2832
+ * @return The variables that no longer exist after this operation, or were replaced by some variable with a
2833
+ * different type.
2834
+ */
2835
+ get removed():Array<VariableDefinition>;
2836
+ /**
2837
+ *
2838
+ * @return The variables that were created by this operation, or have a new type.
2839
+ */
2840
+ get created():Array<VariableDefinition>;
2841
+ /**
2842
+ *
2843
+ * @return The variables that changed value during this operation.
2844
+ */
2845
+ get updated():Array<VariableDefinition>;
2846
+ }
2847
+ /**
2848
+ * Indicates the result of code run on the server.
2849
+ */
2850
+ export interface CommandResult {
2851
+ /**
2852
+ * Describes changes made in the course of this command.
2853
+ * @return {@link dh.ide.VariableChanges}.
2854
+ */
2855
+ get changes():VariableChanges;
2856
+ /**
2857
+ * If the command failed, the error message will be provided here.
2858
+ * @return String
2859
+ */
2860
+ get error():string;
2861
+ /**
2862
+ * The timestamp when the command finished running.
2863
+ * @return DateWrapper
2864
+ */
2865
+ get endTimestamp():dh.DateWrapper;
2866
+ /**
2867
+ * The timestamp when the command started running.
2868
+ * @return DateWrapper
2869
+ */
2870
+ get startTimestamp():dh.DateWrapper;
2871
+ }
2823
2872
  /**
2824
2873
  * A format to describe a variable available to be read from the server. Application fields are optional, and only
2825
2874
  * populated when a variable is provided by application mode.
@@ -2878,66 +2927,17 @@ export namespace dh.ide {
2878
2927
  * The level of the log message, enabling the client to ignore messages.
2879
2928
  * @return String
2880
2929
  */
2881
- get logLevel():string;
2882
- /**
2883
- * Timestamp of the message in microseconds since Jan 1, 1970 UTC.
2884
- * @return double
2885
- */
2886
- get micros():number;
2887
- /**
2888
- * The log message written on the server.
2889
- * @return String
2890
- */
2891
- get message():string;
2892
- }
2893
- /**
2894
- * Indicates the result of code run on the server.
2895
- */
2896
- export interface CommandResult {
2897
- /**
2898
- * Describes changes made in the course of this command.
2899
- * @return {@link dh.ide.VariableChanges}.
2900
- */
2901
- get changes():VariableChanges;
2902
- /**
2903
- * If the command failed, the error message will be provided here.
2904
- * @return String
2905
- */
2906
- get error():string;
2907
- /**
2908
- * The timestamp when the command finished running.
2909
- * @return DateWrapper
2910
- */
2911
- get endTimestamp():dh.DateWrapper;
2912
- /**
2913
- * The timestamp when the command started running.
2914
- * @return DateWrapper
2915
- */
2916
- get startTimestamp():dh.DateWrapper;
2917
- }
2918
- /**
2919
- * Describes changes in the current set of variables in the script session. Note that variables that changed value
2920
- * without changing type will be included as <b>updated</b>, but if a new value with one type replaces an old value with
2921
- * a different type, this will be included as an entry in both <b>removed</b> and <b>created</b> to indicate the old and
2922
- * new types.
2923
- */
2924
- export interface VariableChanges {
2925
- /**
2926
- *
2927
- * @return The variables that no longer exist after this operation, or were replaced by some variable with a
2928
- * different type.
2929
- */
2930
- get removed():Array<VariableDefinition>;
2930
+ get logLevel():string;
2931
2931
  /**
2932
- *
2933
- * @return The variables that were created by this operation, or have a new type.
2932
+ * Timestamp of the message in microseconds since Jan 1, 1970 UTC.
2933
+ * @return double
2934
2934
  */
2935
- get created():Array<VariableDefinition>;
2935
+ get micros():number;
2936
2936
  /**
2937
- *
2938
- * @return The variables that changed value during this operation.
2937
+ * The log message written on the server.
2938
+ * @return String
2939
2939
  */
2940
- get updated():Array<VariableDefinition>;
2940
+ get message():string;
2941
2941
  }
2942
2942
  }
2943
2943
 
@@ -3210,6 +3210,24 @@ export namespace dh.i18n {
3210
3210
 
3211
3211
  export namespace dh.grpc {
3212
3212
 
3213
+ /**
3214
+ * Factory for creating gRPC transports.
3215
+ */
3216
+ export interface GrpcTransportFactory {
3217
+ /**
3218
+ * Create a new transport instance.
3219
+ * @param options - options for creating the transport
3220
+ * @return a transport instance to use for gRPC communication
3221
+ */
3222
+ create(options:GrpcTransportOptions):GrpcTransport;
3223
+ /**
3224
+ * Return true to signal that created transports may have {@link GrpcTransport.sendMessage} called on it
3225
+ * more than once before {@link GrpcTransport.finishSend} should be called.
3226
+ * @return true to signal that the implementation can stream multiple messages, false otherwise indicating that
3227
+ * Open/Next gRPC calls should be used
3228
+ */
3229
+ get supportsClientStreaming():boolean;
3230
+ }
3213
3231
  /**
3214
3232
  * gRPC transport implementation.
3215
3233
  */
@@ -3262,96 +3280,10 @@ export namespace dh.grpc {
3262
3280
  */
3263
3281
  onEnd:(error?:Error|undefined|null)=>void;
3264
3282
  }
3265
- /**
3266
- * Factory for creating gRPC transports.
3267
- */
3268
- export interface GrpcTransportFactory {
3269
- /**
3270
- * Create a new transport instance.
3271
- * @param options - options for creating the transport
3272
- * @return a transport instance to use for gRPC communication
3273
- */
3274
- create(options:GrpcTransportOptions):GrpcTransport;
3275
- /**
3276
- * Return true to signal that created transports may have {@link GrpcTransport.sendMessage} called on it
3277
- * more than once before {@link GrpcTransport.finishSend} should be called.
3278
- * @return true to signal that the implementation can stream multiple messages, false otherwise indicating that
3279
- * Open/Next gRPC calls should be used
3280
- */
3281
- get supportsClientStreaming():boolean;
3282
- }
3283
3283
  }
3284
3284
 
3285
3285
  export namespace dh.plot {
3286
3286
 
3287
- export interface FigureDataUpdatedEvent {
3288
- getArray(series:Series, sourceType:number, mappingFunc?:(arg0:any)=>any):Array<any>;
3289
- get series():Series[];
3290
- }
3291
- /**
3292
- * Provides access to the data for displaying in a figure.
3293
- */
3294
- export interface Series {
3295
- readonly isLinesVisible?:boolean|null;
3296
- readonly pointLabelFormat?:string|null;
3297
- readonly yToolTipPattern?:string|null;
3298
- readonly shapeSize?:number|null;
3299
- readonly xToolTipPattern?:string|null;
3300
- readonly isShapesVisible?:boolean|null;
3301
-
3302
- subscribe(forceDisableDownsample?:DownsampleOptions):void;
3303
- /**
3304
- * Disable updates for this Series.
3305
- */
3306
- unsubscribe():void;
3307
- get shape():string;
3308
- /**
3309
- * Contains details on how to access data within the chart for this series. keyed with the way that this series uses
3310
- * the axis.
3311
- * @return {@link dh.plot.SeriesDataSource}
3312
- */
3313
- get sources():SeriesDataSource[];
3314
- get lineColor():string;
3315
- /**
3316
- * The plotting style to use for this series. See <b>SeriesPlotStyle</b> enum for more details.
3317
- * @return int
3318
- */
3319
- get plotStyle():SeriesPlotStyleType;
3320
- get oneClick():OneClick;
3321
- get gradientVisible():boolean;
3322
- get shapeColor():string;
3323
- /**
3324
- * The name for this series.
3325
- * @return String
3326
- */
3327
- get name():string;
3328
- /**
3329
- * indicates that this series belongs to a MultiSeries, null otherwise
3330
- * @return dh.plot.MultiSeries
3331
- */
3332
- get multiSeries():MultiSeries;
3333
- get shapeLabel():string;
3334
- }
3335
- /**
3336
- * Describes how to access and display data required within a series.
3337
- */
3338
- export interface SeriesDataSource {
3339
- /**
3340
- * the type of data stored in the underlying table's Column.
3341
- * @return String
3342
- */
3343
- get columnType():string;
3344
- /**
3345
- * the axis that this source should be drawn on.
3346
- * @return dh.plot.Axis
3347
- */
3348
- get axis():Axis;
3349
- /**
3350
- * the feature of this series represented by this source. See the <b>SourceType</b> enum for more details.
3351
- * @return int
3352
- */
3353
- get type():SourceTypeType;
3354
- }
3355
3287
  /**
3356
3288
  * Describes a template that will be used to make new series instances when a new table added to a plotBy.
3357
3289
  */
@@ -3441,96 +3373,73 @@ export namespace dh.plot {
3441
3373
  get formatType():AxisFormatTypeType;
3442
3374
  get minRange():number;
3443
3375
  }
3444
-
3445
- export class FigureSourceException {
3446
- table:dh.Table;
3447
- source:SeriesDataSource;
3448
-
3449
- protected constructor();
3450
- }
3451
-
3452
3376
  /**
3453
- * Helper class to manage snapshots and deltas and keep not only a contiguous JS array of data per column in the
3454
- * underlying table, but also support a mapping function to let client code translate data in some way for display and
3455
- * keep that cached as well.
3377
+ * Describes how to access and display data required within a series.
3456
3378
  */
3457
- export class ChartData {
3458
- constructor(table:dh.Table);
3459
-
3460
- update(tableData:dh.SubscriptionTableData):void;
3461
- getColumn(columnName:string, mappingFunc:(arg0:any)=>any, currentUpdate:dh.TableData):Array<any>;
3379
+ export interface SeriesDataSource {
3462
3380
  /**
3463
- * Removes some column from the cache, avoiding extra computation on incoming events, and possibly freeing some
3464
- * memory. If this pair of column name and map function are requested again, it will be recomputed from scratch.
3381
+ * the type of data stored in the underlying table's Column.
3382
+ * @return String
3465
3383
  */
3466
- removeColumn(columnName:string, mappingFunc:(arg0:any)=>any):void;
3467
- }
3468
-
3469
- export class AxisDescriptor {
3470
- formatType:string;
3471
- type:string;
3472
- position:string;
3473
- log?:boolean|null;
3474
- label?:string|null;
3475
- labelFont?:string|null;
3476
- ticksFont?:string|null;
3477
- formatPattern?:string|null;
3478
- color?:string|null;
3479
- minRange?:number|null;
3480
- maxRange?:number|null;
3481
- minorTicksVisible?:boolean|null;
3482
- majorTicksVisible?:boolean|null;
3483
- minorTickCount?:number|null;
3484
- gapBetweenMajorTicks?:number|null;
3485
- majorTickLocations?:Array<number>|null;
3486
- tickLabelAngle?:number|null;
3487
- invert?:boolean|null;
3488
- isTimeAxis?:boolean|null;
3489
-
3490
- constructor();
3491
- }
3492
-
3493
- export class SeriesDescriptor {
3494
- plotStyle:string;
3495
- name?:string|null;
3496
- linesVisible?:boolean|null;
3497
- shapesVisible?:boolean|null;
3498
- gradientVisible?:boolean|null;
3499
- lineColor?:string|null;
3500
- pointLabelFormat?:string|null;
3501
- xToolTipPattern?:string|null;
3502
- yToolTipPattern?:string|null;
3503
- shapeLabel?:string|null;
3504
- shapeSize?:number|null;
3505
- shapeColor?:string|null;
3506
- shape?:string|null;
3507
- dataSources:Array<SourceDescriptor>;
3508
-
3509
- constructor();
3510
- }
3511
-
3512
- export class FigureFetchError {
3513
- error:object;
3514
- errors:Array<string>;
3515
-
3516
- protected constructor();
3384
+ get columnType():string;
3385
+ /**
3386
+ * the axis that this source should be drawn on.
3387
+ * @return dh.plot.Axis
3388
+ */
3389
+ get axis():Axis;
3390
+ /**
3391
+ * the feature of this series represented by this source. See the <b>SourceType</b> enum for more details.
3392
+ * @return int
3393
+ */
3394
+ get type():SourceTypeType;
3517
3395
  }
3518
-
3519
3396
  /**
3520
- * A descriptor used with JsFigureFactory.create to create a figure from JS.
3397
+ * Provides access to the data for displaying in a figure.
3521
3398
  */
3522
- export class FigureDescriptor {
3523
- title?:string|null;
3524
- titleFont?:string|null;
3525
- titleColor?:string|null;
3526
- isResizable?:boolean|null;
3527
- isDefaultTheme?:boolean|null;
3528
- updateInterval?:number|null;
3529
- cols?:number|null;
3530
- rows?:number|null;
3531
- charts:Array<ChartDescriptor>;
3399
+ export interface Series {
3400
+ readonly isLinesVisible?:boolean|null;
3401
+ readonly pointLabelFormat?:string|null;
3402
+ readonly yToolTipPattern?:string|null;
3403
+ readonly shapeSize?:number|null;
3404
+ readonly xToolTipPattern?:string|null;
3405
+ readonly isShapesVisible?:boolean|null;
3532
3406
 
3533
- constructor();
3407
+ subscribe(forceDisableDownsample?:DownsampleOptions):void;
3408
+ /**
3409
+ * Disable updates for this Series.
3410
+ */
3411
+ unsubscribe():void;
3412
+ get shape():string;
3413
+ /**
3414
+ * Contains details on how to access data within the chart for this series. keyed with the way that this series uses
3415
+ * the axis.
3416
+ * @return {@link dh.plot.SeriesDataSource}
3417
+ */
3418
+ get sources():SeriesDataSource[];
3419
+ get lineColor():string;
3420
+ /**
3421
+ * The plotting style to use for this series. See <b>SeriesPlotStyle</b> enum for more details.
3422
+ * @return int
3423
+ */
3424
+ get plotStyle():SeriesPlotStyleType;
3425
+ get oneClick():OneClick;
3426
+ get gradientVisible():boolean;
3427
+ get shapeColor():string;
3428
+ /**
3429
+ * The name for this series.
3430
+ * @return String
3431
+ */
3432
+ get name():string;
3433
+ /**
3434
+ * indicates that this series belongs to a MultiSeries, null otherwise
3435
+ * @return dh.plot.MultiSeries
3436
+ */
3437
+ get multiSeries():MultiSeries;
3438
+ get shapeLabel():string;
3439
+ }
3440
+ export interface FigureDataUpdatedEvent {
3441
+ getArray(series:Series, sourceType:number, mappingFunc?:(arg0:any)=>any):Array<any>;
3442
+ get series():Series[];
3534
3443
  }
3535
3444
 
3536
3445
  export class ChartDescriptor {
@@ -3594,6 +3503,58 @@ export namespace dh.plot {
3594
3503
  get multiSeries():MultiSeries[];
3595
3504
  }
3596
3505
 
3506
+ export class SourceDescriptor {
3507
+ axis:AxisDescriptor;
3508
+ table:dh.Table;
3509
+ columnName:string;
3510
+ type:string;
3511
+
3512
+ constructor();
3513
+ }
3514
+
3515
+ /**
3516
+ * Helper class for plot downsampling methods.
3517
+ */
3518
+ export class Downsample {
3519
+ protected constructor();
3520
+
3521
+ /**
3522
+ * Downsamples a table so that the data can be used for a time-series line plot. The downsampled table should have
3523
+ * the same visual fidelity as the original table, but with fewer rows.
3524
+ * @param table - The table to downsample.
3525
+ * @param xCol - The name of the X column to downsample. Must be an Instant or long.
3526
+ * @param yCols - The names of the Y columns to downsample.
3527
+ * @param width - The width of the visible area in pixels.
3528
+ * @param xRange - The visible range as `[start, end]` or null to always use all data.
3529
+ * @return A promise that resolves to the downsampled table.
3530
+ */
3531
+ static runChartDownsample(table:dh.Table, xCol:string, yCols:string[], width:number, xRange?:dh.LongWrapper[]|undefined|null):Promise<dh.Table>;
3532
+ }
3533
+
3534
+ export class AxisDescriptor {
3535
+ formatType:string;
3536
+ type:string;
3537
+ position:string;
3538
+ log?:boolean|null;
3539
+ label?:string|null;
3540
+ labelFont?:string|null;
3541
+ ticksFont?:string|null;
3542
+ formatPattern?:string|null;
3543
+ color?:string|null;
3544
+ minRange?:number|null;
3545
+ maxRange?:number|null;
3546
+ minorTicksVisible?:boolean|null;
3547
+ majorTicksVisible?:boolean|null;
3548
+ minorTickCount?:number|null;
3549
+ gapBetweenMajorTicks?:number|null;
3550
+ majorTickLocations?:Array<number>|null;
3551
+ tickLabelAngle?:number|null;
3552
+ invert?:boolean|null;
3553
+ isTimeAxis?:boolean|null;
3554
+
3555
+ constructor();
3556
+ }
3557
+
3597
3558
  export class Figure implements dh.HasEventHandling {
3598
3559
  /**
3599
3560
  * The title of the figure.
@@ -3678,11 +3639,30 @@ export namespace dh.plot {
3678
3639
  removeEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):boolean;
3679
3640
  }
3680
3641
 
3681
- export class SeriesDataSourceException {
3682
- protected constructor();
3642
+ export class SeriesDescriptor {
3643
+ plotStyle:string;
3644
+ name?:string|null;
3645
+ linesVisible?:boolean|null;
3646
+ shapesVisible?:boolean|null;
3647
+ gradientVisible?:boolean|null;
3648
+ lineColor?:string|null;
3649
+ pointLabelFormat?:string|null;
3650
+ xToolTipPattern?:string|null;
3651
+ yToolTipPattern?:string|null;
3652
+ shapeLabel?:string|null;
3653
+ shapeSize?:number|null;
3654
+ shapeColor?:string|null;
3655
+ shape?:string|null;
3656
+ dataSources:Array<SourceDescriptor>;
3683
3657
 
3684
- get source():SeriesDataSource;
3685
- get message():string;
3658
+ constructor();
3659
+ }
3660
+
3661
+ export class FigureFetchError {
3662
+ error:object;
3663
+ errors:Array<string>;
3664
+
3665
+ protected constructor();
3686
3666
  }
3687
3667
 
3688
3668
  export class DownsampleOptions {
@@ -3711,48 +3691,59 @@ export namespace dh.plot {
3711
3691
  protected constructor();
3712
3692
  }
3713
3693
 
3694
+ export class FigureSourceException {
3695
+ table:dh.Table;
3696
+ source:SeriesDataSource;
3697
+
3698
+ protected constructor();
3699
+ }
3700
+
3714
3701
  /**
3715
- * Helper class for plot downsampling methods.
3702
+ * Helper class to manage snapshots and deltas and keep not only a contiguous JS array of data per column in the
3703
+ * underlying table, but also support a mapping function to let client code translate data in some way for display and
3704
+ * keep that cached as well.
3716
3705
  */
3717
- export class Downsample {
3718
- protected constructor();
3706
+ export class ChartData {
3707
+ constructor(table:dh.Table);
3719
3708
 
3709
+ update(tableData:dh.SubscriptionTableData):void;
3710
+ getColumn(columnName:string, mappingFunc:(arg0:any)=>any, currentUpdate:dh.TableData):Array<any>;
3720
3711
  /**
3721
- * Downsamples a table so that the data can be used for a time-series line plot. The downsampled table should have
3722
- * the same visual fidelity as the original table, but with fewer rows.
3723
- * @param table - The table to downsample.
3724
- * @param xCol - The name of the X column to downsample. Must be an Instant or long.
3725
- * @param yCols - The names of the Y columns to downsample.
3726
- * @param width - The width of the visible area in pixels.
3727
- * @param xRange - The visible range as `[start, end]` or null to always use all data.
3728
- * @return A promise that resolves to the downsampled table.
3712
+ * Removes some column from the cache, avoiding extra computation on incoming events, and possibly freeing some
3713
+ * memory. If this pair of column name and map function are requested again, it will be recomputed from scratch.
3729
3714
  */
3730
- static runChartDownsample(table:dh.Table, xCol:string, yCols:string[], width:number, xRange?:dh.LongWrapper[]|undefined|null):Promise<dh.Table>;
3715
+ removeColumn(columnName:string, mappingFunc:(arg0:any)=>any):void;
3731
3716
  }
3732
3717
 
3733
- export class SourceDescriptor {
3734
- axis:AxisDescriptor;
3735
- table:dh.Table;
3736
- columnName:string;
3737
- type:string;
3718
+ /**
3719
+ * A descriptor used with JsFigureFactory.create to create a figure from JS.
3720
+ */
3721
+ export class FigureDescriptor {
3722
+ title?:string|null;
3723
+ titleFont?:string|null;
3724
+ titleColor?:string|null;
3725
+ isResizable?:boolean|null;
3726
+ isDefaultTheme?:boolean|null;
3727
+ updateInterval?:number|null;
3728
+ cols?:number|null;
3729
+ rows?:number|null;
3730
+ charts:Array<ChartDescriptor>;
3738
3731
 
3739
3732
  constructor();
3740
3733
  }
3741
3734
 
3735
+ export class SeriesDataSourceException {
3736
+ protected constructor();
3742
3737
 
3743
- /**
3744
- * This enum describes what kind of chart is being drawn. This may limit what kinds of series can be found on it, or how
3745
- * those series should be rendered.
3746
- */
3747
- type ChartTypeType = number;
3748
- export class ChartType {
3749
- static readonly XY:ChartTypeType;
3750
- static readonly PIE:ChartTypeType;
3751
- static readonly OHLC:ChartTypeType;
3752
- static readonly CATEGORY:ChartTypeType;
3753
- static readonly XYZ:ChartTypeType;
3754
- static readonly CATEGORY_3D:ChartTypeType;
3755
- static readonly TREEMAP:ChartTypeType;
3738
+ get source():SeriesDataSource;
3739
+ get message():string;
3740
+ }
3741
+
3742
+
3743
+ type AxisFormatTypeType = number;
3744
+ export class AxisFormatType {
3745
+ static readonly CATEGORY:AxisFormatTypeType;
3746
+ static readonly NUMBER:AxisFormatTypeType;
3756
3747
  }
3757
3748
 
3758
3749
  type AxisTypeType = number;
@@ -3765,15 +3756,6 @@ export namespace dh.plot {
3765
3756
  static readonly COLOR:AxisTypeType;
3766
3757
  }
3767
3758
 
3768
- type AxisPositionType = number;
3769
- export class AxisPosition {
3770
- static readonly TOP:AxisPositionType;
3771
- static readonly BOTTOM:AxisPositionType;
3772
- static readonly LEFT:AxisPositionType;
3773
- static readonly RIGHT:AxisPositionType;
3774
- static readonly NONE:AxisPositionType;
3775
- }
3776
-
3777
3759
  /**
3778
3760
  * This enum describes the source it is in, and how this aspect of the data in the series should be used to render the
3779
3761
  * 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
@@ -3803,10 +3785,19 @@ export namespace dh.plot {
3803
3785
  static readonly HOVER_TEXT:SourceTypeType;
3804
3786
  }
3805
3787
 
3806
- type AxisFormatTypeType = number;
3807
- export class AxisFormatType {
3808
- static readonly CATEGORY:AxisFormatTypeType;
3809
- static readonly NUMBER:AxisFormatTypeType;
3788
+ /**
3789
+ * This enum describes what kind of chart is being drawn. This may limit what kinds of series can be found on it, or how
3790
+ * those series should be rendered.
3791
+ */
3792
+ type ChartTypeType = number;
3793
+ export class ChartType {
3794
+ static readonly XY:ChartTypeType;
3795
+ static readonly PIE:ChartTypeType;
3796
+ static readonly OHLC:ChartTypeType;
3797
+ static readonly CATEGORY:ChartTypeType;
3798
+ static readonly XYZ:ChartTypeType;
3799
+ static readonly CATEGORY_3D:ChartTypeType;
3800
+ static readonly TREEMAP:ChartTypeType;
3810
3801
  }
3811
3802
 
3812
3803
  type SeriesPlotStyleType = number;
@@ -3825,25 +3816,41 @@ export namespace dh.plot {
3825
3816
  static readonly TREEMAP:SeriesPlotStyleType;
3826
3817
  }
3827
3818
 
3819
+ type AxisPositionType = number;
3820
+ export class AxisPosition {
3821
+ static readonly TOP:AxisPositionType;
3822
+ static readonly BOTTOM:AxisPositionType;
3823
+ static readonly LEFT:AxisPositionType;
3824
+ static readonly RIGHT:AxisPositionType;
3825
+ static readonly NONE:AxisPositionType;
3826
+ }
3827
+
3828
3828
  }
3829
3829
 
3830
3830
  export namespace dh.lsp {
3831
3831
 
3832
- export class Hover {
3833
- contents:MarkupContent;
3832
+ export class TextDocumentContentChangeEvent {
3834
3833
  range:Range;
3834
+ rangeLength:number;
3835
+ text:string;
3835
3836
 
3836
3837
  constructor();
3837
3838
  }
3838
3839
 
3839
- export class TextDocumentContentChangeEvent {
3840
+ export class TextEdit {
3840
3841
  range:Range;
3841
- rangeLength:number;
3842
3842
  text:string;
3843
3843
 
3844
3844
  constructor();
3845
3845
  }
3846
3846
 
3847
+ export class MarkupContent {
3848
+ kind:string;
3849
+ value:string;
3850
+
3851
+ constructor();
3852
+ }
3853
+
3847
3854
  export class ParameterInformation {
3848
3855
  label:string;
3849
3856
  documentation:MarkupContent;
@@ -3864,18 +3871,19 @@ export namespace dh.lsp {
3864
3871
  copy():Position;
3865
3872
  }
3866
3873
 
3867
- export class MarkupContent {
3868
- kind:string;
3869
- value:string;
3870
-
3871
- constructor();
3872
- }
3873
-
3874
- export class SignatureInformation {
3874
+ export class CompletionItem {
3875
3875
  label:string;
3876
+ kind:number;
3877
+ detail:string;
3876
3878
  documentation:MarkupContent;
3877
- parameters:Array<ParameterInformation>;
3878
- activeParameter:number;
3879
+ deprecated:boolean;
3880
+ preselect:boolean;
3881
+ textEdit:TextEdit;
3882
+ sortText:string;
3883
+ filterText:string;
3884
+ insertTextFormat:number;
3885
+ additionalTextEdits:Array<TextEdit>;
3886
+ commitCharacters:Array<string>;
3879
3887
 
3880
3888
  constructor();
3881
3889
  }
@@ -3889,26 +3897,18 @@ export namespace dh.lsp {
3889
3897
  isInside(innerStart:Position, innerEnd:Position):boolean;
3890
3898
  }
3891
3899
 
3892
- export class TextEdit {
3893
- range:Range;
3894
- text:string;
3900
+ export class SignatureInformation {
3901
+ label:string;
3902
+ documentation:MarkupContent;
3903
+ parameters:Array<ParameterInformation>;
3904
+ activeParameter:number;
3895
3905
 
3896
3906
  constructor();
3897
3907
  }
3898
3908
 
3899
- export class CompletionItem {
3900
- label:string;
3901
- kind:number;
3902
- detail:string;
3903
- documentation:MarkupContent;
3904
- deprecated:boolean;
3905
- preselect:boolean;
3906
- textEdit:TextEdit;
3907
- sortText:string;
3908
- filterText:string;
3909
- insertTextFormat:number;
3910
- additionalTextEdits:Array<TextEdit>;
3911
- commitCharacters:Array<string>;
3909
+ export class Hover {
3910
+ contents:MarkupContent;
3911
+ range:Range;
3912
3912
 
3913
3913
  constructor();
3914
3914
  }
@@ -3917,6 +3917,10 @@ export namespace dh.lsp {
3917
3917
 
3918
3918
  export namespace dh.calendar {
3919
3919
 
3920
+ export interface BusinessPeriod {
3921
+ get close():string;
3922
+ get open():string;
3923
+ }
3920
3924
  /**
3921
3925
  * Defines a calendar with business hours and holidays.
3922
3926
  */
@@ -3947,10 +3951,6 @@ export namespace dh.calendar {
3947
3951
  */
3948
3952
  get businessPeriods():Array<BusinessPeriod>;
3949
3953
  }
3950
- export interface BusinessPeriod {
3951
- get close():string;
3952
- get open():string;
3953
- }
3954
3954
  export interface Holiday {
3955
3955
  /**
3956
3956
  * The date of the Holiday.