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

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 +1920 -1884
  2. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -1,6 +1,10 @@
1
1
  // Minimum TypeScript Version: 4.3
2
2
  // Generated using com.vertispan.tsdefs.doclet.TsDoclet
3
3
 
4
+ export interface IIterableResult<T> {
5
+ value:T;
6
+ done:boolean;
7
+ }
4
8
  /**
5
9
  * This is part of EcmaScript 2015, documented here for completeness. It supports a single method, <b>next()</b>, which
6
10
  * returns an object with a <b>boolean</b> named <b>done</b> (true if there are no more items to return; false
@@ -11,12 +15,39 @@ export interface Iterator<T> {
11
15
  hasNext():boolean;
12
16
  next():IIterableResult<T>;
13
17
  }
14
- export interface IIterableResult<T> {
15
- value:T;
16
- done:boolean;
17
- }
18
18
  export namespace dh.storage {
19
19
 
20
+ /**
21
+ * Storage service metadata about files and folders.
22
+ */
23
+ export class ItemDetails {
24
+ protected constructor();
25
+
26
+ toString():string;
27
+ get filename():string;
28
+ get basename():string;
29
+ get size():number;
30
+ get etag():string;
31
+ get type():ItemTypeType;
32
+ get dirname():string;
33
+ }
34
+
35
+ /**
36
+ * Represents a file's contents loaded from the server. If an etag was specified when loading, client should first test
37
+ * if the etag of this instance matches - if so, the contents will be empty, and the client's existing contents should
38
+ * be used.
39
+ */
40
+ export class FileContents {
41
+ protected constructor();
42
+
43
+ static blob(blob:Blob):FileContents;
44
+ static text(...text:string[]):FileContents;
45
+ static arrayBuffers(...buffers:ArrayBuffer[]):FileContents;
46
+ text():Promise<string>;
47
+ arrayBuffer():Promise<ArrayBuffer>;
48
+ get etag():string;
49
+ }
50
+
20
51
  /**
21
52
  * Remote service to read and write files on the server. Paths use "/" as a separator, and should not start with "/".
22
53
  */
@@ -75,37 +106,6 @@ export namespace dh.storage {
75
106
  createDirectory(path:string):Promise<void>;
76
107
  }
77
108
 
78
- /**
79
- * Storage service metadata about files and folders.
80
- */
81
- export class ItemDetails {
82
- protected constructor();
83
-
84
- toString():string;
85
- get filename():string;
86
- get basename():string;
87
- get size():number;
88
- get etag():string;
89
- get type():ItemTypeType;
90
- get dirname():string;
91
- }
92
-
93
- /**
94
- * Represents a file's contents loaded from the server. If an etag was specified when loading, client should first test
95
- * if the etag of this instance matches - if so, the contents will be empty, and the client's existing contents should
96
- * be used.
97
- */
98
- export class FileContents {
99
- protected constructor();
100
-
101
- static blob(blob:Blob):FileContents;
102
- static text(...text:string[]):FileContents;
103
- static arrayBuffers(...buffers:ArrayBuffer[]):FileContents;
104
- text():Promise<string>;
105
- arrayBuffer():Promise<ArrayBuffer>;
106
- get etag():string;
107
- }
108
-
109
109
 
110
110
  type ItemTypeType = string;
111
111
  export class ItemType {
@@ -118,36 +118,48 @@ export namespace dh.storage {
118
118
  export namespace dh {
119
119
 
120
120
  /**
121
- * Represents a server-side object that may not yet have been fetched by the client. When this object will no longer be
122
- * used, if {@link fetch} is not called on this object, then {@link close} must be to ensure server-side resources
123
- * are correctly freed.
121
+ * Similar to {@link dh.ViewportData}, but with additional properties to reflect
122
+ * the tree structure.
124
123
  */
125
- export interface WidgetExportedObject {
126
- /**
127
- * Returns the type of this export, typically one of {@link dh.VariableType}, but may also include plugin types. If
128
- * null, this object cannot be fetched, but can be passed to the server, such as via
129
- * {@link Widget.sendMessage}.
130
- * @return the string type of this server-side object, or null.
131
- */
132
- readonly type?:string|null;
133
-
134
- /**
135
- * Exports another copy of this reference, allowing it to be fetched separately. Results in rejection if the ticket
136
- * was already closed (either by calling {@link WidgetExportedObject.close} or closing the object returned from {@link WidgetExportedObject.fetch}).
137
- * @return a promise returning a reexported copy of this object, still referencing the same server-side object.
138
- */
139
- reexport():Promise<WidgetExportedObject>;
124
+ export interface TreeViewportData extends TableData {
125
+ get(index:LongWrapper|number):TreeRow;
126
+ getData(index:LongWrapper|number, column:Column):any;
127
+ getFormat(index:LongWrapper|number, column:Column):Format;
128
+ get treeSize():number;
140
129
  /**
141
- * Returns a promise that will fetch the object represented by this reference. Multiple calls to this will return
142
- * the same instance.
143
- * @return a promise that will resolve to a client side object that represents the reference on the server.
130
+ * The position of the first returned row within the tree.
144
131
  */
145
- fetch():Promise<any>;
132
+ get offset():number;
133
+ get columns():Array<Column>;
134
+ get rows():Array<TreeRow>;
135
+ }
136
+ export interface WorkerHeapInfo {
146
137
  /**
147
- * Releases the server-side resources associated with this object, regardless of whether other client-side objects
148
- * exist that also use that object. Should not be called after fetch() has been invoked.
138
+ * Total heap size available for this worker.
149
139
  */
150
- close():void;
140
+ get totalHeapSize():number;
141
+ get freeMemory():number;
142
+ get maximumHeapSize():number;
143
+ }
144
+ /**
145
+ * Represents a row available in a subscription/snapshot on the client. Do not retain references to rows - they will
146
+ * not function properly when the event isn't actively going off (or promise resolving). Instead, wait for the next
147
+ * event, or re-request the viewport data.
148
+ */
149
+ export interface Row {
150
+ get(column:Column):any;
151
+ getFormat(column:Column):Format;
152
+ get index():LongWrapper;
153
+ }
154
+ export interface LayoutHints {
155
+ readonly searchDisplayMode?:SearchDisplayModeType|null;
156
+
157
+ get hiddenColumns():string[]|null;
158
+ get frozenColumns():string[]|null;
159
+ get columnGroups():ColumnGroup[]|null;
160
+ get areSavedLayoutsAllowed():boolean;
161
+ get frontColumns():string[]|null;
162
+ get backColumns():string[]|null;
151
163
  }
152
164
  /**
153
165
  * Row implementation that also provides additional read-only properties. represents visible rows in the table, but
@@ -177,206 +189,78 @@ export namespace dh {
177
189
  get index():LongWrapper;
178
190
  }
179
191
  /**
180
- * Similar to the browser `CustomEvent` type, this class holds only the type of the event, and optionally some
181
- * details about the event.
182
- * @typeParam T - the type of the event detail
183
- */
184
- export interface Event<T> {
185
- get detail():T;
186
- get type():string;
187
- }
188
- /**
189
- * This object may be pooled internally or discarded and not updated. Do not retain references to it.
192
+ * Represents statistics for a given table column.
190
193
  */
191
- export interface Format {
192
- /**
193
- * The format string to apply to the value of this cell.
194
- * @return String
195
- */
196
- readonly formatString?:string|null;
194
+ export interface ColumnStatistics {
197
195
  /**
198
- * Color to apply to the cell's background, in <b>#rrggbb</b> format.
196
+ * Gets the type of formatting that should be used for given statistic.
197
+ * <p>
198
+ * the format type for a statistic. A null return value means that the column formatting should be used.
199
+ * @param name - the display name of the statistic
199
200
  * @return String
200
201
  */
201
- readonly backgroundColor?:string|null;
202
+ getType(name:string):string;
202
203
  /**
203
- * Color to apply to the text, in <b>#rrggbb</b> format.
204
- * @return String
204
+ * Gets a map with the name of each unique value as key and the count as the value. A map of each unique value's
205
+ * name to the count of how many times it occurred in the column. This map will be empty for tables containing more
206
+ * than 19 unique values.
207
+ * @return Map of String double
205
208
  */
206
- readonly color?:string|null;
209
+ get uniqueValues():Map<string, number>;
207
210
  /**
208
- *
209
- * @deprecated Prefer formatString. Number format string to apply to the value in this cell.
211
+ * Gets a map with the display name of statistics as keys and the numeric stat as a value.
212
+ * <p>
213
+ * A map of each statistic's name to its value.
214
+ * @return Map of String and Object
210
215
  */
211
- readonly numberFormat?:string|null;
216
+ get statisticsMap():Map<string, object>;
212
217
  }
213
218
  /**
214
- * Event data, describing the indexes that were added/removed/updated, and providing access to Rows (and thus data in
215
- * columns) either by index, or scanning the complete present index.
216
- * <p>
217
- * This class supports two ways of reading the table - checking the changes made since the last update, and reading all
218
- * data currently in the table. While it is more expensive to always iterate over every single row in the table, it may
219
- * in some cases actually be cheaper than maintaining state separately and updating only the changes, though both
220
- * options should be considered.
221
- * <p>
222
- * The RangeSet objects allow iterating over the LongWrapper indexes in the table. Note that these "indexes" are not
223
- * necessarily contiguous and may be negative, and represent some internal state on the server, allowing it to keep
224
- * track of data efficiently. Those LongWrapper objects can be passed to the various methods on this instance to read
225
- * specific rows or cells out of the table.
219
+ * Behaves like a Table, but doesn't expose all of its API for changing the internal state. Instead, state is driven by
220
+ * the upstream table - when it changes handle, this listens and updates its own handle accordingly.
221
+ *
222
+ * Additionally, this is automatically subscribed to its one and only row, across all columns.
223
+ *
224
+ * A new config is returned any time it is accessed, to prevent accidental mutation, and to allow it to be used as a
225
+ * template when fetching a new totals table, or changing the totals table in use.
226
+ *
227
+ * A simplistic Table, providing access to aggregation of the table it is sourced from. This table is always
228
+ * automatically subscribed to its parent, and adopts changes automatically from it. This class has limited methods
229
+ * found on Table. Instances of this type always have a size of one when no groupBy is set on the config, but may
230
+ * potentially contain as few as zero rows, or as many as the parent table if each row gets its own group.
231
+ *
232
+ * When using the `groupBy` feature, it may be desireable to also provide a row to the user with all values across all
233
+ * rows. To achieve this, request the same Totals Table again, but remove the `groupBy` setting.
226
234
  */
227
- export interface SubscriptionTableData extends TableData {
228
- get fullIndex():RangeSet;
235
+ export interface TotalsTable extends JoinableTable {
229
236
  /**
230
- * The ordered set of row indexes removed since the last update
231
- * @return the rangeset of removed rows
237
+ * Specifies the range of items to pass to the client and update as they change. If the columns parameter is not
238
+ * provided, all columns will be used. Until this is called, no data will be available. Invoking this will result in
239
+ * events to be fired once data becomes available, starting with an <b>updated</b> event and one <b>rowadded</b>
240
+ * event per row in that range.
241
+ * @param firstRow -
242
+ * @param lastRow -
243
+ * @param columns -
244
+ * @param updateIntervalMs -
232
245
  */
233
- get removed():RangeSet;
246
+ setViewport(firstRow:number, lastRow:number, columns?:Array<Column>, updateIntervalMs?:number, isReverseViewport?:boolean|undefined|null):void;
234
247
  /**
235
- * The ordered set of row indexes added since the last update.
236
- * @return the rangeset of rows added
248
+ * the currently visible viewport. If the current set of operations has not yet resulted in data, it will not
249
+ * resolve until that data is ready.
250
+ * @return Promise of {@link dh.TableData}
237
251
  */
238
- get added():RangeSet;
239
- get columns():Array<Column>;
252
+ getViewportData():Promise<ViewportData>;
240
253
  /**
241
- * The ordered set of row indexes updated since the last update
242
- * @return the rnageset of modified rows
254
+ * a column by the given name. You should prefer to always retrieve a new Column instance instead of caching a
255
+ * returned value.
256
+ * @param key -
257
+ * @return {@link dh.Column}
243
258
  */
244
- get modified():RangeSet;
259
+ findColumn(key:string):Column;
245
260
  /**
246
- * A lazily computed array of all rows available on the client.
247
- */
248
- get rows():Array<Row>;
249
- }
250
- /**
251
- * Represents a row available in a subscription/snapshot on the client. Do not retain references to rows - they will
252
- * not function properly when the event isn't actively going off (or promise resolving). Instead, wait for the next
253
- * event, or re-request the viewport data.
254
- */
255
- export interface Row {
256
- get(column:Column):any;
257
- getFormat(column:Column):Format;
258
- get index():LongWrapper;
259
- }
260
- /**
261
- * Wrap LocalTime values for use in JS. Provides text formatting for display and access to the underlying value.
262
- */
263
- export interface LocalTimeWrapper {
264
- valueOf():string;
265
- getHour():number;
266
- getMinute():number;
267
- getSecond():number;
268
- getNano():number;
269
- toString():string;
270
- }
271
- /**
272
- * Wrap LocalDate values for use in JS. Provides text formatting for display and access to the underlying value.
273
- */
274
- export interface LocalDateWrapper {
275
- valueOf():string;
276
- getYear():number;
277
- getMonthValue():number;
278
- getDayOfMonth():number;
279
- toString():string;
280
- }
281
- export interface WorkerHeapInfo {
282
- /**
283
- * Total heap size available for this worker.
284
- */
285
- get totalHeapSize():number;
286
- get freeMemory():number;
287
- get maximumHeapSize():number;
288
- }
289
- /**
290
- * Similar to {@link dh.ViewportData}, but with additional properties to reflect
291
- * the tree structure.
292
- */
293
- export interface TreeViewportData extends TableData {
294
- get(index:LongWrapper|number):TreeRow;
295
- getData(index:LongWrapper|number, column:Column):any;
296
- getFormat(index:LongWrapper|number, column:Column):Format;
297
- get treeSize():number;
298
- /**
299
- * The position of the first returned row within the tree.
300
- */
301
- get offset():number;
302
- get columns():Array<Column>;
303
- get rows():Array<TreeRow>;
304
- }
305
- export interface HasEventHandling {
306
- /**
307
- * Listen for events on this object.
308
- * @param name - the name of the event to listen for
309
- * @param callback - a function to call when the event occurs
310
- * @return Returns a cleanup function.
311
- * @typeParam T - the type of the data that the event will provide
312
- */
313
- addEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):()=>void;
314
- nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<Event<T>>;
315
- hasListeners(name:string):boolean;
316
- /**
317
- * Removes an event listener added to this table.
318
- * @param name -
319
- * @param callback -
320
- * @return
321
- * @typeParam T -
322
- */
323
- removeEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):boolean;
324
- }
325
- /**
326
- * This object may be pooled internally or discarded and not updated. Do not retain references to it. Instead,
327
- * request the viewport again.
328
- */
329
- export interface ViewportRow extends Row {
330
- get(column:Column):any;
331
- getFormat(column:Column):Format;
332
- get index():LongWrapper;
333
- }
334
- /**
335
- * Behaves like a Table, but doesn't expose all of its API for changing the internal state. Instead, state is driven by
336
- * the upstream table - when it changes handle, this listens and updates its own handle accordingly.
337
- *
338
- * Additionally, this is automatically subscribed to its one and only row, across all columns.
339
- *
340
- * A new config is returned any time it is accessed, to prevent accidental mutation, and to allow it to be used as a
341
- * template when fetching a new totals table, or changing the totals table in use.
342
- *
343
- * A simplistic Table, providing access to aggregation of the table it is sourced from. This table is always
344
- * automatically subscribed to its parent, and adopts changes automatically from it. This class has limited methods
345
- * found on Table. Instances of this type always have a size of one when no groupBy is set on the config, but may
346
- * potentially contain as few as zero rows, or as many as the parent table if each row gets its own group.
347
- *
348
- * When using the `groupBy` feature, it may be desireable to also provide a row to the user with all values across all
349
- * rows. To achieve this, request the same Totals Table again, but remove the `groupBy` setting.
350
- */
351
- export interface TotalsTable extends JoinableTable {
352
- /**
353
- * Specifies the range of items to pass to the client and update as they change. If the columns parameter is not
354
- * provided, all columns will be used. Until this is called, no data will be available. Invoking this will result in
355
- * events to be fired once data becomes available, starting with an <b>updated</b> event and one <b>rowadded</b>
356
- * event per row in that range.
357
- * @param firstRow -
358
- * @param lastRow -
359
- * @param columns -
360
- * @param updateIntervalMs -
361
- */
362
- setViewport(firstRow:number, lastRow:number, columns?:Array<Column>, updateIntervalMs?:number, isReverseViewport?:boolean|undefined|null):void;
363
- /**
364
- * the currently visible viewport. If the current set of operations has not yet resulted in data, it will not
365
- * resolve until that data is ready.
366
- * @return Promise of {@link dh.TableData}
367
- */
368
- getViewportData():Promise<ViewportData>;
369
- /**
370
- * a column by the given name. You should prefer to always retrieve a new Column instance instead of caching a
371
- * returned value.
372
- * @param key -
373
- * @return {@link dh.Column}
374
- */
375
- findColumn(key:string):Column;
376
- /**
377
- * multiple columns specified by the given names.
378
- * @param keys -
379
- * @return {@link dh.Column} array
261
+ * multiple columns specified by the given names.
262
+ * @param keys -
263
+ * @return {@link dh.Column} array
380
264
  */
381
265
  findColumns(keys:string[]):Column[];
382
266
  /**
@@ -460,6 +344,84 @@ export namespace dh {
460
344
  */
461
345
  get isRefreshing():boolean;
462
346
  }
347
+ export interface RefreshToken {
348
+ get bytes():string;
349
+ get expiry():number;
350
+ }
351
+ /**
352
+ * Represents a server-side object that may not yet have been fetched by the client. When this object will no longer be
353
+ * used, if {@link fetch} is not called on this object, then {@link close} must be to ensure server-side resources
354
+ * are correctly freed.
355
+ */
356
+ export interface WidgetExportedObject {
357
+ /**
358
+ * Returns the type of this export, typically one of {@link dh.VariableType}, but may also include plugin types. If
359
+ * null, this object cannot be fetched, but can be passed to the server, such as via
360
+ * {@link Widget.sendMessage}.
361
+ * @return the string type of this server-side object, or null.
362
+ */
363
+ readonly type?:string|null;
364
+
365
+ /**
366
+ * Exports another copy of this reference, allowing it to be fetched separately. Results in rejection if the ticket
367
+ * was already closed (either by calling {@link WidgetExportedObject.close} or closing the object returned from {@link WidgetExportedObject.fetch}).
368
+ * @return a promise returning a reexported copy of this object, still referencing the same server-side object.
369
+ */
370
+ reexport():Promise<WidgetExportedObject>;
371
+ /**
372
+ * Returns a promise that will fetch the object represented by this reference. Multiple calls to this will return
373
+ * the same instance.
374
+ * @return a promise that will resolve to a client side object that represents the reference on the server.
375
+ */
376
+ fetch():Promise<any>;
377
+ /**
378
+ * Releases the server-side resources associated with this object, regardless of whether other client-side objects
379
+ * exist that also use that object. Should not be called after fetch() has been invoked.
380
+ */
381
+ close():void;
382
+ }
383
+ /**
384
+ * Extends {@link dh.TableData}, but only contains data in the current viewport. The only API change from TableData is that
385
+ * ViewportData also contains the offset to this data, so that the actual row number may be determined.
386
+ * <p>
387
+ * For viewport subscriptions, it is not necessary to read with the key, only with the position.
388
+ * <p>
389
+ * Do not assume that the first row in `rows` is the first visible row, because extra rows may be provided for easier
390
+ * scrolling without going to the server.
391
+ */
392
+ export interface ViewportData extends TableData {
393
+ /**
394
+ * Reads a row object from the viewport, based on its position in the table.
395
+ */
396
+ get(index:LongWrapper|number):ViewportRow;
397
+ getData(index:LongWrapper|number, column:Column):any;
398
+ getFormat(index:LongWrapper|number, column:Column):Format;
399
+ /**
400
+ * The position of the first returned row within the table.
401
+ */
402
+ get offset():number;
403
+ get columns():Array<Column>;
404
+ get rows():Array<ViewportRow>;
405
+ }
406
+ /**
407
+ * This object may be pooled internally or discarded and not updated. Do not retain references to it. Instead,
408
+ * request the viewport again.
409
+ */
410
+ export interface ViewportRow extends Row {
411
+ get(column:Column):any;
412
+ getFormat(column:Column):Format;
413
+ get index():LongWrapper;
414
+ }
415
+ /**
416
+ * Wrap LocalDate values for use in JS. Provides text formatting for display and access to the underlying value.
417
+ */
418
+ export interface LocalDateWrapper {
419
+ valueOf():string;
420
+ getYear():number;
421
+ getMonthValue():number;
422
+ getDayOfMonth():number;
423
+ toString():string;
424
+ }
463
425
  /**
464
426
  * Common interface for various ways of accessing table data and formatting for viewport or non-viewport subscriptions
465
427
  * on tables, data in trees, and snapshots.
@@ -495,55 +457,139 @@ export namespace dh {
495
457
  */
496
458
  get rows():Array<Row>;
497
459
  }
460
+ export interface HasEventHandling {
461
+ /**
462
+ * Listen for events on this object.
463
+ * @param name - the name of the event to listen for
464
+ * @param callback - a function to call when the event occurs
465
+ * @return Returns a cleanup function.
466
+ * @typeParam T - the type of the data that the event will provide
467
+ */
468
+ addEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):()=>void;
469
+ nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<Event<T>>;
470
+ hasListeners(name:string):boolean;
471
+ /**
472
+ * Removes an event listener added to this table.
473
+ * @param name -
474
+ * @param callback -
475
+ * @return
476
+ * @typeParam T -
477
+ */
478
+ removeEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):boolean;
479
+ }
498
480
  /**
499
- * Represents the contents of a single widget data message from the server, with a binary data paylod and exported
500
- * objects. Implemented both by Widget itself and by the `event.details` when data is received by the client.
501
- *
502
- * Terminology note: the name of this type should probably use "Data" instead of "Message", and the methods should use
503
- * "payload" rather than "data" to match other platforms and the protobuf itself. These names are instead used for
504
- * backwards compatibility and to better follow JS expectations.
481
+ * Similar to the browser `CustomEvent` type, this class holds only the type of the event, and optionally some
482
+ * details about the event.
483
+ * @typeParam T - the type of the event detail
505
484
  */
506
- export interface WidgetMessageDetails {
485
+ export interface Event<T> {
486
+ get detail():T;
487
+ get type():string;
488
+ }
489
+ /**
490
+ * This object may be pooled internally or discarded and not updated. Do not retain references to it.
491
+ */
492
+ export interface Format {
507
493
  /**
508
- * Returns the data from this message as a base64-encoded string.
494
+ * The format string to apply to the value of this cell.
495
+ * @return String
509
496
  */
510
- getDataAsBase64():string;
497
+ readonly formatString?:string|null;
511
498
  /**
512
- * Returns the data from this message as a Uint8Array.
499
+ * Color to apply to the cell's background, in <b>#rrggbb</b> format.
500
+ * @return String
513
501
  */
514
- getDataAsU8():Uint8Array;
502
+ readonly backgroundColor?:string|null;
515
503
  /**
516
- * Returns the data from this message as a utf-8 string.
504
+ * Color to apply to the text, in <b>#rrggbb</b> format.
505
+ * @return String
517
506
  */
518
- getDataAsString():string;
507
+ readonly color?:string|null;
519
508
  /**
520
- * Returns an array of exported objects sent from the server. The plugin implementation is now responsible for these
521
- * objects, and should close them when no longer needed.
509
+ *
510
+ * @deprecated Prefer formatString. Number format string to apply to the value in this cell.
522
511
  */
523
- get exportedObjects():WidgetExportedObject[];
512
+ readonly numberFormat?:string|null;
524
513
  }
525
514
  /**
526
- * Extends {@link dh.TableData}, but only contains data in the current viewport. The only API change from TableData is that
527
- * ViewportData also contains the offset to this data, so that the actual row number may be determined.
528
- * <p>
529
- * For viewport subscriptions, it is not necessary to read with the key, only with the position.
515
+ * Event data, describing the indexes that were added/removed/updated, and providing access to Rows (and thus data in
516
+ * columns) either by index, or scanning the complete present index.
530
517
  * <p>
531
- * Do not assume that the first row in `rows` is the first visible row, because extra rows may be provided for easier
532
- * scrolling without going to the server.
518
+ * This class supports two ways of reading the table - checking the changes made since the last update, and reading all
519
+ * data currently in the table. While it is more expensive to always iterate over every single row in the table, it may
520
+ * in some cases actually be cheaper than maintaining state separately and updating only the changes, though both
521
+ * options should be considered.
522
+ * <p>
523
+ * The RangeSet objects allow iterating over the LongWrapper indexes in the table. Note that these "indexes" are not
524
+ * necessarily contiguous and may be negative, and represent some internal state on the server, allowing it to keep
525
+ * track of data efficiently. Those LongWrapper objects can be passed to the various methods on this instance to read
526
+ * specific rows or cells out of the table.
533
527
  */
534
- export interface ViewportData extends TableData {
528
+ export interface SubscriptionTableData extends TableData {
529
+ get fullIndex():RangeSet;
535
530
  /**
536
- * Reads a row object from the viewport, based on its position in the table.
531
+ * The ordered set of row indexes removed since the last update
532
+ * @return the rangeset of removed rows
537
533
  */
538
- get(index:LongWrapper|number):ViewportRow;
539
- getData(index:LongWrapper|number, column:Column):any;
540
- getFormat(index:LongWrapper|number, column:Column):Format;
534
+ get removed():RangeSet;
541
535
  /**
542
- * The position of the first returned row within the table.
536
+ * The ordered set of row indexes added since the last update.
537
+ * @return the rangeset of rows added
543
538
  */
544
- get offset():number;
539
+ get added():RangeSet;
545
540
  get columns():Array<Column>;
546
- get rows():Array<ViewportRow>;
541
+ /**
542
+ * The ordered set of row indexes updated since the last update
543
+ * @return the rnageset of modified rows
544
+ */
545
+ get modified():RangeSet;
546
+ /**
547
+ * A lazily computed array of all rows available on the client.
548
+ */
549
+ get rows():Array<Row>;
550
+ }
551
+ /**
552
+ * Represents the contents of a single widget data message from the server, with a binary data paylod and exported
553
+ * objects. Implemented both by Widget itself and by the `event.details` when data is received by the client.
554
+ *
555
+ * Terminology note: the name of this type should probably use "Data" instead of "Message", and the methods should use
556
+ * "payload" rather than "data" to match other platforms and the protobuf itself. These names are instead used for
557
+ * backwards compatibility and to better follow JS expectations.
558
+ */
559
+ export interface WidgetMessageDetails {
560
+ /**
561
+ * Returns the data from this message as a base64-encoded string.
562
+ */
563
+ getDataAsBase64():string;
564
+ /**
565
+ * Returns the data from this message as a Uint8Array.
566
+ */
567
+ getDataAsU8():Uint8Array;
568
+ /**
569
+ * Returns the data from this message as a utf-8 string.
570
+ */
571
+ getDataAsString():string;
572
+ /**
573
+ * Returns an array of exported objects sent from the server. The plugin implementation is now responsible for these
574
+ * objects, and should close them when no longer needed.
575
+ */
576
+ get exportedObjects():WidgetExportedObject[];
577
+ }
578
+ export interface ColumnGroup {
579
+ get name():string|null;
580
+ get children():string[]|null;
581
+ get color():string|null;
582
+ }
583
+ /**
584
+ * Wrap LocalTime values for use in JS. Provides text formatting for display and access to the underlying value.
585
+ */
586
+ export interface LocalTimeWrapper {
587
+ valueOf():string;
588
+ getHour():number;
589
+ getMinute():number;
590
+ getSecond():number;
591
+ getNano():number;
592
+ toString():string;
547
593
  }
548
594
  /**
549
595
  * Represents a table which can be joined to another table. Current implementations are {@link dh.Table} and
@@ -634,145 +680,81 @@ export namespace dh {
634
680
  */
635
681
  naturalJoin(rightTable:JoinableTable, columnsToMatch:Array<string>, columnsToAdd?:Array<string>|undefined|null):Promise<Table>;
636
682
  }
683
+
637
684
  /**
638
- * Represents statistics for a given table column.
685
+ * Represents a set of Tables each corresponding to some key. The keys are available locally, but a call must be made to
686
+ * the server to get each Table. All tables will have the same structure.
639
687
  */
640
- export interface ColumnStatistics {
688
+ export class PartitionedTable implements HasEventHandling {
641
689
  /**
642
- * Gets the type of formatting that should be used for given statistic.
643
- * <p>
644
- * the format type for a statistic. A null return value means that the column formatting should be used.
645
- * @param name - the display name of the statistic
646
- * @return String
690
+ * Indicates that a new key has been added to the array of keys, which can now be fetched with getTable.
647
691
  */
648
- getType(name:string):string;
692
+ static readonly EVENT_KEYADDED:string;
649
693
  /**
650
- * Gets a map with the name of each unique value as key and the count as the value. A map of each unique value's
651
- * name to the count of how many times it occurred in the column. This map will be empty for tables containing more
652
- * than 19 unique values.
653
- * @return Map of String double
694
+ * Indicates that a new key has been added to the array of keys, which can now be fetched with getTable.
654
695
  */
655
- get uniqueValues():Map<string, number>;
696
+ static readonly EVENT_DISCONNECT:string;
656
697
  /**
657
- * Gets a map with the display name of statistics as keys and the numeric stat as a value.
658
- * <p>
659
- * A map of each statistic's name to its value.
660
- * @return Map of String and Object
698
+ * Indicates that a new key has been added to the array of keys, which can now be fetched with getTable.
661
699
  */
662
- get statisticsMap():Map<string, object>;
663
- }
664
- export interface LayoutHints {
665
- readonly searchDisplayMode?:SearchDisplayModeType|null;
666
-
667
- get hiddenColumns():string[]|null;
668
- get frozenColumns():string[]|null;
669
- get columnGroups():ColumnGroup[]|null;
670
- get areSavedLayoutsAllowed():boolean;
671
- get frontColumns():string[]|null;
672
- get backColumns():string[]|null;
673
- }
674
- export interface RefreshToken {
675
- get bytes():string;
676
- get expiry():number;
677
- }
678
- export interface ColumnGroup {
679
- get name():string|null;
680
- get children():string[]|null;
681
- get color():string|null;
682
- }
683
-
684
- /**
685
- * Wrap BigDecimal values for use in JS. Provides text formatting for display and access to the underlying value.
686
- */
687
- export class BigDecimalWrapper {
688
- protected constructor();
689
-
690
- static ofString(value:string):BigDecimalWrapper;
691
- asNumber():number;
692
- valueOf():string;
693
- toString():string;
694
- equals(o:object):boolean;
695
- hashCode():number;
696
- }
697
-
698
- /**
699
- * Presently, this is the entrypoint into the Deephaven JS API. By creating an instance of this with the server URL and
700
- * some options, JS applications can run code on the server, and interact with available exportable objects.
701
- */
702
- export class IdeConnection implements HasEventHandling {
700
+ static readonly EVENT_RECONNECT:string;
703
701
  /**
704
- * @deprecated
702
+ * Indicates that a new key has been added to the array of keys, which can now be fetched with getTable.
705
703
  */
706
- static readonly HACK_CONNECTION_FAILURE:string;
707
- static readonly EVENT_DISCONNECT:string;
708
- static readonly EVENT_RECONNECT:string;
709
- static readonly EVENT_SHUTDOWN:string;
704
+ static readonly EVENT_RECONNECTFAILED:string;
710
705
 
711
706
  protected constructor();
712
707
 
713
708
  /**
714
- * Closes the current connection, releasing any resources on the server or client.
709
+ * Fetch the table with the given key. If the key does not exist, returns `null`.
710
+ * @param key - The key to fetch. An array of values for each key column, in the same order as the key columns are.
711
+ * @return Promise of dh.Table, or `null` if the key does not exist.
715
712
  */
716
- close():void;
717
- running():Promise<IdeConnection>;
713
+ getTable(key:object):Promise<Table|undefined|null>;
718
714
  /**
719
- * Load the named table, with columns and size information already fully populated.
720
- * @param name - the name of the table to fetch
721
- * @param applyPreviewColumns - false to disable previews, defaults to true
722
- * @return a {@link Promise} that will resolve to the table, or reject with an error if it cannot be loaded.
723
- * @deprecated Added to resolve a specific issue, in the future preview will be applied as part of the subscription.
715
+ * Open a new table that is the result of merging all constituent tables. See
716
+ * {@link io.deephaven.engine.table.PartitionedTable.merge} for details.
717
+ * @return A merged representation of the constituent tables.
724
718
  */
725
- getTable(name:string, applyPreviewColumns?:boolean):Promise<Table>;
726
- getObject(definitionObject:dh.ide.VariableDescriptor):Promise<any>;
727
- subscribeToFieldUpdates(callback:(arg0:dh.ide.VariableChanges)=>void):()=>void;
719
+ getMergedTable():Promise<Table>;
728
720
  /**
729
- * Makes an `object` available to another user or another client on this same server which knows the value of
730
- * the `sharedTicketBytes`. Use that sharedTicketBytes value like a one-time use password - any other client
731
- * which knows this value can read the same object.
732
- * <p>
733
- * Shared objects will remain available using the sharedTicketBytes until the client that first shared them
734
- * releases/closes their copy of the object. Whatever side-channel is used to share the bytes, be sure to wait until
735
- * the remote end has signaled that it has successfully fetched the object before releasing it from this client.
736
- * <p>
737
- * Be sure to use an unpredictable value for the shared ticket bytes, like a UUID or other large, random value to
738
- * prevent access by unauthorized clients.
739
- * @param object - the object to share with another client/user
740
- * @param sharedTicketBytes - the value which another client/user must know to obtain the object. It may be a unicode
741
- * string (will be encoded as utf8 bytes), or a {@link Uint8Array} value.
742
- * @return A promise that will resolve to the value passed as sharedTicketBytes when the object is ready to be read
743
- * by another client, or will reject if an error occurs.
721
+ * The set of all currently known keys. This is kept up to date, so getting the list after adding an event listener
722
+ * for <b>keyadded</b> will ensure no keys are missed.
723
+ * @return Set of Object
744
724
  */
745
- shareObject(object:Table|Widget|WidgetExportedObject|PartitionedTable|TotalsTable|TreeTable, sharedTicketBytes:string|Uint8Array):Promise<string|Uint8Array>;
725
+ getKeys():Set<object>;
746
726
  /**
747
- * Reads an object shared by another client to this server with the `sharedTicketBytes`. Until the other
748
- * client releases this object (or their session ends), the object will be available on the server.
749
- * <p>
750
- * The type of the object must be passed so that the object can be read from the server correct - the other client
751
- * should provide this information.
752
- * @param sharedTicketBytes - the value provided by another client/user to obtain the object. It may be a unicode
753
- * string (will be encoded as utf8 bytes), or a {@link Uint8Array} value.
754
- * @param type - The type of the object, so it can be correctly read from the server
755
- * @return A promise that will resolve to the shared object, or will reject with an error if it cannot be read.
727
+ * Fetch a table containing all the valid keys of the partitioned table.
728
+ * @return Promise of a Table
729
+ * @deprecated
756
730
  */
757
- getSharedObject(sharedTicketBytes:string|Uint8Array, type:string):Promise<any>;
758
- newTable(columnNames:string[], types:string[], data:string[][], userTimeZone:string):Promise<Table>;
731
+ getKeyTable():Promise<Table>;
759
732
  /**
760
- * Merges the given tables into a single table. Assumes all tables have the same structure.
761
- * @param tables -
762
- * @return {@link Promise} of {@link dh.Table}
733
+ * Fetch the underlying base table of the partitioned table.
734
+ * @return Promise of a Table
763
735
  */
764
- mergeTables(tables:Table[]):Promise<Table>;
736
+ getBaseTable():Promise<Table>;
765
737
  /**
766
- * Register a callback function to handle any log messages that are emitted on the server. Returns a function ,
767
- * which can be invoked to remove this log handler. Any log handler registered in this way will receive as many old
768
- * log messages as are presently available.
769
- * @param callback -
770
- * @return {@link io.deephaven.web.shared.fu.JsRunnable}
738
+ * Indicates that this PartitionedTable will no longer be used, removing subcriptions to updated keys, etc. This
739
+ * will not affect tables in use.
771
740
  */
772
- onLogMessage(callback:(arg0:dh.ide.LogItem)=>void):()=>void;
773
- startSession(type:string):Promise<IdeSession>;
774
- getConsoleTypes():Promise<Array<string>>;
775
- getWorkerHeapInfo():Promise<WorkerHeapInfo>;
741
+ close():void;
742
+ /**
743
+ * The count of known keys.
744
+ * @return int
745
+ */
746
+ get size():number;
747
+ /**
748
+ * An array of the columns in the tables that can be retrieved from this partitioned table, including both key and
749
+ * non-key columns.
750
+ * @return Array of Column
751
+ */
752
+ get columns():Column[];
753
+ /**
754
+ * An array of all the key columns that the tables are partitioned by.
755
+ * @return Array of Column
756
+ */
757
+ get keyColumns():Column[];
776
758
  /**
777
759
  * Listen for events on this object.
778
760
  * @param name - the name of the event to listen for
@@ -793,405 +775,577 @@ export namespace dh {
793
775
  removeEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):boolean;
794
776
  }
795
777
 
796
- /**
797
- * Describes a Sort present on the table. No visible constructor, created through the use of Column.sort(), will be tied
798
- * to that particular column data. Sort instances are immutable, and use a builder pattern to make modifications. All
799
- * methods return a new Sort instance.
800
- */
801
- export class Sort {
802
- static readonly ASCENDING:string;
803
- static readonly DESCENDING:string;
804
- static readonly REVERSE:string;
805
-
778
+ export class LongWrapper {
806
779
  protected constructor();
807
780
 
781
+ static ofString(str:string):LongWrapper;
782
+ asNumber():number;
783
+ valueOf():string;
784
+ toString():string;
785
+ }
786
+
787
+ export class QueryInfo {
788
+ static readonly EVENT_TABLE_OPENED:string;
789
+ static readonly EVENT_DISCONNECT:string;
790
+ static readonly EVENT_RECONNECT:string;
791
+ static readonly EVENT_CONNECT:string;
792
+
793
+ protected constructor();
794
+ }
795
+
796
+ export class CustomColumn {
797
+ static readonly TYPE_FORMAT_COLOR:string;
798
+ static readonly TYPE_FORMAT_NUMBER:string;
799
+ static readonly TYPE_FORMAT_DATE:string;
800
+ static readonly TYPE_NEW:string;
801
+
802
+ protected constructor();
803
+
804
+ valueOf():string;
805
+ toString():string;
806
+ static from(columnInfo:string):CustomColumn;
808
807
  /**
809
- * Builds a Sort instance to sort values in ascending order.
810
- * @return {@link dh.Sort}
811
- */
812
- asc():Sort;
813
- /**
814
- * Builds a Sort instance to sort values in descending order.
815
- * @return {@link dh.Sort}
816
- */
817
- desc():Sort;
818
- /**
819
- * Builds a Sort instance which takes the absolute value before applying order.
820
- * @return {@link dh.Sort}
808
+ * The expression to evaluate this custom column.
809
+ * @return String
821
810
  */
822
- abs():Sort;
823
- toString():string;
811
+ get expression():string;
824
812
  /**
825
- * True if the absolute value of the column should be used when sorting; defaults to false.
826
- * @return boolean
813
+ * The name of the column to use.
814
+ * @return String
827
815
  */
828
- get isAbs():boolean;
816
+ get name():string;
829
817
  /**
830
- * The column which is sorted.
831
- * @return {@link dh.Column}
818
+ * The options for this custom column.
819
+ * @return CustomColumOptions
832
820
  */
833
- get column():Column;
821
+ get options():CustomColumnOptions;
834
822
  /**
835
- * The direction of this sort, either <b>ASC</b>, <b>DESC</b>, or <b>REVERSE</b>.
823
+ * Type of custom column. One of
824
+ *
825
+ * <ul>
826
+ * <li>FORMAT_COLOR</li>
827
+ * <li>FORMAT_NUMBER</li>
828
+ * <li>FORMAT_DATE</li>
829
+ * <li>NEW</li>
830
+ * </ul>
836
831
  * @return String
837
832
  */
838
- get direction():string;
833
+ get type():string;
839
834
  }
840
835
 
841
836
  /**
842
- * Provides access to data in a table. Note that several methods present their response through Promises. This allows
843
- * the client to both avoid actually connecting to the server until necessary, and also will permit some changes not to
844
- * inform the UI right away that they have taken place.
837
+ * Addition optional configuration that can be passed to the {@link dh.CoreClient} constructor.
845
838
  */
846
- export class Table implements JoinableTable, HasEventHandling {
847
- readonly description?:string|null;
848
- readonly pluginName?:string|null;
849
- readonly layoutHints?:null|LayoutHints;
839
+ export class ConnectOptions {
850
840
  /**
851
- * The table size has updated, so live scrollbars and the like can be updated accordingly.
841
+ * Optional map of http header names and values to send to the server with each request.
852
842
  */
853
- static readonly EVENT_SIZECHANGED:string;
843
+ headers?:{ [key: string]: string; }|null;
854
844
  /**
855
- * The table size has updated, so live scrollbars and the like can be updated accordingly.
845
+ * True to enable debug logging. At this time, only enables logging for gRPC calls.
856
846
  */
857
- static readonly EVENT_UPDATED:string;
847
+ debug?:boolean|null;
858
848
  /**
859
- * The table size has updated, so live scrollbars and the like can be updated accordingly.
849
+ * Set this to true to force the use of websockets when connecting to the deephaven instance, false to force the use
850
+ * of `fetch`. Ignored if {@link dh.transportFactory} is set.
851
+ * <p>
852
+ * Defaults to null, indicating that the server URL should be checked to see if we connect with fetch or websockets.
860
853
  */
861
- static readonly EVENT_ROWADDED:string;
854
+ useWebsockets?:boolean|null;
862
855
  /**
863
- * The table size has updated, so live scrollbars and the like can be updated accordingly.
856
+ * The transport factory to use for creating gRPC streams. If specified, the JS API will ignore
857
+ * {@link dh.useWebsockets} and its own internal logic for determining the appropriate transport to use.
858
+ * <p>
859
+ * Defaults to null, indicating that the JS API should determine the appropriate transport to use. If
860
+ * `useWebsockets` is set to true, the JS API will use websockets, otherwise if the server url begins with
861
+ * https, it will use fetch, otherwise it will use websockets.
864
862
  */
865
- static readonly EVENT_ROWREMOVED:string;
863
+ transportFactory?:dh.grpc.GrpcTransportFactory|null;
864
+
865
+ constructor();
866
+ }
867
+
868
+ /**
869
+ * Represents a non-viewport subscription to a table, and all data currently known to be present in the subscribed
870
+ * columns. This class handles incoming snapshots and deltas, and fires events to consumers to notify of data changes.
871
+ *
872
+ * Unlike {@link dh.TableViewportSubscription}, the "original" table does not have a reference to this instance, only the
873
+ * "private" table instance does, since the original cannot modify the subscription, and the private instance must
874
+ * forward data to it.
875
+ *
876
+ * Represents a subscription to the table on the server. Changes made to the table will not be reflected here - the
877
+ * subscription must be closed and a new one optioned to see those changes. The event model is slightly different from
878
+ * viewports to make it less expensive to compute for large tables.
879
+ */
880
+ export class TableSubscription implements HasEventHandling {
881
+ protected constructor();
882
+
866
883
  /**
867
- * The table size has updated, so live scrollbars and the like can be updated accordingly.
884
+ * Updates the subscription to use the given columns and update interval.
885
+ * @param columns - the new columns to subscribe to
886
+ * @param updateIntervalMs - the new update interval, or null/omit to use the default of one second
868
887
  */
869
- static readonly EVENT_ROWUPDATED:string;
888
+ changeSubscription(columns:Array<Column>, updateIntervalMs:number|undefined|null):void;
889
+ get columns():Array<Column>;
870
890
  /**
871
- * The table size has updated, so live scrollbars and the like can be updated accordingly.
891
+ * Stops the subscription on the server.
872
892
  */
873
- static readonly EVENT_SORTCHANGED:string;
893
+ close():void;
874
894
  /**
875
- * The table size has updated, so live scrollbars and the like can be updated accordingly.
895
+ * Listen for events on this object.
896
+ * @param name - the name of the event to listen for
897
+ * @param callback - a function to call when the event occurs
898
+ * @return Returns a cleanup function.
899
+ * @typeParam T - the type of the data that the event will provide
876
900
  */
877
- static readonly EVENT_FILTERCHANGED:string;
901
+ addEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):()=>void;
902
+ nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<Event<T>>;
903
+ hasListeners(name:string):boolean;
878
904
  /**
879
- * The table size has updated, so live scrollbars and the like can be updated accordingly.
905
+ * Removes an event listener added to this table.
906
+ * @param name -
907
+ * @param callback -
908
+ * @return
909
+ * @typeParam T -
880
910
  */
881
- static readonly EVENT_CUSTOMCOLUMNSCHANGED:string;
911
+ removeEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):boolean;
912
+ }
913
+
914
+ /**
915
+ * Describes data that can be filtered, either a column reference or a literal value. Used this way, the type of a value
916
+ * can be specified so that values which are ambiguous or not well supported in JS will not be confused with Strings or
917
+ * imprecise numbers (e.g., nanosecond-precision date values). Additionally, once wrapped in this way, methods can be
918
+ * called on these value literal instances. These instances are immutable - any method called on them returns a new
919
+ * instance.
920
+ */
921
+ export class FilterValue {
922
+ protected constructor();
923
+
882
924
  /**
883
- * The table size has updated, so live scrollbars and the like can be updated accordingly.
925
+ * Constructs a number for the filter API from the given parameter. Can also be used on the values returned from
926
+ * {@link TableData.get} for DateTime values. To create
927
+ * a filter with a date, use <b>dh.DateWrapper.ofJsDate</b> or
928
+ * {@link i18n.DateTimeFormat.parse}. To create a filter with a
929
+ * 64-bit long integer, use {@link LongWrapper.ofString}.
930
+ * @param input - the number to wrap as a FilterValue
931
+ * @return an immutable FilterValue that can be built into a filter
884
932
  */
885
- static readonly EVENT_DISCONNECT:string;
933
+ static ofNumber(input:LongWrapper|number):FilterValue;
886
934
  /**
887
- * The table size has updated, so live scrollbars and the like can be updated accordingly.
935
+ * a filter condition checking if the current value is equal to the given parameter
936
+ * @param term -
937
+ * @return {@link dh.FilterCondition}
888
938
  */
889
- static readonly EVENT_RECONNECT:string;
939
+ eq(term:FilterValue):FilterCondition;
890
940
  /**
891
- * The table size has updated, so live scrollbars and the like can be updated accordingly.
941
+ * a filter condition checking if the current value is equal to the given parameter, ignoring differences of upper
942
+ * vs lower case
943
+ * @param term -
944
+ * @return {@link dh.FilterCondition}
892
945
  */
893
- static readonly EVENT_RECONNECTFAILED:string;
946
+ eqIgnoreCase(term:FilterValue):FilterCondition;
894
947
  /**
895
- * The table size has updated, so live scrollbars and the like can be updated accordingly.
948
+ * a filter condition checking if the current value is not equal to the given parameter
949
+ * @param term -
950
+ * @return {@link dh.FilterCondition}
896
951
  */
897
- static readonly EVENT_REQUEST_FAILED:string;
952
+ notEq(term:FilterValue):FilterCondition;
898
953
  /**
899
- * The table size has updated, so live scrollbars and the like can be updated accordingly.
954
+ * a filter condition checking if the current value is not equal to the given parameter, ignoring differences of
955
+ * upper vs lower case
956
+ * @param term -
957
+ * @return {@link dh.FilterCondition}
900
958
  */
901
- static readonly EVENT_REQUEST_SUCCEEDED:string;
959
+ notEqIgnoreCase(term:FilterValue):FilterCondition;
902
960
  /**
903
- * The size the table will have if it is uncoalesced.
961
+ * a filter condition checking if the current value is greater than the given parameter
962
+ * @param term -
963
+ * @return {@link dh.FilterCondition}
904
964
  */
905
- static readonly SIZE_UNCOALESCED:number;
906
-
907
- protected constructor();
908
-
909
- batch(userCode:(arg0:unknown)=>void):Promise<Table>;
965
+ greaterThan(term:FilterValue):FilterCondition;
910
966
  /**
911
- * Retrieve a column by the given name. You should prefer to always retrieve a new Column instance instead of
912
- * caching a returned value.
913
- * @param key -
914
- * @return {@link dh.Column}
967
+ * a filter condition checking if the current value is less than the given parameter
968
+ * @param term -
969
+ * @return {@link dh.FilterCondition}
915
970
  */
916
- findColumn(key:string):Column;
971
+ lessThan(term:FilterValue):FilterCondition;
917
972
  /**
918
- * Retrieve multiple columns specified by the given names.
919
- * @param keys -
920
- * @return {@link dh.Column} array
973
+ * a filter condition checking if the current value is greater than or equal to the given parameter
974
+ * @param term -
975
+ * @return {@link dh.FilterCondition}
921
976
  */
922
- findColumns(keys:string[]):Column[];
923
- isBlinkTable():boolean;
977
+ greaterThanOrEqualTo(term:FilterValue):FilterCondition;
924
978
  /**
925
- * If .hasInputTable is true, you may call this method to gain access to an InputTable object which can be used to
926
- * mutate the data within the table. If the table is not an Input Table, the promise will be immediately rejected.
927
- * @return Promise of dh.InputTable
979
+ * a filter condition checking if the current value is less than or equal to the given parameter
980
+ * @param term -
981
+ * @return {@link dh.FilterCondition}
928
982
  */
929
- inputTable():Promise<InputTable>;
983
+ lessThanOrEqualTo(term:FilterValue):FilterCondition;
930
984
  /**
931
- * Indicates that this Table instance will no longer be used, and its connection to the server can be cleaned up.
985
+ * a filter condition checking if the current value is in the given set of values
986
+ * @param terms -
987
+ * @return {@link dh.FilterCondition}
932
988
  */
933
- close():void;
934
- getAttributes():string[];
989
+ in(terms:FilterValue[]):FilterCondition;
935
990
  /**
936
- * null if no property exists, a string if it is an easily serializable property, or a ```Promise
937
- * &lt;Table&gt;``` that will either resolve with a table or error out if the object can't be passed to JS.
938
- * @param attributeName -
939
- * @return Object
991
+ * a filter condition checking if the current value is in the given set of values, ignoring differences of upper vs
992
+ * lower case
993
+ * @param terms -
994
+ * @return {@link dh.FilterCondition}
940
995
  */
941
- getAttribute(attributeName:string):unknown|undefined|null;
996
+ inIgnoreCase(terms:FilterValue[]):FilterCondition;
942
997
  /**
943
- * Replace the currently set sort on this table. Returns the previously set value. Note that the sort property will
944
- * immediately return the new value, but you may receive update events using the old sort before the new sort is
945
- * applied, and the <b>sortchanged</b> event fires. Reusing existing, applied sorts may enable this to perform
946
- * better on the server. The <b>updated</b> event will also fire, but <b>rowadded</b> and <b>rowremoved</b> will
947
- * not.
948
- * @param sort -
949
- * @return {@link dh.Sort} array
998
+ * a filter condition checking that the current value is not in the given set of values
999
+ * @param terms -
1000
+ * @return {@link dh.FilterCondition}
950
1001
  */
951
- applySort(sort:Sort[]):Array<Sort>;
952
- /**
953
- * Replace the currently set filters on the table. Returns the previously set value. Note that the filter property
954
- * will immediately return the new value, but you may receive update events using the old filter before the new one
955
- * is applied, and the <b>filterchanged</b> event fires. Reusing existing, applied filters may enable this to
956
- * perform better on the server. The <b>updated</b> event will also fire, but <b>rowadded</b> and <b>rowremoved</b>
957
- * will not.
958
- * @param filter -
959
- * @return {@link dh.FilterCondition} array
960
- */
961
- applyFilter(filter:FilterCondition[]):Array<FilterCondition>;
1002
+ notIn(terms:FilterValue[]):FilterCondition;
962
1003
  /**
963
- * used when adding new filter and sort operations to the table, as long as they are present.
964
- * @param customColumns -
965
- * @return {@link dh.CustomColumn} array
1004
+ * a filter condition checking that the current value is not in the given set of values, ignoring differences of
1005
+ * upper vs lower case
1006
+ * @param terms -
1007
+ * @return {@link dh.FilterCondition}
966
1008
  */
967
- applyCustomColumns(customColumns:Array<string|CustomColumn>):Array<CustomColumn>;
1009
+ notInIgnoreCase(terms:FilterValue[]):FilterCondition;
968
1010
  /**
969
- * If the columns parameter is not provided, all columns will be used. If the updateIntervalMs parameter is not
970
- * provided, a default of one second will be used. Until this is called, no data will be available. Invoking this
971
- * will result in events to be fired once data becomes available, starting with an `updated` event and a
972
- * <b>rowadded</b> event per row in that range. The returned object allows the viewport to be closed when no longer
973
- * needed.
974
- * @param firstRow -
975
- * @param lastRow -
976
- * @param columns -
977
- * @param updateIntervalMs -
978
- * @return {@link dh.TableViewportSubscription}
1011
+ * a filter condition checking if the given value contains the given string value
1012
+ * @param term -
1013
+ * @return {@link dh.FilterCondition}
979
1014
  */
980
- setViewport(firstRow:number, lastRow:number, columns?:Array<Column>|undefined|null, updateIntervalMs?:number|undefined|null, isReverseViewport?:boolean|undefined|null):TableViewportSubscription;
1015
+ contains(term:FilterValue):FilterCondition;
981
1016
  /**
982
- * Gets the currently visible viewport. If the current set of operations has not yet resulted in data, it will not
983
- * resolve until that data is ready. If this table is closed before the promise resolves, it will be rejected - to
984
- * separate the lifespan of this promise from the table itself, call
985
- * {@link TableViewportSubscription.getViewportData} on the result from {@link Table.setViewport}.
986
- * @return Promise of {@link dh.TableData}
1017
+ * a filter condition checking if the given value contains the given string value, ignoring differences of upper vs
1018
+ * lower case
1019
+ * @param term -
1020
+ * @return {@link dh.FilterCondition}
987
1021
  */
988
- getViewportData():Promise<ViewportData>;
1022
+ containsIgnoreCase(term:FilterValue):FilterCondition;
989
1023
  /**
990
- * Creates a subscription to the specified columns, across all rows in the table. The optional parameter
991
- * updateIntervalMs may be specified to indicate how often the server should send updates, defaulting to one second
992
- * if omitted. Useful for charts or taking a snapshot of the table atomically. The initial snapshot will arrive in a
993
- * single event, but later changes will be sent as updates. However, this may still be very expensive to run from a
994
- * browser for very large tables. Each call to subscribe creates a new subscription, which must have <b>close()</b>
995
- * called on it to stop it, and all events are fired from the TableSubscription instance.
996
- * @param columns -
997
- * @param updateIntervalMs -
998
- * @return {@link dh.TableSubscription}
1024
+ * a filter condition checking if the given value matches the provided regular expressions string. Regex patterns
1025
+ * use Java regex syntax
1026
+ * @param pattern -
1027
+ * @return {@link dh.FilterCondition}
999
1028
  */
1000
- subscribe(columns:Array<Column>, updateIntervalMs?:number):TableSubscription;
1029
+ matches(pattern:FilterValue):FilterCondition;
1001
1030
  /**
1002
- * a new table containing the distinct tuples of values from the given columns that are present in the original
1003
- * table. This table can be manipulated as any other table. Sorting is often desired as the default sort is the
1004
- * order of appearance of values from the original table.
1005
- * @param columns -
1006
- * @return Promise of dh.Table
1031
+ * a filter condition checking if the given value matches the provided regular expressions string, ignoring
1032
+ * differences of upper vs lower case. Regex patterns use Java regex syntax
1033
+ * @param pattern -
1034
+ * @return {@link dh.FilterCondition}
1007
1035
  */
1008
- selectDistinct(columns:Column[]):Promise<Table>;
1036
+ matchesIgnoreCase(pattern:FilterValue):FilterCondition;
1009
1037
  /**
1010
- * Creates a new copy of this table, so it can be sorted and filtered separately, and maintain a different viewport.
1011
- * @return Promise of dh.Table
1038
+ * a filter condition checking if the current value is a true boolean
1039
+ * @return {@link dh.FilterCondition}
1012
1040
  */
1013
- copy():Promise<Table>;
1041
+ isTrue():FilterCondition;
1014
1042
  /**
1015
- * a promise that will resolve to a Totals Table of this table. This table will obey the configurations provided as
1016
- * a parameter, or will use the table's default if no parameter is provided, and be updated once per second as
1017
- * necessary. Note that multiple calls to this method will each produce a new TotalsTable which must have close()
1018
- * called on it when not in use.
1019
- * @param config -
1020
- * @return Promise of dh.TotalsTable
1043
+ * a filter condition checking if the current value is a false boolean
1044
+ * @return {@link dh.FilterCondition}
1021
1045
  */
1022
- getTotalsTable(config?:TotalsTableConfig|undefined|null):Promise<TotalsTable>;
1046
+ isFalse():FilterCondition;
1023
1047
  /**
1024
- * a promise that will resolve to a Totals Table of this table, ignoring any filters. See <b>getTotalsTable()</b>
1025
- * above for more specifics.
1026
- * @param config -
1027
- * @return promise of dh.TotalsTable
1048
+ * a filter condition checking if the current value is a null value
1049
+ * @return {@link dh.FilterCondition}
1028
1050
  */
1029
- getGrandTotalsTable(config?:TotalsTableConfig|undefined|null):Promise<TotalsTable>;
1051
+ isNull():FilterCondition;
1030
1052
  /**
1031
- * a promise that will resolve to a new roll-up <b>TreeTable</b> of this table. Multiple calls to this method will
1032
- * each produce a new <b>TreeTable</b> which must have close() called on it when not in use.
1033
- * @param configObject -
1034
- * @return Promise of dh.TreeTable
1053
+ * a filter condition invoking the given method on the current value, with the given parameters. Currently supported
1054
+ * functions that can be invoked on a String:
1055
+ * <ul>
1056
+ * <li><b>startsWith</b>: Returns true if the current string value starts with the supplied string argument</li>
1057
+ * <li><b>endsWith</b>: Returns true if the current string value ends with the supplied string argument</li>
1058
+ * <li><b>matches</b>: Returns true if the current string value matches the supplied string argument used as a Java
1059
+ * regular expression</li>
1060
+ * <li><b>contains</b>: Returns true if the current string value contains the supplied string argument
1061
+ * <p>
1062
+ * When invoking against a constant, this should be avoided in favor of FilterValue.contains
1063
+ * </p>
1064
+ * </li>
1065
+ * </ul>
1066
+ * @param method -
1067
+ * @param args -
1068
+ * @return
1035
1069
  */
1036
- rollup(configObject:RollupConfig):Promise<TreeTable>;
1070
+ invoke(method:string, ...args:FilterValue[]):FilterCondition;
1071
+ toString():string;
1037
1072
  /**
1038
- * a promise that will resolve to a new `TreeTable` of this table. Multiple calls to this method will each produce a
1039
- * new `TreeTable` which must have close() called on it when not in use.
1040
- * @param configObject -
1041
- * @return Promise dh.TreeTable
1073
+ * Constructs a string for the filter API from the given parameter.
1074
+ * @param input -
1075
+ * @return
1042
1076
  */
1043
- treeTable(configObject:TreeTableConfig):Promise<TreeTable>;
1077
+ static ofString(input:any):FilterValue;
1044
1078
  /**
1045
- * a "frozen" version of this table (a server-side snapshot of the entire source table). Viewports on the frozen
1046
- * table will not update. This does not change the original table, and the new table will not have any of the client
1047
- * side sorts/filters/columns. New client side sorts/filters/columns can be added to the frozen copy.
1048
- * @return Promise of dh.Table
1079
+ * Constructs a boolean for the filter API from the given parameter.
1080
+ * @param b -
1081
+ * @return
1049
1082
  */
1050
- freeze():Promise<Table>;
1051
- snapshot(baseTable:Table, doInitialSnapshot?:boolean, stampColumns?:string[]):Promise<Table>;
1083
+ static ofBoolean(b:boolean):FilterValue;
1084
+ }
1085
+
1086
+
1087
+ /**
1088
+ * Describes a grouping and aggregations for a roll-up table. Pass to the <b>Table.rollup</b> function to create a
1089
+ * roll-up table.
1090
+ */
1091
+ export class RollupConfig {
1052
1092
  /**
1053
- *
1054
- * @inheritDoc
1055
- * @deprecated
1093
+ * Ordered list of columns to group by to form the hierarchy of the resulting roll-up table.
1056
1094
  */
1057
- join(joinType:string, rightTable:JoinableTable, columnsToMatch:Array<string>, columnsToAdd?:Array<string>|undefined|null, asOfMatchRule?:string|undefined|null):Promise<Table>;
1058
- asOfJoin(rightTable:JoinableTable, columnsToMatch:Array<string>, columnsToAdd?:Array<string>|undefined|null, asOfMatchRule?:string|undefined|null):Promise<Table>;
1059
- crossJoin(rightTable:JoinableTable, columnsToMatch:Array<string>, columnsToAdd?:Array<string>|undefined|null, reserveBits?:number|undefined|null):Promise<Table>;
1060
- exactJoin(rightTable:JoinableTable, columnsToMatch:Array<string>, columnsToAdd?:Array<string>):Promise<Table>;
1061
- naturalJoin(rightTable:JoinableTable, columnsToMatch:Array<string>, columnsToAdd?:Array<string>):Promise<Table>;
1062
- byExternal(keys:object, dropKeys?:boolean):Promise<PartitionedTable>;
1095
+ groupingColumns:Array<String>;
1063
1096
  /**
1064
- * Creates a new PartitionedTable from the contents of the current table, partitioning data based on the specified
1065
- * keys.
1066
- * @param keys -
1067
- * @param dropKeys -
1068
- * @return Promise dh.PartitionedTable
1097
+ * Mapping from each aggregation name to the ordered list of columns it should be applied to in the resulting
1098
+ * roll-up table.
1069
1099
  */
1070
- partitionBy(keys:object, dropKeys?:boolean):Promise<PartitionedTable>;
1100
+ aggregations:{ [key: string]: Array<string>; };
1071
1101
  /**
1072
- * a promise that will resolve to ColumnStatistics for the column of this table.
1073
- * @param column -
1074
- * @return Promise of dh.ColumnStatistics
1102
+ * Optional parameter indicating if an extra leaf node should be added at the bottom of the hierarchy, showing the
1103
+ * rows in the underlying table which make up that grouping. Since these values might be a different type from the
1104
+ * rest of the column, any client code must check if TreeRow.hasChildren = false, and if so, interpret those values
1105
+ * as if they were Column.constituentType instead of Column.type. Defaults to false.
1075
1106
  */
1076
- getColumnStatistics(column:Column):Promise<ColumnStatistics>;
1107
+ includeConstituents:boolean;
1108
+ includeOriginalColumns?:boolean|null;
1077
1109
  /**
1078
- * Seek the row matching the data provided
1079
- * @param startingRow - Row to start the seek from
1080
- * @param column - Column to seek for value on
1081
- * @param valueType - Type of value provided
1082
- * @param seekValue - Value to seek
1083
- * @param insensitive - Optional value to flag a search as case-insensitive. Defaults to `false`.
1084
- * @param contains - Optional value to have the seek value do a contains search instead of exact equality. Defaults to
1085
- * `false`.
1086
- * @param isBackwards - Optional value to seek backwards through the table instead of forwards. Defaults to `false`.
1087
- * @return A promise that resolves to the row value found.
1110
+ * Optional parameter indicating if original column descriptions should be included. Defaults to true.
1088
1111
  */
1089
- seekRow(startingRow:number, column:Column, valueType:ValueTypeType, seekValue:any, insensitive?:boolean|undefined|null, contains?:boolean|undefined|null, isBackwards?:boolean|undefined|null):Promise<number>;
1090
- toString():string;
1112
+ includeDescriptions:boolean;
1113
+
1114
+ constructor();
1115
+ }
1116
+
1117
+ /**
1118
+ * Exists to keep the dh.TableMap namespace so that the web UI can remain compatible with the DHE API, which still calls
1119
+ * this type TableMap.
1120
+ * @deprecated
1121
+ */
1122
+ export class TableMap {
1123
+ static readonly EVENT_KEYADDED:string;
1124
+ static readonly EVENT_DISCONNECT:string;
1125
+ static readonly EVENT_RECONNECT:string;
1126
+ static readonly EVENT_RECONNECTFAILED:string;
1127
+
1128
+ protected constructor();
1129
+ }
1130
+
1131
+ /**
1132
+ * A Widget represents a server side object that sends one or more responses to the client. The client can then
1133
+ * interpret these responses to see what to render, or how to respond.
1134
+ * <p>
1135
+ * Most custom object types result in a single response being sent to the client, often with other exported objects, but
1136
+ * some will have streamed responses, and allow the client to send follow-up requests of its own. This class's API is
1137
+ * backwards compatible, but as such does not offer a way to tell the difference between a streaming or non-streaming
1138
+ * object type, the client code that handles the payloads is expected to know what to expect. See
1139
+ * {@link dh.WidgetMessageDetails} for more information.
1140
+ * <p>
1141
+ * When the promise that returns this object resolves, it will have the first response assigned to its fields. Later
1142
+ * responses from the server will be emitted as "message" events. When the connection with the server ends, the "close"
1143
+ * event will be emitted. In this way, the connection will behave roughly in the same way as a WebSocket - either side
1144
+ * can close, and after close no more messages will be processed. There can be some latency in closing locally while
1145
+ * remote messages are still pending - it is up to implementations of plugins to handle this case.
1146
+ * <p>
1147
+ * Also like WebSockets, the plugin API doesn't define how to serialize messages, and just handles any binary payloads.
1148
+ * What it does handle however, is allowing those messages to include references to server-side objects with those
1149
+ * payloads. Those server side objects might be tables or other built-in types in the Deephaven JS API, or could be
1150
+ * objects usable through their own plugins. They also might have no plugin at all, allowing the client to hold a
1151
+ * reference to them and pass them back to the server, either to the current plugin instance, or through another API.
1152
+ * The `Widget` type does not specify how those objects should be used or their lifecycle, but leaves that
1153
+ * entirely to the plugin. Messages will arrive in the order they were sent.
1154
+ * <p>
1155
+ * This can suggest several patterns for how plugins operate:
1156
+ * <ul>
1157
+ * <li>The plugin merely exists to transport some other object to the client. This can be useful for objects which can
1158
+ * easily be translated to some other type (like a Table) when the user clicks on it. An example of this is
1159
+ * `pandas.DataFrame` will result in a widget that only contains a static
1160
+ * {@link dh.Table}. Presently, the widget is immediately closed, and only the Table is
1161
+ * provided to the JS API consumer.</li>
1162
+ * <li>The plugin provides references to Tables and other objects, and those objects can live longer than the object
1163
+ * which provided them. One concrete example of this could have been
1164
+ * {@link dh.PartitionedTable} when fetching constituent tables, but it was implemented
1165
+ * before bidirectional plugins were implemented. Another example of this is plugins that serve as a "factory", giving
1166
+ * the user access to table manipulation/creation methods not supported by gRPC or the JS API.</li>
1167
+ * <li>The plugin provides reference to Tables and other objects that only make sense within the context of the widget
1168
+ * instance, so when the widget goes away, those objects should be released as well. This is also an example of
1169
+ * {@link dh.PartitionedTable}, as the partitioned table tracks creation of new keys through
1170
+ * an internal table instance.</li>
1171
+ * </ul>
1172
+ *
1173
+ * Handling server objects in messages also has more than one potential pattern that can be used:
1174
+ * <ul>
1175
+ * <li>One object per message - the message clearly is about that object, no other details required.</li>
1176
+ * <li>Objects indexed within their message - as each message comes with a list of objects, those objects can be
1177
+ * referenced within the payload by index. This is roughly how {@link dh.plot.Figure}
1178
+ * behaves, where the figure descriptor schema includes an index for each created series, describing which table should
1179
+ * be used, which columns should be mapped to each axis.</li>
1180
+ * <li>Objects indexed since widget creation - each message would append its objects to a list created when the widget
1181
+ * was first made, and any new exports that arrive in a new message would be appended to that list. Then, subsequent
1182
+ * messages can reference objects already sent. This imposes a limitation where the client cannot release any exports
1183
+ * without the server somehow signaling that it will never reference that export again.</li>
1184
+ * </ul>
1185
+ */
1186
+ export class Widget implements WidgetMessageDetails, HasEventHandling {
1187
+ static readonly EVENT_MESSAGE:string;
1188
+ static readonly EVENT_CLOSE:string;
1189
+
1190
+ protected constructor();
1191
+
1091
1192
  /**
1092
- * True if this table represents a user Input Table (created by InputTable.newInputTable). When true, you may call
1093
- * .inputTable() to add or remove data from the underlying table.
1094
- * @return boolean
1193
+ * Ends the client connection to the server.
1095
1194
  */
1096
- get hasInputTable():boolean;
1195
+ close():void;
1196
+ getDataAsBase64():string;
1197
+ getDataAsU8():Uint8Array;
1198
+ getDataAsString():string;
1097
1199
  /**
1098
- * The columns that are present on this table. This is always all possible columns. If you specify fewer columns in
1099
- * .setViewport(), you will get only those columns in your ViewportData. <b>Number size</b> The total count of rows
1100
- * in the table. The size can and will change; see the <b>sizechanged</b> event for details. Size will be negative
1101
- * in exceptional cases (eg. the table is uncoalesced, see the <b>isUncoalesced</b> property for details).
1102
- * @return {@link dh.Column} array
1200
+ * Sends a string/bytes payload to the server, along with references to objects that exist on the server.
1201
+ * @param msg - string/buffer/view instance that represents data to send
1202
+ * @param references - an array of objects that can be safely sent to the server
1103
1203
  */
1104
- get columns():Array<Column>;
1204
+ sendMessage(msg:string|ArrayBuffer|ArrayBufferView, references?:Array<Table|Widget|WidgetExportedObject|PartitionedTable|TotalsTable|TreeTable>):void;
1205
+ addEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):()=>void;
1206
+ nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<Event<T>>;
1207
+ hasListeners(name:string):boolean;
1208
+ removeEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):boolean;
1105
1209
  /**
1106
- * The default configuration to be used when building a <b>TotalsTable</b> for this table.
1107
- * @return dh.TotalsTableConfig
1210
+ *
1211
+ * @return the exported objects sent in the initial message from the server. The client is responsible for closing
1212
+ * them when finished using them.
1108
1213
  */
1109
- get totalsTableConfig():TotalsTableConfig;
1214
+ get exportedObjects():WidgetExportedObject[];
1110
1215
  /**
1111
- * An ordered list of Sorts to apply to the table. To update, call <b>applySort()</b>. Note that this getter will
1112
- * return the new value immediately, even though it may take a little time to update on the server. You may listen
1113
- * for the <b>sortchanged</b> event to know when to update the UI.
1114
- * @return {@link dh.Sort} array
1216
+ *
1217
+ * @return the type of this widget
1115
1218
  */
1116
- get sort():Array<Sort>;
1219
+ get type():string;
1220
+ }
1221
+
1222
+ export class DateWrapper extends LongWrapper {
1223
+ protected constructor();
1224
+
1225
+ static ofJsDate(date:Date):DateWrapper;
1226
+ asDate():Date;
1227
+ }
1228
+
1229
+ /**
1230
+ * This class allows iteration over non-contiguous indexes. In the future, this will support the EcmaScript 2015
1231
+ * Iteration protocol, but for now has one method which returns an iterator, and also supports querying the size.
1232
+ * Additionally, we may add support for creating RangeSet objects to better serve some use cases.
1233
+ */
1234
+ export class RangeSet {
1235
+ protected constructor();
1236
+
1237
+ static ofRange(first:number, last:number):RangeSet;
1238
+ static ofItems(rows:number[]):RangeSet;
1239
+ static ofRanges(ranges:RangeSet[]):RangeSet;
1240
+ static ofSortedRanges(ranges:RangeSet[]):RangeSet;
1117
1241
  /**
1118
- * An ordered list of custom column formulas to add to the table, either adding new columns or replacing existing
1119
- * ones. To update, call <b>applyCustomColumns()</b>.
1120
- * @return {@link dh.CustomColumn} array
1242
+ * a new iterator over all indexes in this collection.
1243
+ * @return Iterator of {@link dh.LongWrapper}
1121
1244
  */
1122
- get customColumns():Array<CustomColumn>;
1245
+ iterator():Iterator<LongWrapper>;
1123
1246
  /**
1124
- * True if this table may receive updates from the server, including size changed events, updated events after
1125
- * initial snapshot.
1126
- * @return boolean
1247
+ * The total count of items contained in this collection. In some cases this can be expensive to compute, and
1248
+ * generally should not be needed except for debugging purposes, or preallocating space (i.e., do not call this
1249
+ * property each time through a loop).
1250
+ * @return double
1127
1251
  */
1128
- get isRefreshing():boolean;
1252
+ get size():number;
1253
+ }
1254
+
1255
+ /**
1256
+ * Describes a filter which can be applied to a table. Replacing these instances may be more expensive than reusing
1257
+ * them. These instances are immutable - all operations that compose them to build bigger expressions return a new
1258
+ * instance.
1259
+ */
1260
+ export class FilterCondition {
1261
+ protected constructor();
1262
+
1129
1263
  /**
1130
- * An ordered list of Filters to apply to the table. To update, call applyFilter(). Note that this getter will
1131
- * return the new value immediately, even though it may take a little time to update on the server. You may listen
1132
- * for the <b>filterchanged</b> event to know when to update the UI.
1133
- * @return {@link dh.FilterCondition} array
1264
+ * the opposite of this condition
1265
+ * @return FilterCondition
1134
1266
  */
1135
- get filter():Array<FilterCondition>;
1267
+ not():FilterCondition;
1136
1268
  /**
1137
- * The total count of the rows in the table, excluding any filters. Unlike {@link Table.size}, changes to this value
1138
- * will not result in any event. If the table is unfiltered, this will return the same size as {@link Table.size}.
1139
- * If this table was uncoalesced before it was filtered, this will return {@link dh.Table.SIZE_UNCOALESCED}.
1140
- * @return the size of the table before filters, or {@link dh.Table.SIZE_UNCOALESCED}
1269
+ * a condition representing the current condition logically ANDed with the other parameters
1270
+ * @param filters -
1271
+ * @return FilterCondition
1141
1272
  */
1142
- get totalSize():number;
1273
+ and(...filters:FilterCondition[]):FilterCondition;
1143
1274
  /**
1144
- * The total count of rows in the table. If there is a viewport subscription active, this size will be updated when
1145
- * the subscription updates. If not, and {@link Table.uncoalesced} is true, the size will be
1146
- * {@link dh.Table.SIZE_UNCOALESCED}. Otherwise, the size will be updated when the server's update graph processes changes.
1147
- * <p>
1148
- * When the size changes, the {@link dh.Table.EVENT_SIZECHANGED} event will be fired.
1149
- * @return the size of the table, or {@link dh.Table.SIZE_UNCOALESCED} if there is no subscription and the table is
1150
- * uncoalesced.
1275
+ * a condition representing the current condition logically ORed with the other parameters
1276
+ * @param filters -
1277
+ * @return FilterCondition.
1151
1278
  */
1152
- get size():number;
1279
+ or(...filters:FilterCondition[]):FilterCondition;
1153
1280
  /**
1154
- * True if this table has been closed.
1155
- * @return boolean
1281
+ * a string suitable for debugging showing the details of this condition.
1282
+ * @return String.
1156
1283
  */
1157
- get isClosed():boolean;
1284
+ toString():string;
1285
+ get columns():Array<Column>;
1158
1286
  /**
1159
- * Read-only. True if this table is uncoalesced, indicating that work must be done before the table can be used.
1287
+ * a filter condition invoking a static function with the given parameters. Currently supported Deephaven static
1288
+ * functions:
1289
+ * <ul>
1290
+ * <li><b>inRange</b>: Given three comparable values, returns true if the first is less than the second but greater
1291
+ * than the third</li>
1292
+ * <li><b>isInf</b>:Returns true if the given number is <i>infinity</i></li>
1293
+ * <li><b>isNaN</b>:Returns true if the given number is <i>not a number</i></li>
1294
+ * <li><b>isNormal</b>:Returns true if the given number <i>is not null</i>, <i>is not infinity</i>, and <i>is not
1295
+ * "not a number"</i></li>
1296
+ * <li><b>startsWith</b>:Returns true if the first string starts with the second string</li>
1297
+ * <li><b>endsWith</b>Returns true if the first string ends with the second string</li>
1298
+ * <li><b>matches</b>:Returns true if the first string argument matches the second string used as a Java regular
1299
+ * expression</li>
1300
+ * <li><b>contains</b>:Returns true if the first string argument contains the second string as a substring</li>
1301
+ * <li><b>in</b>:Returns true if the first string argument can be found in the second array argument.
1160
1302
  * <p>
1161
- * Uncoalesced tables are expensive to operate on - filter to a single partition or range of partitions before
1162
- * subscribing to access only the desired data efficiently. A subscription can be specified without a filter, but
1163
- * this can be very expensive. To see which partitions are available, check each column on the table to see which
1164
- * have {@link Column.isPartitionColumn} as `true`, and filter those columns. To read the possible values
1165
- * for those columns, use {@link Table.selectDistinct}.
1166
- * @return True if the table is uncoaleced and should be filtered before operating on it, otherwise false.
1167
- */
1168
- get isUncoalesced():boolean;
1169
- /**
1170
- * Listen for events on this object.
1171
- * @param name - the name of the event to listen for
1172
- * @param callback - a function to call when the event occurs
1173
- * @return Returns a cleanup function.
1174
- * @typeParam T - the type of the data that the event will provide
1175
- */
1176
- addEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):()=>void;
1177
- nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<Event<T>>;
1178
- hasListeners(name:string):boolean;
1179
- /**
1180
- * Removes an event listener added to this table.
1181
- * @param name -
1182
- * @param callback -
1183
- * @return
1184
- * @typeParam T -
1303
+ * Note that the array can only be specified as a column reference at this time - typically the `FilterValue.in`
1304
+ * method should be used in other cases
1305
+ * </p>
1306
+ * </li>
1307
+ * </ul>
1308
+ * @param function -
1309
+ * @param args -
1310
+ * @return dh.FilterCondition
1185
1311
  */
1186
- removeEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):boolean;
1312
+ static invoke(func:string, ...args:FilterValue[]):FilterCondition;
1187
1313
  /**
1188
- * a Sort than can be used to reverse a table. This can be passed into n array in applySort. Note that Tree Tables
1189
- * do not support reverse.
1190
- * @return {@link dh.Sort}
1314
+ * a filter condition which will check if the given value can be found in any supported column on whatever table
1315
+ * this FilterCondition is passed to. This FilterCondition is somewhat unique in that it need not be given a column
1316
+ * instance, but will adapt to any table. On numeric columns, with a value passed in which can be parsed as a
1317
+ * number, the column will be filtered to numbers which equal, or can be "rounded" effectively to this number. On
1318
+ * String columns, the given value will match any column which contains this string in a case-insensitive search. An
1319
+ * optional second argument can be passed, an array of `FilterValue` from the columns to limit this search to (see
1320
+ * {@link dh.Column.filter}).
1321
+ * @param value -
1322
+ * @param columns -
1323
+ * @return dh.FilterCondition
1191
1324
  */
1192
- static reverse():Sort;
1325
+ static search(value:FilterValue, columns?:FilterValue[]):FilterCondition;
1326
+ }
1327
+
1328
+ /**
1329
+ * Wrap BigDecimal values for use in JS. Provides text formatting for display and access to the underlying value.
1330
+ */
1331
+ export class BigDecimalWrapper {
1332
+ protected constructor();
1333
+
1334
+ static ofString(value:string):BigDecimalWrapper;
1335
+ asNumber():number;
1336
+ valueOf():string;
1337
+ toString():string;
1338
+ equals(o:object):boolean;
1339
+ hashCode():number;
1193
1340
  }
1194
1341
 
1342
+ export class LoginCredentials {
1343
+ type?:string|null;
1344
+ username?:string|null;
1345
+ token?:string|null;
1346
+
1347
+ constructor();
1348
+ }
1195
1349
 
1196
1350
  /**
1197
1351
  * Behaves like a {@link dh.Table} externally, but data, state, and viewports are managed by an entirely different
@@ -1424,218 +1578,13 @@ export namespace dh {
1424
1578
  }
1425
1579
 
1426
1580
  /**
1427
- * Describes how a Totals Table will be generated from its parent table. Each table has a default (which may be null)
1428
- * indicating how that table was configured when it was declared, and each Totals Table has a similar property
1429
- * describing how it was created. Both the <b>Table.getTotalsTable</b> and <b>Table.getGrandTotalsTable</b> methods take
1430
- * this config as an optional parameter - without it, the table's default will be used, or if null, a default instance
1431
- * of <b>TotalsTableConfig</b> will be supplied.
1432
- *
1433
- * This class has a no-arg constructor, allowing an instance to be made with the default values provided. However, any
1434
- * JS object can be passed in to the methods which accept instances of this type, provided their values adhere to the
1435
- * expected formats.
1436
- */
1437
- export class TotalsTableConfig {
1438
- /**
1439
- * @deprecated
1440
- */
1441
- static readonly COUNT:string;
1442
- /**
1443
- * @deprecated
1444
- */
1445
- static readonly MIN:string;
1446
- /**
1447
- * @deprecated
1448
- */
1449
- static readonly MAX:string;
1450
- /**
1451
- * @deprecated
1452
- */
1453
- static readonly SUM:string;
1454
- /**
1455
- * @deprecated
1456
- */
1457
- static readonly ABS_SUM:string;
1458
- /**
1459
- * @deprecated
1460
- */
1461
- static readonly VAR:string;
1462
- /**
1463
- * @deprecated
1464
- */
1465
- static readonly AVG:string;
1466
- /**
1467
- * @deprecated
1468
- */
1469
- static readonly STD:string;
1470
- /**
1471
- * @deprecated
1472
- */
1473
- static readonly FIRST:string;
1474
- /**
1475
- * @deprecated
1476
- */
1477
- static readonly LAST:string;
1478
- /**
1479
- * @deprecated
1480
- */
1481
- static readonly SKIP:string;
1482
- /**
1483
- * Specifies if a Totals Table should be expanded by default in the UI. Defaults to false.
1484
- */
1485
- showTotalsByDefault:boolean;
1486
- /**
1487
- * Specifies if a Grand Totals Table should be expanded by default in the UI. Defaults to false.
1488
- */
1489
- showGrandTotalsByDefault:boolean;
1490
- /**
1491
- * Specifies the default operation for columns that do not have a specific operation applied; defaults to "Sum".
1492
- */
1493
- defaultOperation:AggregationOperationType;
1494
- /**
1495
- * Mapping from each column name to the aggregation(s) that should be applied to that column in the resulting Totals
1496
- * Table. If a column is omitted, the defaultOperation is used.
1497
- */
1498
- operationMap:{ [key: string]: Array<AggregationOperationType>; };
1499
- /**
1500
- * Groupings to use when generating the Totals Table. One row will exist for each unique set of values observed in
1501
- * these columns. See also `Table.selectDistinct`.
1502
- */
1503
- groupBy:Array<string>;
1504
-
1505
- constructor();
1506
-
1507
- toString():string;
1508
- }
1509
-
1510
- /**
1511
- * Exists to keep the dh.TableMap namespace so that the web UI can remain compatible with the DHE API, which still calls
1512
- * this type TableMap.
1513
- * @deprecated
1514
- */
1515
- export class TableMap {
1516
- static readonly EVENT_KEYADDED:string;
1517
- static readonly EVENT_DISCONNECT:string;
1518
- static readonly EVENT_RECONNECT:string;
1519
- static readonly EVENT_RECONNECTFAILED:string;
1520
-
1521
- protected constructor();
1522
- }
1523
-
1524
- /**
1525
- * Describes a grouping and aggregations for a roll-up table. Pass to the <b>Table.rollup</b> function to create a
1526
- * roll-up table.
1527
- */
1528
- export class RollupConfig {
1529
- /**
1530
- * Ordered list of columns to group by to form the hierarchy of the resulting roll-up table.
1531
- */
1532
- groupingColumns:Array<String>;
1533
- /**
1534
- * Mapping from each aggregation name to the ordered list of columns it should be applied to in the resulting
1535
- * roll-up table.
1536
- */
1537
- aggregations:{ [key: string]: Array<string>; };
1538
- /**
1539
- * Optional parameter indicating if an extra leaf node should be added at the bottom of the hierarchy, showing the
1540
- * rows in the underlying table which make up that grouping. Since these values might be a different type from the
1541
- * rest of the column, any client code must check if TreeRow.hasChildren = false, and if so, interpret those values
1542
- * as if they were Column.constituentType instead of Column.type. Defaults to false.
1543
- */
1544
- includeConstituents:boolean;
1545
- includeOriginalColumns?:boolean|null;
1546
- /**
1547
- * Optional parameter indicating if original column descriptions should be included. Defaults to true.
1548
- */
1549
- includeDescriptions:boolean;
1550
-
1551
- constructor();
1552
- }
1553
-
1554
- /**
1555
- * A js type for operating on input tables.
1556
- *
1557
- * Represents a User Input Table, which can have data added to it from other sources.
1558
- *
1559
- * You may add rows using dictionaries of key-value tuples (representing columns by name), add tables containing all the
1560
- * key/value columns to add, or delete tables containing the keys to delete. Each operation is atomic, and will either
1561
- * succeed completely or fail completely. To guarantee order of operations, apply an operation and wait for the response
1562
- * before sending the next operation.
1563
- *
1564
- * Each table has one or more key columns, where each unique combination of keys will appear at most once in the table.
1565
- *
1566
- * To view the results of the Input Table, you should use standard table operations on the InputTable's source Table
1567
- * object.
1581
+ * Event fired when a command is issued from the client.
1568
1582
  */
1569
- export class InputTable {
1570
- protected constructor();
1583
+ export class CommandInfo {
1584
+ constructor(code:string, result:Promise<dh.ide.CommandResult>);
1571
1585
 
1572
- /**
1573
- * Adds a single row to the table. For each key or value column name in the Input Table, we retrieve that javascript
1574
- * property at that name and validate it can be put into the given column type.
1575
- * @param row -
1576
- * @param userTimeZone -
1577
- * @return Promise of dh.InputTable
1578
- */
1579
- addRow(row:{ [key: string]: any; }, userTimeZone?:string):Promise<InputTable>;
1580
- /**
1581
- * Add multiple rows to a table.
1582
- * @param rows -
1583
- * @param userTimeZone -
1584
- * @return Promise of dh.InputTable
1585
- */
1586
- addRows(rows:{ [key: string]: any; }[], userTimeZone?:string):Promise<InputTable>;
1587
- /**
1588
- * Add an entire table to this Input Table. Only column names that match the definition of the input table will be
1589
- * copied, and all key columns must have values filled in. This only copies the current state of the source table;
1590
- * future updates to the source table will not be reflected in the Input Table. The returned promise will be
1591
- * resolved to the same InputTable instance this method was called upon once the server returns.
1592
- * @param tableToAdd -
1593
- * @return Promise of dh.InputTable
1594
- */
1595
- addTable(tableToAdd:Table):Promise<InputTable>;
1596
- /**
1597
- * Add multiple tables to this Input Table.
1598
- * @param tablesToAdd -
1599
- * @return Promise of dh.InputTable
1600
- */
1601
- addTables(tablesToAdd:Table[]):Promise<InputTable>;
1602
- /**
1603
- * Deletes an entire table from this Input Table. Key columns must match the Input Table.
1604
- * @param tableToDelete -
1605
- * @return Promise of dh.InputTable
1606
- */
1607
- deleteTable(tableToDelete:Table):Promise<InputTable>;
1608
- /**
1609
- * Delete multiple tables from this Input Table.
1610
- * @param tablesToDelete -
1611
- * @return
1612
- */
1613
- deleteTables(tablesToDelete:Table[]):Promise<InputTable>;
1614
- /**
1615
- * A list of the key columns, by name
1616
- * @return String array.
1617
- */
1618
- get keys():string[];
1619
- /**
1620
- * A list of the value columns, by name
1621
- * @return String array.
1622
- */
1623
- get values():string[];
1624
- /**
1625
- * A list of the key columns.
1626
- * @return Column array.
1627
- */
1628
- get keyColumns():Column[];
1629
- /**
1630
- * A list of the value Column objects
1631
- * @return {@link dh.Column} array.
1632
- */
1633
- get valueColumns():Column[];
1634
- /**
1635
- * The source table for this Input Table
1636
- * @return dh.table
1637
- */
1638
- get table():Table;
1586
+ get result():Promise<dh.ide.CommandResult>;
1587
+ get code():string;
1639
1588
  }
1640
1589
 
1641
1590
  /**
@@ -1651,487 +1600,484 @@ export namespace dh {
1651
1600
  constructor();
1652
1601
  }
1653
1602
 
1654
- /**
1655
- * Wrap BigInteger values for use in JS. Provides text formatting for display and access to the underlying value.
1656
- */
1657
- export class BigIntegerWrapper {
1658
- protected constructor();
1659
-
1660
- static ofString(str:string):BigIntegerWrapper;
1661
- asNumber():number;
1662
- valueOf():string;
1663
- toString():string;
1664
- equals(o:object):boolean;
1665
- hashCode():number;
1666
- }
1667
-
1668
- export class LongWrapper {
1669
- protected constructor();
1603
+ export class CoreClient implements HasEventHandling {
1604
+ static readonly EVENT_CONNECT:string;
1605
+ static readonly EVENT_DISCONNECT:string;
1606
+ static readonly EVENT_RECONNECT:string;
1607
+ static readonly EVENT_RECONNECT_AUTH_FAILED:string;
1608
+ static readonly EVENT_REQUEST_FAILED:string;
1609
+ static readonly EVENT_REQUEST_STARTED:string;
1610
+ static readonly EVENT_REQUEST_SUCCEEDED:string;
1611
+ /**
1612
+ * @deprecated
1613
+ */
1614
+ static readonly EVENT_REFRESH_TOKEN_UPDATED:string;
1615
+ static readonly LOGIN_TYPE_PASSWORD:string;
1616
+ static readonly LOGIN_TYPE_ANONYMOUS:string;
1670
1617
 
1671
- static ofString(str:string):LongWrapper;
1672
- asNumber():number;
1673
- valueOf():string;
1674
- toString():string;
1618
+ constructor(serverUrl:string, connectOptions?:ConnectOptions);
1619
+
1620
+ running():Promise<CoreClient>;
1621
+ getServerUrl():string;
1622
+ getAuthConfigValues():Promise<string[][]>;
1623
+ login(credentials:LoginCredentials):Promise<void>;
1624
+ relogin(token:RefreshToken):Promise<void>;
1625
+ onConnected(timeoutInMillis?:number):Promise<void>;
1626
+ getServerConfigValues():Promise<string[][]>;
1627
+ getStorageService():dh.storage.StorageService;
1628
+ getAsIdeConnection():Promise<IdeConnection>;
1629
+ disconnect():void;
1630
+ addEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):()=>void;
1631
+ nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<Event<T>>;
1632
+ hasListeners(name:string):boolean;
1633
+ removeEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):boolean;
1675
1634
  }
1676
1635
 
1677
1636
  /**
1678
- * Describes data that can be filtered, either a column reference or a literal value. Used this way, the type of a value
1679
- * can be specified so that values which are ambiguous or not well supported in JS will not be confused with Strings or
1680
- * imprecise numbers (e.g., nanosecond-precision date values). Additionally, once wrapped in this way, methods can be
1681
- * called on these value literal instances. These instances are immutable - any method called on them returns a new
1682
- * instance.
1637
+ * Describes the structure of the column, and if desired can be used to get access to the data to be rendered in this
1638
+ * column.
1683
1639
  */
1684
- export class FilterValue {
1640
+ export class Column {
1641
+ /**
1642
+ * If this column is part of a roll-up tree table, represents the type of the row data that can be found in this
1643
+ * column for leaf nodes if includeConstituents is enabled. Otherwise, it is <b>null</b>.
1644
+ * @return String
1645
+ */
1646
+ readonly constituentType?:string|null;
1647
+ readonly description?:string|null;
1648
+
1685
1649
  protected constructor();
1686
1650
 
1687
1651
  /**
1688
- * Constructs a number for the filter API from the given parameter. Can also be used on the values returned from
1689
- * {@link TableData.get} for DateTime values. To create
1690
- * a filter with a date, use <b>dh.DateWrapper.ofJsDate</b> or
1691
- * {@link i18n.DateTimeFormat.parse}. To create a filter with a
1692
- * 64-bit long integer, use {@link LongWrapper.ofString}.
1693
- * @param input - the number to wrap as a FilterValue
1694
- * @return an immutable FilterValue that can be built into a filter
1652
+ * the value for this column in the given row. Type will be consistent with the type of the Column.
1653
+ * @param row -
1654
+ * @return Any
1695
1655
  */
1696
- static ofNumber(input:LongWrapper|number):FilterValue;
1656
+ get(row:Row):any;
1657
+ getFormat(row:Row):Format;
1697
1658
  /**
1698
- * a filter condition checking if the current value is equal to the given parameter
1699
- * @param term -
1700
- * @return {@link dh.FilterCondition}
1659
+ * Creates a sort builder object, to be used when sorting by this column.
1660
+ * @return {@link dh.Sort}
1701
1661
  */
1702
- eq(term:FilterValue):FilterCondition;
1662
+ sort():Sort;
1703
1663
  /**
1704
- * a filter condition checking if the current value is equal to the given parameter, ignoring differences of upper
1705
- * vs lower case
1706
- * @param term -
1707
- * @return {@link dh.FilterCondition}
1664
+ * Creates a new value for use in filters based on this column. Used either as a parameter to another filter
1665
+ * operation, or as a builder to create a filter operation.
1666
+ * @return {@link dh.FilterValue}
1708
1667
  */
1709
- eqIgnoreCase(term:FilterValue):FilterCondition;
1668
+ filter():FilterValue;
1710
1669
  /**
1711
- * a filter condition checking if the current value is not equal to the given parameter
1712
- * @param term -
1713
- * @return {@link dh.FilterCondition}
1670
+ * a <b>CustomColumn</b> object to apply using `applyCustomColumns` with the expression specified.
1671
+ * @param expression -
1672
+ * @return {@link dh.CustomColumn}
1714
1673
  */
1715
- notEq(term:FilterValue):FilterCondition;
1674
+ formatColor(expression:string, options?:CustomColumnOptions|undefined|null):CustomColumn;
1716
1675
  /**
1717
- * a filter condition checking if the current value is not equal to the given parameter, ignoring differences of
1718
- * upper vs lower case
1719
- * @param term -
1720
- * @return {@link dh.FilterCondition}
1676
+ * a <b>CustomColumn</b> object to apply using <b>applyCustomColumns</b> with the expression specified.
1677
+ * @param expression -
1678
+ * @return {@link dh.CustomColumn}
1721
1679
  */
1722
- notEqIgnoreCase(term:FilterValue):FilterCondition;
1680
+ formatNumber(expression:string, options?:CustomColumnOptions|undefined|null):CustomColumn;
1723
1681
  /**
1724
- * a filter condition checking if the current value is greater than the given parameter
1725
- * @param term -
1726
- * @return {@link dh.FilterCondition}
1682
+ * a <b>CustomColumn</b> object to apply using <b>applyCustomColumns</b> with the expression specified.
1683
+ * @param expression -
1684
+ * @return {@link dh.CustomColumn}
1727
1685
  */
1728
- greaterThan(term:FilterValue):FilterCondition;
1686
+ formatDate(expression:string, options?:CustomColumnOptions|undefined|null):CustomColumn;
1687
+ toString():string;
1729
1688
  /**
1730
- * a filter condition checking if the current value is less than the given parameter
1731
- * @param term -
1732
- * @return {@link dh.FilterCondition}
1689
+ * Label for this column.
1690
+ * @return String
1733
1691
  */
1734
- lessThan(term:FilterValue):FilterCondition;
1692
+ get name():string;
1735
1693
  /**
1736
- * a filter condition checking if the current value is greater than or equal to the given parameter
1737
- * @param term -
1738
- * @return {@link dh.FilterCondition}
1694
+ * True if this column is a partition column. Partition columns are used for filtering uncoalesced tables - see
1695
+ * {@link Table.uncoalesced}.
1696
+ * @return true if the column is a partition column
1739
1697
  */
1740
- greaterThanOrEqualTo(term:FilterValue):FilterCondition;
1698
+ get isPartitionColumn():boolean;
1741
1699
  /**
1742
- * a filter condition checking if the current value is less than or equal to the given parameter
1743
- * @param term -
1744
- * @return {@link dh.FilterCondition}
1700
+ *
1701
+ * @deprecated do not use. Internal index of the column in the table, to be used as a key on the Row.
1702
+ * @return int
1745
1703
  */
1746
- lessThanOrEqualTo(term:FilterValue):FilterCondition;
1704
+ get index():number;
1705
+ get isSortable():boolean;
1747
1706
  /**
1748
- * a filter condition checking if the current value is in the given set of values
1749
- * @param terms -
1750
- * @return {@link dh.FilterCondition}
1707
+ * Type of the row data that can be found in this column.
1708
+ * @return String
1751
1709
  */
1752
- in(terms:FilterValue[]):FilterCondition;
1710
+ get type():string;
1753
1711
  /**
1754
- * a filter condition checking if the current value is in the given set of values, ignoring differences of upper vs
1755
- * lower case
1756
- * @param terms -
1757
- * @return {@link dh.FilterCondition}
1712
+ * Format entire rows colors using the expression specified. Returns a <b>CustomColumn</b> object to apply to a
1713
+ * table using <b>applyCustomColumns</b> with the parameters specified.
1714
+ * @param expression -
1715
+ * @param options -
1716
+ * @return {@link dh.CustomColumn}
1758
1717
  */
1759
- inIgnoreCase(terms:FilterValue[]):FilterCondition;
1718
+ static formatRowColor(expression:string, options?:CustomColumnOptions|undefined|null):CustomColumn;
1760
1719
  /**
1761
- * a filter condition checking that the current value is not in the given set of values
1762
- * @param terms -
1763
- * @return {@link dh.FilterCondition}
1720
+ * a <b>CustomColumn</b> object to apply using <b>applyCustomColumns</b> with the expression specified.
1721
+ * @param name -
1722
+ * @param expression -
1723
+ * @param options -
1724
+ * @return {@link dh.CustomColumn}
1764
1725
  */
1765
- notIn(terms:FilterValue[]):FilterCondition;
1726
+ static createCustomColumn(name:string, expression:string, options?:CustomColumnOptions|undefined|null):CustomColumn;
1727
+ }
1728
+
1729
+ /**
1730
+ * Provides access to data in a table. Note that several methods present their response through Promises. This allows
1731
+ * the client to both avoid actually connecting to the server until necessary, and also will permit some changes not to
1732
+ * inform the UI right away that they have taken place.
1733
+ */
1734
+ export class Table implements JoinableTable, HasEventHandling {
1735
+ readonly description?:string|null;
1736
+ readonly pluginName?:string|null;
1737
+ readonly layoutHints?:null|LayoutHints;
1766
1738
  /**
1767
- * a filter condition checking that the current value is not in the given set of values, ignoring differences of
1768
- * upper vs lower case
1769
- * @param terms -
1770
- * @return {@link dh.FilterCondition}
1739
+ * The table size has updated, so live scrollbars and the like can be updated accordingly.
1771
1740
  */
1772
- notInIgnoreCase(terms:FilterValue[]):FilterCondition;
1741
+ static readonly EVENT_SIZECHANGED:string;
1773
1742
  /**
1774
- * a filter condition checking if the given value contains the given string value
1775
- * @param term -
1776
- * @return {@link dh.FilterCondition}
1743
+ * The table size has updated, so live scrollbars and the like can be updated accordingly.
1777
1744
  */
1778
- contains(term:FilterValue):FilterCondition;
1745
+ static readonly EVENT_UPDATED:string;
1779
1746
  /**
1780
- * a filter condition checking if the given value contains the given string value, ignoring differences of upper vs
1781
- * lower case
1782
- * @param term -
1783
- * @return {@link dh.FilterCondition}
1747
+ * The table size has updated, so live scrollbars and the like can be updated accordingly.
1784
1748
  */
1785
- containsIgnoreCase(term:FilterValue):FilterCondition;
1749
+ static readonly EVENT_ROWADDED:string;
1786
1750
  /**
1787
- * a filter condition checking if the given value matches the provided regular expressions string. Regex patterns
1788
- * use Java regex syntax
1789
- * @param pattern -
1790
- * @return {@link dh.FilterCondition}
1751
+ * The table size has updated, so live scrollbars and the like can be updated accordingly.
1791
1752
  */
1792
- matches(pattern:FilterValue):FilterCondition;
1753
+ static readonly EVENT_ROWREMOVED:string;
1793
1754
  /**
1794
- * a filter condition checking if the given value matches the provided regular expressions string, ignoring
1795
- * differences of upper vs lower case. Regex patterns use Java regex syntax
1796
- * @param pattern -
1797
- * @return {@link dh.FilterCondition}
1755
+ * The table size has updated, so live scrollbars and the like can be updated accordingly.
1798
1756
  */
1799
- matchesIgnoreCase(pattern:FilterValue):FilterCondition;
1757
+ static readonly EVENT_ROWUPDATED:string;
1800
1758
  /**
1801
- * a filter condition checking if the current value is a true boolean
1802
- * @return {@link dh.FilterCondition}
1759
+ * The table size has updated, so live scrollbars and the like can be updated accordingly.
1803
1760
  */
1804
- isTrue():FilterCondition;
1761
+ static readonly EVENT_SORTCHANGED:string;
1805
1762
  /**
1806
- * a filter condition checking if the current value is a false boolean
1807
- * @return {@link dh.FilterCondition}
1763
+ * The table size has updated, so live scrollbars and the like can be updated accordingly.
1808
1764
  */
1809
- isFalse():FilterCondition;
1765
+ static readonly EVENT_FILTERCHANGED:string;
1810
1766
  /**
1811
- * a filter condition checking if the current value is a null value
1812
- * @return {@link dh.FilterCondition}
1767
+ * The table size has updated, so live scrollbars and the like can be updated accordingly.
1813
1768
  */
1814
- isNull():FilterCondition;
1769
+ static readonly EVENT_CUSTOMCOLUMNSCHANGED:string;
1815
1770
  /**
1816
- * a filter condition invoking the given method on the current value, with the given parameters. Currently supported
1817
- * functions that can be invoked on a String:
1818
- * <ul>
1819
- * <li><b>startsWith</b>: Returns true if the current string value starts with the supplied string argument</li>
1820
- * <li><b>endsWith</b>: Returns true if the current string value ends with the supplied string argument</li>
1821
- * <li><b>matches</b>: Returns true if the current string value matches the supplied string argument used as a Java
1822
- * regular expression</li>
1823
- * <li><b>contains</b>: Returns true if the current string value contains the supplied string argument
1824
- * <p>
1825
- * When invoking against a constant, this should be avoided in favor of FilterValue.contains
1826
- * </p>
1827
- * </li>
1828
- * </ul>
1829
- * @param method -
1830
- * @param args -
1831
- * @return
1771
+ * The table size has updated, so live scrollbars and the like can be updated accordingly.
1832
1772
  */
1833
- invoke(method:string, ...args:FilterValue[]):FilterCondition;
1834
- toString():string;
1773
+ static readonly EVENT_DISCONNECT:string;
1835
1774
  /**
1836
- * Constructs a string for the filter API from the given parameter.
1837
- * @param input -
1838
- * @return
1775
+ * The table size has updated, so live scrollbars and the like can be updated accordingly.
1776
+ */
1777
+ static readonly EVENT_RECONNECT:string;
1778
+ /**
1779
+ * The table size has updated, so live scrollbars and the like can be updated accordingly.
1780
+ */
1781
+ static readonly EVENT_RECONNECTFAILED:string;
1782
+ /**
1783
+ * The table size has updated, so live scrollbars and the like can be updated accordingly.
1784
+ */
1785
+ static readonly EVENT_REQUEST_FAILED:string;
1786
+ /**
1787
+ * The table size has updated, so live scrollbars and the like can be updated accordingly.
1839
1788
  */
1840
- static ofString(input:any):FilterValue;
1789
+ static readonly EVENT_REQUEST_SUCCEEDED:string;
1841
1790
  /**
1842
- * Constructs a boolean for the filter API from the given parameter.
1843
- * @param b -
1844
- * @return
1791
+ * The size the table will have if it is uncoalesced.
1845
1792
  */
1846
- static ofBoolean(b:boolean):FilterValue;
1847
- }
1793
+ static readonly SIZE_UNCOALESCED:number;
1848
1794
 
1849
- /**
1850
- * Configuration object for running Table.treeTable to produce a hierarchical view of a given "flat" table.
1851
- *
1852
- * Like TotalsTableConfig, `TreeTableConfig` supports an operation map indicating how to aggregate the data, as well as
1853
- * an array of column names which will be the layers in the roll-up tree, grouped at each level. An additional optional
1854
- * value can be provided describing the strategy the engine should use when grouping the rows.
1855
- */
1856
- export class TreeTableConfig {
1795
+ protected constructor();
1796
+
1797
+ batch(userCode:(arg0:unknown)=>void):Promise<Table>;
1857
1798
  /**
1858
- * The column representing the unique ID for each item
1799
+ * Retrieve a column by the given name. You should prefer to always retrieve a new Column instance instead of
1800
+ * caching a returned value.
1801
+ * @param key -
1802
+ * @return {@link dh.Column}
1859
1803
  */
1860
- idColumn:string;
1804
+ findColumn(key:string):Column;
1861
1805
  /**
1862
- * The column representing the parent ID for each item
1806
+ * Retrieve multiple columns specified by the given names.
1807
+ * @param keys -
1808
+ * @return {@link dh.Column} array
1863
1809
  */
1864
- parentColumn:string;
1810
+ findColumns(keys:string[]):Column[];
1811
+ isBlinkTable():boolean;
1865
1812
  /**
1866
- * Optional parameter indicating if items with an invalid parent ID should be promoted to root. Defaults to false.
1813
+ * If .hasInputTable is true, you may call this method to gain access to an InputTable object which can be used to
1814
+ * mutate the data within the table. If the table is not an Input Table, the promise will be immediately rejected.
1815
+ * @return Promise of dh.InputTable
1867
1816
  */
1868
- promoteOrphansToRoot:boolean;
1869
-
1870
- constructor();
1871
- }
1872
-
1873
- /**
1874
- * A Widget represents a server side object that sends one or more responses to the client. The client can then
1875
- * interpret these responses to see what to render, or how to respond.
1876
- * <p>
1877
- * Most custom object types result in a single response being sent to the client, often with other exported objects, but
1878
- * some will have streamed responses, and allow the client to send follow-up requests of its own. This class's API is
1879
- * backwards compatible, but as such does not offer a way to tell the difference between a streaming or non-streaming
1880
- * object type, the client code that handles the payloads is expected to know what to expect. See
1881
- * {@link dh.WidgetMessageDetails} for more information.
1882
- * <p>
1883
- * When the promise that returns this object resolves, it will have the first response assigned to its fields. Later
1884
- * responses from the server will be emitted as "message" events. When the connection with the server ends, the "close"
1885
- * event will be emitted. In this way, the connection will behave roughly in the same way as a WebSocket - either side
1886
- * can close, and after close no more messages will be processed. There can be some latency in closing locally while
1887
- * remote messages are still pending - it is up to implementations of plugins to handle this case.
1888
- * <p>
1889
- * Also like WebSockets, the plugin API doesn't define how to serialize messages, and just handles any binary payloads.
1890
- * What it does handle however, is allowing those messages to include references to server-side objects with those
1891
- * payloads. Those server side objects might be tables or other built-in types in the Deephaven JS API, or could be
1892
- * objects usable through their own plugins. They also might have no plugin at all, allowing the client to hold a
1893
- * reference to them and pass them back to the server, either to the current plugin instance, or through another API.
1894
- * The `Widget` type does not specify how those objects should be used or their lifecycle, but leaves that
1895
- * entirely to the plugin. Messages will arrive in the order they were sent.
1896
- * <p>
1897
- * This can suggest several patterns for how plugins operate:
1898
- * <ul>
1899
- * <li>The plugin merely exists to transport some other object to the client. This can be useful for objects which can
1900
- * easily be translated to some other type (like a Table) when the user clicks on it. An example of this is
1901
- * `pandas.DataFrame` will result in a widget that only contains a static
1902
- * {@link dh.Table}. Presently, the widget is immediately closed, and only the Table is
1903
- * provided to the JS API consumer.</li>
1904
- * <li>The plugin provides references to Tables and other objects, and those objects can live longer than the object
1905
- * which provided them. One concrete example of this could have been
1906
- * {@link dh.PartitionedTable} when fetching constituent tables, but it was implemented
1907
- * before bidirectional plugins were implemented. Another example of this is plugins that serve as a "factory", giving
1908
- * the user access to table manipulation/creation methods not supported by gRPC or the JS API.</li>
1909
- * <li>The plugin provides reference to Tables and other objects that only make sense within the context of the widget
1910
- * instance, so when the widget goes away, those objects should be released as well. This is also an example of
1911
- * {@link dh.PartitionedTable}, as the partitioned table tracks creation of new keys through
1912
- * an internal table instance.</li>
1913
- * </ul>
1914
- *
1915
- * Handling server objects in messages also has more than one potential pattern that can be used:
1916
- * <ul>
1917
- * <li>One object per message - the message clearly is about that object, no other details required.</li>
1918
- * <li>Objects indexed within their message - as each message comes with a list of objects, those objects can be
1919
- * referenced within the payload by index. This is roughly how {@link dh.plot.Figure}
1920
- * behaves, where the figure descriptor schema includes an index for each created series, describing which table should
1921
- * be used, which columns should be mapped to each axis.</li>
1922
- * <li>Objects indexed since widget creation - each message would append its objects to a list created when the widget
1923
- * was first made, and any new exports that arrive in a new message would be appended to that list. Then, subsequent
1924
- * messages can reference objects already sent. This imposes a limitation where the client cannot release any exports
1925
- * without the server somehow signaling that it will never reference that export again.</li>
1926
- * </ul>
1927
- */
1928
- export class Widget implements WidgetMessageDetails, HasEventHandling {
1929
- static readonly EVENT_MESSAGE:string;
1930
- static readonly EVENT_CLOSE:string;
1931
-
1932
- protected constructor();
1933
-
1817
+ inputTable():Promise<InputTable>;
1934
1818
  /**
1935
- * Ends the client connection to the server.
1819
+ * Indicates that this Table instance will no longer be used, and its connection to the server can be cleaned up.
1936
1820
  */
1937
1821
  close():void;
1938
- getDataAsBase64():string;
1939
- getDataAsU8():Uint8Array;
1940
- getDataAsString():string;
1822
+ getAttributes():string[];
1941
1823
  /**
1942
- * Sends a string/bytes payload to the server, along with references to objects that exist on the server.
1943
- * @param msg - string/buffer/view instance that represents data to send
1944
- * @param references - an array of objects that can be safely sent to the server
1824
+ * null if no property exists, a string if it is an easily serializable property, or a ```Promise
1825
+ * &lt;Table&gt;``` that will either resolve with a table or error out if the object can't be passed to JS.
1826
+ * @param attributeName -
1827
+ * @return Object
1945
1828
  */
1946
- sendMessage(msg:string|ArrayBuffer|ArrayBufferView, references?:Array<Table|Widget|WidgetExportedObject|PartitionedTable|TotalsTable|TreeTable>):void;
1947
- addEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):()=>void;
1948
- nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<Event<T>>;
1949
- hasListeners(name:string):boolean;
1950
- removeEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):boolean;
1829
+ getAttribute(attributeName:string):unknown|undefined|null;
1951
1830
  /**
1952
- *
1953
- * @return the exported objects sent in the initial message from the server. The client is responsible for closing
1954
- * them when finished using them.
1831
+ * Replace the currently set sort on this table. Returns the previously set value. Note that the sort property will
1832
+ * immediately return the new value, but you may receive update events using the old sort before the new sort is
1833
+ * applied, and the <b>sortchanged</b> event fires. Reusing existing, applied sorts may enable this to perform
1834
+ * better on the server. The <b>updated</b> event will also fire, but <b>rowadded</b> and <b>rowremoved</b> will
1835
+ * not.
1836
+ * @param sort -
1837
+ * @return {@link dh.Sort} array
1955
1838
  */
1956
- get exportedObjects():WidgetExportedObject[];
1839
+ applySort(sort:Sort[]):Array<Sort>;
1957
1840
  /**
1958
- *
1959
- * @return the type of this widget
1841
+ * Replace the currently set filters on the table. Returns the previously set value. Note that the filter property
1842
+ * will immediately return the new value, but you may receive update events using the old filter before the new one
1843
+ * is applied, and the <b>filterchanged</b> event fires. Reusing existing, applied filters may enable this to
1844
+ * perform better on the server. The <b>updated</b> event will also fire, but <b>rowadded</b> and <b>rowremoved</b>
1845
+ * will not.
1846
+ * @param filter -
1847
+ * @return {@link dh.FilterCondition} array
1960
1848
  */
1961
- get type():string;
1962
- }
1963
-
1964
- /**
1965
- * This object serves as a "handle" to a subscription, allowing it to be acted on directly or canceled outright. If you
1966
- * retain an instance of this, you have two choices - either only use it to call `close()` on it to stop the table's
1967
- * viewport without creating a new one, or listen directly to this object instead of the table for data events, and
1968
- * always call `close()` when finished. Calling any method on this object other than close() will result in it
1969
- * continuing to live on after `setViewport` is called on the original table, or after the table is modified.
1970
- */
1971
- export class TableViewportSubscription implements HasEventHandling {
1972
- protected constructor();
1973
-
1849
+ applyFilter(filter:FilterCondition[]):Array<FilterCondition>;
1974
1850
  /**
1975
- * Changes the rows and columns set on this viewport. This cannot be used to change the update interval.
1851
+ * used when adding new filter and sort operations to the table, as long as they are present.
1852
+ * @param customColumns -
1853
+ * @return {@link dh.CustomColumn} array
1854
+ */
1855
+ applyCustomColumns(customColumns:Array<string|CustomColumn>):Array<CustomColumn>;
1856
+ /**
1857
+ * If the columns parameter is not provided, all columns will be used. If the updateIntervalMs parameter is not
1858
+ * provided, a default of one second will be used. Until this is called, no data will be available. Invoking this
1859
+ * will result in events to be fired once data becomes available, starting with an `updated` event and a
1860
+ * <b>rowadded</b> event per row in that range. The returned object allows the viewport to be closed when no longer
1861
+ * needed.
1976
1862
  * @param firstRow -
1977
1863
  * @param lastRow -
1978
1864
  * @param columns -
1979
1865
  * @param updateIntervalMs -
1866
+ * @return {@link dh.TableViewportSubscription}
1980
1867
  */
1981
- setViewport(firstRow:number, lastRow:number, columns?:Column[]|undefined|null, updateIntervalMs?:number|undefined|null, isReverseViewport?:boolean|undefined|null):void;
1868
+ setViewport(firstRow:number, lastRow:number, columns?:Array<Column>|undefined|null, updateIntervalMs?:number|undefined|null, isReverseViewport?:boolean|undefined|null):TableViewportSubscription;
1982
1869
  /**
1983
- * Stops this viewport from running, stopping all events on itself and on the table that created it.
1870
+ * Gets the currently visible viewport. If the current set of operations has not yet resulted in data, it will not
1871
+ * resolve until that data is ready. If this table is closed before the promise resolves, it will be rejected - to
1872
+ * separate the lifespan of this promise from the table itself, call
1873
+ * {@link TableViewportSubscription.getViewportData} on the result from {@link Table.setViewport}.
1874
+ * @return Promise of {@link dh.TableData}
1984
1875
  */
1985
- close():void;
1876
+ getViewportData():Promise<ViewportData>;
1986
1877
  /**
1987
- * Gets the data currently visible in this viewport
1988
- * @return Promise of {@link dh.TableData}.
1878
+ * Creates a subscription to the specified columns, across all rows in the table. The optional parameter
1879
+ * updateIntervalMs may be specified to indicate how often the server should send updates, defaulting to one second
1880
+ * if omitted. Useful for charts or taking a snapshot of the table atomically. The initial snapshot will arrive in a
1881
+ * single event, but later changes will be sent as updates. However, this may still be very expensive to run from a
1882
+ * browser for very large tables. Each call to subscribe creates a new subscription, which must have <b>close()</b>
1883
+ * called on it to stop it, and all events are fired from the TableSubscription instance.
1884
+ * @param columns -
1885
+ * @param updateIntervalMs -
1886
+ * @return {@link dh.TableSubscription}
1989
1887
  */
1990
- getViewportData():Promise<ViewportData>;
1991
- snapshot(rows:RangeSet, columns:Column[]):Promise<TableData>;
1888
+ subscribe(columns:Array<Column>, updateIntervalMs?:number):TableSubscription;
1992
1889
  /**
1993
- * Listen for events on this object.
1994
- * @param name - the name of the event to listen for
1995
- * @param callback - a function to call when the event occurs
1996
- * @return Returns a cleanup function.
1997
- * @typeParam T - the type of the data that the event will provide
1890
+ * a new table containing the distinct tuples of values from the given columns that are present in the original
1891
+ * table. This table can be manipulated as any other table. Sorting is often desired as the default sort is the
1892
+ * order of appearance of values from the original table.
1893
+ * @param columns -
1894
+ * @return Promise of dh.Table
1998
1895
  */
1999
- addEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):()=>void;
2000
- nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<Event<T>>;
2001
- hasListeners(name:string):boolean;
1896
+ selectDistinct(columns:Column[]):Promise<Table>;
2002
1897
  /**
2003
- * Removes an event listener added to this table.
2004
- * @param name -
2005
- * @param callback -
2006
- * @return
2007
- * @typeParam T -
1898
+ * Creates a new copy of this table, so it can be sorted and filtered separately, and maintain a different viewport.
1899
+ * @return Promise of dh.Table
2008
1900
  */
2009
- removeEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):boolean;
2010
- }
2011
-
2012
- /**
2013
- * Addition optional configuration that can be passed to the {@link dh.CoreClient} constructor.
2014
- */
2015
- export class ConnectOptions {
1901
+ copy():Promise<Table>;
1902
+ /**
1903
+ * a promise that will resolve to a Totals Table of this table. This table will obey the configurations provided as
1904
+ * a parameter, or will use the table's default if no parameter is provided, and be updated once per second as
1905
+ * necessary. Note that multiple calls to this method will each produce a new TotalsTable which must have close()
1906
+ * called on it when not in use.
1907
+ * @param config -
1908
+ * @return Promise of dh.TotalsTable
1909
+ */
1910
+ getTotalsTable(config?:TotalsTableConfig|undefined|null):Promise<TotalsTable>;
1911
+ /**
1912
+ * a promise that will resolve to a Totals Table of this table, ignoring any filters. See <b>getTotalsTable()</b>
1913
+ * above for more specifics.
1914
+ * @param config -
1915
+ * @return promise of dh.TotalsTable
1916
+ */
1917
+ getGrandTotalsTable(config?:TotalsTableConfig|undefined|null):Promise<TotalsTable>;
1918
+ /**
1919
+ * a promise that will resolve to a new roll-up <b>TreeTable</b> of this table. Multiple calls to this method will
1920
+ * each produce a new <b>TreeTable</b> which must have close() called on it when not in use.
1921
+ * @param configObject -
1922
+ * @return Promise of dh.TreeTable
1923
+ */
1924
+ rollup(configObject:RollupConfig):Promise<TreeTable>;
1925
+ /**
1926
+ * a promise that will resolve to a new `TreeTable` of this table. Multiple calls to this method will each produce a
1927
+ * new `TreeTable` which must have close() called on it when not in use.
1928
+ * @param configObject -
1929
+ * @return Promise dh.TreeTable
1930
+ */
1931
+ treeTable(configObject:TreeTableConfig):Promise<TreeTable>;
1932
+ /**
1933
+ * a "frozen" version of this table (a server-side snapshot of the entire source table). Viewports on the frozen
1934
+ * table will not update. This does not change the original table, and the new table will not have any of the client
1935
+ * side sorts/filters/columns. New client side sorts/filters/columns can be added to the frozen copy.
1936
+ * @return Promise of dh.Table
1937
+ */
1938
+ freeze():Promise<Table>;
1939
+ snapshot(baseTable:Table, doInitialSnapshot?:boolean, stampColumns?:string[]):Promise<Table>;
2016
1940
  /**
2017
- * Optional map of http header names and values to send to the server with each request.
1941
+ *
1942
+ * @inheritDoc
1943
+ * @deprecated
2018
1944
  */
2019
- headers?:{ [key: string]: string; }|null;
1945
+ join(joinType:string, rightTable:JoinableTable, columnsToMatch:Array<string>, columnsToAdd?:Array<string>|undefined|null, asOfMatchRule?:string|undefined|null):Promise<Table>;
1946
+ asOfJoin(rightTable:JoinableTable, columnsToMatch:Array<string>, columnsToAdd?:Array<string>|undefined|null, asOfMatchRule?:string|undefined|null):Promise<Table>;
1947
+ crossJoin(rightTable:JoinableTable, columnsToMatch:Array<string>, columnsToAdd?:Array<string>|undefined|null, reserveBits?:number|undefined|null):Promise<Table>;
1948
+ exactJoin(rightTable:JoinableTable, columnsToMatch:Array<string>, columnsToAdd?:Array<string>):Promise<Table>;
1949
+ naturalJoin(rightTable:JoinableTable, columnsToMatch:Array<string>, columnsToAdd?:Array<string>):Promise<Table>;
1950
+ byExternal(keys:object, dropKeys?:boolean):Promise<PartitionedTable>;
2020
1951
  /**
2021
- * True to enable debug logging. At this time, only enables logging for gRPC calls.
1952
+ * Creates a new PartitionedTable from the contents of the current table, partitioning data based on the specified
1953
+ * keys.
1954
+ * @param keys -
1955
+ * @param dropKeys -
1956
+ * @return Promise dh.PartitionedTable
2022
1957
  */
2023
- debug?:boolean|null;
1958
+ partitionBy(keys:object, dropKeys?:boolean):Promise<PartitionedTable>;
2024
1959
  /**
2025
- * Set this to true to force the use of websockets when connecting to the deephaven instance, false to force the use
2026
- * of `fetch`. Ignored if {@link dh.transportFactory} is set.
2027
- * <p>
2028
- * Defaults to null, indicating that the server URL should be checked to see if we connect with fetch or websockets.
1960
+ * a promise that will resolve to ColumnStatistics for the column of this table.
1961
+ * @param column -
1962
+ * @return Promise of dh.ColumnStatistics
2029
1963
  */
2030
- useWebsockets?:boolean|null;
1964
+ getColumnStatistics(column:Column):Promise<ColumnStatistics>;
2031
1965
  /**
2032
- * The transport factory to use for creating gRPC streams. If specified, the JS API will ignore
2033
- * {@link dh.useWebsockets} and its own internal logic for determining the appropriate transport to use.
2034
- * <p>
2035
- * Defaults to null, indicating that the JS API should determine the appropriate transport to use. If
2036
- * `useWebsockets` is set to true, the JS API will use websockets, otherwise if the server url begins with
2037
- * https, it will use fetch, otherwise it will use websockets.
1966
+ * Seek the row matching the data provided
1967
+ * @param startingRow - Row to start the seek from
1968
+ * @param column - Column to seek for value on
1969
+ * @param valueType - Type of value provided
1970
+ * @param seekValue - Value to seek
1971
+ * @param insensitive - Optional value to flag a search as case-insensitive. Defaults to `false`.
1972
+ * @param contains - Optional value to have the seek value do a contains search instead of exact equality. Defaults to
1973
+ * `false`.
1974
+ * @param isBackwards - Optional value to seek backwards through the table instead of forwards. Defaults to `false`.
1975
+ * @return A promise that resolves to the row value found.
2038
1976
  */
2039
- transportFactory?:dh.grpc.GrpcTransportFactory|null;
2040
-
2041
- constructor();
2042
- }
2043
-
2044
- /**
2045
- * Describes the structure of the column, and if desired can be used to get access to the data to be rendered in this
2046
- * column.
2047
- */
2048
- export class Column {
1977
+ seekRow(startingRow:number, column:Column, valueType:ValueTypeType, seekValue:any, insensitive?:boolean|undefined|null, contains?:boolean|undefined|null, isBackwards?:boolean|undefined|null):Promise<number>;
1978
+ toString():string;
2049
1979
  /**
2050
- * If this column is part of a roll-up tree table, represents the type of the row data that can be found in this
2051
- * column for leaf nodes if includeConstituents is enabled. Otherwise, it is <b>null</b>.
2052
- * @return String
1980
+ * True if this table represents a user Input Table (created by InputTable.newInputTable). When true, you may call
1981
+ * .inputTable() to add or remove data from the underlying table.
1982
+ * @return boolean
2053
1983
  */
2054
- readonly constituentType?:string|null;
2055
- readonly description?:string|null;
2056
-
2057
- protected constructor();
2058
-
1984
+ get hasInputTable():boolean;
2059
1985
  /**
2060
- * the value for this column in the given row. Type will be consistent with the type of the Column.
2061
- * @param row -
2062
- * @return Any
1986
+ * The columns that are present on this table. This is always all possible columns. If you specify fewer columns in
1987
+ * .setViewport(), you will get only those columns in your ViewportData. <b>Number size</b> The total count of rows
1988
+ * in the table. The size can and will change; see the <b>sizechanged</b> event for details. Size will be negative
1989
+ * in exceptional cases (eg. the table is uncoalesced, see the <b>isUncoalesced</b> property for details).
1990
+ * @return {@link dh.Column} array
2063
1991
  */
2064
- get(row:Row):any;
2065
- getFormat(row:Row):Format;
1992
+ get columns():Array<Column>;
2066
1993
  /**
2067
- * Creates a sort builder object, to be used when sorting by this column.
2068
- * @return {@link dh.Sort}
1994
+ * The default configuration to be used when building a <b>TotalsTable</b> for this table.
1995
+ * @return dh.TotalsTableConfig
2069
1996
  */
2070
- sort():Sort;
1997
+ get totalsTableConfig():TotalsTableConfig;
2071
1998
  /**
2072
- * Creates a new value for use in filters based on this column. Used either as a parameter to another filter
2073
- * operation, or as a builder to create a filter operation.
2074
- * @return {@link dh.FilterValue}
1999
+ * An ordered list of Sorts to apply to the table. To update, call <b>applySort()</b>. Note that this getter will
2000
+ * return the new value immediately, even though it may take a little time to update on the server. You may listen
2001
+ * for the <b>sortchanged</b> event to know when to update the UI.
2002
+ * @return {@link dh.Sort} array
2075
2003
  */
2076
- filter():FilterValue;
2004
+ get sort():Array<Sort>;
2077
2005
  /**
2078
- * a <b>CustomColumn</b> object to apply using `applyCustomColumns` with the expression specified.
2079
- * @param expression -
2080
- * @return {@link dh.CustomColumn}
2006
+ * An ordered list of custom column formulas to add to the table, either adding new columns or replacing existing
2007
+ * ones. To update, call <b>applyCustomColumns()</b>.
2008
+ * @return {@link dh.CustomColumn} array
2081
2009
  */
2082
- formatColor(expression:string, options?:CustomColumnOptions|undefined|null):CustomColumn;
2010
+ get customColumns():Array<CustomColumn>;
2083
2011
  /**
2084
- * a <b>CustomColumn</b> object to apply using <b>applyCustomColumns</b> with the expression specified.
2085
- * @param expression -
2086
- * @return {@link dh.CustomColumn}
2012
+ * True if this table may receive updates from the server, including size changed events, updated events after
2013
+ * initial snapshot.
2014
+ * @return boolean
2087
2015
  */
2088
- formatNumber(expression:string, options?:CustomColumnOptions|undefined|null):CustomColumn;
2016
+ get isRefreshing():boolean;
2089
2017
  /**
2090
- * a <b>CustomColumn</b> object to apply using <b>applyCustomColumns</b> with the expression specified.
2091
- * @param expression -
2092
- * @return {@link dh.CustomColumn}
2018
+ * An ordered list of Filters to apply to the table. To update, call applyFilter(). Note that this getter will
2019
+ * return the new value immediately, even though it may take a little time to update on the server. You may listen
2020
+ * for the <b>filterchanged</b> event to know when to update the UI.
2021
+ * @return {@link dh.FilterCondition} array
2093
2022
  */
2094
- formatDate(expression:string, options?:CustomColumnOptions|undefined|null):CustomColumn;
2095
- toString():string;
2023
+ get filter():Array<FilterCondition>;
2096
2024
  /**
2097
- * Label for this column.
2098
- * @return String
2025
+ * The total count of the rows in the table, excluding any filters. Unlike {@link Table.size}, changes to this value
2026
+ * will not result in any event. If the table is unfiltered, this will return the same size as {@link Table.size}.
2027
+ * If this table was uncoalesced before it was filtered, this will return {@link dh.Table.SIZE_UNCOALESCED}.
2028
+ * @return the size of the table before filters, or {@link dh.Table.SIZE_UNCOALESCED}
2099
2029
  */
2100
- get name():string;
2030
+ get totalSize():number;
2101
2031
  /**
2102
- * True if this column is a partition column. Partition columns are used for filtering uncoalesced tables - see
2103
- * {@link Table.uncoalesced}.
2104
- * @return true if the column is a partition column
2032
+ * The total count of rows in the table. If there is a viewport subscription active, this size will be updated when
2033
+ * the subscription updates. If not, and {@link Table.uncoalesced} is true, the size will be
2034
+ * {@link dh.Table.SIZE_UNCOALESCED}. Otherwise, the size will be updated when the server's update graph processes changes.
2035
+ * <p>
2036
+ * When the size changes, the {@link dh.Table.EVENT_SIZECHANGED} event will be fired.
2037
+ * @return the size of the table, or {@link dh.Table.SIZE_UNCOALESCED} if there is no subscription and the table is
2038
+ * uncoalesced.
2105
2039
  */
2106
- get isPartitionColumn():boolean;
2040
+ get size():number;
2107
2041
  /**
2108
- *
2109
- * @deprecated do not use. Internal index of the column in the table, to be used as a key on the Row.
2110
- * @return int
2042
+ * True if this table has been closed.
2043
+ * @return boolean
2111
2044
  */
2112
- get index():number;
2113
- get isSortable():boolean;
2045
+ get isClosed():boolean;
2114
2046
  /**
2115
- * Type of the row data that can be found in this column.
2116
- * @return String
2047
+ * Read-only. True if this table is uncoalesced, indicating that work must be done before the table can be used.
2048
+ * <p>
2049
+ * Uncoalesced tables are expensive to operate on - filter to a single partition or range of partitions before
2050
+ * subscribing to access only the desired data efficiently. A subscription can be specified without a filter, but
2051
+ * this can be very expensive. To see which partitions are available, check each column on the table to see which
2052
+ * have {@link Column.isPartitionColumn} as `true`, and filter those columns. To read the possible values
2053
+ * for those columns, use {@link Table.selectDistinct}.
2054
+ * @return True if the table is uncoaleced and should be filtered before operating on it, otherwise false.
2117
2055
  */
2118
- get type():string;
2056
+ get isUncoalesced():boolean;
2119
2057
  /**
2120
- * Format entire rows colors using the expression specified. Returns a <b>CustomColumn</b> object to apply to a
2121
- * table using <b>applyCustomColumns</b> with the parameters specified.
2122
- * @param expression -
2123
- * @param options -
2124
- * @return {@link dh.CustomColumn}
2058
+ * Listen for events on this object.
2059
+ * @param name - the name of the event to listen for
2060
+ * @param callback - a function to call when the event occurs
2061
+ * @return Returns a cleanup function.
2062
+ * @typeParam T - the type of the data that the event will provide
2125
2063
  */
2126
- static formatRowColor(expression:string, options?:CustomColumnOptions|undefined|null):CustomColumn;
2064
+ addEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):()=>void;
2065
+ nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<Event<T>>;
2066
+ hasListeners(name:string):boolean;
2127
2067
  /**
2128
- * a <b>CustomColumn</b> object to apply using <b>applyCustomColumns</b> with the expression specified.
2068
+ * Removes an event listener added to this table.
2129
2069
  * @param name -
2130
- * @param expression -
2131
- * @param options -
2132
- * @return {@link dh.CustomColumn}
2070
+ * @param callback -
2071
+ * @return
2072
+ * @typeParam T -
2133
2073
  */
2134
- static createCustomColumn(name:string, expression:string, options?:CustomColumnOptions|undefined|null):CustomColumn;
2074
+ removeEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):boolean;
2075
+ /**
2076
+ * a Sort than can be used to reverse a table. This can be passed into n array in applySort. Note that Tree Tables
2077
+ * do not support reverse.
2078
+ * @return {@link dh.Sort}
2079
+ */
2080
+ static reverse():Sort;
2135
2081
  }
2136
2082
 
2137
2083
  export class IdeSession implements HasEventHandling {
@@ -2226,351 +2172,348 @@ export namespace dh {
2226
2172
  * @param startTime -
2227
2173
  * @return {@link Promise} of {@link dh.Table}
2228
2174
  */
2229
- timeTable(periodNanos:number, startTime?:DateWrapper):Promise<Table>;
2175
+ timeTable(periodNanos:number, startTime?:DateWrapper):Promise<Table>;
2176
+ addEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):()=>void;
2177
+ nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<Event<T>>;
2178
+ hasListeners(name:string):boolean;
2179
+ removeEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):boolean;
2180
+ }
2181
+
2182
+ /**
2183
+ * Configuration object for running Table.treeTable to produce a hierarchical view of a given "flat" table.
2184
+ *
2185
+ * Like TotalsTableConfig, `TreeTableConfig` supports an operation map indicating how to aggregate the data, as well as
2186
+ * an array of column names which will be the layers in the roll-up tree, grouped at each level. An additional optional
2187
+ * value can be provided describing the strategy the engine should use when grouping the rows.
2188
+ */
2189
+ export class TreeTableConfig {
2190
+ /**
2191
+ * The column representing the unique ID for each item
2192
+ */
2193
+ idColumn:string;
2194
+ /**
2195
+ * The column representing the parent ID for each item
2196
+ */
2197
+ parentColumn:string;
2198
+ /**
2199
+ * Optional parameter indicating if items with an invalid parent ID should be promoted to root. Defaults to false.
2200
+ */
2201
+ promoteOrphansToRoot:boolean;
2202
+
2203
+ constructor();
2204
+ }
2205
+
2206
+ /**
2207
+ * This object serves as a "handle" to a subscription, allowing it to be acted on directly or canceled outright. If you
2208
+ * retain an instance of this, you have two choices - either only use it to call `close()` on it to stop the table's
2209
+ * viewport without creating a new one, or listen directly to this object instead of the table for data events, and
2210
+ * always call `close()` when finished. Calling any method on this object other than close() will result in it
2211
+ * continuing to live on after `setViewport` is called on the original table, or after the table is modified.
2212
+ */
2213
+ export class TableViewportSubscription implements HasEventHandling {
2214
+ protected constructor();
2215
+
2216
+ /**
2217
+ * Changes the rows and columns set on this viewport. This cannot be used to change the update interval.
2218
+ * @param firstRow -
2219
+ * @param lastRow -
2220
+ * @param columns -
2221
+ * @param updateIntervalMs -
2222
+ */
2223
+ setViewport(firstRow:number, lastRow:number, columns?:Column[]|undefined|null, updateIntervalMs?:number|undefined|null, isReverseViewport?:boolean|undefined|null):void;
2224
+ /**
2225
+ * Stops this viewport from running, stopping all events on itself and on the table that created it.
2226
+ */
2227
+ close():void;
2228
+ /**
2229
+ * Gets the data currently visible in this viewport
2230
+ * @return Promise of {@link dh.TableData}.
2231
+ */
2232
+ getViewportData():Promise<ViewportData>;
2233
+ snapshot(rows:RangeSet, columns:Column[]):Promise<TableData>;
2234
+ /**
2235
+ * Listen for events on this object.
2236
+ * @param name - the name of the event to listen for
2237
+ * @param callback - a function to call when the event occurs
2238
+ * @return Returns a cleanup function.
2239
+ * @typeParam T - the type of the data that the event will provide
2240
+ */
2230
2241
  addEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):()=>void;
2231
2242
  nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<Event<T>>;
2232
2243
  hasListeners(name:string):boolean;
2244
+ /**
2245
+ * Removes an event listener added to this table.
2246
+ * @param name -
2247
+ * @param callback -
2248
+ * @return
2249
+ * @typeParam T -
2250
+ */
2233
2251
  removeEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):boolean;
2234
2252
  }
2235
2253
 
2236
- export class QueryInfo {
2237
- static readonly EVENT_TABLE_OPENED:string;
2238
- static readonly EVENT_DISCONNECT:string;
2239
- static readonly EVENT_RECONNECT:string;
2240
- static readonly EVENT_CONNECT:string;
2241
-
2242
- protected constructor();
2243
- }
2244
-
2245
- /**
2246
- * Event fired when a command is issued from the client.
2247
- */
2248
- export class CommandInfo {
2249
- constructor(code:string, result:Promise<dh.ide.CommandResult>);
2250
-
2251
- get result():Promise<dh.ide.CommandResult>;
2252
- get code():string;
2253
- }
2254
-
2255
2254
  /**
2256
- * Describes a filter which can be applied to a table. Replacing these instances may be more expensive than reusing
2257
- * them. These instances are immutable - all operations that compose them to build bigger expressions return a new
2258
- * instance.
2255
+ * Describes how a Totals Table will be generated from its parent table. Each table has a default (which may be null)
2256
+ * indicating how that table was configured when it was declared, and each Totals Table has a similar property
2257
+ * describing how it was created. Both the <b>Table.getTotalsTable</b> and <b>Table.getGrandTotalsTable</b> methods take
2258
+ * this config as an optional parameter - without it, the table's default will be used, or if null, a default instance
2259
+ * of <b>TotalsTableConfig</b> will be supplied.
2260
+ *
2261
+ * This class has a no-arg constructor, allowing an instance to be made with the default values provided. However, any
2262
+ * JS object can be passed in to the methods which accept instances of this type, provided their values adhere to the
2263
+ * expected formats.
2259
2264
  */
2260
- export class FilterCondition {
2261
- protected constructor();
2262
-
2265
+ export class TotalsTableConfig {
2263
2266
  /**
2264
- * the opposite of this condition
2265
- * @return FilterCondition
2267
+ * @deprecated
2266
2268
  */
2267
- not():FilterCondition;
2269
+ static readonly COUNT:string;
2268
2270
  /**
2269
- * a condition representing the current condition logically ANDed with the other parameters
2270
- * @param filters -
2271
- * @return FilterCondition
2271
+ * @deprecated
2272
2272
  */
2273
- and(...filters:FilterCondition[]):FilterCondition;
2273
+ static readonly MIN:string;
2274
2274
  /**
2275
- * a condition representing the current condition logically ORed with the other parameters
2276
- * @param filters -
2277
- * @return FilterCondition.
2275
+ * @deprecated
2278
2276
  */
2279
- or(...filters:FilterCondition[]):FilterCondition;
2277
+ static readonly MAX:string;
2280
2278
  /**
2281
- * a string suitable for debugging showing the details of this condition.
2282
- * @return String.
2279
+ * @deprecated
2283
2280
  */
2284
- toString():string;
2285
- get columns():Array<Column>;
2281
+ static readonly SUM:string;
2286
2282
  /**
2287
- * a filter condition invoking a static function with the given parameters. Currently supported Deephaven static
2288
- * functions:
2289
- * <ul>
2290
- * <li><b>inRange</b>: Given three comparable values, returns true if the first is less than the second but greater
2291
- * than the third</li>
2292
- * <li><b>isInf</b>:Returns true if the given number is <i>infinity</i></li>
2293
- * <li><b>isNaN</b>:Returns true if the given number is <i>not a number</i></li>
2294
- * <li><b>isNormal</b>:Returns true if the given number <i>is not null</i>, <i>is not infinity</i>, and <i>is not
2295
- * "not a number"</i></li>
2296
- * <li><b>startsWith</b>:Returns true if the first string starts with the second string</li>
2297
- * <li><b>endsWith</b>Returns true if the first string ends with the second string</li>
2298
- * <li><b>matches</b>:Returns true if the first string argument matches the second string used as a Java regular
2299
- * expression</li>
2300
- * <li><b>contains</b>:Returns true if the first string argument contains the second string as a substring</li>
2301
- * <li><b>in</b>:Returns true if the first string argument can be found in the second array argument.
2302
- * <p>
2303
- * Note that the array can only be specified as a column reference at this time - typically the `FilterValue.in`
2304
- * method should be used in other cases
2305
- * </p>
2306
- * </li>
2307
- * </ul>
2308
- * @param function -
2309
- * @param args -
2310
- * @return dh.FilterCondition
2283
+ * @deprecated
2311
2284
  */
2312
- static invoke(func:string, ...args:FilterValue[]):FilterCondition;
2285
+ static readonly ABS_SUM:string;
2313
2286
  /**
2314
- * a filter condition which will check if the given value can be found in any supported column on whatever table
2315
- * this FilterCondition is passed to. This FilterCondition is somewhat unique in that it need not be given a column
2316
- * instance, but will adapt to any table. On numeric columns, with a value passed in which can be parsed as a
2317
- * number, the column will be filtered to numbers which equal, or can be "rounded" effectively to this number. On
2318
- * String columns, the given value will match any column which contains this string in a case-insensitive search. An
2319
- * optional second argument can be passed, an array of `FilterValue` from the columns to limit this search to (see
2320
- * {@link dh.Column.filter}).
2321
- * @param value -
2322
- * @param columns -
2323
- * @return dh.FilterCondition
2287
+ * @deprecated
2324
2288
  */
2325
- static search(value:FilterValue, columns?:FilterValue[]):FilterCondition;
2326
- }
2327
-
2328
- export class CoreClient implements HasEventHandling {
2329
- static readonly EVENT_CONNECT:string;
2330
- static readonly EVENT_DISCONNECT:string;
2331
- static readonly EVENT_RECONNECT:string;
2332
- static readonly EVENT_RECONNECT_AUTH_FAILED:string;
2333
- static readonly EVENT_REQUEST_FAILED:string;
2334
- static readonly EVENT_REQUEST_STARTED:string;
2335
- static readonly EVENT_REQUEST_SUCCEEDED:string;
2289
+ static readonly VAR:string;
2336
2290
  /**
2337
2291
  * @deprecated
2338
2292
  */
2339
- static readonly EVENT_REFRESH_TOKEN_UPDATED:string;
2340
- static readonly LOGIN_TYPE_PASSWORD:string;
2341
- static readonly LOGIN_TYPE_ANONYMOUS:string;
2342
-
2343
- constructor(serverUrl:string, connectOptions?:ConnectOptions);
2344
-
2345
- running():Promise<CoreClient>;
2346
- getServerUrl():string;
2347
- getAuthConfigValues():Promise<string[][]>;
2348
- login(credentials:LoginCredentials):Promise<void>;
2349
- relogin(token:RefreshToken):Promise<void>;
2350
- onConnected(timeoutInMillis?:number):Promise<void>;
2351
- getServerConfigValues():Promise<string[][]>;
2352
- getStorageService():dh.storage.StorageService;
2353
- getAsIdeConnection():Promise<IdeConnection>;
2354
- disconnect():void;
2355
- addEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):()=>void;
2356
- nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<Event<T>>;
2357
- hasListeners(name:string):boolean;
2358
- removeEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):boolean;
2359
- }
2360
-
2361
- export class DateWrapper extends LongWrapper {
2362
- protected constructor();
2363
-
2364
- static ofJsDate(date:Date):DateWrapper;
2365
- asDate():Date;
2366
- }
2367
-
2368
- /**
2369
- * Deprecated for use in Deephaven Core.
2370
- * @deprecated
2371
- */
2372
- export class Client {
2373
- static readonly EVENT_REQUEST_FAILED:string;
2374
- static readonly EVENT_REQUEST_STARTED:string;
2375
- static readonly EVENT_REQUEST_SUCCEEDED:string;
2376
-
2377
- constructor();
2378
- }
2379
-
2380
- /**
2381
- * Represents a set of Tables each corresponding to some key. The keys are available locally, but a call must be made to
2382
- * the server to get each Table. All tables will have the same structure.
2383
- */
2384
- export class PartitionedTable implements HasEventHandling {
2293
+ static readonly AVG:string;
2385
2294
  /**
2386
- * Indicates that a new key has been added to the array of keys, which can now be fetched with getTable.
2295
+ * @deprecated
2387
2296
  */
2388
- static readonly EVENT_KEYADDED:string;
2297
+ static readonly STD:string;
2389
2298
  /**
2390
- * Indicates that a new key has been added to the array of keys, which can now be fetched with getTable.
2299
+ * @deprecated
2391
2300
  */
2392
- static readonly EVENT_DISCONNECT:string;
2301
+ static readonly FIRST:string;
2393
2302
  /**
2394
- * Indicates that a new key has been added to the array of keys, which can now be fetched with getTable.
2303
+ * @deprecated
2395
2304
  */
2396
- static readonly EVENT_RECONNECT:string;
2305
+ static readonly LAST:string;
2397
2306
  /**
2398
- * Indicates that a new key has been added to the array of keys, which can now be fetched with getTable.
2307
+ * @deprecated
2399
2308
  */
2400
- static readonly EVENT_RECONNECTFAILED:string;
2309
+ static readonly SKIP:string;
2310
+ /**
2311
+ * Specifies if a Totals Table should be expanded by default in the UI. Defaults to false.
2312
+ */
2313
+ showTotalsByDefault:boolean;
2314
+ /**
2315
+ * Specifies if a Grand Totals Table should be expanded by default in the UI. Defaults to false.
2316
+ */
2317
+ showGrandTotalsByDefault:boolean;
2318
+ /**
2319
+ * Specifies the default operation for columns that do not have a specific operation applied; defaults to "Sum".
2320
+ */
2321
+ defaultOperation:AggregationOperationType;
2322
+ /**
2323
+ * Mapping from each column name to the aggregation(s) that should be applied to that column in the resulting Totals
2324
+ * Table. If a column is omitted, the defaultOperation is used.
2325
+ */
2326
+ operationMap:{ [key: string]: Array<AggregationOperationType>; };
2327
+ /**
2328
+ * Groupings to use when generating the Totals Table. One row will exist for each unique set of values observed in
2329
+ * these columns. See also `Table.selectDistinct`.
2330
+ */
2331
+ groupBy:Array<string>;
2401
2332
 
2333
+ constructor();
2334
+
2335
+ toString():string;
2336
+ }
2337
+
2338
+ /**
2339
+ * A js type for operating on input tables.
2340
+ *
2341
+ * Represents a User Input Table, which can have data added to it from other sources.
2342
+ *
2343
+ * You may add rows using dictionaries of key-value tuples (representing columns by name), add tables containing all the
2344
+ * key/value columns to add, or delete tables containing the keys to delete. Each operation is atomic, and will either
2345
+ * succeed completely or fail completely. To guarantee order of operations, apply an operation and wait for the response
2346
+ * before sending the next operation.
2347
+ *
2348
+ * Each table has one or more key columns, where each unique combination of keys will appear at most once in the table.
2349
+ *
2350
+ * To view the results of the Input Table, you should use standard table operations on the InputTable's source Table
2351
+ * object.
2352
+ */
2353
+ export class InputTable {
2402
2354
  protected constructor();
2403
2355
 
2404
2356
  /**
2405
- * Fetch the table with the given key. If the key does not exist, returns `null`.
2406
- * @param key - The key to fetch. An array of values for each key column, in the same order as the key columns are.
2407
- * @return Promise of dh.Table, or `null` if the key does not exist.
2357
+ * Adds a single row to the table. For each key or value column name in the Input Table, we retrieve that javascript
2358
+ * property at that name and validate it can be put into the given column type.
2359
+ * @param row -
2360
+ * @param userTimeZone -
2361
+ * @return Promise of dh.InputTable
2408
2362
  */
2409
- getTable(key:object):Promise<Table|undefined|null>;
2363
+ addRow(row:{ [key: string]: any; }, userTimeZone?:string):Promise<InputTable>;
2410
2364
  /**
2411
- * Open a new table that is the result of merging all constituent tables. See
2412
- * {@link io.deephaven.engine.table.PartitionedTable.merge} for details.
2413
- * @return A merged representation of the constituent tables.
2365
+ * Add multiple rows to a table.
2366
+ * @param rows -
2367
+ * @param userTimeZone -
2368
+ * @return Promise of dh.InputTable
2414
2369
  */
2415
- getMergedTable():Promise<Table>;
2370
+ addRows(rows:{ [key: string]: any; }[], userTimeZone?:string):Promise<InputTable>;
2416
2371
  /**
2417
- * The set of all currently known keys. This is kept up to date, so getting the list after adding an event listener
2418
- * for <b>keyadded</b> will ensure no keys are missed.
2419
- * @return Set of Object
2372
+ * Add an entire table to this Input Table. Only column names that match the definition of the input table will be
2373
+ * copied, and all key columns must have values filled in. This only copies the current state of the source table;
2374
+ * future updates to the source table will not be reflected in the Input Table. The returned promise will be
2375
+ * resolved to the same InputTable instance this method was called upon once the server returns.
2376
+ * @param tableToAdd -
2377
+ * @return Promise of dh.InputTable
2420
2378
  */
2421
- getKeys():Set<object>;
2379
+ addTable(tableToAdd:Table):Promise<InputTable>;
2422
2380
  /**
2423
- * Fetch a table containing all the valid keys of the partitioned table.
2424
- * @return Promise of a Table
2425
- * @deprecated
2381
+ * Add multiple tables to this Input Table.
2382
+ * @param tablesToAdd -
2383
+ * @return Promise of dh.InputTable
2426
2384
  */
2427
- getKeyTable():Promise<Table>;
2385
+ addTables(tablesToAdd:Table[]):Promise<InputTable>;
2428
2386
  /**
2429
- * Fetch the underlying base table of the partitioned table.
2430
- * @return Promise of a Table
2387
+ * Deletes an entire table from this Input Table. Key columns must match the Input Table.
2388
+ * @param tableToDelete -
2389
+ * @return Promise of dh.InputTable
2431
2390
  */
2432
- getBaseTable():Promise<Table>;
2391
+ deleteTable(tableToDelete:Table):Promise<InputTable>;
2433
2392
  /**
2434
- * Indicates that this PartitionedTable will no longer be used, removing subcriptions to updated keys, etc. This
2435
- * will not affect tables in use.
2393
+ * Delete multiple tables from this Input Table.
2394
+ * @param tablesToDelete -
2395
+ * @return
2436
2396
  */
2437
- close():void;
2397
+ deleteTables(tablesToDelete:Table[]):Promise<InputTable>;
2438
2398
  /**
2439
- * The count of known keys.
2440
- * @return int
2399
+ * A list of the key columns, by name
2400
+ * @return String array.
2441
2401
  */
2442
- get size():number;
2402
+ get keys():string[];
2443
2403
  /**
2444
- * An array of the columns in the tables that can be retrieved from this partitioned table, including both key and
2445
- * non-key columns.
2446
- * @return Array of Column
2404
+ * A list of the value columns, by name
2405
+ * @return String array.
2447
2406
  */
2448
- get columns():Column[];
2407
+ get values():string[];
2449
2408
  /**
2450
- * An array of all the key columns that the tables are partitioned by.
2451
- * @return Array of Column
2409
+ * A list of the key columns.
2410
+ * @return Column array.
2452
2411
  */
2453
2412
  get keyColumns():Column[];
2454
2413
  /**
2455
- * Listen for events on this object.
2456
- * @param name - the name of the event to listen for
2457
- * @param callback - a function to call when the event occurs
2458
- * @return Returns a cleanup function.
2459
- * @typeParam T - the type of the data that the event will provide
2414
+ * A list of the value Column objects
2415
+ * @return {@link dh.Column} array.
2460
2416
  */
2461
- addEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):()=>void;
2462
- nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<Event<T>>;
2463
- hasListeners(name:string):boolean;
2417
+ get valueColumns():Column[];
2464
2418
  /**
2465
- * Removes an event listener added to this table.
2466
- * @param name -
2467
- * @param callback -
2468
- * @return
2469
- * @typeParam T -
2419
+ * The source table for this Input Table
2420
+ * @return dh.table
2470
2421
  */
2471
- removeEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):boolean;
2422
+ get table():Table;
2472
2423
  }
2473
2424
 
2474
2425
  /**
2475
- * This class allows iteration over non-contiguous indexes. In the future, this will support the EcmaScript 2015
2476
- * Iteration protocol, but for now has one method which returns an iterator, and also supports querying the size.
2477
- * Additionally, we may add support for creating RangeSet objects to better serve some use cases.
2426
+ * Wrap BigInteger values for use in JS. Provides text formatting for display and access to the underlying value.
2478
2427
  */
2479
- export class RangeSet {
2428
+ export class BigIntegerWrapper {
2480
2429
  protected constructor();
2481
2430
 
2482
- static ofRange(first:number, last:number):RangeSet;
2483
- static ofItems(rows:number[]):RangeSet;
2484
- static ofRanges(ranges:RangeSet[]):RangeSet;
2485
- static ofSortedRanges(ranges:RangeSet[]):RangeSet;
2486
- /**
2487
- * a new iterator over all indexes in this collection.
2488
- * @return Iterator of {@link dh.LongWrapper}
2489
- */
2490
- iterator():Iterator<LongWrapper>;
2491
- /**
2492
- * The total count of items contained in this collection. In some cases this can be expensive to compute, and
2493
- * generally should not be needed except for debugging purposes, or preallocating space (i.e., do not call this
2494
- * property each time through a loop).
2495
- * @return double
2496
- */
2497
- get size():number;
2431
+ static ofString(str:string):BigIntegerWrapper;
2432
+ asNumber():number;
2433
+ valueOf():string;
2434
+ toString():string;
2435
+ equals(o:object):boolean;
2436
+ hashCode():number;
2498
2437
  }
2499
2438
 
2500
- export class CustomColumn {
2501
- static readonly TYPE_FORMAT_COLOR:string;
2502
- static readonly TYPE_FORMAT_NUMBER:string;
2503
- static readonly TYPE_FORMAT_DATE:string;
2504
- static readonly TYPE_NEW:string;
2439
+ /**
2440
+ * Presently, this is the entrypoint into the Deephaven JS API. By creating an instance of this with the server URL and
2441
+ * some options, JS applications can run code on the server, and interact with available exportable objects.
2442
+ */
2443
+ export class IdeConnection implements HasEventHandling {
2444
+ /**
2445
+ * @deprecated
2446
+ */
2447
+ static readonly HACK_CONNECTION_FAILURE:string;
2448
+ static readonly EVENT_DISCONNECT:string;
2449
+ static readonly EVENT_RECONNECT:string;
2450
+ static readonly EVENT_SHUTDOWN:string;
2505
2451
 
2506
2452
  protected constructor();
2507
2453
 
2508
- valueOf():string;
2509
- toString():string;
2510
- static from(columnInfo:string):CustomColumn;
2511
2454
  /**
2512
- * The expression to evaluate this custom column.
2513
- * @return String
2455
+ * Closes the current connection, releasing any resources on the server or client.
2514
2456
  */
2515
- get expression():string;
2457
+ close():void;
2458
+ running():Promise<IdeConnection>;
2516
2459
  /**
2517
- * The name of the column to use.
2518
- * @return String
2460
+ * Load the named table, with columns and size information already fully populated.
2461
+ * @param name - the name of the table to fetch
2462
+ * @param applyPreviewColumns - false to disable previews, defaults to true
2463
+ * @return a {@link Promise} that will resolve to the table, or reject with an error if it cannot be loaded.
2464
+ * @deprecated Added to resolve a specific issue, in the future preview will be applied as part of the subscription.
2519
2465
  */
2520
- get name():string;
2466
+ getTable(name:string, applyPreviewColumns?:boolean):Promise<Table>;
2467
+ getObject(definitionObject:dh.ide.VariableDescriptor):Promise<any>;
2468
+ subscribeToFieldUpdates(callback:(arg0:dh.ide.VariableChanges)=>void):()=>void;
2521
2469
  /**
2522
- * The options for this custom column.
2523
- * @return CustomColumOptions
2470
+ * Makes an `object` available to another user or another client on this same server which knows the value of
2471
+ * the `sharedTicketBytes`. Use that sharedTicketBytes value like a one-time use password - any other client
2472
+ * which knows this value can read the same object.
2473
+ * <p>
2474
+ * Shared objects will remain available using the sharedTicketBytes until the client that first shared them
2475
+ * releases/closes their copy of the object. Whatever side-channel is used to share the bytes, be sure to wait until
2476
+ * the remote end has signaled that it has successfully fetched the object before releasing it from this client.
2477
+ * <p>
2478
+ * Be sure to use an unpredictable value for the shared ticket bytes, like a UUID or other large, random value to
2479
+ * prevent access by unauthorized clients.
2480
+ * @param object - the object to share with another client/user
2481
+ * @param sharedTicketBytes - the value which another client/user must know to obtain the object. It may be a unicode
2482
+ * string (will be encoded as utf8 bytes), or a {@link Uint8Array} value.
2483
+ * @return A promise that will resolve to the value passed as sharedTicketBytes when the object is ready to be read
2484
+ * by another client, or will reject if an error occurs.
2524
2485
  */
2525
- get options():CustomColumnOptions;
2486
+ shareObject(object:Table|Widget|WidgetExportedObject|PartitionedTable|TotalsTable|TreeTable, sharedTicketBytes:string|Uint8Array):Promise<string|Uint8Array>;
2526
2487
  /**
2527
- * Type of custom column. One of
2528
- *
2529
- * <ul>
2530
- * <li>FORMAT_COLOR</li>
2531
- * <li>FORMAT_NUMBER</li>
2532
- * <li>FORMAT_DATE</li>
2533
- * <li>NEW</li>
2534
- * </ul>
2535
- * @return String
2488
+ * Reads an object shared by another client to this server with the `sharedTicketBytes`. Until the other
2489
+ * client releases this object (or their session ends), the object will be available on the server.
2490
+ * <p>
2491
+ * The type of the object must be passed so that the object can be read from the server correct - the other client
2492
+ * should provide this information.
2493
+ * @param sharedTicketBytes - the value provided by another client/user to obtain the object. It may be a unicode
2494
+ * string (will be encoded as utf8 bytes), or a {@link Uint8Array} value.
2495
+ * @param type - The type of the object, so it can be correctly read from the server
2496
+ * @return A promise that will resolve to the shared object, or will reject with an error if it cannot be read.
2536
2497
  */
2537
- get type():string;
2538
- }
2539
-
2540
- export class LoginCredentials {
2541
- type?:string|null;
2542
- username?:string|null;
2543
- token?:string|null;
2544
-
2545
- constructor();
2546
- }
2547
-
2548
- /**
2549
- * Represents a non-viewport subscription to a table, and all data currently known to be present in the subscribed
2550
- * columns. This class handles incoming snapshots and deltas, and fires events to consumers to notify of data changes.
2551
- *
2552
- * Unlike {@link dh.TableViewportSubscription}, the "original" table does not have a reference to this instance, only the
2553
- * "private" table instance does, since the original cannot modify the subscription, and the private instance must
2554
- * forward data to it.
2555
- *
2556
- * Represents a subscription to the table on the server. Changes made to the table will not be reflected here - the
2557
- * subscription must be closed and a new one optioned to see those changes. The event model is slightly different from
2558
- * viewports to make it less expensive to compute for large tables.
2559
- */
2560
- export class TableSubscription implements HasEventHandling {
2561
- protected constructor();
2562
-
2498
+ getSharedObject(sharedTicketBytes:string|Uint8Array, type:string):Promise<any>;
2499
+ newTable(columnNames:string[], types:string[], data:string[][], userTimeZone:string):Promise<Table>;
2563
2500
  /**
2564
- * Updates the subscription to use the given columns and update interval.
2565
- * @param columns - the new columns to subscribe to
2566
- * @param updateIntervalMs - the new update interval, or null/omit to use the default of one second
2501
+ * Merges the given tables into a single table. Assumes all tables have the same structure.
2502
+ * @param tables -
2503
+ * @return {@link Promise} of {@link dh.Table}
2567
2504
  */
2568
- changeSubscription(columns:Array<Column>, updateIntervalMs:number|undefined|null):void;
2569
- get columns():Array<Column>;
2505
+ mergeTables(tables:Table[]):Promise<Table>;
2570
2506
  /**
2571
- * Stops the subscription on the server.
2507
+ * Register a callback function to handle any log messages that are emitted on the server. Returns a function ,
2508
+ * which can be invoked to remove this log handler. Any log handler registered in this way will receive as many old
2509
+ * log messages as are presently available.
2510
+ * @param callback -
2511
+ * @return {@link io.deephaven.web.shared.fu.JsRunnable}
2572
2512
  */
2573
- close():void;
2513
+ onLogMessage(callback:(arg0:dh.ide.LogItem)=>void):()=>void;
2514
+ startSession(type:string):Promise<IdeSession>;
2515
+ getConsoleTypes():Promise<Array<string>>;
2516
+ getWorkerHeapInfo():Promise<WorkerHeapInfo>;
2574
2517
  /**
2575
2518
  * Listen for events on this object.
2576
2519
  * @param name - the name of the event to listen for
@@ -2591,30 +2534,64 @@ export namespace dh {
2591
2534
  removeEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):boolean;
2592
2535
  }
2593
2536
 
2537
+ /**
2538
+ * Describes a Sort present on the table. No visible constructor, created through the use of Column.sort(), will be tied
2539
+ * to that particular column data. Sort instances are immutable, and use a builder pattern to make modifications. All
2540
+ * methods return a new Sort instance.
2541
+ */
2542
+ export class Sort {
2543
+ static readonly ASCENDING:string;
2544
+ static readonly DESCENDING:string;
2545
+ static readonly REVERSE:string;
2594
2546
 
2595
- type SearchDisplayModeType = string;
2596
- export class SearchDisplayMode {
2597
- static readonly SEARCH_DISPLAY_DEFAULT:SearchDisplayModeType;
2598
- static readonly SEARCH_DISPLAY_HIDE:SearchDisplayModeType;
2599
- static readonly SEARCH_DISPLAY_SHOW:SearchDisplayModeType;
2547
+ protected constructor();
2548
+
2549
+ /**
2550
+ * Builds a Sort instance to sort values in ascending order.
2551
+ * @return {@link dh.Sort}
2552
+ */
2553
+ asc():Sort;
2554
+ /**
2555
+ * Builds a Sort instance to sort values in descending order.
2556
+ * @return {@link dh.Sort}
2557
+ */
2558
+ desc():Sort;
2559
+ /**
2560
+ * Builds a Sort instance which takes the absolute value before applying order.
2561
+ * @return {@link dh.Sort}
2562
+ */
2563
+ abs():Sort;
2564
+ toString():string;
2565
+ /**
2566
+ * True if the absolute value of the column should be used when sorting; defaults to false.
2567
+ * @return boolean
2568
+ */
2569
+ get isAbs():boolean;
2570
+ /**
2571
+ * The column which is sorted.
2572
+ * @return {@link dh.Column}
2573
+ */
2574
+ get column():Column;
2575
+ /**
2576
+ * The direction of this sort, either <b>ASC</b>, <b>DESC</b>, or <b>REVERSE</b>.
2577
+ * @return String
2578
+ */
2579
+ get direction():string;
2600
2580
  }
2601
2581
 
2602
2582
  /**
2603
- * A set of string constants that can be used to describe the different objects the JS API can export.
2583
+ * Deprecated for use in Deephaven Core.
2584
+ * @deprecated
2604
2585
  */
2605
- type VariableTypeType = string;
2606
- export class VariableType {
2607
- static readonly TABLE:VariableTypeType;
2608
- static readonly TREETABLE:VariableTypeType;
2609
- static readonly HIERARCHICALTABLE:VariableTypeType;
2610
- static readonly TABLEMAP:VariableTypeType;
2611
- static readonly PARTITIONEDTABLE:VariableTypeType;
2612
- static readonly FIGURE:VariableTypeType;
2613
- static readonly OTHERWIDGET:VariableTypeType;
2614
- static readonly PANDAS:VariableTypeType;
2615
- static readonly TREEMAP:VariableTypeType;
2586
+ export class Client {
2587
+ static readonly EVENT_REQUEST_FAILED:string;
2588
+ static readonly EVENT_REQUEST_STARTED:string;
2589
+ static readonly EVENT_REQUEST_SUCCEEDED:string;
2590
+
2591
+ constructor();
2616
2592
  }
2617
2593
 
2594
+
2618
2595
  /**
2619
2596
  * This enum describes the name of each supported operation/aggregation type when creating a `TreeTable`.
2620
2597
  */
@@ -2637,14 +2614,11 @@ export namespace dh {
2637
2614
  static readonly SKIP:AggregationOperationType;
2638
2615
  }
2639
2616
 
2640
- type ValueTypeType = string;
2641
- export class ValueType {
2642
- static readonly STRING:ValueTypeType;
2643
- static readonly NUMBER:ValueTypeType;
2644
- static readonly DOUBLE:ValueTypeType;
2645
- static readonly LONG:ValueTypeType;
2646
- static readonly DATETIME:ValueTypeType;
2647
- static readonly BOOLEAN:ValueTypeType;
2617
+ type SearchDisplayModeType = string;
2618
+ export class SearchDisplayMode {
2619
+ static readonly SEARCH_DISPLAY_DEFAULT:SearchDisplayModeType;
2620
+ static readonly SEARCH_DISPLAY_HIDE:SearchDisplayModeType;
2621
+ static readonly SEARCH_DISPLAY_SHOW:SearchDisplayModeType;
2648
2622
  }
2649
2623
 
2650
2624
  /**
@@ -2656,6 +2630,32 @@ export namespace dh {
2656
2630
  static readonly ROLLUP_NODE_TYPE_CONSTITUENT:RollupNodeTypeType;
2657
2631
  }
2658
2632
 
2633
+ /**
2634
+ * A set of string constants that can be used to describe the different objects the JS API can export.
2635
+ */
2636
+ type VariableTypeType = string;
2637
+ export class VariableType {
2638
+ static readonly TABLE:VariableTypeType;
2639
+ static readonly TREETABLE:VariableTypeType;
2640
+ static readonly HIERARCHICALTABLE:VariableTypeType;
2641
+ static readonly TABLEMAP:VariableTypeType;
2642
+ static readonly PARTITIONEDTABLE:VariableTypeType;
2643
+ static readonly FIGURE:VariableTypeType;
2644
+ static readonly OTHERWIDGET:VariableTypeType;
2645
+ static readonly PANDAS:VariableTypeType;
2646
+ static readonly TREEMAP:VariableTypeType;
2647
+ }
2648
+
2649
+ type ValueTypeType = string;
2650
+ export class ValueType {
2651
+ static readonly STRING:ValueTypeType;
2652
+ static readonly NUMBER:ValueTypeType;
2653
+ static readonly DOUBLE:ValueTypeType;
2654
+ static readonly LONG:ValueTypeType;
2655
+ static readonly DATETIME:ValueTypeType;
2656
+ static readonly BOOLEAN:ValueTypeType;
2657
+ }
2658
+
2659
2659
  }
2660
2660
 
2661
2661
  export namespace dh.ide {
@@ -2702,6 +2702,29 @@ export namespace dh.ide {
2702
2702
  get applicationName():string;
2703
2703
  }
2704
2704
  /**
2705
+ * Specifies a type and either id or name (but not both).
2706
+ */
2707
+ export interface VariableDescriptor {
2708
+ type:string;
2709
+ id?:string|null;
2710
+ name?:string|null;
2711
+ }
2712
+ /**
2713
+ * Indicates the result of code run on the server.
2714
+ */
2715
+ export interface CommandResult {
2716
+ /**
2717
+ * Describes changes made in the course of this command.
2718
+ * @return {@link dh.ide.VariableChanges}.
2719
+ */
2720
+ get changes():VariableChanges;
2721
+ /**
2722
+ * If the command failed, the error message will be provided here.
2723
+ * @return String
2724
+ */
2725
+ get error():string;
2726
+ }
2727
+ /**
2705
2728
  * Describes changes in the current set of variables in the script session. Note that variables that changed value
2706
2729
  * without changing type will be included as <b>updated</b>, but if a new value with one type replaces an old value with
2707
2730
  * a different type, this will be included as an entry in both <b>removed</b> and <b>created</b> to indicate the old and
@@ -2746,29 +2769,6 @@ export namespace dh.ide {
2746
2769
  */
2747
2770
  get message():string;
2748
2771
  }
2749
- /**
2750
- * Indicates the result of code run on the server.
2751
- */
2752
- export interface CommandResult {
2753
- /**
2754
- * Describes changes made in the course of this command.
2755
- * @return {@link dh.ide.VariableChanges}.
2756
- */
2757
- get changes():VariableChanges;
2758
- /**
2759
- * If the command failed, the error message will be provided here.
2760
- * @return String
2761
- */
2762
- get error():string;
2763
- }
2764
- /**
2765
- * Specifies a type and either id or name (but not both).
2766
- */
2767
- export interface VariableDescriptor {
2768
- type:string;
2769
- id?:string|null;
2770
- name?:string|null;
2771
- }
2772
2772
  }
2773
2773
 
2774
2774
  export namespace dh.i18n {
@@ -3040,33 +3040,6 @@ export namespace dh.i18n {
3040
3040
 
3041
3041
  export namespace dh.grpc {
3042
3042
 
3043
- /**
3044
- * Options for creating a gRPC stream transport instance.
3045
- */
3046
- export interface GrpcTransportOptions {
3047
- /**
3048
- * The gRPC method URL.
3049
- */
3050
- url:URL;
3051
- /**
3052
- * True to enable debug logging for this stream.
3053
- */
3054
- debug:boolean;
3055
- /**
3056
- * Callback for when headers and status are received. The headers are a map of header names to values, and the
3057
- * status is the HTTP status code. If the connection could not be made, the status should be 0.
3058
- */
3059
- onHeaders:(headers:{ [key: string]: string|Array<string>; },status:number)=>void;
3060
- /**
3061
- * Callback for when a chunk of data is received.
3062
- */
3063
- onChunk:(chunk:Uint8Array)=>void;
3064
- /**
3065
- * Callback for when the stream ends, with an error instance if it can be provided. Note that the present
3066
- * implementation does not consume errors, even if provided.
3067
- */
3068
- onEnd:(error?:Error|undefined|null)=>void;
3069
- }
3070
3043
  /**
3071
3044
  * Factory for creating gRPC transports.
3072
3045
  */
@@ -3110,48 +3083,105 @@ export namespace dh.grpc {
3110
3083
  */
3111
3084
  cancel():void;
3112
3085
  }
3086
+ /**
3087
+ * Options for creating a gRPC stream transport instance.
3088
+ */
3089
+ export interface GrpcTransportOptions {
3090
+ /**
3091
+ * The gRPC method URL.
3092
+ */
3093
+ url:URL;
3094
+ /**
3095
+ * True to enable debug logging for this stream.
3096
+ */
3097
+ debug:boolean;
3098
+ /**
3099
+ * Callback for when headers and status are received. The headers are a map of header names to values, and the
3100
+ * status is the HTTP status code. If the connection could not be made, the status should be 0.
3101
+ */
3102
+ onHeaders:(headers:{ [key: string]: string|Array<string>; },status:number)=>void;
3103
+ /**
3104
+ * Callback for when a chunk of data is received.
3105
+ */
3106
+ onChunk:(chunk:Uint8Array)=>void;
3107
+ /**
3108
+ * Callback for when the stream ends, with an error instance if it can be provided. Note that the present
3109
+ * implementation does not consume errors, even if provided.
3110
+ */
3111
+ onEnd:(error?:Error|undefined|null)=>void;
3112
+ }
3113
3113
  }
3114
3114
 
3115
3115
  export namespace dh.plot {
3116
3116
 
3117
3117
  /**
3118
- * Describes how to access and display data required within a series.
3118
+ * Describes a template that will be used to make new series instances when a new table added to a plotBy.
3119
3119
  */
3120
- export interface SeriesDataSource {
3120
+ export interface MultiSeries {
3121
3121
  /**
3122
- * the type of data stored in the underlying table's Column.
3122
+ * The name for this multi-series.
3123
3123
  * @return String
3124
3124
  */
3125
- get columnType():string;
3126
- /**
3127
- * the axis that this source should be drawn on.
3128
- * @return dh.plot.Axis
3129
- */
3130
- get axis():Axis;
3125
+ get name():string;
3131
3126
  /**
3132
- * the feature of this series represented by this source. See the <b>SourceType</b> enum for more details.
3127
+ * The plotting style to use for the series that will be created. See <b>SeriesPlotStyle</b> enum for more details.
3133
3128
  * @return int
3134
3129
  */
3135
- get type():SourceTypeType;
3130
+ get plotStyle():SeriesPlotStyleType;
3136
3131
  }
3137
3132
  export interface FigureDataUpdatedEvent {
3138
3133
  getArray(series:Series, sourceType:number, mappingFunc?:(arg0:any)=>any):Array<any>;
3139
3134
  get series():Series[];
3140
3135
  }
3136
+ export interface OneClick {
3137
+ setValueForColumn(columnName:string, value:any):void;
3138
+ getValueForColumn(columName:string):any;
3139
+ get requireAllFiltersToDisplay():boolean;
3140
+ get columns():dh.Column[];
3141
+ }
3141
3142
  /**
3142
- * Describes a template that will be used to make new series instances when a new table added to a plotBy.
3143
+ * Provides access to the data for displaying in a figure.
3143
3144
  */
3144
- export interface MultiSeries {
3145
+ export interface Series {
3146
+ readonly isLinesVisible?:boolean|null;
3147
+ readonly pointLabelFormat?:string|null;
3148
+ readonly yToolTipPattern?:string|null;
3149
+ readonly shapeSize?:number|null;
3150
+ readonly xToolTipPattern?:string|null;
3151
+ readonly isShapesVisible?:boolean|null;
3152
+
3153
+ subscribe(forceDisableDownsample?:DownsampleOptions):void;
3145
3154
  /**
3146
- * The name for this multi-series.
3147
- * @return String
3155
+ * Disable updates for this Series.
3148
3156
  */
3149
- get name():string;
3157
+ unsubscribe():void;
3158
+ get shape():string;
3150
3159
  /**
3151
- * The plotting style to use for the series that will be created. See <b>SeriesPlotStyle</b> enum for more details.
3160
+ * Contains details on how to access data within the chart for this series. keyed with the way that this series uses
3161
+ * the axis.
3162
+ * @return {@link dh.plot.SeriesDataSource}
3163
+ */
3164
+ get sources():SeriesDataSource[];
3165
+ get lineColor():string;
3166
+ /**
3167
+ * The plotting style to use for this series. See <b>SeriesPlotStyle</b> enum for more details.
3152
3168
  * @return int
3153
3169
  */
3154
3170
  get plotStyle():SeriesPlotStyleType;
3171
+ get oneClick():OneClick;
3172
+ get gradientVisible():boolean;
3173
+ get shapeColor():string;
3174
+ /**
3175
+ * The name for this series.
3176
+ * @return String
3177
+ */
3178
+ get name():string;
3179
+ /**
3180
+ * indicates that this series belongs to a MultiSeries, null otherwise
3181
+ * @return dh.plot.MultiSeries
3182
+ */
3183
+ get multiSeries():MultiSeries;
3184
+ get shapeLabel():string;
3155
3185
  }
3156
3186
  /**
3157
3187
  * Defines one axis used with by series. These instances will be found both on the Chart and the Series instances, and
@@ -3221,72 +3251,39 @@ export namespace dh.plot {
3221
3251
  get formatType():AxisFormatTypeType;
3222
3252
  get minRange():number;
3223
3253
  }
3224
- export interface OneClick {
3225
- setValueForColumn(columnName:string, value:any):void;
3226
- getValueForColumn(columName:string):any;
3227
- get requireAllFiltersToDisplay():boolean;
3228
- get columns():dh.Column[];
3229
- }
3230
3254
  /**
3231
- * Provides access to the data for displaying in a figure.
3232
- */
3233
- export interface Series {
3234
- readonly isLinesVisible?:boolean|null;
3235
- readonly pointLabelFormat?:string|null;
3236
- readonly yToolTipPattern?:string|null;
3237
- readonly shapeSize?:number|null;
3238
- readonly xToolTipPattern?:string|null;
3239
- readonly isShapesVisible?:boolean|null;
3240
-
3241
- subscribe(forceDisableDownsample?:DownsampleOptions):void;
3242
- /**
3243
- * Disable updates for this Series.
3244
- */
3245
- unsubscribe():void;
3246
- get shape():string;
3247
- /**
3248
- * Contains details on how to access data within the chart for this series. keyed with the way that this series uses
3249
- * the axis.
3250
- * @return {@link dh.plot.SeriesDataSource}
3251
- */
3252
- get sources():SeriesDataSource[];
3253
- get lineColor():string;
3255
+ * Describes how to access and display data required within a series.
3256
+ */
3257
+ export interface SeriesDataSource {
3254
3258
  /**
3255
- * The plotting style to use for this series. See <b>SeriesPlotStyle</b> enum for more details.
3256
- * @return int
3259
+ * the type of data stored in the underlying table's Column.
3260
+ * @return String
3257
3261
  */
3258
- get plotStyle():SeriesPlotStyleType;
3259
- get oneClick():OneClick;
3260
- get gradientVisible():boolean;
3261
- get shapeColor():string;
3262
+ get columnType():string;
3262
3263
  /**
3263
- * The name for this series.
3264
- * @return String
3264
+ * the axis that this source should be drawn on.
3265
+ * @return dh.plot.Axis
3265
3266
  */
3266
- get name():string;
3267
+ get axis():Axis;
3267
3268
  /**
3268
- * indicates that this series belongs to a MultiSeries, null otherwise
3269
- * @return dh.plot.MultiSeries
3269
+ * the feature of this series represented by this source. See the <b>SourceType</b> enum for more details.
3270
+ * @return int
3270
3271
  */
3271
- get multiSeries():MultiSeries;
3272
- get shapeLabel():string;
3272
+ get type():SourceTypeType;
3273
3273
  }
3274
3274
 
3275
- /**
3276
- * Helper class to manage snapshots and deltas and keep not only a contiguous JS array of data per column in the
3277
- * underlying table, but also support a mapping function to let client code translate data in some way for display and
3278
- * keep that cached as well.
3279
- */
3280
- export class ChartData {
3281
- constructor(table:dh.Table);
3275
+ export class FigureFetchError {
3276
+ error:object;
3277
+ errors:Array<string>;
3282
3278
 
3283
- update(tableData:dh.SubscriptionTableData):void;
3284
- getColumn(columnName:string, mappingFunc:(arg0:any)=>any, currentUpdate:dh.TableData):Array<any>;
3285
- /**
3286
- * Removes some column from the cache, avoiding extra computation on incoming events, and possibly freeing some
3287
- * memory. If this pair of column name and map function are requested again, it will be recomputed from scratch.
3288
- */
3289
- removeColumn(columnName:string, mappingFunc:(arg0:any)=>any):void;
3279
+ protected constructor();
3280
+ }
3281
+
3282
+ export class SeriesDataSourceException {
3283
+ protected constructor();
3284
+
3285
+ get source():SeriesDataSource;
3286
+ get message():string;
3290
3287
  }
3291
3288
 
3292
3289
  export class DownsampleOptions {
@@ -3325,101 +3322,83 @@ export namespace dh.plot {
3325
3322
  }
3326
3323
 
3327
3324
  /**
3328
- * A descriptor used with JsFigureFactory.create to create a figure from JS.
3325
+ * Provide the details for a chart.
3329
3326
  */
3330
- export class FigureDescriptor {
3331
- title?:string|null;
3332
- titleFont?:string|null;
3333
- titleColor?:string|null;
3334
- isResizable?:boolean|null;
3335
- isDefaultTheme?:boolean|null;
3336
- updateInterval?:number|null;
3337
- cols?:number|null;
3338
- rows?:number|null;
3339
- charts:Array<ChartDescriptor>;
3340
-
3341
- constructor();
3342
- }
3343
-
3344
- export class AxisDescriptor {
3345
- formatType:string;
3346
- type:string;
3347
- position:string;
3348
- log?:boolean|null;
3349
- label?:string|null;
3350
- labelFont?:string|null;
3351
- ticksFont?:string|null;
3352
- formatPattern?:string|null;
3353
- color?:string|null;
3354
- minRange?:number|null;
3355
- maxRange?:number|null;
3356
- minorTicksVisible?:boolean|null;
3357
- majorTicksVisible?:boolean|null;
3358
- minorTickCount?:number|null;
3359
- gapBetweenMajorTicks?:number|null;
3360
- majorTickLocations?:Array<number>|null;
3361
- tickLabelAngle?:number|null;
3362
- invert?:boolean|null;
3363
- isTimeAxis?:boolean|null;
3364
-
3365
- constructor();
3366
- }
3367
-
3368
- export class SeriesDescriptor {
3369
- plotStyle:string;
3370
- name?:string|null;
3371
- linesVisible?:boolean|null;
3372
- shapesVisible?:boolean|null;
3373
- gradientVisible?:boolean|null;
3374
- lineColor?:string|null;
3375
- pointLabelFormat?:string|null;
3376
- xToolTipPattern?:string|null;
3377
- yToolTipPattern?:string|null;
3378
- shapeLabel?:string|null;
3379
- shapeSize?:number|null;
3380
- shapeColor?:string|null;
3381
- shape?:string|null;
3382
- dataSources:Array<SourceDescriptor>;
3383
-
3384
- constructor();
3385
- }
3386
-
3387
- export class ChartDescriptor {
3388
- colspan?:number|null;
3389
- rowspan?:number|null;
3390
- series:Array<SeriesDescriptor>;
3391
- axes:Array<AxisDescriptor>;
3392
- chartType:string;
3393
- title?:string|null;
3394
- titleFont?:string|null;
3395
- titleColor?:string|null;
3396
- showLegend?:boolean|null;
3397
- legendFont?:string|null;
3398
- legendColor?:string|null;
3399
- is3d?:boolean|null;
3400
-
3401
- constructor();
3402
- }
3327
+ export class Chart implements dh.HasEventHandling {
3328
+ /**
3329
+ * a new series was added to this chart as part of a multi-series. The series instance is the detail for this event.
3330
+ */
3331
+ static readonly EVENT_SERIES_ADDED:string;
3332
+ /**
3333
+ * The title of the chart.
3334
+ * @return String
3335
+ */
3336
+ readonly title?:string|null;
3403
3337
 
3404
- /**
3405
- * Helper class for plot downsampling methods.
3406
- */
3407
- export class Downsample {
3408
3338
  protected constructor();
3409
3339
 
3340
+ addEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):()=>void;
3341
+ nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<dh.Event<T>>;
3342
+ hasListeners(name:string):boolean;
3343
+ removeEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):boolean;
3344
+ get column():number;
3345
+ get showLegend():boolean;
3410
3346
  /**
3411
- * Downsamples a table so that the data can be used for a time-series line plot. The downsampled table should have
3412
- * the same visual fidelity as the original table, but with fewer rows.
3413
- * @param table - The table to downsample.
3414
- * @param xCol - The name of the X column to downsample. Must be an Instant or long.
3415
- * @param yCols - The names of the Y columns to downsample.
3416
- * @param width - The width of the visible area in pixels.
3417
- * @param xRange - The visible range as `[start, end]` or null to always use all data.
3418
- * @return A promise that resolves to the downsampled table.
3347
+ * The axes used in this chart.
3348
+ * @return dh.plot.Axis
3419
3349
  */
3420
- static runChartDownsample(table:dh.Table, xCol:string, yCols:string[], width:number, xRange?:dh.LongWrapper[]|undefined|null):Promise<dh.Table>;
3350
+ get axes():Axis[];
3351
+ get is3d():boolean;
3352
+ get titleFont():string;
3353
+ get colspan():number;
3354
+ get titleColor():string;
3355
+ get series():Series[];
3356
+ get rowspan():number;
3357
+ /**
3358
+ * The type of this chart, see <b>ChartType</b> enum for more details.
3359
+ * @return int
3360
+ */
3361
+ get chartType():ChartTypeType;
3362
+ get row():number;
3363
+ get legendColor():string;
3364
+ get legendFont():string;
3365
+ get multiSeries():MultiSeries[];
3421
3366
  }
3422
3367
 
3368
+ /**
3369
+ * Provides the details for a figure.
3370
+ *
3371
+ * The Deephaven JS API supports automatic lossless downsampling of time-series data, when that data is plotted in one
3372
+ * or more line series. Using a scatter plot or a X-axis of some type other than DateTime will prevent this feature from
3373
+ * being applied to a series. To enable this feature, invoke <b>Axis.range(...)</b> to specify the length in pixels of
3374
+ * the axis on the screen, and the range of values that are visible, and the server will use that width (and range, if
3375
+ * any) to reduce the number of points sent to the client.
3376
+ *
3377
+ * Downsampling can also be controlled when calling either <b>Figure.subscribe()</b> or <b>Series.subscribe()</b> - both
3378
+ * can be given an optional <b>dh.plot.DownsampleOptions</b> argument. Presently only two valid values exist,
3379
+ * <b>DEFAULT</b>, and <b>DISABLE</b>, and if no argument is specified, <b>DEFAULT</b> is assumed. If there are more
3380
+ * than 30,000 rows in a table, downsampling will be encouraged - data will not load without calling
3381
+ * <b>subscribe(DISABLE)</b> or enabling downsampling via <b>Axis.range(...)</b>. If there are more than 200,000 rows,
3382
+ * data will refuse to load without downsampling and <b>subscribe(DISABLE)</b> would have no effect.
3383
+ *
3384
+ * Downsampled data looks like normal data, except that select items have been removed if they would be redundant in the
3385
+ * UI given the current configuration. Individual rows are intact, so that a tooltip or some other UI item is sure to be
3386
+ * accurate and consistent, and at least the highest and lowest value for each axis will be retained as well, to ensure
3387
+ * that the "important" values are visible.
3388
+ *
3389
+ * Four events exist to help with interacting with downsampled data, all fired from the <b>Figure</b> instance itself.
3390
+ * First, <b>downsampleneeded</b> indicates that more than 30,000 rows would be fetched, and so specifying downsampling
3391
+ * is no longer optional - it must either be enabled (calling <b>axis.range(...)</b>), or disabled. If the figure is
3392
+ * configured for downsampling, when a change takes place that requires that the server perform some downsampling work,
3393
+ * the <b>downsamplestarted</b> event will first be fired, which can be used to present a brief loading message,
3394
+ * indicating to the user why data is not ready yet - when the server side process is complete,
3395
+ * <b>downsamplefinished</b> will be fired. These events will repeat when the range changes, such as when zooming,
3396
+ * panning, or resizing the figure. Finally, <b>downsamplefailed</b> indicates that something when wrong when
3397
+ * downsampling, or possibly that downsampling cannot be disabled due to the number of rows in the table.
3398
+ *
3399
+ * At this time, not marked as a ServerObject, due to internal implementation issues which leave the door open to
3400
+ * client-created figures.
3401
+ */
3423
3402
  export class Figure implements dh.HasEventHandling {
3424
3403
  /**
3425
3404
  * The title of the figure.
@@ -3463,7 +3442,8 @@ export namespace dh.plot {
3463
3442
  */
3464
3443
  static readonly EVENT_DOWNSAMPLENEEDED:string;
3465
3444
 
3466
- static create(config:FigureDescriptor):Promise<Figure>;
3445
+ protected constructor();
3446
+
3467
3447
  subscribe(forceDisableDownsample?:DownsampleOptions):void;
3468
3448
  /**
3469
3449
  * Disable updates for all series in this figure.
@@ -3502,64 +3482,101 @@ export namespace dh.plot {
3502
3482
  * @typeParam T -
3503
3483
  */
3504
3484
  removeEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):boolean;
3485
+ static create(config:FigureDescriptor):Promise<Figure>;
3505
3486
  }
3506
3487
 
3507
- /**
3508
- * Provide the details for a chart.
3509
- */
3510
- export class Chart implements dh.HasEventHandling {
3511
- /**
3512
- * a new series was added to this chart as part of a multi-series. The series instance is the detail for this event.
3513
- */
3514
- static readonly EVENT_SERIES_ADDED:string;
3515
- /**
3516
- * The title of the chart.
3517
- * @return String
3518
- */
3519
- readonly title?:string|null;
3488
+ export class ChartDescriptor {
3489
+ colspan?:number|null;
3490
+ rowspan?:number|null;
3491
+ series:Array<SeriesDescriptor>;
3492
+ axes:Array<AxisDescriptor>;
3493
+ chartType:string;
3494
+ title?:string|null;
3495
+ titleFont?:string|null;
3496
+ titleColor?:string|null;
3497
+ showLegend?:boolean|null;
3498
+ legendFont?:string|null;
3499
+ legendColor?:string|null;
3500
+ is3d?:boolean|null;
3520
3501
 
3521
- protected constructor();
3502
+ constructor();
3503
+ }
3522
3504
 
3523
- addEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):()=>void;
3524
- nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<dh.Event<T>>;
3525
- hasListeners(name:string):boolean;
3526
- removeEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):boolean;
3527
- get column():number;
3528
- get showLegend():boolean;
3529
- /**
3530
- * The axes used in this chart.
3531
- * @return dh.plot.Axis
3532
- */
3533
- get axes():Axis[];
3534
- get is3d():boolean;
3535
- get titleFont():string;
3536
- get colspan():number;
3537
- get titleColor():string;
3538
- get series():Series[];
3539
- get rowspan():number;
3505
+ export class AxisDescriptor {
3506
+ formatType:string;
3507
+ type:string;
3508
+ position:string;
3509
+ log?:boolean|null;
3510
+ label?:string|null;
3511
+ labelFont?:string|null;
3512
+ ticksFont?:string|null;
3513
+ formatPattern?:string|null;
3514
+ color?:string|null;
3515
+ minRange?:number|null;
3516
+ maxRange?:number|null;
3517
+ minorTicksVisible?:boolean|null;
3518
+ majorTicksVisible?:boolean|null;
3519
+ minorTickCount?:number|null;
3520
+ gapBetweenMajorTicks?:number|null;
3521
+ majorTickLocations?:Array<number>|null;
3522
+ tickLabelAngle?:number|null;
3523
+ invert?:boolean|null;
3524
+ isTimeAxis?:boolean|null;
3525
+
3526
+ constructor();
3527
+ }
3528
+
3529
+ /**
3530
+ * Helper class to manage snapshots and deltas and keep not only a contiguous JS array of data per column in the
3531
+ * underlying table, but also support a mapping function to let client code translate data in some way for display and
3532
+ * keep that cached as well.
3533
+ */
3534
+ export class ChartData {
3535
+ constructor(table:dh.Table);
3536
+
3537
+ update(tableData:dh.SubscriptionTableData):void;
3538
+ getColumn(columnName:string, mappingFunc:(arg0:any)=>any, currentUpdate:dh.TableData):Array<any>;
3540
3539
  /**
3541
- * The type of this chart, see <b>ChartType</b> enum for more details.
3542
- * @return int
3540
+ * Removes some column from the cache, avoiding extra computation on incoming events, and possibly freeing some
3541
+ * memory. If this pair of column name and map function are requested again, it will be recomputed from scratch.
3543
3542
  */
3544
- get chartType():ChartTypeType;
3545
- get row():number;
3546
- get legendColor():string;
3547
- get legendFont():string;
3548
- get multiSeries():MultiSeries[];
3543
+ removeColumn(columnName:string, mappingFunc:(arg0:any)=>any):void;
3549
3544
  }
3550
3545
 
3551
- export class SeriesDataSourceException {
3552
- protected constructor();
3546
+ /**
3547
+ * A descriptor used with JsFigureFactory.create to create a figure from JS.
3548
+ */
3549
+ export class FigureDescriptor {
3550
+ title?:string|null;
3551
+ titleFont?:string|null;
3552
+ titleColor?:string|null;
3553
+ isResizable?:boolean|null;
3554
+ isDefaultTheme?:boolean|null;
3555
+ updateInterval?:number|null;
3556
+ cols?:number|null;
3557
+ rows?:number|null;
3558
+ charts:Array<ChartDescriptor>;
3553
3559
 
3554
- get source():SeriesDataSource;
3555
- get message():string;
3560
+ constructor();
3556
3561
  }
3557
3562
 
3558
- export class FigureFetchError {
3559
- error:object;
3560
- errors:Array<string>;
3563
+ export class SeriesDescriptor {
3564
+ plotStyle:string;
3565
+ name?:string|null;
3566
+ linesVisible?:boolean|null;
3567
+ shapesVisible?:boolean|null;
3568
+ gradientVisible?:boolean|null;
3569
+ lineColor?:string|null;
3570
+ pointLabelFormat?:string|null;
3571
+ xToolTipPattern?:string|null;
3572
+ yToolTipPattern?:string|null;
3573
+ shapeLabel?:string|null;
3574
+ shapeSize?:number|null;
3575
+ shapeColor?:string|null;
3576
+ shape?:string|null;
3577
+ dataSources:Array<SourceDescriptor>;
3561
3578
 
3562
- protected constructor();
3579
+ constructor();
3563
3580
  }
3564
3581
 
3565
3582
  export class FigureSourceException {
@@ -3569,6 +3586,51 @@ export namespace dh.plot {
3569
3586
  protected constructor();
3570
3587
  }
3571
3588
 
3589
+ /**
3590
+ * Helper class for plot downsampling methods.
3591
+ */
3592
+ export class Downsample {
3593
+ protected constructor();
3594
+
3595
+ /**
3596
+ * Downsamples a table so that the data can be used for a time-series line plot. The downsampled table should have
3597
+ * the same visual fidelity as the original table, but with fewer rows.
3598
+ * @param table - The table to downsample.
3599
+ * @param xCol - The name of the X column to downsample. Must be an Instant or long.
3600
+ * @param yCols - The names of the Y columns to downsample.
3601
+ * @param width - The width of the visible area in pixels.
3602
+ * @param xRange - The visible range as `[start, end]` or null to always use all data.
3603
+ * @return A promise that resolves to the downsampled table.
3604
+ */
3605
+ static runChartDownsample(table:dh.Table, xCol:string, yCols:string[], width:number, xRange?:dh.LongWrapper[]|undefined|null):Promise<dh.Table>;
3606
+ }
3607
+
3608
+
3609
+ type AxisTypeType = number;
3610
+ export class AxisType {
3611
+ static readonly X:AxisTypeType;
3612
+ static readonly Y:AxisTypeType;
3613
+ static readonly SHAPE:AxisTypeType;
3614
+ static readonly SIZE:AxisTypeType;
3615
+ static readonly LABEL:AxisTypeType;
3616
+ static readonly COLOR:AxisTypeType;
3617
+ }
3618
+
3619
+ type SeriesPlotStyleType = number;
3620
+ export class SeriesPlotStyle {
3621
+ static readonly BAR:SeriesPlotStyleType;
3622
+ static readonly STACKED_BAR:SeriesPlotStyleType;
3623
+ static readonly LINE:SeriesPlotStyleType;
3624
+ static readonly AREA:SeriesPlotStyleType;
3625
+ static readonly STACKED_AREA:SeriesPlotStyleType;
3626
+ static readonly PIE:SeriesPlotStyleType;
3627
+ static readonly HISTOGRAM:SeriesPlotStyleType;
3628
+ static readonly OHLC:SeriesPlotStyleType;
3629
+ static readonly SCATTER:SeriesPlotStyleType;
3630
+ static readonly STEP:SeriesPlotStyleType;
3631
+ static readonly ERROR_BAR:SeriesPlotStyleType;
3632
+ static readonly TREEMAP:SeriesPlotStyleType;
3633
+ }
3572
3634
 
3573
3635
  type AxisPositionType = number;
3574
3636
  export class AxisPosition {
@@ -3579,10 +3641,19 @@ export namespace dh.plot {
3579
3641
  static readonly NONE:AxisPositionType;
3580
3642
  }
3581
3643
 
3582
- type AxisFormatTypeType = number;
3583
- export class AxisFormatType {
3584
- static readonly CATEGORY:AxisFormatTypeType;
3585
- static readonly NUMBER:AxisFormatTypeType;
3644
+ /**
3645
+ * This enum describes what kind of chart is being drawn. This may limit what kinds of series can be found on it, or how
3646
+ * those series should be rendered.
3647
+ */
3648
+ type ChartTypeType = number;
3649
+ export class ChartType {
3650
+ static readonly XY:ChartTypeType;
3651
+ static readonly PIE:ChartTypeType;
3652
+ static readonly OHLC:ChartTypeType;
3653
+ static readonly CATEGORY:ChartTypeType;
3654
+ static readonly XYZ:ChartTypeType;
3655
+ static readonly CATEGORY_3D:ChartTypeType;
3656
+ static readonly TREEMAP:ChartTypeType;
3586
3657
  }
3587
3658
 
3588
3659
  /**
@@ -3614,58 +3685,16 @@ export namespace dh.plot {
3614
3685
  static readonly HOVER_TEXT:SourceTypeType;
3615
3686
  }
3616
3687
 
3617
- /**
3618
- * This enum describes what kind of chart is being drawn. This may limit what kinds of series can be found on it, or how
3619
- * those series should be rendered.
3620
- */
3621
- type ChartTypeType = number;
3622
- export class ChartType {
3623
- static readonly XY:ChartTypeType;
3624
- static readonly PIE:ChartTypeType;
3625
- static readonly OHLC:ChartTypeType;
3626
- static readonly CATEGORY:ChartTypeType;
3627
- static readonly XYZ:ChartTypeType;
3628
- static readonly CATEGORY_3D:ChartTypeType;
3629
- static readonly TREEMAP:ChartTypeType;
3630
- }
3631
-
3632
- type AxisTypeType = number;
3633
- export class AxisType {
3634
- static readonly X:AxisTypeType;
3635
- static readonly Y:AxisTypeType;
3636
- static readonly SHAPE:AxisTypeType;
3637
- static readonly SIZE:AxisTypeType;
3638
- static readonly LABEL:AxisTypeType;
3639
- static readonly COLOR:AxisTypeType;
3640
- }
3641
-
3642
- type SeriesPlotStyleType = number;
3643
- export class SeriesPlotStyle {
3644
- static readonly BAR:SeriesPlotStyleType;
3645
- static readonly STACKED_BAR:SeriesPlotStyleType;
3646
- static readonly LINE:SeriesPlotStyleType;
3647
- static readonly AREA:SeriesPlotStyleType;
3648
- static readonly STACKED_AREA:SeriesPlotStyleType;
3649
- static readonly PIE:SeriesPlotStyleType;
3650
- static readonly HISTOGRAM:SeriesPlotStyleType;
3651
- static readonly OHLC:SeriesPlotStyleType;
3652
- static readonly SCATTER:SeriesPlotStyleType;
3653
- static readonly STEP:SeriesPlotStyleType;
3654
- static readonly ERROR_BAR:SeriesPlotStyleType;
3655
- static readonly TREEMAP:SeriesPlotStyleType;
3688
+ type AxisFormatTypeType = number;
3689
+ export class AxisFormatType {
3690
+ static readonly CATEGORY:AxisFormatTypeType;
3691
+ static readonly NUMBER:AxisFormatTypeType;
3656
3692
  }
3657
3693
 
3658
3694
  }
3659
3695
 
3660
3696
  export namespace dh.lsp {
3661
3697
 
3662
- export class MarkupContent {
3663
- kind:string;
3664
- value:string;
3665
-
3666
- constructor();
3667
- }
3668
-
3669
3698
  export class SignatureInformation {
3670
3699
  label:string;
3671
3700
  documentation:MarkupContent;
@@ -3675,23 +3704,6 @@ export namespace dh.lsp {
3675
3704
  constructor();
3676
3705
  }
3677
3706
 
3678
- export class CompletionItem {
3679
- label:string;
3680
- kind:number;
3681
- detail:string;
3682
- documentation:MarkupContent;
3683
- deprecated:boolean;
3684
- preselect:boolean;
3685
- textEdit:TextEdit;
3686
- sortText:string;
3687
- filterText:string;
3688
- insertTextFormat:number;
3689
- additionalTextEdits:Array<TextEdit>;
3690
- commitCharacters:Array<string>;
3691
-
3692
- constructor();
3693
- }
3694
-
3695
3707
  export class Position {
3696
3708
  line:number;
3697
3709
  character:number;
@@ -3705,9 +3717,18 @@ export namespace dh.lsp {
3705
3717
  copy():Position;
3706
3718
  }
3707
3719
 
3708
- export class TextEdit {
3709
- range:Range;
3710
- text:string;
3720
+ export class Range {
3721
+ start:Position;
3722
+ end:Position;
3723
+
3724
+ constructor();
3725
+
3726
+ isInside(innerStart:Position, innerEnd:Position):boolean;
3727
+ }
3728
+
3729
+ export class MarkupContent {
3730
+ kind:string;
3731
+ value:string;
3711
3732
 
3712
3733
  constructor();
3713
3734
  }
@@ -3719,13 +3740,11 @@ export namespace dh.lsp {
3719
3740
  constructor();
3720
3741
  }
3721
3742
 
3722
- export class Range {
3723
- start:Position;
3724
- end:Position;
3743
+ export class TextEdit {
3744
+ range:Range;
3745
+ text:string;
3725
3746
 
3726
3747
  constructor();
3727
-
3728
- isInside(innerStart:Position, innerEnd:Position):boolean;
3729
3748
  }
3730
3749
 
3731
3750
  export class ParameterInformation {
@@ -3743,26 +3762,27 @@ export namespace dh.lsp {
3743
3762
  constructor();
3744
3763
  }
3745
3764
 
3765
+ export class CompletionItem {
3766
+ label:string;
3767
+ kind:number;
3768
+ detail:string;
3769
+ documentation:MarkupContent;
3770
+ deprecated:boolean;
3771
+ preselect:boolean;
3772
+ textEdit:TextEdit;
3773
+ sortText:string;
3774
+ filterText:string;
3775
+ insertTextFormat:number;
3776
+ additionalTextEdits:Array<TextEdit>;
3777
+ commitCharacters:Array<string>;
3778
+
3779
+ constructor();
3780
+ }
3781
+
3746
3782
  }
3747
3783
 
3748
3784
  export namespace dh.calendar {
3749
3785
 
3750
- export interface BusinessPeriod {
3751
- get close():string;
3752
- get open():string;
3753
- }
3754
- export interface Holiday {
3755
- /**
3756
- * The date of the Holiday.
3757
- * @return {@link dh.LocalDateWrapper}
3758
- */
3759
- get date():dh.LocalDateWrapper;
3760
- /**
3761
- * The business periods that are open on the holiday.
3762
- * @return dh.calendar.BusinessPeriod
3763
- */
3764
- get businessPeriods():Array<BusinessPeriod>;
3765
- }
3766
3786
  /**
3767
3787
  * Defines a calendar with business hours and holidays.
3768
3788
  */
@@ -3793,6 +3813,22 @@ export namespace dh.calendar {
3793
3813
  */
3794
3814
  get businessPeriods():Array<BusinessPeriod>;
3795
3815
  }
3816
+ export interface BusinessPeriod {
3817
+ get close():string;
3818
+ get open():string;
3819
+ }
3820
+ export interface Holiday {
3821
+ /**
3822
+ * The date of the Holiday.
3823
+ * @return {@link dh.LocalDateWrapper}
3824
+ */
3825
+ get date():dh.LocalDateWrapper;
3826
+ /**
3827
+ * The business periods that are open on the holiday.
3828
+ * @return dh.calendar.BusinessPeriod
3829
+ */
3830
+ get businessPeriods():Array<BusinessPeriod>;
3831
+ }
3796
3832
 
3797
3833
  type DayOfWeekType = string;
3798
3834
  export class DayOfWeek {