@deephaven/jsapi-types 41.8.0 → 41.10.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 +1928 -1892
  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,23 +11,12 @@ export interface Iterator<T> {
15
11
  hasNext():boolean;
16
12
  next():IIterableResult<T>;
17
13
  }
14
+ export interface IIterableResult<T> {
15
+ value:T;
16
+ done:boolean;
17
+ }
18
18
  export namespace dh.storage {
19
19
 
20
- /**
21
- * Storage service metadata about files and folders.
22
- */
23
- export class ItemDetails {
24
- protected constructor();
25
-
26
- toString():string;
27
- get filename():string;
28
- get basename():string;
29
- get size():number;
30
- get etag():string;
31
- get type():ItemTypeType;
32
- get dirname():string;
33
- }
34
-
35
20
  /**
36
21
  * Remote service to read and write files on the server. Paths use "/" as a separator, and should not start with "/".
37
22
  */
@@ -106,6 +91,21 @@ export namespace dh.storage {
106
91
  get etag():string;
107
92
  }
108
93
 
94
+ /**
95
+ * Storage service metadata about files and folders.
96
+ */
97
+ export class ItemDetails {
98
+ protected constructor();
99
+
100
+ toString():string;
101
+ get filename():string;
102
+ get basename():string;
103
+ get size():number;
104
+ get etag():string;
105
+ get type():ItemTypeType;
106
+ get dirname():string;
107
+ }
108
+
109
109
 
110
110
  type ItemTypeType = string;
111
111
  export class ItemType {
@@ -118,15 +118,84 @@ export namespace dh.storage {
118
118
  export namespace dh {
119
119
 
120
120
  /**
121
- * Wrap LocalTime values for use in JS. Provides text formatting for display and access to the underlying value.
121
+ * Represents a row available in a subscription/snapshot on the client. Do not retain references to rows - they will
122
+ * not function properly when the event isn't actively going off (or promise resolving). Instead, wait for the next
123
+ * event, or re-request the viewport data.
122
124
  */
123
- export interface LocalTimeWrapper {
124
- valueOf():string;
125
- getHour():number;
126
- getMinute():number;
127
- getSecond():number;
128
- getNano():number;
129
- toString():string;
125
+ export interface Row {
126
+ get(column:Column):any;
127
+ getFormat(column:Column):Format;
128
+ get index():LongWrapper;
129
+ }
130
+ /**
131
+ * This object may be pooled internally or discarded and not updated. Do not retain references to it.
132
+ */
133
+ export interface Format {
134
+ /**
135
+ * The format string to apply to the value of this cell.
136
+ * @return String
137
+ */
138
+ readonly formatString?:string|null;
139
+ /**
140
+ * Color to apply to the cell's background, in <b>#rrggbb</b> format.
141
+ * @return String
142
+ */
143
+ readonly backgroundColor?:string|null;
144
+ /**
145
+ * Color to apply to the text, in <b>#rrggbb</b> format.
146
+ * @return String
147
+ */
148
+ readonly color?:string|null;
149
+ /**
150
+ *
151
+ * @deprecated Prefer formatString. Number format string to apply to the value in this cell.
152
+ */
153
+ readonly numberFormat?:string|null;
154
+ }
155
+ export interface LayoutHints {
156
+ readonly searchDisplayMode?:SearchDisplayModeType|null;
157
+
158
+ get hiddenColumns():string[]|null;
159
+ get frozenColumns():string[]|null;
160
+ get columnGroups():ColumnGroup[]|null;
161
+ get areSavedLayoutsAllowed():boolean;
162
+ get frontColumns():string[]|null;
163
+ get backColumns():string[]|null;
164
+ }
165
+ export interface WorkerHeapInfo {
166
+ /**
167
+ * Total heap size available for this worker.
168
+ */
169
+ get totalHeapSize():number;
170
+ get freeMemory():number;
171
+ get maximumHeapSize():number;
172
+ }
173
+ /**
174
+ * Similar to the browser `CustomEvent` type, this class holds only the type of the event, and optionally some
175
+ * details about the event.
176
+ * @typeParam T - the type of the event detail
177
+ */
178
+ export interface Event<T> {
179
+ get detail():T;
180
+ get type():string;
181
+ }
182
+ /**
183
+ * Options for requesting a preview of columns when requesting table data. The two properties
184
+ * {@link dh.convertArrayToString} and {@link dh.array} are mutually exclusive.
185
+ */
186
+ export interface PreviewOptions {
187
+ /**
188
+ * If true, any array columns will be converted to strings for preview purposes. This is the legacy behavior.
189
+ */
190
+ convertArrayToString?:boolean|null;
191
+ /**
192
+ * Specifies the length of the array to serialize. If the array is longer than this length, one extra element
193
+ * will be included - the client is expected to truncate the array and append "..." to indicate that there are
194
+ * additional elements. Negative values indicate that the values should be counted from the end of the array
195
+ * rather than the beginning. Zero or null indicate that the entire array should be serialized. The default is
196
+ * null.
197
+ */
198
+ array?:number|null;
130
199
  }
131
200
  /**
132
201
  * Similar to {@link dh.ViewportData}, but with additional properties to reflect
@@ -144,25 +213,23 @@ export namespace dh {
144
213
  get columns():Array<Column>;
145
214
  get rows():Array<TreeRow>;
146
215
  }
147
- export interface HasEventHandling {
148
- /**
149
- * Listen for events on this object.
150
- * @param name - the name of the event to listen for
151
- * @param callback - a function to call when the event occurs
152
- * @return Returns a cleanup function.
153
- * @typeParam T - the type of the data that the event will provide
154
- */
155
- addEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):()=>void;
156
- nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<Event<T>>;
157
- hasListeners(name:string):boolean;
216
+ /**
217
+ * Options for requesting a full-table subscription to a table.
218
+ */
219
+ export interface SubscriptionOptions extends DataOptions {
158
220
  /**
159
- * Removes an event listener added to this table.
160
- * @param name -
161
- * @param callback -
162
- * @return
163
- * @typeParam T -
221
+ * Minimum interval between updates, in milliseconds. If not specified, the server default will be used,
222
+ * typically 1000ms.
223
+ * <p>
224
+ * Note that setting this to smaller values will not necessarily result in more frequent updates - the server
225
+ * may not propagate updates that frequently, or there may be no updates to propagate.
164
226
  */
165
- removeEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):boolean;
227
+ updateIntervalMs?:number|null;
228
+ }
229
+ export interface ColumnGroup {
230
+ get name():string|null;
231
+ get children():string[]|null;
232
+ get color():string|null;
166
233
  }
167
234
  /**
168
235
  * Options for requesting table data, either as a snapshot or a subscription. See subtypes for more specific options:
@@ -182,113 +249,69 @@ export namespace dh {
182
249
  */
183
250
  columns:Array<Column>;
184
251
  }
185
- /**
186
- * Represents the contents of a single widget data message from the server, with a binary data paylod and exported
187
- * objects. Implemented both by Widget itself and by the `event.details` when data is received by the client.
188
- *
189
- * Terminology note: the name of this type should probably use "Data" instead of "Message", and the methods should use
190
- * "payload" rather than "data" to match other platforms and the protobuf itself. These names are instead used for
191
- * backwards compatibility and to better follow JS expectations.
192
- */
193
- export interface WidgetMessageDetails {
194
- /**
195
- * Returns the data from this message as a base64-encoded string.
196
- */
197
- getDataAsBase64():string;
198
- /**
199
- * Returns the data from this message as a Uint8Array.
200
- */
201
- getDataAsU8():Uint8Array;
252
+ export interface HasEventHandling {
202
253
  /**
203
- * Returns the data from this message as a utf-8 string.
254
+ * Listen for events on this object.
255
+ * @param name - the name of the event to listen for
256
+ * @param callback - a function to call when the event occurs
257
+ * @return Returns a cleanup function.
258
+ * @typeParam T - the type of the data that the event will provide
204
259
  */
205
- getDataAsString():string;
260
+ addEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):()=>void;
261
+ nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<Event<T>>;
262
+ hasListeners(name:string):boolean;
206
263
  /**
207
- * Returns an array of exported objects sent from the server. The plugin implementation is now responsible for these
208
- * objects, and should close them when no longer needed.
264
+ * Removes an event listener added to this table.
265
+ * @param name -
266
+ * @param callback -
267
+ * @return
268
+ * @typeParam T -
209
269
  */
210
- get exportedObjects():WidgetExportedObject[];
270
+ removeEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):boolean;
211
271
  }
212
272
  /**
213
- * Wrap LocalDate values for use in JS. Provides text formatting for display and access to the underlying value.
273
+ * This object may be pooled internally or discarded and not updated. Do not retain references to it. Instead,
274
+ * request the viewport again.
214
275
  */
215
- export interface LocalDateWrapper {
216
- valueOf():string;
217
- getYear():number;
218
- getMonthValue():number;
219
- getDayOfMonth():number;
220
- toString():string;
276
+ export interface ViewportRow extends Row {
277
+ get(column:Column):any;
278
+ getFormat(column:Column):Format;
279
+ get index():LongWrapper;
221
280
  }
222
281
  /**
223
- * Options for requesting a viewport subscription to a table.
282
+ * Common interface for various ways of accessing table data and formatting for viewport or non-viewport subscriptions
283
+ * on tables, data in trees, and snapshots.
284
+ * <p>
285
+ * Generally speaking, it is more efficient to access data in column-major order, rather than iterating through each Row
286
+ * and accessing all columns that it holds. The {@link rows} accessor can be useful to read row data, but may
287
+ * incur other costs - it is likely faster to access data by columns using {@link getData}.
224
288
  */
225
- export interface ViewportSubscriptionOptions extends SubscriptionOptions {
289
+ export interface TableData {
226
290
  /**
227
- * If true, the viewport will be filled starting from the end of the table, where 0 is the last row of the
228
- * table. Default is false.
291
+ * Reads a row object from the table, from which any subscribed column can be read.
292
+ * @param index - the position or key to access
293
+ * @return the row at the given location
229
294
  */
230
- isReverseViewport?:boolean|null;
295
+ get(index:LongWrapper|number):Row;
231
296
  /**
232
- * The rows to include in the viewport. This can be either a {@link dh.RangeSet} or a single range with
233
- * `first` and `last` properties.
297
+ * Reads a specific cell from the table, by row key and column.
298
+ * @param index - the row in the table to get data from
299
+ * @param column - the column to read
300
+ * @return the value in the table
234
301
  */
235
- rows:RangeSet|SimpleRange;
236
- }
237
- /**
238
- * Similar to the browser `CustomEvent` type, this class holds only the type of the event, and optionally some
239
- * details about the event.
240
- * @typeParam T - the type of the event detail
241
- */
242
- export interface Event<T> {
243
- get detail():T;
244
- get type():string;
245
- }
246
- /**
247
- * Represents a server-side object that may not yet have been fetched by the client. When this object will no longer be
248
- * used, if {@link fetch} is not called on this object, then {@link close} must be to ensure server-side resources
249
- * are correctly freed.
250
- */
251
- export interface WidgetExportedObject {
302
+ getData(index:LongWrapper|number, column:Column):any;
252
303
  /**
253
- * Returns the type of this export, typically one of {@link dh.VariableType}, but may also include plugin types. If
254
- * null, this object cannot be fetched, but can be passed to the server, such as via
255
- * {@link Widget.sendMessage}.
256
- * @return the string type of this server-side object, or null.
304
+ * The server-specified Format to use for the cell at the given position.
305
+ * @param index - the row to read
306
+ * @param column - the column to read
307
+ * @return a Format instance with any server-specified details
257
308
  */
258
- readonly type?:string|null;
259
-
260
- /**
261
- * Exports another copy of this reference, allowing it to be fetched separately. Results in rejection if the ticket
262
- * was already closed (either by calling {@link WidgetExportedObject.close} or closing the object returned from {@link WidgetExportedObject.fetch}).
263
- * @return a promise returning a reexported copy of this object, still referencing the same server-side object.
264
- */
265
- reexport():Promise<WidgetExportedObject>;
266
- /**
267
- * Returns a promise that will fetch the object represented by this reference. Multiple calls to this will return
268
- * the same instance.
269
- * @return a promise that will resolve to a client side object that represents the reference on the server.
270
- */
271
- fetch():Promise<any>;
272
- /**
273
- * Releases the server-side resources associated with this object, regardless of whether other client-side objects
274
- * exist that also use that object. Should not be called after fetch() has been invoked.
275
- */
276
- close():void;
277
- }
278
- /**
279
- * Options for requesting a snapshot of a table.
280
- */
281
- export interface SnapshotOptions extends DataOptions {
282
- /**
283
- * If true, the snapshot will be filled starting from the end of the table, where 0 is the last row of the
284
- * table. Default is false.
285
- */
286
- isReverseViewport?:boolean|null;
309
+ getFormat(index:LongWrapper|number, column:Column):Format;
310
+ get columns():Array<Column>;
287
311
  /**
288
- * The rows to include in the snapshot. This can be either a {@link dh.RangeSet} or a single range with
289
- * `first` and `last` properties.
312
+ * A lazily computed array of all rows available on the client.
290
313
  */
291
- rows:RangeSet|SimpleRange;
314
+ get rows():Array<Row>;
292
315
  }
293
316
  /**
294
317
  * Behaves like a Table, but doesn't expose all of its API for changing the internal state. Instead, state is driven by
@@ -444,18 +467,88 @@ export namespace dh {
444
467
  */
445
468
  get isRefreshing():boolean;
446
469
  }
447
- export interface ColumnGroup {
448
- get name():string|null;
449
- get children():string[]|null;
450
- get color():string|null;
470
+ /**
471
+ * Wrap LocalDate values for use in JS. Provides text formatting for display and access to the underlying value.
472
+ */
473
+ export interface LocalDateWrapper {
474
+ valueOf():string;
475
+ getYear():number;
476
+ getMonthValue():number;
477
+ getDayOfMonth():number;
478
+ toString():string;
451
479
  }
452
480
  /**
453
- * This object may be pooled internally or discarded and not updated. Do not retain references to it. Instead,
454
- * request the viewport again.
481
+ * Represents a server-side object that may not yet have been fetched by the client. When this object will no longer be
482
+ * used, if {@link fetch} is not called on this object, then {@link close} must be to ensure server-side resources
483
+ * are correctly freed.
455
484
  */
456
- export interface ViewportRow extends Row {
485
+ export interface WidgetExportedObject {
486
+ /**
487
+ * Returns the type of this export, typically one of {@link dh.VariableType}, but may also include plugin types. If
488
+ * null, this object cannot be fetched, but can be passed to the server, such as via
489
+ * {@link Widget.sendMessage}.
490
+ * @return the string type of this server-side object, or null.
491
+ */
492
+ readonly type?:string|null;
493
+
494
+ /**
495
+ * Exports another copy of this reference, allowing it to be fetched separately. Results in rejection if the ticket
496
+ * was already closed (either by calling {@link WidgetExportedObject.close} or closing the object returned from {@link WidgetExportedObject.fetch}).
497
+ * @return a promise returning a reexported copy of this object, still referencing the same server-side object.
498
+ */
499
+ reexport():Promise<WidgetExportedObject>;
500
+ /**
501
+ * Returns a promise that will fetch the object represented by this reference. Multiple calls to this will return
502
+ * the same instance.
503
+ * @return a promise that will resolve to a client side object that represents the reference on the server.
504
+ */
505
+ fetch():Promise<any>;
506
+ /**
507
+ * Releases the server-side resources associated with this object, regardless of whether other client-side objects
508
+ * exist that also use that object. Should not be called after fetch() has been invoked.
509
+ */
510
+ close():void;
511
+ }
512
+ export interface RefreshToken {
513
+ get bytes():string;
514
+ get expiry():number;
515
+ }
516
+ /**
517
+ * Wrap LocalTime values for use in JS. Provides text formatting for display and access to the underlying value.
518
+ */
519
+ export interface LocalTimeWrapper {
520
+ valueOf():string;
521
+ getHour():number;
522
+ getMinute():number;
523
+ getSecond():number;
524
+ getNano():number;
525
+ toString():string;
526
+ }
527
+ /**
528
+ * Row implementation that also provides additional read-only properties. represents visible rows in the table, but
529
+ * with additional properties to reflect the tree structure.
530
+ */
531
+ export interface TreeRow extends Row {
457
532
  get(column:Column):any;
458
533
  getFormat(column:Column):Format;
534
+ /**
535
+ * True if this node is currently expanded to show its children; false otherwise. Those children will be the
536
+ * rows below this one with a greater depth than this one.
537
+ * @return boolean
538
+ */
539
+ get isExpanded():boolean;
540
+ /**
541
+ * The number of levels above this node; zero for top level nodes. Generally used by the UI to indent the row
542
+ * and its expand/collapse icon.
543
+ * @return int
544
+ */
545
+ get depth():number;
546
+ /**
547
+ * True if this node has children and can be expanded; false otherwise. Note that this value may change when the
548
+ * table updates, depending on the table's configuration.
549
+ * @return boolean
550
+ */
551
+ get hasChildren():boolean;
459
552
  get index():LongWrapper;
460
553
  }
461
554
  /**
@@ -508,9 +601,57 @@ export namespace dh {
508
601
  get columns():Array<Column>;
509
602
  get rows():Array<ViewportRow>;
510
603
  }
511
- export interface RefreshToken {
512
- get bytes():string;
513
- get expiry():number;
604
+ /**
605
+ * Options for requesting a viewport subscription to a table.
606
+ */
607
+ export interface ViewportSubscriptionOptions extends SubscriptionOptions {
608
+ /**
609
+ * If true, the viewport will be filled starting from the end of the table, where 0 is the last row of the
610
+ * table. Default is false.
611
+ */
612
+ isReverseViewport?:boolean|null;
613
+ /**
614
+ * The rows to include in the viewport. This can be either a {@link dh.RangeSet} or a single range with
615
+ * `first` and `last` properties.
616
+ */
617
+ rows:RangeSet|SimpleRange;
618
+ }
619
+ /**
620
+ * Event data, describing the indexes that were added/removed/updated, and providing access to Rows (and thus data in
621
+ * columns) either by index, or scanning the complete present index.
622
+ * <p>
623
+ * This class supports two ways of reading the table - checking the changes made since the last update, and reading all
624
+ * data currently in the table. While it is more expensive to always iterate over every single row in the table, it may
625
+ * in some cases actually be cheaper than maintaining state separately and updating only the changes, though both
626
+ * options should be considered.
627
+ * <p>
628
+ * The RangeSet objects allow iterating over the LongWrapper indexes in the table. Note that these "indexes" are not
629
+ * necessarily contiguous and may be negative, and represent some internal state on the server, allowing it to keep
630
+ * track of data efficiently. Those LongWrapper objects can be passed to the various methods on this instance to read
631
+ * specific rows or cells out of the table.
632
+ */
633
+ export interface SubscriptionTableData extends TableData {
634
+ get fullIndex():RangeSet;
635
+ /**
636
+ * The ordered set of row indexes removed since the last update
637
+ * @return the rangeset of removed rows
638
+ */
639
+ get removed():RangeSet;
640
+ /**
641
+ * The ordered set of row indexes added since the last update.
642
+ * @return the rangeset of rows added
643
+ */
644
+ get added():RangeSet;
645
+ get columns():Array<Column>;
646
+ /**
647
+ * The ordered set of row indexes updated since the last update
648
+ * @return the rnageset of modified rows
649
+ */
650
+ get modified():RangeSet;
651
+ /**
652
+ * A lazily computed array of all rows available on the client.
653
+ */
654
+ get rows():Array<Row>;
514
655
  }
515
656
  /**
516
657
  * Represents a table which can be joined to another table. Current implementations are {@link dh.Table} and
@@ -602,982 +743,1014 @@ export namespace dh {
602
743
  naturalJoin(rightTable:JoinableTable, columnsToMatch:Array<string>, columnsToAdd?:Array<string>|undefined|null):Promise<Table>;
603
744
  }
604
745
  /**
605
- * Row implementation that also provides additional read-only properties. represents visible rows in the table, but
606
- * with additional properties to reflect the tree structure.
746
+ * Represents the contents of a single widget data message from the server, with a binary data paylod and exported
747
+ * objects. Implemented both by Widget itself and by the `event.details` when data is received by the client.
748
+ *
749
+ * Terminology note: the name of this type should probably use "Data" instead of "Message", and the methods should use
750
+ * "payload" rather than "data" to match other platforms and the protobuf itself. These names are instead used for
751
+ * backwards compatibility and to better follow JS expectations.
607
752
  */
608
- export interface TreeRow extends Row {
609
- get(column:Column):any;
610
- getFormat(column:Column):Format;
753
+ export interface WidgetMessageDetails {
611
754
  /**
612
- * True if this node is currently expanded to show its children; false otherwise. Those children will be the
613
- * rows below this one with a greater depth than this one.
614
- * @return boolean
755
+ * Returns the data from this message as a base64-encoded string.
615
756
  */
616
- get isExpanded():boolean;
757
+ getDataAsBase64():string;
617
758
  /**
618
- * The number of levels above this node; zero for top level nodes. Generally used by the UI to indent the row
619
- * and its expand/collapse icon.
620
- * @return int
759
+ * Returns the data from this message as a Uint8Array.
621
760
  */
622
- get depth():number;
761
+ getDataAsU8():Uint8Array;
623
762
  /**
624
- * True if this node has children and can be expanded; false otherwise. Note that this value may change when the
625
- * table updates, depending on the table's configuration.
626
- * @return boolean
763
+ * Returns the data from this message as a utf-8 string.
627
764
  */
628
- get hasChildren():boolean;
629
- get index():LongWrapper;
630
- }
631
- export interface WorkerHeapInfo {
765
+ getDataAsString():string;
632
766
  /**
633
- * Total heap size available for this worker.
767
+ * Returns an array of exported objects sent from the server. The plugin implementation is now responsible for these
768
+ * objects, and should close them when no longer needed.
634
769
  */
635
- get totalHeapSize():number;
636
- get freeMemory():number;
637
- get maximumHeapSize():number;
770
+ get exportedObjects():WidgetExportedObject[];
638
771
  }
639
772
  /**
640
- * Represents a row available in a subscription/snapshot on the client. Do not retain references to rows - they will
641
- * not function properly when the event isn't actively going off (or promise resolving). Instead, wait for the next
642
- * event, or re-request the viewport data.
773
+ * Simple range consisting only of start and end numbers. Will be migrated to deephaven-core in the near future, and
774
+ * subsequently removed from this the coreplus namespace.
643
775
  */
644
- export interface Row {
645
- get(column:Column):any;
646
- getFormat(column:Column):Format;
647
- get index():LongWrapper;
648
- }
649
- export interface LayoutHints {
650
- readonly searchDisplayMode?:SearchDisplayModeType|null;
651
-
652
- get hiddenColumns():string[]|null;
653
- get frozenColumns():string[]|null;
654
- get columnGroups():ColumnGroup[]|null;
655
- get areSavedLayoutsAllowed():boolean;
656
- get frontColumns():string[]|null;
657
- get backColumns():string[]|null;
776
+ export interface SimpleRange {
777
+ first:number;
778
+ last:number;
658
779
  }
659
780
  /**
660
- * This object may be pooled internally or discarded and not updated. Do not retain references to it.
781
+ * Options for requesting a snapshot of a table.
661
782
  */
662
- export interface Format {
783
+ export interface SnapshotOptions extends DataOptions {
663
784
  /**
664
- * The format string to apply to the value of this cell.
665
- * @return String
785
+ * If true, the snapshot will be filled starting from the end of the table, where 0 is the last row of the
786
+ * table. Default is false.
666
787
  */
667
- readonly formatString?:string|null;
788
+ isReverseViewport?:boolean|null;
668
789
  /**
669
- * Color to apply to the cell's background, in <b>#rrggbb</b> format.
670
- * @return String
790
+ * The rows to include in the snapshot. This can be either a {@link dh.RangeSet} or a single range with
791
+ * `first` and `last` properties.
671
792
  */
672
- readonly backgroundColor?:string|null;
793
+ rows:RangeSet|SimpleRange;
794
+ }
795
+
796
+ /**
797
+ * Represents a set of Tables each corresponding to some key. The keys are available locally, but a call must be made to
798
+ * the server to get each Table. All tables will have the same structure.
799
+ */
800
+ export class PartitionedTable implements HasEventHandling {
673
801
  /**
674
- * Color to apply to the text, in <b>#rrggbb</b> format.
675
- * @return String
802
+ * Indicates that a new key has been added to the array of keys, which can now be fetched with getTable.
676
803
  */
677
- readonly color?:string|null;
804
+ static readonly EVENT_KEYADDED:string;
678
805
  /**
679
- *
680
- * @deprecated Prefer formatString. Number format string to apply to the value in this cell.
806
+ * Indicates that a new key has been added to the array of keys, which can now be fetched with getTable.
681
807
  */
682
- readonly numberFormat?:string|null;
683
- }
684
- /**
685
- * Options for requesting a full-table subscription to a table.
686
- */
687
- export interface SubscriptionOptions extends DataOptions {
808
+ static readonly EVENT_DISCONNECT:string;
688
809
  /**
689
- * Minimum interval between updates, in milliseconds. If not specified, the server default will be used,
690
- * typically 1000ms.
691
- * <p>
692
- * Note that setting this to smaller values will not necessarily result in more frequent updates - the server
693
- * may not propagate updates that frequently, or there may be no updates to propagate.
810
+ * Indicates that a new key has been added to the array of keys, which can now be fetched with getTable.
694
811
  */
695
- updateIntervalMs?:number|null;
696
- }
697
- /**
698
- * Options for requesting a preview of columns when requesting table data. The two properties
699
- * {@link dh.convertArrayToString} and {@link dh.array} are mutually exclusive.
700
- */
701
- export interface PreviewOptions {
812
+ static readonly EVENT_RECONNECT:string;
702
813
  /**
703
- * If true, any array columns will be converted to strings for preview purposes. This is the legacy behavior.
814
+ * Indicates that a new key has been added to the array of keys, which can now be fetched with getTable.
704
815
  */
705
- convertArrayToString?:boolean|null;
816
+ static readonly EVENT_RECONNECTFAILED:string;
817
+
818
+ protected constructor();
819
+
706
820
  /**
707
- * Specifies the length of the array to serialize. If the array is longer than this length, one extra element
708
- * will be included - the client is expected to truncate the array and append "..." to indicate that there are
709
- * additional elements. Negative values indicate that the values should be counted from the end of the array
710
- * rather than the beginning. Zero or null indicate that the entire array should be serialized. The default is
711
- * null.
821
+ * Fetch the table with the given key. If the key does not exist, returns `null`.
822
+ * @param key - The key to fetch. An array of values for each key column, in the same order as the key columns are.
823
+ * @return Promise of dh.Table, or `null` if the key does not exist.
712
824
  */
713
- array?:number|null;
714
- }
715
- /**
716
- * Common interface for various ways of accessing table data and formatting for viewport or non-viewport subscriptions
717
- * on tables, data in trees, and snapshots.
718
- * <p>
719
- * Generally speaking, it is more efficient to access data in column-major order, rather than iterating through each Row
720
- * and accessing all columns that it holds. The {@link rows} accessor can be useful to read row data, but may
721
- * incur other costs - it is likely faster to access data by columns using {@link getData}.
722
- */
723
- export interface TableData {
825
+ getTable(key:object):Promise<Table|undefined|null>;
724
826
  /**
725
- * Reads a row object from the table, from which any subscribed column can be read.
726
- * @param index - the position or key to access
727
- * @return the row at the given location
827
+ * Open a new table that is the result of merging all constituent tables. See
828
+ * {@link io.deephaven.engine.table.PartitionedTable.merge} for details.
829
+ * @return A merged representation of the constituent tables.
728
830
  */
729
- get(index:LongWrapper|number):Row;
831
+ getMergedTable():Promise<Table>;
730
832
  /**
731
- * Reads a specific cell from the table, by row key and column.
732
- * @param index - the row in the table to get data from
733
- * @param column - the column to read
734
- * @return the value in the table
833
+ * The set of all currently known keys. This is kept up to date, so getting the list after adding an event listener
834
+ * for <b>keyadded</b> will ensure no keys are missed.
835
+ * @return Set of Object
735
836
  */
736
- getData(index:LongWrapper|number, column:Column):any;
837
+ getKeys():Set<object>;
737
838
  /**
738
- * The server-specified Format to use for the cell at the given position.
739
- * @param index - the row to read
740
- * @param column - the column to read
741
- * @return a Format instance with any server-specified details
839
+ * Fetch a table containing all the valid keys of the partitioned table.
840
+ * @return Promise of a Table
841
+ * @deprecated
742
842
  */
743
- getFormat(index:LongWrapper|number, column:Column):Format;
744
- get columns():Array<Column>;
843
+ getKeyTable():Promise<Table>;
745
844
  /**
746
- * A lazily computed array of all rows available on the client.
845
+ * Fetch the underlying base table of the partitioned table.
846
+ * @return Promise of a Table
747
847
  */
748
- get rows():Array<Row>;
749
- }
750
- /**
751
- * Event data, describing the indexes that were added/removed/updated, and providing access to Rows (and thus data in
752
- * columns) either by index, or scanning the complete present index.
753
- * <p>
754
- * This class supports two ways of reading the table - checking the changes made since the last update, and reading all
755
- * data currently in the table. While it is more expensive to always iterate over every single row in the table, it may
756
- * in some cases actually be cheaper than maintaining state separately and updating only the changes, though both
757
- * options should be considered.
758
- * <p>
759
- * The RangeSet objects allow iterating over the LongWrapper indexes in the table. Note that these "indexes" are not
760
- * necessarily contiguous and may be negative, and represent some internal state on the server, allowing it to keep
761
- * track of data efficiently. Those LongWrapper objects can be passed to the various methods on this instance to read
762
- * specific rows or cells out of the table.
763
- */
764
- export interface SubscriptionTableData extends TableData {
765
- get fullIndex():RangeSet;
848
+ getBaseTable():Promise<Table>;
766
849
  /**
767
- * The ordered set of row indexes removed since the last update
768
- * @return the rangeset of removed rows
850
+ * Indicates that this PartitionedTable will no longer be used, removing subcriptions to updated keys, etc. This
851
+ * will not affect tables in use.
769
852
  */
770
- get removed():RangeSet;
853
+ close():void;
771
854
  /**
772
- * The ordered set of row indexes added since the last update.
773
- * @return the rangeset of rows added
855
+ * The count of known keys.
856
+ * @return int
774
857
  */
775
- get added():RangeSet;
776
- get columns():Array<Column>;
858
+ get size():number;
777
859
  /**
778
- * The ordered set of row indexes updated since the last update
779
- * @return the rnageset of modified rows
860
+ * An array of the columns in the tables that can be retrieved from this partitioned table, including both key and
861
+ * non-key columns.
862
+ * @return Array of Column
780
863
  */
781
- get modified():RangeSet;
864
+ get columns():Column[];
782
865
  /**
783
- * A lazily computed array of all rows available on the client.
866
+ * An array of all the key columns that the tables are partitioned by.
867
+ * @return Array of Column
784
868
  */
785
- get rows():Array<Row>;
869
+ get keyColumns():Column[];
870
+ /**
871
+ * Listen for events on this object.
872
+ * @param name - the name of the event to listen for
873
+ * @param callback - a function to call when the event occurs
874
+ * @return Returns a cleanup function.
875
+ * @typeParam T - the type of the data that the event will provide
876
+ */
877
+ addEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):()=>void;
878
+ nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<Event<T>>;
879
+ hasListeners(name:string):boolean;
880
+ /**
881
+ * Removes an event listener added to this table.
882
+ * @param name -
883
+ * @param callback -
884
+ * @return
885
+ * @typeParam T -
886
+ */
887
+ removeEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):boolean;
786
888
  }
889
+
787
890
  /**
788
- * Simple range consisting only of start and end numbers. Will be migrated to deephaven-core in the near future, and
789
- * subsequently removed from this the coreplus namespace.
891
+ * Wrap BigDecimal values for use in JS. Provides text formatting for display and access to the underlying value.
790
892
  */
791
- export interface SimpleRange {
792
- first:number;
793
- last:number;
794
- }
795
-
796
- export class DateWrapper extends LongWrapper {
797
- protected constructor();
798
-
799
- static ofJsDate(date:Date):DateWrapper;
800
- asDate():Date;
801
- }
802
-
803
- export class LongWrapper {
893
+ export class BigDecimalWrapper {
804
894
  protected constructor();
805
895
 
806
- static ofString(str:string):LongWrapper;
896
+ static ofString(value:string):BigDecimalWrapper;
807
897
  asNumber():number;
808
898
  valueOf():string;
809
899
  toString():string;
900
+ equals(o:object):boolean;
901
+ hashCode():number;
810
902
  }
811
903
 
812
904
  /**
813
- * Describes a grouping and aggregations for a roll-up table. Pass to the <b>Table.rollup</b> function to create a
814
- * roll-up table.
905
+ * Options for custom columns.
815
906
  */
816
- export class RollupConfig {
817
- /**
818
- * Ordered list of columns to group by to form the hierarchy of the resulting roll-up table.
819
- */
820
- groupingColumns:Array<String>;
821
- /**
822
- * Mapping from each aggregation name to the ordered list of columns it should be applied to in the resulting
823
- * roll-up table.
824
- */
825
- aggregations:{ [key: string]: Array<string>; };
826
- /**
827
- * Optional parameter indicating if an extra leaf node should be added at the bottom of the hierarchy, showing the
828
- * rows in the underlying table which make up that grouping. Since these values might be a different type from the
829
- * rest of the column, any client code must check if TreeRow.hasChildren = false, and if so, interpret those values
830
- * as if they were Column.constituentType instead of Column.type. Defaults to false.
831
- */
832
- includeConstituents:boolean;
833
- includeOriginalColumns?:boolean|null;
907
+ export class CustomColumnOptions {
834
908
  /**
835
- * Optional parameter indicating if original column descriptions should be included. Defaults to true.
909
+ * When specified for custom columns on a rollup table, specifies if the formula apply to rollup or constituent
910
+ * nodes.
836
911
  */
837
- includeDescriptions:boolean;
912
+ rollupNodeType?:RollupNodeTypeType|null;
838
913
 
839
914
  constructor();
840
915
  }
841
916
 
842
917
  /**
843
- * Wrap BigInteger values for use in JS. Provides text formatting for display and access to the underlying value.
918
+ * Deprecated for use in Deephaven Core.
919
+ * @deprecated
844
920
  */
845
- export class BigIntegerWrapper {
921
+ export class Client {
922
+ static readonly EVENT_REQUEST_FAILED:string;
923
+ static readonly EVENT_REQUEST_STARTED:string;
924
+ static readonly EVENT_REQUEST_SUCCEEDED:string;
925
+
926
+ constructor();
927
+ }
928
+
929
+ export class CustomColumn {
930
+ static readonly TYPE_FORMAT_COLOR:string;
931
+ static readonly TYPE_FORMAT_NUMBER:string;
932
+ static readonly TYPE_FORMAT_DATE:string;
933
+ static readonly TYPE_NEW:string;
934
+
846
935
  protected constructor();
847
936
 
848
- static ofString(str:string):BigIntegerWrapper;
849
- asNumber():number;
850
937
  valueOf():string;
851
938
  toString():string;
852
- equals(o:object):boolean;
853
- hashCode():number;
854
- }
855
-
856
- /**
857
- * Describes how a Totals Table will be generated from its parent table. Each table has a default (which may be null)
858
- * indicating how that table was configured when it was declared, and each Totals Table has a similar property
859
- * describing how it was created. Both the <b>Table.getTotalsTable</b> and <b>Table.getGrandTotalsTable</b> methods take
860
- * this config as an optional parameter - without it, the table's default will be used, or if null, a default instance
861
- * of <b>TotalsTableConfig</b> will be supplied.
862
- *
863
- * This class has a no-arg constructor, allowing an instance to be made with the default values provided. However, any
864
- * JS object can be passed in to the methods which accept instances of this type, provided their values adhere to the
865
- * expected formats.
866
- */
867
- export class TotalsTableConfig {
868
- /**
869
- * @deprecated
870
- */
871
- static readonly COUNT:string;
939
+ static from(columnInfo:string):CustomColumn;
872
940
  /**
873
- * @deprecated
941
+ * The expression to evaluate this custom column.
942
+ * @return String
874
943
  */
875
- static readonly MIN:string;
944
+ get expression():string;
876
945
  /**
877
- * @deprecated
946
+ * The name of the column to use.
947
+ * @return String
878
948
  */
879
- static readonly MAX:string;
949
+ get name():string;
880
950
  /**
881
- * @deprecated
951
+ * The options for this custom column.
952
+ * @return CustomColumOptions
882
953
  */
883
- static readonly SUM:string;
954
+ get options():CustomColumnOptions;
884
955
  /**
885
- * @deprecated
886
- */
887
- static readonly ABS_SUM:string;
888
- /**
889
- * @deprecated
956
+ * Type of custom column. One of
957
+ *
958
+ * <ul>
959
+ * <li>FORMAT_COLOR</li>
960
+ * <li>FORMAT_NUMBER</li>
961
+ * <li>FORMAT_DATE</li>
962
+ * <li>NEW</li>
963
+ * </ul>
964
+ * @return String
890
965
  */
891
- static readonly VAR:string;
966
+ get type():string;
967
+ }
968
+
969
+ /**
970
+ * Provides access to data in a table. Note that several methods present their response through Promises. This allows
971
+ * the client to both avoid actually connecting to the server until necessary, and also will permit some changes not to
972
+ * inform the UI right away that they have taken place.
973
+ */
974
+ export class Table implements JoinableTable, HasEventHandling {
975
+ readonly description?:string|null;
976
+ readonly pluginName?:string|null;
977
+ readonly layoutHints?:null|LayoutHints;
892
978
  /**
893
- * @deprecated
979
+ * The table size has updated, so live scrollbars and the like can be updated accordingly.
894
980
  */
895
- static readonly AVG:string;
981
+ static readonly EVENT_SIZECHANGED:string;
896
982
  /**
897
- * @deprecated
983
+ * The table size has updated, so live scrollbars and the like can be updated accordingly.
898
984
  */
899
- static readonly STD:string;
985
+ static readonly EVENT_UPDATED:string;
900
986
  /**
901
- * @deprecated
987
+ * The table size has updated, so live scrollbars and the like can be updated accordingly.
902
988
  */
903
- static readonly FIRST:string;
989
+ static readonly EVENT_ROWADDED:string;
904
990
  /**
905
- * @deprecated
991
+ * The table size has updated, so live scrollbars and the like can be updated accordingly.
906
992
  */
907
- static readonly LAST:string;
993
+ static readonly EVENT_ROWREMOVED:string;
908
994
  /**
909
- * @deprecated
995
+ * The table size has updated, so live scrollbars and the like can be updated accordingly.
910
996
  */
911
- static readonly SKIP:string;
997
+ static readonly EVENT_ROWUPDATED:string;
912
998
  /**
913
- * Specifies if a Totals Table should be expanded by default in the UI. Defaults to false.
999
+ * The table size has updated, so live scrollbars and the like can be updated accordingly.
914
1000
  */
915
- showTotalsByDefault:boolean;
1001
+ static readonly EVENT_SORTCHANGED:string;
916
1002
  /**
917
- * Specifies if a Grand Totals Table should be expanded by default in the UI. Defaults to false.
1003
+ * The table size has updated, so live scrollbars and the like can be updated accordingly.
918
1004
  */
919
- showGrandTotalsByDefault:boolean;
1005
+ static readonly EVENT_FILTERCHANGED:string;
920
1006
  /**
921
- * Specifies the default operation for columns that do not have a specific operation applied; defaults to "Sum".
1007
+ * The table size has updated, so live scrollbars and the like can be updated accordingly.
922
1008
  */
923
- defaultOperation:AggregationOperationType;
1009
+ static readonly EVENT_CUSTOMCOLUMNSCHANGED:string;
924
1010
  /**
925
- * Mapping from each column name to the aggregation(s) that should be applied to that column in the resulting Totals
926
- * Table. If a column is omitted, the defaultOperation is used.
1011
+ * The table size has updated, so live scrollbars and the like can be updated accordingly.
927
1012
  */
928
- operationMap:{ [key: string]: Array<AggregationOperationType>; };
1013
+ static readonly EVENT_DISCONNECT:string;
929
1014
  /**
930
- * Groupings to use when generating the Totals Table. One row will exist for each unique set of values observed in
931
- * these columns. See also `Table.selectDistinct`.
1015
+ * The table size has updated, so live scrollbars and the like can be updated accordingly.
932
1016
  */
933
- groupBy:Array<string>;
934
-
935
- constructor();
936
-
937
- toString():string;
938
- }
939
-
940
- export class QueryInfo {
941
- static readonly EVENT_TABLE_OPENED:string;
942
- static readonly EVENT_DISCONNECT:string;
943
1017
  static readonly EVENT_RECONNECT:string;
944
- static readonly EVENT_CONNECT:string;
945
-
946
- protected constructor();
947
- }
948
-
949
- /**
950
- * A js type for operating on input tables.
951
- *
952
- * Represents a User Input Table, which can have data added to it from other sources.
953
- *
954
- * You may add rows using dictionaries of key-value tuples (representing columns by name), add tables containing all the
955
- * key/value columns to add, or delete tables containing the keys to delete. Each operation is atomic, and will either
956
- * succeed completely or fail completely. To guarantee order of operations, apply an operation and wait for the response
957
- * before sending the next operation.
958
- *
959
- * Each table has one or more key columns, where each unique combination of keys will appear at most once in the table.
960
- *
961
- * To view the results of the Input Table, you should use standard table operations on the InputTable's source Table
962
- * object.
963
- */
964
- export class InputTable {
965
- protected constructor();
966
-
967
1018
  /**
968
- * Adds a single row to the table. For each key or value column name in the Input Table, we retrieve that javascript
969
- * property at that name and validate it can be put into the given column type.
970
- * @param row -
971
- * @param userTimeZone -
972
- * @return Promise of dh.InputTable
1019
+ * The table size has updated, so live scrollbars and the like can be updated accordingly.
973
1020
  */
974
- addRow(row:{ [key: string]: any; }, userTimeZone?:string):Promise<InputTable>;
1021
+ static readonly EVENT_RECONNECTFAILED:string;
975
1022
  /**
976
- * Add multiple rows to a table.
977
- * @param rows -
978
- * @param userTimeZone -
979
- * @return Promise of dh.InputTable
1023
+ * The table size has updated, so live scrollbars and the like can be updated accordingly.
980
1024
  */
981
- addRows(rows:{ [key: string]: any; }[], userTimeZone?:string):Promise<InputTable>;
1025
+ static readonly EVENT_REQUEST_FAILED:string;
982
1026
  /**
983
- * Add an entire table to this Input Table. Only column names that match the definition of the input table will be
984
- * copied, and all key columns must have values filled in. This only copies the current state of the source table;
985
- * future updates to the source table will not be reflected in the Input Table. The returned promise will be
986
- * resolved to the same InputTable instance this method was called upon once the server returns.
987
- * @param tableToAdd -
988
- * @return Promise of dh.InputTable
1027
+ * The table size has updated, so live scrollbars and the like can be updated accordingly.
989
1028
  */
990
- addTable(tableToAdd:Table):Promise<InputTable>;
1029
+ static readonly EVENT_REQUEST_SUCCEEDED:string;
991
1030
  /**
992
- * Add multiple tables to this Input Table.
993
- * @param tablesToAdd -
994
- * @return Promise of dh.InputTable
1031
+ * The size the table will have if it is uncoalesced.
995
1032
  */
996
- addTables(tablesToAdd:Table[]):Promise<InputTable>;
1033
+ static readonly SIZE_UNCOALESCED:number;
1034
+
1035
+ protected constructor();
1036
+
1037
+ batch(userCode:(arg0:unknown)=>void):Promise<Table>;
997
1038
  /**
998
- * Deletes an entire table from this Input Table. Key columns must match the Input Table.
999
- * @param tableToDelete -
1000
- * @return Promise of dh.InputTable
1039
+ * Retrieve a column by the given name. You should prefer to always retrieve a new Column instance instead of
1040
+ * caching a returned value.
1041
+ * @param key -
1042
+ * @return {@link dh.Column}
1001
1043
  */
1002
- deleteTable(tableToDelete:Table):Promise<InputTable>;
1044
+ findColumn(key:string):Column;
1003
1045
  /**
1004
- * Delete multiple tables from this Input Table.
1005
- * @param tablesToDelete -
1006
- * @return
1046
+ * Retrieve multiple columns specified by the given names.
1047
+ * @param keys -
1048
+ * @return {@link dh.Column} array
1007
1049
  */
1008
- deleteTables(tablesToDelete:Table[]):Promise<InputTable>;
1050
+ findColumns(keys:string[]):Column[];
1051
+ isBlinkTable():boolean;
1009
1052
  /**
1010
- * A list of the key columns, by name
1011
- * @return String array.
1053
+ * If .hasInputTable is true, you may call this method to gain access to an InputTable object which can be used to
1054
+ * mutate the data within the table. If the table is not an Input Table, the promise will be immediately rejected.
1055
+ * @return Promise of dh.InputTable
1012
1056
  */
1013
- get keys():string[];
1057
+ inputTable():Promise<InputTable>;
1014
1058
  /**
1015
- * A list of the value columns, by name
1016
- * @return String array.
1059
+ * Indicates that this Table instance will no longer be used, and its connection to the server can be cleaned up.
1017
1060
  */
1018
- get values():string[];
1061
+ close():void;
1062
+ getAttributes():string[];
1019
1063
  /**
1020
- * A list of the key columns.
1021
- * @return Column array.
1064
+ * null if no property exists, a string if it is an easily serializable property, or a ```Promise
1065
+ * &lt;Table&gt;``` that will either resolve with a table or error out if the object can't be passed to JS.
1066
+ * @param attributeName -
1067
+ * @return Object
1022
1068
  */
1023
- get keyColumns():Column[];
1069
+ getAttribute(attributeName:string):unknown|undefined|null;
1024
1070
  /**
1025
- * A list of the value Column objects
1026
- * @return {@link dh.Column} array.
1071
+ * Replace the currently set sort on this table. Returns the previously set value. Note that the sort property will
1072
+ * immediately return the new value, but you may receive update events using the old sort before the new sort is
1073
+ * applied, and the <b>sortchanged</b> event fires. Reusing existing, applied sorts may enable this to perform
1074
+ * better on the server. The <b>updated</b> event will also fire, but <b>rowadded</b> and <b>rowremoved</b> will
1075
+ * not.
1076
+ * @param sort -
1077
+ * @return {@link dh.Sort} array
1027
1078
  */
1028
- get valueColumns():Column[];
1079
+ applySort(sort:Sort[]):Array<Sort>;
1029
1080
  /**
1030
- * The source table for this Input Table
1031
- * @return dh.table
1081
+ * Replace the currently set filters on the table. Returns the previously set value. Note that the filter property
1082
+ * will immediately return the new value, but you may receive update events using the old filter before the new one
1083
+ * is applied, and the <b>filterchanged</b> event fires. Reusing existing, applied filters may enable this to
1084
+ * perform better on the server. The <b>updated</b> event will also fire, but <b>rowadded</b> and <b>rowremoved</b>
1085
+ * will not.
1086
+ * @param filter -
1087
+ * @return {@link dh.FilterCondition} array
1032
1088
  */
1033
- get table():Table;
1034
- }
1035
-
1036
- export class CustomColumn {
1037
- static readonly TYPE_FORMAT_COLOR:string;
1038
- static readonly TYPE_FORMAT_NUMBER:string;
1039
- static readonly TYPE_FORMAT_DATE:string;
1040
- static readonly TYPE_NEW:string;
1041
-
1042
- protected constructor();
1043
-
1044
- valueOf():string;
1045
- toString():string;
1046
- static from(columnInfo:string):CustomColumn;
1089
+ applyFilter(filter:FilterCondition[]):Array<FilterCondition>;
1047
1090
  /**
1048
- * The expression to evaluate this custom column.
1049
- * @return String
1091
+ * used when adding new filter and sort operations to the table, as long as they are present.
1092
+ * @param customColumns -
1093
+ * @return {@link dh.CustomColumn} array
1050
1094
  */
1051
- get expression():string;
1095
+ applyCustomColumns(customColumns:Array<string|CustomColumn>):Array<CustomColumn>;
1052
1096
  /**
1053
- * The name of the column to use.
1054
- * @return String
1097
+ * If the columns parameter is not provided, all columns will be used. If the updateIntervalMs parameter is not
1098
+ * provided, a default of one second will be used. Until this is called, no data will be available. Invoking this
1099
+ * will result in events to be fired once data becomes available, starting with an `updated` event and a
1100
+ * <b>rowadded</b> event per row in that range. The returned object allows the viewport to be closed when no longer
1101
+ * needed.
1102
+ * @param firstRow -
1103
+ * @param lastRow -
1104
+ * @param columns -
1105
+ * @param updateIntervalMs -
1106
+ * @return {@link dh.TableViewportSubscription}
1107
+ * @deprecated Use {@link #createViewportSubscription(Object)} instead.
1055
1108
  */
1056
- get name():string;
1109
+ setViewport(firstRow:number, lastRow:number, columns?:Array<Column>|undefined|null, updateIntervalMs?:number|undefined|null, isReverseViewport?:boolean|undefined|null):TableViewportSubscription;
1057
1110
  /**
1058
- * The options for this custom column.
1059
- * @return CustomColumOptions
1111
+ * Gets the currently visible viewport. If the current set of operations has not yet resulted in data, it will not
1112
+ * resolve until that data is ready. If this table is closed before the promise resolves, it will be rejected - to
1113
+ * separate the lifespan of this promise from the table itself, call
1114
+ * {@link TableViewportSubscription.getViewportData} on the result from {@link Table.setViewport}.
1115
+ * @return Promise of {@link dh.TableData}
1116
+ * @deprecated use {@link TableViewportSubscription#getViewportData()} on the result from
1117
+ * {@link #createViewportSubscription(Object)} instead.
1060
1118
  */
1061
- get options():CustomColumnOptions;
1119
+ getViewportData():Promise<ViewportData>;
1062
1120
  /**
1063
- * Type of custom column. One of
1064
- *
1065
- * <ul>
1066
- * <li>FORMAT_COLOR</li>
1067
- * <li>FORMAT_NUMBER</li>
1068
- * <li>FORMAT_DATE</li>
1069
- * <li>NEW</li>
1070
- * </ul>
1071
- * @return String
1072
- */
1073
- get type():string;
1074
- }
1075
-
1076
- /**
1077
- * Describes a filter which can be applied to a table. Replacing these instances may be more expensive than reusing
1078
- * them. These instances are immutable - all operations that compose them to build bigger expressions return a new
1079
- * instance.
1080
- */
1081
- export class FilterCondition {
1082
- protected constructor();
1083
-
1084
- /**
1085
- * the opposite of this condition
1086
- * @return FilterCondition
1087
- */
1088
- not():FilterCondition;
1089
- /**
1090
- * a condition representing the current condition logically ANDed with the other parameters
1091
- * @param filters -
1092
- * @return FilterCondition
1121
+ * Creates a subscription to the specified columns, across all rows in the table. The optional parameter
1122
+ * updateIntervalMs may be specified to indicate how often the server should send updates, defaulting to one second
1123
+ * if omitted. Useful for charts or taking a snapshot of the table atomically. The initial snapshot will arrive in a
1124
+ * single event, but later changes will be sent as updates. However, this may still be very expensive to run from a
1125
+ * browser for very large tables. Each call to subscribe creates a new subscription, which must have <b>close()</b>
1126
+ * called on it to stop it, and all events are fired from the TableSubscription instance.
1127
+ * @param columns -
1128
+ * @param updateIntervalMs -
1129
+ * @return {@link dh.TableSubscription}
1130
+ * @deprecated Use {@link #createSubscription(Object)} with a {@link DataOptions.SubscriptionOptions} instead.
1093
1131
  */
1094
- and(...filters:FilterCondition[]):FilterCondition;
1132
+ subscribe(columns:Array<Column>, updateIntervalMs?:number):TableSubscription;
1095
1133
  /**
1096
- * a condition representing the current condition logically ORed with the other parameters
1097
- * @param filters -
1098
- * @return FilterCondition.
1134
+ * Creates a subscription to the specified columns, across all rows in the table. Useful for charts or taking a
1135
+ * snapshot of the table atomically. The initial snapshot will arrive in a single event, but later changes will be
1136
+ * sent as updates. However, this may still be very expensive to run from a browser for very large tables. Each call
1137
+ * to `createSubscription` creates a new subscription, which must have {@link io.deephaven.web.client.api.subscription.AbstractTableSubscription.close}
1138
+ * called on it to stop it and release its resources, and all events are fired from the TableSubscription instance.
1139
+ * @param options - options for the subscription; see {@link dh.SubscriptionOptions} for details
1140
+ * @return a new {@link dh.TableSubscription}
1099
1141
  */
1100
- or(...filters:FilterCondition[]):FilterCondition;
1142
+ createSubscription(options:SubscriptionOptions):TableSubscription;
1101
1143
  /**
1102
- * a string suitable for debugging showing the details of this condition.
1103
- * @return String.
1144
+ * Creates a viewport subscription to the specified columns, across the specified rows in the table. The returned
1145
+ * TableViewportSubscription instance allows the viewport to be changed over time, and events are fired from it when
1146
+ * the data changes or when a viewport change has been applied. Each call to `createSubscription` creates a
1147
+ * new subscription, which must have {@link TableViewportSubscription.close} called on it to stop it and release
1148
+ * its resources
1149
+ * @param options - options for the viewport subscription; see {@link dh.ViewportSubscriptionOptions} for
1150
+ * details
1151
+ * @return a new {@link dh.TableViewportSubscription}
1104
1152
  */
1105
- toString():string;
1106
- get columns():Array<Column>;
1153
+ createViewportSubscription(options:ViewportSubscriptionOptions):TableViewportSubscription;
1107
1154
  /**
1108
- * a filter condition invoking a static function with the given parameters. Currently supported Deephaven static
1109
- * functions:
1110
- * <ul>
1111
- * <li><b>inRange</b>: Given three comparable values, returns true if the first is less than the second but greater
1112
- * than the third</li>
1113
- * <li><b>isInf</b>:Returns true if the given number is <i>infinity</i></li>
1114
- * <li><b>isNaN</b>:Returns true if the given number is <i>not a number</i></li>
1115
- * <li><b>isNormal</b>:Returns true if the given number <i>is not null</i>, <i>is not infinity</i>, and <i>is not
1116
- * "not a number"</i></li>
1117
- * <li><b>startsWith</b>:Returns true if the first string starts with the second string</li>
1118
- * <li><b>endsWith</b>Returns true if the first string ends with the second string</li>
1119
- * <li><b>matches</b>:Returns true if the first string argument matches the second string used as a Java regular
1120
- * expression</li>
1121
- * <li><b>contains</b>:Returns true if the first string argument contains the second string as a substring</li>
1122
- * <li><b>in</b>:Returns true if the first string argument can be found in the second array argument.
1123
- * <p>
1124
- * Note that the array can only be specified as a column reference at this time - typically the `FilterValue.in`
1125
- * method should be used in other cases
1126
- * </p>
1127
- * </li>
1128
- * </ul>
1129
- * @param function -
1130
- * @param args -
1131
- * @return dh.FilterCondition
1155
+ * Returns a promise that will resolve to a TableData containing a snapshot of the current state of the table,
1156
+ * within the bounds of the specified rows and columns.
1157
+ * @param options - options for the snapshot; see {@link dh.SnapshotOptions} for details
1158
+ * @return Promise of {@link dh.TableData}
1132
1159
  */
1133
- static invoke(func:string, ...args:FilterValue[]):FilterCondition;
1160
+ createSnapshot(options:SnapshotOptions):Promise<TableData>;
1134
1161
  /**
1135
- * a filter condition which will check if the given value can be found in any supported column on whatever table
1136
- * this FilterCondition is passed to. This FilterCondition is somewhat unique in that it need not be given a column
1137
- * instance, but will adapt to any table. On numeric columns, with a value passed in which can be parsed as a
1138
- * number, the column will be filtered to numbers which equal, or can be "rounded" effectively to this number. On
1139
- * String columns, the given value will match any column which contains this string in a case-insensitive search. An
1140
- * optional second argument can be passed, an array of `FilterValue` from the columns to limit this search to (see
1141
- * {@link dh.Column.filter}).
1142
- * @param value -
1162
+ * a new table containing the distinct tuples of values from the given columns that are present in the original
1163
+ * table. This table can be manipulated as any other table. Sorting is often desired as the default sort is the
1164
+ * order of appearance of values from the original table.
1143
1165
  * @param columns -
1144
- * @return dh.FilterCondition
1166
+ * @return Promise of dh.Table
1145
1167
  */
1146
- static search(value:FilterValue, columns?:FilterValue[]):FilterCondition;
1147
- }
1148
-
1149
- /**
1150
- * Describes a Sort present on the table. No visible constructor, created through the use of Column.sort(), will be tied
1151
- * to that particular column data. Sort instances are immutable, and use a builder pattern to make modifications. All
1152
- * methods return a new Sort instance.
1153
- */
1154
- export class Sort {
1155
- static readonly ASCENDING:string;
1156
- static readonly DESCENDING:string;
1157
- static readonly REVERSE:string;
1158
-
1159
- protected constructor();
1160
-
1168
+ selectDistinct(columns:Column[]):Promise<Table>;
1161
1169
  /**
1162
- * Builds a Sort instance to sort values in ascending order.
1163
- * @return {@link dh.Sort}
1170
+ * Creates a new copy of this table, so it can be sorted and filtered separately, and maintain a different viewport.
1171
+ * @return Promise of dh.Table
1164
1172
  */
1165
- asc():Sort;
1173
+ copy():Promise<Table>;
1166
1174
  /**
1167
- * Builds a Sort instance to sort values in descending order.
1168
- * @return {@link dh.Sort}
1175
+ * a promise that will resolve to a Totals Table of this table. This table will obey the configurations provided as
1176
+ * a parameter, or will use the table's default if no parameter is provided, and be updated once per second as
1177
+ * necessary. Note that multiple calls to this method will each produce a new TotalsTable which must have close()
1178
+ * called on it when not in use.
1179
+ * @param config -
1180
+ * @return Promise of dh.TotalsTable
1169
1181
  */
1170
- desc():Sort;
1182
+ getTotalsTable(config?:TotalsTableConfig|undefined|null):Promise<TotalsTable>;
1171
1183
  /**
1172
- * Builds a Sort instance which takes the absolute value before applying order.
1173
- * @return {@link dh.Sort}
1184
+ * a promise that will resolve to a Totals Table of this table, ignoring any filters. See <b>getTotalsTable()</b>
1185
+ * above for more specifics.
1186
+ * @param config -
1187
+ * @return promise of dh.TotalsTable
1174
1188
  */
1175
- abs():Sort;
1176
- toString():string;
1189
+ getGrandTotalsTable(config?:TotalsTableConfig|undefined|null):Promise<TotalsTable>;
1177
1190
  /**
1178
- * True if the absolute value of the column should be used when sorting; defaults to false.
1179
- * @return boolean
1191
+ * a promise that will resolve to a new roll-up <b>TreeTable</b> of this table. Multiple calls to this method will
1192
+ * each produce a new <b>TreeTable</b> which must have close() called on it when not in use.
1193
+ * @param configObject -
1194
+ * @return Promise of dh.TreeTable
1180
1195
  */
1181
- get isAbs():boolean;
1196
+ rollup(configObject:RollupConfig):Promise<TreeTable>;
1182
1197
  /**
1183
- * The column which is sorted.
1184
- * @return {@link dh.Column}
1198
+ * a promise that will resolve to a new `TreeTable` of this table. Multiple calls to this method will each produce a
1199
+ * new `TreeTable` which must have close() called on it when not in use.
1200
+ * @param configObject -
1201
+ * @return Promise dh.TreeTable
1185
1202
  */
1186
- get column():Column;
1203
+ treeTable(configObject:TreeTableConfig):Promise<TreeTable>;
1187
1204
  /**
1188
- * The direction of this sort, either <b>ASC</b>, <b>DESC</b>, or <b>REVERSE</b>.
1189
- * @return String
1205
+ * a "frozen" version of this table (a server-side snapshot of the entire source table). Viewports on the frozen
1206
+ * table will not update. This does not change the original table, and the new table will not have any of the client
1207
+ * side sorts/filters/columns. New client side sorts/filters/columns can be added to the frozen copy.
1208
+ * @return Promise of dh.Table
1190
1209
  */
1191
- get direction():string;
1192
- }
1193
-
1194
- /**
1195
- * Options for custom columns.
1196
- */
1197
- export class CustomColumnOptions {
1210
+ freeze():Promise<Table>;
1211
+ snapshot(baseTable:Table, doInitialSnapshot?:boolean, stampColumns?:string[]):Promise<Table>;
1198
1212
  /**
1199
- * When specified for custom columns on a rollup table, specifies if the formula apply to rollup or constituent
1200
- * nodes.
1213
+ *
1214
+ * @inheritDoc
1215
+ * @deprecated
1201
1216
  */
1202
- rollupNodeType?:RollupNodeTypeType|null;
1203
-
1204
- constructor();
1205
- }
1206
-
1207
- /**
1208
- * Exists to keep the dh.TableMap namespace so that the web UI can remain compatible with the DHE API, which still calls
1209
- * this type TableMap.
1210
- * @deprecated
1211
- */
1212
- export class TableMap {
1213
- static readonly EVENT_KEYADDED:string;
1214
- static readonly EVENT_DISCONNECT:string;
1215
- static readonly EVENT_RECONNECT:string;
1216
- static readonly EVENT_RECONNECTFAILED:string;
1217
-
1218
- protected constructor();
1219
- }
1220
-
1221
- /**
1222
- * Provides access to data in a table. Note that several methods present their response through Promises. This allows
1223
- * the client to both avoid actually connecting to the server until necessary, and also will permit some changes not to
1224
- * inform the UI right away that they have taken place.
1225
- */
1226
- export class Table implements JoinableTable, HasEventHandling {
1227
- readonly description?:string|null;
1228
- readonly pluginName?:string|null;
1229
- readonly layoutHints?:null|LayoutHints;
1217
+ join(joinType:string, rightTable:JoinableTable, columnsToMatch:Array<string>, columnsToAdd?:Array<string>|undefined|null, asOfMatchRule?:string|undefined|null):Promise<Table>;
1218
+ asOfJoin(rightTable:JoinableTable, columnsToMatch:Array<string>, columnsToAdd?:Array<string>|undefined|null, asOfMatchRule?:string|undefined|null):Promise<Table>;
1219
+ crossJoin(rightTable:JoinableTable, columnsToMatch:Array<string>, columnsToAdd?:Array<string>|undefined|null, reserveBits?:number|undefined|null):Promise<Table>;
1220
+ exactJoin(rightTable:JoinableTable, columnsToMatch:Array<string>, columnsToAdd?:Array<string>):Promise<Table>;
1221
+ naturalJoin(rightTable:JoinableTable, columnsToMatch:Array<string>, columnsToAdd?:Array<string>):Promise<Table>;
1222
+ byExternal(keys:object, dropKeys?:boolean):Promise<PartitionedTable>;
1230
1223
  /**
1231
- * The table size has updated, so live scrollbars and the like can be updated accordingly.
1224
+ * Creates a new PartitionedTable from the contents of the current table, partitioning data based on the specified
1225
+ * keys.
1226
+ * @param keys -
1227
+ * @param dropKeys -
1228
+ * @return Promise dh.PartitionedTable
1232
1229
  */
1233
- static readonly EVENT_SIZECHANGED:string;
1230
+ partitionBy(keys:object, dropKeys?:boolean):Promise<PartitionedTable>;
1234
1231
  /**
1235
- * The table size has updated, so live scrollbars and the like can be updated accordingly.
1232
+ * a promise that will resolve to ColumnStatistics for the column of this table.
1233
+ * @param column -
1234
+ * @return Promise of dh.ColumnStatistics
1236
1235
  */
1237
- static readonly EVENT_UPDATED:string;
1236
+ getColumnStatistics(column:Column):Promise<ColumnStatistics>;
1238
1237
  /**
1239
- * The table size has updated, so live scrollbars and the like can be updated accordingly.
1238
+ * Seek the row matching the data provided
1239
+ * @param startingRow - Row to start the seek from
1240
+ * @param column - Column to seek for value on
1241
+ * @param valueType - Type of value provided
1242
+ * @param seekValue - Value to seek
1243
+ * @param insensitive - Optional value to flag a search as case-insensitive. Defaults to `false`.
1244
+ * @param contains - Optional value to have the seek value do a contains search instead of exact equality. Defaults to
1245
+ * `false`.
1246
+ * @param isBackwards - Optional value to seek backwards through the table instead of forwards. Defaults to `false`.
1247
+ * @return A promise that resolves to the row value found.
1240
1248
  */
1241
- static readonly EVENT_ROWADDED:string;
1249
+ seekRow(startingRow:number, column:Column, valueType:ValueTypeType, seekValue:any, insensitive?:boolean|undefined|null, contains?:boolean|undefined|null, isBackwards?:boolean|undefined|null):Promise<number>;
1250
+ toString():string;
1242
1251
  /**
1243
- * The table size has updated, so live scrollbars and the like can be updated accordingly.
1252
+ * True if this table represents a user Input Table (created by InputTable.newInputTable). When true, you may call
1253
+ * .inputTable() to add or remove data from the underlying table.
1254
+ * @return boolean
1244
1255
  */
1245
- static readonly EVENT_ROWREMOVED:string;
1256
+ get hasInputTable():boolean;
1246
1257
  /**
1247
- * The table size has updated, so live scrollbars and the like can be updated accordingly.
1258
+ * The columns that are present on this table. This is always all possible columns. If you specify fewer columns in
1259
+ * .setViewport(), you will get only those columns in your ViewportData. <b>Number size</b> The total count of rows
1260
+ * in the table. The size can and will change; see the <b>sizechanged</b> event for details. Size will be negative
1261
+ * in exceptional cases (eg. the table is uncoalesced, see the <b>isUncoalesced</b> property for details).
1262
+ * @return {@link dh.Column} array
1248
1263
  */
1249
- static readonly EVENT_ROWUPDATED:string;
1264
+ get columns():Array<Column>;
1250
1265
  /**
1251
- * The table size has updated, so live scrollbars and the like can be updated accordingly.
1266
+ * The default configuration to be used when building a <b>TotalsTable</b> for this table.
1267
+ * @return dh.TotalsTableConfig
1252
1268
  */
1253
- static readonly EVENT_SORTCHANGED:string;
1269
+ get totalsTableConfig():TotalsTableConfig;
1254
1270
  /**
1255
- * The table size has updated, so live scrollbars and the like can be updated accordingly.
1271
+ * An ordered list of Sorts to apply to the table. To update, call <b>applySort()</b>. Note that this getter will
1272
+ * return the new value immediately, even though it may take a little time to update on the server. You may listen
1273
+ * for the <b>sortchanged</b> event to know when to update the UI.
1274
+ * @return {@link dh.Sort} array
1256
1275
  */
1257
- static readonly EVENT_FILTERCHANGED:string;
1276
+ get sort():Array<Sort>;
1258
1277
  /**
1259
- * The table size has updated, so live scrollbars and the like can be updated accordingly.
1278
+ * An ordered list of custom column formulas to add to the table, either adding new columns or replacing existing
1279
+ * ones. To update, call <b>applyCustomColumns()</b>.
1280
+ * @return {@link dh.CustomColumn} array
1260
1281
  */
1261
- static readonly EVENT_CUSTOMCOLUMNSCHANGED:string;
1282
+ get customColumns():Array<CustomColumn>;
1262
1283
  /**
1263
- * The table size has updated, so live scrollbars and the like can be updated accordingly.
1284
+ * True if this table may receive updates from the server, including size changed events, updated events after
1285
+ * initial snapshot.
1286
+ * @return boolean
1264
1287
  */
1265
- static readonly EVENT_DISCONNECT:string;
1288
+ get isRefreshing():boolean;
1266
1289
  /**
1267
- * The table size has updated, so live scrollbars and the like can be updated accordingly.
1290
+ * An ordered list of Filters to apply to the table. To update, call applyFilter(). Note that this getter will
1291
+ * return the new value immediately, even though it may take a little time to update on the server. You may listen
1292
+ * for the <b>filterchanged</b> event to know when to update the UI.
1293
+ * @return {@link dh.FilterCondition} array
1268
1294
  */
1269
- static readonly EVENT_RECONNECT:string;
1295
+ get filter():Array<FilterCondition>;
1270
1296
  /**
1271
- * The table size has updated, so live scrollbars and the like can be updated accordingly.
1297
+ * The total count of the rows in the table, excluding any filters. Unlike {@link Table.size}, changes to this value
1298
+ * will not result in any event. If the table is unfiltered, this will return the same size as {@link Table.size}.
1299
+ * If this table was uncoalesced before it was filtered, this will return {@link dh.Table.SIZE_UNCOALESCED}.
1300
+ * @return the size of the table before filters, or {@link dh.Table.SIZE_UNCOALESCED}
1272
1301
  */
1273
- static readonly EVENT_RECONNECTFAILED:string;
1302
+ get totalSize():number;
1274
1303
  /**
1275
- * The table size has updated, so live scrollbars and the like can be updated accordingly.
1304
+ * The total count of rows in the table. If there is a viewport subscription active, this size will be updated when
1305
+ * the subscription updates. If not, and {@link Table.uncoalesced} is true, the size will be
1306
+ * {@link dh.Table.SIZE_UNCOALESCED}. Otherwise, the size will be updated when the server's update graph processes changes.
1307
+ * <p>
1308
+ * When the size changes, the {@link dh.Table.EVENT_SIZECHANGED} event will be fired.
1309
+ * @return the size of the table, or {@link dh.Table.SIZE_UNCOALESCED} if there is no subscription and the table is
1310
+ * uncoalesced.
1276
1311
  */
1277
- static readonly EVENT_REQUEST_FAILED:string;
1312
+ get size():number;
1278
1313
  /**
1279
- * The table size has updated, so live scrollbars and the like can be updated accordingly.
1314
+ * True if this table has been closed.
1315
+ * @return boolean
1280
1316
  */
1281
- static readonly EVENT_REQUEST_SUCCEEDED:string;
1317
+ get isClosed():boolean;
1282
1318
  /**
1283
- * The size the table will have if it is uncoalesced.
1319
+ * Read-only. True if this table is uncoalesced, indicating that work must be done before the table can be used.
1320
+ * <p>
1321
+ * Uncoalesced tables are expensive to operate on - filter to a single partition or range of partitions before
1322
+ * subscribing to access only the desired data efficiently. A subscription can be specified without a filter, but
1323
+ * this can be very expensive. To see which partitions are available, check each column on the table to see which
1324
+ * have {@link Column.isPartitionColumn} as `true`, and filter those columns. To read the possible values
1325
+ * for those columns, use {@link Table.selectDistinct}.
1326
+ * @return True if the table is uncoaleced and should be filtered before operating on it, otherwise false.
1284
1327
  */
1285
- static readonly SIZE_UNCOALESCED:number;
1328
+ get isUncoalesced():boolean;
1329
+ /**
1330
+ * Listen for events on this object.
1331
+ * @param name - the name of the event to listen for
1332
+ * @param callback - a function to call when the event occurs
1333
+ * @return Returns a cleanup function.
1334
+ * @typeParam T - the type of the data that the event will provide
1335
+ */
1336
+ addEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):()=>void;
1337
+ nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<Event<T>>;
1338
+ hasListeners(name:string):boolean;
1339
+ /**
1340
+ * Removes an event listener added to this table.
1341
+ * @param name -
1342
+ * @param callback -
1343
+ * @return
1344
+ * @typeParam T -
1345
+ */
1346
+ removeEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):boolean;
1347
+ /**
1348
+ * a Sort than can be used to reverse a table. This can be passed into n array in applySort. Note that Tree Tables
1349
+ * do not support reverse.
1350
+ * @return {@link dh.Sort}
1351
+ */
1352
+ static reverse():Sort;
1353
+ }
1354
+
1355
+
1356
+ /**
1357
+ * A Widget represents a server side object that sends one or more responses to the client. The client can then
1358
+ * interpret these responses to see what to render, or how to respond.
1359
+ * <p>
1360
+ * Most custom object types result in a single response being sent to the client, often with other exported objects, but
1361
+ * some will have streamed responses, and allow the client to send follow-up requests of its own. This class's API is
1362
+ * backwards compatible, but as such does not offer a way to tell the difference between a streaming or non-streaming
1363
+ * object type, the client code that handles the payloads is expected to know what to expect. See
1364
+ * {@link dh.WidgetMessageDetails} for more information.
1365
+ * <p>
1366
+ * When the promise that returns this object resolves, it will have the first response assigned to its fields. Later
1367
+ * responses from the server will be emitted as "message" events. When the connection with the server ends, the "close"
1368
+ * event will be emitted. In this way, the connection will behave roughly in the same way as a WebSocket - either side
1369
+ * can close, and after close no more messages will be processed. There can be some latency in closing locally while
1370
+ * remote messages are still pending - it is up to implementations of plugins to handle this case.
1371
+ * <p>
1372
+ * Also like WebSockets, the plugin API doesn't define how to serialize messages, and just handles any binary payloads.
1373
+ * What it does handle however, is allowing those messages to include references to server-side objects with those
1374
+ * payloads. Those server side objects might be tables or other built-in types in the Deephaven JS API, or could be
1375
+ * objects usable through their own plugins. They also might have no plugin at all, allowing the client to hold a
1376
+ * reference to them and pass them back to the server, either to the current plugin instance, or through another API.
1377
+ * The `Widget` type does not specify how those objects should be used or their lifecycle, but leaves that
1378
+ * entirely to the plugin. Messages will arrive in the order they were sent.
1379
+ * <p>
1380
+ * This can suggest several patterns for how plugins operate:
1381
+ * <ul>
1382
+ * <li>The plugin merely exists to transport some other object to the client. This can be useful for objects which can
1383
+ * easily be translated to some other type (like a Table) when the user clicks on it. An example of this is
1384
+ * `pandas.DataFrame` will result in a widget that only contains a static
1385
+ * {@link dh.Table}. Presently, the widget is immediately closed, and only the Table is
1386
+ * provided to the JS API consumer.</li>
1387
+ * <li>The plugin provides references to Tables and other objects, and those objects can live longer than the object
1388
+ * which provided them. One concrete example of this could have been
1389
+ * {@link dh.PartitionedTable} when fetching constituent tables, but it was implemented
1390
+ * before bidirectional plugins were implemented. Another example of this is plugins that serve as a "factory", giving
1391
+ * the user access to table manipulation/creation methods not supported by gRPC or the JS API.</li>
1392
+ * <li>The plugin provides reference to Tables and other objects that only make sense within the context of the widget
1393
+ * instance, so when the widget goes away, those objects should be released as well. This is also an example of
1394
+ * {@link dh.PartitionedTable}, as the partitioned table tracks creation of new keys through
1395
+ * an internal table instance.</li>
1396
+ * </ul>
1397
+ *
1398
+ * Handling server objects in messages also has more than one potential pattern that can be used:
1399
+ * <ul>
1400
+ * <li>One object per message - the message clearly is about that object, no other details required.</li>
1401
+ * <li>Objects indexed within their message - as each message comes with a list of objects, those objects can be
1402
+ * referenced within the payload by index. This is roughly how {@link dh.plot.Figure}
1403
+ * behaves, where the figure descriptor schema includes an index for each created series, describing which table should
1404
+ * be used, which columns should be mapped to each axis.</li>
1405
+ * <li>Objects indexed since widget creation - each message would append its objects to a list created when the widget
1406
+ * was first made, and any new exports that arrive in a new message would be appended to that list. Then, subsequent
1407
+ * messages can reference objects already sent. This imposes a limitation where the client cannot release any exports
1408
+ * without the server somehow signaling that it will never reference that export again.</li>
1409
+ * </ul>
1410
+ */
1411
+ export class Widget implements WidgetMessageDetails, HasEventHandling {
1412
+ static readonly EVENT_MESSAGE:string;
1413
+ static readonly EVENT_CLOSE:string;
1286
1414
 
1287
1415
  protected constructor();
1288
1416
 
1289
- batch(userCode:(arg0:unknown)=>void):Promise<Table>;
1290
1417
  /**
1291
- * Retrieve a column by the given name. You should prefer to always retrieve a new Column instance instead of
1292
- * caching a returned value.
1293
- * @param key -
1294
- * @return {@link dh.Column}
1418
+ * Ends the client connection to the server.
1295
1419
  */
1296
- findColumn(key:string):Column;
1420
+ close():void;
1421
+ getDataAsBase64():string;
1422
+ getDataAsU8():Uint8Array;
1423
+ getDataAsString():string;
1297
1424
  /**
1298
- * Retrieve multiple columns specified by the given names.
1299
- * @param keys -
1300
- * @return {@link dh.Column} array
1425
+ * Sends a string/bytes payload to the server, along with references to objects that exist on the server.
1426
+ * @param msg - string/buffer/view instance that represents data to send
1427
+ * @param references - an array of objects that can be safely sent to the server
1301
1428
  */
1302
- findColumns(keys:string[]):Column[];
1303
- isBlinkTable():boolean;
1429
+ sendMessage(msg:string|ArrayBuffer|ArrayBufferView, references?:Array<Table|Widget|WidgetExportedObject|PartitionedTable|TotalsTable|TreeTable>):void;
1430
+ addEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):()=>void;
1431
+ nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<Event<T>>;
1432
+ hasListeners(name:string):boolean;
1433
+ removeEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):boolean;
1304
1434
  /**
1305
- * If .hasInputTable is true, you may call this method to gain access to an InputTable object which can be used to
1306
- * mutate the data within the table. If the table is not an Input Table, the promise will be immediately rejected.
1307
- * @return Promise of dh.InputTable
1435
+ *
1436
+ * @return the exported objects sent in the initial message from the server. The client is responsible for closing
1437
+ * them when finished using them.
1308
1438
  */
1309
- inputTable():Promise<InputTable>;
1439
+ get exportedObjects():WidgetExportedObject[];
1310
1440
  /**
1311
- * Indicates that this Table instance will no longer be used, and its connection to the server can be cleaned up.
1441
+ *
1442
+ * @return the type of this widget
1312
1443
  */
1313
- close():void;
1314
- getAttributes():string[];
1444
+ get type():string;
1445
+ }
1446
+
1447
+ /**
1448
+ * Describes a grouping and aggregations for a roll-up table. Pass to the <b>Table.rollup</b> function to create a
1449
+ * roll-up table.
1450
+ */
1451
+ export class RollupConfig {
1315
1452
  /**
1316
- * null if no property exists, a string if it is an easily serializable property, or a ```Promise
1317
- * &lt;Table&gt;``` that will either resolve with a table or error out if the object can't be passed to JS.
1318
- * @param attributeName -
1319
- * @return Object
1453
+ * Ordered list of columns to group by to form the hierarchy of the resulting roll-up table.
1320
1454
  */
1321
- getAttribute(attributeName:string):unknown|undefined|null;
1455
+ groupingColumns:Array<String>;
1322
1456
  /**
1323
- * Replace the currently set sort on this table. Returns the previously set value. Note that the sort property will
1324
- * immediately return the new value, but you may receive update events using the old sort before the new sort is
1325
- * applied, and the <b>sortchanged</b> event fires. Reusing existing, applied sorts may enable this to perform
1326
- * better on the server. The <b>updated</b> event will also fire, but <b>rowadded</b> and <b>rowremoved</b> will
1327
- * not.
1328
- * @param sort -
1329
- * @return {@link dh.Sort} array
1457
+ * Mapping from each aggregation name to the ordered list of columns it should be applied to in the resulting
1458
+ * roll-up table.
1330
1459
  */
1331
- applySort(sort:Sort[]):Array<Sort>;
1460
+ aggregations:{ [key: string]: Array<string>; };
1332
1461
  /**
1333
- * Replace the currently set filters on the table. Returns the previously set value. Note that the filter property
1334
- * will immediately return the new value, but you may receive update events using the old filter before the new one
1335
- * is applied, and the <b>filterchanged</b> event fires. Reusing existing, applied filters may enable this to
1336
- * perform better on the server. The <b>updated</b> event will also fire, but <b>rowadded</b> and <b>rowremoved</b>
1337
- * will not.
1338
- * @param filter -
1339
- * @return {@link dh.FilterCondition} array
1462
+ * Optional parameter indicating if an extra leaf node should be added at the bottom of the hierarchy, showing the
1463
+ * rows in the underlying table which make up that grouping. Since these values might be a different type from the
1464
+ * rest of the column, any client code must check if TreeRow.hasChildren = false, and if so, interpret those values
1465
+ * as if they were Column.constituentType instead of Column.type. Defaults to false.
1340
1466
  */
1341
- applyFilter(filter:FilterCondition[]):Array<FilterCondition>;
1467
+ includeConstituents:boolean;
1468
+ includeOriginalColumns?:boolean|null;
1342
1469
  /**
1343
- * used when adding new filter and sort operations to the table, as long as they are present.
1344
- * @param customColumns -
1345
- * @return {@link dh.CustomColumn} array
1470
+ * Optional parameter indicating if original column descriptions should be included. Defaults to true.
1346
1471
  */
1347
- applyCustomColumns(customColumns:Array<string|CustomColumn>):Array<CustomColumn>;
1472
+ includeDescriptions:boolean;
1473
+
1474
+ constructor();
1475
+ }
1476
+
1477
+ export class LongWrapper {
1478
+ protected constructor();
1479
+
1480
+ static ofString(str:string):LongWrapper;
1481
+ asNumber():number;
1482
+ valueOf():string;
1483
+ toString():string;
1484
+ }
1485
+
1486
+ /**
1487
+ * Exists to keep the dh.TableMap namespace so that the web UI can remain compatible with the DHE API, which still calls
1488
+ * this type TableMap.
1489
+ * @deprecated
1490
+ */
1491
+ export class TableMap {
1492
+ static readonly EVENT_KEYADDED:string;
1493
+ static readonly EVENT_DISCONNECT:string;
1494
+ static readonly EVENT_RECONNECT:string;
1495
+ static readonly EVENT_RECONNECTFAILED:string;
1496
+
1497
+ protected constructor();
1498
+ }
1499
+
1500
+ /**
1501
+ * This class allows iteration over non-contiguous indexes. In the future, this will support the EcmaScript 2015
1502
+ * Iteration protocol, but for now has one method which returns an iterator, and also supports querying the size.
1503
+ * Additionally, we may add support for creating RangeSet objects to better serve some use cases.
1504
+ */
1505
+ export class RangeSet {
1506
+ protected constructor();
1507
+
1508
+ static ofRange(first:number, last:number):RangeSet;
1509
+ static ofItems(rows:number[]):RangeSet;
1510
+ static ofRanges(ranges:RangeSet[]):RangeSet;
1511
+ static ofSortedRanges(ranges:RangeSet[]):RangeSet;
1348
1512
  /**
1349
- * If the columns parameter is not provided, all columns will be used. If the updateIntervalMs parameter is not
1350
- * provided, a default of one second will be used. Until this is called, no data will be available. Invoking this
1351
- * will result in events to be fired once data becomes available, starting with an `updated` event and a
1352
- * <b>rowadded</b> event per row in that range. The returned object allows the viewport to be closed when no longer
1353
- * needed.
1354
- * @param firstRow -
1355
- * @param lastRow -
1356
- * @param columns -
1357
- * @param updateIntervalMs -
1358
- * @return {@link dh.TableViewportSubscription}
1359
- * @deprecated Use {@link #createViewportSubscription(Object)} instead.
1513
+ * a new iterator over all indexes in this collection.
1514
+ * @return Iterator of {@link dh.LongWrapper}
1360
1515
  */
1361
- setViewport(firstRow:number, lastRow:number, columns?:Array<Column>|undefined|null, updateIntervalMs?:number|undefined|null, isReverseViewport?:boolean|undefined|null):TableViewportSubscription;
1516
+ iterator():Iterator<LongWrapper>;
1362
1517
  /**
1363
- * Gets the currently visible viewport. If the current set of operations has not yet resulted in data, it will not
1364
- * resolve until that data is ready. If this table is closed before the promise resolves, it will be rejected - to
1365
- * separate the lifespan of this promise from the table itself, call
1366
- * {@link TableViewportSubscription.getViewportData} on the result from {@link Table.setViewport}.
1367
- * @return Promise of {@link dh.TableData}
1368
- * @deprecated use {@link TableViewportSubscription#getViewportData()} on the result from
1369
- * {@link #createViewportSubscription(Object)} instead.
1518
+ * The total count of items contained in this collection. In some cases this can be expensive to compute, and
1519
+ * generally should not be needed except for debugging purposes, or preallocating space (i.e., do not call this
1520
+ * property each time through a loop).
1521
+ * @return double
1370
1522
  */
1371
- getViewportData():Promise<ViewportData>;
1523
+ get size():number;
1524
+ }
1525
+
1526
+ /**
1527
+ * Wrap BigInteger values for use in JS. Provides text formatting for display and access to the underlying value.
1528
+ */
1529
+ export class BigIntegerWrapper {
1530
+ protected constructor();
1531
+
1532
+ static ofString(str:string):BigIntegerWrapper;
1533
+ asNumber():number;
1534
+ valueOf():string;
1535
+ toString():string;
1536
+ equals(o:object):boolean;
1537
+ hashCode():number;
1538
+ }
1539
+
1540
+ /**
1541
+ * Describes data that can be filtered, either a column reference or a literal value. Used this way, the type of a value
1542
+ * can be specified so that values which are ambiguous or not well supported in JS will not be confused with Strings or
1543
+ * imprecise numbers (e.g., nanosecond-precision date values). Additionally, once wrapped in this way, methods can be
1544
+ * called on these value literal instances. These instances are immutable - any method called on them returns a new
1545
+ * instance.
1546
+ */
1547
+ export class FilterValue {
1548
+ protected constructor();
1549
+
1372
1550
  /**
1373
- * Creates a subscription to the specified columns, across all rows in the table. The optional parameter
1374
- * updateIntervalMs may be specified to indicate how often the server should send updates, defaulting to one second
1375
- * if omitted. Useful for charts or taking a snapshot of the table atomically. The initial snapshot will arrive in a
1376
- * single event, but later changes will be sent as updates. However, this may still be very expensive to run from a
1377
- * browser for very large tables. Each call to subscribe creates a new subscription, which must have <b>close()</b>
1378
- * called on it to stop it, and all events are fired from the TableSubscription instance.
1379
- * @param columns -
1380
- * @param updateIntervalMs -
1381
- * @return {@link dh.TableSubscription}
1382
- * @deprecated Use {@link #createSubscription(Object)} with a {@link DataOptions.SubscriptionOptions} instead.
1551
+ * Constructs a number for the filter API from the given parameter. Can also be used on the values returned from
1552
+ * {@link TableData.get} for DateTime values. To create
1553
+ * a filter with a date, use <b>dh.DateWrapper.ofJsDate</b> or
1554
+ * {@link i18n.DateTimeFormat.parse}. To create a filter with a
1555
+ * 64-bit long integer, use {@link LongWrapper.ofString}.
1556
+ * @param input - the number to wrap as a FilterValue
1557
+ * @return an immutable FilterValue that can be built into a filter
1383
1558
  */
1384
- subscribe(columns:Array<Column>, updateIntervalMs?:number):TableSubscription;
1559
+ static ofNumber(input:LongWrapper|number):FilterValue;
1385
1560
  /**
1386
- * Creates a subscription to the specified columns, across all rows in the table. Useful for charts or taking a
1387
- * snapshot of the table atomically. The initial snapshot will arrive in a single event, but later changes will be
1388
- * sent as updates. However, this may still be very expensive to run from a browser for very large tables. Each call
1389
- * to `createSubscription` creates a new subscription, which must have {@link io.deephaven.web.client.api.subscription.AbstractTableSubscription.close}
1390
- * called on it to stop it and release its resources, and all events are fired from the TableSubscription instance.
1391
- * @param options - options for the subscription; see {@link dh.SubscriptionOptions} for details
1392
- * @return a new {@link dh.TableSubscription}
1561
+ * a filter condition checking if the current value is equal to the given parameter
1562
+ * @param term -
1563
+ * @return {@link dh.FilterCondition}
1393
1564
  */
1394
- createSubscription(options:SubscriptionOptions):TableSubscription;
1565
+ eq(term:FilterValue):FilterCondition;
1395
1566
  /**
1396
- * Creates a viewport subscription to the specified columns, across the specified rows in the table. The returned
1397
- * TableViewportSubscription instance allows the viewport to be changed over time, and events are fired from it when
1398
- * the data changes or when a viewport change has been applied. Each call to `createSubscription` creates a
1399
- * new subscription, which must have {@link TableViewportSubscription.close} called on it to stop it and release
1400
- * its resources
1401
- * @param options - options for the viewport subscription; see {@link dh.ViewportSubscriptionOptions} for
1402
- * details
1403
- * @return a new {@link dh.TableViewportSubscription}
1567
+ * a filter condition checking if the current value is equal to the given parameter, ignoring differences of upper
1568
+ * vs lower case
1569
+ * @param term -
1570
+ * @return {@link dh.FilterCondition}
1404
1571
  */
1405
- createViewportSubscription(options:ViewportSubscriptionOptions):TableViewportSubscription;
1572
+ eqIgnoreCase(term:FilterValue):FilterCondition;
1406
1573
  /**
1407
- * Returns a promise that will resolve to a TableData containing a snapshot of the current state of the table,
1408
- * within the bounds of the specified rows and columns.
1409
- * @param options - options for the snapshot; see {@link dh.SnapshotOptions} for details
1410
- * @return Promise of {@link dh.TableData}
1574
+ * a filter condition checking if the current value is not equal to the given parameter
1575
+ * @param term -
1576
+ * @return {@link dh.FilterCondition}
1411
1577
  */
1412
- createSnapshot(options:SnapshotOptions):Promise<TableData>;
1578
+ notEq(term:FilterValue):FilterCondition;
1413
1579
  /**
1414
- * a new table containing the distinct tuples of values from the given columns that are present in the original
1415
- * table. This table can be manipulated as any other table. Sorting is often desired as the default sort is the
1416
- * order of appearance of values from the original table.
1417
- * @param columns -
1418
- * @return Promise of dh.Table
1580
+ * a filter condition checking if the current value is not equal to the given parameter, ignoring differences of
1581
+ * upper vs lower case
1582
+ * @param term -
1583
+ * @return {@link dh.FilterCondition}
1419
1584
  */
1420
- selectDistinct(columns:Column[]):Promise<Table>;
1585
+ notEqIgnoreCase(term:FilterValue):FilterCondition;
1421
1586
  /**
1422
- * Creates a new copy of this table, so it can be sorted and filtered separately, and maintain a different viewport.
1423
- * @return Promise of dh.Table
1587
+ * a filter condition checking if the current value is greater than the given parameter
1588
+ * @param term -
1589
+ * @return {@link dh.FilterCondition}
1424
1590
  */
1425
- copy():Promise<Table>;
1591
+ greaterThan(term:FilterValue):FilterCondition;
1426
1592
  /**
1427
- * a promise that will resolve to a Totals Table of this table. This table will obey the configurations provided as
1428
- * a parameter, or will use the table's default if no parameter is provided, and be updated once per second as
1429
- * necessary. Note that multiple calls to this method will each produce a new TotalsTable which must have close()
1430
- * called on it when not in use.
1431
- * @param config -
1432
- * @return Promise of dh.TotalsTable
1593
+ * a filter condition checking if the current value is less than the given parameter
1594
+ * @param term -
1595
+ * @return {@link dh.FilterCondition}
1433
1596
  */
1434
- getTotalsTable(config?:TotalsTableConfig|undefined|null):Promise<TotalsTable>;
1597
+ lessThan(term:FilterValue):FilterCondition;
1435
1598
  /**
1436
- * a promise that will resolve to a Totals Table of this table, ignoring any filters. See <b>getTotalsTable()</b>
1437
- * above for more specifics.
1438
- * @param config -
1439
- * @return promise of dh.TotalsTable
1599
+ * a filter condition checking if the current value is greater than or equal to the given parameter
1600
+ * @param term -
1601
+ * @return {@link dh.FilterCondition}
1440
1602
  */
1441
- getGrandTotalsTable(config?:TotalsTableConfig|undefined|null):Promise<TotalsTable>;
1603
+ greaterThanOrEqualTo(term:FilterValue):FilterCondition;
1442
1604
  /**
1443
- * a promise that will resolve to a new roll-up <b>TreeTable</b> of this table. Multiple calls to this method will
1444
- * each produce a new <b>TreeTable</b> which must have close() called on it when not in use.
1445
- * @param configObject -
1446
- * @return Promise of dh.TreeTable
1605
+ * a filter condition checking if the current value is less than or equal to the given parameter
1606
+ * @param term -
1607
+ * @return {@link dh.FilterCondition}
1447
1608
  */
1448
- rollup(configObject:RollupConfig):Promise<TreeTable>;
1609
+ lessThanOrEqualTo(term:FilterValue):FilterCondition;
1449
1610
  /**
1450
- * a promise that will resolve to a new `TreeTable` of this table. Multiple calls to this method will each produce a
1451
- * new `TreeTable` which must have close() called on it when not in use.
1452
- * @param configObject -
1453
- * @return Promise dh.TreeTable
1611
+ * a filter condition checking if the current value is in the given set of values
1612
+ * @param terms -
1613
+ * @return {@link dh.FilterCondition}
1454
1614
  */
1455
- treeTable(configObject:TreeTableConfig):Promise<TreeTable>;
1615
+ in(terms:FilterValue[]):FilterCondition;
1456
1616
  /**
1457
- * a "frozen" version of this table (a server-side snapshot of the entire source table). Viewports on the frozen
1458
- * table will not update. This does not change the original table, and the new table will not have any of the client
1459
- * side sorts/filters/columns. New client side sorts/filters/columns can be added to the frozen copy.
1460
- * @return Promise of dh.Table
1617
+ * a filter condition checking if the current value is in the given set of values, ignoring differences of upper vs
1618
+ * lower case
1619
+ * @param terms -
1620
+ * @return {@link dh.FilterCondition}
1461
1621
  */
1462
- freeze():Promise<Table>;
1463
- snapshot(baseTable:Table, doInitialSnapshot?:boolean, stampColumns?:string[]):Promise<Table>;
1622
+ inIgnoreCase(terms:FilterValue[]):FilterCondition;
1464
1623
  /**
1465
- *
1466
- * @inheritDoc
1467
- * @deprecated
1624
+ * a filter condition checking that the current value is not in the given set of values
1625
+ * @param terms -
1626
+ * @return {@link dh.FilterCondition}
1468
1627
  */
1469
- join(joinType:string, rightTable:JoinableTable, columnsToMatch:Array<string>, columnsToAdd?:Array<string>|undefined|null, asOfMatchRule?:string|undefined|null):Promise<Table>;
1470
- asOfJoin(rightTable:JoinableTable, columnsToMatch:Array<string>, columnsToAdd?:Array<string>|undefined|null, asOfMatchRule?:string|undefined|null):Promise<Table>;
1471
- crossJoin(rightTable:JoinableTable, columnsToMatch:Array<string>, columnsToAdd?:Array<string>|undefined|null, reserveBits?:number|undefined|null):Promise<Table>;
1472
- exactJoin(rightTable:JoinableTable, columnsToMatch:Array<string>, columnsToAdd?:Array<string>):Promise<Table>;
1473
- naturalJoin(rightTable:JoinableTable, columnsToMatch:Array<string>, columnsToAdd?:Array<string>):Promise<Table>;
1474
- byExternal(keys:object, dropKeys?:boolean):Promise<PartitionedTable>;
1628
+ notIn(terms:FilterValue[]):FilterCondition;
1475
1629
  /**
1476
- * Creates a new PartitionedTable from the contents of the current table, partitioning data based on the specified
1477
- * keys.
1478
- * @param keys -
1479
- * @param dropKeys -
1480
- * @return Promise dh.PartitionedTable
1630
+ * a filter condition checking that the current value is not in the given set of values, ignoring differences of
1631
+ * upper vs lower case
1632
+ * @param terms -
1633
+ * @return {@link dh.FilterCondition}
1481
1634
  */
1482
- partitionBy(keys:object, dropKeys?:boolean):Promise<PartitionedTable>;
1635
+ notInIgnoreCase(terms:FilterValue[]):FilterCondition;
1483
1636
  /**
1484
- * a promise that will resolve to ColumnStatistics for the column of this table.
1485
- * @param column -
1486
- * @return Promise of dh.ColumnStatistics
1637
+ * a filter condition checking if the given value contains the given string value
1638
+ * @param term -
1639
+ * @return {@link dh.FilterCondition}
1487
1640
  */
1488
- getColumnStatistics(column:Column):Promise<ColumnStatistics>;
1641
+ contains(term:FilterValue):FilterCondition;
1489
1642
  /**
1490
- * Seek the row matching the data provided
1491
- * @param startingRow - Row to start the seek from
1492
- * @param column - Column to seek for value on
1493
- * @param valueType - Type of value provided
1494
- * @param seekValue - Value to seek
1495
- * @param insensitive - Optional value to flag a search as case-insensitive. Defaults to `false`.
1496
- * @param contains - Optional value to have the seek value do a contains search instead of exact equality. Defaults to
1497
- * `false`.
1498
- * @param isBackwards - Optional value to seek backwards through the table instead of forwards. Defaults to `false`.
1499
- * @return A promise that resolves to the row value found.
1643
+ * a filter condition checking if the given value contains the given string value, ignoring differences of upper vs
1644
+ * lower case
1645
+ * @param term -
1646
+ * @return {@link dh.FilterCondition}
1500
1647
  */
1501
- seekRow(startingRow:number, column:Column, valueType:ValueTypeType, seekValue:any, insensitive?:boolean|undefined|null, contains?:boolean|undefined|null, isBackwards?:boolean|undefined|null):Promise<number>;
1502
- toString():string;
1648
+ containsIgnoreCase(term:FilterValue):FilterCondition;
1503
1649
  /**
1504
- * True if this table represents a user Input Table (created by InputTable.newInputTable). When true, you may call
1505
- * .inputTable() to add or remove data from the underlying table.
1506
- * @return boolean
1650
+ * a filter condition checking if the given value matches the provided regular expressions string. Regex patterns
1651
+ * use Java regex syntax
1652
+ * @param pattern -
1653
+ * @return {@link dh.FilterCondition}
1507
1654
  */
1508
- get hasInputTable():boolean;
1655
+ matches(pattern:FilterValue):FilterCondition;
1509
1656
  /**
1510
- * The columns that are present on this table. This is always all possible columns. If you specify fewer columns in
1511
- * .setViewport(), you will get only those columns in your ViewportData. <b>Number size</b> The total count of rows
1512
- * in the table. The size can and will change; see the <b>sizechanged</b> event for details. Size will be negative
1513
- * in exceptional cases (eg. the table is uncoalesced, see the <b>isUncoalesced</b> property for details).
1514
- * @return {@link dh.Column} array
1657
+ * a filter condition checking if the given value matches the provided regular expressions string, ignoring
1658
+ * differences of upper vs lower case. Regex patterns use Java regex syntax
1659
+ * @param pattern -
1660
+ * @return {@link dh.FilterCondition}
1515
1661
  */
1516
- get columns():Array<Column>;
1662
+ matchesIgnoreCase(pattern:FilterValue):FilterCondition;
1517
1663
  /**
1518
- * The default configuration to be used when building a <b>TotalsTable</b> for this table.
1519
- * @return dh.TotalsTableConfig
1664
+ * a filter condition checking if the current value is a true boolean
1665
+ * @return {@link dh.FilterCondition}
1520
1666
  */
1521
- get totalsTableConfig():TotalsTableConfig;
1667
+ isTrue():FilterCondition;
1522
1668
  /**
1523
- * An ordered list of Sorts to apply to the table. To update, call <b>applySort()</b>. Note that this getter will
1524
- * return the new value immediately, even though it may take a little time to update on the server. You may listen
1525
- * for the <b>sortchanged</b> event to know when to update the UI.
1526
- * @return {@link dh.Sort} array
1669
+ * a filter condition checking if the current value is a false boolean
1670
+ * @return {@link dh.FilterCondition}
1527
1671
  */
1528
- get sort():Array<Sort>;
1672
+ isFalse():FilterCondition;
1529
1673
  /**
1530
- * An ordered list of custom column formulas to add to the table, either adding new columns or replacing existing
1531
- * ones. To update, call <b>applyCustomColumns()</b>.
1532
- * @return {@link dh.CustomColumn} array
1674
+ * a filter condition checking if the current value is a null value
1675
+ * @return {@link dh.FilterCondition}
1533
1676
  */
1534
- get customColumns():Array<CustomColumn>;
1677
+ isNull():FilterCondition;
1535
1678
  /**
1536
- * True if this table may receive updates from the server, including size changed events, updated events after
1537
- * initial snapshot.
1538
- * @return boolean
1679
+ * a filter condition invoking the given method on the current value, with the given parameters. Currently supported
1680
+ * functions that can be invoked on a String:
1681
+ * <ul>
1682
+ * <li><b>startsWith</b>: Returns true if the current string value starts with the supplied string argument</li>
1683
+ * <li><b>endsWith</b>: Returns true if the current string value ends with the supplied string argument</li>
1684
+ * <li><b>matches</b>: Returns true if the current string value matches the supplied string argument used as a Java
1685
+ * regular expression</li>
1686
+ * <li><b>contains</b>: Returns true if the current string value contains the supplied string argument
1687
+ * <p>
1688
+ * When invoking against a constant, this should be avoided in favor of FilterValue.contains
1689
+ * </p>
1690
+ * </li>
1691
+ * </ul>
1692
+ * @param method -
1693
+ * @param args -
1694
+ * @return
1539
1695
  */
1540
- get isRefreshing():boolean;
1696
+ invoke(method:string, ...args:FilterValue[]):FilterCondition;
1697
+ toString():string;
1541
1698
  /**
1542
- * An ordered list of Filters to apply to the table. To update, call applyFilter(). Note that this getter will
1543
- * return the new value immediately, even though it may take a little time to update on the server. You may listen
1544
- * for the <b>filterchanged</b> event to know when to update the UI.
1545
- * @return {@link dh.FilterCondition} array
1699
+ * Constructs a string for the filter API from the given parameter.
1700
+ * @param input -
1701
+ * @return
1546
1702
  */
1547
- get filter():Array<FilterCondition>;
1703
+ static ofString(input:any):FilterValue;
1548
1704
  /**
1549
- * The total count of the rows in the table, excluding any filters. Unlike {@link Table.size}, changes to this value
1550
- * will not result in any event. If the table is unfiltered, this will return the same size as {@link Table.size}.
1551
- * If this table was uncoalesced before it was filtered, this will return {@link dh.Table.SIZE_UNCOALESCED}.
1552
- * @return the size of the table before filters, or {@link dh.Table.SIZE_UNCOALESCED}
1705
+ * Constructs a boolean for the filter API from the given parameter.
1706
+ * @param b -
1707
+ * @return
1553
1708
  */
1554
- get totalSize():number;
1709
+ static ofBoolean(b:boolean):FilterValue;
1710
+ }
1711
+
1712
+ /**
1713
+ * Event fired when a command is issued from the client.
1714
+ */
1715
+ export class CommandInfo {
1716
+ constructor(code:string, result:Promise<dh.ide.CommandResult>);
1717
+
1718
+ get result():Promise<dh.ide.CommandResult>;
1719
+ get code():string;
1720
+ }
1721
+
1722
+ /**
1723
+ * Represents a non-viewport subscription to a table, and all data currently known to be present in the subscribed
1724
+ * columns. This class handles incoming snapshots and deltas, and fires events to consumers to notify of data changes.
1725
+ * <p>
1726
+ * Unlike {@link dh.TableViewportSubscription}, the "original" table does not have a reference to this instance, only the
1727
+ * "private" table instance does, since the original cannot modify the subscription, and the private instance must
1728
+ * forward data to it.
1729
+ * <p>
1730
+ * Represents a subscription to the table on the server. Changes made to the table will not be reflected here - the
1731
+ * subscription must be closed and a new one optioned to see those changes. The event model is slightly different from
1732
+ * viewports to make it less expensive to compute for large tables.
1733
+ */
1734
+ export class TableSubscription implements HasEventHandling {
1735
+ protected constructor();
1736
+
1737
+ static createTableSubscription(options:SubscriptionOptions, existingTable:Table):TableSubscription;
1555
1738
  /**
1556
- * The total count of rows in the table. If there is a viewport subscription active, this size will be updated when
1557
- * the subscription updates. If not, and {@link Table.uncoalesced} is true, the size will be
1558
- * {@link dh.Table.SIZE_UNCOALESCED}. Otherwise, the size will be updated when the server's update graph processes changes.
1559
- * <p>
1560
- * When the size changes, the {@link dh.Table.EVENT_SIZECHANGED} event will be fired.
1561
- * @return the size of the table, or {@link dh.Table.SIZE_UNCOALESCED} if there is no subscription and the table is
1562
- * uncoalesced.
1739
+ * Updates the subscription to use the given columns and update interval.
1740
+ * @param columns - the new columns to subscribe to
1741
+ * @param updateIntervalMs - the new update interval, or null/omit to use the default of one second
1563
1742
  */
1564
- get size():number;
1743
+ changeSubscription(columns:Array<Column>, updateIntervalMs:number|undefined|null):void;
1565
1744
  /**
1566
- * True if this table has been closed.
1567
- * @return boolean
1745
+ * Update the options for this viewport subscription. This cannot alter the update interval or preview options.
1746
+ * @param options - the subscription options
1568
1747
  */
1569
- get isClosed():boolean;
1748
+ update(options:SubscriptionOptions):void;
1749
+ get columns():Array<Column>;
1570
1750
  /**
1571
- * Read-only. True if this table is uncoalesced, indicating that work must be done before the table can be used.
1572
- * <p>
1573
- * Uncoalesced tables are expensive to operate on - filter to a single partition or range of partitions before
1574
- * subscribing to access only the desired data efficiently. A subscription can be specified without a filter, but
1575
- * this can be very expensive. To see which partitions are available, check each column on the table to see which
1576
- * have {@link Column.isPartitionColumn} as `true`, and filter those columns. To read the possible values
1577
- * for those columns, use {@link Table.selectDistinct}.
1578
- * @return True if the table is uncoaleced and should be filtered before operating on it, otherwise false.
1751
+ * Stops the subscription on the server.
1579
1752
  */
1580
- get isUncoalesced():boolean;
1753
+ close():void;
1581
1754
  /**
1582
1755
  * Listen for events on this object.
1583
1756
  * @param name - the name of the event to listen for
@@ -1596,107 +1769,110 @@ export namespace dh {
1596
1769
  * @typeParam T -
1597
1770
  */
1598
1771
  removeEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):boolean;
1599
- /**
1600
- * a Sort than can be used to reverse a table. This can be passed into n array in applySort. Note that Tree Tables
1601
- * do not support reverse.
1602
- * @return {@link dh.Sort}
1603
- */
1604
- static reverse():Sort;
1605
1772
  }
1606
1773
 
1607
-
1608
- /**
1609
- * Represents a set of Tables each corresponding to some key. The keys are available locally, but a call must be made to
1610
- * the server to get each Table. All tables will have the same structure.
1611
- */
1612
- export class PartitionedTable implements HasEventHandling {
1613
- /**
1614
- * Indicates that a new key has been added to the array of keys, which can now be fetched with getTable.
1615
- */
1616
- static readonly EVENT_KEYADDED:string;
1617
- /**
1618
- * Indicates that a new key has been added to the array of keys, which can now be fetched with getTable.
1619
- */
1774
+ export class QueryInfo {
1775
+ static readonly EVENT_TABLE_OPENED:string;
1620
1776
  static readonly EVENT_DISCONNECT:string;
1621
- /**
1622
- * Indicates that a new key has been added to the array of keys, which can now be fetched with getTable.
1623
- */
1624
1777
  static readonly EVENT_RECONNECT:string;
1625
- /**
1626
- * Indicates that a new key has been added to the array of keys, which can now be fetched with getTable.
1627
- */
1628
- static readonly EVENT_RECONNECTFAILED:string;
1778
+ static readonly EVENT_CONNECT:string;
1779
+
1780
+ protected constructor();
1781
+ }
1782
+
1783
+ export class LoginCredentials {
1784
+ type?:string|null;
1785
+ username?:string|null;
1786
+ token?:string|null;
1787
+
1788
+ constructor();
1789
+ }
1629
1790
 
1791
+ /**
1792
+ * A js type for operating on input tables.
1793
+ *
1794
+ * Represents a User Input Table, which can have data added to it from other sources.
1795
+ *
1796
+ * You may add rows using dictionaries of key-value tuples (representing columns by name), add tables containing all the
1797
+ * key/value columns to add, or delete tables containing the keys to delete. Each operation is atomic, and will either
1798
+ * succeed completely or fail completely. To guarantee order of operations, apply an operation and wait for the response
1799
+ * before sending the next operation.
1800
+ *
1801
+ * Each table has one or more key columns, where each unique combination of keys will appear at most once in the table.
1802
+ *
1803
+ * To view the results of the Input Table, you should use standard table operations on the InputTable's source Table
1804
+ * object.
1805
+ */
1806
+ export class InputTable {
1630
1807
  protected constructor();
1631
1808
 
1632
1809
  /**
1633
- * Fetch the table with the given key. If the key does not exist, returns `null`.
1634
- * @param key - The key to fetch. An array of values for each key column, in the same order as the key columns are.
1635
- * @return Promise of dh.Table, or `null` if the key does not exist.
1810
+ * Adds a single row to the table. For each key or value column name in the Input Table, we retrieve that javascript
1811
+ * property at that name and validate it can be put into the given column type.
1812
+ * @param row -
1813
+ * @param userTimeZone -
1814
+ * @return Promise of dh.InputTable
1636
1815
  */
1637
- getTable(key:object):Promise<Table|undefined|null>;
1816
+ addRow(row:{ [key: string]: any; }, userTimeZone?:string):Promise<InputTable>;
1638
1817
  /**
1639
- * Open a new table that is the result of merging all constituent tables. See
1640
- * {@link io.deephaven.engine.table.PartitionedTable.merge} for details.
1641
- * @return A merged representation of the constituent tables.
1818
+ * Add multiple rows to a table.
1819
+ * @param rows -
1820
+ * @param userTimeZone -
1821
+ * @return Promise of dh.InputTable
1642
1822
  */
1643
- getMergedTable():Promise<Table>;
1823
+ addRows(rows:{ [key: string]: any; }[], userTimeZone?:string):Promise<InputTable>;
1644
1824
  /**
1645
- * The set of all currently known keys. This is kept up to date, so getting the list after adding an event listener
1646
- * for <b>keyadded</b> will ensure no keys are missed.
1647
- * @return Set of Object
1825
+ * Add an entire table to this Input Table. Only column names that match the definition of the input table will be
1826
+ * copied, and all key columns must have values filled in. This only copies the current state of the source table;
1827
+ * future updates to the source table will not be reflected in the Input Table. The returned promise will be
1828
+ * resolved to the same InputTable instance this method was called upon once the server returns.
1829
+ * @param tableToAdd -
1830
+ * @return Promise of dh.InputTable
1648
1831
  */
1649
- getKeys():Set<object>;
1832
+ addTable(tableToAdd:Table):Promise<InputTable>;
1650
1833
  /**
1651
- * Fetch a table containing all the valid keys of the partitioned table.
1652
- * @return Promise of a Table
1653
- * @deprecated
1834
+ * Add multiple tables to this Input Table.
1835
+ * @param tablesToAdd -
1836
+ * @return Promise of dh.InputTable
1654
1837
  */
1655
- getKeyTable():Promise<Table>;
1838
+ addTables(tablesToAdd:Table[]):Promise<InputTable>;
1656
1839
  /**
1657
- * Fetch the underlying base table of the partitioned table.
1658
- * @return Promise of a Table
1840
+ * Deletes an entire table from this Input Table. Key columns must match the Input Table.
1841
+ * @param tableToDelete -
1842
+ * @return Promise of dh.InputTable
1659
1843
  */
1660
- getBaseTable():Promise<Table>;
1844
+ deleteTable(tableToDelete:Table):Promise<InputTable>;
1661
1845
  /**
1662
- * Indicates that this PartitionedTable will no longer be used, removing subcriptions to updated keys, etc. This
1663
- * will not affect tables in use.
1846
+ * Delete multiple tables from this Input Table.
1847
+ * @param tablesToDelete -
1848
+ * @return
1664
1849
  */
1665
- close():void;
1850
+ deleteTables(tablesToDelete:Table[]):Promise<InputTable>;
1666
1851
  /**
1667
- * The count of known keys.
1668
- * @return int
1852
+ * A list of the key columns, by name
1853
+ * @return String array.
1669
1854
  */
1670
- get size():number;
1855
+ get keys():string[];
1671
1856
  /**
1672
- * An array of the columns in the tables that can be retrieved from this partitioned table, including both key and
1673
- * non-key columns.
1674
- * @return Array of Column
1857
+ * A list of the value columns, by name
1858
+ * @return String array.
1675
1859
  */
1676
- get columns():Column[];
1860
+ get values():string[];
1677
1861
  /**
1678
- * An array of all the key columns that the tables are partitioned by.
1679
- * @return Array of Column
1862
+ * A list of the key columns.
1863
+ * @return Column array.
1680
1864
  */
1681
1865
  get keyColumns():Column[];
1682
1866
  /**
1683
- * Listen for events on this object.
1684
- * @param name - the name of the event to listen for
1685
- * @param callback - a function to call when the event occurs
1686
- * @return Returns a cleanup function.
1687
- * @typeParam T - the type of the data that the event will provide
1867
+ * A list of the value Column objects
1868
+ * @return {@link dh.Column} array.
1688
1869
  */
1689
- addEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):()=>void;
1690
- nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<Event<T>>;
1691
- hasListeners(name:string):boolean;
1870
+ get valueColumns():Column[];
1692
1871
  /**
1693
- * Removes an event listener added to this table.
1694
- * @param name -
1695
- * @param callback -
1696
- * @return
1697
- * @typeParam T -
1872
+ * The source table for this Input Table
1873
+ * @return dh.table
1698
1874
  */
1699
- removeEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):boolean;
1875
+ get table():Table;
1700
1876
  }
1701
1877
 
1702
1878
  /**
@@ -1930,231 +2106,139 @@ export namespace dh {
1930
2106
  }
1931
2107
 
1932
2108
  /**
1933
- * Addition optional configuration that can be passed to the {@link dh.CoreClient} constructor.
1934
- */
1935
- export class ConnectOptions {
1936
- /**
1937
- * Optional map of http header names and values to send to the server with each request.
1938
- */
1939
- headers?:{ [key: string]: string; }|null;
1940
- /**
1941
- * True to enable debug logging. At this time, only enables logging for gRPC calls.
1942
- */
1943
- debug?:boolean|null;
1944
- /**
1945
- * Set this to true to force the use of websockets when connecting to the deephaven instance, false to force the use
1946
- * of `fetch`. Ignored if {@link dh.transportFactory} is set.
1947
- * <p>
1948
- * Defaults to null, indicating that the server URL should be checked to see if we connect with fetch or websockets.
1949
- */
1950
- useWebsockets?:boolean|null;
1951
- /**
1952
- * The transport factory to use for creating gRPC streams. If specified, the JS API will ignore
1953
- * {@link dh.useWebsockets} and its own internal logic for determining the appropriate transport to use.
1954
- * <p>
1955
- * Defaults to null, indicating that the JS API should determine the appropriate transport to use. If
1956
- * `useWebsockets` is set to true, the JS API will use websockets, otherwise if the server url begins with
1957
- * https, it will use fetch, otherwise it will use websockets.
1958
- */
1959
- transportFactory?:dh.grpc.GrpcTransportFactory|null;
1960
-
1961
- constructor();
1962
- }
1963
-
1964
- /**
1965
- * Event fired when a command is issued from the client.
2109
+ * Describes a Sort present on the table. No visible constructor, created through the use of Column.sort(), will be tied
2110
+ * to that particular column data. Sort instances are immutable, and use a builder pattern to make modifications. All
2111
+ * methods return a new Sort instance.
1966
2112
  */
1967
- export class CommandInfo {
1968
- constructor(code:string, result:Promise<dh.ide.CommandResult>);
1969
-
1970
- get result():Promise<dh.ide.CommandResult>;
1971
- get code():string;
1972
- }
2113
+ export class Sort {
2114
+ static readonly ASCENDING:string;
2115
+ static readonly DESCENDING:string;
2116
+ static readonly REVERSE:string;
1973
2117
 
1974
- /**
1975
- * Describes data that can be filtered, either a column reference or a literal value. Used this way, the type of a value
1976
- * can be specified so that values which are ambiguous or not well supported in JS will not be confused with Strings or
1977
- * imprecise numbers (e.g., nanosecond-precision date values). Additionally, once wrapped in this way, methods can be
1978
- * called on these value literal instances. These instances are immutable - any method called on them returns a new
1979
- * instance.
1980
- */
1981
- export class FilterValue {
1982
2118
  protected constructor();
1983
2119
 
1984
2120
  /**
1985
- * Constructs a number for the filter API from the given parameter. Can also be used on the values returned from
1986
- * {@link TableData.get} for DateTime values. To create
1987
- * a filter with a date, use <b>dh.DateWrapper.ofJsDate</b> or
1988
- * {@link i18n.DateTimeFormat.parse}. To create a filter with a
1989
- * 64-bit long integer, use {@link LongWrapper.ofString}.
1990
- * @param input - the number to wrap as a FilterValue
1991
- * @return an immutable FilterValue that can be built into a filter
1992
- */
1993
- static ofNumber(input:LongWrapper|number):FilterValue;
1994
- /**
1995
- * a filter condition checking if the current value is equal to the given parameter
1996
- * @param term -
1997
- * @return {@link dh.FilterCondition}
2121
+ * Builds a Sort instance to sort values in ascending order.
2122
+ * @return {@link dh.Sort}
1998
2123
  */
1999
- eq(term:FilterValue):FilterCondition;
2124
+ asc():Sort;
2000
2125
  /**
2001
- * a filter condition checking if the current value is equal to the given parameter, ignoring differences of upper
2002
- * vs lower case
2003
- * @param term -
2004
- * @return {@link dh.FilterCondition}
2126
+ * Builds a Sort instance to sort values in descending order.
2127
+ * @return {@link dh.Sort}
2005
2128
  */
2006
- eqIgnoreCase(term:FilterValue):FilterCondition;
2129
+ desc():Sort;
2007
2130
  /**
2008
- * a filter condition checking if the current value is not equal to the given parameter
2009
- * @param term -
2010
- * @return {@link dh.FilterCondition}
2131
+ * Builds a Sort instance which takes the absolute value before applying order.
2132
+ * @return {@link dh.Sort}
2011
2133
  */
2012
- notEq(term:FilterValue):FilterCondition;
2134
+ abs():Sort;
2135
+ toString():string;
2013
2136
  /**
2014
- * a filter condition checking if the current value is not equal to the given parameter, ignoring differences of
2015
- * upper vs lower case
2016
- * @param term -
2017
- * @return {@link dh.FilterCondition}
2137
+ * True if the absolute value of the column should be used when sorting; defaults to false.
2138
+ * @return boolean
2018
2139
  */
2019
- notEqIgnoreCase(term:FilterValue):FilterCondition;
2140
+ get isAbs():boolean;
2020
2141
  /**
2021
- * a filter condition checking if the current value is greater than the given parameter
2022
- * @param term -
2023
- * @return {@link dh.FilterCondition}
2142
+ * The column which is sorted.
2143
+ * @return {@link dh.Column}
2024
2144
  */
2025
- greaterThan(term:FilterValue):FilterCondition;
2145
+ get column():Column;
2026
2146
  /**
2027
- * a filter condition checking if the current value is less than the given parameter
2028
- * @param term -
2029
- * @return {@link dh.FilterCondition}
2147
+ * The direction of this sort, either <b>ASC</b>, <b>DESC</b>, or <b>REVERSE</b>.
2148
+ * @return String
2030
2149
  */
2031
- lessThan(term:FilterValue):FilterCondition;
2150
+ get direction():string;
2151
+ }
2152
+
2153
+ export class DateWrapper extends LongWrapper {
2154
+ protected constructor();
2155
+
2156
+ static ofJsDate(date:Date):DateWrapper;
2157
+ asDate():Date;
2158
+ }
2159
+
2160
+ /**
2161
+ * Describes how a Totals Table will be generated from its parent table. Each table has a default (which may be null)
2162
+ * indicating how that table was configured when it was declared, and each Totals Table has a similar property
2163
+ * describing how it was created. Both the <b>Table.getTotalsTable</b> and <b>Table.getGrandTotalsTable</b> methods take
2164
+ * this config as an optional parameter - without it, the table's default will be used, or if null, a default instance
2165
+ * of <b>TotalsTableConfig</b> will be supplied.
2166
+ *
2167
+ * This class has a no-arg constructor, allowing an instance to be made with the default values provided. However, any
2168
+ * JS object can be passed in to the methods which accept instances of this type, provided their values adhere to the
2169
+ * expected formats.
2170
+ */
2171
+ export class TotalsTableConfig {
2032
2172
  /**
2033
- * a filter condition checking if the current value is greater than or equal to the given parameter
2034
- * @param term -
2035
- * @return {@link dh.FilterCondition}
2173
+ * @deprecated
2036
2174
  */
2037
- greaterThanOrEqualTo(term:FilterValue):FilterCondition;
2175
+ static readonly COUNT:string;
2038
2176
  /**
2039
- * a filter condition checking if the current value is less than or equal to the given parameter
2040
- * @param term -
2041
- * @return {@link dh.FilterCondition}
2177
+ * @deprecated
2042
2178
  */
2043
- lessThanOrEqualTo(term:FilterValue):FilterCondition;
2179
+ static readonly MIN:string;
2044
2180
  /**
2045
- * a filter condition checking if the current value is in the given set of values
2046
- * @param terms -
2047
- * @return {@link dh.FilterCondition}
2181
+ * @deprecated
2048
2182
  */
2049
- in(terms:FilterValue[]):FilterCondition;
2183
+ static readonly MAX:string;
2050
2184
  /**
2051
- * a filter condition checking if the current value is in the given set of values, ignoring differences of upper vs
2052
- * lower case
2053
- * @param terms -
2054
- * @return {@link dh.FilterCondition}
2185
+ * @deprecated
2055
2186
  */
2056
- inIgnoreCase(terms:FilterValue[]):FilterCondition;
2187
+ static readonly SUM:string;
2057
2188
  /**
2058
- * a filter condition checking that the current value is not in the given set of values
2059
- * @param terms -
2060
- * @return {@link dh.FilterCondition}
2189
+ * @deprecated
2061
2190
  */
2062
- notIn(terms:FilterValue[]):FilterCondition;
2191
+ static readonly ABS_SUM:string;
2063
2192
  /**
2064
- * a filter condition checking that the current value is not in the given set of values, ignoring differences of
2065
- * upper vs lower case
2066
- * @param terms -
2067
- * @return {@link dh.FilterCondition}
2193
+ * @deprecated
2068
2194
  */
2069
- notInIgnoreCase(terms:FilterValue[]):FilterCondition;
2195
+ static readonly VAR:string;
2070
2196
  /**
2071
- * a filter condition checking if the given value contains the given string value
2072
- * @param term -
2073
- * @return {@link dh.FilterCondition}
2197
+ * @deprecated
2074
2198
  */
2075
- contains(term:FilterValue):FilterCondition;
2199
+ static readonly AVG:string;
2076
2200
  /**
2077
- * a filter condition checking if the given value contains the given string value, ignoring differences of upper vs
2078
- * lower case
2079
- * @param term -
2080
- * @return {@link dh.FilterCondition}
2201
+ * @deprecated
2081
2202
  */
2082
- containsIgnoreCase(term:FilterValue):FilterCondition;
2203
+ static readonly STD:string;
2083
2204
  /**
2084
- * a filter condition checking if the given value matches the provided regular expressions string. Regex patterns
2085
- * use Java regex syntax
2086
- * @param pattern -
2087
- * @return {@link dh.FilterCondition}
2205
+ * @deprecated
2088
2206
  */
2089
- matches(pattern:FilterValue):FilterCondition;
2207
+ static readonly FIRST:string;
2090
2208
  /**
2091
- * a filter condition checking if the given value matches the provided regular expressions string, ignoring
2092
- * differences of upper vs lower case. Regex patterns use Java regex syntax
2093
- * @param pattern -
2094
- * @return {@link dh.FilterCondition}
2209
+ * @deprecated
2095
2210
  */
2096
- matchesIgnoreCase(pattern:FilterValue):FilterCondition;
2211
+ static readonly LAST:string;
2097
2212
  /**
2098
- * a filter condition checking if the current value is a true boolean
2099
- * @return {@link dh.FilterCondition}
2213
+ * @deprecated
2100
2214
  */
2101
- isTrue():FilterCondition;
2215
+ static readonly SKIP:string;
2102
2216
  /**
2103
- * a filter condition checking if the current value is a false boolean
2104
- * @return {@link dh.FilterCondition}
2217
+ * Specifies if a Totals Table should be expanded by default in the UI. Defaults to false.
2105
2218
  */
2106
- isFalse():FilterCondition;
2219
+ showTotalsByDefault:boolean;
2107
2220
  /**
2108
- * a filter condition checking if the current value is a null value
2109
- * @return {@link dh.FilterCondition}
2221
+ * Specifies if a Grand Totals Table should be expanded by default in the UI. Defaults to false.
2110
2222
  */
2111
- isNull():FilterCondition;
2223
+ showGrandTotalsByDefault:boolean;
2112
2224
  /**
2113
- * a filter condition invoking the given method on the current value, with the given parameters. Currently supported
2114
- * functions that can be invoked on a String:
2115
- * <ul>
2116
- * <li><b>startsWith</b>: Returns true if the current string value starts with the supplied string argument</li>
2117
- * <li><b>endsWith</b>: Returns true if the current string value ends with the supplied string argument</li>
2118
- * <li><b>matches</b>: Returns true if the current string value matches the supplied string argument used as a Java
2119
- * regular expression</li>
2120
- * <li><b>contains</b>: Returns true if the current string value contains the supplied string argument
2121
- * <p>
2122
- * When invoking against a constant, this should be avoided in favor of FilterValue.contains
2123
- * </p>
2124
- * </li>
2125
- * </ul>
2126
- * @param method -
2127
- * @param args -
2128
- * @return
2225
+ * Specifies the default operation for columns that do not have a specific operation applied; defaults to "Sum".
2129
2226
  */
2130
- invoke(method:string, ...args:FilterValue[]):FilterCondition;
2131
- toString():string;
2227
+ defaultOperation:AggregationOperationType;
2132
2228
  /**
2133
- * Constructs a string for the filter API from the given parameter.
2134
- * @param input -
2135
- * @return
2229
+ * Mapping from each column name to the aggregation(s) that should be applied to that column in the resulting Totals
2230
+ * Table. If a column is omitted, the defaultOperation is used.
2136
2231
  */
2137
- static ofString(input:any):FilterValue;
2232
+ operationMap:{ [key: string]: Array<AggregationOperationType>; };
2138
2233
  /**
2139
- * Constructs a boolean for the filter API from the given parameter.
2140
- * @param b -
2141
- * @return
2234
+ * Groupings to use when generating the Totals Table. One row will exist for each unique set of values observed in
2235
+ * these columns. See also `Table.selectDistinct`.
2142
2236
  */
2143
- static ofBoolean(b:boolean):FilterValue;
2144
- }
2237
+ groupBy:Array<string>;
2145
2238
 
2146
- /**
2147
- * Wrap BigDecimal values for use in JS. Provides text formatting for display and access to the underlying value.
2148
- */
2149
- export class BigDecimalWrapper {
2150
- protected constructor();
2239
+ constructor();
2151
2240
 
2152
- static ofString(value:string):BigDecimalWrapper;
2153
- asNumber():number;
2154
- valueOf():string;
2155
2241
  toString():string;
2156
- equals(o:object):boolean;
2157
- hashCode():number;
2158
2242
  }
2159
2243
 
2160
2244
  export class IdeSession implements HasEventHandling {
@@ -2256,58 +2340,6 @@ export namespace dh {
2256
2340
  removeEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):boolean;
2257
2341
  }
2258
2342
 
2259
- /**
2260
- * Represents a non-viewport subscription to a table, and all data currently known to be present in the subscribed
2261
- * columns. This class handles incoming snapshots and deltas, and fires events to consumers to notify of data changes.
2262
- * <p>
2263
- * Unlike {@link dh.TableViewportSubscription}, the "original" table does not have a reference to this instance, only the
2264
- * "private" table instance does, since the original cannot modify the subscription, and the private instance must
2265
- * forward data to it.
2266
- * <p>
2267
- * Represents a subscription to the table on the server. Changes made to the table will not be reflected here - the
2268
- * subscription must be closed and a new one optioned to see those changes. The event model is slightly different from
2269
- * viewports to make it less expensive to compute for large tables.
2270
- */
2271
- export class TableSubscription implements HasEventHandling {
2272
- protected constructor();
2273
-
2274
- static createTableSubscription(options:SubscriptionOptions, existingTable:Table):TableSubscription;
2275
- /**
2276
- * Updates the subscription to use the given columns and update interval.
2277
- * @param columns - the new columns to subscribe to
2278
- * @param updateIntervalMs - the new update interval, or null/omit to use the default of one second
2279
- */
2280
- changeSubscription(columns:Array<Column>, updateIntervalMs:number|undefined|null):void;
2281
- /**
2282
- * Update the options for this viewport subscription. This cannot alter the update interval or preview options.
2283
- * @param options - the subscription options
2284
- */
2285
- update(options:SubscriptionOptions):void;
2286
- get columns():Array<Column>;
2287
- /**
2288
- * Stops the subscription on the server.
2289
- */
2290
- close():void;
2291
- /**
2292
- * Listen for events on this object.
2293
- * @param name - the name of the event to listen for
2294
- * @param callback - a function to call when the event occurs
2295
- * @return Returns a cleanup function.
2296
- * @typeParam T - the type of the data that the event will provide
2297
- */
2298
- addEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):()=>void;
2299
- nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<Event<T>>;
2300
- hasListeners(name:string):boolean;
2301
- /**
2302
- * Removes an event listener added to this table.
2303
- * @param name -
2304
- * @param callback -
2305
- * @return
2306
- * @typeParam T -
2307
- */
2308
- removeEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):boolean;
2309
- }
2310
-
2311
2343
  /**
2312
2344
  * Presently, this is the entrypoint into the Deephaven JS API. By creating an instance of this with the server URL and
2313
2345
  * some options, JS applications can run code on the server, and interact with available exportable objects.
@@ -2322,225 +2354,118 @@ export namespace dh {
2322
2354
  static readonly EVENT_SHUTDOWN:string;
2323
2355
 
2324
2356
  protected constructor();
2325
-
2326
- /**
2327
- * Closes the current connection, releasing any resources on the server or client.
2328
- */
2329
- close():void;
2330
- running():Promise<IdeConnection>;
2331
- /**
2332
- * Load the named table, with columns and size information already fully populated.
2333
- * @param name - the name of the table to fetch
2334
- * @param applyPreviewColumns - false to disable previews, defaults to true
2335
- * @return a {@link Promise} that will resolve to the table, or reject with an error if it cannot be loaded.
2336
- * @deprecated Added to resolve a specific issue, in the future preview will be applied as part of the subscription.
2337
- */
2338
- getTable(name:string, applyPreviewColumns?:boolean):Promise<Table>;
2339
- getObject(definitionObject:dh.ide.VariableDescriptor):Promise<any>;
2340
- subscribeToFieldUpdates(callback:(arg0:dh.ide.VariableChanges)=>void):()=>void;
2341
- /**
2342
- * Makes an `object` available to another user or another client on this same server which knows the value of
2343
- * the `sharedTicketBytes`. Use that sharedTicketBytes value like a one-time use password - any other client
2344
- * which knows this value can read the same object.
2345
- * <p>
2346
- * Shared objects will remain available using the sharedTicketBytes until the client that first shared them
2347
- * releases/closes their copy of the object. Whatever side-channel is used to share the bytes, be sure to wait until
2348
- * the remote end has signaled that it has successfully fetched the object before releasing it from this client.
2349
- * <p>
2350
- * Be sure to use an unpredictable value for the shared ticket bytes, like a UUID or other large, random value to
2351
- * prevent access by unauthorized clients.
2352
- * @param object - the object to share with another client/user
2353
- * @param sharedTicketBytes - the value which another client/user must know to obtain the object. It may be a unicode
2354
- * string (will be encoded as utf8 bytes), or a {@link Uint8Array} value.
2355
- * @return A promise that will resolve to the value passed as sharedTicketBytes when the object is ready to be read
2356
- * by another client, or will reject if an error occurs.
2357
- */
2358
- shareObject(object:Table|Widget|WidgetExportedObject|PartitionedTable|TotalsTable|TreeTable, sharedTicketBytes:string|Uint8Array):Promise<string|Uint8Array>;
2359
- /**
2360
- * Reads an object shared by another client to this server with the `sharedTicketBytes`. Until the other
2361
- * client releases this object (or their session ends), the object will be available on the server.
2362
- * <p>
2363
- * The type of the object must be passed so that the object can be read from the server correct - the other client
2364
- * should provide this information.
2365
- * @param sharedTicketBytes - the value provided by another client/user to obtain the object. It may be a unicode
2366
- * string (will be encoded as utf8 bytes), or a {@link Uint8Array} value.
2367
- * @param type - The type of the object, so it can be correctly read from the server
2368
- * @return A promise that will resolve to the shared object, or will reject with an error if it cannot be read.
2369
- */
2370
- getSharedObject(sharedTicketBytes:string|Uint8Array, type:string):Promise<any>;
2371
- newTable(columnNames:string[], types:string[], data:string[][], userTimeZone:string):Promise<Table>;
2372
- /**
2373
- * Merges the given tables into a single table. Assumes all tables have the same structure.
2374
- * @param tables -
2375
- * @return {@link Promise} of {@link dh.Table}
2376
- */
2377
- mergeTables(tables:Table[]):Promise<Table>;
2378
- /**
2379
- * Register a callback function to handle any log messages that are emitted on the server. Returns a function ,
2380
- * which can be invoked to remove this log handler. Any log handler registered in this way will receive as many old
2381
- * log messages as are presently available.
2382
- * @param callback -
2383
- * @return {@link io.deephaven.web.shared.fu.JsRunnable}
2384
- */
2385
- onLogMessage(callback:(arg0:dh.ide.LogItem)=>void):()=>void;
2386
- startSession(type:string):Promise<IdeSession>;
2387
- getConsoleTypes():Promise<Array<string>>;
2388
- getWorkerHeapInfo():Promise<WorkerHeapInfo>;
2389
- /**
2390
- * Listen for events on this object.
2391
- * @param name - the name of the event to listen for
2392
- * @param callback - a function to call when the event occurs
2393
- * @return Returns a cleanup function.
2394
- * @typeParam T - the type of the data that the event will provide
2395
- */
2396
- addEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):()=>void;
2397
- nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<Event<T>>;
2398
- hasListeners(name:string):boolean;
2399
- /**
2400
- * Removes an event listener added to this table.
2401
- * @param name -
2402
- * @param callback -
2403
- * @return
2404
- * @typeParam T -
2405
- */
2406
- removeEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):boolean;
2407
- }
2408
-
2409
- /**
2410
- * This class allows iteration over non-contiguous indexes. In the future, this will support the EcmaScript 2015
2411
- * Iteration protocol, but for now has one method which returns an iterator, and also supports querying the size.
2412
- * Additionally, we may add support for creating RangeSet objects to better serve some use cases.
2413
- */
2414
- export class RangeSet {
2415
- protected constructor();
2416
-
2417
- static ofRange(first:number, last:number):RangeSet;
2418
- static ofItems(rows:number[]):RangeSet;
2419
- static ofRanges(ranges:RangeSet[]):RangeSet;
2420
- static ofSortedRanges(ranges:RangeSet[]):RangeSet;
2421
- /**
2422
- * a new iterator over all indexes in this collection.
2423
- * @return Iterator of {@link dh.LongWrapper}
2424
- */
2425
- iterator():Iterator<LongWrapper>;
2426
- /**
2427
- * The total count of items contained in this collection. In some cases this can be expensive to compute, and
2428
- * generally should not be needed except for debugging purposes, or preallocating space (i.e., do not call this
2429
- * property each time through a loop).
2430
- * @return double
2431
- */
2432
- get size():number;
2433
- }
2434
-
2435
- export class LoginCredentials {
2436
- type?:string|null;
2437
- username?:string|null;
2438
- token?:string|null;
2439
-
2440
- constructor();
2441
- }
2442
-
2443
- /**
2444
- * Describes the structure of the column, and if desired can be used to get access to the data to be rendered in this
2445
- * column.
2446
- */
2447
- export class Column {
2448
- /**
2449
- * If this column is part of a roll-up tree table, represents the type of the row data that can be found in this
2450
- * column for leaf nodes if includeConstituents is enabled. Otherwise, it is <b>null</b>.
2451
- * @return String
2452
- */
2453
- readonly constituentType?:string|null;
2454
- readonly description?:string|null;
2455
-
2456
- protected constructor();
2457
-
2458
- /**
2459
- * the value for this column in the given row. Type will be consistent with the type of the Column.
2460
- * @param row -
2461
- * @return Any
2462
- */
2463
- get(row:Row):any;
2464
- getFormat(row:Row):Format;
2465
- /**
2466
- * Creates a sort builder object, to be used when sorting by this column.
2467
- * @return {@link dh.Sort}
2468
- */
2469
- sort():Sort;
2470
- /**
2471
- * Creates a new value for use in filters based on this column. Used either as a parameter to another filter
2472
- * operation, or as a builder to create a filter operation.
2473
- * @return {@link dh.FilterValue}
2474
- */
2475
- filter():FilterValue;
2476
- /**
2477
- * a <b>CustomColumn</b> object to apply using `applyCustomColumns` with the expression specified.
2478
- * @param expression -
2479
- * @return {@link dh.CustomColumn}
2480
- */
2481
- formatColor(expression:string, options?:CustomColumnOptions|undefined|null):CustomColumn;
2357
+
2482
2358
  /**
2483
- * a <b>CustomColumn</b> object to apply using <b>applyCustomColumns</b> with the expression specified.
2484
- * @param expression -
2485
- * @return {@link dh.CustomColumn}
2359
+ * Closes the current connection, releasing any resources on the server or client.
2486
2360
  */
2487
- formatNumber(expression:string, options?:CustomColumnOptions|undefined|null):CustomColumn;
2361
+ close():void;
2362
+ running():Promise<IdeConnection>;
2488
2363
  /**
2489
- * a <b>CustomColumn</b> object to apply using <b>applyCustomColumns</b> with the expression specified.
2490
- * @param expression -
2491
- * @return {@link dh.CustomColumn}
2364
+ * Load the named table, with columns and size information already fully populated.
2365
+ * @param name - the name of the table to fetch
2366
+ * @param applyPreviewColumns - false to disable previews, defaults to true
2367
+ * @return a {@link Promise} that will resolve to the table, or reject with an error if it cannot be loaded.
2368
+ * @deprecated Added to resolve a specific issue, in the future preview will be applied as part of the subscription.
2492
2369
  */
2493
- formatDate(expression:string, options?:CustomColumnOptions|undefined|null):CustomColumn;
2494
- toString():string;
2370
+ getTable(name:string, applyPreviewColumns?:boolean):Promise<Table>;
2371
+ getObject(definitionObject:dh.ide.VariableDescriptor):Promise<any>;
2372
+ subscribeToFieldUpdates(callback:(arg0:dh.ide.VariableChanges)=>void):()=>void;
2495
2373
  /**
2496
- * Label for this column.
2497
- * @return String
2374
+ * Makes an `object` available to another user or another client on this same server which knows the value of
2375
+ * the `sharedTicketBytes`. Use that sharedTicketBytes value like a one-time use password - any other client
2376
+ * which knows this value can read the same object.
2377
+ * <p>
2378
+ * Shared objects will remain available using the sharedTicketBytes until the client that first shared them
2379
+ * releases/closes their copy of the object. Whatever side-channel is used to share the bytes, be sure to wait until
2380
+ * the remote end has signaled that it has successfully fetched the object before releasing it from this client.
2381
+ * <p>
2382
+ * Be sure to use an unpredictable value for the shared ticket bytes, like a UUID or other large, random value to
2383
+ * prevent access by unauthorized clients.
2384
+ * @param object - the object to share with another client/user
2385
+ * @param sharedTicketBytes - the value which another client/user must know to obtain the object. It may be a unicode
2386
+ * string (will be encoded as utf8 bytes), or a {@link Uint8Array} value.
2387
+ * @return A promise that will resolve to the value passed as sharedTicketBytes when the object is ready to be read
2388
+ * by another client, or will reject if an error occurs.
2498
2389
  */
2499
- get name():string;
2390
+ shareObject(object:Table|Widget|WidgetExportedObject|PartitionedTable|TotalsTable|TreeTable, sharedTicketBytes:string|Uint8Array):Promise<string|Uint8Array>;
2500
2391
  /**
2501
- * True if this column is a partition column. Partition columns are used for filtering uncoalesced tables - see
2502
- * {@link Table.uncoalesced}.
2503
- * @return true if the column is a partition column
2392
+ * Reads an object shared by another client to this server with the `sharedTicketBytes`. Until the other
2393
+ * client releases this object (or their session ends), the object will be available on the server.
2394
+ * <p>
2395
+ * The type of the object must be passed so that the object can be read from the server correct - the other client
2396
+ * should provide this information.
2397
+ * @param sharedTicketBytes - the value provided by another client/user to obtain the object. It may be a unicode
2398
+ * string (will be encoded as utf8 bytes), or a {@link Uint8Array} value.
2399
+ * @param type - The type of the object, so it can be correctly read from the server
2400
+ * @return A promise that will resolve to the shared object, or will reject with an error if it cannot be read.
2504
2401
  */
2505
- get isPartitionColumn():boolean;
2402
+ getSharedObject(sharedTicketBytes:string|Uint8Array, type:string):Promise<any>;
2403
+ newTable(columnNames:string[], types:string[], data:string[][], userTimeZone:string):Promise<Table>;
2506
2404
  /**
2507
- *
2508
- * @deprecated do not use. Internal index of the column in the table, to be used as a key on the Row.
2509
- * @return int
2405
+ * Merges the given tables into a single table. Assumes all tables have the same structure.
2406
+ * @param tables -
2407
+ * @return {@link Promise} of {@link dh.Table}
2510
2408
  */
2511
- get index():number;
2512
- get isSortable():boolean;
2409
+ mergeTables(tables:Table[]):Promise<Table>;
2513
2410
  /**
2514
- * Type of the row data that can be found in this column.
2515
- * @return String
2411
+ * Register a callback function to handle any log messages that are emitted on the server. Returns a function ,
2412
+ * which can be invoked to remove this log handler. Any log handler registered in this way will receive as many old
2413
+ * log messages as are presently available.
2414
+ * @param callback -
2415
+ * @return {@link io.deephaven.web.shared.fu.JsRunnable}
2516
2416
  */
2517
- get type():string;
2417
+ onLogMessage(callback:(arg0:dh.ide.LogItem)=>void):()=>void;
2418
+ startSession(type:string):Promise<IdeSession>;
2419
+ getConsoleTypes():Promise<Array<string>>;
2420
+ getWorkerHeapInfo():Promise<WorkerHeapInfo>;
2518
2421
  /**
2519
- * Format entire rows colors using the expression specified. Returns a <b>CustomColumn</b> object to apply to a
2520
- * table using <b>applyCustomColumns</b> with the parameters specified.
2521
- * @param expression -
2522
- * @param options -
2523
- * @return {@link dh.CustomColumn}
2422
+ * Listen for events on this object.
2423
+ * @param name - the name of the event to listen for
2424
+ * @param callback - a function to call when the event occurs
2425
+ * @return Returns a cleanup function.
2426
+ * @typeParam T - the type of the data that the event will provide
2524
2427
  */
2525
- static formatRowColor(expression:string, options?:CustomColumnOptions|undefined|null):CustomColumn;
2428
+ addEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):()=>void;
2429
+ nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<Event<T>>;
2430
+ hasListeners(name:string):boolean;
2526
2431
  /**
2527
- * a <b>CustomColumn</b> object to apply using <b>applyCustomColumns</b> with the expression specified.
2432
+ * Removes an event listener added to this table.
2528
2433
  * @param name -
2529
- * @param expression -
2530
- * @param options -
2531
- * @return {@link dh.CustomColumn}
2434
+ * @param callback -
2435
+ * @return
2436
+ * @typeParam T -
2532
2437
  */
2533
- static createCustomColumn(name:string, expression:string, options?:CustomColumnOptions|undefined|null):CustomColumn;
2438
+ removeEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):boolean;
2534
2439
  }
2535
2440
 
2536
2441
  /**
2537
- * Deprecated for use in Deephaven Core.
2538
- * @deprecated
2442
+ * Addition optional configuration that can be passed to the {@link dh.CoreClient} constructor.
2539
2443
  */
2540
- export class Client {
2541
- static readonly EVENT_REQUEST_FAILED:string;
2542
- static readonly EVENT_REQUEST_STARTED:string;
2543
- static readonly EVENT_REQUEST_SUCCEEDED:string;
2444
+ export class ConnectOptions {
2445
+ /**
2446
+ * Optional map of http header names and values to send to the server with each request.
2447
+ */
2448
+ headers?:{ [key: string]: string; }|null;
2449
+ /**
2450
+ * True to enable debug logging. At this time, only enables logging for gRPC calls.
2451
+ */
2452
+ debug?:boolean|null;
2453
+ /**
2454
+ * Set this to true to force the use of websockets when connecting to the deephaven instance, false to force the use
2455
+ * of `fetch`. Ignored if {@link dh.transportFactory} is set.
2456
+ * <p>
2457
+ * Defaults to null, indicating that the server URL should be checked to see if we connect with fetch or websockets.
2458
+ */
2459
+ useWebsockets?:boolean|null;
2460
+ /**
2461
+ * The transport factory to use for creating gRPC streams. If specified, the JS API will ignore
2462
+ * {@link dh.useWebsockets} and its own internal logic for determining the appropriate transport to use.
2463
+ * <p>
2464
+ * Defaults to null, indicating that the JS API should determine the appropriate transport to use. If
2465
+ * `useWebsockets` is set to true, the JS API will use websockets, otherwise if the server url begins with
2466
+ * https, it will use fetch, otherwise it will use websockets.
2467
+ */
2468
+ transportFactory?:dh.grpc.GrpcTransportFactory|null;
2544
2469
 
2545
2470
  constructor();
2546
2471
  }
@@ -2579,94 +2504,193 @@ export namespace dh {
2579
2504
  }
2580
2505
 
2581
2506
  /**
2582
- * A Widget represents a server side object that sends one or more responses to the client. The client can then
2583
- * interpret these responses to see what to render, or how to respond.
2584
- * <p>
2585
- * Most custom object types result in a single response being sent to the client, often with other exported objects, but
2586
- * some will have streamed responses, and allow the client to send follow-up requests of its own. This class's API is
2587
- * backwards compatible, but as such does not offer a way to tell the difference between a streaming or non-streaming
2588
- * object type, the client code that handles the payloads is expected to know what to expect. See
2589
- * {@link dh.WidgetMessageDetails} for more information.
2590
- * <p>
2591
- * When the promise that returns this object resolves, it will have the first response assigned to its fields. Later
2592
- * responses from the server will be emitted as "message" events. When the connection with the server ends, the "close"
2593
- * event will be emitted. In this way, the connection will behave roughly in the same way as a WebSocket - either side
2594
- * can close, and after close no more messages will be processed. There can be some latency in closing locally while
2595
- * remote messages are still pending - it is up to implementations of plugins to handle this case.
2596
- * <p>
2597
- * Also like WebSockets, the plugin API doesn't define how to serialize messages, and just handles any binary payloads.
2598
- * What it does handle however, is allowing those messages to include references to server-side objects with those
2599
- * payloads. Those server side objects might be tables or other built-in types in the Deephaven JS API, or could be
2600
- * objects usable through their own plugins. They also might have no plugin at all, allowing the client to hold a
2601
- * reference to them and pass them back to the server, either to the current plugin instance, or through another API.
2602
- * The `Widget` type does not specify how those objects should be used or their lifecycle, but leaves that
2603
- * entirely to the plugin. Messages will arrive in the order they were sent.
2604
- * <p>
2605
- * This can suggest several patterns for how plugins operate:
2606
- * <ul>
2607
- * <li>The plugin merely exists to transport some other object to the client. This can be useful for objects which can
2608
- * easily be translated to some other type (like a Table) when the user clicks on it. An example of this is
2609
- * `pandas.DataFrame` will result in a widget that only contains a static
2610
- * {@link dh.Table}. Presently, the widget is immediately closed, and only the Table is
2611
- * provided to the JS API consumer.</li>
2612
- * <li>The plugin provides references to Tables and other objects, and those objects can live longer than the object
2613
- * which provided them. One concrete example of this could have been
2614
- * {@link dh.PartitionedTable} when fetching constituent tables, but it was implemented
2615
- * before bidirectional plugins were implemented. Another example of this is plugins that serve as a "factory", giving
2616
- * the user access to table manipulation/creation methods not supported by gRPC or the JS API.</li>
2617
- * <li>The plugin provides reference to Tables and other objects that only make sense within the context of the widget
2618
- * instance, so when the widget goes away, those objects should be released as well. This is also an example of
2619
- * {@link dh.PartitionedTable}, as the partitioned table tracks creation of new keys through
2620
- * an internal table instance.</li>
2621
- * </ul>
2622
- *
2623
- * Handling server objects in messages also has more than one potential pattern that can be used:
2624
- * <ul>
2625
- * <li>One object per message - the message clearly is about that object, no other details required.</li>
2626
- * <li>Objects indexed within their message - as each message comes with a list of objects, those objects can be
2627
- * referenced within the payload by index. This is roughly how {@link dh.plot.Figure}
2628
- * behaves, where the figure descriptor schema includes an index for each created series, describing which table should
2629
- * be used, which columns should be mapped to each axis.</li>
2630
- * <li>Objects indexed since widget creation - each message would append its objects to a list created when the widget
2631
- * was first made, and any new exports that arrive in a new message would be appended to that list. Then, subsequent
2632
- * messages can reference objects already sent. This imposes a limitation where the client cannot release any exports
2633
- * without the server somehow signaling that it will never reference that export again.</li>
2634
- * </ul>
2507
+ * Describes a filter which can be applied to a table. Replacing these instances may be more expensive than reusing
2508
+ * them. These instances are immutable - all operations that compose them to build bigger expressions return a new
2509
+ * instance.
2510
+ */
2511
+ export class FilterCondition {
2512
+ protected constructor();
2513
+
2514
+ /**
2515
+ * the opposite of this condition
2516
+ * @return FilterCondition
2517
+ */
2518
+ not():FilterCondition;
2519
+ /**
2520
+ * a condition representing the current condition logically ANDed with the other parameters
2521
+ * @param filters -
2522
+ * @return FilterCondition
2523
+ */
2524
+ and(...filters:FilterCondition[]):FilterCondition;
2525
+ /**
2526
+ * a condition representing the current condition logically ORed with the other parameters
2527
+ * @param filters -
2528
+ * @return FilterCondition.
2529
+ */
2530
+ or(...filters:FilterCondition[]):FilterCondition;
2531
+ /**
2532
+ * a string suitable for debugging showing the details of this condition.
2533
+ * @return String.
2534
+ */
2535
+ toString():string;
2536
+ get columns():Array<Column>;
2537
+ /**
2538
+ * a filter condition invoking a static function with the given parameters. Currently supported Deephaven static
2539
+ * functions:
2540
+ * <ul>
2541
+ * <li><b>inRange</b>: Given three comparable values, returns true if the first is less than the second but greater
2542
+ * than the third</li>
2543
+ * <li><b>isInf</b>:Returns true if the given number is <i>infinity</i></li>
2544
+ * <li><b>isNaN</b>:Returns true if the given number is <i>not a number</i></li>
2545
+ * <li><b>isNormal</b>:Returns true if the given number <i>is not null</i>, <i>is not infinity</i>, and <i>is not
2546
+ * "not a number"</i></li>
2547
+ * <li><b>startsWith</b>:Returns true if the first string starts with the second string</li>
2548
+ * <li><b>endsWith</b>Returns true if the first string ends with the second string</li>
2549
+ * <li><b>matches</b>:Returns true if the first string argument matches the second string used as a Java regular
2550
+ * expression</li>
2551
+ * <li><b>contains</b>:Returns true if the first string argument contains the second string as a substring</li>
2552
+ * <li><b>in</b>:Returns true if the first string argument can be found in the second array argument.
2553
+ * <p>
2554
+ * Note that the array can only be specified as a column reference at this time - typically the `FilterValue.in`
2555
+ * method should be used in other cases
2556
+ * </p>
2557
+ * </li>
2558
+ * </ul>
2559
+ * @param function -
2560
+ * @param args -
2561
+ * @return dh.FilterCondition
2562
+ */
2563
+ static invoke(func:string, ...args:FilterValue[]):FilterCondition;
2564
+ /**
2565
+ * a filter condition which will check if the given value can be found in any supported column on whatever table
2566
+ * this FilterCondition is passed to. This FilterCondition is somewhat unique in that it need not be given a column
2567
+ * instance, but will adapt to any table. On numeric columns, with a value passed in which can be parsed as a
2568
+ * number, the column will be filtered to numbers which equal, or can be "rounded" effectively to this number. On
2569
+ * String columns, the given value will match any column which contains this string in a case-insensitive search. An
2570
+ * optional second argument can be passed, an array of `FilterValue` from the columns to limit this search to (see
2571
+ * {@link dh.Column.filter}).
2572
+ * @param value -
2573
+ * @param columns -
2574
+ * @return dh.FilterCondition
2575
+ */
2576
+ static search(value:FilterValue, columns?:FilterValue[]):FilterCondition;
2577
+ }
2578
+
2579
+ /**
2580
+ * Configuration object for running Table.treeTable to produce a hierarchical view of a given "flat" table.
2581
+ *
2582
+ * Like TotalsTableConfig, `TreeTableConfig` supports an operation map indicating how to aggregate the data, as well as
2583
+ * an array of column names which will be the layers in the roll-up tree, grouped at each level. An additional optional
2584
+ * value can be provided describing the strategy the engine should use when grouping the rows.
2635
2585
  */
2636
- export class Widget implements WidgetMessageDetails, HasEventHandling {
2637
- static readonly EVENT_MESSAGE:string;
2638
- static readonly EVENT_CLOSE:string;
2586
+ export class TreeTableConfig {
2587
+ /**
2588
+ * The column representing the unique ID for each item
2589
+ */
2590
+ idColumn:string;
2591
+ /**
2592
+ * The column representing the parent ID for each item
2593
+ */
2594
+ parentColumn:string;
2595
+ /**
2596
+ * Optional parameter indicating if items with an invalid parent ID should be promoted to root. Defaults to false.
2597
+ */
2598
+ promoteOrphansToRoot:boolean;
2599
+
2600
+ constructor();
2601
+ }
2602
+
2603
+ /**
2604
+ * Describes the structure of the column, and if desired can be used to get access to the data to be rendered in this
2605
+ * column.
2606
+ */
2607
+ export class Column {
2608
+ /**
2609
+ * If this column is part of a roll-up tree table, represents the type of the row data that can be found in this
2610
+ * column for leaf nodes if includeConstituents is enabled. Otherwise, it is <b>null</b>.
2611
+ * @return String
2612
+ */
2613
+ readonly constituentType?:string|null;
2614
+ readonly description?:string|null;
2639
2615
 
2640
2616
  protected constructor();
2641
2617
 
2642
2618
  /**
2643
- * Ends the client connection to the server.
2619
+ * the value for this column in the given row. Type will be consistent with the type of the Column.
2620
+ * @param row -
2621
+ * @return Any
2644
2622
  */
2645
- close():void;
2646
- getDataAsBase64():string;
2647
- getDataAsU8():Uint8Array;
2648
- getDataAsString():string;
2623
+ get(row:Row):any;
2624
+ getFormat(row:Row):Format;
2649
2625
  /**
2650
- * Sends a string/bytes payload to the server, along with references to objects that exist on the server.
2651
- * @param msg - string/buffer/view instance that represents data to send
2652
- * @param references - an array of objects that can be safely sent to the server
2626
+ * Creates a sort builder object, to be used when sorting by this column.
2627
+ * @return {@link dh.Sort}
2653
2628
  */
2654
- sendMessage(msg:string|ArrayBuffer|ArrayBufferView, references?:Array<Table|Widget|WidgetExportedObject|PartitionedTable|TotalsTable|TreeTable>):void;
2655
- addEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):()=>void;
2656
- nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<Event<T>>;
2657
- hasListeners(name:string):boolean;
2658
- removeEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):boolean;
2629
+ sort():Sort;
2659
2630
  /**
2660
- *
2661
- * @return the exported objects sent in the initial message from the server. The client is responsible for closing
2662
- * them when finished using them.
2631
+ * Creates a new value for use in filters based on this column. Used either as a parameter to another filter
2632
+ * operation, or as a builder to create a filter operation.
2633
+ * @return {@link dh.FilterValue}
2663
2634
  */
2664
- get exportedObjects():WidgetExportedObject[];
2635
+ filter():FilterValue;
2636
+ /**
2637
+ * a <b>CustomColumn</b> object to apply using `applyCustomColumns` with the expression specified.
2638
+ * @param expression -
2639
+ * @return {@link dh.CustomColumn}
2640
+ */
2641
+ formatColor(expression:string, options?:CustomColumnOptions|undefined|null):CustomColumn;
2642
+ /**
2643
+ * a <b>CustomColumn</b> object to apply using <b>applyCustomColumns</b> with the expression specified.
2644
+ * @param expression -
2645
+ * @return {@link dh.CustomColumn}
2646
+ */
2647
+ formatNumber(expression:string, options?:CustomColumnOptions|undefined|null):CustomColumn;
2648
+ /**
2649
+ * a <b>CustomColumn</b> object to apply using <b>applyCustomColumns</b> with the expression specified.
2650
+ * @param expression -
2651
+ * @return {@link dh.CustomColumn}
2652
+ */
2653
+ formatDate(expression:string, options?:CustomColumnOptions|undefined|null):CustomColumn;
2654
+ toString():string;
2655
+ /**
2656
+ * Label for this column.
2657
+ * @return String
2658
+ */
2659
+ get name():string;
2660
+ /**
2661
+ * True if this column is a partition column. Partition columns are used for filtering uncoalesced tables - see
2662
+ * {@link Table.uncoalesced}.
2663
+ * @return true if the column is a partition column
2664
+ */
2665
+ get isPartitionColumn():boolean;
2665
2666
  /**
2666
2667
  *
2667
- * @return the type of this widget
2668
+ * @deprecated do not use. Internal index of the column in the table, to be used as a key on the Row.
2669
+ * @return int
2670
+ */
2671
+ get index():number;
2672
+ get isSortable():boolean;
2673
+ /**
2674
+ * Type of the row data that can be found in this column.
2675
+ * @return String
2668
2676
  */
2669
2677
  get type():string;
2678
+ /**
2679
+ * Format entire rows colors using the expression specified. Returns a <b>CustomColumn</b> object to apply to a
2680
+ * table using <b>applyCustomColumns</b> with the parameters specified.
2681
+ * @param expression -
2682
+ * @param options -
2683
+ * @return {@link dh.CustomColumn}
2684
+ */
2685
+ static formatRowColor(expression:string, options?:CustomColumnOptions|undefined|null):CustomColumn;
2686
+ /**
2687
+ * a <b>CustomColumn</b> object to apply using <b>applyCustomColumns</b> with the expression specified.
2688
+ * @param name -
2689
+ * @param expression -
2690
+ * @param options -
2691
+ * @return {@link dh.CustomColumn}
2692
+ */
2693
+ static createCustomColumn(name:string, expression:string, options?:CustomColumnOptions|undefined|null):CustomColumn;
2670
2694
  }
2671
2695
 
2672
2696
  /**
@@ -2727,40 +2751,6 @@ export namespace dh {
2727
2751
  removeEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):boolean;
2728
2752
  }
2729
2753
 
2730
- /**
2731
- * Configuration object for running Table.treeTable to produce a hierarchical view of a given "flat" table.
2732
- *
2733
- * Like TotalsTableConfig, `TreeTableConfig` supports an operation map indicating how to aggregate the data, as well as
2734
- * an array of column names which will be the layers in the roll-up tree, grouped at each level. An additional optional
2735
- * value can be provided describing the strategy the engine should use when grouping the rows.
2736
- */
2737
- export class TreeTableConfig {
2738
- /**
2739
- * The column representing the unique ID for each item
2740
- */
2741
- idColumn:string;
2742
- /**
2743
- * The column representing the parent ID for each item
2744
- */
2745
- parentColumn:string;
2746
- /**
2747
- * Optional parameter indicating if items with an invalid parent ID should be promoted to root. Defaults to false.
2748
- */
2749
- promoteOrphansToRoot:boolean;
2750
-
2751
- constructor();
2752
- }
2753
-
2754
-
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;
2763
- }
2764
2754
 
2765
2755
  /**
2766
2756
  * A set of string constants that can be used to describe the different objects the JS API can export.
@@ -2809,6 +2799,16 @@ export namespace dh {
2809
2799
  static readonly SKIP:AggregationOperationType;
2810
2800
  }
2811
2801
 
2802
+ type ValueTypeType = string;
2803
+ export class ValueType {
2804
+ static readonly STRING:ValueTypeType;
2805
+ static readonly NUMBER:ValueTypeType;
2806
+ static readonly DOUBLE:ValueTypeType;
2807
+ static readonly LONG:ValueTypeType;
2808
+ static readonly DATETIME:ValueTypeType;
2809
+ static readonly BOOLEAN:ValueTypeType;
2810
+ }
2811
+
2812
2812
  type SearchDisplayModeType = string;
2813
2813
  export class SearchDisplayMode {
2814
2814
  static readonly SEARCH_DISPLAY_DEFAULT:SearchDisplayModeType;
@@ -2821,94 +2821,91 @@ export namespace dh {
2821
2821
  export namespace dh.ide {
2822
2822
 
2823
2823
  /**
2824
- * Describes changes in the current set of variables in the script session. Note that variables that changed value
2825
- * without changing type will be included as <b>updated</b>, but if a new value with one type replaces an old value with
2826
- * a different type, this will be included as an entry in both <b>removed</b> and <b>created</b> to indicate the old and
2827
- * new types.
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
2828
  */
2829
- export interface VariableChanges {
2830
- /**
2831
- *
2832
- * @return The variables that no longer exist after this operation, or were replaced by some variable with a
2833
- * different type.
2834
- */
2835
- get removed():Array<VariableDefinition>;
2829
+ export interface VariableDefinition {
2830
+ get name():string;
2836
2831
  /**
2837
- *
2838
- * @return The variables that were created by this operation, or have a new type.
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
2839
2835
  */
2840
- get created():Array<VariableDefinition>;
2836
+ get description():string;
2841
2837
  /**
2842
- *
2843
- * @return The variables that changed value during this operation.
2838
+ * An opaque identifier for this variable
2839
+ * @return String
2844
2840
  */
2845
- get updated():Array<VariableDefinition>;
2846
- }
2847
- /**
2848
- * Indicates the result of code run on the server.
2849
- */
2850
- export interface CommandResult {
2841
+ get id():string;
2851
2842
  /**
2852
- * Describes changes made in the course of this command.
2853
- * @return {@link dh.ide.VariableChanges}.
2843
+ * The type of the variable, one of <b>dh.VariableType</b>
2844
+ * @return dh.VariableType.
2854
2845
  */
2855
- get changes():VariableChanges;
2846
+ get type():dh.VariableTypeType;
2856
2847
  /**
2857
- * If the command failed, the error message will be provided here.
2848
+ * The name of the variable, to be used when rendering it to a user
2858
2849
  * @return String
2859
2850
  */
2860
- get error():string;
2851
+ get title():string;
2861
2852
  /**
2862
- * The timestamp when the command finished running.
2863
- * @return DateWrapper
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
2864
2856
  */
2865
- get endTimestamp():dh.DateWrapper;
2857
+ get applicationId():string;
2866
2858
  /**
2867
- * The timestamp when the command started running.
2868
- * @return DateWrapper
2859
+ * The name of the application which provided this variable
2860
+ * @return String
2869
2861
  */
2870
- get startTimestamp():dh.DateWrapper;
2862
+ get applicationName():string;
2871
2863
  }
2872
2864
  /**
2873
- * A format to describe a variable available to be read from the server. Application fields are optional, and only
2874
- * populated when a variable is provided by application mode.
2875
- * <p>
2876
- * APIs which take a VariableDefinition must at least be provided an object with a <b>type</b> and <b>id</b> field.
2865
+ * Represents a serialized fishlib LogRecord, suitable for display on javascript clients. A log entry sent from the
2866
+ * server.
2877
2867
  */
2878
- export interface VariableDefinition {
2879
- get name():string;
2868
+ export interface LogItem {
2880
2869
  /**
2881
- * Optional description for the variable's contents, typically used to provide more detail that wouldn't be
2882
- * reasonable to put in the title
2870
+ * The level of the log message, enabling the client to ignore messages.
2883
2871
  * @return String
2884
2872
  */
2885
- get description():string;
2873
+ get logLevel():string;
2886
2874
  /**
2887
- * An opaque identifier for this variable
2888
- * @return String
2875
+ * Timestamp of the message in microseconds since Jan 1, 1970 UTC.
2876
+ * @return double
2889
2877
  */
2890
- get id():string;
2878
+ get micros():number;
2891
2879
  /**
2892
- * The type of the variable, one of <b>dh.VariableType</b>
2893
- * @return dh.VariableType.
2880
+ * The log message written on the server.
2881
+ * @return String
2882
+ */
2883
+ get message():string;
2884
+ }
2885
+ /**
2886
+ * Indicates the result of code run on the server.
2887
+ */
2888
+ export interface CommandResult {
2889
+ /**
2890
+ * Describes changes made in the course of this command.
2891
+ * @return {@link dh.ide.VariableChanges}.
2894
2892
  */
2895
- get type():dh.VariableTypeType;
2893
+ get changes():VariableChanges;
2896
2894
  /**
2897
- * The name of the variable, to be used when rendering it to a user
2895
+ * If the command failed, the error message will be provided here.
2898
2896
  * @return String
2899
2897
  */
2900
- get title():string;
2898
+ get error():string;
2901
2899
  /**
2902
- * Optional description for the variable's contents, typically used to provide more detail that wouldn't be
2903
- * reasonable to put in the title
2904
- * @return String
2900
+ * The timestamp when the command finished running.
2901
+ * @return DateWrapper
2905
2902
  */
2906
- get applicationId():string;
2903
+ get endTimestamp():dh.DateWrapper;
2907
2904
  /**
2908
- * The name of the application which provided this variable
2909
- * @return String
2905
+ * The timestamp when the command started running.
2906
+ * @return DateWrapper
2910
2907
  */
2911
- get applicationName():string;
2908
+ get startTimestamp():dh.DateWrapper;
2912
2909
  }
2913
2910
  /**
2914
2911
  * Specifies a type and either id or name (but not both).
@@ -2919,25 +2916,28 @@ export namespace dh.ide {
2919
2916
  name?:string|null;
2920
2917
  }
2921
2918
  /**
2922
- * Represents a serialized fishlib LogRecord, suitable for display on javascript clients. A log entry sent from the
2923
- * server.
2919
+ * Describes changes in the current set of variables in the script session. Note that variables that changed value
2920
+ * without changing type will be included as <b>updated</b>, but if a new value with one type replaces an old value with
2921
+ * a different type, this will be included as an entry in both <b>removed</b> and <b>created</b> to indicate the old and
2922
+ * new types.
2924
2923
  */
2925
- export interface LogItem {
2924
+ export interface VariableChanges {
2926
2925
  /**
2927
- * The level of the log message, enabling the client to ignore messages.
2928
- * @return String
2926
+ *
2927
+ * @return The variables that no longer exist after this operation, or were replaced by some variable with a
2928
+ * different type.
2929
2929
  */
2930
- get logLevel():string;
2930
+ get removed():Array<VariableDefinition>;
2931
2931
  /**
2932
- * Timestamp of the message in microseconds since Jan 1, 1970 UTC.
2933
- * @return double
2932
+ *
2933
+ * @return The variables that were created by this operation, or have a new type.
2934
2934
  */
2935
- get micros():number;
2935
+ get created():Array<VariableDefinition>;
2936
2936
  /**
2937
- * The log message written on the server.
2938
- * @return String
2937
+ *
2938
+ * @return The variables that changed value during this operation.
2939
2939
  */
2940
- get message():string;
2940
+ get updated():Array<VariableDefinition>;
2941
2941
  }
2942
2942
  }
2943
2943
 
@@ -3210,6 +3210,33 @@ export namespace dh.i18n {
3210
3210
 
3211
3211
  export namespace dh.grpc {
3212
3212
 
3213
+ /**
3214
+ * Options for creating a gRPC stream transport instance.
3215
+ */
3216
+ export interface GrpcTransportOptions {
3217
+ /**
3218
+ * The gRPC method URL.
3219
+ */
3220
+ url:URL;
3221
+ /**
3222
+ * True to enable debug logging for this stream.
3223
+ */
3224
+ debug:boolean;
3225
+ /**
3226
+ * Callback for when headers and status are received. The headers are a map of header names to values, and the
3227
+ * status is the HTTP status code. If the connection could not be made, the status should be 0.
3228
+ */
3229
+ onHeaders:(headers:{ [key: string]: string|Array<string>; },status:number)=>void;
3230
+ /**
3231
+ * Callback for when a chunk of data is received.
3232
+ */
3233
+ onChunk:(chunk:Uint8Array)=>void;
3234
+ /**
3235
+ * Callback for when the stream ends, with an error instance if it can be provided. Note that the present
3236
+ * implementation does not consume errors, even if provided.
3237
+ */
3238
+ onEnd:(error?:Error|undefined|null)=>void;
3239
+ }
3213
3240
  /**
3214
3241
  * Factory for creating gRPC transports.
3215
3242
  */
@@ -3253,37 +3280,84 @@ export namespace dh.grpc {
3253
3280
  */
3254
3281
  cancel():void;
3255
3282
  }
3283
+ }
3284
+
3285
+ export namespace dh.plot {
3286
+
3256
3287
  /**
3257
- * Options for creating a gRPC stream transport instance.
3288
+ * Provides access to the data for displaying in a figure.
3258
3289
  */
3259
- export interface GrpcTransportOptions {
3290
+ export interface Series {
3291
+ readonly isLinesVisible?:boolean|null;
3292
+ readonly pointLabelFormat?:string|null;
3293
+ readonly yToolTipPattern?:string|null;
3294
+ readonly shapeSize?:number|null;
3295
+ readonly xToolTipPattern?:string|null;
3296
+ readonly isShapesVisible?:boolean|null;
3297
+
3298
+ subscribe(forceDisableDownsample?:DownsampleOptions):void;
3260
3299
  /**
3261
- * The gRPC method URL.
3300
+ * Disable updates for this Series.
3262
3301
  */
3263
- url:URL;
3302
+ unsubscribe():void;
3303
+ get shape():string;
3264
3304
  /**
3265
- * True to enable debug logging for this stream.
3305
+ * Contains details on how to access data within the chart for this series. keyed with the way that this series uses
3306
+ * the axis.
3307
+ * @return {@link dh.plot.SeriesDataSource}
3266
3308
  */
3267
- debug:boolean;
3309
+ get sources():SeriesDataSource[];
3310
+ get lineColor():string;
3268
3311
  /**
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.
3312
+ * The plotting style to use for this series. See <b>SeriesPlotStyle</b> enum for more details.
3313
+ * @return int
3271
3314
  */
3272
- onHeaders:(headers:{ [key: string]: string|Array<string>; },status:number)=>void;
3315
+ get plotStyle():SeriesPlotStyleType;
3316
+ get oneClick():OneClick;
3317
+ get gradientVisible():boolean;
3318
+ get shapeColor():string;
3273
3319
  /**
3274
- * Callback for when a chunk of data is received.
3320
+ * The name for this series.
3321
+ * @return String
3275
3322
  */
3276
- onChunk:(chunk:Uint8Array)=>void;
3323
+ get name():string;
3277
3324
  /**
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.
3325
+ * indicates that this series belongs to a MultiSeries, null otherwise
3326
+ * @return dh.plot.MultiSeries
3280
3327
  */
3281
- onEnd:(error?:Error|undefined|null)=>void;
3328
+ get multiSeries():MultiSeries;
3329
+ get shapeLabel():string;
3330
+ }
3331
+ export interface FigureDataUpdatedEvent {
3332
+ getArray(series:Series, sourceType:number, mappingFunc?:(arg0:any)=>any):Array<any>;
3333
+ get series():Series[];
3334
+ }
3335
+ export interface OneClick {
3336
+ setValueForColumn(columnName:string, value:any):void;
3337
+ getValueForColumn(columName:string):any;
3338
+ get requireAllFiltersToDisplay():boolean;
3339
+ get columns():dh.Column[];
3340
+ }
3341
+ /**
3342
+ * Describes how to access and display data required within a series.
3343
+ */
3344
+ export interface SeriesDataSource {
3345
+ /**
3346
+ * the type of data stored in the underlying table's Column.
3347
+ * @return String
3348
+ */
3349
+ get columnType():string;
3350
+ /**
3351
+ * the axis that this source should be drawn on.
3352
+ * @return dh.plot.Axis
3353
+ */
3354
+ get axis():Axis;
3355
+ /**
3356
+ * the feature of this series represented by this source. See the <b>SourceType</b> enum for more details.
3357
+ * @return int
3358
+ */
3359
+ get type():SourceTypeType;
3282
3360
  }
3283
- }
3284
-
3285
- export namespace dh.plot {
3286
-
3287
3361
  /**
3288
3362
  * Describes a template that will be used to make new series instances when a new table added to a plotBy.
3289
3363
  */
@@ -3299,12 +3373,6 @@ export namespace dh.plot {
3299
3373
  */
3300
3374
  get plotStyle():SeriesPlotStyleType;
3301
3375
  }
3302
- export interface OneClick {
3303
- setValueForColumn(columnName:string, value:any):void;
3304
- getValueForColumn(columName:string):any;
3305
- get requireAllFiltersToDisplay():boolean;
3306
- get columns():dh.Column[];
3307
- }
3308
3376
  /**
3309
3377
  * Defines one axis used with by series. These instances will be found both on the Chart and the Series instances, and
3310
3378
  * may be shared between Series instances.
@@ -3338,223 +3406,107 @@ export namespace dh.plot {
3338
3406
  * The label for this axis.
3339
3407
  * @return String
3340
3408
  */
3341
- get label():string;
3342
- get timeAxis():boolean;
3343
- /**
3344
- * The type for this axis, indicating how it will be drawn. See <b>AxisType</b> enum for more details.
3345
- * @return int
3346
- */
3347
- get type():AxisTypeType;
3348
- get minorTicksVisible():boolean;
3349
- get minorTickCount():number;
3350
- get majorTickLocations():number[];
3351
- get majorTicksVisible():boolean;
3352
- get ticksFont():string;
3353
- /**
3354
- * The unique id for this axis.
3355
- * @return String
3356
- */
3357
- get id():string;
3358
- /**
3359
- * The position for this axis. See <b>AxisPosition</b> enum for more details.
3360
- * @return int
3361
- */
3362
- get position():AxisPositionType;
3363
- /**
3364
- * The calendar with the business hours and holidays to transform plot data against. Defaults to null, or no
3365
- * transform.
3366
- * @return dh.calendar.BusinessCalendar
3367
- */
3368
- get businessCalendar():dh.calendar.BusinessCalendar;
3369
- /**
3370
- * The type for this axis. See <b>AxisFormatType</b> enum for more details.
3371
- * @return int
3372
- */
3373
- get formatType():AxisFormatTypeType;
3374
- get minRange():number;
3375
- }
3376
- /**
3377
- * Describes how to access and display data required within a series.
3378
- */
3379
- export interface SeriesDataSource {
3380
- /**
3381
- * the type of data stored in the underlying table's Column.
3382
- * @return String
3383
- */
3384
- get columnType():string;
3385
- /**
3386
- * the axis that this source should be drawn on.
3387
- * @return dh.plot.Axis
3388
- */
3389
- get axis():Axis;
3390
- /**
3391
- * the feature of this series represented by this source. See the <b>SourceType</b> enum for more details.
3392
- * @return int
3393
- */
3394
- get type():SourceTypeType;
3395
- }
3396
- /**
3397
- * Provides access to the data for displaying in a figure.
3398
- */
3399
- export interface Series {
3400
- readonly isLinesVisible?:boolean|null;
3401
- readonly pointLabelFormat?:string|null;
3402
- readonly yToolTipPattern?:string|null;
3403
- readonly shapeSize?:number|null;
3404
- readonly xToolTipPattern?:string|null;
3405
- readonly isShapesVisible?:boolean|null;
3406
-
3407
- subscribe(forceDisableDownsample?:DownsampleOptions):void;
3408
- /**
3409
- * Disable updates for this Series.
3410
- */
3411
- unsubscribe():void;
3412
- get shape():string;
3413
- /**
3414
- * Contains details on how to access data within the chart for this series. keyed with the way that this series uses
3415
- * the axis.
3416
- * @return {@link dh.plot.SeriesDataSource}
3417
- */
3418
- get sources():SeriesDataSource[];
3419
- get lineColor():string;
3420
- /**
3421
- * The plotting style to use for this series. See <b>SeriesPlotStyle</b> enum for more details.
3422
- * @return int
3423
- */
3424
- get plotStyle():SeriesPlotStyleType;
3425
- get oneClick():OneClick;
3426
- get gradientVisible():boolean;
3427
- get shapeColor():string;
3428
- /**
3429
- * The name for this series.
3430
- * @return String
3431
- */
3432
- get name():string;
3409
+ get label():string;
3410
+ get timeAxis():boolean;
3433
3411
  /**
3434
- * indicates that this series belongs to a MultiSeries, null otherwise
3435
- * @return dh.plot.MultiSeries
3412
+ * The type for this axis, indicating how it will be drawn. See <b>AxisType</b> enum for more details.
3413
+ * @return int
3436
3414
  */
3437
- get multiSeries():MultiSeries;
3438
- get shapeLabel():string;
3439
- }
3440
- export interface FigureDataUpdatedEvent {
3441
- getArray(series:Series, sourceType:number, mappingFunc?:(arg0:any)=>any):Array<any>;
3442
- get series():Series[];
3443
- }
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;
3458
-
3459
- constructor();
3460
- }
3461
-
3462
- /**
3463
- * Provide the details for a chart.
3464
- */
3465
- export class Chart implements dh.HasEventHandling {
3415
+ get type():AxisTypeType;
3416
+ get minorTicksVisible():boolean;
3417
+ get minorTickCount():number;
3418
+ get majorTickLocations():number[];
3419
+ get majorTicksVisible():boolean;
3420
+ get ticksFont():string;
3466
3421
  /**
3467
- * a new series was added to this chart as part of a multi-series. The series instance is the detail for this event.
3422
+ * The unique id for this axis.
3423
+ * @return String
3468
3424
  */
3469
- static readonly EVENT_SERIES_ADDED:string;
3425
+ get id():string;
3470
3426
  /**
3471
- * The title of the chart.
3472
- * @return String
3427
+ * The position for this axis. See <b>AxisPosition</b> enum for more details.
3428
+ * @return int
3473
3429
  */
3474
- readonly title?:string|null;
3475
-
3476
- protected constructor();
3477
-
3478
- addEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):()=>void;
3479
- nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<dh.Event<T>>;
3480
- hasListeners(name:string):boolean;
3481
- removeEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):boolean;
3482
- get column():number;
3483
- get showLegend():boolean;
3430
+ get position():AxisPositionType;
3484
3431
  /**
3485
- * The axes used in this chart.
3486
- * @return dh.plot.Axis
3432
+ * The calendar with the business hours and holidays to transform plot data against. Defaults to null, or no
3433
+ * transform.
3434
+ * @return dh.calendar.BusinessCalendar
3487
3435
  */
3488
- get axes():Axis[];
3489
- get is3d():boolean;
3490
- get titleFont():string;
3491
- get colspan():number;
3492
- get titleColor():string;
3493
- get series():Series[];
3494
- get rowspan():number;
3436
+ get businessCalendar():dh.calendar.BusinessCalendar;
3495
3437
  /**
3496
- * The type of this chart, see <b>ChartType</b> enum for more details.
3438
+ * The type for this axis. See <b>AxisFormatType</b> enum for more details.
3497
3439
  * @return int
3498
3440
  */
3499
- get chartType():ChartTypeType;
3500
- get row():number;
3501
- get legendColor():string;
3502
- get legendFont():string;
3503
- get multiSeries():MultiSeries[];
3504
- }
3505
-
3506
- export class SourceDescriptor {
3507
- axis:AxisDescriptor;
3508
- table:dh.Table;
3509
- columnName:string;
3510
- type:string;
3511
-
3512
- constructor();
3441
+ get formatType():AxisFormatTypeType;
3442
+ get minRange():number;
3513
3443
  }
3514
3444
 
3515
3445
  /**
3516
- * Helper class for plot downsampling methods.
3446
+ * Helper class to manage snapshots and deltas and keep not only a contiguous JS array of data per column in the
3447
+ * underlying table, but also support a mapping function to let client code translate data in some way for display and
3448
+ * keep that cached as well.
3517
3449
  */
3518
- export class Downsample {
3519
- protected constructor();
3450
+ export class ChartData {
3451
+ constructor(table:dh.Table);
3520
3452
 
3453
+ update(tableData:dh.SubscriptionTableData):void;
3454
+ getColumn(columnName:string, mappingFunc:(arg0:any)=>any, currentUpdate:dh.TableData):Array<any>;
3521
3455
  /**
3522
- * Downsamples a table so that the data can be used for a time-series line plot. The downsampled table should have
3523
- * the same visual fidelity as the original table, but with fewer rows.
3524
- * @param table - The table to downsample.
3525
- * @param xCol - The name of the X column to downsample. Must be an Instant or long.
3526
- * @param yCols - The names of the Y columns to downsample.
3527
- * @param width - The width of the visible area in pixels.
3528
- * @param xRange - The visible range as `[start, end]` or null to always use all data.
3529
- * @return A promise that resolves to the downsampled table.
3456
+ * Removes some column from the cache, avoiding extra computation on incoming events, and possibly freeing some
3457
+ * memory. If this pair of column name and map function are requested again, it will be recomputed from scratch.
3530
3458
  */
3531
- static runChartDownsample(table:dh.Table, xCol:string, yCols:string[], width:number, xRange?:dh.LongWrapper[]|undefined|null):Promise<dh.Table>;
3459
+ removeColumn(columnName:string, mappingFunc:(arg0:any)=>any):void;
3532
3460
  }
3533
3461
 
3534
- export class AxisDescriptor {
3535
- formatType:string;
3536
- type:string;
3537
- position:string;
3538
- log?:boolean|null;
3539
- label?:string|null;
3540
- labelFont?:string|null;
3541
- ticksFont?:string|null;
3542
- formatPattern?:string|null;
3543
- color?:string|null;
3544
- minRange?:number|null;
3545
- maxRange?:number|null;
3546
- minorTicksVisible?:boolean|null;
3547
- majorTicksVisible?:boolean|null;
3548
- minorTickCount?:number|null;
3549
- gapBetweenMajorTicks?:number|null;
3550
- majorTickLocations?:Array<number>|null;
3551
- tickLabelAngle?:number|null;
3552
- invert?:boolean|null;
3553
- isTimeAxis?:boolean|null;
3462
+ export class FigureSourceException {
3463
+ table:dh.Table;
3464
+ source:SeriesDataSource;
3554
3465
 
3555
- constructor();
3466
+ protected constructor();
3467
+ }
3468
+
3469
+ export class SeriesDataSourceException {
3470
+ protected constructor();
3471
+
3472
+ get source():SeriesDataSource;
3473
+ get message():string;
3556
3474
  }
3557
3475
 
3476
+ /**
3477
+ * Provides the details for a figure.
3478
+ *
3479
+ * The Deephaven JS API supports automatic lossless downsampling of time-series data, when that data is plotted in one
3480
+ * or more line series. Using a scatter plot or a X-axis of some type other than DateTime will prevent this feature from
3481
+ * being applied to a series. To enable this feature, invoke <b>Axis.range(...)</b> to specify the length in pixels of
3482
+ * the axis on the screen, and the range of values that are visible, and the server will use that width (and range, if
3483
+ * any) to reduce the number of points sent to the client.
3484
+ *
3485
+ * Downsampling can also be controlled when calling either <b>Figure.subscribe()</b> or <b>Series.subscribe()</b> - both
3486
+ * can be given an optional <b>dh.plot.DownsampleOptions</b> argument. Presently only two valid values exist,
3487
+ * <b>DEFAULT</b>, and <b>DISABLE</b>, and if no argument is specified, <b>DEFAULT</b> is assumed. If there are more
3488
+ * than 30,000 rows in a table, downsampling will be encouraged - data will not load without calling
3489
+ * <b>subscribe(DISABLE)</b> or enabling downsampling via <b>Axis.range(...)</b>. If there are more than 200,000 rows,
3490
+ * data will refuse to load without downsampling and <b>subscribe(DISABLE)</b> would have no effect.
3491
+ *
3492
+ * Downsampled data looks like normal data, except that select items have been removed if they would be redundant in the
3493
+ * UI given the current configuration. Individual rows are intact, so that a tooltip or some other UI item is sure to be
3494
+ * accurate and consistent, and at least the highest and lowest value for each axis will be retained as well, to ensure
3495
+ * that the "important" values are visible.
3496
+ *
3497
+ * Four events exist to help with interacting with downsampled data, all fired from the <b>Figure</b> instance itself.
3498
+ * First, <b>downsampleneeded</b> indicates that more than 30,000 rows would be fetched, and so specifying downsampling
3499
+ * is no longer optional - it must either be enabled (calling <b>axis.range(...)</b>), or disabled. If the figure is
3500
+ * configured for downsampling, when a change takes place that requires that the server perform some downsampling work,
3501
+ * the <b>downsamplestarted</b> event will first be fired, which can be used to present a brief loading message,
3502
+ * indicating to the user why data is not ready yet - when the server side process is complete,
3503
+ * <b>downsamplefinished</b> will be fired. These events will repeat when the range changes, such as when zooming,
3504
+ * panning, or resizing the figure. Finally, <b>downsamplefailed</b> indicates that something when wrong when
3505
+ * downsampling, or possibly that downsampling cannot be disabled due to the number of rows in the table.
3506
+ *
3507
+ * At this time, not marked as a ServerObject, due to internal implementation issues which leave the door open to
3508
+ * client-created figures.
3509
+ */
3558
3510
  export class Figure implements dh.HasEventHandling {
3559
3511
  /**
3560
3512
  * The title of the figure.
@@ -3598,7 +3550,8 @@ export namespace dh.plot {
3598
3550
  */
3599
3551
  static readonly EVENT_DOWNSAMPLENEEDED:string;
3600
3552
 
3601
- static create(config:FigureDescriptor):Promise<Figure>;
3553
+ protected constructor();
3554
+
3602
3555
  subscribe(forceDisableDownsample?:DownsampleOptions):void;
3603
3556
  /**
3604
3557
  * Disable updates for all series in this figure.
@@ -3630,13 +3583,141 @@ export namespace dh.plot {
3630
3583
  nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<dh.Event<T>>;
3631
3584
  hasListeners(name:string):boolean;
3632
3585
  /**
3633
- * Removes an event listener added to this table.
3634
- * @param name -
3635
- * @param callback -
3636
- * @return
3637
- * @typeParam T -
3586
+ * Removes an event listener added to this table.
3587
+ * @param name -
3588
+ * @param callback -
3589
+ * @return
3590
+ * @typeParam T -
3591
+ */
3592
+ removeEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):boolean;
3593
+ static create(config:FigureDescriptor):Promise<Figure>;
3594
+ }
3595
+
3596
+ export class SourceDescriptor {
3597
+ axis:AxisDescriptor;
3598
+ table:dh.Table;
3599
+ columnName:string;
3600
+ type:string;
3601
+
3602
+ constructor();
3603
+ }
3604
+
3605
+ export class FigureFetchError {
3606
+ error:object;
3607
+ errors:Array<string>;
3608
+
3609
+ protected constructor();
3610
+ }
3611
+
3612
+ export class DownsampleOptions {
3613
+ /**
3614
+ * Max number of items in the series before DEFAULT will not attempt to load the series without downsampling. Above
3615
+ * this size if downsample fails or is not applicable, the series won't be loaded unless DISABLE is passed to
3616
+ * series.subscribe().
3617
+ */
3618
+ static MAX_SERIES_SIZE:number;
3619
+ /**
3620
+ * Max number of items in the series where the subscription will be allowed at all. Above this limit, even with
3621
+ * downsampling disabled, the series will not load data.
3622
+ */
3623
+ static MAX_SUBSCRIPTION_SIZE:number;
3624
+ /**
3625
+ * Flag to let the API decide what data will be available, based on the nature of the data, the series, and how the
3626
+ * axes are configured.
3627
+ */
3628
+ static readonly DEFAULT:DownsampleOptions;
3629
+ /**
3630
+ * Flat to entirely disable downsampling, and force all data to load, no matter how many items that would be, up to
3631
+ * the limit of MAX_SUBSCRIPTION_SIZE.
3632
+ */
3633
+ static readonly DISABLE:DownsampleOptions;
3634
+
3635
+ protected constructor();
3636
+ }
3637
+
3638
+ export class ChartDescriptor {
3639
+ colspan?:number|null;
3640
+ rowspan?:number|null;
3641
+ series:Array<SeriesDescriptor>;
3642
+ axes:Array<AxisDescriptor>;
3643
+ chartType:string;
3644
+ title?:string|null;
3645
+ titleFont?:string|null;
3646
+ titleColor?:string|null;
3647
+ showLegend?:boolean|null;
3648
+ legendFont?:string|null;
3649
+ legendColor?:string|null;
3650
+ is3d?:boolean|null;
3651
+
3652
+ constructor();
3653
+ }
3654
+
3655
+ /**
3656
+ * Provide the details for a chart.
3657
+ */
3658
+ export class Chart implements dh.HasEventHandling {
3659
+ /**
3660
+ * a new series was added to this chart as part of a multi-series. The series instance is the detail for this event.
3661
+ */
3662
+ static readonly EVENT_SERIES_ADDED:string;
3663
+ /**
3664
+ * The title of the chart.
3665
+ * @return String
3666
+ */
3667
+ readonly title?:string|null;
3668
+
3669
+ protected constructor();
3670
+
3671
+ addEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):()=>void;
3672
+ nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<dh.Event<T>>;
3673
+ hasListeners(name:string):boolean;
3674
+ removeEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):boolean;
3675
+ get column():number;
3676
+ get showLegend():boolean;
3677
+ /**
3678
+ * The axes used in this chart.
3679
+ * @return dh.plot.Axis
3680
+ */
3681
+ get axes():Axis[];
3682
+ get is3d():boolean;
3683
+ get titleFont():string;
3684
+ get colspan():number;
3685
+ get titleColor():string;
3686
+ get series():Series[];
3687
+ get rowspan():number;
3688
+ /**
3689
+ * The type of this chart, see <b>ChartType</b> enum for more details.
3690
+ * @return int
3638
3691
  */
3639
- removeEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):boolean;
3692
+ get chartType():ChartTypeType;
3693
+ get row():number;
3694
+ get legendColor():string;
3695
+ get legendFont():string;
3696
+ get multiSeries():MultiSeries[];
3697
+ }
3698
+
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
+
3720
+ constructor();
3640
3721
  }
3641
3722
 
3642
3723
  export class SeriesDescriptor {
@@ -3658,61 +3739,23 @@ export namespace dh.plot {
3658
3739
  constructor();
3659
3740
  }
3660
3741
 
3661
- export class FigureFetchError {
3662
- error:object;
3663
- errors:Array<string>;
3664
-
3665
- protected constructor();
3666
- }
3667
-
3668
- export class DownsampleOptions {
3669
- /**
3670
- * Max number of items in the series before DEFAULT will not attempt to load the series without downsampling. Above
3671
- * this size if downsample fails or is not applicable, the series won't be loaded unless DISABLE is passed to
3672
- * series.subscribe().
3673
- */
3674
- static MAX_SERIES_SIZE:number;
3675
- /**
3676
- * Max number of items in the series where the subscription will be allowed at all. Above this limit, even with
3677
- * downsampling disabled, the series will not load data.
3678
- */
3679
- static MAX_SUBSCRIPTION_SIZE:number;
3680
- /**
3681
- * Flag to let the API decide what data will be available, based on the nature of the data, the series, and how the
3682
- * axes are configured.
3683
- */
3684
- static readonly DEFAULT:DownsampleOptions;
3685
- /**
3686
- * Flat to entirely disable downsampling, and force all data to load, no matter how many items that would be, up to
3687
- * the limit of MAX_SUBSCRIPTION_SIZE.
3688
- */
3689
- static readonly DISABLE:DownsampleOptions;
3690
-
3691
- protected constructor();
3692
- }
3693
-
3694
- export class FigureSourceException {
3695
- table:dh.Table;
3696
- source:SeriesDataSource;
3697
-
3698
- protected constructor();
3699
- }
3700
-
3701
3742
  /**
3702
- * Helper class to manage snapshots and deltas and keep not only a contiguous JS array of data per column in the
3703
- * underlying table, but also support a mapping function to let client code translate data in some way for display and
3704
- * keep that cached as well.
3743
+ * Helper class for plot downsampling methods.
3705
3744
  */
3706
- export class ChartData {
3707
- constructor(table:dh.Table);
3745
+ export class Downsample {
3746
+ protected constructor();
3708
3747
 
3709
- update(tableData:dh.SubscriptionTableData):void;
3710
- getColumn(columnName:string, mappingFunc:(arg0:any)=>any, currentUpdate:dh.TableData):Array<any>;
3711
3748
  /**
3712
- * Removes some column from the cache, avoiding extra computation on incoming events, and possibly freeing some
3713
- * memory. If this pair of column name and map function are requested again, it will be recomputed from scratch.
3749
+ * Downsamples a table so that the data can be used for a time-series line plot. The downsampled table should have
3750
+ * the same visual fidelity as the original table, but with fewer rows.
3751
+ * @param table - The table to downsample.
3752
+ * @param xCol - The name of the X column to downsample. Must be an Instant or long.
3753
+ * @param yCols - The names of the Y columns to downsample.
3754
+ * @param width - The width of the visible area in pixels.
3755
+ * @param xRange - The visible range as `[start, end]` or null to always use all data.
3756
+ * @return A promise that resolves to the downsampled table.
3714
3757
  */
3715
- removeColumn(columnName:string, mappingFunc:(arg0:any)=>any):void;
3758
+ static runChartDownsample(table:dh.Table, xCol:string, yCols:string[], width:number, xRange?:dh.LongWrapper[]|undefined|null):Promise<dh.Table>;
3716
3759
  }
3717
3760
 
3718
3761
  /**
@@ -3732,29 +3775,6 @@ export namespace dh.plot {
3732
3775
  constructor();
3733
3776
  }
3734
3777
 
3735
- export class SeriesDataSourceException {
3736
- protected constructor();
3737
-
3738
- get source():SeriesDataSource;
3739
- get message():string;
3740
- }
3741
-
3742
-
3743
- type AxisFormatTypeType = number;
3744
- export class AxisFormatType {
3745
- static readonly CATEGORY:AxisFormatTypeType;
3746
- static readonly NUMBER:AxisFormatTypeType;
3747
- }
3748
-
3749
- type AxisTypeType = number;
3750
- export class AxisType {
3751
- static readonly X:AxisTypeType;
3752
- static readonly Y:AxisTypeType;
3753
- static readonly SHAPE:AxisTypeType;
3754
- static readonly SIZE:AxisTypeType;
3755
- static readonly LABEL:AxisTypeType;
3756
- static readonly COLOR:AxisTypeType;
3757
- }
3758
3778
 
3759
3779
  /**
3760
3780
  * This enum describes the source it is in, and how this aspect of the data in the series should be used to render the
@@ -3785,6 +3805,12 @@ export namespace dh.plot {
3785
3805
  static readonly HOVER_TEXT:SourceTypeType;
3786
3806
  }
3787
3807
 
3808
+ type AxisFormatTypeType = number;
3809
+ export class AxisFormatType {
3810
+ static readonly CATEGORY:AxisFormatTypeType;
3811
+ static readonly NUMBER:AxisFormatTypeType;
3812
+ }
3813
+
3788
3814
  /**
3789
3815
  * This enum describes what kind of chart is being drawn. This may limit what kinds of series can be found on it, or how
3790
3816
  * those series should be rendered.
@@ -3800,6 +3826,25 @@ export namespace dh.plot {
3800
3826
  static readonly TREEMAP:ChartTypeType;
3801
3827
  }
3802
3828
 
3829
+ type AxisPositionType = number;
3830
+ export class AxisPosition {
3831
+ static readonly TOP:AxisPositionType;
3832
+ static readonly BOTTOM:AxisPositionType;
3833
+ static readonly LEFT:AxisPositionType;
3834
+ static readonly RIGHT:AxisPositionType;
3835
+ static readonly NONE:AxisPositionType;
3836
+ }
3837
+
3838
+ type AxisTypeType = number;
3839
+ export class AxisType {
3840
+ static readonly X:AxisTypeType;
3841
+ static readonly Y:AxisTypeType;
3842
+ static readonly SHAPE:AxisTypeType;
3843
+ static readonly SIZE:AxisTypeType;
3844
+ static readonly LABEL:AxisTypeType;
3845
+ static readonly COLOR:AxisTypeType;
3846
+ }
3847
+
3803
3848
  type SeriesPlotStyleType = number;
3804
3849
  export class SeriesPlotStyle {
3805
3850
  static readonly BAR:SeriesPlotStyleType;
@@ -3816,37 +3861,23 @@ export namespace dh.plot {
3816
3861
  static readonly TREEMAP:SeriesPlotStyleType;
3817
3862
  }
3818
3863
 
3819
- type AxisPositionType = number;
3820
- export class AxisPosition {
3821
- static readonly TOP:AxisPositionType;
3822
- static readonly BOTTOM:AxisPositionType;
3823
- static readonly LEFT:AxisPositionType;
3824
- static readonly RIGHT:AxisPositionType;
3825
- static readonly NONE:AxisPositionType;
3826
- }
3827
-
3828
3864
  }
3829
3865
 
3830
3866
  export namespace dh.lsp {
3831
3867
 
3832
- export class TextDocumentContentChangeEvent {
3833
- range:Range;
3834
- rangeLength:number;
3835
- text:string;
3836
-
3837
- constructor();
3838
- }
3839
-
3840
- export class TextEdit {
3841
- range:Range;
3842
- text:string;
3843
-
3844
- constructor();
3845
- }
3846
-
3847
- export class MarkupContent {
3848
- kind:string;
3849
- value:string;
3868
+ export class CompletionItem {
3869
+ label:string;
3870
+ kind:number;
3871
+ detail:string;
3872
+ documentation:MarkupContent;
3873
+ deprecated:boolean;
3874
+ preselect:boolean;
3875
+ textEdit:TextEdit;
3876
+ sortText:string;
3877
+ filterText:string;
3878
+ insertTextFormat:number;
3879
+ additionalTextEdits:Array<TextEdit>;
3880
+ commitCharacters:Array<string>;
3850
3881
 
3851
3882
  constructor();
3852
3883
  }
@@ -3871,19 +3902,25 @@ export namespace dh.lsp {
3871
3902
  copy():Position;
3872
3903
  }
3873
3904
 
3874
- export class CompletionItem {
3905
+ export class SignatureInformation {
3875
3906
  label:string;
3876
- kind:number;
3877
- detail:string;
3878
3907
  documentation:MarkupContent;
3879
- deprecated:boolean;
3880
- preselect:boolean;
3881
- textEdit:TextEdit;
3882
- sortText:string;
3883
- filterText:string;
3884
- insertTextFormat:number;
3885
- additionalTextEdits:Array<TextEdit>;
3886
- commitCharacters:Array<string>;
3908
+ parameters:Array<ParameterInformation>;
3909
+ activeParameter:number;
3910
+
3911
+ constructor();
3912
+ }
3913
+
3914
+ export class TextEdit {
3915
+ range:Range;
3916
+ text:string;
3917
+
3918
+ constructor();
3919
+ }
3920
+
3921
+ export class Hover {
3922
+ contents:MarkupContent;
3923
+ range:Range;
3887
3924
 
3888
3925
  constructor();
3889
3926
  }
@@ -3897,18 +3934,17 @@ export namespace dh.lsp {
3897
3934
  isInside(innerStart:Position, innerEnd:Position):boolean;
3898
3935
  }
3899
3936
 
3900
- export class SignatureInformation {
3901
- label:string;
3902
- documentation:MarkupContent;
3903
- parameters:Array<ParameterInformation>;
3904
- activeParameter:number;
3937
+ export class MarkupContent {
3938
+ kind:string;
3939
+ value:string;
3905
3940
 
3906
3941
  constructor();
3907
3942
  }
3908
3943
 
3909
- export class Hover {
3910
- contents:MarkupContent;
3944
+ export class TextDocumentContentChangeEvent {
3911
3945
  range:Range;
3946
+ rangeLength:number;
3947
+ text:string;
3912
3948
 
3913
3949
  constructor();
3914
3950
  }
@@ -3917,6 +3953,18 @@ export namespace dh.lsp {
3917
3953
 
3918
3954
  export namespace dh.calendar {
3919
3955
 
3956
+ export interface Holiday {
3957
+ /**
3958
+ * The date of the Holiday.
3959
+ * @return {@link dh.LocalDateWrapper}
3960
+ */
3961
+ get date():dh.LocalDateWrapper;
3962
+ /**
3963
+ * The business periods that are open on the holiday.
3964
+ * @return dh.calendar.BusinessPeriod
3965
+ */
3966
+ get businessPeriods():Array<BusinessPeriod>;
3967
+ }
3920
3968
  export interface BusinessPeriod {
3921
3969
  get close():string;
3922
3970
  get open():string;
@@ -3951,18 +3999,6 @@ export namespace dh.calendar {
3951
3999
  */
3952
4000
  get businessPeriods():Array<BusinessPeriod>;
3953
4001
  }
3954
- export interface Holiday {
3955
- /**
3956
- * The date of the Holiday.
3957
- * @return {@link dh.LocalDateWrapper}
3958
- */
3959
- get date():dh.LocalDateWrapper;
3960
- /**
3961
- * The business periods that are open on the holiday.
3962
- * @return dh.calendar.BusinessPeriod
3963
- */
3964
- get businessPeriods():Array<BusinessPeriod>;
3965
- }
3966
4002
 
3967
4003
  type DayOfWeekType = string;
3968
4004
  export class DayOfWeek {