@deephaven/jsapi-types 41.2.0 → 41.3.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 +1828 -1828
  2. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -1,10 +1,6 @@
1
1
  // Minimum TypeScript Version: 4.3
2
2
  // Generated using com.vertispan.tsdefs.doclet.TsDoclet
3
3
 
4
- export interface IIterableResult<T> {
5
- value:T;
6
- done:boolean;
7
- }
8
4
  /**
9
5
  * This is part of EcmaScript 2015, documented here for completeness. It supports a single method, <b>next()</b>, which
10
6
  * returns an object with a <b>boolean</b> named <b>done</b> (true if there are no more items to return; false
@@ -15,8 +11,43 @@ export interface Iterator<T> {
15
11
  hasNext():boolean;
16
12
  next():IIterableResult<T>;
17
13
  }
14
+ export interface IIterableResult<T> {
15
+ value:T;
16
+ done:boolean;
17
+ }
18
18
  export namespace dh.storage {
19
19
 
20
+ /**
21
+ * Represents a file's contents loaded from the server. If an etag was specified when loading, client should first test
22
+ * if the etag of this instance matches - if so, the contents will be empty, and the client's existing contents should
23
+ * be used.
24
+ */
25
+ export class FileContents {
26
+ protected constructor();
27
+
28
+ static blob(blob:Blob):FileContents;
29
+ static text(...text:string[]):FileContents;
30
+ static arrayBuffers(...buffers:ArrayBuffer[]):FileContents;
31
+ text():Promise<string>;
32
+ arrayBuffer():Promise<ArrayBuffer>;
33
+ get etag():string;
34
+ }
35
+
36
+ /**
37
+ * Storage service metadata about files and folders.
38
+ */
39
+ export class ItemDetails {
40
+ protected constructor();
41
+
42
+ toString():string;
43
+ get filename():string;
44
+ get basename():string;
45
+ get size():number;
46
+ get etag():string;
47
+ get type():ItemTypeType;
48
+ get dirname():string;
49
+ }
50
+
20
51
  /**
21
52
  * Remote service to read and write files on the server. Paths use "/" as a separator, and should not start with "/".
22
53
  */
@@ -75,37 +106,6 @@ export namespace dh.storage {
75
106
  createDirectory(path:string):Promise<void>;
76
107
  }
77
108
 
78
- /**
79
- * Storage service metadata about files and folders.
80
- */
81
- export class ItemDetails {
82
- protected constructor();
83
-
84
- toString():string;
85
- get filename():string;
86
- get basename():string;
87
- get size():number;
88
- get etag():string;
89
- get type():ItemTypeType;
90
- get dirname():string;
91
- }
92
-
93
- /**
94
- * Represents a file's contents loaded from the server. If an etag was specified when loading, client should first test
95
- * if the etag of this instance matches - if so, the contents will be empty, and the client's existing contents should
96
- * be used.
97
- */
98
- export class FileContents {
99
- protected constructor();
100
-
101
- static blob(blob:Blob):FileContents;
102
- static text(...text:string[]):FileContents;
103
- static arrayBuffers(...buffers:ArrayBuffer[]):FileContents;
104
- text():Promise<string>;
105
- arrayBuffer():Promise<ArrayBuffer>;
106
- get etag():string;
107
- }
108
-
109
109
 
110
110
  type ItemTypeType = string;
111
111
  export class ItemType {
@@ -118,23 +118,33 @@ export namespace dh.storage {
118
118
  export namespace dh {
119
119
 
120
120
  /**
121
- * Wrap LocalDate values for use in JS. Provides text formatting for display and access to the underlying value.
121
+ * Options for requesting a viewport subscription to a table.
122
122
  */
123
- export interface LocalDateWrapper {
124
- valueOf():string;
125
- getYear():number;
126
- getMonthValue():number;
127
- getDayOfMonth():number;
128
- toString():string;
123
+ export interface ViewportSubscriptionOptions extends SubscriptionOptions {
124
+ /**
125
+ * If true, the viewport will be filled starting from the end of the table, where 0 is the last row of the
126
+ * table. Default is false.
127
+ */
128
+ isReverseViewport?:boolean|null;
129
+ /**
130
+ * The rows to include in the viewport. This can be either a {@link dh.RangeSet} or a single range with
131
+ * `first` and `last` properties.
132
+ */
133
+ rows:RangeSet|SimpleRange;
129
134
  }
130
135
  /**
131
- * This object may be pooled internally or discarded and not updated. Do not retain references to it. Instead,
132
- * request the viewport again.
136
+ * Similar to the browser `CustomEvent` type, this class holds only the type of the event, and optionally some
137
+ * details about the event.
138
+ * @typeParam T - the type of the event detail
133
139
  */
134
- export interface ViewportRow extends Row {
135
- get(column:Column):any;
136
- getFormat(column:Column):Format;
137
- get index():LongWrapper;
140
+ export interface Event<T> {
141
+ get detail():T;
142
+ get type():string;
143
+ }
144
+ export interface ColumnGroup {
145
+ get name():string|null;
146
+ get children():string[]|null;
147
+ get color():string|null;
138
148
  }
139
149
  /**
140
150
  * Represents a row available in a subscription/snapshot on the client. Do not retain references to rows - they will
@@ -185,12 +195,13 @@ export namespace dh {
185
195
  removeEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):boolean;
186
196
  }
187
197
  /**
188
- * Simple range consisting only of start and end numbers. Will be migrated to deephaven-core in the near future, and
189
- * subsequently removed from this the coreplus namespace.
198
+ * This object may be pooled internally or discarded and not updated. Do not retain references to it. Instead,
199
+ * request the viewport again.
190
200
  */
191
- export interface SimpleRange {
192
- first:number;
193
- last:number;
201
+ export interface ViewportRow extends Row {
202
+ get(column:Column):any;
203
+ getFormat(column:Column):Format;
204
+ get index():LongWrapper;
194
205
  }
195
206
  /**
196
207
  * Common interface for various ways of accessing table data and formatting for viewport or non-viewport subscriptions
@@ -227,6 +238,48 @@ export namespace dh {
227
238
  */
228
239
  get rows():Array<Row>;
229
240
  }
241
+ export interface LayoutHints {
242
+ readonly searchDisplayMode?:SearchDisplayModeType|null;
243
+
244
+ get hiddenColumns():string[]|null;
245
+ get frozenColumns():string[]|null;
246
+ get columnGroups():ColumnGroup[]|null;
247
+ get areSavedLayoutsAllowed():boolean;
248
+ get frontColumns():string[]|null;
249
+ get backColumns():string[]|null;
250
+ }
251
+ /**
252
+ * Represents a server-side object that may not yet have been fetched by the client. When this object will no longer be
253
+ * used, if {@link fetch} is not called on this object, then {@link close} must be to ensure server-side resources
254
+ * are correctly freed.
255
+ */
256
+ export interface WidgetExportedObject {
257
+ /**
258
+ * Returns the type of this export, typically one of {@link dh.VariableType}, but may also include plugin types. If
259
+ * null, this object cannot be fetched, but can be passed to the server, such as via
260
+ * {@link Widget.sendMessage}.
261
+ * @return the string type of this server-side object, or null.
262
+ */
263
+ readonly type?:string|null;
264
+
265
+ /**
266
+ * Exports another copy of this reference, allowing it to be fetched separately. Results in rejection if the ticket
267
+ * was already closed (either by calling {@link WidgetExportedObject.close} or closing the object returned from {@link WidgetExportedObject.fetch}).
268
+ * @return a promise returning a reexported copy of this object, still referencing the same server-side object.
269
+ */
270
+ reexport():Promise<WidgetExportedObject>;
271
+ /**
272
+ * Returns a promise that will fetch the object represented by this reference. Multiple calls to this will return
273
+ * the same instance.
274
+ * @return a promise that will resolve to a client side object that represents the reference on the server.
275
+ */
276
+ fetch():Promise<any>;
277
+ /**
278
+ * Releases the server-side resources associated with this object, regardless of whether other client-side objects
279
+ * exist that also use that object. Should not be called after fetch() has been invoked.
280
+ */
281
+ close():void;
282
+ }
230
283
  /**
231
284
  * Options for requesting a full-table subscription to a table.
232
285
  */
@@ -240,9 +293,20 @@ export namespace dh {
240
293
  */
241
294
  updateIntervalMs?:number|null;
242
295
  }
243
- export interface RefreshToken {
244
- get bytes():string;
245
- get expiry():number;
296
+ /**
297
+ * Options for requesting a snapshot of a table.
298
+ */
299
+ export interface SnapshotOptions extends DataOptions {
300
+ /**
301
+ * If true, the snapshot will be filled starting from the end of the table, where 0 is the last row of the
302
+ * table. Default is false.
303
+ */
304
+ isReverseViewport?:boolean|null;
305
+ /**
306
+ * The rows to include in the snapshot. This can be either a {@link dh.RangeSet} or a single range with
307
+ * `first` and `last` properties.
308
+ */
309
+ rows:RangeSet|SimpleRange;
246
310
  }
247
311
  /**
248
312
  * Behaves like a Table, but doesn't expose all of its API for changing the internal state. Instead, state is driven by
@@ -399,6 +463,47 @@ export namespace dh {
399
463
  get isRefreshing():boolean;
400
464
  }
401
465
  /**
466
+ * Event data, describing the indexes that were added/removed/updated, and providing access to Rows (and thus data in
467
+ * columns) either by index, or scanning the complete present index.
468
+ * <p>
469
+ * This class supports two ways of reading the table - checking the changes made since the last update, and reading all
470
+ * data currently in the table. While it is more expensive to always iterate over every single row in the table, it may
471
+ * in some cases actually be cheaper than maintaining state separately and updating only the changes, though both
472
+ * options should be considered.
473
+ * <p>
474
+ * The RangeSet objects allow iterating over the LongWrapper indexes in the table. Note that these "indexes" are not
475
+ * necessarily contiguous and may be negative, and represent some internal state on the server, allowing it to keep
476
+ * track of data efficiently. Those LongWrapper objects can be passed to the various methods on this instance to read
477
+ * specific rows or cells out of the table.
478
+ */
479
+ export interface SubscriptionTableData extends TableData {
480
+ get fullIndex():RangeSet;
481
+ /**
482
+ * The ordered set of row indexes removed since the last update
483
+ * @return the rangeset of removed rows
484
+ */
485
+ get removed():RangeSet;
486
+ /**
487
+ * The ordered set of row indexes added since the last update.
488
+ * @return the rangeset of rows added
489
+ */
490
+ get added():RangeSet;
491
+ get columns():Array<Column>;
492
+ /**
493
+ * The ordered set of row indexes updated since the last update
494
+ * @return the rnageset of modified rows
495
+ */
496
+ get modified():RangeSet;
497
+ /**
498
+ * A lazily computed array of all rows available on the client.
499
+ */
500
+ get rows():Array<Row>;
501
+ }
502
+ export interface RefreshToken {
503
+ get bytes():string;
504
+ get expiry():number;
505
+ }
506
+ /**
402
507
  * Row implementation that also provides additional read-only properties. represents visible rows in the table, but
403
508
  * with additional properties to reflect the tree structure.
404
509
  */
@@ -426,39 +531,116 @@ export namespace dh {
426
531
  get index():LongWrapper;
427
532
  }
428
533
  /**
429
- * Represents statistics for a given table column.
534
+ * Represents a table which can be joined to another table. Current implementations are {@link dh.Table} and
535
+ * {@link dh.TotalsTable}.
430
536
  */
431
- export interface ColumnStatistics {
537
+ export interface JoinableTable {
538
+ freeze():Promise<Table>;
539
+ snapshot(baseTable:Table, doInitialSnapshot?:boolean, stampColumns?:string[]):Promise<Table>;
432
540
  /**
433
- * Gets the type of formatting that should be used for given statistic.
541
+ * Joins this table to the provided table, using one of the specified join types:
542
+ * <ul>
543
+ * <li><code>AJ</code>, <code>ReverseAJ</code> (or <code>RAJ</code>) - inexact timeseries joins, based on the
544
+ * provided matching rule.</li>
545
+ * <li><code>CROSS_JOIN</code> (or <code>Join</code>) - cross join of all rows that have matching values in both
546
+ * tables.</li>
547
+ * <li><code>EXACT_JOIN</code> (or <code>ExactJoin</code> - matches values in exactly one row in the right table,
548
+ * with errors if there is not exactly one.</li>
549
+ * <li><code>NATURAL_JOIN</code> (or <code>Natural</code> - matches values in at most one row in the right table,
550
+ * with nulls if there is no match or errors if there are multiple matches.</li>
551
+ * </ul>
552
+ *
553
+ * Note that <code>Left</code> join is not supported here, unlike DHE.
434
554
  * <p>
435
- * the format type for a statistic. A null return value means that the column formatting should be used.
436
- * @param name - the display name of the statistic
437
- * @return String
555
+ * See the <a href="https://deephaven.io/core/docs/conceptual/choose-joins/">Choose a join method</a> document for
556
+ * more guidance on picking a join operation.
557
+ * @deprecated Instead, call the specific method for the join type.
558
+ * @param joinType - The type of join to perform, see the list above.
559
+ * @param rightTable - The table to match to values in this table
560
+ * @param columnsToMatch - Columns that should match
561
+ * @param columnsToAdd - Columns from the right table to add to the result - empty/null/absent to add all columns
562
+ * @param asOfMatchRule - If joinType is AJ/RAJ/ReverseAJ, the match rule to use
563
+ * @return a promise that will resolve to the joined table
438
564
  */
439
- getType(name:string):string;
565
+ join(joinType:string, rightTable:JoinableTable, columnsToMatch:Array<string>, columnsToAdd?:Array<string>|undefined|null, asOfMatchRule?:string|undefined|null):Promise<Table>;
440
566
  /**
441
- * 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
442
- * name to the count of how many times it occurred in the column. This map will be empty for tables containing more
443
- * than 19 unique values.
444
- * @return Map of String double
567
+ * Performs an inexact timeseries join, where rows in this table will have columns added from the closest matching
568
+ * row from the right table.
569
+ * <p>
570
+ * The `asOfMatchRule` value can be one of:
571
+ * <ul>
572
+ * <li>LESS_THAN_EQUAL</li>
573
+ * <li>LESS_THAN</li>
574
+ * <li>GREATER_THAN_EQUAL</li>
575
+ * <li>GREATER_THAN</li>
576
+ * </ul>
577
+ * @param rightTable - the table to match to values in this table
578
+ * @param columnsToMatch - the columns that should match, according to the asOfMatchRole
579
+ * @param columnsToAdd - columns from the right table to add to the resulting table, empty/null/absent to add all
580
+ * columns
581
+ * @param asOfMatchRule - the match rule to use, see above
582
+ * @return a promise that will resolve to the joined table
445
583
  */
446
- get uniqueValues():Map<string, number>;
584
+ asOfJoin(rightTable:JoinableTable, columnsToMatch:Array<string>, columnsToAdd?:Array<string>|undefined|null, asOfMatchRule?:string|undefined|null):Promise<Table>;
447
585
  /**
448
- * Gets a map with the display name of statistics as keys and the numeric stat as a value.
449
- * <p>
450
- * A map of each statistic's name to its value.
451
- * @return Map of String and Object
586
+ * a promise that will be resolved with the newly created table holding the results of the specified cross join
587
+ * operation. The <b>columnsToAdd</b> parameter is optional, not specifying it will result in all columns from the
588
+ * right table being added to the output. The <b>reserveBits</b> optional parameter lets the client control how the
589
+ * key space is distributed between the rows in the two tables, see the Java <b>Table</b> class for details.
590
+ * @param rightTable - the table to match to values in this table
591
+ * @param columnsToMatch - the columns that should match exactly
592
+ * @param columnsToAdd - columns from the right table to add to the resulting table, empty/null/absent to add all
593
+ * columns
594
+ * @param reserveBits - the number of bits of key-space to initially reserve per group, null/absent will let the
595
+ * server select a value
596
+ * @return a promise that will resolve to the joined table
452
597
  */
453
- get statisticsMap():Map<string, object>;
598
+ crossJoin(rightTable:JoinableTable, columnsToMatch:Array<string>, columnsToAdd?:Array<string>|undefined|null, reserveBits?:number|undefined|null):Promise<Table>;
599
+ /**
600
+ * a promise that will be resolved with the newly created table holding the results of the specified exact join
601
+ * operation. The `columnsToAdd` parameter is optional, not specifying it will result in all columns from the right
602
+ * table being added to the output.
603
+ * @param rightTable - the table to match to values in this table
604
+ * @param columnsToMatch - the columns that should match exactly
605
+ * @param columnsToAdd - columns from the right table to add to the resulting table, empty/null/absent to add all
606
+ * columns
607
+ * @return a promise that will resolve to the joined table
608
+ */
609
+ exactJoin(rightTable:JoinableTable, columnsToMatch:Array<string>, columnsToAdd?:Array<string>|undefined|null):Promise<Table>;
610
+ /**
611
+ * a promise that will be resolved with the newly created table holding the results of the specified natural join
612
+ * operation. The <b>columnsToAdd</b> parameter is optional, not specifying it will result in all columns from the
613
+ * right table being added to the output.
614
+ * @param rightTable - the table to match to values in this table
615
+ * @param columnsToMatch - the columns that should match exactly
616
+ * @param columnsToAdd - columns from the right table to add to the resulting table, empty/null/absent to add all
617
+ * columns
618
+ * @return a promise that will resolve to the joined table
619
+ */
620
+ naturalJoin(rightTable:JoinableTable, columnsToMatch:Array<string>, columnsToAdd?:Array<string>|undefined|null):Promise<Table>;
454
621
  }
455
- export interface WorkerHeapInfo {
622
+ /**
623
+ * Extends {@link dh.TableData}, but only contains data in the current viewport. The only API change from TableData is that
624
+ * ViewportData also contains the offset to this data, so that the actual row number may be determined.
625
+ * <p>
626
+ * For viewport subscriptions, it is not necessary to read with the key, only with the position.
627
+ * <p>
628
+ * Do not assume that the first row in `rows` is the first visible row, because extra rows may be provided for easier
629
+ * scrolling without going to the server.
630
+ */
631
+ export interface ViewportData extends TableData {
456
632
  /**
457
- * Total heap size available for this worker.
633
+ * Reads a row object from the viewport, based on its position in the table.
458
634
  */
459
- get totalHeapSize():number;
460
- get freeMemory():number;
461
- get maximumHeapSize():number;
635
+ get(index:LongWrapper|number):ViewportRow;
636
+ getData(index:LongWrapper|number, column:Column):any;
637
+ getFormat(index:LongWrapper|number, column:Column):Format;
638
+ /**
639
+ * The position of the first returned row within the table.
640
+ */
641
+ get offset():number;
642
+ get columns():Array<Column>;
643
+ get rows():Array<ViewportRow>;
462
644
  }
463
645
  /**
464
646
  * Options for requesting table data, either as a snapshot or a subscription. See subtypes for more specific options:
@@ -479,117 +661,120 @@ export namespace dh {
479
661
  columns:Array<Column>;
480
662
  }
481
663
  /**
482
- * This object may be pooled internally or discarded and not updated. Do not retain references to it.
664
+ * Wrap LocalDate values for use in JS. Provides text formatting for display and access to the underlying value.
483
665
  */
484
- export interface Format {
485
- /**
486
- * The format string to apply to the value of this cell.
487
- * @return String
488
- */
489
- readonly formatString?:string|null;
490
- /**
491
- * Color to apply to the cell's background, in <b>#rrggbb</b> format.
492
- * @return String
493
- */
494
- readonly backgroundColor?:string|null;
495
- /**
496
- * Color to apply to the text, in <b>#rrggbb</b> format.
497
- * @return String
498
- */
499
- readonly color?:string|null;
500
- /**
501
- *
502
- * @deprecated Prefer formatString. Number format string to apply to the value in this cell.
503
- */
504
- readonly numberFormat?:string|null;
666
+ export interface LocalDateWrapper {
667
+ valueOf():string;
668
+ getYear():number;
669
+ getMonthValue():number;
670
+ getDayOfMonth():number;
671
+ toString():string;
505
672
  }
506
673
  /**
507
- * Event data, describing the indexes that were added/removed/updated, and providing access to Rows (and thus data in
508
- * columns) either by index, or scanning the complete present index.
509
- * <p>
510
- * This class supports two ways of reading the table - checking the changes made since the last update, and reading all
511
- * data currently in the table. While it is more expensive to always iterate over every single row in the table, it may
512
- * in some cases actually be cheaper than maintaining state separately and updating only the changes, though both
513
- * options should be considered.
514
- * <p>
515
- * The RangeSet objects allow iterating over the LongWrapper indexes in the table. Note that these "indexes" are not
516
- * necessarily contiguous and may be negative, and represent some internal state on the server, allowing it to keep
517
- * track of data efficiently. Those LongWrapper objects can be passed to the various methods on this instance to read
518
- * specific rows or cells out of the table.
674
+ * Represents the contents of a single widget data message from the server, with a binary data paylod and exported
675
+ * objects. Implemented both by Widget itself and by the `event.details` when data is received by the client.
676
+ *
677
+ * Terminology note: the name of this type should probably use "Data" instead of "Message", and the methods should use
678
+ * "payload" rather than "data" to match other platforms and the protobuf itself. These names are instead used for
679
+ * backwards compatibility and to better follow JS expectations.
519
680
  */
520
- export interface SubscriptionTableData extends TableData {
521
- get fullIndex():RangeSet;
681
+ export interface WidgetMessageDetails {
522
682
  /**
523
- * The ordered set of row indexes removed since the last update
524
- * @return the rangeset of removed rows
683
+ * Returns the data from this message as a base64-encoded string.
525
684
  */
526
- get removed():RangeSet;
685
+ getDataAsBase64():string;
527
686
  /**
528
- * The ordered set of row indexes added since the last update.
529
- * @return the rangeset of rows added
687
+ * Returns the data from this message as a Uint8Array.
530
688
  */
531
- get added():RangeSet;
532
- get columns():Array<Column>;
689
+ getDataAsU8():Uint8Array;
533
690
  /**
534
- * The ordered set of row indexes updated since the last update
535
- * @return the rnageset of modified rows
691
+ * Returns the data from this message as a utf-8 string.
536
692
  */
537
- get modified():RangeSet;
693
+ getDataAsString():string;
538
694
  /**
539
- * A lazily computed array of all rows available on the client.
695
+ * Returns an array of exported objects sent from the server. The plugin implementation is now responsible for these
696
+ * objects, and should close them when no longer needed.
540
697
  */
541
- get rows():Array<Row>;
698
+ get exportedObjects():WidgetExportedObject[];
542
699
  }
543
- /**
544
- * Similar to the browser `CustomEvent` type, this class holds only the type of the event, and optionally some
545
- * details about the event.
546
- * @typeParam T - the type of the event detail
547
- */
548
- export interface Event<T> {
549
- get detail():T;
550
- get type():string;
700
+ export interface WorkerHeapInfo {
701
+ /**
702
+ * Total heap size available for this worker.
703
+ */
704
+ get totalHeapSize():number;
705
+ get freeMemory():number;
706
+ get maximumHeapSize():number;
551
707
  }
552
708
  /**
553
- * Options for requesting a snapshot of a table.
709
+ * Represents statistics for a given table column.
554
710
  */
555
- export interface SnapshotOptions extends DataOptions {
711
+ export interface ColumnStatistics {
556
712
  /**
557
- * If true, the snapshot will be filled starting from the end of the table, where 0 is the last row of the
558
- * table. Default is false.
713
+ * Gets the type of formatting that should be used for given statistic.
714
+ * <p>
715
+ * the format type for a statistic. A null return value means that the column formatting should be used.
716
+ * @param name - the display name of the statistic
717
+ * @return String
559
718
  */
560
- isReverseViewport?:boolean|null;
719
+ getType(name:string):string;
561
720
  /**
562
- * The rows to include in the snapshot. This can be either a {@link dh.RangeSet} or a single range with
563
- * `first` and `last` properties.
721
+ * 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
722
+ * name to the count of how many times it occurred in the column. This map will be empty for tables containing more
723
+ * than 19 unique values.
724
+ * @return Map of String double
564
725
  */
565
- rows:RangeSet|SimpleRange;
726
+ get uniqueValues():Map<string, number>;
727
+ /**
728
+ * Gets a map with the display name of statistics as keys and the numeric stat as a value.
729
+ * <p>
730
+ * A map of each statistic's name to its value.
731
+ * @return Map of String and Object
732
+ */
733
+ get statisticsMap():Map<string, object>;
566
734
  }
567
735
  /**
568
- * Represents the contents of a single widget data message from the server, with a binary data paylod and exported
569
- * objects. Implemented both by Widget itself and by the `event.details` when data is received by the client.
570
- *
571
- * Terminology note: the name of this type should probably use "Data" instead of "Message", and the methods should use
572
- * "payload" rather than "data" to match other platforms and the protobuf itself. These names are instead used for
573
- * backwards compatibility and to better follow JS expectations.
736
+ * This object may be pooled internally or discarded and not updated. Do not retain references to it.
574
737
  */
575
- export interface WidgetMessageDetails {
738
+ export interface Format {
576
739
  /**
577
- * Returns the data from this message as a base64-encoded string.
740
+ * The format string to apply to the value of this cell.
741
+ * @return String
578
742
  */
579
- getDataAsBase64():string;
743
+ readonly formatString?:string|null;
580
744
  /**
581
- * Returns the data from this message as a Uint8Array.
745
+ * Color to apply to the cell's background, in <b>#rrggbb</b> format.
746
+ * @return String
582
747
  */
583
- getDataAsU8():Uint8Array;
748
+ readonly backgroundColor?:string|null;
584
749
  /**
585
- * Returns the data from this message as a utf-8 string.
750
+ * Color to apply to the text, in <b>#rrggbb</b> format.
751
+ * @return String
586
752
  */
587
- getDataAsString():string;
753
+ readonly color?:string|null;
588
754
  /**
589
- * Returns an array of exported objects sent from the server. The plugin implementation is now responsible for these
590
- * objects, and should close them when no longer needed.
755
+ *
756
+ * @deprecated Prefer formatString. Number format string to apply to the value in this cell.
591
757
  */
592
- get exportedObjects():WidgetExportedObject[];
758
+ readonly numberFormat?:string|null;
759
+ }
760
+ /**
761
+ * Simple range consisting only of start and end numbers. Will be migrated to deephaven-core in the near future, and
762
+ * subsequently removed from this the coreplus namespace.
763
+ */
764
+ export interface SimpleRange {
765
+ first:number;
766
+ last:number;
767
+ }
768
+ /**
769
+ * Wrap LocalTime values for use in JS. Provides text formatting for display and access to the underlying value.
770
+ */
771
+ export interface LocalTimeWrapper {
772
+ valueOf():string;
773
+ getHour():number;
774
+ getMinute():number;
775
+ getSecond():number;
776
+ getNano():number;
777
+ toString():string;
593
778
  }
594
779
  /**
595
780
  * Similar to {@link dh.ViewportData}, but with additional properties to reflect
@@ -607,237 +792,316 @@ export namespace dh {
607
792
  get columns():Array<Column>;
608
793
  get rows():Array<TreeRow>;
609
794
  }
610
- /**
611
- * Wrap LocalTime values for use in JS. Provides text formatting for display and access to the underlying value.
612
- */
613
- export interface LocalTimeWrapper {
795
+
796
+ export class LongWrapper {
797
+ protected constructor();
798
+
799
+ static ofString(str:string):LongWrapper;
800
+ asNumber():number;
614
801
  valueOf():string;
615
- getHour():number;
616
- getMinute():number;
617
- getSecond():number;
618
- getNano():number;
619
802
  toString():string;
620
803
  }
621
- export interface ColumnGroup {
622
- get name():string|null;
623
- get children():string[]|null;
624
- get color():string|null;
625
- }
626
- /**
627
- * Extends {@link dh.TableData}, but only contains data in the current viewport. The only API change from TableData is that
628
- * ViewportData also contains the offset to this data, so that the actual row number may be determined.
629
- * <p>
630
- * For viewport subscriptions, it is not necessary to read with the key, only with the position.
631
- * <p>
632
- * Do not assume that the first row in `rows` is the first visible row, because extra rows may be provided for easier
633
- * scrolling without going to the server.
634
- */
635
- export interface ViewportData extends TableData {
636
- /**
637
- * Reads a row object from the viewport, based on its position in the table.
638
- */
639
- get(index:LongWrapper|number):ViewportRow;
640
- getData(index:LongWrapper|number, column:Column):any;
641
- getFormat(index:LongWrapper|number, column:Column):Format;
642
- /**
643
- * The position of the first returned row within the table.
644
- */
645
- get offset():number;
646
- get columns():Array<Column>;
647
- get rows():Array<ViewportRow>;
648
- }
804
+
649
805
  /**
650
- * Options for requesting a viewport subscription to a table.
806
+ * This object serves as a "handle" to a subscription, allowing it to be acted on directly or canceled outright. If you
807
+ * retain an instance of this, you have two choices - either only use it to call `close()` on it to stop the table's
808
+ * viewport without creating a new one, or listen directly to this object instead of the table for data events, and
809
+ * always call `close()` when finished. Calling any method on this object other than close() will result in it
810
+ * continuing to live on after `setViewport` is called on the original table, or after the table is modified.
651
811
  */
652
- export interface ViewportSubscriptionOptions extends SubscriptionOptions {
812
+ export class TableViewportSubscription implements HasEventHandling {
813
+ protected constructor();
814
+
653
815
  /**
654
- * If true, the viewport will be filled starting from the end of the table, where 0 is the last row of the
655
- * table. Default is false.
816
+ * Changes the rows and columns set on this viewport. This cannot be used to change the update interval.
817
+ * @param firstRow -
818
+ * @param lastRow -
819
+ * @param columns -
820
+ * @param updateIntervalMs -
821
+ * @deprecated use {@link #update(Object)} instead
656
822
  */
657
- isReverseViewport?:boolean|null;
823
+ setViewport(firstRow:number, lastRow:number, columns?:Column[]|undefined|null, updateIntervalMs?:number|undefined|null, isReverseViewport?:boolean|undefined|null):void;
658
824
  /**
659
- * The rows to include in the viewport. This can be either a {@link dh.RangeSet} or a single range with
660
- * `first` and `last` properties.
825
+ * Update the options for this viewport subscription. This cannot alter the update interval or preview options.
826
+ * @param options - the subscription options
661
827
  */
662
- rows:RangeSet|SimpleRange;
663
- }
664
- /**
665
- * Represents a table which can be joined to another table. Current implementations are {@link dh.Table} and
666
- * {@link dh.TotalsTable}.
667
- */
668
- export interface JoinableTable {
669
- freeze():Promise<Table>;
670
- snapshot(baseTable:Table, doInitialSnapshot?:boolean, stampColumns?:string[]):Promise<Table>;
828
+ update(options:ViewportSubscriptionOptions):void;
671
829
  /**
672
- * Joins this table to the provided table, using one of the specified join types:
673
- * <ul>
674
- * <li><code>AJ</code>, <code>ReverseAJ</code> (or <code>RAJ</code>) - inexact timeseries joins, based on the
675
- * provided matching rule.</li>
676
- * <li><code>CROSS_JOIN</code> (or <code>Join</code>) - cross join of all rows that have matching values in both
677
- * tables.</li>
678
- * <li><code>EXACT_JOIN</code> (or <code>ExactJoin</code> - matches values in exactly one row in the right table,
679
- * with errors if there is not exactly one.</li>
680
- * <li><code>NATURAL_JOIN</code> (or <code>Natural</code> - matches values in at most one row in the right table,
681
- * with nulls if there is no match or errors if there are multiple matches.</li>
682
- * </ul>
683
- *
684
- * Note that <code>Left</code> join is not supported here, unlike DHE.
685
- * <p>
686
- * See the <a href="https://deephaven.io/core/docs/conceptual/choose-joins/">Choose a join method</a> document for
687
- * more guidance on picking a join operation.
688
- * @deprecated Instead, call the specific method for the join type.
689
- * @param joinType - The type of join to perform, see the list above.
690
- * @param rightTable - The table to match to values in this table
691
- * @param columnsToMatch - Columns that should match
692
- * @param columnsToAdd - Columns from the right table to add to the result - empty/null/absent to add all columns
693
- * @param asOfMatchRule - If joinType is AJ/RAJ/ReverseAJ, the match rule to use
694
- * @return a promise that will resolve to the joined table
830
+ * Stops this viewport from running, stopping all events on itself and on the table that created it.
695
831
  */
696
- join(joinType:string, rightTable:JoinableTable, columnsToMatch:Array<string>, columnsToAdd?:Array<string>|undefined|null, asOfMatchRule?:string|undefined|null):Promise<Table>;
832
+ close():void;
697
833
  /**
698
- * Performs an inexact timeseries join, where rows in this table will have columns added from the closest matching
699
- * row from the right table.
700
- * <p>
701
- * The `asOfMatchRule` value can be one of:
702
- * <ul>
703
- * <li>LESS_THAN_EQUAL</li>
704
- * <li>LESS_THAN</li>
705
- * <li>GREATER_THAN_EQUAL</li>
706
- * <li>GREATER_THAN</li>
707
- * </ul>
708
- * @param rightTable - the table to match to values in this table
709
- * @param columnsToMatch - the columns that should match, according to the asOfMatchRole
710
- * @param columnsToAdd - columns from the right table to add to the resulting table, empty/null/absent to add all
711
- * columns
712
- * @param asOfMatchRule - the match rule to use, see above
713
- * @return a promise that will resolve to the joined table
834
+ * Gets the data currently visible in this viewport
835
+ * @return Promise of {@link dh.TableData}.
714
836
  */
715
- asOfJoin(rightTable:JoinableTable, columnsToMatch:Array<string>, columnsToAdd?:Array<string>|undefined|null, asOfMatchRule?:string|undefined|null):Promise<Table>;
837
+ getViewportData():Promise<ViewportData>;
716
838
  /**
717
- * a promise that will be resolved with the newly created table holding the results of the specified cross join
718
- * operation. The <b>columnsToAdd</b> parameter is optional, not specifying it will result in all columns from the
719
- * right table being added to the output. The <b>reserveBits</b> optional parameter lets the client control how the
720
- * key space is distributed between the rows in the two tables, see the Java <b>Table</b> class for details.
721
- * @param rightTable - the table to match to values in this table
722
- * @param columnsToMatch - the columns that should match exactly
723
- * @param columnsToAdd - columns from the right table to add to the resulting table, empty/null/absent to add all
724
- * columns
725
- * @param reserveBits - the number of bits of key-space to initially reserve per group, null/absent will let the
726
- * server select a value
727
- * @return a promise that will resolve to the joined table
839
+ *
840
+ * @deprecated Use {@link JsTable#createSnapshot(Object)} instead
728
841
  */
729
- crossJoin(rightTable:JoinableTable, columnsToMatch:Array<string>, columnsToAdd?:Array<string>|undefined|null, reserveBits?:number|undefined|null):Promise<Table>;
842
+ snapshot(rows:RangeSet, columns:Column[]):Promise<TableData>;
730
843
  /**
731
- * a promise that will be resolved with the newly created table holding the results of the specified exact join
732
- * operation. The `columnsToAdd` parameter is optional, not specifying it will result in all columns from the right
733
- * table being added to the output.
734
- * @param rightTable - the table to match to values in this table
735
- * @param columnsToMatch - the columns that should match exactly
736
- * @param columnsToAdd - columns from the right table to add to the resulting table, empty/null/absent to add all
737
- * columns
738
- * @return a promise that will resolve to the joined table
844
+ * Listen for events on this object.
845
+ * @param name - the name of the event to listen for
846
+ * @param callback - a function to call when the event occurs
847
+ * @return Returns a cleanup function.
848
+ * @typeParam T - the type of the data that the event will provide
739
849
  */
740
- exactJoin(rightTable:JoinableTable, columnsToMatch:Array<string>, columnsToAdd?:Array<string>|undefined|null):Promise<Table>;
850
+ addEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):()=>void;
851
+ nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<Event<T>>;
852
+ hasListeners(name:string):boolean;
741
853
  /**
742
- * a promise that will be resolved with the newly created table holding the results of the specified natural join
743
- * operation. The <b>columnsToAdd</b> parameter is optional, not specifying it will result in all columns from the
744
- * right table being added to the output.
745
- * @param rightTable - the table to match to values in this table
746
- * @param columnsToMatch - the columns that should match exactly
747
- * @param columnsToAdd - columns from the right table to add to the resulting table, empty/null/absent to add all
748
- * columns
749
- * @return a promise that will resolve to the joined table
854
+ * Removes an event listener added to this table.
855
+ * @param name -
856
+ * @param callback -
857
+ * @return
858
+ * @typeParam T -
750
859
  */
751
- naturalJoin(rightTable:JoinableTable, columnsToMatch:Array<string>, columnsToAdd?:Array<string>|undefined|null):Promise<Table>;
860
+ removeEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):boolean;
752
861
  }
862
+
753
863
  /**
754
- * Represents a server-side object that may not yet have been fetched by the client. When this object will no longer be
755
- * used, if {@link fetch} is not called on this object, then {@link close} must be to ensure server-side resources
756
- * are correctly freed.
864
+ * Describes a grouping and aggregations for a roll-up table. Pass to the <b>Table.rollup</b> function to create a
865
+ * roll-up table.
757
866
  */
758
- export interface WidgetExportedObject {
867
+ export class RollupConfig {
759
868
  /**
760
- * Returns the type of this export, typically one of {@link dh.VariableType}, but may also include plugin types. If
761
- * null, this object cannot be fetched, but can be passed to the server, such as via
762
- * {@link Widget.sendMessage}.
763
- * @return the string type of this server-side object, or null.
869
+ * Ordered list of columns to group by to form the hierarchy of the resulting roll-up table.
764
870
  */
765
- readonly type?:string|null;
766
-
871
+ groupingColumns:Array<String>;
767
872
  /**
768
- * Exports another copy of this reference, allowing it to be fetched separately. Results in rejection if the ticket
769
- * was already closed (either by calling {@link WidgetExportedObject.close} or closing the object returned from {@link WidgetExportedObject.fetch}).
770
- * @return a promise returning a reexported copy of this object, still referencing the same server-side object.
873
+ * Mapping from each aggregation name to the ordered list of columns it should be applied to in the resulting
874
+ * roll-up table.
771
875
  */
772
- reexport():Promise<WidgetExportedObject>;
876
+ aggregations:{ [key: string]: Array<string>; };
773
877
  /**
774
- * Returns a promise that will fetch the object represented by this reference. Multiple calls to this will return
775
- * the same instance.
776
- * @return a promise that will resolve to a client side object that represents the reference on the server.
878
+ * Optional parameter indicating if an extra leaf node should be added at the bottom of the hierarchy, showing the
879
+ * rows in the underlying table which make up that grouping. Since these values might be a different type from the
880
+ * rest of the column, any client code must check if TreeRow.hasChildren = false, and if so, interpret those values
881
+ * as if they were Column.constituentType instead of Column.type. Defaults to false.
777
882
  */
778
- fetch():Promise<any>;
883
+ includeConstituents:boolean;
884
+ includeOriginalColumns?:boolean|null;
779
885
  /**
780
- * Releases the server-side resources associated with this object, regardless of whether other client-side objects
781
- * exist that also use that object. Should not be called after fetch() has been invoked.
886
+ * Optional parameter indicating if original column descriptions should be included. Defaults to true.
782
887
  */
783
- close():void;
784
- }
785
- export interface LayoutHints {
786
- readonly searchDisplayMode?:SearchDisplayModeType|null;
888
+ includeDescriptions:boolean;
787
889
 
788
- get hiddenColumns():string[]|null;
789
- get frozenColumns():string[]|null;
790
- get columnGroups():ColumnGroup[]|null;
791
- get areSavedLayoutsAllowed():boolean;
792
- get frontColumns():string[]|null;
793
- get backColumns():string[]|null;
890
+ constructor();
794
891
  }
795
892
 
796
893
  /**
797
- * Describes a Sort present on the table. No visible constructor, created through the use of Column.sort(), will be tied
798
- * to that particular column data. Sort instances are immutable, and use a builder pattern to make modifications. All
799
- * methods return a new Sort instance.
894
+ * Describes how a Totals Table will be generated from its parent table. Each table has a default (which may be null)
895
+ * indicating how that table was configured when it was declared, and each Totals Table has a similar property
896
+ * describing how it was created. Both the <b>Table.getTotalsTable</b> and <b>Table.getGrandTotalsTable</b> methods take
897
+ * this config as an optional parameter - without it, the table's default will be used, or if null, a default instance
898
+ * of <b>TotalsTableConfig</b> will be supplied.
899
+ *
900
+ * This class has a no-arg constructor, allowing an instance to be made with the default values provided. However, any
901
+ * JS object can be passed in to the methods which accept instances of this type, provided their values adhere to the
902
+ * expected formats.
800
903
  */
801
- export class Sort {
802
- static readonly ASCENDING:string;
803
- static readonly DESCENDING:string;
804
- static readonly REVERSE:string;
805
-
806
- protected constructor();
807
-
904
+ export class TotalsTableConfig {
808
905
  /**
809
- * Builds a Sort instance to sort values in ascending order.
810
- * @return {@link dh.Sort}
906
+ * @deprecated
811
907
  */
812
- asc():Sort;
908
+ static readonly COUNT:string;
813
909
  /**
814
- * Builds a Sort instance to sort values in descending order.
815
- * @return {@link dh.Sort}
910
+ * @deprecated
816
911
  */
817
- desc():Sort;
912
+ static readonly MIN:string;
818
913
  /**
819
- * Builds a Sort instance which takes the absolute value before applying order.
820
- * @return {@link dh.Sort}
914
+ * @deprecated
821
915
  */
822
- abs():Sort;
823
- toString():string;
916
+ static readonly MAX:string;
824
917
  /**
825
- * True if the absolute value of the column should be used when sorting; defaults to false.
826
- * @return boolean
918
+ * @deprecated
827
919
  */
828
- get isAbs():boolean;
920
+ static readonly SUM:string;
829
921
  /**
830
- * The column which is sorted.
831
- * @return {@link dh.Column}
922
+ * @deprecated
832
923
  */
833
- get column():Column;
924
+ static readonly ABS_SUM:string;
834
925
  /**
835
- * The direction of this sort, either <b>ASC</b>, <b>DESC</b>, or <b>REVERSE</b>.
836
- * @return String
926
+ * @deprecated
927
+ */
928
+ static readonly VAR:string;
929
+ /**
930
+ * @deprecated
931
+ */
932
+ static readonly AVG:string;
933
+ /**
934
+ * @deprecated
935
+ */
936
+ static readonly STD:string;
937
+ /**
938
+ * @deprecated
939
+ */
940
+ static readonly FIRST:string;
941
+ /**
942
+ * @deprecated
943
+ */
944
+ static readonly LAST:string;
945
+ /**
946
+ * @deprecated
947
+ */
948
+ static readonly SKIP:string;
949
+ /**
950
+ * Specifies if a Totals Table should be expanded by default in the UI. Defaults to false.
951
+ */
952
+ showTotalsByDefault:boolean;
953
+ /**
954
+ * Specifies if a Grand Totals Table should be expanded by default in the UI. Defaults to false.
955
+ */
956
+ showGrandTotalsByDefault:boolean;
957
+ /**
958
+ * Specifies the default operation for columns that do not have a specific operation applied; defaults to "Sum".
959
+ */
960
+ defaultOperation:AggregationOperationType;
961
+ /**
962
+ * Mapping from each column name to the aggregation(s) that should be applied to that column in the resulting Totals
963
+ * Table. If a column is omitted, the defaultOperation is used.
964
+ */
965
+ operationMap:{ [key: string]: Array<AggregationOperationType>; };
966
+ /**
967
+ * Groupings to use when generating the Totals Table. One row will exist for each unique set of values observed in
968
+ * these columns. See also `Table.selectDistinct`.
969
+ */
970
+ groupBy:Array<string>;
971
+
972
+ constructor();
973
+
974
+ toString():string;
975
+ }
976
+
977
+ /**
978
+ * Describes a Sort present on the table. No visible constructor, created through the use of Column.sort(), will be tied
979
+ * to that particular column data. Sort instances are immutable, and use a builder pattern to make modifications. All
980
+ * methods return a new Sort instance.
981
+ */
982
+ export class Sort {
983
+ static readonly ASCENDING:string;
984
+ static readonly DESCENDING:string;
985
+ static readonly REVERSE:string;
986
+
987
+ protected constructor();
988
+
989
+ /**
990
+ * Builds a Sort instance to sort values in ascending order.
991
+ * @return {@link dh.Sort}
992
+ */
993
+ asc():Sort;
994
+ /**
995
+ * Builds a Sort instance to sort values in descending order.
996
+ * @return {@link dh.Sort}
997
+ */
998
+ desc():Sort;
999
+ /**
1000
+ * Builds a Sort instance which takes the absolute value before applying order.
1001
+ * @return {@link dh.Sort}
1002
+ */
1003
+ abs():Sort;
1004
+ toString():string;
1005
+ /**
1006
+ * True if the absolute value of the column should be used when sorting; defaults to false.
1007
+ * @return boolean
1008
+ */
1009
+ get isAbs():boolean;
1010
+ /**
1011
+ * The column which is sorted.
1012
+ * @return {@link dh.Column}
1013
+ */
1014
+ get column():Column;
1015
+ /**
1016
+ * The direction of this sort, either <b>ASC</b>, <b>DESC</b>, or <b>REVERSE</b>.
1017
+ * @return String
837
1018
  */
838
1019
  get direction():string;
839
1020
  }
840
1021
 
1022
+ /**
1023
+ * Event fired when a command is issued from the client.
1024
+ */
1025
+ export class CommandInfo {
1026
+ constructor(code:string, result:Promise<dh.ide.CommandResult>);
1027
+
1028
+ get result():Promise<dh.ide.CommandResult>;
1029
+ get code():string;
1030
+ }
1031
+
1032
+ /**
1033
+ * Describes a filter which can be applied to a table. Replacing these instances may be more expensive than reusing
1034
+ * them. These instances are immutable - all operations that compose them to build bigger expressions return a new
1035
+ * instance.
1036
+ */
1037
+ export class FilterCondition {
1038
+ protected constructor();
1039
+
1040
+ /**
1041
+ * the opposite of this condition
1042
+ * @return FilterCondition
1043
+ */
1044
+ not():FilterCondition;
1045
+ /**
1046
+ * a condition representing the current condition logically ANDed with the other parameters
1047
+ * @param filters -
1048
+ * @return FilterCondition
1049
+ */
1050
+ and(...filters:FilterCondition[]):FilterCondition;
1051
+ /**
1052
+ * a condition representing the current condition logically ORed with the other parameters
1053
+ * @param filters -
1054
+ * @return FilterCondition.
1055
+ */
1056
+ or(...filters:FilterCondition[]):FilterCondition;
1057
+ /**
1058
+ * a string suitable for debugging showing the details of this condition.
1059
+ * @return String.
1060
+ */
1061
+ toString():string;
1062
+ get columns():Array<Column>;
1063
+ /**
1064
+ * a filter condition invoking a static function with the given parameters. Currently supported Deephaven static
1065
+ * functions:
1066
+ * <ul>
1067
+ * <li><b>inRange</b>: Given three comparable values, returns true if the first is less than the second but greater
1068
+ * than the third</li>
1069
+ * <li><b>isInf</b>:Returns true if the given number is <i>infinity</i></li>
1070
+ * <li><b>isNaN</b>:Returns true if the given number is <i>not a number</i></li>
1071
+ * <li><b>isNormal</b>:Returns true if the given number <i>is not null</i>, <i>is not infinity</i>, and <i>is not
1072
+ * "not a number"</i></li>
1073
+ * <li><b>startsWith</b>:Returns true if the first string starts with the second string</li>
1074
+ * <li><b>endsWith</b>Returns true if the first string ends with the second string</li>
1075
+ * <li><b>matches</b>:Returns true if the first string argument matches the second string used as a Java regular
1076
+ * expression</li>
1077
+ * <li><b>contains</b>:Returns true if the first string argument contains the second string as a substring</li>
1078
+ * <li><b>in</b>:Returns true if the first string argument can be found in the second array argument.
1079
+ * <p>
1080
+ * Note that the array can only be specified as a column reference at this time - typically the `FilterValue.in`
1081
+ * method should be used in other cases
1082
+ * </p>
1083
+ * </li>
1084
+ * </ul>
1085
+ * @param function -
1086
+ * @param args -
1087
+ * @return dh.FilterCondition
1088
+ */
1089
+ static invoke(func:string, ...args:FilterValue[]):FilterCondition;
1090
+ /**
1091
+ * a filter condition which will check if the given value can be found in any supported column on whatever table
1092
+ * this FilterCondition is passed to. This FilterCondition is somewhat unique in that it need not be given a column
1093
+ * instance, but will adapt to any table. On numeric columns, with a value passed in which can be parsed as a
1094
+ * number, the column will be filtered to numbers which equal, or can be "rounded" effectively to this number. On
1095
+ * String columns, the given value will match any column which contains this string in a case-insensitive search. An
1096
+ * optional second argument can be passed, an array of `FilterValue` from the columns to limit this search to (see
1097
+ * {@link dh.Column.filter}).
1098
+ * @param value -
1099
+ * @param columns -
1100
+ * @return dh.FilterCondition
1101
+ */
1102
+ static search(value:FilterValue, columns?:FilterValue[]):FilterCondition;
1103
+ }
1104
+
841
1105
  /**
842
1106
  * Addition optional configuration that can be passed to the {@link dh.CoreClient} constructor.
843
1107
  */
@@ -870,13 +1134,6 @@ export namespace dh {
870
1134
  constructor();
871
1135
  }
872
1136
 
873
- export class DateWrapper extends LongWrapper {
874
- protected constructor();
875
-
876
- static ofJsDate(date:Date):DateWrapper;
877
- asDate():Date;
878
- }
879
-
880
1137
  /**
881
1138
  * Presently, this is the entrypoint into the Deephaven JS API. By creating an instance of this with the server URL and
882
1139
  * some options, JS applications can run code on the server, and interact with available exportable objects.
@@ -975,321 +1232,422 @@ export namespace dh {
975
1232
  removeEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):boolean;
976
1233
  }
977
1234
 
978
- export class CoreClient implements HasEventHandling {
979
- static readonly EVENT_CONNECT:string;
980
- static readonly EVENT_DISCONNECT:string;
981
- static readonly EVENT_RECONNECT:string;
982
- static readonly EVENT_RECONNECT_AUTH_FAILED:string;
983
- static readonly EVENT_REQUEST_FAILED:string;
984
- static readonly EVENT_REQUEST_STARTED:string;
985
- static readonly EVENT_REQUEST_SUCCEEDED:string;
986
- /**
987
- * @deprecated
988
- */
989
- static readonly EVENT_REFRESH_TOKEN_UPDATED:string;
990
- static readonly LOGIN_TYPE_PASSWORD:string;
991
- static readonly LOGIN_TYPE_ANONYMOUS:string;
992
-
993
- constructor(serverUrl:string, connectOptions?:ConnectOptions);
994
-
995
- running():Promise<CoreClient>;
996
- getServerUrl():string;
997
- getAuthConfigValues():Promise<string[][]>;
998
- login(credentials:LoginCredentials):Promise<void>;
999
- relogin(token:RefreshToken):Promise<void>;
1000
- onConnected(timeoutInMillis?:number):Promise<void>;
1001
- getServerConfigValues():Promise<string[][]>;
1002
- getStorageService():dh.storage.StorageService;
1003
- getAsIdeConnection():Promise<IdeConnection>;
1004
- disconnect():void;
1005
- addEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):()=>void;
1006
- nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<Event<T>>;
1007
- hasListeners(name:string):boolean;
1008
- removeEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):boolean;
1009
- }
1010
-
1011
1235
  /**
1012
- * A js type for operating on input tables.
1013
- *
1014
- * Represents a User Input Table, which can have data added to it from other sources.
1015
- *
1016
- * You may add rows using dictionaries of key-value tuples (representing columns by name), add tables containing all the
1017
- * key/value columns to add, or delete tables containing the keys to delete. Each operation is atomic, and will either
1018
- * succeed completely or fail completely. To guarantee order of operations, apply an operation and wait for the response
1019
- * before sending the next operation.
1020
- *
1021
- * Each table has one or more key columns, where each unique combination of keys will appear at most once in the table.
1022
- *
1023
- * To view the results of the Input Table, you should use standard table operations on the InputTable's source Table
1024
- * object.
1236
+ * Describes data that can be filtered, either a column reference or a literal value. Used this way, the type of a value
1237
+ * can be specified so that values which are ambiguous or not well supported in JS will not be confused with Strings or
1238
+ * imprecise numbers (e.g., nanosecond-precision date values). Additionally, once wrapped in this way, methods can be
1239
+ * called on these value literal instances. These instances are immutable - any method called on them returns a new
1240
+ * instance.
1025
1241
  */
1026
- export class InputTable {
1242
+ export class FilterValue {
1027
1243
  protected constructor();
1028
1244
 
1029
1245
  /**
1030
- * Adds a single row to the table. For each key or value column name in the Input Table, we retrieve that javascript
1031
- * property at that name and validate it can be put into the given column type.
1032
- * @param row -
1033
- * @param userTimeZone -
1034
- * @return Promise of dh.InputTable
1246
+ * Constructs a number for the filter API from the given parameter. Can also be used on the values returned from
1247
+ * {@link TableData.get} for DateTime values. To create
1248
+ * a filter with a date, use <b>dh.DateWrapper.ofJsDate</b> or
1249
+ * {@link i18n.DateTimeFormat.parse}. To create a filter with a
1250
+ * 64-bit long integer, use {@link LongWrapper.ofString}.
1251
+ * @param input - the number to wrap as a FilterValue
1252
+ * @return an immutable FilterValue that can be built into a filter
1035
1253
  */
1036
- addRow(row:{ [key: string]: any; }, userTimeZone?:string):Promise<InputTable>;
1254
+ static ofNumber(input:LongWrapper|number):FilterValue;
1037
1255
  /**
1038
- * Add multiple rows to a table.
1039
- * @param rows -
1040
- * @param userTimeZone -
1041
- * @return Promise of dh.InputTable
1256
+ * a filter condition checking if the current value is equal to the given parameter
1257
+ * @param term -
1258
+ * @return {@link dh.FilterCondition}
1042
1259
  */
1043
- addRows(rows:{ [key: string]: any; }[], userTimeZone?:string):Promise<InputTable>;
1260
+ eq(term:FilterValue):FilterCondition;
1044
1261
  /**
1045
- * Add an entire table to this Input Table. Only column names that match the definition of the input table will be
1046
- * copied, and all key columns must have values filled in. This only copies the current state of the source table;
1047
- * future updates to the source table will not be reflected in the Input Table. The returned promise will be
1048
- * resolved to the same InputTable instance this method was called upon once the server returns.
1049
- * @param tableToAdd -
1050
- * @return Promise of dh.InputTable
1262
+ * a filter condition checking if the current value is equal to the given parameter, ignoring differences of upper
1263
+ * vs lower case
1264
+ * @param term -
1265
+ * @return {@link dh.FilterCondition}
1051
1266
  */
1052
- addTable(tableToAdd:Table):Promise<InputTable>;
1267
+ eqIgnoreCase(term:FilterValue):FilterCondition;
1053
1268
  /**
1054
- * Add multiple tables to this Input Table.
1055
- * @param tablesToAdd -
1056
- * @return Promise of dh.InputTable
1269
+ * a filter condition checking if the current value is not equal to the given parameter
1270
+ * @param term -
1271
+ * @return {@link dh.FilterCondition}
1057
1272
  */
1058
- addTables(tablesToAdd:Table[]):Promise<InputTable>;
1273
+ notEq(term:FilterValue):FilterCondition;
1059
1274
  /**
1060
- * Deletes an entire table from this Input Table. Key columns must match the Input Table.
1061
- * @param tableToDelete -
1062
- * @return Promise of dh.InputTable
1275
+ * a filter condition checking if the current value is not equal to the given parameter, ignoring differences of
1276
+ * upper vs lower case
1277
+ * @param term -
1278
+ * @return {@link dh.FilterCondition}
1063
1279
  */
1064
- deleteTable(tableToDelete:Table):Promise<InputTable>;
1280
+ notEqIgnoreCase(term:FilterValue):FilterCondition;
1065
1281
  /**
1066
- * Delete multiple tables from this Input Table.
1067
- * @param tablesToDelete -
1068
- * @return
1282
+ * a filter condition checking if the current value is greater than the given parameter
1283
+ * @param term -
1284
+ * @return {@link dh.FilterCondition}
1069
1285
  */
1070
- deleteTables(tablesToDelete:Table[]):Promise<InputTable>;
1286
+ greaterThan(term:FilterValue):FilterCondition;
1071
1287
  /**
1072
- * A list of the key columns, by name
1073
- * @return String array.
1288
+ * a filter condition checking if the current value is less than the given parameter
1289
+ * @param term -
1290
+ * @return {@link dh.FilterCondition}
1074
1291
  */
1075
- get keys():string[];
1292
+ lessThan(term:FilterValue):FilterCondition;
1076
1293
  /**
1077
- * A list of the value columns, by name
1078
- * @return String array.
1294
+ * a filter condition checking if the current value is greater than or equal to the given parameter
1295
+ * @param term -
1296
+ * @return {@link dh.FilterCondition}
1079
1297
  */
1080
- get values():string[];
1298
+ greaterThanOrEqualTo(term:FilterValue):FilterCondition;
1081
1299
  /**
1082
- * A list of the key columns.
1083
- * @return Column array.
1300
+ * a filter condition checking if the current value is less than or equal to the given parameter
1301
+ * @param term -
1302
+ * @return {@link dh.FilterCondition}
1084
1303
  */
1085
- get keyColumns():Column[];
1304
+ lessThanOrEqualTo(term:FilterValue):FilterCondition;
1086
1305
  /**
1087
- * A list of the value Column objects
1088
- * @return {@link dh.Column} array.
1306
+ * a filter condition checking if the current value is in the given set of values
1307
+ * @param terms -
1308
+ * @return {@link dh.FilterCondition}
1089
1309
  */
1090
- get valueColumns():Column[];
1310
+ in(terms:FilterValue[]):FilterCondition;
1091
1311
  /**
1092
- * The source table for this Input Table
1093
- * @return dh.table
1312
+ * a filter condition checking if the current value is in the given set of values, ignoring differences of upper vs
1313
+ * lower case
1314
+ * @param terms -
1315
+ * @return {@link dh.FilterCondition}
1094
1316
  */
1095
- get table():Table;
1096
- }
1097
-
1098
- /**
1099
- * Describes a filter which can be applied to a table. Replacing these instances may be more expensive than reusing
1100
- * them. These instances are immutable - all operations that compose them to build bigger expressions return a new
1101
- * instance.
1102
- */
1103
- export class FilterCondition {
1104
- protected constructor();
1105
-
1317
+ inIgnoreCase(terms:FilterValue[]):FilterCondition;
1106
1318
  /**
1107
- * the opposite of this condition
1108
- * @return FilterCondition
1319
+ * a filter condition checking that the current value is not in the given set of values
1320
+ * @param terms -
1321
+ * @return {@link dh.FilterCondition}
1109
1322
  */
1110
- not():FilterCondition;
1323
+ notIn(terms:FilterValue[]):FilterCondition;
1111
1324
  /**
1112
- * a condition representing the current condition logically ANDed with the other parameters
1113
- * @param filters -
1114
- * @return FilterCondition
1325
+ * a filter condition checking that the current value is not in the given set of values, ignoring differences of
1326
+ * upper vs lower case
1327
+ * @param terms -
1328
+ * @return {@link dh.FilterCondition}
1115
1329
  */
1116
- and(...filters:FilterCondition[]):FilterCondition;
1330
+ notInIgnoreCase(terms:FilterValue[]):FilterCondition;
1117
1331
  /**
1118
- * a condition representing the current condition logically ORed with the other parameters
1119
- * @param filters -
1120
- * @return FilterCondition.
1332
+ * a filter condition checking if the given value contains the given string value
1333
+ * @param term -
1334
+ * @return {@link dh.FilterCondition}
1121
1335
  */
1122
- or(...filters:FilterCondition[]):FilterCondition;
1336
+ contains(term:FilterValue):FilterCondition;
1123
1337
  /**
1124
- * a string suitable for debugging showing the details of this condition.
1125
- * @return String.
1338
+ * a filter condition checking if the given value contains the given string value, ignoring differences of upper vs
1339
+ * lower case
1340
+ * @param term -
1341
+ * @return {@link dh.FilterCondition}
1126
1342
  */
1127
- toString():string;
1128
- get columns():Array<Column>;
1343
+ containsIgnoreCase(term:FilterValue):FilterCondition;
1129
1344
  /**
1130
- * a filter condition invoking a static function with the given parameters. Currently supported Deephaven static
1131
- * functions:
1345
+ * a filter condition checking if the given value matches the provided regular expressions string. Regex patterns
1346
+ * use Java regex syntax
1347
+ * @param pattern -
1348
+ * @return {@link dh.FilterCondition}
1349
+ */
1350
+ matches(pattern:FilterValue):FilterCondition;
1351
+ /**
1352
+ * a filter condition checking if the given value matches the provided regular expressions string, ignoring
1353
+ * differences of upper vs lower case. Regex patterns use Java regex syntax
1354
+ * @param pattern -
1355
+ * @return {@link dh.FilterCondition}
1356
+ */
1357
+ matchesIgnoreCase(pattern:FilterValue):FilterCondition;
1358
+ /**
1359
+ * a filter condition checking if the current value is a true boolean
1360
+ * @return {@link dh.FilterCondition}
1361
+ */
1362
+ isTrue():FilterCondition;
1363
+ /**
1364
+ * a filter condition checking if the current value is a false boolean
1365
+ * @return {@link dh.FilterCondition}
1366
+ */
1367
+ isFalse():FilterCondition;
1368
+ /**
1369
+ * a filter condition checking if the current value is a null value
1370
+ * @return {@link dh.FilterCondition}
1371
+ */
1372
+ isNull():FilterCondition;
1373
+ /**
1374
+ * a filter condition invoking the given method on the current value, with the given parameters. Currently supported
1375
+ * functions that can be invoked on a String:
1132
1376
  * <ul>
1133
- * <li><b>inRange</b>: Given three comparable values, returns true if the first is less than the second but greater
1134
- * than the third</li>
1135
- * <li><b>isInf</b>:Returns true if the given number is <i>infinity</i></li>
1136
- * <li><b>isNaN</b>:Returns true if the given number is <i>not a number</i></li>
1137
- * <li><b>isNormal</b>:Returns true if the given number <i>is not null</i>, <i>is not infinity</i>, and <i>is not
1138
- * "not a number"</i></li>
1139
- * <li><b>startsWith</b>:Returns true if the first string starts with the second string</li>
1140
- * <li><b>endsWith</b>Returns true if the first string ends with the second string</li>
1141
- * <li><b>matches</b>:Returns true if the first string argument matches the second string used as a Java regular
1142
- * expression</li>
1143
- * <li><b>contains</b>:Returns true if the first string argument contains the second string as a substring</li>
1144
- * <li><b>in</b>:Returns true if the first string argument can be found in the second array argument.
1377
+ * <li><b>startsWith</b>: Returns true if the current string value starts with the supplied string argument</li>
1378
+ * <li><b>endsWith</b>: Returns true if the current string value ends with the supplied string argument</li>
1379
+ * <li><b>matches</b>: Returns true if the current string value matches the supplied string argument used as a Java
1380
+ * regular expression</li>
1381
+ * <li><b>contains</b>: Returns true if the current string value contains the supplied string argument
1145
1382
  * <p>
1146
- * Note that the array can only be specified as a column reference at this time - typically the `FilterValue.in`
1147
- * method should be used in other cases
1383
+ * When invoking against a constant, this should be avoided in favor of FilterValue.contains
1148
1384
  * </p>
1149
1385
  * </li>
1150
1386
  * </ul>
1151
- * @param function -
1387
+ * @param method -
1152
1388
  * @param args -
1153
- * @return dh.FilterCondition
1389
+ * @return
1154
1390
  */
1155
- static invoke(func:string, ...args:FilterValue[]):FilterCondition;
1391
+ invoke(method:string, ...args:FilterValue[]):FilterCondition;
1392
+ toString():string;
1156
1393
  /**
1157
- * a filter condition which will check if the given value can be found in any supported column on whatever table
1158
- * this FilterCondition is passed to. This FilterCondition is somewhat unique in that it need not be given a column
1159
- * instance, but will adapt to any table. On numeric columns, with a value passed in which can be parsed as a
1160
- * number, the column will be filtered to numbers which equal, or can be "rounded" effectively to this number. On
1161
- * String columns, the given value will match any column which contains this string in a case-insensitive search. An
1162
- * optional second argument can be passed, an array of `FilterValue` from the columns to limit this search to (see
1163
- * {@link dh.Column.filter}).
1164
- * @param value -
1165
- * @param columns -
1166
- * @return dh.FilterCondition
1394
+ * Constructs a string for the filter API from the given parameter.
1395
+ * @param input -
1396
+ * @return
1167
1397
  */
1168
- static search(value:FilterValue, columns?:FilterValue[]):FilterCondition;
1169
- }
1170
-
1171
- export class LoginCredentials {
1172
- type?:string|null;
1173
- username?:string|null;
1174
- token?:string|null;
1175
-
1176
- constructor();
1398
+ static ofString(input:any):FilterValue;
1399
+ /**
1400
+ * Constructs a boolean for the filter API from the given parameter.
1401
+ * @param b -
1402
+ * @return
1403
+ */
1404
+ static ofBoolean(b:boolean):FilterValue;
1177
1405
  }
1178
1406
 
1179
- export class QueryInfo {
1180
- static readonly EVENT_TABLE_OPENED:string;
1181
- static readonly EVENT_DISCONNECT:string;
1182
- static readonly EVENT_RECONNECT:string;
1183
- static readonly EVENT_CONNECT:string;
1184
-
1185
- protected constructor();
1186
- }
1187
1407
 
1188
1408
  /**
1189
- * Wrap BigDecimal values for use in JS. Provides text formatting for display and access to the underlying value.
1409
+ * Represents a non-viewport subscription to a table, and all data currently known to be present in the subscribed
1410
+ * columns. This class handles incoming snapshots and deltas, and fires events to consumers to notify of data changes.
1411
+ * <p>
1412
+ * Unlike {@link dh.TableViewportSubscription}, the "original" table does not have a reference to this instance, only the
1413
+ * "private" table instance does, since the original cannot modify the subscription, and the private instance must
1414
+ * forward data to it.
1415
+ * <p>
1416
+ * Represents a subscription to the table on the server. Changes made to the table will not be reflected here - the
1417
+ * subscription must be closed and a new one optioned to see those changes. The event model is slightly different from
1418
+ * viewports to make it less expensive to compute for large tables.
1190
1419
  */
1191
- export class BigDecimalWrapper {
1192
- protected constructor();
1193
-
1194
- static ofString(value:string):BigDecimalWrapper;
1195
- asNumber():number;
1196
- valueOf():string;
1197
- toString():string;
1198
- equals(o:object):boolean;
1199
- hashCode():number;
1200
- }
1201
-
1202
- /**
1203
- * A Widget represents a server side object that sends one or more responses to the client. The client can then
1204
- * interpret these responses to see what to render, or how to respond.
1205
- * <p>
1206
- * Most custom object types result in a single response being sent to the client, often with other exported objects, but
1207
- * some will have streamed responses, and allow the client to send follow-up requests of its own. This class's API is
1208
- * backwards compatible, but as such does not offer a way to tell the difference between a streaming or non-streaming
1209
- * object type, the client code that handles the payloads is expected to know what to expect. See
1210
- * {@link dh.WidgetMessageDetails} for more information.
1211
- * <p>
1212
- * When the promise that returns this object resolves, it will have the first response assigned to its fields. Later
1213
- * responses from the server will be emitted as "message" events. When the connection with the server ends, the "close"
1214
- * event will be emitted. In this way, the connection will behave roughly in the same way as a WebSocket - either side
1215
- * can close, and after close no more messages will be processed. There can be some latency in closing locally while
1216
- * remote messages are still pending - it is up to implementations of plugins to handle this case.
1217
- * <p>
1218
- * Also like WebSockets, the plugin API doesn't define how to serialize messages, and just handles any binary payloads.
1219
- * What it does handle however, is allowing those messages to include references to server-side objects with those
1220
- * payloads. Those server side objects might be tables or other built-in types in the Deephaven JS API, or could be
1221
- * objects usable through their own plugins. They also might have no plugin at all, allowing the client to hold a
1222
- * reference to them and pass them back to the server, either to the current plugin instance, or through another API.
1223
- * The `Widget` type does not specify how those objects should be used or their lifecycle, but leaves that
1224
- * entirely to the plugin. Messages will arrive in the order they were sent.
1225
- * <p>
1226
- * This can suggest several patterns for how plugins operate:
1227
- * <ul>
1228
- * <li>The plugin merely exists to transport some other object to the client. This can be useful for objects which can
1229
- * easily be translated to some other type (like a Table) when the user clicks on it. An example of this is
1230
- * `pandas.DataFrame` will result in a widget that only contains a static
1231
- * {@link dh.Table}. Presently, the widget is immediately closed, and only the Table is
1232
- * provided to the JS API consumer.</li>
1233
- * <li>The plugin provides references to Tables and other objects, and those objects can live longer than the object
1234
- * which provided them. One concrete example of this could have been
1235
- * {@link dh.PartitionedTable} when fetching constituent tables, but it was implemented
1236
- * before bidirectional plugins were implemented. Another example of this is plugins that serve as a "factory", giving
1237
- * the user access to table manipulation/creation methods not supported by gRPC or the JS API.</li>
1238
- * <li>The plugin provides reference to Tables and other objects that only make sense within the context of the widget
1239
- * instance, so when the widget goes away, those objects should be released as well. This is also an example of
1240
- * {@link dh.PartitionedTable}, as the partitioned table tracks creation of new keys through
1241
- * an internal table instance.</li>
1242
- * </ul>
1243
- *
1244
- * Handling server objects in messages also has more than one potential pattern that can be used:
1245
- * <ul>
1246
- * <li>One object per message - the message clearly is about that object, no other details required.</li>
1247
- * <li>Objects indexed within their message - as each message comes with a list of objects, those objects can be
1248
- * referenced within the payload by index. This is roughly how {@link dh.plot.Figure}
1249
- * behaves, where the figure descriptor schema includes an index for each created series, describing which table should
1250
- * be used, which columns should be mapped to each axis.</li>
1251
- * <li>Objects indexed since widget creation - each message would append its objects to a list created when the widget
1252
- * was first made, and any new exports that arrive in a new message would be appended to that list. Then, subsequent
1253
- * messages can reference objects already sent. This imposes a limitation where the client cannot release any exports
1254
- * without the server somehow signaling that it will never reference that export again.</li>
1255
- * </ul>
1256
- */
1257
- export class Widget implements WidgetMessageDetails, HasEventHandling {
1258
- static readonly EVENT_MESSAGE:string;
1259
- static readonly EVENT_CLOSE:string;
1260
-
1420
+ export class TableSubscription implements HasEventHandling {
1261
1421
  protected constructor();
1262
1422
 
1423
+ static createTableSubscription(options:SubscriptionOptions, existingTable:Table):TableSubscription;
1263
1424
  /**
1264
- * Ends the client connection to the server.
1425
+ * Updates the subscription to use the given columns and update interval.
1426
+ * @param columns - the new columns to subscribe to
1427
+ * @param updateIntervalMs - the new update interval, or null/omit to use the default of one second
1428
+ */
1429
+ changeSubscription(columns:Array<Column>, updateIntervalMs:number|undefined|null):void;
1430
+ /**
1431
+ * Update the options for this viewport subscription. This cannot alter the update interval or preview options.
1432
+ * @param options - the subscription options
1433
+ */
1434
+ update(options:SubscriptionOptions):void;
1435
+ get columns():Array<Column>;
1436
+ /**
1437
+ * Stops the subscription on the server.
1265
1438
  */
1266
1439
  close():void;
1267
- getDataAsBase64():string;
1268
- getDataAsU8():Uint8Array;
1269
- getDataAsString():string;
1270
1440
  /**
1271
- * Sends a string/bytes payload to the server, along with references to objects that exist on the server.
1272
- * @param msg - string/buffer/view instance that represents data to send
1273
- * @param references - an array of objects that can be safely sent to the server
1441
+ * Listen for events on this object.
1442
+ * @param name - the name of the event to listen for
1443
+ * @param callback - a function to call when the event occurs
1444
+ * @return Returns a cleanup function.
1445
+ * @typeParam T - the type of the data that the event will provide
1274
1446
  */
1275
- sendMessage(msg:string|ArrayBuffer|ArrayBufferView, references?:Array<Table|Widget|WidgetExportedObject|PartitionedTable|TotalsTable|TreeTable>):void;
1276
1447
  addEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):()=>void;
1277
1448
  nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<Event<T>>;
1278
1449
  hasListeners(name:string):boolean;
1450
+ /**
1451
+ * Removes an event listener added to this table.
1452
+ * @param name -
1453
+ * @param callback -
1454
+ * @return
1455
+ * @typeParam T -
1456
+ */
1279
1457
  removeEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):boolean;
1458
+ }
1459
+
1460
+ /**
1461
+ * This class allows iteration over non-contiguous indexes. In the future, this will support the EcmaScript 2015
1462
+ * Iteration protocol, but for now has one method which returns an iterator, and also supports querying the size.
1463
+ * Additionally, we may add support for creating RangeSet objects to better serve some use cases.
1464
+ */
1465
+ export class RangeSet {
1466
+ protected constructor();
1467
+
1468
+ static ofRange(first:number, last:number):RangeSet;
1469
+ static ofItems(rows:number[]):RangeSet;
1470
+ static ofRanges(ranges:RangeSet[]):RangeSet;
1471
+ static ofSortedRanges(ranges:RangeSet[]):RangeSet;
1280
1472
  /**
1281
- *
1282
- * @return the exported objects sent in the initial message from the server. The client is responsible for closing
1283
- * them when finished using them.
1473
+ * a new iterator over all indexes in this collection.
1474
+ * @return Iterator of {@link dh.LongWrapper}
1284
1475
  */
1285
- get exportedObjects():WidgetExportedObject[];
1476
+ iterator():Iterator<LongWrapper>;
1477
+ /**
1478
+ * The total count of items contained in this collection. In some cases this can be expensive to compute, and
1479
+ * generally should not be needed except for debugging purposes, or preallocating space (i.e., do not call this
1480
+ * property each time through a loop).
1481
+ * @return double
1482
+ */
1483
+ get size():number;
1484
+ }
1485
+
1486
+ /**
1487
+ * Describes the structure of the column, and if desired can be used to get access to the data to be rendered in this
1488
+ * column.
1489
+ */
1490
+ export class Column {
1491
+ /**
1492
+ * If this column is part of a roll-up tree table, represents the type of the row data that can be found in this
1493
+ * column for leaf nodes if includeConstituents is enabled. Otherwise, it is <b>null</b>.
1494
+ * @return String
1495
+ */
1496
+ readonly constituentType?:string|null;
1497
+ readonly description?:string|null;
1498
+
1499
+ protected constructor();
1500
+
1501
+ /**
1502
+ * the value for this column in the given row. Type will be consistent with the type of the Column.
1503
+ * @param row -
1504
+ * @return Any
1505
+ */
1506
+ get(row:Row):any;
1507
+ getFormat(row:Row):Format;
1508
+ /**
1509
+ * Creates a sort builder object, to be used when sorting by this column.
1510
+ * @return {@link dh.Sort}
1511
+ */
1512
+ sort():Sort;
1513
+ /**
1514
+ * Creates a new value for use in filters based on this column. Used either as a parameter to another filter
1515
+ * operation, or as a builder to create a filter operation.
1516
+ * @return {@link dh.FilterValue}
1517
+ */
1518
+ filter():FilterValue;
1519
+ /**
1520
+ * a <b>CustomColumn</b> object to apply using `applyCustomColumns` with the expression specified.
1521
+ * @param expression -
1522
+ * @return {@link dh.CustomColumn}
1523
+ */
1524
+ formatColor(expression:string, options?:CustomColumnOptions|undefined|null):CustomColumn;
1525
+ /**
1526
+ * a <b>CustomColumn</b> object to apply using <b>applyCustomColumns</b> with the expression specified.
1527
+ * @param expression -
1528
+ * @return {@link dh.CustomColumn}
1529
+ */
1530
+ formatNumber(expression:string, options?:CustomColumnOptions|undefined|null):CustomColumn;
1531
+ /**
1532
+ * a <b>CustomColumn</b> object to apply using <b>applyCustomColumns</b> with the expression specified.
1533
+ * @param expression -
1534
+ * @return {@link dh.CustomColumn}
1535
+ */
1536
+ formatDate(expression:string, options?:CustomColumnOptions|undefined|null):CustomColumn;
1537
+ toString():string;
1538
+ /**
1539
+ * Label for this column.
1540
+ * @return String
1541
+ */
1542
+ get name():string;
1543
+ /**
1544
+ * True if this column is a partition column. Partition columns are used for filtering uncoalesced tables - see
1545
+ * {@link Table.uncoalesced}.
1546
+ * @return true if the column is a partition column
1547
+ */
1548
+ get isPartitionColumn():boolean;
1286
1549
  /**
1287
1550
  *
1288
- * @return the type of this widget
1551
+ * @deprecated do not use. Internal index of the column in the table, to be used as a key on the Row.
1552
+ * @return int
1553
+ */
1554
+ get index():number;
1555
+ get isSortable():boolean;
1556
+ /**
1557
+ * Type of the row data that can be found in this column.
1558
+ * @return String
1559
+ */
1560
+ get type():string;
1561
+ /**
1562
+ * Format entire rows colors using the expression specified. Returns a <b>CustomColumn</b> object to apply to a
1563
+ * table using <b>applyCustomColumns</b> with the parameters specified.
1564
+ * @param expression -
1565
+ * @param options -
1566
+ * @return {@link dh.CustomColumn}
1567
+ */
1568
+ static formatRowColor(expression:string, options?:CustomColumnOptions|undefined|null):CustomColumn;
1569
+ /**
1570
+ * a <b>CustomColumn</b> object to apply using <b>applyCustomColumns</b> with the expression specified.
1571
+ * @param name -
1572
+ * @param expression -
1573
+ * @param options -
1574
+ * @return {@link dh.CustomColumn}
1575
+ */
1576
+ static createCustomColumn(name:string, expression:string, options?:CustomColumnOptions|undefined|null):CustomColumn;
1577
+ }
1578
+
1579
+ export class CustomColumn {
1580
+ static readonly TYPE_FORMAT_COLOR:string;
1581
+ static readonly TYPE_FORMAT_NUMBER:string;
1582
+ static readonly TYPE_FORMAT_DATE:string;
1583
+ static readonly TYPE_NEW:string;
1584
+
1585
+ protected constructor();
1586
+
1587
+ valueOf():string;
1588
+ toString():string;
1589
+ static from(columnInfo:string):CustomColumn;
1590
+ /**
1591
+ * The expression to evaluate this custom column.
1592
+ * @return String
1593
+ */
1594
+ get expression():string;
1595
+ /**
1596
+ * The name of the column to use.
1597
+ * @return String
1598
+ */
1599
+ get name():string;
1600
+ /**
1601
+ * The options for this custom column.
1602
+ * @return CustomColumOptions
1603
+ */
1604
+ get options():CustomColumnOptions;
1605
+ /**
1606
+ * Type of custom column. One of
1607
+ *
1608
+ * <ul>
1609
+ * <li>FORMAT_COLOR</li>
1610
+ * <li>FORMAT_NUMBER</li>
1611
+ * <li>FORMAT_DATE</li>
1612
+ * <li>NEW</li>
1613
+ * </ul>
1614
+ * @return String
1289
1615
  */
1290
1616
  get type():string;
1291
1617
  }
1292
1618
 
1619
+ export class CoreClient implements HasEventHandling {
1620
+ static readonly EVENT_CONNECT:string;
1621
+ static readonly EVENT_DISCONNECT:string;
1622
+ static readonly EVENT_RECONNECT:string;
1623
+ static readonly EVENT_RECONNECT_AUTH_FAILED:string;
1624
+ static readonly EVENT_REQUEST_FAILED:string;
1625
+ static readonly EVENT_REQUEST_STARTED:string;
1626
+ static readonly EVENT_REQUEST_SUCCEEDED:string;
1627
+ /**
1628
+ * @deprecated
1629
+ */
1630
+ static readonly EVENT_REFRESH_TOKEN_UPDATED:string;
1631
+ static readonly LOGIN_TYPE_PASSWORD:string;
1632
+ static readonly LOGIN_TYPE_ANONYMOUS:string;
1633
+
1634
+ constructor(serverUrl:string, connectOptions?:ConnectOptions);
1635
+
1636
+ running():Promise<CoreClient>;
1637
+ getServerUrl():string;
1638
+ getAuthConfigValues():Promise<string[][]>;
1639
+ login(credentials:LoginCredentials):Promise<void>;
1640
+ relogin(token:RefreshToken):Promise<void>;
1641
+ onConnected(timeoutInMillis?:number):Promise<void>;
1642
+ getServerConfigValues():Promise<string[][]>;
1643
+ getStorageService():dh.storage.StorageService;
1644
+ getAsIdeConnection():Promise<IdeConnection>;
1645
+ disconnect():void;
1646
+ addEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):()=>void;
1647
+ nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<Event<T>>;
1648
+ hasListeners(name:string):boolean;
1649
+ removeEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):boolean;
1650
+ }
1293
1651
 
1294
1652
  export class IdeSession implements HasEventHandling {
1295
1653
  static readonly EVENT_COMMANDSTARTED:string;
@@ -1359,350 +1717,247 @@ export namespace dh {
1359
1717
  * @return A promise that will resolve to the shared object, or will reject with an error if it cannot be read.
1360
1718
  */
1361
1719
  getSharedObject(sharedTicketBytes:string|Uint8Array, type:string):Promise<any>;
1362
- subscribeToFieldUpdates(callback:(arg0:dh.ide.VariableChanges)=>void):()=>void;
1363
- close():void;
1364
- runCode(code:string):Promise<dh.ide.CommandResult>;
1365
- onLogMessage(callback:(arg0:dh.ide.LogItem)=>void):()=>void;
1366
- openDocument(params:object):void;
1367
- changeDocument(params:object):void;
1368
- getCompletionItems(params:object):Promise<Array<dh.lsp.CompletionItem>>;
1369
- getSignatureHelp(params:object):Promise<Array<dh.lsp.SignatureInformation>>;
1370
- getHover(params:object):Promise<dh.lsp.Hover>;
1371
- closeDocument(params:object):void;
1372
- /**
1373
- * Creates an empty table with the specified number of rows. Optionally columns and types may be specified, but all
1374
- * values will be null.
1375
- * @param size -
1376
- * @return {@link Promise} of {@link dh.Table}
1377
- */
1378
- emptyTable(size:number):Promise<Table>;
1379
- /**
1380
- * Creates a new table that ticks automatically every "periodNanos" nanoseconds. A start time may be provided; if so
1381
- * the table will be populated with the interval from the specified date until now.
1382
- * @param periodNanos -
1383
- * @param startTime -
1384
- * @return {@link Promise} of {@link dh.Table}
1385
- */
1386
- timeTable(periodNanos:number, startTime?:DateWrapper):Promise<Table>;
1387
- addEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):()=>void;
1388
- nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<Event<T>>;
1389
- hasListeners(name:string):boolean;
1390
- removeEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):boolean;
1391
- }
1392
-
1393
- /**
1394
- * This object serves as a "handle" to a subscription, allowing it to be acted on directly or canceled outright. If you
1395
- * retain an instance of this, you have two choices - either only use it to call `close()` on it to stop the table's
1396
- * viewport without creating a new one, or listen directly to this object instead of the table for data events, and
1397
- * always call `close()` when finished. Calling any method on this object other than close() will result in it
1398
- * continuing to live on after `setViewport` is called on the original table, or after the table is modified.
1399
- */
1400
- export class TableViewportSubscription implements HasEventHandling {
1401
- protected constructor();
1402
-
1403
- /**
1404
- * Changes the rows and columns set on this viewport. This cannot be used to change the update interval.
1405
- * @param firstRow -
1406
- * @param lastRow -
1407
- * @param columns -
1408
- * @param updateIntervalMs -
1409
- * @deprecated use {@link #update(Object)} instead
1410
- */
1411
- setViewport(firstRow:number, lastRow:number, columns?:Column[]|undefined|null, updateIntervalMs?:number|undefined|null, isReverseViewport?:boolean|undefined|null):void;
1412
- /**
1413
- * Update the options for this viewport subscription. This cannot alter the update interval or preview options.
1414
- * @param options - the subscription options
1415
- */
1416
- update(options:ViewportSubscriptionOptions):void;
1417
- /**
1418
- * Stops this viewport from running, stopping all events on itself and on the table that created it.
1419
- */
1420
- close():void;
1421
- /**
1422
- * Gets the data currently visible in this viewport
1423
- * @return Promise of {@link dh.TableData}.
1424
- */
1425
- getViewportData():Promise<ViewportData>;
1720
+ subscribeToFieldUpdates(callback:(arg0:dh.ide.VariableChanges)=>void):()=>void;
1721
+ close():void;
1722
+ runCode(code:string):Promise<dh.ide.CommandResult>;
1723
+ onLogMessage(callback:(arg0:dh.ide.LogItem)=>void):()=>void;
1724
+ openDocument(params:object):void;
1725
+ changeDocument(params:object):void;
1726
+ getCompletionItems(params:object):Promise<Array<dh.lsp.CompletionItem>>;
1727
+ getSignatureHelp(params:object):Promise<Array<dh.lsp.SignatureInformation>>;
1728
+ getHover(params:object):Promise<dh.lsp.Hover>;
1729
+ closeDocument(params:object):void;
1426
1730
  /**
1427
- *
1428
- * @deprecated Use {@link JsTable#createSnapshot(Object)} instead
1731
+ * Creates an empty table with the specified number of rows. Optionally columns and types may be specified, but all
1732
+ * values will be null.
1733
+ * @param size -
1734
+ * @return {@link Promise} of {@link dh.Table}
1429
1735
  */
1430
- snapshot(rows:RangeSet, columns:Column[]):Promise<TableData>;
1736
+ emptyTable(size:number):Promise<Table>;
1431
1737
  /**
1432
- * Listen for events on this object.
1433
- * @param name - the name of the event to listen for
1434
- * @param callback - a function to call when the event occurs
1435
- * @return Returns a cleanup function.
1436
- * @typeParam T - the type of the data that the event will provide
1738
+ * Creates a new table that ticks automatically every "periodNanos" nanoseconds. A start time may be provided; if so
1739
+ * the table will be populated with the interval from the specified date until now.
1740
+ * @param periodNanos -
1741
+ * @param startTime -
1742
+ * @return {@link Promise} of {@link dh.Table}
1437
1743
  */
1744
+ timeTable(periodNanos:number, startTime?:DateWrapper):Promise<Table>;
1438
1745
  addEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):()=>void;
1439
1746
  nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<Event<T>>;
1440
1747
  hasListeners(name:string):boolean;
1441
- /**
1442
- * Removes an event listener added to this table.
1443
- * @param name -
1444
- * @param callback -
1445
- * @return
1446
- * @typeParam T -
1447
- */
1448
1748
  removeEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):boolean;
1449
1749
  }
1450
1750
 
1451
1751
  /**
1452
- * Event fired when a command is issued from the client.
1752
+ * Behaves like a {@link dh.Table} externally, but data, state, and viewports are managed by an entirely different
1753
+ * mechanism, and so reimplemented here.
1754
+ * <p>
1755
+ * Any time a change is made, we build a new request and send it to the server, and wait for the updated state.
1756
+ * <p>
1757
+ * Semantics around getting updates from the server are slightly different - we don't "unset" the viewport here after
1758
+ * operations are performed, but encourage the client code to re-set them to the desired position.
1759
+ * <p>
1760
+ * The table size will be -1 until a viewport has been fetched.
1761
+ * <p>
1762
+ * Similar to a table, a Tree Table provides access to subscribed viewport data on the current hierarchy. A different
1763
+ * Row type is used within that viewport, showing the depth of that node within the tree and indicating details about
1764
+ * whether it has children or is expanded. The Tree Table itself then provides the ability to change if a row is
1765
+ * expanded or not. Methods used to control or check if a row should be expanded or not can be invoked on a TreeRow
1766
+ * instance, or on the number of the row (thus allowing for expanding/collapsing rows which are not currently visible in
1767
+ * the viewport).
1768
+ * <p>
1769
+ * Events and viewports are somewhat different from tables, due to the expense of computing the expanded/collapsed rows
1770
+ * and count of children at each level of the hierarchy, and differences in the data that is available.
1771
+ * <p>
1772
+ * <ul>
1773
+ * <li>There is no {@link Table.totalSize | totalSize} property.</li>
1774
+ * <li>The viewport is not un-set when changes are made to filter or sort, but changes will continue to be streamed in.
1775
+ * It is suggested that the viewport be changed to the desired position (usually the first N rows) after any filter/sort
1776
+ * change is made. Likewise, {@link getViewportData} will always return the most recent data, and will not wait if a
1777
+ * new operation is pending.</li>
1778
+ * <li>Custom columns are supported on Rollup tables, but not on Tree tables. If the TreeTable was created client-side,
1779
+ * the original Table can have custom columns applied, and the TreeTable can be recreated.</li>
1780
+ * <li>Whereas Table has a {@link Table.totalsTableConfig} property, it is defined here as a method,
1781
+ * {@link getTotalsTableConfig}. This returns a promise so the config can be fetched asynchronously.</li>
1782
+ * <li>Totals Tables for trees vary in behavior between tree tables and roll-up tables. This behavior is based on the
1783
+ * original flat table used to produce the Tree Table - for a hierarchical table (i.e. Table.treeTable in the query
1784
+ * config), the totals will include non-leaf nodes (since they are themselves actual rows in the table), but in a
1785
+ * roll-up table, the totals only include leaf nodes (as non-leaf nodes are generated through grouping the contents of
1786
+ * the original table). Roll-ups also have the {@link dh.includeConstituents} property, indicating that a
1787
+ * {@link dh.Column} in the tree may have a {@link Column.constituentType} property reflecting that the type of cells
1788
+ * where {@link TreeRowImpl.hasChildren} is false will be different from usual.</li>
1789
+ * </ul>
1453
1790
  */
1454
- export class CommandInfo {
1455
- constructor(code:string, result:Promise<dh.ide.CommandResult>);
1456
-
1457
- get result():Promise<dh.ide.CommandResult>;
1458
- get code():string;
1459
- }
1460
-
1461
- export class LongWrapper {
1462
- protected constructor();
1463
-
1464
- static ofString(str:string):LongWrapper;
1465
- asNumber():number;
1466
- valueOf():string;
1467
- toString():string;
1468
- }
1469
-
1470
- export class CustomColumn {
1471
- static readonly TYPE_FORMAT_COLOR:string;
1472
- static readonly TYPE_FORMAT_NUMBER:string;
1473
- static readonly TYPE_FORMAT_DATE:string;
1474
- static readonly TYPE_NEW:string;
1475
-
1476
- protected constructor();
1477
-
1478
- valueOf():string;
1479
- toString():string;
1480
- static from(columnInfo:string):CustomColumn;
1481
- /**
1482
- * The expression to evaluate this custom column.
1483
- * @return String
1484
- */
1485
- get expression():string;
1791
+ export class TreeTable implements HasEventHandling {
1486
1792
  /**
1487
- * The name of the column to use.
1488
- * @return String
1793
+ * event.detail is the currently visible viewport data based on the active viewport configuration.
1489
1794
  */
1490
- get name():string;
1795
+ static readonly EVENT_UPDATED:string;
1491
1796
  /**
1492
- * The options for this custom column.
1493
- * @return CustomColumOptions
1797
+ * event.detail is the currently visible viewport data based on the active viewport configuration.
1494
1798
  */
1495
- get options():CustomColumnOptions;
1799
+ static readonly EVENT_DISCONNECT:string;
1496
1800
  /**
1497
- * Type of custom column. One of
1498
- *
1499
- * <ul>
1500
- * <li>FORMAT_COLOR</li>
1501
- * <li>FORMAT_NUMBER</li>
1502
- * <li>FORMAT_DATE</li>
1503
- * <li>NEW</li>
1504
- * </ul>
1505
- * @return String
1801
+ * event.detail is the currently visible viewport data based on the active viewport configuration.
1506
1802
  */
1507
- get type():string;
1508
- }
1509
-
1510
- /**
1511
- * This class allows iteration over non-contiguous indexes. In the future, this will support the EcmaScript 2015
1512
- * Iteration protocol, but for now has one method which returns an iterator, and also supports querying the size.
1513
- * Additionally, we may add support for creating RangeSet objects to better serve some use cases.
1514
- */
1515
- export class RangeSet {
1516
- protected constructor();
1517
-
1518
- static ofRange(first:number, last:number):RangeSet;
1519
- static ofItems(rows:number[]):RangeSet;
1520
- static ofRanges(ranges:RangeSet[]):RangeSet;
1521
- static ofSortedRanges(ranges:RangeSet[]):RangeSet;
1803
+ static readonly EVENT_RECONNECT:string;
1522
1804
  /**
1523
- * a new iterator over all indexes in this collection.
1524
- * @return Iterator of {@link dh.LongWrapper}
1805
+ * event.detail is the currently visible viewport data based on the active viewport configuration.
1525
1806
  */
1526
- iterator():Iterator<LongWrapper>;
1807
+ static readonly EVENT_RECONNECTFAILED:string;
1527
1808
  /**
1528
- * The total count of items contained in this collection. In some cases this can be expensive to compute, and
1529
- * generally should not be needed except for debugging purposes, or preallocating space (i.e., do not call this
1530
- * property each time through a loop).
1531
- * @return double
1809
+ * event.detail is the currently visible viewport data based on the active viewport configuration.
1532
1810
  */
1533
- get size():number;
1534
- }
1535
-
1536
- /**
1537
- * Exists to keep the dh.TableMap namespace so that the web UI can remain compatible with the DHE API, which still calls
1538
- * this type TableMap.
1539
- * @deprecated
1540
- */
1541
- export class TableMap {
1542
- static readonly EVENT_KEYADDED:string;
1543
- static readonly EVENT_DISCONNECT:string;
1544
- static readonly EVENT_RECONNECT:string;
1545
- static readonly EVENT_RECONNECTFAILED:string;
1811
+ static readonly EVENT_REQUEST_FAILED:string;
1812
+ readonly description?:string|null;
1813
+ readonly layoutHints?:null|LayoutHints;
1546
1814
 
1547
1815
  protected constructor();
1548
- }
1549
1816
 
1550
- /**
1551
- * Represents a set of Tables each corresponding to some key. The keys are available locally, but a call must be made to
1552
- * the server to get each Table. All tables will have the same structure.
1553
- */
1554
- export class PartitionedTable implements HasEventHandling {
1555
1817
  /**
1556
- * Indicates that a new key has been added to the array of keys, which can now be fetched with getTable.
1557
- */
1558
- static readonly EVENT_KEYADDED:string;
1559
- /**
1560
- * Indicates that a new key has been added to the array of keys, which can now be fetched with getTable.
1818
+ * Expands the given node, so that its children are visible when they are in the viewport. The parameter can be the
1819
+ * row index, or the row object itself. The second parameter is a boolean value, false by default, specifying if the
1820
+ * row and all descendants should be fully expanded. Equivalent to `setExpanded(row, true)` with an optional third
1821
+ * boolean parameter.
1822
+ * @param row -
1823
+ * @param expandDescendants -
1561
1824
  */
1562
- static readonly EVENT_DISCONNECT:string;
1825
+ expand(row:TreeRow|number, expandDescendants?:boolean):void;
1563
1826
  /**
1564
- * Indicates that a new key has been added to the array of keys, which can now be fetched with getTable.
1827
+ * Collapses the given node, so that its children and descendants are not visible in the size or the viewport. The
1828
+ * parameter can be the row index, or the row object itself. Equivalent to <b>setExpanded(row, false, false)</b>.
1829
+ * @param row -
1565
1830
  */
1566
- static readonly EVENT_RECONNECT:string;
1831
+ collapse(row:TreeRow|number):void;
1567
1832
  /**
1568
- * Indicates that a new key has been added to the array of keys, which can now be fetched with getTable.
1833
+ * Specifies if the given node should be expanded or collapsed. If this node has children, and the value is changed,
1834
+ * the size of the table will change. If node is to be expanded and the third parameter, <b>expandDescendants</b>,
1835
+ * is true, then its children will also be expanded.
1836
+ * @param row - the row to expand or collapse, either the absolute row index or the row object
1837
+ * @param isExpanded - true to expand the row, false to collapse
1838
+ * @param expandDescendants - true to expand the row and all descendants, false to expand only the row, defaults to
1839
+ * false
1569
1840
  */
1570
- static readonly EVENT_RECONNECTFAILED:string;
1571
-
1572
- protected constructor();
1573
-
1841
+ setExpanded(row:TreeRow|number, isExpanded:boolean, expandDescendants?:boolean):void;
1842
+ expandAll():void;
1843
+ collapseAll():void;
1574
1844
  /**
1575
- * Fetch the table with the given key. If the key does not exist, returns `null`.
1576
- * @param key - The key to fetch. An array of values for each key column, in the same order as the key columns are.
1577
- * @return Promise of dh.Table, or `null` if the key does not exist.
1845
+ * Tests if the specified row is expanded.
1846
+ * @param row - the row to test, either the absolute row index or the row object
1847
+ * @return boolean true if the row is expanded, false otherwise
1578
1848
  */
1579
- getTable(key:object):Promise<Table|undefined|null>;
1849
+ isExpanded(row:TreeRow|number):boolean;
1850
+ setViewport(firstRow:number, lastRow:number, columns?:Array<Column>|undefined|null, updateInterval?:number|undefined|null):void;
1851
+ getViewportData():Promise<TreeViewportData>;
1580
1852
  /**
1581
- * Open a new table that is the result of merging all constituent tables. See
1582
- * {@link io.deephaven.engine.table.PartitionedTable.merge} for details.
1583
- * @return A merged representation of the constituent tables.
1853
+ * Indicates that the table will no longer be used, and server resources can be freed.
1584
1854
  */
1585
- getMergedTable():Promise<Table>;
1855
+ close():void;
1586
1856
  /**
1587
- * The set of all currently known keys. This is kept up to date, so getting the list after adding an event listener
1588
- * for <b>keyadded</b> will ensure no keys are missed.
1589
- * @return Set of Object
1857
+ * Applies the given sort to all levels of the tree. Returns the previous sort in use.
1858
+ * @param sort -
1859
+ * @return {@link dh.Sort} array
1590
1860
  */
1591
- getKeys():Set<object>;
1861
+ applySort(sort:Sort[]):Array<Sort>;
1592
1862
  /**
1593
- * Fetch a table containing all the valid keys of the partitioned table.
1594
- * @return Promise of a Table
1595
- * @deprecated
1863
+ * Applies the given filter to the contents of the tree in such a way that if any node is visible, then any parent
1864
+ * node will be visible as well even if that parent node would not normally be visible due to the filter's
1865
+ * condition. Returns the previous sort in use.
1866
+ * @param filter -
1867
+ * @return {@link dh.FilterCondition} array
1596
1868
  */
1597
- getKeyTable():Promise<Table>;
1869
+ applyFilter(filter:FilterCondition[]):Array<FilterCondition>;
1598
1870
  /**
1599
- * Fetch the underlying base table of the partitioned table.
1600
- * @return Promise of a Table
1871
+ * Adding new columns to the table based on other columns using updateView() mechanics. Rollup tables are supported
1872
+ * but Tree tables will throw an {@link java.lang.UnsupportedOperationException} if this function is called.
1873
+ * @param customColumns -
1874
+ * @return {@link dh.CustomColumn} array
1601
1875
  */
1602
- getBaseTable():Promise<Table>;
1876
+ applyCustomColumns(customColumns:Array<string|CustomColumn>):Array<CustomColumn>;
1603
1877
  /**
1604
- * Indicates that this PartitionedTable will no longer be used, removing subcriptions to updated keys, etc. This
1605
- * will not affect tables in use.
1878
+ * a column with the given name, or throws an exception if it cannot be found
1879
+ * @param key -
1880
+ * @return {@link dh.Column}
1606
1881
  */
1607
- close():void;
1882
+ findColumn(key:string):Column;
1608
1883
  /**
1609
- * The count of known keys.
1610
- * @return int
1884
+ * an array with all of the named columns in order, or throws an exception if one cannot be found.
1885
+ * @param keys -
1886
+ * @return {@link dh.Column} array
1611
1887
  */
1612
- get size():number;
1888
+ findColumns(keys:string[]):Column[];
1613
1889
  /**
1614
- * An array of the columns in the tables that can be retrieved from this partitioned table, including both key and
1615
- * non-key columns.
1616
- * @return Array of Column
1890
+ * Provides Table-like selectDistinct functionality, but with a few quirks, since it is only fetching the distinct
1891
+ * values for the given columns in the source table:
1892
+ * <ul>
1893
+ * <li>Rollups may make no sense, since values are aggregated.</li>
1894
+ * <li>Values found on orphaned (and removed) nodes will show up in the resulting table, even though they are not in
1895
+ * the tree.</li>
1896
+ * <li>Values found on parent nodes which are only present in the tree since a child is visible will not be present
1897
+ * in the resulting table.</li>
1898
+ * </ul>
1617
1899
  */
1618
- get columns():Column[];
1900
+ selectDistinct(columns:Column[]):Promise<Table>;
1901
+ getTotalsTableConfig():Promise<TotalsTableConfig>;
1902
+ getTotalsTable(config?:object):Promise<TotalsTable>;
1903
+ getGrandTotalsTable(config?:object):Promise<TotalsTable>;
1619
1904
  /**
1620
- * An array of all the key columns that the tables are partitioned by.
1621
- * @return Array of Column
1905
+ * a new copy of this treetable, so it can be sorted and filtered separately, and maintain a different viewport.
1906
+ * Unlike Table, this will _not_ copy the filter or sort, since tree table viewport semantics differ, and without a
1907
+ * viewport set, the treetable doesn't evaluate these settings, and they aren't readable on the properties. Expanded
1908
+ * state is also not copied.
1909
+ * @return Promise of dh.TreeTable
1622
1910
  */
1623
- get keyColumns():Column[];
1911
+ copy():Promise<TreeTable>;
1624
1912
  /**
1625
- * Listen for events on this object.
1626
- * @param name - the name of the event to listen for
1627
- * @param callback - a function to call when the event occurs
1628
- * @return Returns a cleanup function.
1629
- * @typeParam T - the type of the data that the event will provide
1913
+ * The current filter configuration of this Tree Table.
1914
+ * @return {@link dh.FilterCondition} array
1630
1915
  */
1631
- addEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):()=>void;
1632
- nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<Event<T>>;
1633
- hasListeners(name:string):boolean;
1916
+ get filter():Array<FilterCondition>;
1634
1917
  /**
1635
- * Removes an event listener added to this table.
1636
- * @param name -
1637
- * @param callback -
1638
- * @return
1639
- * @typeParam T -
1918
+ * True if this is a roll-up and will provide the original rows that make up each grouping.
1919
+ * @return boolean
1640
1920
  */
1641
- removeEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):boolean;
1642
- }
1643
-
1644
- /**
1645
- * Describes a grouping and aggregations for a roll-up table. Pass to the <b>Table.rollup</b> function to create a
1646
- * roll-up table.
1647
- */
1648
- export class RollupConfig {
1921
+ get includeConstituents():boolean;
1922
+ get groupedColumns():Array<Column>;
1649
1923
  /**
1650
- * Ordered list of columns to group by to form the hierarchy of the resulting roll-up table.
1924
+ * True if this table has been closed.
1925
+ * @return boolean
1651
1926
  */
1652
- groupingColumns:Array<String>;
1927
+ get isClosed():boolean;
1653
1928
  /**
1654
- * Mapping from each aggregation name to the ordered list of columns it should be applied to in the resulting
1655
- * roll-up table.
1929
+ * The current number of rows given the table's contents and the various expand/collapse states of each node. (No
1930
+ * totalSize is provided at this time; its definition becomes unclear between roll-up and tree tables, especially
1931
+ * when considering collapse/expand states).
1932
+ * @return double
1656
1933
  */
1657
- aggregations:{ [key: string]: Array<string>; };
1934
+ get size():number;
1658
1935
  /**
1659
- * Optional parameter indicating if an extra leaf node should be added at the bottom of the hierarchy, showing the
1660
- * rows in the underlying table which make up that grouping. Since these values might be a different type from the
1661
- * rest of the column, any client code must check if TreeRow.hasChildren = false, and if so, interpret those values
1662
- * as if they were Column.constituentType instead of Column.type. Defaults to false.
1936
+ * Returns the columns that are aggregated.
1937
+ * @return array of aggregated columns
1663
1938
  */
1664
- includeConstituents:boolean;
1665
- includeOriginalColumns?:boolean|null;
1939
+ get aggregatedColumns():Array<Column>;
1666
1940
  /**
1667
- * Optional parameter indicating if original column descriptions should be included. Defaults to true.
1941
+ * The columns that can be shown in this Tree Table.
1942
+ * @return {@link dh.Column} array
1668
1943
  */
1669
- includeDescriptions:boolean;
1670
-
1671
- constructor();
1672
- }
1673
-
1674
- /**
1675
- * Represents a non-viewport subscription to a table, and all data currently known to be present in the subscribed
1676
- * columns. This class handles incoming snapshots and deltas, and fires events to consumers to notify of data changes.
1677
- * <p>
1678
- * Unlike {@link dh.TableViewportSubscription}, the "original" table does not have a reference to this instance, only the
1679
- * "private" table instance does, since the original cannot modify the subscription, and the private instance must
1680
- * forward data to it.
1681
- * <p>
1682
- * Represents a subscription to the table on the server. Changes made to the table will not be reflected here - the
1683
- * subscription must be closed and a new one optioned to see those changes. The event model is slightly different from
1684
- * viewports to make it less expensive to compute for large tables.
1685
- */
1686
- export class TableSubscription implements HasEventHandling {
1687
- protected constructor();
1688
-
1689
- static createTableSubscription(options:SubscriptionOptions, existingTable:Table):TableSubscription;
1944
+ get columns():Array<Column>;
1690
1945
  /**
1691
- * Updates the subscription to use the given columns and update interval.
1692
- * @param columns - the new columns to subscribe to
1693
- * @param updateIntervalMs - the new update interval, or null/omit to use the default of one second
1946
+ * The current sort configuration of this Tree Table
1947
+ * @return {@link dh.Sort} array.
1694
1948
  */
1695
- changeSubscription(columns:Array<Column>, updateIntervalMs:number|undefined|null):void;
1949
+ get sort():Array<Sort>;
1696
1950
  /**
1697
- * Update the options for this viewport subscription. This cannot alter the update interval or preview options.
1698
- * @param options - the subscription options
1951
+ * The current list of custom columns added to this Tree Table.
1952
+ * @return {@link dh.CustomColumn} array
1699
1953
  */
1700
- update(options:SubscriptionOptions):void;
1701
- get columns():Array<Column>;
1954
+ get customColumns():Array<CustomColumn>;
1702
1955
  /**
1703
- * Stops the subscription on the server.
1956
+ * True if this table may receive updates from the server, including size changed events, updated events after
1957
+ * initial snapshot.
1958
+ * @return boolean
1704
1959
  */
1705
- close():void;
1960
+ get isRefreshing():boolean;
1706
1961
  /**
1707
1962
  * Listen for events on this object.
1708
1963
  * @param name - the name of the event to listen for
@@ -1724,123 +1979,31 @@ export namespace dh {
1724
1979
  }
1725
1980
 
1726
1981
  /**
1727
- * Deprecated for use in Deephaven Core.
1728
- * @deprecated
1729
- */
1730
- export class Client {
1731
- static readonly EVENT_REQUEST_FAILED:string;
1732
- static readonly EVENT_REQUEST_STARTED:string;
1733
- static readonly EVENT_REQUEST_SUCCEEDED:string;
1734
-
1735
- constructor();
1736
- }
1737
-
1738
- /**
1739
- * Configuration object for running Table.treeTable to produce a hierarchical view of a given "flat" table.
1740
- *
1741
- * Like TotalsTableConfig, `TreeTableConfig` supports an operation map indicating how to aggregate the data, as well as
1742
- * an array of column names which will be the layers in the roll-up tree, grouped at each level. An additional optional
1743
- * value can be provided describing the strategy the engine should use when grouping the rows.
1982
+ * Wrap BigInteger values for use in JS. Provides text formatting for display and access to the underlying value.
1744
1983
  */
1745
- export class TreeTableConfig {
1746
- /**
1747
- * The column representing the unique ID for each item
1748
- */
1749
- idColumn:string;
1750
- /**
1751
- * The column representing the parent ID for each item
1752
- */
1753
- parentColumn:string;
1754
- /**
1755
- * Optional parameter indicating if items with an invalid parent ID should be promoted to root. Defaults to false.
1756
- */
1757
- promoteOrphansToRoot:boolean;
1984
+ export class BigIntegerWrapper {
1985
+ protected constructor();
1758
1986
 
1759
- constructor();
1987
+ static ofString(str:string):BigIntegerWrapper;
1988
+ asNumber():number;
1989
+ valueOf():string;
1990
+ toString():string;
1991
+ equals(o:object):boolean;
1992
+ hashCode():number;
1760
1993
  }
1761
1994
 
1762
1995
  /**
1763
- * Describes how a Totals Table will be generated from its parent table. Each table has a default (which may be null)
1764
- * indicating how that table was configured when it was declared, and each Totals Table has a similar property
1765
- * describing how it was created. Both the <b>Table.getTotalsTable</b> and <b>Table.getGrandTotalsTable</b> methods take
1766
- * this config as an optional parameter - without it, the table's default will be used, or if null, a default instance
1767
- * of <b>TotalsTableConfig</b> will be supplied.
1768
- *
1769
- * This class has a no-arg constructor, allowing an instance to be made with the default values provided. However, any
1770
- * JS object can be passed in to the methods which accept instances of this type, provided their values adhere to the
1771
- * expected formats.
1996
+ * Wrap BigDecimal values for use in JS. Provides text formatting for display and access to the underlying value.
1772
1997
  */
1773
- export class TotalsTableConfig {
1774
- /**
1775
- * @deprecated
1776
- */
1777
- static readonly COUNT:string;
1778
- /**
1779
- * @deprecated
1780
- */
1781
- static readonly MIN:string;
1782
- /**
1783
- * @deprecated
1784
- */
1785
- static readonly MAX:string;
1786
- /**
1787
- * @deprecated
1788
- */
1789
- static readonly SUM:string;
1790
- /**
1791
- * @deprecated
1792
- */
1793
- static readonly ABS_SUM:string;
1794
- /**
1795
- * @deprecated
1796
- */
1797
- static readonly VAR:string;
1798
- /**
1799
- * @deprecated
1800
- */
1801
- static readonly AVG:string;
1802
- /**
1803
- * @deprecated
1804
- */
1805
- static readonly STD:string;
1806
- /**
1807
- * @deprecated
1808
- */
1809
- static readonly FIRST:string;
1810
- /**
1811
- * @deprecated
1812
- */
1813
- static readonly LAST:string;
1814
- /**
1815
- * @deprecated
1816
- */
1817
- static readonly SKIP:string;
1818
- /**
1819
- * Specifies if a Totals Table should be expanded by default in the UI. Defaults to false.
1820
- */
1821
- showTotalsByDefault:boolean;
1822
- /**
1823
- * Specifies if a Grand Totals Table should be expanded by default in the UI. Defaults to false.
1824
- */
1825
- showGrandTotalsByDefault:boolean;
1826
- /**
1827
- * Specifies the default operation for columns that do not have a specific operation applied; defaults to "Sum".
1828
- */
1829
- defaultOperation:AggregationOperationType;
1830
- /**
1831
- * Mapping from each column name to the aggregation(s) that should be applied to that column in the resulting Totals
1832
- * Table. If a column is omitted, the defaultOperation is used.
1833
- */
1834
- operationMap:{ [key: string]: Array<AggregationOperationType>; };
1835
- /**
1836
- * Groupings to use when generating the Totals Table. One row will exist for each unique set of values observed in
1837
- * these columns. See also `Table.selectDistinct`.
1838
- */
1839
- groupBy:Array<string>;
1840
-
1841
- constructor();
1998
+ export class BigDecimalWrapper {
1999
+ protected constructor();
1842
2000
 
2001
+ static ofString(value:string):BigDecimalWrapper;
2002
+ asNumber():number;
2003
+ valueOf():string;
1843
2004
  toString():string;
2005
+ equals(o:object):boolean;
2006
+ hashCode():number;
1844
2007
  }
1845
2008
 
1846
2009
  /**
@@ -2230,538 +2393,365 @@ export namespace dh {
2230
2393
  }
2231
2394
 
2232
2395
  /**
2233
- * Wrap BigInteger values for use in JS. Provides text formatting for display and access to the underlying value.
2396
+ * Deprecated for use in Deephaven Core.
2397
+ * @deprecated
2234
2398
  */
2235
- export class BigIntegerWrapper {
2236
- protected constructor();
2399
+ export class Client {
2400
+ static readonly EVENT_REQUEST_FAILED:string;
2401
+ static readonly EVENT_REQUEST_STARTED:string;
2402
+ static readonly EVENT_REQUEST_SUCCEEDED:string;
2237
2403
 
2238
- static ofString(str:string):BigIntegerWrapper;
2239
- asNumber():number;
2240
- valueOf():string;
2241
- toString():string;
2242
- equals(o:object):boolean;
2243
- hashCode():number;
2404
+ constructor();
2244
2405
  }
2245
2406
 
2246
2407
  /**
2247
- * Options for custom columns.
2408
+ * Configuration object for running Table.treeTable to produce a hierarchical view of a given "flat" table.
2409
+ *
2410
+ * Like TotalsTableConfig, `TreeTableConfig` supports an operation map indicating how to aggregate the data, as well as
2411
+ * an array of column names which will be the layers in the roll-up tree, grouped at each level. An additional optional
2412
+ * value can be provided describing the strategy the engine should use when grouping the rows.
2248
2413
  */
2249
- export class CustomColumnOptions {
2414
+ export class TreeTableConfig {
2250
2415
  /**
2251
- * When specified for custom columns on a rollup table, specifies if the formula apply to rollup or constituent
2252
- * nodes.
2416
+ * The column representing the unique ID for each item
2253
2417
  */
2254
- rollupNodeType?:RollupNodeTypeType|null;
2418
+ idColumn:string;
2419
+ /**
2420
+ * The column representing the parent ID for each item
2421
+ */
2422
+ parentColumn:string;
2423
+ /**
2424
+ * Optional parameter indicating if items with an invalid parent ID should be promoted to root. Defaults to false.
2425
+ */
2426
+ promoteOrphansToRoot:boolean;
2255
2427
 
2256
2428
  constructor();
2257
2429
  }
2258
2430
 
2259
2431
  /**
2260
- * Behaves like a {@link dh.Table} externally, but data, state, and viewports are managed by an entirely different
2261
- * mechanism, and so reimplemented here.
2262
- * <p>
2263
- * Any time a change is made, we build a new request and send it to the server, and wait for the updated state.
2264
- * <p>
2265
- * Semantics around getting updates from the server are slightly different - we don't "unset" the viewport here after
2266
- * operations are performed, but encourage the client code to re-set them to the desired position.
2432
+ * A Widget represents a server side object that sends one or more responses to the client. The client can then
2433
+ * interpret these responses to see what to render, or how to respond.
2267
2434
  * <p>
2268
- * The table size will be -1 until a viewport has been fetched.
2435
+ * Most custom object types result in a single response being sent to the client, often with other exported objects, but
2436
+ * some will have streamed responses, and allow the client to send follow-up requests of its own. This class's API is
2437
+ * backwards compatible, but as such does not offer a way to tell the difference between a streaming or non-streaming
2438
+ * object type, the client code that handles the payloads is expected to know what to expect. See
2439
+ * {@link dh.WidgetMessageDetails} for more information.
2269
2440
  * <p>
2270
- * Similar to a table, a Tree Table provides access to subscribed viewport data on the current hierarchy. A different
2271
- * Row type is used within that viewport, showing the depth of that node within the tree and indicating details about
2272
- * whether it has children or is expanded. The Tree Table itself then provides the ability to change if a row is
2273
- * expanded or not. Methods used to control or check if a row should be expanded or not can be invoked on a TreeRow
2274
- * instance, or on the number of the row (thus allowing for expanding/collapsing rows which are not currently visible in
2275
- * the viewport).
2441
+ * When the promise that returns this object resolves, it will have the first response assigned to its fields. Later
2442
+ * responses from the server will be emitted as "message" events. When the connection with the server ends, the "close"
2443
+ * event will be emitted. In this way, the connection will behave roughly in the same way as a WebSocket - either side
2444
+ * can close, and after close no more messages will be processed. There can be some latency in closing locally while
2445
+ * remote messages are still pending - it is up to implementations of plugins to handle this case.
2276
2446
  * <p>
2277
- * Events and viewports are somewhat different from tables, due to the expense of computing the expanded/collapsed rows
2278
- * and count of children at each level of the hierarchy, and differences in the data that is available.
2447
+ * Also like WebSockets, the plugin API doesn't define how to serialize messages, and just handles any binary payloads.
2448
+ * What it does handle however, is allowing those messages to include references to server-side objects with those
2449
+ * payloads. Those server side objects might be tables or other built-in types in the Deephaven JS API, or could be
2450
+ * objects usable through their own plugins. They also might have no plugin at all, allowing the client to hold a
2451
+ * reference to them and pass them back to the server, either to the current plugin instance, or through another API.
2452
+ * The `Widget` type does not specify how those objects should be used or their lifecycle, but leaves that
2453
+ * entirely to the plugin. Messages will arrive in the order they were sent.
2279
2454
  * <p>
2280
- * <ul>
2281
- * <li>There is no {@link Table.totalSize | totalSize} property.</li>
2282
- * <li>The viewport is not un-set when changes are made to filter or sort, but changes will continue to be streamed in.
2283
- * It is suggested that the viewport be changed to the desired position (usually the first N rows) after any filter/sort
2284
- * change is made. Likewise, {@link getViewportData} will always return the most recent data, and will not wait if a
2285
- * new operation is pending.</li>
2286
- * <li>Custom columns are supported on Rollup tables, but not on Tree tables. If the TreeTable was created client-side,
2287
- * the original Table can have custom columns applied, and the TreeTable can be recreated.</li>
2288
- * <li>Whereas Table has a {@link Table.totalsTableConfig} property, it is defined here as a method,
2289
- * {@link getTotalsTableConfig}. This returns a promise so the config can be fetched asynchronously.</li>
2290
- * <li>Totals Tables for trees vary in behavior between tree tables and roll-up tables. This behavior is based on the
2291
- * original flat table used to produce the Tree Table - for a hierarchical table (i.e. Table.treeTable in the query
2292
- * config), the totals will include non-leaf nodes (since they are themselves actual rows in the table), but in a
2293
- * roll-up table, the totals only include leaf nodes (as non-leaf nodes are generated through grouping the contents of
2294
- * the original table). Roll-ups also have the {@link dh.includeConstituents} property, indicating that a
2295
- * {@link dh.Column} in the tree may have a {@link Column.constituentType} property reflecting that the type of cells
2296
- * where {@link TreeRowImpl.hasChildren} is false will be different from usual.</li>
2297
- * </ul>
2298
- */
2299
- export class TreeTable implements HasEventHandling {
2300
- /**
2301
- * event.detail is the currently visible viewport data based on the active viewport configuration.
2302
- */
2303
- static readonly EVENT_UPDATED:string;
2304
- /**
2305
- * event.detail is the currently visible viewport data based on the active viewport configuration.
2306
- */
2307
- static readonly EVENT_DISCONNECT:string;
2308
- /**
2309
- * event.detail is the currently visible viewport data based on the active viewport configuration.
2310
- */
2311
- static readonly EVENT_RECONNECT:string;
2312
- /**
2313
- * event.detail is the currently visible viewport data based on the active viewport configuration.
2314
- */
2315
- static readonly EVENT_RECONNECTFAILED:string;
2316
- /**
2317
- * event.detail is the currently visible viewport data based on the active viewport configuration.
2318
- */
2319
- static readonly EVENT_REQUEST_FAILED:string;
2320
- readonly description?:string|null;
2321
- readonly layoutHints?:null|LayoutHints;
2322
-
2323
- protected constructor();
2324
-
2325
- /**
2326
- * Expands the given node, so that its children are visible when they are in the viewport. The parameter can be the
2327
- * row index, or the row object itself. The second parameter is a boolean value, false by default, specifying if the
2328
- * row and all descendants should be fully expanded. Equivalent to `setExpanded(row, true)` with an optional third
2329
- * boolean parameter.
2330
- * @param row -
2331
- * @param expandDescendants -
2332
- */
2333
- expand(row:TreeRow|number, expandDescendants?:boolean):void;
2334
- /**
2335
- * Collapses the given node, so that its children and descendants are not visible in the size or the viewport. The
2336
- * parameter can be the row index, or the row object itself. Equivalent to <b>setExpanded(row, false, false)</b>.
2337
- * @param row -
2338
- */
2339
- collapse(row:TreeRow|number):void;
2340
- /**
2341
- * Specifies if the given node should be expanded or collapsed. If this node has children, and the value is changed,
2342
- * the size of the table will change. If node is to be expanded and the third parameter, <b>expandDescendants</b>,
2343
- * is true, then its children will also be expanded.
2344
- * @param row - the row to expand or collapse, either the absolute row index or the row object
2345
- * @param isExpanded - true to expand the row, false to collapse
2346
- * @param expandDescendants - true to expand the row and all descendants, false to expand only the row, defaults to
2347
- * false
2348
- */
2349
- setExpanded(row:TreeRow|number, isExpanded:boolean, expandDescendants?:boolean):void;
2350
- expandAll():void;
2351
- collapseAll():void;
2352
- /**
2353
- * Tests if the specified row is expanded.
2354
- * @param row - the row to test, either the absolute row index or the row object
2355
- * @return boolean true if the row is expanded, false otherwise
2356
- */
2357
- isExpanded(row:TreeRow|number):boolean;
2358
- setViewport(firstRow:number, lastRow:number, columns?:Array<Column>|undefined|null, updateInterval?:number|undefined|null):void;
2359
- getViewportData():Promise<TreeViewportData>;
2360
- /**
2361
- * Indicates that the table will no longer be used, and server resources can be freed.
2362
- */
2363
- close():void;
2364
- /**
2365
- * Applies the given sort to all levels of the tree. Returns the previous sort in use.
2366
- * @param sort -
2367
- * @return {@link dh.Sort} array
2368
- */
2369
- applySort(sort:Sort[]):Array<Sort>;
2370
- /**
2371
- * Applies the given filter to the contents of the tree in such a way that if any node is visible, then any parent
2372
- * node will be visible as well even if that parent node would not normally be visible due to the filter's
2373
- * condition. Returns the previous sort in use.
2374
- * @param filter -
2375
- * @return {@link dh.FilterCondition} array
2376
- */
2377
- applyFilter(filter:FilterCondition[]):Array<FilterCondition>;
2378
- /**
2379
- * Adding new columns to the table based on other columns using updateView() mechanics. Rollup tables are supported
2380
- * but Tree tables will throw an {@link java.lang.UnsupportedOperationException} if this function is called.
2381
- * @param customColumns -
2382
- * @return {@link dh.CustomColumn} array
2383
- */
2384
- applyCustomColumns(customColumns:Array<string|CustomColumn>):Array<CustomColumn>;
2385
- /**
2386
- * a column with the given name, or throws an exception if it cannot be found
2387
- * @param key -
2388
- * @return {@link dh.Column}
2389
- */
2390
- findColumn(key:string):Column;
2391
- /**
2392
- * an array with all of the named columns in order, or throws an exception if one cannot be found.
2393
- * @param keys -
2394
- * @return {@link dh.Column} array
2395
- */
2396
- findColumns(keys:string[]):Column[];
2397
- /**
2398
- * Provides Table-like selectDistinct functionality, but with a few quirks, since it is only fetching the distinct
2399
- * values for the given columns in the source table:
2400
- * <ul>
2401
- * <li>Rollups may make no sense, since values are aggregated.</li>
2402
- * <li>Values found on orphaned (and removed) nodes will show up in the resulting table, even though they are not in
2403
- * the tree.</li>
2404
- * <li>Values found on parent nodes which are only present in the tree since a child is visible will not be present
2405
- * in the resulting table.</li>
2406
- * </ul>
2407
- */
2408
- selectDistinct(columns:Column[]):Promise<Table>;
2409
- getTotalsTableConfig():Promise<TotalsTableConfig>;
2410
- getTotalsTable(config?:object):Promise<TotalsTable>;
2411
- getGrandTotalsTable(config?:object):Promise<TotalsTable>;
2412
- /**
2413
- * a new copy of this treetable, so it can be sorted and filtered separately, and maintain a different viewport.
2414
- * Unlike Table, this will _not_ copy the filter or sort, since tree table viewport semantics differ, and without a
2415
- * viewport set, the treetable doesn't evaluate these settings, and they aren't readable on the properties. Expanded
2416
- * state is also not copied.
2417
- * @return Promise of dh.TreeTable
2418
- */
2419
- copy():Promise<TreeTable>;
2420
- /**
2421
- * The current filter configuration of this Tree Table.
2422
- * @return {@link dh.FilterCondition} array
2423
- */
2424
- get filter():Array<FilterCondition>;
2425
- /**
2426
- * True if this is a roll-up and will provide the original rows that make up each grouping.
2427
- * @return boolean
2428
- */
2429
- get includeConstituents():boolean;
2430
- get groupedColumns():Array<Column>;
2431
- /**
2432
- * True if this table has been closed.
2433
- * @return boolean
2434
- */
2435
- get isClosed():boolean;
2436
- /**
2437
- * The current number of rows given the table's contents and the various expand/collapse states of each node. (No
2438
- * totalSize is provided at this time; its definition becomes unclear between roll-up and tree tables, especially
2439
- * when considering collapse/expand states).
2440
- * @return double
2441
- */
2442
- get size():number;
2443
- /**
2444
- * Returns the columns that are aggregated.
2445
- * @return array of aggregated columns
2446
- */
2447
- get aggregatedColumns():Array<Column>;
2448
- /**
2449
- * The columns that can be shown in this Tree Table.
2450
- * @return {@link dh.Column} array
2451
- */
2452
- get columns():Array<Column>;
2453
- /**
2454
- * The current sort configuration of this Tree Table
2455
- * @return {@link dh.Sort} array.
2456
- */
2457
- get sort():Array<Sort>;
2458
- /**
2459
- * The current list of custom columns added to this Tree Table.
2460
- * @return {@link dh.CustomColumn} array
2461
- */
2462
- get customColumns():Array<CustomColumn>;
2455
+ * This can suggest several patterns for how plugins operate:
2456
+ * <ul>
2457
+ * <li>The plugin merely exists to transport some other object to the client. This can be useful for objects which can
2458
+ * easily be translated to some other type (like a Table) when the user clicks on it. An example of this is
2459
+ * `pandas.DataFrame` will result in a widget that only contains a static
2460
+ * {@link dh.Table}. Presently, the widget is immediately closed, and only the Table is
2461
+ * provided to the JS API consumer.</li>
2462
+ * <li>The plugin provides references to Tables and other objects, and those objects can live longer than the object
2463
+ * which provided them. One concrete example of this could have been
2464
+ * {@link dh.PartitionedTable} when fetching constituent tables, but it was implemented
2465
+ * before bidirectional plugins were implemented. Another example of this is plugins that serve as a "factory", giving
2466
+ * the user access to table manipulation/creation methods not supported by gRPC or the JS API.</li>
2467
+ * <li>The plugin provides reference to Tables and other objects that only make sense within the context of the widget
2468
+ * instance, so when the widget goes away, those objects should be released as well. This is also an example of
2469
+ * {@link dh.PartitionedTable}, as the partitioned table tracks creation of new keys through
2470
+ * an internal table instance.</li>
2471
+ * </ul>
2472
+ *
2473
+ * Handling server objects in messages also has more than one potential pattern that can be used:
2474
+ * <ul>
2475
+ * <li>One object per message - the message clearly is about that object, no other details required.</li>
2476
+ * <li>Objects indexed within their message - as each message comes with a list of objects, those objects can be
2477
+ * referenced within the payload by index. This is roughly how {@link dh.plot.Figure}
2478
+ * behaves, where the figure descriptor schema includes an index for each created series, describing which table should
2479
+ * be used, which columns should be mapped to each axis.</li>
2480
+ * <li>Objects indexed since widget creation - each message would append its objects to a list created when the widget
2481
+ * was first made, and any new exports that arrive in a new message would be appended to that list. Then, subsequent
2482
+ * messages can reference objects already sent. This imposes a limitation where the client cannot release any exports
2483
+ * without the server somehow signaling that it will never reference that export again.</li>
2484
+ * </ul>
2485
+ */
2486
+ export class Widget implements WidgetMessageDetails, HasEventHandling {
2487
+ static readonly EVENT_MESSAGE:string;
2488
+ static readonly EVENT_CLOSE:string;
2489
+
2490
+ protected constructor();
2491
+
2463
2492
  /**
2464
- * True if this table may receive updates from the server, including size changed events, updated events after
2465
- * initial snapshot.
2466
- * @return boolean
2493
+ * Ends the client connection to the server.
2467
2494
  */
2468
- get isRefreshing():boolean;
2495
+ close():void;
2496
+ getDataAsBase64():string;
2497
+ getDataAsU8():Uint8Array;
2498
+ getDataAsString():string;
2469
2499
  /**
2470
- * Listen for events on this object.
2471
- * @param name - the name of the event to listen for
2472
- * @param callback - a function to call when the event occurs
2473
- * @return Returns a cleanup function.
2474
- * @typeParam T - the type of the data that the event will provide
2500
+ * Sends a string/bytes payload to the server, along with references to objects that exist on the server.
2501
+ * @param msg - string/buffer/view instance that represents data to send
2502
+ * @param references - an array of objects that can be safely sent to the server
2475
2503
  */
2504
+ sendMessage(msg:string|ArrayBuffer|ArrayBufferView, references?:Array<Table|Widget|WidgetExportedObject|PartitionedTable|TotalsTable|TreeTable>):void;
2476
2505
  addEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):()=>void;
2477
2506
  nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<Event<T>>;
2478
2507
  hasListeners(name:string):boolean;
2508
+ removeEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):boolean;
2479
2509
  /**
2480
- * Removes an event listener added to this table.
2481
- * @param name -
2482
- * @param callback -
2483
- * @return
2484
- * @typeParam T -
2510
+ *
2511
+ * @return the exported objects sent in the initial message from the server. The client is responsible for closing
2512
+ * them when finished using them.
2485
2513
  */
2486
- removeEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):boolean;
2514
+ get exportedObjects():WidgetExportedObject[];
2515
+ /**
2516
+ *
2517
+ * @return the type of this widget
2518
+ */
2519
+ get type():string;
2520
+ }
2521
+
2522
+ export class DateWrapper extends LongWrapper {
2523
+ protected constructor();
2524
+
2525
+ static ofJsDate(date:Date):DateWrapper;
2526
+ asDate():Date;
2487
2527
  }
2488
2528
 
2489
2529
  /**
2490
- * Describes the structure of the column, and if desired can be used to get access to the data to be rendered in this
2491
- * column.
2530
+ * Exists to keep the dh.TableMap namespace so that the web UI can remain compatible with the DHE API, which still calls
2531
+ * this type TableMap.
2532
+ * @deprecated
2492
2533
  */
2493
- export class Column {
2494
- /**
2495
- * If this column is part of a roll-up tree table, represents the type of the row data that can be found in this
2496
- * column for leaf nodes if includeConstituents is enabled. Otherwise, it is <b>null</b>.
2497
- * @return String
2498
- */
2499
- readonly constituentType?:string|null;
2500
- readonly description?:string|null;
2534
+ export class TableMap {
2535
+ static readonly EVENT_KEYADDED:string;
2536
+ static readonly EVENT_DISCONNECT:string;
2537
+ static readonly EVENT_RECONNECT:string;
2538
+ static readonly EVENT_RECONNECTFAILED:string;
2501
2539
 
2502
2540
  protected constructor();
2541
+ }
2503
2542
 
2543
+ /**
2544
+ * Represents a set of Tables each corresponding to some key. The keys are available locally, but a call must be made to
2545
+ * the server to get each Table. All tables will have the same structure.
2546
+ */
2547
+ export class PartitionedTable implements HasEventHandling {
2504
2548
  /**
2505
- * the value for this column in the given row. Type will be consistent with the type of the Column.
2506
- * @param row -
2507
- * @return Any
2508
- */
2509
- get(row:Row):any;
2510
- getFormat(row:Row):Format;
2511
- /**
2512
- * Creates a sort builder object, to be used when sorting by this column.
2513
- * @return {@link dh.Sort}
2514
- */
2515
- sort():Sort;
2516
- /**
2517
- * Creates a new value for use in filters based on this column. Used either as a parameter to another filter
2518
- * operation, or as a builder to create a filter operation.
2519
- * @return {@link dh.FilterValue}
2520
- */
2521
- filter():FilterValue;
2522
- /**
2523
- * a <b>CustomColumn</b> object to apply using `applyCustomColumns` with the expression specified.
2524
- * @param expression -
2525
- * @return {@link dh.CustomColumn}
2526
- */
2527
- formatColor(expression:string, options?:CustomColumnOptions|undefined|null):CustomColumn;
2528
- /**
2529
- * a <b>CustomColumn</b> object to apply using <b>applyCustomColumns</b> with the expression specified.
2530
- * @param expression -
2531
- * @return {@link dh.CustomColumn}
2532
- */
2533
- formatNumber(expression:string, options?:CustomColumnOptions|undefined|null):CustomColumn;
2534
- /**
2535
- * a <b>CustomColumn</b> object to apply using <b>applyCustomColumns</b> with the expression specified.
2536
- * @param expression -
2537
- * @return {@link dh.CustomColumn}
2538
- */
2539
- formatDate(expression:string, options?:CustomColumnOptions|undefined|null):CustomColumn;
2540
- toString():string;
2541
- /**
2542
- * Label for this column.
2543
- * @return String
2544
- */
2545
- get name():string;
2546
- /**
2547
- * True if this column is a partition column. Partition columns are used for filtering uncoalesced tables - see
2548
- * {@link Table.uncoalesced}.
2549
- * @return true if the column is a partition column
2550
- */
2551
- get isPartitionColumn():boolean;
2552
- /**
2553
- *
2554
- * @deprecated do not use. Internal index of the column in the table, to be used as a key on the Row.
2555
- * @return int
2549
+ * Indicates that a new key has been added to the array of keys, which can now be fetched with getTable.
2556
2550
  */
2557
- get index():number;
2558
- get isSortable():boolean;
2551
+ static readonly EVENT_KEYADDED:string;
2559
2552
  /**
2560
- * Type of the row data that can be found in this column.
2561
- * @return String
2553
+ * Indicates that a new key has been added to the array of keys, which can now be fetched with getTable.
2562
2554
  */
2563
- get type():string;
2555
+ static readonly EVENT_DISCONNECT:string;
2564
2556
  /**
2565
- * Format entire rows colors using the expression specified. Returns a <b>CustomColumn</b> object to apply to a
2566
- * table using <b>applyCustomColumns</b> with the parameters specified.
2567
- * @param expression -
2568
- * @param options -
2569
- * @return {@link dh.CustomColumn}
2557
+ * Indicates that a new key has been added to the array of keys, which can now be fetched with getTable.
2570
2558
  */
2571
- static formatRowColor(expression:string, options?:CustomColumnOptions|undefined|null):CustomColumn;
2559
+ static readonly EVENT_RECONNECT:string;
2572
2560
  /**
2573
- * a <b>CustomColumn</b> object to apply using <b>applyCustomColumns</b> with the expression specified.
2574
- * @param name -
2575
- * @param expression -
2576
- * @param options -
2577
- * @return {@link dh.CustomColumn}
2561
+ * Indicates that a new key has been added to the array of keys, which can now be fetched with getTable.
2578
2562
  */
2579
- static createCustomColumn(name:string, expression:string, options?:CustomColumnOptions|undefined|null):CustomColumn;
2580
- }
2563
+ static readonly EVENT_RECONNECTFAILED:string;
2581
2564
 
2582
- /**
2583
- * Describes data that can be filtered, either a column reference or a literal value. Used this way, the type of a value
2584
- * can be specified so that values which are ambiguous or not well supported in JS will not be confused with Strings or
2585
- * imprecise numbers (e.g., nanosecond-precision date values). Additionally, once wrapped in this way, methods can be
2586
- * called on these value literal instances. These instances are immutable - any method called on them returns a new
2587
- * instance.
2588
- */
2589
- export class FilterValue {
2590
2565
  protected constructor();
2591
2566
 
2592
2567
  /**
2593
- * Constructs a number for the filter API from the given parameter. Can also be used on the values returned from
2594
- * {@link TableData.get} for DateTime values. To create
2595
- * a filter with a date, use <b>dh.DateWrapper.ofJsDate</b> or
2596
- * {@link i18n.DateTimeFormat.parse}. To create a filter with a
2597
- * 64-bit long integer, use {@link LongWrapper.ofString}.
2598
- * @param input - the number to wrap as a FilterValue
2599
- * @return an immutable FilterValue that can be built into a filter
2600
- */
2601
- static ofNumber(input:LongWrapper|number):FilterValue;
2602
- /**
2603
- * a filter condition checking if the current value is equal to the given parameter
2604
- * @param term -
2605
- * @return {@link dh.FilterCondition}
2568
+ * Fetch the table with the given key. If the key does not exist, returns `null`.
2569
+ * @param key - The key to fetch. An array of values for each key column, in the same order as the key columns are.
2570
+ * @return Promise of dh.Table, or `null` if the key does not exist.
2606
2571
  */
2607
- eq(term:FilterValue):FilterCondition;
2572
+ getTable(key:object):Promise<Table|undefined|null>;
2608
2573
  /**
2609
- * a filter condition checking if the current value is equal to the given parameter, ignoring differences of upper
2610
- * vs lower case
2611
- * @param term -
2612
- * @return {@link dh.FilterCondition}
2574
+ * Open a new table that is the result of merging all constituent tables. See
2575
+ * {@link io.deephaven.engine.table.PartitionedTable.merge} for details.
2576
+ * @return A merged representation of the constituent tables.
2613
2577
  */
2614
- eqIgnoreCase(term:FilterValue):FilterCondition;
2578
+ getMergedTable():Promise<Table>;
2615
2579
  /**
2616
- * a filter condition checking if the current value is not equal to the given parameter
2617
- * @param term -
2618
- * @return {@link dh.FilterCondition}
2580
+ * The set of all currently known keys. This is kept up to date, so getting the list after adding an event listener
2581
+ * for <b>keyadded</b> will ensure no keys are missed.
2582
+ * @return Set of Object
2619
2583
  */
2620
- notEq(term:FilterValue):FilterCondition;
2584
+ getKeys():Set<object>;
2621
2585
  /**
2622
- * a filter condition checking if the current value is not equal to the given parameter, ignoring differences of
2623
- * upper vs lower case
2624
- * @param term -
2625
- * @return {@link dh.FilterCondition}
2586
+ * Fetch a table containing all the valid keys of the partitioned table.
2587
+ * @return Promise of a Table
2588
+ * @deprecated
2626
2589
  */
2627
- notEqIgnoreCase(term:FilterValue):FilterCondition;
2590
+ getKeyTable():Promise<Table>;
2628
2591
  /**
2629
- * a filter condition checking if the current value is greater than the given parameter
2630
- * @param term -
2631
- * @return {@link dh.FilterCondition}
2592
+ * Fetch the underlying base table of the partitioned table.
2593
+ * @return Promise of a Table
2632
2594
  */
2633
- greaterThan(term:FilterValue):FilterCondition;
2595
+ getBaseTable():Promise<Table>;
2634
2596
  /**
2635
- * a filter condition checking if the current value is less than the given parameter
2636
- * @param term -
2637
- * @return {@link dh.FilterCondition}
2597
+ * Indicates that this PartitionedTable will no longer be used, removing subcriptions to updated keys, etc. This
2598
+ * will not affect tables in use.
2638
2599
  */
2639
- lessThan(term:FilterValue):FilterCondition;
2600
+ close():void;
2640
2601
  /**
2641
- * a filter condition checking if the current value is greater than or equal to the given parameter
2642
- * @param term -
2643
- * @return {@link dh.FilterCondition}
2602
+ * The count of known keys.
2603
+ * @return int
2644
2604
  */
2645
- greaterThanOrEqualTo(term:FilterValue):FilterCondition;
2605
+ get size():number;
2646
2606
  /**
2647
- * a filter condition checking if the current value is less than or equal to the given parameter
2648
- * @param term -
2649
- * @return {@link dh.FilterCondition}
2607
+ * An array of the columns in the tables that can be retrieved from this partitioned table, including both key and
2608
+ * non-key columns.
2609
+ * @return Array of Column
2650
2610
  */
2651
- lessThanOrEqualTo(term:FilterValue):FilterCondition;
2611
+ get columns():Column[];
2652
2612
  /**
2653
- * a filter condition checking if the current value is in the given set of values
2654
- * @param terms -
2655
- * @return {@link dh.FilterCondition}
2613
+ * An array of all the key columns that the tables are partitioned by.
2614
+ * @return Array of Column
2656
2615
  */
2657
- in(terms:FilterValue[]):FilterCondition;
2616
+ get keyColumns():Column[];
2658
2617
  /**
2659
- * a filter condition checking if the current value is in the given set of values, ignoring differences of upper vs
2660
- * lower case
2661
- * @param terms -
2662
- * @return {@link dh.FilterCondition}
2618
+ * Listen for events on this object.
2619
+ * @param name - the name of the event to listen for
2620
+ * @param callback - a function to call when the event occurs
2621
+ * @return Returns a cleanup function.
2622
+ * @typeParam T - the type of the data that the event will provide
2663
2623
  */
2664
- inIgnoreCase(terms:FilterValue[]):FilterCondition;
2624
+ addEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):()=>void;
2625
+ nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<Event<T>>;
2626
+ hasListeners(name:string):boolean;
2665
2627
  /**
2666
- * a filter condition checking that the current value is not in the given set of values
2667
- * @param terms -
2668
- * @return {@link dh.FilterCondition}
2628
+ * Removes an event listener added to this table.
2629
+ * @param name -
2630
+ * @param callback -
2631
+ * @return
2632
+ * @typeParam T -
2669
2633
  */
2670
- notIn(terms:FilterValue[]):FilterCondition;
2634
+ removeEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):boolean;
2635
+ }
2636
+
2637
+ export class QueryInfo {
2638
+ static readonly EVENT_TABLE_OPENED:string;
2639
+ static readonly EVENT_DISCONNECT:string;
2640
+ static readonly EVENT_RECONNECT:string;
2641
+ static readonly EVENT_CONNECT:string;
2642
+
2643
+ protected constructor();
2644
+ }
2645
+
2646
+ /**
2647
+ * A js type for operating on input tables.
2648
+ *
2649
+ * Represents a User Input Table, which can have data added to it from other sources.
2650
+ *
2651
+ * You may add rows using dictionaries of key-value tuples (representing columns by name), add tables containing all the
2652
+ * key/value columns to add, or delete tables containing the keys to delete. Each operation is atomic, and will either
2653
+ * succeed completely or fail completely. To guarantee order of operations, apply an operation and wait for the response
2654
+ * before sending the next operation.
2655
+ *
2656
+ * Each table has one or more key columns, where each unique combination of keys will appear at most once in the table.
2657
+ *
2658
+ * To view the results of the Input Table, you should use standard table operations on the InputTable's source Table
2659
+ * object.
2660
+ */
2661
+ export class InputTable {
2662
+ protected constructor();
2663
+
2671
2664
  /**
2672
- * a filter condition checking that the current value is not in the given set of values, ignoring differences of
2673
- * upper vs lower case
2674
- * @param terms -
2675
- * @return {@link dh.FilterCondition}
2665
+ * Adds a single row to the table. For each key or value column name in the Input Table, we retrieve that javascript
2666
+ * property at that name and validate it can be put into the given column type.
2667
+ * @param row -
2668
+ * @param userTimeZone -
2669
+ * @return Promise of dh.InputTable
2676
2670
  */
2677
- notInIgnoreCase(terms:FilterValue[]):FilterCondition;
2671
+ addRow(row:{ [key: string]: any; }, userTimeZone?:string):Promise<InputTable>;
2678
2672
  /**
2679
- * a filter condition checking if the given value contains the given string value
2680
- * @param term -
2681
- * @return {@link dh.FilterCondition}
2673
+ * Add multiple rows to a table.
2674
+ * @param rows -
2675
+ * @param userTimeZone -
2676
+ * @return Promise of dh.InputTable
2682
2677
  */
2683
- contains(term:FilterValue):FilterCondition;
2678
+ addRows(rows:{ [key: string]: any; }[], userTimeZone?:string):Promise<InputTable>;
2684
2679
  /**
2685
- * a filter condition checking if the given value contains the given string value, ignoring differences of upper vs
2686
- * lower case
2687
- * @param term -
2688
- * @return {@link dh.FilterCondition}
2680
+ * Add an entire table to this Input Table. Only column names that match the definition of the input table will be
2681
+ * copied, and all key columns must have values filled in. This only copies the current state of the source table;
2682
+ * future updates to the source table will not be reflected in the Input Table. The returned promise will be
2683
+ * resolved to the same InputTable instance this method was called upon once the server returns.
2684
+ * @param tableToAdd -
2685
+ * @return Promise of dh.InputTable
2689
2686
  */
2690
- containsIgnoreCase(term:FilterValue):FilterCondition;
2687
+ addTable(tableToAdd:Table):Promise<InputTable>;
2691
2688
  /**
2692
- * a filter condition checking if the given value matches the provided regular expressions string. Regex patterns
2693
- * use Java regex syntax
2694
- * @param pattern -
2695
- * @return {@link dh.FilterCondition}
2689
+ * Add multiple tables to this Input Table.
2690
+ * @param tablesToAdd -
2691
+ * @return Promise of dh.InputTable
2696
2692
  */
2697
- matches(pattern:FilterValue):FilterCondition;
2693
+ addTables(tablesToAdd:Table[]):Promise<InputTable>;
2698
2694
  /**
2699
- * a filter condition checking if the given value matches the provided regular expressions string, ignoring
2700
- * differences of upper vs lower case. Regex patterns use Java regex syntax
2701
- * @param pattern -
2702
- * @return {@link dh.FilterCondition}
2695
+ * Deletes an entire table from this Input Table. Key columns must match the Input Table.
2696
+ * @param tableToDelete -
2697
+ * @return Promise of dh.InputTable
2703
2698
  */
2704
- matchesIgnoreCase(pattern:FilterValue):FilterCondition;
2699
+ deleteTable(tableToDelete:Table):Promise<InputTable>;
2705
2700
  /**
2706
- * a filter condition checking if the current value is a true boolean
2707
- * @return {@link dh.FilterCondition}
2701
+ * Delete multiple tables from this Input Table.
2702
+ * @param tablesToDelete -
2703
+ * @return
2708
2704
  */
2709
- isTrue():FilterCondition;
2705
+ deleteTables(tablesToDelete:Table[]):Promise<InputTable>;
2710
2706
  /**
2711
- * a filter condition checking if the current value is a false boolean
2712
- * @return {@link dh.FilterCondition}
2707
+ * A list of the key columns, by name
2708
+ * @return String array.
2713
2709
  */
2714
- isFalse():FilterCondition;
2710
+ get keys():string[];
2715
2711
  /**
2716
- * a filter condition checking if the current value is a null value
2717
- * @return {@link dh.FilterCondition}
2712
+ * A list of the value columns, by name
2713
+ * @return String array.
2718
2714
  */
2719
- isNull():FilterCondition;
2715
+ get values():string[];
2720
2716
  /**
2721
- * a filter condition invoking the given method on the current value, with the given parameters. Currently supported
2722
- * functions that can be invoked on a String:
2723
- * <ul>
2724
- * <li><b>startsWith</b>: Returns true if the current string value starts with the supplied string argument</li>
2725
- * <li><b>endsWith</b>: Returns true if the current string value ends with the supplied string argument</li>
2726
- * <li><b>matches</b>: Returns true if the current string value matches the supplied string argument used as a Java
2727
- * regular expression</li>
2728
- * <li><b>contains</b>: Returns true if the current string value contains the supplied string argument
2729
- * <p>
2730
- * When invoking against a constant, this should be avoided in favor of FilterValue.contains
2731
- * </p>
2732
- * </li>
2733
- * </ul>
2734
- * @param method -
2735
- * @param args -
2736
- * @return
2717
+ * A list of the key columns.
2718
+ * @return Column array.
2737
2719
  */
2738
- invoke(method:string, ...args:FilterValue[]):FilterCondition;
2739
- toString():string;
2720
+ get keyColumns():Column[];
2740
2721
  /**
2741
- * Constructs a string for the filter API from the given parameter.
2742
- * @param input -
2743
- * @return
2722
+ * A list of the value Column objects
2723
+ * @return {@link dh.Column} array.
2744
2724
  */
2745
- static ofString(input:any):FilterValue;
2725
+ get valueColumns():Column[];
2746
2726
  /**
2747
- * Constructs a boolean for the filter API from the given parameter.
2748
- * @param b -
2749
- * @return
2727
+ * The source table for this Input Table
2728
+ * @return dh.table
2750
2729
  */
2751
- static ofBoolean(b:boolean):FilterValue;
2730
+ get table():Table;
2752
2731
  }
2753
2732
 
2733
+ export class LoginCredentials {
2734
+ type?:string|null;
2735
+ username?:string|null;
2736
+ token?:string|null;
2754
2737
 
2755
- type ValueTypeType = string;
2756
- export class ValueType {
2757
- static readonly STRING:ValueTypeType;
2758
- static readonly NUMBER:ValueTypeType;
2759
- static readonly DOUBLE:ValueTypeType;
2760
- static readonly LONG:ValueTypeType;
2761
- static readonly DATETIME:ValueTypeType;
2762
- static readonly BOOLEAN:ValueTypeType;
2738
+ constructor();
2739
+ }
2740
+
2741
+ /**
2742
+ * Options for custom columns.
2743
+ */
2744
+ export class CustomColumnOptions {
2745
+ /**
2746
+ * When specified for custom columns on a rollup table, specifies if the formula apply to rollup or constituent
2747
+ * nodes.
2748
+ */
2749
+ rollupNodeType?:RollupNodeTypeType|null;
2750
+
2751
+ constructor();
2763
2752
  }
2764
2753
 
2754
+
2765
2755
  /**
2766
2756
  * This enum describes the name of each supported operation/aggregation type when creating a `TreeTable`.
2767
2757
  */
@@ -2793,11 +2783,14 @@ export namespace dh {
2793
2783
  static readonly ROLLUP_NODE_TYPE_CONSTITUENT:RollupNodeTypeType;
2794
2784
  }
2795
2785
 
2796
- type SearchDisplayModeType = string;
2797
- export class SearchDisplayMode {
2798
- static readonly SEARCH_DISPLAY_DEFAULT:SearchDisplayModeType;
2799
- static readonly SEARCH_DISPLAY_HIDE:SearchDisplayModeType;
2800
- static readonly SEARCH_DISPLAY_SHOW:SearchDisplayModeType;
2786
+ type ValueTypeType = string;
2787
+ export class ValueType {
2788
+ static readonly STRING:ValueTypeType;
2789
+ static readonly NUMBER:ValueTypeType;
2790
+ static readonly DOUBLE:ValueTypeType;
2791
+ static readonly LONG:ValueTypeType;
2792
+ static readonly DATETIME:ValueTypeType;
2793
+ static readonly BOOLEAN:ValueTypeType;
2801
2794
  }
2802
2795
 
2803
2796
  /**
@@ -2816,51 +2809,17 @@ export namespace dh {
2816
2809
  static readonly TREEMAP:VariableTypeType;
2817
2810
  }
2818
2811
 
2819
- }
2820
-
2821
- export namespace dh.ide {
2822
-
2823
- /**
2824
- * A format to describe a variable available to be read from the server. Application fields are optional, and only
2825
- * populated when a variable is provided by application mode.
2826
- * <p>
2827
- * APIs which take a VariableDefinition must at least be provided an object with a <b>type</b> and <b>id</b> field.
2828
- */
2829
- export interface VariableDefinition {
2830
- get name():string;
2831
- /**
2832
- * Optional description for the variable's contents, typically used to provide more detail that wouldn't be
2833
- * reasonable to put in the title
2834
- * @return String
2835
- */
2836
- get description():string;
2837
- /**
2838
- * An opaque identifier for this variable
2839
- * @return String
2840
- */
2841
- get id():string;
2842
- /**
2843
- * The type of the variable, one of <b>dh.VariableType</b>
2844
- * @return dh.VariableType.
2845
- */
2846
- get type():dh.VariableTypeType;
2847
- /**
2848
- * The name of the variable, to be used when rendering it to a user
2849
- * @return String
2850
- */
2851
- get title():string;
2852
- /**
2853
- * Optional description for the variable's contents, typically used to provide more detail that wouldn't be
2854
- * reasonable to put in the title
2855
- * @return String
2856
- */
2857
- get applicationId():string;
2858
- /**
2859
- * The name of the application which provided this variable
2860
- * @return String
2861
- */
2862
- get applicationName():string;
2812
+ type SearchDisplayModeType = string;
2813
+ export class SearchDisplayMode {
2814
+ static readonly SEARCH_DISPLAY_DEFAULT:SearchDisplayModeType;
2815
+ static readonly SEARCH_DISPLAY_HIDE:SearchDisplayModeType;
2816
+ static readonly SEARCH_DISPLAY_SHOW:SearchDisplayModeType;
2863
2817
  }
2818
+
2819
+ }
2820
+
2821
+ export namespace dh.ide {
2822
+
2864
2823
  /**
2865
2824
  * Represents a serialized fishlib LogRecord, suitable for display on javascript clients. A log entry sent from the
2866
2825
  * server.
@@ -2908,6 +2867,47 @@ export namespace dh.ide {
2908
2867
  get startTimestamp():dh.DateWrapper;
2909
2868
  }
2910
2869
  /**
2870
+ * A format to describe a variable available to be read from the server. Application fields are optional, and only
2871
+ * populated when a variable is provided by application mode.
2872
+ * <p>
2873
+ * APIs which take a VariableDefinition must at least be provided an object with a <b>type</b> and <b>id</b> field.
2874
+ */
2875
+ export interface VariableDefinition {
2876
+ get name():string;
2877
+ /**
2878
+ * Optional description for the variable's contents, typically used to provide more detail that wouldn't be
2879
+ * reasonable to put in the title
2880
+ * @return String
2881
+ */
2882
+ get description():string;
2883
+ /**
2884
+ * An opaque identifier for this variable
2885
+ * @return String
2886
+ */
2887
+ get id():string;
2888
+ /**
2889
+ * The type of the variable, one of <b>dh.VariableType</b>
2890
+ * @return dh.VariableType.
2891
+ */
2892
+ get type():dh.VariableTypeType;
2893
+ /**
2894
+ * The name of the variable, to be used when rendering it to a user
2895
+ * @return String
2896
+ */
2897
+ get title():string;
2898
+ /**
2899
+ * Optional description for the variable's contents, typically used to provide more detail that wouldn't be
2900
+ * reasonable to put in the title
2901
+ * @return String
2902
+ */
2903
+ get applicationId():string;
2904
+ /**
2905
+ * The name of the application which provided this variable
2906
+ * @return String
2907
+ */
2908
+ get applicationName():string;
2909
+ }
2910
+ /**
2911
2911
  * Specifies a type and either id or name (but not both).
2912
2912
  */
2913
2913
  export interface VariableDescriptor {
@@ -2941,6 +2941,80 @@ export namespace dh.ide {
2941
2941
  }
2942
2942
  }
2943
2943
 
2944
+ export namespace dh.grpc {
2945
+
2946
+ /**
2947
+ * Options for creating a gRPC stream transport instance.
2948
+ */
2949
+ export interface GrpcTransportOptions {
2950
+ /**
2951
+ * The gRPC method URL.
2952
+ */
2953
+ url:URL;
2954
+ /**
2955
+ * True to enable debug logging for this stream.
2956
+ */
2957
+ debug:boolean;
2958
+ /**
2959
+ * Callback for when headers and status are received. The headers are a map of header names to values, and the
2960
+ * status is the HTTP status code. If the connection could not be made, the status should be 0.
2961
+ */
2962
+ onHeaders:(headers:{ [key: string]: string|Array<string>; },status:number)=>void;
2963
+ /**
2964
+ * Callback for when a chunk of data is received.
2965
+ */
2966
+ onChunk:(chunk:Uint8Array)=>void;
2967
+ /**
2968
+ * Callback for when the stream ends, with an error instance if it can be provided. Note that the present
2969
+ * implementation does not consume errors, even if provided.
2970
+ */
2971
+ onEnd:(error?:Error|undefined|null)=>void;
2972
+ }
2973
+ /**
2974
+ * gRPC transport implementation.
2975
+ */
2976
+ export interface GrpcTransport {
2977
+ /**
2978
+ * Starts the stream, sending metadata to the server.
2979
+ * @param metadata - the headers to send the server when opening the connection
2980
+ */
2981
+ start(metadata:{ [key: string]: string|Array<string>; }):void;
2982
+ /**
2983
+ * Sends a message to the server.
2984
+ * @param msgBytes - bytes to send to the server
2985
+ */
2986
+ sendMessage(msgBytes:Uint8Array):void;
2987
+ /**
2988
+ * "Half close" the stream, signaling to the server that no more messages will be sent, but that the client is still
2989
+ * open to receiving messages.
2990
+ */
2991
+ finishSend():void;
2992
+ /**
2993
+ * End the stream, both notifying the server that no more messages will be sent nor received, and preventing the
2994
+ * client from receiving any more events.
2995
+ */
2996
+ cancel():void;
2997
+ }
2998
+ /**
2999
+ * Factory for creating gRPC transports.
3000
+ */
3001
+ export interface GrpcTransportFactory {
3002
+ /**
3003
+ * Create a new transport instance.
3004
+ * @param options - options for creating the transport
3005
+ * @return a transport instance to use for gRPC communication
3006
+ */
3007
+ create(options:GrpcTransportOptions):GrpcTransport;
3008
+ /**
3009
+ * Return true to signal that created transports may have {@link GrpcTransport.sendMessage} called on it
3010
+ * more than once before {@link GrpcTransport.finishSend} should be called.
3011
+ * @return true to signal that the implementation can stream multiple messages, false otherwise indicating that
3012
+ * Open/Next gRPC calls should be used
3013
+ */
3014
+ get supportsClientStreaming():boolean;
3015
+ }
3016
+ }
3017
+
2944
3018
  export namespace dh.i18n {
2945
3019
 
2946
3020
  /**
@@ -3041,60 +3115,6 @@ export namespace dh.i18n {
3041
3115
  toString():string;
3042
3116
  }
3043
3117
 
3044
- /**
3045
- * Exported wrapper of the GWT NumberFormat, plus LongWrapper support
3046
- *
3047
- * Utility class to parse and format numbers, using the same format patterns as are supported by the standard Java
3048
- * implementation used in the Deephaven server and swing client. Works for numeric types including BigInteger and
3049
- * BigDecimal.
3050
- */
3051
- export class NumberFormat {
3052
- /**
3053
- * Creates a new number format instance. This generally should be avoided in favor of the static `getFormat`
3054
- * function, which will create and cache an instance so that later calls share the same instance.
3055
- * @param pattern -
3056
- */
3057
- constructor(pattern:string);
3058
-
3059
- /**
3060
- * a number format instance matching the specified format. If this format has not been specified before, a new
3061
- * instance will be created and cached for later reuse. Prefer this method to calling the constructor directly to
3062
- * take advantage of caching
3063
- * @param pattern -
3064
- * @return dh.i18n.NumberFormat
3065
- */
3066
- static getFormat(pattern:string):NumberFormat;
3067
- /**
3068
- * Parses the given text using the cached format matching the given pattern.
3069
- * @param pattern -
3070
- * @param text -
3071
- * @return double
3072
- */
3073
- static parse(pattern:string, text:string):number;
3074
- /**
3075
- * Formats the specified number (or Java <b>long</b>, <b>BigInteger</b> or <b>BigDecimal</b> value) using the cached
3076
- * format matching the given pattern string.
3077
- * @param pattern -
3078
- * @param number -
3079
- * @return String
3080
- */
3081
- static format(pattern:string, number:number|dh.BigIntegerWrapper|dh.BigDecimalWrapper|dh.LongWrapper):string;
3082
- /**
3083
- * Parses the given text using this instance's pattern into a JS Number.
3084
- * @param text -
3085
- * @return double
3086
- */
3087
- parse(text:string):number;
3088
- /**
3089
- * Formats the specified number (or Java `long`, `BigInteger` or `BigDecimal` value) using this instance's pattern.
3090
- * @param number -
3091
- * @return String
3092
- */
3093
- format(number:number|dh.BigIntegerWrapper|dh.BigDecimalWrapper|dh.LongWrapper):string;
3094
- toString():string;
3095
- }
3096
-
3097
-
3098
3118
  /**
3099
3119
  * Represents the timezones supported by Deephaven. Can be used to format dates, taking into account the offset changing
3100
3120
  * throughout the year (potentially changing each year). These instances mostly are useful at this time to pass to the
@@ -3206,80 +3226,60 @@ export namespace dh.i18n {
3206
3226
  get id():string;
3207
3227
  }
3208
3228
 
3209
- }
3210
-
3211
- export namespace dh.grpc {
3212
-
3213
- /**
3214
- * gRPC transport implementation.
3215
- */
3216
- export interface GrpcTransport {
3217
- /**
3218
- * Starts the stream, sending metadata to the server.
3219
- * @param metadata - the headers to send the server when opening the connection
3220
- */
3221
- start(metadata:{ [key: string]: string|Array<string>; }):void;
3222
- /**
3223
- * Sends a message to the server.
3224
- * @param msgBytes - bytes to send to the server
3225
- */
3226
- sendMessage(msgBytes:Uint8Array):void;
3227
- /**
3228
- * "Half close" the stream, signaling to the server that no more messages will be sent, but that the client is still
3229
- * open to receiving messages.
3230
- */
3231
- finishSend():void;
3232
- /**
3233
- * End the stream, both notifying the server that no more messages will be sent nor received, and preventing the
3234
- * client from receiving any more events.
3235
- */
3236
- cancel():void;
3237
- }
3238
3229
  /**
3239
- * Factory for creating gRPC transports.
3230
+ * Exported wrapper of the GWT NumberFormat, plus LongWrapper support
3231
+ *
3232
+ * Utility class to parse and format numbers, using the same format patterns as are supported by the standard Java
3233
+ * implementation used in the Deephaven server and swing client. Works for numeric types including BigInteger and
3234
+ * BigDecimal.
3240
3235
  */
3241
- export interface GrpcTransportFactory {
3242
- /**
3243
- * Create a new transport instance.
3244
- * @param options - options for creating the transport
3245
- * @return a transport instance to use for gRPC communication
3246
- */
3247
- create(options:GrpcTransportOptions):GrpcTransport;
3236
+ export class NumberFormat {
3248
3237
  /**
3249
- * Return true to signal that created transports may have {@link GrpcTransport.sendMessage} called on it
3250
- * more than once before {@link GrpcTransport.finishSend} should be called.
3251
- * @return true to signal that the implementation can stream multiple messages, false otherwise indicating that
3252
- * Open/Next gRPC calls should be used
3238
+ * Creates a new number format instance. This generally should be avoided in favor of the static `getFormat`
3239
+ * function, which will create and cache an instance so that later calls share the same instance.
3240
+ * @param pattern -
3253
3241
  */
3254
- get supportsClientStreaming():boolean;
3255
- }
3256
- /**
3257
- * Options for creating a gRPC stream transport instance.
3258
- */
3259
- export interface GrpcTransportOptions {
3242
+ constructor(pattern:string);
3243
+
3260
3244
  /**
3261
- * The gRPC method URL.
3245
+ * a number format instance matching the specified format. If this format has not been specified before, a new
3246
+ * instance will be created and cached for later reuse. Prefer this method to calling the constructor directly to
3247
+ * take advantage of caching
3248
+ * @param pattern -
3249
+ * @return dh.i18n.NumberFormat
3262
3250
  */
3263
- url:URL;
3251
+ static getFormat(pattern:string):NumberFormat;
3264
3252
  /**
3265
- * True to enable debug logging for this stream.
3253
+ * Parses the given text using the cached format matching the given pattern.
3254
+ * @param pattern -
3255
+ * @param text -
3256
+ * @return double
3266
3257
  */
3267
- debug:boolean;
3258
+ static parse(pattern:string, text:string):number;
3268
3259
  /**
3269
- * Callback for when headers and status are received. The headers are a map of header names to values, and the
3270
- * status is the HTTP status code. If the connection could not be made, the status should be 0.
3260
+ * Formats the specified number (or Java <b>long</b>, <b>BigInteger</b> or <b>BigDecimal</b> value) using the cached
3261
+ * format matching the given pattern string.
3262
+ * @param pattern -
3263
+ * @param number -
3264
+ * @return String
3271
3265
  */
3272
- onHeaders:(headers:{ [key: string]: string|Array<string>; },status:number)=>void;
3266
+ static format(pattern:string, number:number|dh.BigIntegerWrapper|dh.BigDecimalWrapper|dh.LongWrapper):string;
3273
3267
  /**
3274
- * Callback for when a chunk of data is received.
3268
+ * Parses the given text using this instance's pattern into a JS Number.
3269
+ * @param text -
3270
+ * @return double
3275
3271
  */
3276
- onChunk:(chunk:Uint8Array)=>void;
3272
+ parse(text:string):number;
3277
3273
  /**
3278
- * Callback for when the stream ends, with an error instance if it can be provided. Note that the present
3279
- * implementation does not consume errors, even if provided.
3274
+ * Formats the specified number (or Java `long`, `BigInteger` or `BigDecimal` value) using this instance's pattern.
3275
+ * @param number -
3276
+ * @return String
3280
3277
  */
3281
- onEnd:(error?:Error|undefined|null)=>void;
3278
+ format(number:number|dh.BigIntegerWrapper|dh.BigDecimalWrapper|dh.LongWrapper):string;
3279
+ toString():string;
3282
3280
  }
3281
+
3282
+
3283
3283
  }
3284
3284
 
3285
3285
  export namespace dh.plot {
@@ -3353,6 +3353,31 @@ export namespace dh.plot {
3353
3353
  get minRange():number;
3354
3354
  }
3355
3355
  /**
3356
+ * Describes a template that will be used to make new series instances when a new table added to a plotBy.
3357
+ */
3358
+ export interface MultiSeries {
3359
+ /**
3360
+ * The name for this multi-series.
3361
+ * @return String
3362
+ */
3363
+ get name():string;
3364
+ /**
3365
+ * The plotting style to use for the series that will be created. See <b>SeriesPlotStyle</b> enum for more details.
3366
+ * @return int
3367
+ */
3368
+ get plotStyle():SeriesPlotStyleType;
3369
+ }
3370
+ export interface OneClick {
3371
+ setValueForColumn(columnName:string, value:any):void;
3372
+ getValueForColumn(columName:string):any;
3373
+ get requireAllFiltersToDisplay():boolean;
3374
+ get columns():dh.Column[];
3375
+ }
3376
+ export interface FigureDataUpdatedEvent {
3377
+ getArray(series:Series, sourceType:number, mappingFunc?:(arg0:any)=>any):Array<any>;
3378
+ get series():Series[];
3379
+ }
3380
+ /**
3356
3381
  * Provides access to the data for displaying in a figure.
3357
3382
  */
3358
3383
  export interface Series {
@@ -3396,27 +3421,6 @@ export namespace dh.plot {
3396
3421
  get multiSeries():MultiSeries;
3397
3422
  get shapeLabel():string;
3398
3423
  }
3399
- export interface OneClick {
3400
- setValueForColumn(columnName:string, value:any):void;
3401
- getValueForColumn(columName:string):any;
3402
- get requireAllFiltersToDisplay():boolean;
3403
- get columns():dh.Column[];
3404
- }
3405
- /**
3406
- * Describes a template that will be used to make new series instances when a new table added to a plotBy.
3407
- */
3408
- export interface MultiSeries {
3409
- /**
3410
- * The name for this multi-series.
3411
- * @return String
3412
- */
3413
- get name():string;
3414
- /**
3415
- * The plotting style to use for the series that will be created. See <b>SeriesPlotStyle</b> enum for more details.
3416
- * @return int
3417
- */
3418
- get plotStyle():SeriesPlotStyleType;
3419
- }
3420
3424
  /**
3421
3425
  * Describes how to access and display data required within a series.
3422
3426
  */
@@ -3437,89 +3441,57 @@ export namespace dh.plot {
3437
3441
  */
3438
3442
  get type():SourceTypeType;
3439
3443
  }
3440
- export interface FigureDataUpdatedEvent {
3441
- getArray(series:Series, sourceType:number, mappingFunc?:(arg0:any)=>any):Array<any>;
3442
- get series():Series[];
3443
- }
3444
3444
 
3445
- export class ChartDescriptor {
3446
- colspan?:number|null;
3447
- rowspan?:number|null;
3448
- series:Array<SeriesDescriptor>;
3449
- axes:Array<AxisDescriptor>;
3450
- chartType:string;
3451
- title?:string|null;
3452
- titleFont?:string|null;
3453
- titleColor?:string|null;
3454
- showLegend?:boolean|null;
3455
- legendFont?:string|null;
3456
- legendColor?:string|null;
3457
- is3d?:boolean|null;
3445
+ export class DownsampleOptions {
3446
+ /**
3447
+ * Max number of items in the series before DEFAULT will not attempt to load the series without downsampling. Above
3448
+ * this size if downsample fails or is not applicable, the series won't be loaded unless DISABLE is passed to
3449
+ * series.subscribe().
3450
+ */
3451
+ static MAX_SERIES_SIZE:number;
3452
+ /**
3453
+ * Max number of items in the series where the subscription will be allowed at all. Above this limit, even with
3454
+ * downsampling disabled, the series will not load data.
3455
+ */
3456
+ static MAX_SUBSCRIPTION_SIZE:number;
3457
+ /**
3458
+ * Flag to let the API decide what data will be available, based on the nature of the data, the series, and how the
3459
+ * axes are configured.
3460
+ */
3461
+ static readonly DEFAULT:DownsampleOptions;
3462
+ /**
3463
+ * Flat to entirely disable downsampling, and force all data to load, no matter how many items that would be, up to
3464
+ * the limit of MAX_SUBSCRIPTION_SIZE.
3465
+ */
3466
+ static readonly DISABLE:DownsampleOptions;
3458
3467
 
3459
- constructor();
3468
+ protected constructor();
3460
3469
  }
3461
3470
 
3462
- export class SeriesDescriptor {
3463
- plotStyle:string;
3464
- name?:string|null;
3465
- linesVisible?:boolean|null;
3466
- shapesVisible?:boolean|null;
3467
- gradientVisible?:boolean|null;
3468
- lineColor?:string|null;
3469
- pointLabelFormat?:string|null;
3470
- xToolTipPattern?:string|null;
3471
- yToolTipPattern?:string|null;
3472
- shapeLabel?:string|null;
3473
- shapeSize?:number|null;
3474
- shapeColor?:string|null;
3475
- shape?:string|null;
3476
- dataSources:Array<SourceDescriptor>;
3471
+ export class FigureFetchError {
3472
+ error:object;
3473
+ errors:Array<string>;
3477
3474
 
3478
- constructor();
3475
+ protected constructor();
3479
3476
  }
3480
3477
 
3481
3478
  /**
3482
- * Provide the details for a chart.
3479
+ * Helper class for plot downsampling methods.
3483
3480
  */
3484
- export class Chart implements dh.HasEventHandling {
3485
- /**
3486
- * a new series was added to this chart as part of a multi-series. The series instance is the detail for this event.
3487
- */
3488
- static readonly EVENT_SERIES_ADDED:string;
3489
- /**
3490
- * The title of the chart.
3491
- * @return String
3492
- */
3493
- readonly title?:string|null;
3494
-
3481
+ export class Downsample {
3495
3482
  protected constructor();
3496
3483
 
3497
- addEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):()=>void;
3498
- nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<dh.Event<T>>;
3499
- hasListeners(name:string):boolean;
3500
- removeEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):boolean;
3501
- get column():number;
3502
- get showLegend():boolean;
3503
- /**
3504
- * The axes used in this chart.
3505
- * @return dh.plot.Axis
3506
- */
3507
- get axes():Axis[];
3508
- get is3d():boolean;
3509
- get titleFont():string;
3510
- get colspan():number;
3511
- get titleColor():string;
3512
- get series():Series[];
3513
- get rowspan():number;
3514
3484
  /**
3515
- * The type of this chart, see <b>ChartType</b> enum for more details.
3516
- * @return int
3485
+ * Downsamples a table so that the data can be used for a time-series line plot. The downsampled table should have
3486
+ * the same visual fidelity as the original table, but with fewer rows.
3487
+ * @param table - The table to downsample.
3488
+ * @param xCol - The name of the X column to downsample. Must be an Instant or long.
3489
+ * @param yCols - The names of the Y columns to downsample.
3490
+ * @param width - The width of the visible area in pixels.
3491
+ * @param xRange - The visible range as `[start, end]` or null to always use all data.
3492
+ * @return A promise that resolves to the downsampled table.
3517
3493
  */
3518
- get chartType():ChartTypeType;
3519
- get row():number;
3520
- get legendColor():string;
3521
- get legendFont():string;
3522
- get multiSeries():MultiSeries[];
3494
+ static runChartDownsample(table:dh.Table, xCol:string, yCols:string[], width:number, xRange?:dh.LongWrapper[]|undefined|null):Promise<dh.Table>;
3523
3495
  }
3524
3496
 
3525
3497
  export class Figure implements dh.HasEventHandling {
@@ -3615,6 +3587,23 @@ export namespace dh.plot {
3615
3587
  constructor();
3616
3588
  }
3617
3589
 
3590
+ export class ChartDescriptor {
3591
+ colspan?:number|null;
3592
+ rowspan?:number|null;
3593
+ series:Array<SeriesDescriptor>;
3594
+ axes:Array<AxisDescriptor>;
3595
+ chartType:string;
3596
+ title?:string|null;
3597
+ titleFont?:string|null;
3598
+ titleColor?:string|null;
3599
+ showLegend?:boolean|null;
3600
+ legendFont?:string|null;
3601
+ legendColor?:string|null;
3602
+ is3d?:boolean|null;
3603
+
3604
+ constructor();
3605
+ }
3606
+
3618
3607
  /**
3619
3608
  * Helper class to manage snapshots and deltas and keep not only a contiguous JS array of data per column in the
3620
3609
  * underlying table, but also support a mapping function to let client code translate data in some way for display and
@@ -3632,13 +3621,6 @@ export namespace dh.plot {
3632
3621
  removeColumn(columnName:string, mappingFunc:(arg0:any)=>any):void;
3633
3622
  }
3634
3623
 
3635
- export class FigureSourceException {
3636
- table:dh.Table;
3637
- source:SeriesDataSource;
3638
-
3639
- protected constructor();
3640
- }
3641
-
3642
3624
  /**
3643
3625
  * A descriptor used with JsFigureFactory.create to create a figure from JS.
3644
3626
  */
@@ -3656,35 +3638,96 @@ export namespace dh.plot {
3656
3638
  constructor();
3657
3639
  }
3658
3640
 
3659
- export class FigureFetchError {
3660
- error:object;
3661
- errors:Array<string>;
3641
+ export class AxisDescriptor {
3642
+ formatType:string;
3643
+ type:string;
3644
+ position:string;
3645
+ log?:boolean|null;
3646
+ label?:string|null;
3647
+ labelFont?:string|null;
3648
+ ticksFont?:string|null;
3649
+ formatPattern?:string|null;
3650
+ color?:string|null;
3651
+ minRange?:number|null;
3652
+ maxRange?:number|null;
3653
+ minorTicksVisible?:boolean|null;
3654
+ majorTicksVisible?:boolean|null;
3655
+ minorTickCount?:number|null;
3656
+ gapBetweenMajorTicks?:number|null;
3657
+ majorTickLocations?:Array<number>|null;
3658
+ tickLabelAngle?:number|null;
3659
+ invert?:boolean|null;
3660
+ isTimeAxis?:boolean|null;
3662
3661
 
3663
- protected constructor();
3662
+ constructor();
3664
3663
  }
3665
3664
 
3666
- export class DownsampleOptions {
3665
+ export class SeriesDescriptor {
3666
+ plotStyle:string;
3667
+ name?:string|null;
3668
+ linesVisible?:boolean|null;
3669
+ shapesVisible?:boolean|null;
3670
+ gradientVisible?:boolean|null;
3671
+ lineColor?:string|null;
3672
+ pointLabelFormat?:string|null;
3673
+ xToolTipPattern?:string|null;
3674
+ yToolTipPattern?:string|null;
3675
+ shapeLabel?:string|null;
3676
+ shapeSize?:number|null;
3677
+ shapeColor?:string|null;
3678
+ shape?:string|null;
3679
+ dataSources:Array<SourceDescriptor>;
3680
+
3681
+ constructor();
3682
+ }
3683
+
3684
+ /**
3685
+ * Provide the details for a chart.
3686
+ */
3687
+ export class Chart implements dh.HasEventHandling {
3667
3688
  /**
3668
- * Max number of items in the series before DEFAULT will not attempt to load the series without downsampling. Above
3669
- * this size if downsample fails or is not applicable, the series won't be loaded unless DISABLE is passed to
3670
- * series.subscribe().
3689
+ * a new series was added to this chart as part of a multi-series. The series instance is the detail for this event.
3671
3690
  */
3672
- static MAX_SERIES_SIZE:number;
3691
+ static readonly EVENT_SERIES_ADDED:string;
3673
3692
  /**
3674
- * Max number of items in the series where the subscription will be allowed at all. Above this limit, even with
3675
- * downsampling disabled, the series will not load data.
3693
+ * The title of the chart.
3694
+ * @return String
3676
3695
  */
3677
- static MAX_SUBSCRIPTION_SIZE:number;
3696
+ readonly title?:string|null;
3697
+
3698
+ protected constructor();
3699
+
3700
+ addEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):()=>void;
3701
+ nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<dh.Event<T>>;
3702
+ hasListeners(name:string):boolean;
3703
+ removeEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):boolean;
3704
+ get column():number;
3705
+ get showLegend():boolean;
3678
3706
  /**
3679
- * Flag to let the API decide what data will be available, based on the nature of the data, the series, and how the
3680
- * axes are configured.
3707
+ * The axes used in this chart.
3708
+ * @return dh.plot.Axis
3681
3709
  */
3682
- static readonly DEFAULT:DownsampleOptions;
3710
+ get axes():Axis[];
3711
+ get is3d():boolean;
3712
+ get titleFont():string;
3713
+ get colspan():number;
3714
+ get titleColor():string;
3715
+ get series():Series[];
3716
+ get rowspan():number;
3683
3717
  /**
3684
- * Flat to entirely disable downsampling, and force all data to load, no matter how many items that would be, up to
3685
- * the limit of MAX_SUBSCRIPTION_SIZE.
3718
+ * The type of this chart, see <b>ChartType</b> enum for more details.
3719
+ * @return int
3686
3720
  */
3687
- static readonly DISABLE:DownsampleOptions;
3721
+ get chartType():ChartTypeType;
3722
+ get row():number;
3723
+ get legendColor():string;
3724
+ get legendFont():string;
3725
+ get multiSeries():MultiSeries[];
3726
+ }
3727
+
3728
+ export class FigureSourceException {
3729
+ table:dh.Table;
3730
+ source:SeriesDataSource;
3688
3731
 
3689
3732
  protected constructor();
3690
3733
  }
@@ -3696,50 +3739,51 @@ export namespace dh.plot {
3696
3739
  get message():string;
3697
3740
  }
3698
3741
 
3699
- export class AxisDescriptor {
3700
- formatType:string;
3701
- type:string;
3702
- position:string;
3703
- log?:boolean|null;
3704
- label?:string|null;
3705
- labelFont?:string|null;
3706
- ticksFont?:string|null;
3707
- formatPattern?:string|null;
3708
- color?:string|null;
3709
- minRange?:number|null;
3710
- maxRange?:number|null;
3711
- minorTicksVisible?:boolean|null;
3712
- majorTicksVisible?:boolean|null;
3713
- minorTickCount?:number|null;
3714
- gapBetweenMajorTicks?:number|null;
3715
- majorTickLocations?:Array<number>|null;
3716
- tickLabelAngle?:number|null;
3717
- invert?:boolean|null;
3718
- isTimeAxis?:boolean|null;
3719
3742
 
3720
- constructor();
3743
+ /**
3744
+ * This enum describes the source it is in, and how this aspect of the data in the series should be used to render the
3745
+ * 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
3746
+ * COLOR per item - the three SeriesDataSources all would share the same Axis instance, but would have different
3747
+ * SourceType enums set. The exact meaning of each source type will depend on the series that they are in.
3748
+ */
3749
+ type SourceTypeType = number;
3750
+ export class SourceType {
3751
+ static readonly X:SourceTypeType;
3752
+ static readonly Y:SourceTypeType;
3753
+ static readonly Z:SourceTypeType;
3754
+ static readonly X_LOW:SourceTypeType;
3755
+ static readonly X_HIGH:SourceTypeType;
3756
+ static readonly Y_LOW:SourceTypeType;
3757
+ static readonly Y_HIGH:SourceTypeType;
3758
+ static readonly TIME:SourceTypeType;
3759
+ static readonly OPEN:SourceTypeType;
3760
+ static readonly HIGH:SourceTypeType;
3761
+ static readonly LOW:SourceTypeType;
3762
+ static readonly CLOSE:SourceTypeType;
3763
+ static readonly SHAPE:SourceTypeType;
3764
+ static readonly SIZE:SourceTypeType;
3765
+ static readonly LABEL:SourceTypeType;
3766
+ static readonly COLOR:SourceTypeType;
3767
+ static readonly PARENT:SourceTypeType;
3768
+ static readonly TEXT:SourceTypeType;
3769
+ static readonly HOVER_TEXT:SourceTypeType;
3721
3770
  }
3722
3771
 
3723
3772
  /**
3724
- * Helper class for plot downsampling methods.
3773
+ * This enum describes what kind of chart is being drawn. This may limit what kinds of series can be found on it, or how
3774
+ * those series should be rendered.
3725
3775
  */
3726
- export class Downsample {
3727
- protected constructor();
3728
-
3729
- /**
3730
- * Downsamples a table so that the data can be used for a time-series line plot. The downsampled table should have
3731
- * the same visual fidelity as the original table, but with fewer rows.
3732
- * @param table - The table to downsample.
3733
- * @param xCol - The name of the X column to downsample. Must be an Instant or long.
3734
- * @param yCols - The names of the Y columns to downsample.
3735
- * @param width - The width of the visible area in pixels.
3736
- * @param xRange - The visible range as `[start, end]` or null to always use all data.
3737
- * @return A promise that resolves to the downsampled table.
3738
- */
3739
- static runChartDownsample(table:dh.Table, xCol:string, yCols:string[], width:number, xRange?:dh.LongWrapper[]|undefined|null):Promise<dh.Table>;
3776
+ type ChartTypeType = number;
3777
+ export class ChartType {
3778
+ static readonly XY:ChartTypeType;
3779
+ static readonly PIE:ChartTypeType;
3780
+ static readonly OHLC:ChartTypeType;
3781
+ static readonly CATEGORY:ChartTypeType;
3782
+ static readonly XYZ:ChartTypeType;
3783
+ static readonly CATEGORY_3D:ChartTypeType;
3784
+ static readonly TREEMAP:ChartTypeType;
3740
3785
  }
3741
3786
 
3742
-
3743
3787
  type AxisPositionType = number;
3744
3788
  export class AxisPosition {
3745
3789
  static readonly TOP:AxisPositionType;
@@ -3749,37 +3793,12 @@ export namespace dh.plot {
3749
3793
  static readonly NONE:AxisPositionType;
3750
3794
  }
3751
3795
 
3752
- type AxisTypeType = number;
3753
- export class AxisType {
3754
- static readonly X:AxisTypeType;
3755
- static readonly Y:AxisTypeType;
3756
- static readonly SHAPE:AxisTypeType;
3757
- static readonly SIZE:AxisTypeType;
3758
- static readonly LABEL:AxisTypeType;
3759
- static readonly COLOR:AxisTypeType;
3760
- }
3761
-
3762
3796
  type AxisFormatTypeType = number;
3763
3797
  export class AxisFormatType {
3764
3798
  static readonly CATEGORY:AxisFormatTypeType;
3765
3799
  static readonly NUMBER:AxisFormatTypeType;
3766
3800
  }
3767
3801
 
3768
- /**
3769
- * This enum describes what kind of chart is being drawn. This may limit what kinds of series can be found on it, or how
3770
- * those series should be rendered.
3771
- */
3772
- type ChartTypeType = number;
3773
- export class ChartType {
3774
- static readonly XY:ChartTypeType;
3775
- static readonly PIE:ChartTypeType;
3776
- static readonly OHLC:ChartTypeType;
3777
- static readonly CATEGORY:ChartTypeType;
3778
- static readonly XYZ:ChartTypeType;
3779
- static readonly CATEGORY_3D:ChartTypeType;
3780
- static readonly TREEMAP:ChartTypeType;
3781
- }
3782
-
3783
3802
  type SeriesPlotStyleType = number;
3784
3803
  export class SeriesPlotStyle {
3785
3804
  static readonly BAR:SeriesPlotStyleType;
@@ -3796,59 +3815,32 @@ export namespace dh.plot {
3796
3815
  static readonly TREEMAP:SeriesPlotStyleType;
3797
3816
  }
3798
3817
 
3799
- /**
3800
- * This enum describes the source it is in, and how this aspect of the data in the series should be used to render the
3801
- * 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
3802
- * COLOR per item - the three SeriesDataSources all would share the same Axis instance, but would have different
3803
- * SourceType enums set. The exact meaning of each source type will depend on the series that they are in.
3804
- */
3805
- type SourceTypeType = number;
3806
- export class SourceType {
3807
- static readonly X:SourceTypeType;
3808
- static readonly Y:SourceTypeType;
3809
- static readonly Z:SourceTypeType;
3810
- static readonly X_LOW:SourceTypeType;
3811
- static readonly X_HIGH:SourceTypeType;
3812
- static readonly Y_LOW:SourceTypeType;
3813
- static readonly Y_HIGH:SourceTypeType;
3814
- static readonly TIME:SourceTypeType;
3815
- static readonly OPEN:SourceTypeType;
3816
- static readonly HIGH:SourceTypeType;
3817
- static readonly LOW:SourceTypeType;
3818
- static readonly CLOSE:SourceTypeType;
3819
- static readonly SHAPE:SourceTypeType;
3820
- static readonly SIZE:SourceTypeType;
3821
- static readonly LABEL:SourceTypeType;
3822
- static readonly COLOR:SourceTypeType;
3823
- static readonly PARENT:SourceTypeType;
3824
- static readonly TEXT:SourceTypeType;
3825
- static readonly HOVER_TEXT:SourceTypeType;
3818
+ type AxisTypeType = number;
3819
+ export class AxisType {
3820
+ static readonly X:AxisTypeType;
3821
+ static readonly Y:AxisTypeType;
3822
+ static readonly SHAPE:AxisTypeType;
3823
+ static readonly SIZE:AxisTypeType;
3824
+ static readonly LABEL:AxisTypeType;
3825
+ static readonly COLOR:AxisTypeType;
3826
3826
  }
3827
3827
 
3828
3828
  }
3829
3829
 
3830
3830
  export namespace dh.lsp {
3831
3831
 
3832
- export class Position {
3833
- line:number;
3834
- character:number;
3832
+ export class ParameterInformation {
3833
+ label:string;
3834
+ documentation:MarkupContent;
3835
3835
 
3836
3836
  constructor();
3837
-
3838
- lessThan(start:Position):boolean;
3839
- lessOrEqual(start:Position):boolean;
3840
- greaterThan(end:Position):boolean;
3841
- greaterOrEqual(end:Position):boolean;
3842
- copy():Position;
3843
3837
  }
3844
3838
 
3845
- export class Range {
3846
- start:Position;
3847
- end:Position;
3839
+ export class Hover {
3840
+ contents:MarkupContent;
3841
+ range:Range;
3848
3842
 
3849
3843
  constructor();
3850
-
3851
- isInside(innerStart:Position, innerEnd:Position):boolean;
3852
3844
  }
3853
3845
 
3854
3846
  export class SignatureInformation {
@@ -3860,18 +3852,25 @@ export namespace dh.lsp {
3860
3852
  constructor();
3861
3853
  }
3862
3854
 
3863
- export class Hover {
3864
- contents:MarkupContent;
3855
+ export class TextDocumentContentChangeEvent {
3865
3856
  range:Range;
3857
+ rangeLength:number;
3858
+ text:string;
3866
3859
 
3867
3860
  constructor();
3868
3861
  }
3869
3862
 
3870
- export class ParameterInformation {
3871
- label:string;
3872
- documentation:MarkupContent;
3863
+ export class Position {
3864
+ line:number;
3865
+ character:number;
3873
3866
 
3874
3867
  constructor();
3868
+
3869
+ lessThan(start:Position):boolean;
3870
+ lessOrEqual(start:Position):boolean;
3871
+ greaterThan(end:Position):boolean;
3872
+ greaterOrEqual(end:Position):boolean;
3873
+ copy():Position;
3875
3874
  }
3876
3875
 
3877
3876
  export class TextEdit {
@@ -3881,10 +3880,18 @@ export namespace dh.lsp {
3881
3880
  constructor();
3882
3881
  }
3883
3882
 
3884
- export class TextDocumentContentChangeEvent {
3885
- range:Range;
3886
- rangeLength:number;
3887
- text:string;
3883
+ export class Range {
3884
+ start:Position;
3885
+ end:Position;
3886
+
3887
+ constructor();
3888
+
3889
+ isInside(innerStart:Position, innerEnd:Position):boolean;
3890
+ }
3891
+
3892
+ export class MarkupContent {
3893
+ kind:string;
3894
+ value:string;
3888
3895
 
3889
3896
  constructor();
3890
3897
  }
@@ -3906,17 +3913,23 @@ export namespace dh.lsp {
3906
3913
  constructor();
3907
3914
  }
3908
3915
 
3909
- export class MarkupContent {
3910
- kind:string;
3911
- value:string;
3912
-
3913
- constructor();
3914
- }
3915
-
3916
3916
  }
3917
3917
 
3918
+
3918
3919
  export namespace dh.calendar {
3919
3920
 
3921
+ export interface Holiday {
3922
+ /**
3923
+ * The date of the Holiday.
3924
+ * @return {@link dh.LocalDateWrapper}
3925
+ */
3926
+ get date():dh.LocalDateWrapper;
3927
+ /**
3928
+ * The business periods that are open on the holiday.
3929
+ * @return dh.calendar.BusinessPeriod
3930
+ */
3931
+ get businessPeriods():Array<BusinessPeriod>;
3932
+ }
3920
3933
  /**
3921
3934
  * Defines a calendar with business hours and holidays.
3922
3935
  */
@@ -3947,18 +3960,6 @@ export namespace dh.calendar {
3947
3960
  */
3948
3961
  get businessPeriods():Array<BusinessPeriod>;
3949
3962
  }
3950
- export interface Holiday {
3951
- /**
3952
- * The date of the Holiday.
3953
- * @return {@link dh.LocalDateWrapper}
3954
- */
3955
- get date():dh.LocalDateWrapper;
3956
- /**
3957
- * The business periods that are open on the holiday.
3958
- * @return dh.calendar.BusinessPeriod
3959
- */
3960
- get businessPeriods():Array<BusinessPeriod>;
3961
- }
3962
3963
  export interface BusinessPeriod {
3963
3964
  get close():string;
3964
3965
  get open():string;
@@ -3978,4 +3979,3 @@ export namespace dh.calendar {
3978
3979
  }
3979
3980
 
3980
3981
  }
3981
-