@deephaven/jsapi-types 1.0.0-dev0.33.3 → 1.0.0-dev0.33.4

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 +1836 -1871
  2. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -1,10 +1,6 @@
1
1
  // Minimum TypeScript Version: 4.3
2
2
  // Generated using com.vertispan.tsdefs.doclet.TsDoclet
3
3
 
4
- export interface IIterableResult<T> {
5
- value:T;
6
- done:boolean;
7
- }
8
4
  /**
9
5
  * This is part of EcmaScript 2015, documented here for completeness. It supports a single method, <b>next()</b>, which
10
6
  * returns an object with a <b>boolean</b> named <b>done</b> (true if there are no more items to return; false
@@ -15,22 +11,24 @@ export interface Iterator<T> {
15
11
  hasNext():boolean;
16
12
  next():IIterableResult<T>;
17
13
  }
14
+ export interface IIterableResult<T> {
15
+ value:T;
16
+ done:boolean;
17
+ }
18
18
  export namespace dh.storage {
19
19
 
20
20
  /**
21
- * Represents a file's contents loaded from the server. If an etag was specified when loading, client should first test
22
- * if the etag of this instance matches - if so, the contents will be empty, and the client's existing contents should
23
- * be used.
21
+ * Storage service metadata about files and folders.
24
22
  */
25
- export class FileContents {
23
+ export class ItemDetails {
26
24
  protected constructor();
27
25
 
28
- static blob(blob:Blob):FileContents;
29
- static text(...text:string[]):FileContents;
30
- static arrayBuffers(...buffers:ArrayBuffer[]):FileContents;
31
- text():Promise<string>;
32
- arrayBuffer():Promise<ArrayBuffer>;
26
+ get filename():string;
27
+ get basename():string;
28
+ get size():number;
33
29
  get etag():string;
30
+ get type():ItemTypeType;
31
+ get dirname():string;
34
32
  }
35
33
 
36
34
  /**
@@ -92,17 +90,19 @@ export namespace dh.storage {
92
90
  }
93
91
 
94
92
  /**
95
- * Storage service metadata about files and folders.
93
+ * Represents a file's contents loaded from the server. If an etag was specified when loading, client should first test
94
+ * if the etag of this instance matches - if so, the contents will be empty, and the client's existing contents should
95
+ * be used.
96
96
  */
97
- export class ItemDetails {
97
+ export class FileContents {
98
98
  protected constructor();
99
99
 
100
- get filename():string;
101
- get basename():string;
102
- get size():number;
100
+ static blob(blob:Blob):FileContents;
101
+ static text(...text:string[]):FileContents;
102
+ static arrayBuffers(...buffers:ArrayBuffer[]):FileContents;
103
+ text():Promise<string>;
104
+ arrayBuffer():Promise<ArrayBuffer>;
103
105
  get etag():string;
104
- get type():ItemTypeType;
105
- get dirname():string;
106
106
  }
107
107
 
108
108
 
@@ -116,10 +116,59 @@ export namespace dh.storage {
116
116
 
117
117
  export namespace dh {
118
118
 
119
+ export interface JoinableTable {
120
+ freeze():Promise<Table>;
121
+ snapshot(baseTable:Table, doInitialSnapshot?:boolean, stampColumns?:string[]):Promise<Table>;
122
+ /**
123
+ * @deprecated
124
+ */
125
+ join(joinType:object, rightTable:JoinableTable, columnsToMatch:Array<string>, columnsToAdd?:Array<string>, asOfMatchRule?:object):Promise<Table>;
126
+ asOfJoin(rightTable:JoinableTable, columnsToMatch:Array<string>, columnsToAdd?:Array<string>, asOfMatchRule?:string):Promise<Table>;
127
+ crossJoin(rightTable:JoinableTable, columnsToMatch:Array<string>, columnsToAdd?:Array<string>, reserve_bits?:number):Promise<Table>;
128
+ exactJoin(rightTable:JoinableTable, columnsToMatch:Array<string>, columnsToAdd?:Array<string>):Promise<Table>;
129
+ naturalJoin(rightTable:JoinableTable, columnsToMatch:Array<string>, columnsToAdd?:Array<string>):Promise<Table>;
130
+ }
131
+ /**
132
+ * Contains data in the current viewport. Also contains the offset to this data, so that the actual row number may be
133
+ * determined. Do not assume that the first row in `rows` is the first visible row, because extra rows may be provided
134
+ * for easier scrolling without going to the server.
135
+ */
136
+ export interface ViewportData extends TableData {
137
+ /**
138
+ * The index of the first returned row
139
+ * @return double
140
+ */
141
+ get offset():number;
142
+ /**
143
+ * A list of columns describing the data types in each row
144
+ * @return {@link dh.Column} array.
145
+ */
146
+ get columns():Array<Column>;
147
+ /**
148
+ * An array of rows of data
149
+ * @return {@link dh.ViewportRow} array.
150
+ */
151
+ get rows():Array<ViewportRow>;
152
+ }
119
153
  export interface RefreshToken {
120
154
  get bytes():string;
121
155
  get expiry():number;
122
156
  }
157
+ export interface Row {
158
+ get(column:Column):any;
159
+ getFormat(column:Column):Format;
160
+ get index():LongWrapper;
161
+ }
162
+ /**
163
+ * Wrap LocalDate values for use in JS. Provides text formatting for display and access to the underlying value.
164
+ */
165
+ export interface LocalDateWrapper {
166
+ valueOf():string;
167
+ getYear():number;
168
+ getMonthValue():number;
169
+ getDayOfMonth():number;
170
+ toString():string;
171
+ }
123
172
  /**
124
173
  * This object may be pooled internally or discarded and not updated. Do not retain references to it.
125
174
  */
@@ -146,17 +195,161 @@ export namespace dh {
146
195
  readonly numberFormat?:string|null;
147
196
  }
148
197
  /**
149
- * Common interface for various ways of accessing table data and formatting.
198
+ * Behaves like a Table, but doesn't expose all of its API for changing the internal state. Instead, state is driven by
199
+ * the upstream table - when it changes handle, this listens and updates its own handle accordingly.
150
200
  *
151
- * Java note: this interface contains some extra overloads that aren't available in JS. Implementations are expected to
152
- * implement only abstract methods, and default methods present in this interface will dispatch accordingly.
201
+ * Additionally, this is automatically subscribed to its one and only row, across all columns.
202
+ *
203
+ * A new config is returned any time it is accessed, to prevent accidental mutation, and to allow it to be used as a
204
+ * template when fetching a new totals table, or changing the totals table in use.
205
+ *
206
+ * A simplistic Table, providing access to aggregation of the table it is sourced from. This table is always
207
+ * automatically subscribed to its parent, and adopts changes automatically from it. This class has limited methods
208
+ * found on Table. Instances of this type always have a size of one when no groupBy is set on the config, but may
209
+ * potentially contain as few as zero rows, or as many as the parent table if each row gets its own group.
210
+ *
211
+ * When using the `groupBy` feature, it may be desireable to also provide a row to the user with all values across all
212
+ * rows. To achieve this, request the same Totals Table again, but remove the `groupBy` setting.
153
213
  */
154
- export interface TableData {
155
- get(index:LongWrapper|number):Row;
156
- getData(index:LongWrapper|number, column:Column):any;
157
- getFormat(index:LongWrapper|number, column:Column):Format;
214
+ export interface TotalsTable extends JoinableTable {
215
+ /**
216
+ * Specifies the range of items to pass to the client and update as they change. If the columns parameter is not
217
+ * provided, all columns will be used. Until this is called, no data will be available. Invoking this will result in
218
+ * events to be fired once data becomes available, starting with an <b>updated</b> event and one <b>rowadded</b>
219
+ * event per row in that range.
220
+ * @param firstRow -
221
+ * @param lastRow -
222
+ * @param columns -
223
+ * @param updateIntervalMs -
224
+ */
225
+ setViewport(firstRow:number, lastRow:number, columns?:Array<Column>, updateIntervalMs?:number):void;
226
+ /**
227
+ * the currently visible viewport. If the current set of operations has not yet resulted in data, it will not
228
+ * resolve until that data is ready.
229
+ * @return Promise of {@link dh.TableData}
230
+ */
231
+ getViewportData():Promise<TableData>;
232
+ /**
233
+ * a column by the given name. You should prefer to always retrieve a new Column instance instead of caching a
234
+ * returned value.
235
+ * @param key -
236
+ * @return {@link dh.Column}
237
+ */
238
+ findColumn(key:string):Column;
239
+ /**
240
+ * multiple columns specified by the given names.
241
+ * @param keys -
242
+ * @return {@link dh.Column} array
243
+ */
244
+ findColumns(keys:string[]):Column[];
245
+ /**
246
+ * Indicates that the table will no longer be used, and resources used to provide it can be freed up on the server.
247
+ */
248
+ close():void;
249
+ addEventListener<T>(name:string, callback:(e:CustomEvent<T>)=>void):()=>void;
250
+ removeEventListener<T>(name:string, callback:(e:CustomEvent<T>)=>void):boolean;
251
+ nextEvent<T>(eventName:string, timeoutInMillis:number):Promise<CustomEvent<T>>;
252
+ hasListeners(name:string):boolean;
253
+ /**
254
+ * Replace the currently set sort on this table. Returns the previously set value. Note that the sort property will
255
+ * immediately return the new value, but you may receive update events using the old sort before the new sort is
256
+ * applied, and the <b>sortchanged</b> event fires. Reusing existing, applied sorts may enable this to perform
257
+ * better on the server. The <b>updated</b> event will also fire, but <b>rowadded</b> and <b>rowremoved</b> will
258
+ * not.
259
+ * @param sort -
260
+ * @return {@link dh.Sort} array
261
+ */
262
+ applySort(sort:Sort[]):Array<Sort>;
263
+ /**
264
+ * Replace the current custom columns with a new set. These columns can be used when adding new filter and sort
265
+ * operations to the table, as long as they are present.
266
+ * @param customColumns -
267
+ * @return
268
+ */
269
+ applyCustomColumns(customColumns:Array<string|CustomColumn>):Array<CustomColumn>;
270
+ /**
271
+ * Replace the currently set filters on the table. Returns the previously set value. Note that the filter property
272
+ * will immediately return the new value, but you may receive update events using the old filter before the new one
273
+ * is applied, and the <b>filterchanged</b> event fires. Reusing existing, applied filters may enable this to
274
+ * perform better on the server. The <b>updated</b> event will also fire, but <b>rowadded</b> and <b>rowremoved</b>
275
+ * will not.
276
+ * @param filter -
277
+ * @return {@link dh.FilterCondition} array
278
+ */
279
+ applyFilter(filter:FilterCondition[]):Array<FilterCondition>;
280
+ /**
281
+ * An ordered list of Filters to apply to the table. To update, call applyFilter(). Note that this getter will
282
+ * return the new value immediately, even though it may take a little time to update on the server. You may listen
283
+ * for the <b>filterchanged</b> event to know when to update the UI.
284
+ * @return {@link dh.FilterCondition} array
285
+ */
286
+ get filter():Array<FilterCondition>;
287
+ /**
288
+ * True if this table has been closed.
289
+ * @return boolean
290
+ */
291
+ get isClosed():boolean;
292
+ /**
293
+ * The total number of rows in this table. This may change as the base table's configuration, filter, or contents
294
+ * change.
295
+ * @return double
296
+ */
297
+ get size():number;
298
+ /**
299
+ * The columns present on this table. Note that this may not include all columns in the parent table, and in cases
300
+ * where a given column has more than one aggregation applied, the column name will have a suffix indicating the
301
+ * aggregation used. This suffixed name will be of the form <b>columnName + '__' + aggregationName</b>.
302
+ * @return {@link dh.Column} array
303
+ */
158
304
  get columns():Array<Column>;
159
- get rows():Array<Row>;
305
+ get totalsTableConfig():TotalsTableConfig;
306
+ /**
307
+ * An ordered list of Sorts to apply to the table. To update, call applySort(). Note that this getter will return
308
+ * the new value immediately, even though it may take a little time to update on the server. You may listen for the
309
+ * <b>sortchanged</b> event to know when to update the UI.
310
+ * @return {@link dh.Sort} array
311
+ */
312
+ get sort():Array<Sort>;
313
+ /**
314
+ * Read-only. An ordered list of custom column formulas to add to the table, either adding new columns or replacing
315
+ * existing ones. To update, call <b>applyCustomColumns()</b>.
316
+ * @return {@link dh.CustomColumn} array
317
+ */
318
+ get customColumns():Array<CustomColumn>;
319
+ /**
320
+ * True if this table may receive updates from the server, including size changed events, updated events after
321
+ * initial snapshot.
322
+ * @return boolean
323
+ */
324
+ get isRefreshing():boolean;
325
+ }
326
+ /**
327
+ * Javascript wrapper for {@link io.deephaven.web.shared.data.ColumnStatistics} This class holds the results of a call to generate statistics on a
328
+ * table column.
329
+ */
330
+ export interface ColumnStatistics {
331
+ /**
332
+ * Gets the type of formatting that should be used for given statistic.
333
+ * <p>
334
+ * the format type for a statistic. A null return value means that the column formatting should be used.
335
+ * @param name - the display name of the statistic
336
+ * @return String
337
+ */
338
+ getType(name:string):string;
339
+ /**
340
+ * 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
341
+ * name to the count of how many times it occurred in the column. This map will be empty for tables containing more
342
+ * than 19 unique values.
343
+ * @return Map of String double
344
+ */
345
+ get uniqueValues():Map<string, number>;
346
+ /**
347
+ * Gets a map with the display name of statistics as keys and the numeric stat as a value.
348
+ * <p>
349
+ * A map of each statistic's name to its value.
350
+ * @return Map of String and Object
351
+ */
352
+ get statisticsMap():Map<string, object>;
160
353
  }
161
354
  /**
162
355
  * Row implementation that also provides additional read-only properties. represents visible rows in the table,
@@ -183,16 +376,6 @@ export namespace dh {
183
376
  get hasChildren():boolean;
184
377
  get index():LongWrapper;
185
378
  }
186
- export interface LayoutHints {
187
- readonly searchDisplayMode?:SearchDisplayModeType|null;
188
-
189
- get hiddenColumns():string[]|null;
190
- get frozenColumns():string[]|null;
191
- get columnGroups():ColumnGroup[]|null;
192
- get areSavedLayoutsAllowed():boolean;
193
- get frontColumns():string[]|null;
194
- get backColumns():string[]|null;
195
- }
196
379
  /**
197
380
  * Represents a server-side object that may not yet have been fetched by the client. When this object will no longer be
198
381
  * used, if {@link fetch} is not called on this object, then {@link close} must be to ensure server-side resources
@@ -225,67 +408,55 @@ export namespace dh {
225
408
  */
226
409
  close():void;
227
410
  }
411
+ export interface LayoutHints {
412
+ readonly searchDisplayMode?:SearchDisplayModeType|null;
413
+
414
+ get hiddenColumns():string[]|null;
415
+ get frozenColumns():string[]|null;
416
+ get columnGroups():ColumnGroup[]|null;
417
+ get areSavedLayoutsAllowed():boolean;
418
+ get frontColumns():string[]|null;
419
+ get backColumns():string[]|null;
420
+ }
228
421
  /**
229
- * Javascript wrapper for {@link io.deephaven.web.shared.data.ColumnStatistics} This class holds the results of a call to generate statistics on a
230
- * table column.
422
+ * Represents the contents of a single widget data message from the server, with a binary data paylod and exported
423
+ * objects. Implemented both by Widget itself and by the `event.details` when data is received by the client.
424
+ *
425
+ * Terminology note: the name of this type should probably use "Data" instead of "Message", and the methods should use
426
+ * "payload" rather than "data" to match other platforms and the protobuf itself. These names are instead used for
427
+ * backwards compatibility and to better follow JS expectations.
231
428
  */
232
- export interface ColumnStatistics {
429
+ export interface WidgetMessageDetails {
233
430
  /**
234
- * Gets the type of formatting that should be used for given statistic.
235
- * <p>
236
- * the format type for a statistic. A null return value means that the column formatting should be used.
237
- * @param name - the display name of the statistic
238
- * @return String
431
+ * Returns the data from this message as a base64-encoded string.
239
432
  */
240
- getType(name:string):string;
433
+ getDataAsBase64():string;
241
434
  /**
242
- * 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
243
- * name to the count of how many times it occurred in the column. This map will be empty for tables containing more
244
- * than 19 unique values.
245
- * @return Map of String double
435
+ * Returns the data from this message as a Uint8Array.
246
436
  */
247
- get uniqueValues():Map<string, number>;
437
+ getDataAsU8():Uint8Array;
248
438
  /**
249
- * Gets a map with the display name of statistics as keys and the numeric stat as a value.
250
- * <p>
251
- * A map of each statistic's name to its value.
252
- * @return Map of String and Object
439
+ * Returns the data from this message as a utf-8 string.
253
440
  */
254
- get statisticsMap():Map<string, object>;
441
+ getDataAsString():string;
442
+ /**
443
+ * Returns an array of exported objects sent from the server. The plugin implementation is now responsible for these
444
+ * objects, and should close them when no longer needed.
445
+ */
446
+ get exportedObjects():WidgetExportedObject[];
255
447
  }
256
448
  /**
257
- * Contains data in the current viewport. Also contains the offset to this data, so that the actual row number may be
258
- * determined. Do not assume that the first row in `rows` is the first visible row, because extra rows may be provided
259
- * for easier scrolling without going to the server.
449
+ * Common interface for various ways of accessing table data and formatting.
450
+ *
451
+ * Java note: this interface contains some extra overloads that aren't available in JS. Implementations are expected to
452
+ * implement only abstract methods, and default methods present in this interface will dispatch accordingly.
260
453
  */
261
- export interface ViewportData extends TableData {
262
- /**
263
- * The index of the first returned row
264
- * @return double
265
- */
266
- get offset():number;
267
- /**
268
- * A list of columns describing the data types in each row
269
- * @return {@link dh.Column} array.
270
- */
454
+ export interface TableData {
455
+ get(index:LongWrapper|number):Row;
456
+ getData(index:LongWrapper|number, column:Column):any;
457
+ getFormat(index:LongWrapper|number, column:Column):Format;
271
458
  get columns():Array<Column>;
272
- /**
273
- * An array of rows of data
274
- * @return {@link dh.ViewportRow} array.
275
- */
276
- get rows():Array<ViewportRow>;
277
- }
278
- export interface JoinableTable {
279
- freeze():Promise<Table>;
280
- snapshot(baseTable:Table, doInitialSnapshot?:boolean, stampColumns?:string[]):Promise<Table>;
281
- /**
282
- * @deprecated
283
- */
284
- join(joinType:object, rightTable:JoinableTable, columnsToMatch:Array<string>, columnsToAdd?:Array<string>, asOfMatchRule?:object):Promise<Table>;
285
- asOfJoin(rightTable:JoinableTable, columnsToMatch:Array<string>, columnsToAdd?:Array<string>, asOfMatchRule?:string):Promise<Table>;
286
- crossJoin(rightTable:JoinableTable, columnsToMatch:Array<string>, columnsToAdd?:Array<string>, reserve_bits?:number):Promise<Table>;
287
- exactJoin(rightTable:JoinableTable, columnsToMatch:Array<string>, columnsToAdd?:Array<string>):Promise<Table>;
288
- naturalJoin(rightTable:JoinableTable, columnsToMatch:Array<string>, columnsToAdd?:Array<string>):Promise<Table>;
459
+ get rows():Array<Row>;
289
460
  }
290
461
  export interface HasEventHandling {
291
462
  /**
@@ -308,6 +479,76 @@ export namespace dh {
308
479
  removeEventListener<T>(name:string, callback:(e:CustomEvent<T>)=>void):boolean;
309
480
  }
310
481
  /**
482
+ * Event data, describing the indexes that were added/removed/updated, and providing access to Rows (and thus data
483
+ * in columns) either by index, or scanning the complete present index.
484
+ *
485
+ * This class supports two ways of reading the table - checking the changes made since the last update, and reading
486
+ * all data currently in the table. While it is more expensive to always iterate over every single row in the table,
487
+ * it may in some cases actually be cheaper than maintaining state separately and updating only the changes, though
488
+ * both options should be considered.
489
+ *
490
+ * The RangeSet objects allow iterating over the LongWrapper indexes in the table. Note that these "indexes" are not
491
+ * necessarily contiguous and may be negative, and represent some internal state on the server, allowing it to keep
492
+ * track of data efficiently. Those LongWrapper objects can be passed to the various methods on this instance to
493
+ * read specific rows or cells out of the table.
494
+ */
495
+ export interface SubscriptionTableData extends TableData {
496
+ get fullIndex():RangeSet;
497
+ /**
498
+ * The ordered set of row indexes removed since the last update
499
+ * @return dh.RangeSet
500
+ */
501
+ get removed():RangeSet;
502
+ /**
503
+ * The ordered set of row indexes added since the last update
504
+ * @return dh.RangeSet
505
+ */
506
+ get added():RangeSet;
507
+ get columns():Array<Column>;
508
+ /**
509
+ * The ordered set of row indexes updated since the last update
510
+ * @return dh.RangeSet
511
+ */
512
+ get modified():RangeSet;
513
+ get rows():Array<Row>;
514
+ }
515
+ export interface WorkerHeapInfo {
516
+ /**
517
+ * Total heap size available for this worker.
518
+ */
519
+ get totalHeapSize():number;
520
+ get freeMemory():number;
521
+ get maximumHeapSize():number;
522
+ }
523
+ /**
524
+ * Wrap LocalTime values for use in JS. Provides text formatting for display and access to the underlying value.
525
+ */
526
+ export interface LocalTimeWrapper {
527
+ valueOf():string;
528
+ getHour():number;
529
+ getMinute():number;
530
+ getSecond():number;
531
+ getNano():number;
532
+ toString():string;
533
+ }
534
+ export interface ColumnGroup {
535
+ get name():string|null;
536
+ get children():string[]|null;
537
+ get color():string|null;
538
+ }
539
+ export interface TreeViewportData extends TableData {
540
+ get offset():number;
541
+ get columns():Array<Column>;
542
+ get rows():Array<TreeRow>;
543
+ }
544
+ /**
545
+ * This object may be pooled internally or discarded and not updated. Do not retain references to it. Instead, request
546
+ * the viewport again.
547
+ */
548
+ export interface ViewportRow extends Row {
549
+ get index():LongWrapper;
550
+ }
551
+ /**
311
552
  * Encapsulates event handling around table subscriptions by "cheating" and wrapping up a JsTable instance to do the
312
553
  * real dirty work. This allows a viewport to stay open on the old table if desired, while this one remains open.
313
554
  * <p>
@@ -352,285 +593,342 @@ export namespace dh {
352
593
  getViewportData():Promise<TableData>;
353
594
  snapshot(rows:RangeSet, columns:Column[]):Promise<TableData>;
354
595
  }
355
- /**
356
- * Represents the contents of a single widget data message from the server, with a binary data paylod and exported
357
- * objects. Implemented both by Widget itself and by the `event.details` when data is received by the client.
358
- *
359
- * Terminology note: the name of this type should probably use "Data" instead of "Message", and the methods should use
360
- * "payload" rather than "data" to match other platforms and the protobuf itself. These names are instead used for
361
- * backwards compatibility and to better follow JS expectations.
362
- */
363
- export interface WidgetMessageDetails {
364
- /**
365
- * Returns the data from this message as a base64-encoded string.
366
- */
367
- getDataAsBase64():string;
596
+
597
+ export class CustomColumn {
598
+ static readonly TYPE_FORMAT_COLOR:string;
599
+ static readonly TYPE_FORMAT_NUMBER:string;
600
+ static readonly TYPE_FORMAT_DATE:string;
601
+ static readonly TYPE_NEW:string;
602
+
603
+ protected constructor();
604
+
605
+ valueOf():string;
606
+ toString():string;
368
607
  /**
369
- * Returns the data from this message as a Uint8Array.
608
+ * The expression to evaluate this custom column.
609
+ * @return String
370
610
  */
371
- getDataAsU8():Uint8Array;
611
+ get expression():string;
372
612
  /**
373
- * Returns the data from this message as a utf-8 string.
613
+ * The name of the column to use.
614
+ * @return String
374
615
  */
375
- getDataAsString():string;
616
+ get name():string;
376
617
  /**
377
- * Returns an array of exported objects sent from the server. The plugin implementation is now responsible for these
378
- * objects, and should close them when no longer needed.
618
+ * Type of custom column. One of
619
+ *
620
+ * <ul>
621
+ * <li>FORMAT_COLOR</li>
622
+ * <li>FORMAT_NUMBER</li>
623
+ * <li>FORMAT_DATE</li>
624
+ * <li>NEW</li>
625
+ * </ul>
626
+ * @return String
379
627
  */
380
- get exportedObjects():WidgetExportedObject[];
381
- }
382
- export interface Row {
383
- get(column:Column):any;
384
- getFormat(column:Column):Format;
385
- get index():LongWrapper;
386
- }
387
- /**
388
- * This object may be pooled internally or discarded and not updated. Do not retain references to it. Instead, request
389
- * the viewport again.
390
- */
391
- export interface ViewportRow extends Row {
392
- get index():LongWrapper;
393
- }
394
- export interface ColumnGroup {
395
- get name():string|null;
396
- get children():string[]|null;
397
- get color():string|null;
628
+ get type():string;
398
629
  }
630
+
399
631
  /**
400
- * Wrap LocalTime values for use in JS. Provides text formatting for display and access to the underlying value.
632
+ * Describes data that can be filtered, either a column reference or a literal value. Used this way, the type of a value
633
+ * can be specified so that values which are ambiguous or not well supported in JS will not be confused with Strings or
634
+ * imprecise numbers (e.g., nanosecond-precision date values). Additionally, once wrapped in this way, methods can be
635
+ * called on these value literal instances. These instances are immutable - any method called on them returns a new
636
+ * instance.
401
637
  */
402
- export interface LocalTimeWrapper {
403
- valueOf():string;
404
- getHour():number;
405
- getMinute():number;
406
- getSecond():number;
407
- getNano():number;
408
- toString():string;
409
- }
410
- export interface WorkerHeapInfo {
638
+ export class FilterValue {
639
+ protected constructor();
640
+
411
641
  /**
412
- * Total heap size available for this worker.
642
+ * Constructs a number for the filter API from the given parameter. Can also be used on the values returned from
643
+ * {@link TableData.get} for DateTime values. To create
644
+ * a filter with a date, use <b>dh.DateWrapper.ofJsDate</b> or
645
+ * {@link i18n.DateTimeFormat.parse}. To create a filter with a
646
+ * 64-bit long integer, use {@link LongWrapper.ofString}.
647
+ * @param input - the number to wrap as a FilterValue
648
+ * @return an immutable FilterValue that can be built into a filter
413
649
  */
414
- get totalHeapSize():number;
415
- get freeMemory():number;
416
- get maximumHeapSize():number;
417
- }
418
- /**
419
- * Wrap LocalDate values for use in JS. Provides text formatting for display and access to the underlying value.
420
- */
421
- export interface LocalDateWrapper {
422
- valueOf():string;
423
- getYear():number;
424
- getMonthValue():number;
425
- getDayOfMonth():number;
426
- toString():string;
427
- }
428
- /**
429
- * Event data, describing the indexes that were added/removed/updated, and providing access to Rows (and thus data
430
- * in columns) either by index, or scanning the complete present index.
431
- *
432
- * This class supports two ways of reading the table - checking the changes made since the last update, and reading
433
- * all data currently in the table. While it is more expensive to always iterate over every single row in the table,
434
- * it may in some cases actually be cheaper than maintaining state separately and updating only the changes, though
435
- * both options should be considered.
436
- *
437
- * The RangeSet objects allow iterating over the LongWrapper indexes in the table. Note that these "indexes" are not
438
- * necessarily contiguous and may be negative, and represent some internal state on the server, allowing it to keep
439
- * track of data efficiently. Those LongWrapper objects can be passed to the various methods on this instance to
440
- * read specific rows or cells out of the table.
441
- */
442
- export interface SubscriptionTableData extends TableData {
443
- get fullIndex():RangeSet;
444
- /**
445
- * The ordered set of row indexes removed since the last update
446
- * @return dh.RangeSet
447
- */
448
- get removed():RangeSet;
650
+ static ofNumber(input:LongWrapper|number):FilterValue;
449
651
  /**
450
- * The ordered set of row indexes added since the last update
451
- * @return dh.RangeSet
652
+ * a filter condition checking if the current value is equal to the given parameter
653
+ * @param term -
654
+ * @return {@link dh.FilterCondition}
452
655
  */
453
- get added():RangeSet;
454
- get columns():Array<Column>;
656
+ eq(term:FilterValue):FilterCondition;
455
657
  /**
456
- * The ordered set of row indexes updated since the last update
457
- * @return dh.RangeSet
658
+ * a filter condition checking if the current value is equal to the given parameter, ignoring differences of upper
659
+ * vs lower case
660
+ * @param term -
661
+ * @return {@link dh.FilterCondition}
458
662
  */
459
- get modified():RangeSet;
460
- get rows():Array<Row>;
461
- }
462
- /**
463
- * Behaves like a Table, but doesn't expose all of its API for changing the internal state. Instead, state is driven by
464
- * the upstream table - when it changes handle, this listens and updates its own handle accordingly.
465
- *
466
- * Additionally, this is automatically subscribed to its one and only row, across all columns.
467
- *
468
- * A new config is returned any time it is accessed, to prevent accidental mutation, and to allow it to be used as a
469
- * template when fetching a new totals table, or changing the totals table in use.
470
- *
471
- * A simplistic Table, providing access to aggregation of the table it is sourced from. This table is always
472
- * automatically subscribed to its parent, and adopts changes automatically from it. This class has limited methods
473
- * found on Table. Instances of this type always have a size of one when no groupBy is set on the config, but may
474
- * potentially contain as few as zero rows, or as many as the parent table if each row gets its own group.
475
- *
476
- * When using the `groupBy` feature, it may be desireable to also provide a row to the user with all values across all
477
- * rows. To achieve this, request the same Totals Table again, but remove the `groupBy` setting.
478
- */
479
- export interface TotalsTable extends JoinableTable {
663
+ eqIgnoreCase(term:FilterValue):FilterCondition;
480
664
  /**
481
- * Specifies the range of items to pass to the client and update as they change. If the columns parameter is not
482
- * provided, all columns will be used. Until this is called, no data will be available. Invoking this will result in
483
- * events to be fired once data becomes available, starting with an <b>updated</b> event and one <b>rowadded</b>
484
- * event per row in that range.
485
- * @param firstRow -
486
- * @param lastRow -
487
- * @param columns -
488
- * @param updateIntervalMs -
665
+ * a filter condition checking if the current value is not equal to the given parameter
666
+ * @param term -
667
+ * @return {@link dh.FilterCondition}
489
668
  */
490
- setViewport(firstRow:number, lastRow:number, columns?:Array<Column>, updateIntervalMs?:number):void;
669
+ notEq(term:FilterValue):FilterCondition;
491
670
  /**
492
- * the currently visible viewport. If the current set of operations has not yet resulted in data, it will not
493
- * resolve until that data is ready.
494
- * @return Promise of {@link dh.TableData}
671
+ * a filter condition checking if the current value is not equal to the given parameter, ignoring differences of
672
+ * upper vs lower case
673
+ * @param term -
674
+ * @return {@link dh.FilterCondition}
495
675
  */
496
- getViewportData():Promise<TableData>;
676
+ notEqIgnoreCase(term:FilterValue):FilterCondition;
497
677
  /**
498
- * a column by the given name. You should prefer to always retrieve a new Column instance instead of caching a
499
- * returned value.
500
- * @param key -
501
- * @return {@link dh.Column}
678
+ * a filter condition checking if the current value is greater than the given parameter
679
+ * @param term -
680
+ * @return {@link dh.FilterCondition}
502
681
  */
503
- findColumn(key:string):Column;
682
+ greaterThan(term:FilterValue):FilterCondition;
504
683
  /**
505
- * multiple columns specified by the given names.
506
- * @param keys -
507
- * @return {@link dh.Column} array
684
+ * a filter condition checking if the current value is less than the given parameter
685
+ * @param term -
686
+ * @return {@link dh.FilterCondition}
508
687
  */
509
- findColumns(keys:string[]):Column[];
688
+ lessThan(term:FilterValue):FilterCondition;
510
689
  /**
511
- * Indicates that the table will no longer be used, and resources used to provide it can be freed up on the server.
690
+ * a filter condition checking if the current value is greater than or equal to the given parameter
691
+ * @param term -
692
+ * @return {@link dh.FilterCondition}
512
693
  */
513
- close():void;
514
- addEventListener<T>(name:string, callback:(e:CustomEvent<T>)=>void):()=>void;
515
- removeEventListener<T>(name:string, callback:(e:CustomEvent<T>)=>void):boolean;
516
- nextEvent<T>(eventName:string, timeoutInMillis:number):Promise<CustomEvent<T>>;
517
- hasListeners(name:string):boolean;
694
+ greaterThanOrEqualTo(term:FilterValue):FilterCondition;
518
695
  /**
519
- * Replace the currently set sort on this table. Returns the previously set value. Note that the sort property will
520
- * immediately return the new value, but you may receive update events using the old sort before the new sort is
521
- * applied, and the <b>sortchanged</b> event fires. Reusing existing, applied sorts may enable this to perform
522
- * better on the server. The <b>updated</b> event will also fire, but <b>rowadded</b> and <b>rowremoved</b> will
523
- * not.
524
- * @param sort -
525
- * @return {@link dh.Sort} array
696
+ * a filter condition checking if the current value is less than or equal to the given parameter
697
+ * @param term -
698
+ * @return {@link dh.FilterCondition}
526
699
  */
527
- applySort(sort:Sort[]):Array<Sort>;
700
+ lessThanOrEqualTo(term:FilterValue):FilterCondition;
528
701
  /**
529
- * Replace the current custom columns with a new set. These columns can be used when adding new filter and sort
530
- * operations to the table, as long as they are present.
531
- * @param customColumns -
532
- * @return
702
+ * a filter condition checking if the current value is in the given set of values
703
+ * @param terms -
704
+ * @return {@link dh.FilterCondition}
533
705
  */
534
- applyCustomColumns(customColumns:Array<string|CustomColumn>):Array<CustomColumn>;
706
+ in(terms:FilterValue[]):FilterCondition;
535
707
  /**
536
- * Replace the currently set filters on the table. Returns the previously set value. Note that the filter property
537
- * will immediately return the new value, but you may receive update events using the old filter before the new one
538
- * is applied, and the <b>filterchanged</b> event fires. Reusing existing, applied filters may enable this to
539
- * perform better on the server. The <b>updated</b> event will also fire, but <b>rowadded</b> and <b>rowremoved</b>
540
- * will not.
541
- * @param filter -
542
- * @return {@link dh.FilterCondition} array
708
+ * a filter condition checking if the current value is in the given set of values, ignoring differences of upper vs
709
+ * lower case
710
+ * @param terms -
711
+ * @return {@link dh.FilterCondition}
543
712
  */
544
- applyFilter(filter:FilterCondition[]):Array<FilterCondition>;
713
+ inIgnoreCase(terms:FilterValue[]):FilterCondition;
545
714
  /**
546
- * An ordered list of Filters to apply to the table. To update, call applyFilter(). Note that this getter will
547
- * return the new value immediately, even though it may take a little time to update on the server. You may listen
548
- * for the <b>filterchanged</b> event to know when to update the UI.
549
- * @return {@link dh.FilterCondition} array
715
+ * a filter condition checking that the current value is not in the given set of values
716
+ * @param terms -
717
+ * @return {@link dh.FilterCondition}
550
718
  */
551
- get filter():Array<FilterCondition>;
719
+ notIn(terms:FilterValue[]):FilterCondition;
552
720
  /**
553
- * True if this table has been closed.
554
- * @return boolean
721
+ * a filter condition checking that the current value is not in the given set of values, ignoring differences of
722
+ * upper vs lower case
723
+ * @param terms -
724
+ * @return {@link dh.FilterCondition}
555
725
  */
556
- get isClosed():boolean;
726
+ notInIgnoreCase(terms:FilterValue[]):FilterCondition;
557
727
  /**
558
- * The total number of rows in this table. This may change as the base table's configuration, filter, or contents
559
- * change.
560
- * @return double
728
+ * a filter condition checking if the given value contains the given string value
729
+ * @param term -
730
+ * @return {@link dh.FilterCondition}
561
731
  */
562
- get size():number;
732
+ contains(term:FilterValue):FilterCondition;
563
733
  /**
564
- * The columns present on this table. Note that this may not include all columns in the parent table, and in cases
565
- * where a given column has more than one aggregation applied, the column name will have a suffix indicating the
566
- * aggregation used. This suffixed name will be of the form <b>columnName + '__' + aggregationName</b>.
567
- * @return {@link dh.Column} array
734
+ * a filter condition checking if the given value contains the given string value, ignoring differences of upper vs
735
+ * lower case
736
+ * @param term -
737
+ * @return {@link dh.FilterCondition}
568
738
  */
569
- get columns():Array<Column>;
570
- get totalsTableConfig():TotalsTableConfig;
739
+ containsIgnoreCase(term:FilterValue):FilterCondition;
571
740
  /**
572
- * An ordered list of Sorts to apply to the table. To update, call applySort(). Note that this getter will return
573
- * the new value immediately, even though it may take a little time to update on the server. You may listen for the
574
- * <b>sortchanged</b> event to know when to update the UI.
575
- * @return {@link dh.Sort} array
741
+ * a filter condition checking if the given value matches the provided regular expressions string. Regex patterns
742
+ * use Java regex syntax
743
+ * @param pattern -
744
+ * @return {@link dh.FilterCondition}
576
745
  */
577
- get sort():Array<Sort>;
746
+ matches(pattern:FilterValue):FilterCondition;
578
747
  /**
579
- * Read-only. An ordered list of custom column formulas to add to the table, either adding new columns or replacing
580
- * existing ones. To update, call <b>applyCustomColumns()</b>.
581
- * @return {@link dh.CustomColumn} array
748
+ * a filter condition checking if the given value matches the provided regular expressions string, ignoring
749
+ * differences of upper vs lower case. Regex patterns use Java regex syntax
750
+ * @param pattern -
751
+ * @return {@link dh.FilterCondition}
582
752
  */
583
- get customColumns():Array<CustomColumn>;
753
+ matchesIgnoreCase(pattern:FilterValue):FilterCondition;
584
754
  /**
585
- * True if this table may receive updates from the server, including size changed events, updated events after
586
- * initial snapshot.
587
- * @return boolean
755
+ * a filter condition checking if the current value is a true boolean
756
+ * @return {@link dh.FilterCondition}
588
757
  */
589
- get isRefreshing():boolean;
590
- }
591
- export interface TreeViewportData extends TableData {
592
- get offset():number;
593
- get columns():Array<Column>;
594
- get rows():Array<TreeRow>;
595
- }
596
-
597
- /**
598
- * Deprecated for use in Deephaven Core.
599
- * @deprecated
600
- */
601
- export class Client {
602
- static readonly EVENT_REQUEST_FAILED:string;
603
- static readonly EVENT_REQUEST_STARTED:string;
604
- static readonly EVENT_REQUEST_SUCCEEDED:string;
605
-
606
- constructor();
607
- }
608
-
609
- /**
610
- * Describes a filter which can be applied to a table. Replacing these instances may be more expensive than reusing
611
- * them. These instances are immutable - all operations that compose them to build bigger expressions return a new
612
- * instance.
613
- */
614
- export class FilterCondition {
615
- protected constructor();
616
-
758
+ isTrue():FilterCondition;
617
759
  /**
618
- * the opposite of this condition
619
- * @return FilterCondition
760
+ * a filter condition checking if the current value is a false boolean
761
+ * @return {@link dh.FilterCondition}
620
762
  */
621
- not():FilterCondition;
763
+ isFalse():FilterCondition;
622
764
  /**
623
- * a condition representing the current condition logically ANDed with the other parameters
624
- * @param filters -
625
- * @return FilterCondition
765
+ * a filter condition checking if the current value is a null value
766
+ * @return {@link dh.FilterCondition}
626
767
  */
627
- and(...filters:FilterCondition[]):FilterCondition;
768
+ isNull():FilterCondition;
628
769
  /**
629
- * a condition representing the current condition logically ORed with the other parameters
630
- * @param filters -
631
- * @return FilterCondition.
632
- */
633
- or(...filters:FilterCondition[]):FilterCondition;
770
+ * a filter condition invoking the given method on the current value, with the given parameters. Currently supported
771
+ * functions that can be invoked on a String:
772
+ * <ul>
773
+ * <li><b>startsWith</b>: Returns true if the current string value starts with the supplied string argument</li>
774
+ * <li><b>endsWith</b>: Returns true if the current string value ends with the supplied string argument</li>
775
+ * <li><b>matches</b>: Returns true if the current string value matches the supplied string argument used as a Java
776
+ * regular expression</li>
777
+ * <li><b>contains</b>: Returns true if the current string value contains the supplied string argument
778
+ * <p>
779
+ * When invoking against a constant, this should be avoided in favor of FilterValue.contains
780
+ * </p>
781
+ * </li>
782
+ * </ul>
783
+ * @param method -
784
+ * @param args -
785
+ * @return
786
+ */
787
+ invoke(method:string, ...args:FilterValue[]):FilterCondition;
788
+ toString():string;
789
+ /**
790
+ * Constructs a string for the filter API from the given parameter.
791
+ * @param input -
792
+ * @return
793
+ */
794
+ static ofString(input:any):FilterValue;
795
+ /**
796
+ * Constructs a boolean for the filter API from the given parameter.
797
+ * @param b -
798
+ * @return
799
+ */
800
+ static ofBoolean(b:boolean):FilterValue;
801
+ }
802
+
803
+
804
+ /**
805
+ * Exists to keep the dh.TableMap namespace so that the web UI can remain compatible with the DHE API, which still calls
806
+ * this type TableMap.
807
+ * @deprecated
808
+ */
809
+ export class TableMap {
810
+ static readonly EVENT_KEYADDED:string;
811
+ static readonly EVENT_DISCONNECT:string;
812
+ static readonly EVENT_RECONNECT:string;
813
+ static readonly EVENT_RECONNECTFAILED:string;
814
+
815
+ protected constructor();
816
+ }
817
+
818
+ /**
819
+ * Presently, this is the entrypoint into the Deephaven JS API. By creating an instance of this with the server URL and
820
+ * some options, JS applications can run code on the server, and interact with available exportable objects.
821
+ */
822
+ export class IdeConnection implements HasEventHandling {
823
+ /**
824
+ * @deprecated
825
+ */
826
+ static readonly HACK_CONNECTION_FAILURE:string;
827
+ static readonly EVENT_DISCONNECT:string;
828
+ static readonly EVENT_RECONNECT:string;
829
+ static readonly EVENT_SHUTDOWN:string;
830
+
831
+ /**
832
+ * creates a new instance, from which console sessions can be made. <b>options</b> are optional.
833
+ * @param serverUrl - The url used when connecting to the server. Read-only.
834
+ * @param connectOptions - Optional Object
835
+ * @param fromJava - Optional boolean
836
+ * @deprecated
837
+ */
838
+ constructor(serverUrl:string, connectOptions?:ConnectOptions, fromJava?:boolean);
839
+
840
+ /**
841
+ * closes the current connection, releasing any resources on the server or client.
842
+ */
843
+ close():void;
844
+ running():Promise<IdeConnection>;
845
+ getObject(definitionObject:dh.ide.VariableDescriptor):Promise<any>;
846
+ subscribeToFieldUpdates(callback:(arg0:dh.ide.VariableChanges)=>void):()=>void;
847
+ /**
848
+ * Register a callback function to handle any log messages that are emitted on the server. Returns a function ,
849
+ * which can be invoked to remove this log handler. Any log handler registered in this way will receive as many old
850
+ * log messages as are presently available.
851
+ * @param callback -
852
+ * @return {@link io.deephaven.web.shared.fu.JsRunnable}
853
+ */
854
+ onLogMessage(callback:(arg0:dh.ide.LogItem)=>void):()=>void;
855
+ startSession(type:string):Promise<IdeSession>;
856
+ getConsoleTypes():Promise<Array<string>>;
857
+ getWorkerHeapInfo():Promise<WorkerHeapInfo>;
858
+ /**
859
+ * Listen for events on this object.
860
+ * @param name - the name of the event to listen for
861
+ * @param callback - a function to call when the event occurs
862
+ * @return Returns a cleanup function.
863
+ * @typeParam T - the type of the data that the event will provide
864
+ */
865
+ addEventListener<T>(name:string, callback:(e:CustomEvent<T>)=>void):()=>void;
866
+ nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<CustomEvent<T>>;
867
+ hasListeners(name:string):boolean;
868
+ /**
869
+ * Removes an event listener added to this table.
870
+ * @param name -
871
+ * @param callback -
872
+ * @return
873
+ * @typeParam T -
874
+ */
875
+ removeEventListener<T>(name:string, callback:(e:CustomEvent<T>)=>void):boolean;
876
+ }
877
+
878
+ /**
879
+ * Wrap BigDecimal values for use in JS. Provides text formatting for display and access to the underlying value.
880
+ */
881
+ export class BigDecimalWrapper {
882
+ protected constructor();
883
+
884
+ static ofString(value:string):BigDecimalWrapper;
885
+ asNumber():number;
886
+ valueOf():string;
887
+ toString():string;
888
+ }
889
+
890
+ /**
891
+ * Event fired when a command is issued from the client.
892
+ */
893
+ export class CommandInfo {
894
+ constructor(code:string, result:Promise<dh.ide.CommandResult>);
895
+
896
+ get result():Promise<dh.ide.CommandResult>;
897
+ get code():string;
898
+ }
899
+
900
+ export class DateWrapper extends LongWrapper {
901
+ protected constructor();
902
+
903
+ static ofJsDate(date:Date):DateWrapper;
904
+ asDate():Date;
905
+ }
906
+
907
+ /**
908
+ * Describes a filter which can be applied to a table. Replacing these instances may be more expensive than reusing
909
+ * them. These instances are immutable - all operations that compose them to build bigger expressions return a new
910
+ * instance.
911
+ */
912
+ export class FilterCondition {
913
+ protected constructor();
914
+
915
+ /**
916
+ * the opposite of this condition
917
+ * @return FilterCondition
918
+ */
919
+ not():FilterCondition;
920
+ /**
921
+ * a condition representing the current condition logically ANDed with the other parameters
922
+ * @param filters -
923
+ * @return FilterCondition
924
+ */
925
+ and(...filters:FilterCondition[]):FilterCondition;
926
+ /**
927
+ * a condition representing the current condition logically ORed with the other parameters
928
+ * @param filters -
929
+ * @return FilterCondition.
930
+ */
931
+ or(...filters:FilterCondition[]):FilterCondition;
634
932
  /**
635
933
  * a string suitable for debugging showing the details of this condition.
636
934
  * @return String.
@@ -680,252 +978,199 @@ export namespace dh {
680
978
  }
681
979
 
682
980
  /**
683
- * A js type for operating on input tables.
684
- *
685
- * Represents a User Input Table, which can have data added to it from other sources.
686
- *
687
- * You may add rows using dictionaries of key-value tuples (representing columns by name), add tables containing all the
688
- * key/value columns to add, or delete tables containing the keys to delete. Each operation is atomic, and will either
689
- * succeed completely or fail completely. To guarantee order of operations, apply an operation and wait for the response
690
- * before sending the next operation.
691
- *
692
- * Each table has one or more key columns, where each unique combination of keys will appear at most once in the table.
693
- *
694
- * To view the results of the Input Table, you should use standard table operations on the InputTable's source Table
695
- * object.
981
+ * Behaves like a {@link dh.Table} externally, but data, state, and viewports are managed by an entirely different
982
+ * mechanism, and so reimplemented here.
983
+ * <p>
984
+ * Any time a change is made, we build a new request and send it to the server, and wait for the updated state.
985
+ * <p>
986
+ * Semantics around getting updates from the server are slightly different - we don't "unset" the viewport here after
987
+ * operations are performed, but encourage the client code to re-set them to the desired position.
988
+ * <p>
989
+ * The table size will be -1 until a viewport has been fetched.
990
+ * <p>
991
+ * Similar to a table, a Tree Table provides access to subscribed viewport data on the current hierarchy. A different
992
+ * Row type is used within that viewport, showing the depth of that node within the tree and indicating details about
993
+ * whether it has children or is expanded. The Tree Table itself then provides the ability to change if a row is
994
+ * expanded or not. Methods used to control or check if a row should be expanded or not can be invoked on a TreeRow
995
+ * instance, or on the number of the row (thus allowing for expanding/collapsing rows which are not currently visible in
996
+ * the viewport).
997
+ * <p>
998
+ * Events and viewports are somewhat different from tables, due to the expense of computing the expanded/collapsed rows
999
+ * and count of children at each level of the hierarchy, and differences in the data that is available.
1000
+ * <p>
1001
+ * <ul>
1002
+ * <li>There is no {@link Table.totalSize | totalSize} property.</li>
1003
+ * <li>The viewport is not un-set when changes are made to filter or sort, but changes will continue to be streamed in.
1004
+ * It is suggested that the viewport be changed to the desired position (usually the first N rows) after any filter/sort
1005
+ * change is made. Likewise, {@link getViewportData} will always return the most recent data, and will not wait if a
1006
+ * new operation is pending.</li>
1007
+ * <li>Custom columns are not directly supported. If the TreeTable was created client-side, the original Table can have
1008
+ * custom columns applied, and the TreeTable can be recreated.</li>
1009
+ * <li>Whereas Table has a {@link Table.totalsTableConfig} property, it is defined here as a method,
1010
+ * {@link getTotalsTableConfig}. This returns a promise so the config can be fetched asynchronously.</li>
1011
+ * <li>Totals Tables for trees vary in behavior between tree tables and roll-up tables. This behavior is based on the
1012
+ * original flat table used to produce the Tree Table - for a hierarchical table (i.e. Table.treeTable in the query
1013
+ * config), the totals will include non-leaf nodes (since they are themselves actual rows in the table), but in a
1014
+ * roll-up table, the totals only include leaf nodes (as non-leaf nodes are generated through grouping the contents of
1015
+ * the original table). Roll-ups also have the {@link dh.includeConstituents} property, indicating that a
1016
+ * {@link dh.Column} in the tree may have a {@link Column.constituentType} property reflecting that the type of cells
1017
+ * where {@link TreeRow.hasChildren} is false will be different from usual.</li>
1018
+ * </ul>
696
1019
  */
697
- export class InputTable {
698
- protected constructor();
699
-
1020
+ export class TreeTable implements HasEventHandling {
700
1021
  /**
701
- * Adds a single row to the table. For each key or value column name in the Input Table, we retrieve that javascript
702
- * property at that name and validate it can be put into the given column type.
703
- * @param row -
704
- * @param userTimeZone -
705
- * @return Promise of dh.InputTable
1022
+ * event.detail is the currently visible viewport data based on the active viewport configuration.
706
1023
  */
707
- addRow(row:{ [key: string]: any; }, userTimeZone?:string):Promise<InputTable>;
1024
+ static readonly EVENT_UPDATED:string;
708
1025
  /**
709
- * Add multiple rows to a table.
710
- * @param rows -
711
- * @param userTimeZone -
712
- * @return Promise of dh.InputTable
1026
+ * event.detail is the currently visible viewport data based on the active viewport configuration.
713
1027
  */
714
- addRows(rows:{ [key: string]: any; }[], userTimeZone?:string):Promise<InputTable>;
1028
+ static readonly EVENT_DISCONNECT:string;
715
1029
  /**
716
- * Add an entire table to this Input Table. Only column names that match the definition of the input table will be
717
- * copied, and all key columns must have values filled in. This only copies the current state of the source table;
718
- * future updates to the source table will not be reflected in the Input Table. The returned promise will be
719
- * resolved to the same InputTable instance this method was called upon once the server returns.
720
- * @param tableToAdd -
721
- * @return Promise of dh.InputTable
1030
+ * event.detail is the currently visible viewport data based on the active viewport configuration.
722
1031
  */
723
- addTable(tableToAdd:Table):Promise<InputTable>;
1032
+ static readonly EVENT_RECONNECT:string;
724
1033
  /**
725
- * Add multiple tables to this Input Table.
726
- * @param tablesToAdd -
727
- * @return Promise of dh.InputTable
1034
+ * event.detail is the currently visible viewport data based on the active viewport configuration.
728
1035
  */
729
- addTables(tablesToAdd:Table[]):Promise<InputTable>;
1036
+ static readonly EVENT_RECONNECTFAILED:string;
730
1037
  /**
731
- * Deletes an entire table from this Input Table. Key columns must match the Input Table.
732
- * @param tableToDelete -
733
- * @return Promise of dh.InputTable
1038
+ * event.detail is the currently visible viewport data based on the active viewport configuration.
734
1039
  */
735
- deleteTable(tableToDelete:Table):Promise<InputTable>;
736
- /**
737
- * Delete multiple tables from this Input Table.
738
- * @param tablesToDelete -
739
- * @return
740
- */
741
- deleteTables(tablesToDelete:Table[]):Promise<InputTable>;
742
- /**
743
- * A list of the key columns, by name
744
- * @return String array.
745
- */
746
- get keys():string[];
747
- /**
748
- * A list of the value columns, by name
749
- * @return String array.
750
- */
751
- get values():string[];
752
- /**
753
- * A list of the key Column objects
754
- * @return {@link dh.Column} array.
755
- */
756
- get keyColumns():Column[];
757
- /**
758
- * A list of the value Column objects
759
- * @return {@link dh.Column} array.
760
- */
761
- get valueColumns():Column[];
762
- /**
763
- * The source table for this Input Table
764
- * @return dh.table
765
- */
766
- get table():Table;
767
- }
768
-
769
- /**
770
- * Describes the structure of the column, and if desired can be used to get access to the data to be rendered in this
771
- * column.
772
- */
773
- export class Column {
774
- /**
775
- * If this column is part of a roll-up tree table, represents the type of the row data that can be found in this
776
- * column for leaf nodes if includeConstituents is enabled. Otherwise, it is <b>null</b>.
777
- * @return String
778
- */
779
- readonly constituentType?:string|null;
1040
+ static readonly EVENT_REQUEST_FAILED:string;
780
1041
  readonly description?:string|null;
1042
+ readonly layoutHints?:null|LayoutHints;
781
1043
 
782
1044
  protected constructor();
783
1045
 
784
1046
  /**
785
- * the value for this column in the given row. Type will be consistent with the type of the Column.
1047
+ * Expands the given node, so that its children are visible when they are in the viewport. The parameter can be the
1048
+ * row index, or the row object itself. The second parameter is a boolean value, false by default, specifying if the
1049
+ * row and all descendants should be fully expanded. Equivalent to `setExpanded(row, true)` with an optional third
1050
+ * boolean parameter.
786
1051
  * @param row -
787
- * @return Any
788
- */
789
- get(row:Row):any;
790
- getFormat(row:Row):Format;
791
- /**
792
- * Creates a sort builder object, to be used when sorting by this column.
793
- * @return {@link dh.Sort}
794
- */
795
- sort():Sort;
796
- /**
797
- * Creates a new value for use in filters based on this column. Used either as a parameter to another filter
798
- * operation, or as a builder to create a filter operation.
799
- * @return {@link dh.FilterValue}
800
- */
801
- filter():FilterValue;
802
- /**
803
- * a <b>CustomColumn</b> object to apply using `applyCustomColumns` with the expression specified.
804
- * @param expression -
805
- * @return {@link dh.CustomColumn}
806
- */
807
- formatColor(expression:string):CustomColumn;
808
- /**
809
- * a <b>CustomColumn</b> object to apply using <b>applyCustomColumns</b> with the expression specified.
810
- * @param expression -
811
- * @return {@link dh.CustomColumn}
1052
+ * @param expandDescendants -
812
1053
  */
813
- formatNumber(expression:string):CustomColumn;
1054
+ expand(row:TreeRow|number, expandDescendants?:boolean):void;
814
1055
  /**
815
- * a <b>CustomColumn</b> object to apply using <b>applyCustomColumns</b> with the expression specified.
816
- * @param expression -
817
- * @return {@link dh.CustomColumn}
1056
+ * Collapses the given node, so that its children and descendants are not visible in the size or the viewport. The
1057
+ * parameter can be the row index, or the row object itself. Equivalent to <b>setExpanded(row, false, false)</b>.
1058
+ * @param row -
818
1059
  */
819
- formatDate(expression:string):CustomColumn;
820
- toString():string;
1060
+ collapse(row:TreeRow|number):void;
821
1061
  /**
822
- * Label for this column.
823
- * @return String
1062
+ * Specifies if the given node should be expanded or collapsed. If this node has children, and the value is changed,
1063
+ * the size of the table will change. If node is to be expanded and the third parameter, <b>expandDescendants</b>,
1064
+ * is true, then its children will also be expanded.
1065
+ * @param row -
1066
+ * @param isExpanded -
1067
+ * @param expandDescendants -
824
1068
  */
825
- get name():string;
1069
+ setExpanded(row:TreeRow|number, isExpanded:boolean, expandDescendants?:boolean):void;
1070
+ expandAll():void;
1071
+ collapseAll():void;
826
1072
  /**
827
- * True if this column is a partition column. Partition columns are used for filtering uncoalesced tables (see
828
- * <b>isUncoalesced</b> property on <b>Table</b>)
1073
+ * true if the given row is expanded, false otherwise. Equivalent to `TreeRow.isExpanded`, if an instance of the row
1074
+ * is available
1075
+ * @param row -
829
1076
  * @return boolean
830
1077
  */
831
- get isPartitionColumn():boolean;
832
- /**
833
- *
834
- * @deprecated do not use. Internal index of the column in the table, to be used as a key on the Row.
835
- * @return int
836
- */
837
- get index():number;
838
- get isSortable():boolean;
839
- /**
840
- * Type of the row data that can be found in this column.
841
- * @return String
842
- */
843
- get type():string;
1078
+ isExpanded(row:TreeRow|number):boolean;
1079
+ setViewport(firstRow:number, lastRow:number, columns?:Array<Column>|undefined|null, updateInterval?:number|undefined|null):void;
1080
+ getViewportData():Promise<TreeViewportData>;
844
1081
  /**
845
- * Format entire rows colors using the expression specified. Returns a <b>CustomColumn</b> object to apply to a
846
- * table using <b>applyCustomColumns</b> with the parameters specified.
847
- * @param expression -
848
- * @return {@link dh.CustomColumn}
1082
+ * Indicates that the table will no longer be used, and server resources can be freed.
849
1083
  */
850
- static formatRowColor(expression:string):CustomColumn;
1084
+ close():void;
1085
+ typedTicket():dhinternal.io.deephaven.proto.ticket_pb.TypedTicket;
851
1086
  /**
852
- * a <b>CustomColumn</b> object to apply using <b>applyCustomColumns</b> with the expression specified.
853
- * @param name -
854
- * @param expression -
855
- * @return {@link dh.CustomColumn}
1087
+ * Applies the given sort to all levels of the tree. Returns the previous sort in use.
1088
+ * @param sort -
1089
+ * @return {@link dh.Sort} array
856
1090
  */
857
- static createCustomColumn(name:string, expression:string):CustomColumn;
858
- }
859
-
860
- /**
861
- * Represents a set of Tables each corresponding to some key. The keys are available locally, but a call must be made to
862
- * the server to get each Table. All tables will have the same structure.
863
- */
864
- export class PartitionedTable implements HasEventHandling {
1091
+ applySort(sort:Sort[]):Array<Sort>;
865
1092
  /**
866
- * Indicates that a new key has been added to the array of keys, which can now be fetched with getTable.
1093
+ * Applies the given filter to the contents of the tree in such a way that if any node is visible, then any parent
1094
+ * node will be visible as well even if that parent node would not normally be visible due to the filter's
1095
+ * condition. Returns the previous sort in use.
1096
+ * @param filter -
1097
+ * @return {@link dh.FilterCondition} array
867
1098
  */
868
- static readonly EVENT_KEYADDED:string;
1099
+ applyFilter(filter:FilterCondition[]):Array<FilterCondition>;
869
1100
  /**
870
- * Indicates that a new key has been added to the array of keys, which can now be fetched with getTable.
1101
+ * a column with the given name, or throws an exception if it cannot be found
1102
+ * @param key -
1103
+ * @return {@link dh.Column}
871
1104
  */
872
- static readonly EVENT_DISCONNECT:string;
1105
+ findColumn(key:string):Column;
873
1106
  /**
874
- * Indicates that a new key has been added to the array of keys, which can now be fetched with getTable.
1107
+ * an array with all of the named columns in order, or throws an exception if one cannot be found.
1108
+ * @param keys -
1109
+ * @return {@link dh.Column} array
875
1110
  */
876
- static readonly EVENT_RECONNECT:string;
1111
+ findColumns(keys:string[]):Column[];
877
1112
  /**
878
- * Indicates that a new key has been added to the array of keys, which can now be fetched with getTable.
1113
+ * Provides Table-like selectDistinct functionality, but with a few quirks, since it is only fetching the distinct
1114
+ * values for the given columns in the source table:
1115
+ * <ul>
1116
+ * <li>Rollups may make no sense, since values are aggregated.</li>
1117
+ * <li>Values found on orphaned (and removed) nodes will show up in the resulting table, even though they are not in
1118
+ * the tree.</li>
1119
+ * <li>Values found on parent nodes which are only present in the tree since a child is visible will not be present
1120
+ * in the resulting table.</li>
1121
+ * </ul>
879
1122
  */
880
- static readonly EVENT_RECONNECTFAILED:string;
881
-
882
- protected constructor();
883
-
884
- typedTicket():dhinternal.io.deephaven.proto.ticket_pb.TypedTicket;
1123
+ selectDistinct(columns:Column[]):Promise<Table>;
1124
+ getTotalsTableConfig():Promise<TotalsTableConfig>;
1125
+ getTotalsTable(config?:object):Promise<TotalsTable>;
1126
+ getGrandTotalsTable(config?:object):Promise<TotalsTable>;
885
1127
  /**
886
- * Fetch the table with the given key.
887
- * @param key - The key to fetch. An array of values for each key column, in the same order as the key columns are.
888
- * @return Promise of dh.Table
1128
+ * a new copy of this treetable, so it can be sorted and filtered separately, and maintain a different viewport.
1129
+ * Unlike Table, this will _not_ copy the filter or sort, since tree table viewport semantics differ, and without a
1130
+ * viewport set, the treetable doesn't evaluate these settings, and they aren't readable on the properties. Expanded
1131
+ * state is also not copied.
1132
+ * @return Promise of dh.TreeTable
889
1133
  */
890
- getTable(key:object):Promise<Table>;
1134
+ copy():Promise<TreeTable>;
891
1135
  /**
892
- * Open a new table that is the result of merging all constituent tables. See
893
- * {@link io.deephaven.engine.table.PartitionedTable#merge()} for details.
894
- * @return A merged representation of the constituent tables.
1136
+ * The current filter configuration of this Tree Table.
1137
+ * @return {@link dh.FilterCondition} array
895
1138
  */
896
- getMergedTable():Promise<Table>;
1139
+ get filter():Array<FilterCondition>;
897
1140
  /**
898
- * The set of all currently known keys. This is kept up to date, so getting the list after adding an event listener
899
- * for <b>keyadded</b> will ensure no keys are missed.
900
- * @return Set of Object
1141
+ * True if this is a roll-up and will provide the original rows that make up each grouping.
1142
+ * @return boolean
901
1143
  */
902
- getKeys():Set<object>;
1144
+ get includeConstituents():boolean;
1145
+ get groupedColumns():Array<Column>;
903
1146
  /**
904
- * Fetch a table containing all the valid keys of the partitioned table.
905
- * @return Promise of a Table
1147
+ * True if this table has been closed.
1148
+ * @return boolean
906
1149
  */
907
- getKeyTable():Promise<Table>;
1150
+ get isClosed():boolean;
908
1151
  /**
909
- * Indicates that this PartitionedTable will no longer be used, removing subcriptions to updated keys, etc. This
910
- * will not affect tables in use.
1152
+ * The current number of rows given the table's contents and the various expand/collapse states of each node. (No
1153
+ * totalSize is provided at this time; its definition becomes unclear between roll-up and tree tables, especially
1154
+ * when considering collapse/expand states).
1155
+ * @return double
911
1156
  */
912
- close():void;
1157
+ get size():number;
913
1158
  /**
914
- * The count of known keys.
915
- * @return int
1159
+ * The columns that can be shown in this Tree Table.
1160
+ * @return {@link dh.Column} array
916
1161
  */
917
- get size():number;
1162
+ get columns():Array<Column>;
918
1163
  /**
919
- * An array of the columns in the tables that can be retrieved from this partitioned table, including both key and
920
- * non-key columns.
921
- * @return Array of Column
1164
+ * The current sort configuration of this Tree Table
1165
+ * @return {@link dh.Sort} array.
922
1166
  */
923
- get columns():Column[];
1167
+ get sort():Array<Sort>;
924
1168
  /**
925
- * An array of all the key columns that the tables are partitioned by.
926
- * @return Array of Column
1169
+ * True if this table may receive updates from the server, including size changed events, updated events after
1170
+ * initial snapshot.
1171
+ * @return boolean
927
1172
  */
928
- get keyColumns():Column[];
1173
+ get isRefreshing():boolean;
929
1174
  /**
930
1175
  * Listen for events on this object.
931
1176
  * @param name - the name of the event to listen for
@@ -947,581 +1192,235 @@ export namespace dh {
947
1192
  }
948
1193
 
949
1194
  /**
950
- * Behaves like a {@link dh.Table} externally, but data, state, and viewports are managed by an entirely different
951
- * mechanism, and so reimplemented here.
952
- * <p>
953
- * Any time a change is made, we build a new request and send it to the server, and wait for the updated state.
954
- * <p>
955
- * Semantics around getting updates from the server are slightly different - we don't "unset" the viewport here after
956
- * operations are performed, but encourage the client code to re-set them to the desired position.
957
- * <p>
958
- * The table size will be -1 until a viewport has been fetched.
959
- * <p>
960
- * Similar to a table, a Tree Table provides access to subscribed viewport data on the current hierarchy. A different
961
- * Row type is used within that viewport, showing the depth of that node within the tree and indicating details about
962
- * whether it has children or is expanded. The Tree Table itself then provides the ability to change if a row is
963
- * expanded or not. Methods used to control or check if a row should be expanded or not can be invoked on a TreeRow
964
- * instance, or on the number of the row (thus allowing for expanding/collapsing rows which are not currently visible in
965
- * the viewport).
966
- * <p>
967
- * Events and viewports are somewhat different from tables, due to the expense of computing the expanded/collapsed rows
968
- * and count of children at each level of the hierarchy, and differences in the data that is available.
969
- * <p>
970
- * <ul>
971
- * <li>There is no {@link Table.totalSize | totalSize} property.</li>
972
- * <li>The viewport is not un-set when changes are made to filter or sort, but changes will continue to be streamed in.
973
- * It is suggested that the viewport be changed to the desired position (usually the first N rows) after any filter/sort
974
- * change is made. Likewise, {@link getViewportData} will always return the most recent data, and will not wait if a
975
- * new operation is pending.</li>
976
- * <li>Custom columns are not directly supported. If the TreeTable was created client-side, the original Table can have
977
- * custom columns applied, and the TreeTable can be recreated.</li>
978
- * <li>Whereas Table has a {@link Table.totalsTableConfig} property, it is defined here as a method,
979
- * {@link getTotalsTableConfig}. This returns a promise so the config can be fetched asynchronously.</li>
980
- * <li>Totals Tables for trees vary in behavior between tree tables and roll-up tables. This behavior is based on the
981
- * original flat table used to produce the Tree Table - for a hierarchical table (i.e. Table.treeTable in the query
982
- * config), the totals will include non-leaf nodes (since they are themselves actual rows in the table), but in a
983
- * roll-up table, the totals only include leaf nodes (as non-leaf nodes are generated through grouping the contents of
984
- * the original table). Roll-ups also have the {@link dh.includeConstituents} property, indicating that a
985
- * {@link dh.Column} in the tree may have a {@link Column.constituentType} property reflecting that the type of cells
986
- * where {@link TreeRow.hasChildren} is false will be different from usual.</li>
987
- * </ul>
1195
+ * Represents a non-viewport subscription to a table, and all data currently known to be present in the subscribed
1196
+ * columns. This class handles incoming snapshots and deltas, and fires events to consumers to notify of data changes.
1197
+ *
1198
+ * Unlike {@link dh.TableViewportSubscription}, the "original" table does not have a reference to this instance, only the
1199
+ * "private" table instance does, since the original cannot modify the subscription, and the private instance must
1200
+ * forward data to it.
1201
+ *
1202
+ * Represents a subscription to the table on the server. Changes made to the table will not be reflected here - the
1203
+ * subscription must be closed and a new one optioned to see those changes. The event model is slightly different from
1204
+ * viewports to make it less expensive to compute for large tables.
988
1205
  */
989
- export class TreeTable implements HasEventHandling {
1206
+ export class TableSubscription implements HasEventHandling {
990
1207
  /**
991
- * event.detail is the currently visible viewport data based on the active viewport configuration.
1208
+ * Indicates that some new data is available on the client, either an initial snapshot or a delta update. The
1209
+ * <b>detail</b> field of the event will contain a TableSubscriptionEventData detailing what has changed, or
1210
+ * allowing access to the entire range of items currently in the subscribed columns.
992
1211
  */
993
1212
  static readonly EVENT_UPDATED:string;
994
- /**
995
- * event.detail is the currently visible viewport data based on the active viewport configuration.
996
- */
997
- static readonly EVENT_DISCONNECT:string;
998
- /**
999
- * event.detail is the currently visible viewport data based on the active viewport configuration.
1000
- */
1001
- static readonly EVENT_RECONNECT:string;
1002
- /**
1003
- * event.detail is the currently visible viewport data based on the active viewport configuration.
1004
- */
1005
- static readonly EVENT_RECONNECTFAILED:string;
1006
- /**
1007
- * event.detail is the currently visible viewport data based on the active viewport configuration.
1008
- */
1009
- static readonly EVENT_REQUEST_FAILED:string;
1010
- readonly description?:string|null;
1011
-
1012
- protected constructor();
1013
-
1014
- /**
1015
- * Expands the given node, so that its children are visible when they are in the viewport. The parameter can be the
1016
- * row index, or the row object itself. The second parameter is a boolean value, false by default, specifying if the
1017
- * row and all descendants should be fully expanded. Equivalent to `setExpanded(row, true)` with an optional third
1018
- * boolean parameter.
1019
- * @param row -
1020
- * @param expandDescendants -
1021
- */
1022
- expand(row:TreeRow|number, expandDescendants?:boolean):void;
1023
- /**
1024
- * Collapses the given node, so that its children and descendants are not visible in the size or the viewport. The
1025
- * parameter can be the row index, or the row object itself. Equivalent to <b>setExpanded(row, false, false)</b>.
1026
- * @param row -
1027
- */
1028
- collapse(row:TreeRow|number):void;
1029
- /**
1030
- * Specifies if the given node should be expanded or collapsed. If this node has children, and the value is changed,
1031
- * the size of the table will change. If node is to be expanded and the third parameter, <b>expandDescendants</b>,
1032
- * is true, then its children will also be expanded.
1033
- * @param row -
1034
- * @param isExpanded -
1035
- * @param expandDescendants -
1036
- */
1037
- setExpanded(row:TreeRow|number, isExpanded:boolean, expandDescendants?:boolean):void;
1038
- expandAll():void;
1039
- collapseAll():void;
1040
- /**
1041
- * true if the given row is expanded, false otherwise. Equivalent to `TreeRow.isExpanded`, if an instance of the row
1042
- * is available
1043
- * @param row -
1044
- * @return boolean
1045
- */
1046
- isExpanded(row:TreeRow|number):boolean;
1047
- setViewport(firstRow:number, lastRow:number, columns?:Array<Column>|undefined|null, updateInterval?:number|undefined|null):void;
1048
- getViewportData():Promise<TreeViewportData>;
1049
- /**
1050
- * Indicates that the table will no longer be used, and server resources can be freed.
1051
- */
1052
- close():void;
1053
- typedTicket():dhinternal.io.deephaven.proto.ticket_pb.TypedTicket;
1054
- /**
1055
- * Applies the given sort to all levels of the tree. Returns the previous sort in use.
1056
- * @param sort -
1057
- * @return {@link dh.Sort} array
1058
- */
1059
- applySort(sort:Sort[]):Array<Sort>;
1060
- /**
1061
- * Applies the given filter to the contents of the tree in such a way that if any node is visible, then any parent
1062
- * node will be visible as well even if that parent node would not normally be visible due to the filter's
1063
- * condition. Returns the previous sort in use.
1064
- * @param filter -
1065
- * @return {@link dh.FilterCondition} array
1066
- */
1067
- applyFilter(filter:FilterCondition[]):Array<FilterCondition>;
1068
- /**
1069
- * a column with the given name, or throws an exception if it cannot be found
1070
- * @param key -
1071
- * @return {@link dh.Column}
1072
- */
1073
- findColumn(key:string):Column;
1074
- /**
1075
- * an array with all of the named columns in order, or throws an exception if one cannot be found.
1076
- * @param keys -
1077
- * @return {@link dh.Column} array
1078
- */
1079
- findColumns(keys:string[]):Column[];
1080
- /**
1081
- * Provides Table-like selectDistinct functionality, but with a few quirks, since it is only fetching the distinct
1082
- * values for the given columns in the source table:
1083
- * <ul>
1084
- * <li>Rollups may make no sense, since values are aggregated.</li>
1085
- * <li>Values found on orphaned (and removed) nodes will show up in the resulting table, even though they are not in
1086
- * the tree.</li>
1087
- * <li>Values found on parent nodes which are only present in the tree since a child is visible will not be present
1088
- * in the resulting table.</li>
1089
- * </ul>
1090
- */
1091
- selectDistinct(columns:Column[]):Promise<Table>;
1092
- getTotalsTableConfig():Promise<TotalsTableConfig>;
1093
- getTotalsTable(config?:object):Promise<TotalsTable>;
1094
- getGrandTotalsTable(config?:object):Promise<TotalsTable>;
1095
- /**
1096
- * a new copy of this treetable, so it can be sorted and filtered separately, and maintain a different viewport.
1097
- * Unlike Table, this will _not_ copy the filter or sort, since tree table viewport semantics differ, and without a
1098
- * viewport set, the treetable doesn't evaluate these settings, and they aren't readable on the properties. Expanded
1099
- * state is also not copied.
1100
- * @return Promise of dh.TreeTable
1101
- */
1102
- copy():Promise<TreeTable>;
1103
- /**
1104
- * The current filter configuration of this Tree Table.
1105
- * @return {@link dh.FilterCondition} array
1106
- */
1107
- get filter():Array<FilterCondition>;
1108
- /**
1109
- * True if this is a roll-up and will provide the original rows that make up each grouping.
1110
- * @return boolean
1111
- */
1112
- get includeConstituents():boolean;
1113
- get groupedColumns():Array<Column>;
1114
- /**
1115
- * True if this table has been closed.
1116
- * @return boolean
1117
- */
1118
- get isClosed():boolean;
1119
- /**
1120
- * The current number of rows given the table's contents and the various expand/collapse states of each node. (No
1121
- * totalSize is provided at this time; its definition becomes unclear between roll-up and tree tables, especially
1122
- * when considering collapse/expand states).
1123
- * @return double
1124
- */
1125
- get size():number;
1126
- /**
1127
- * The columns that can be shown in this Tree Table.
1128
- * @return {@link dh.Column} array
1129
- */
1130
- get columns():Array<Column>;
1131
- /**
1132
- * The current sort configuration of this Tree Table
1133
- * @return {@link dh.Sort} array.
1134
- */
1135
- get sort():Array<Sort>;
1136
- /**
1137
- * True if this table may receive updates from the server, including size changed events, updated events after
1138
- * initial snapshot.
1139
- * @return boolean
1140
- */
1141
- get isRefreshing():boolean;
1142
- /**
1143
- * Listen for events on this object.
1144
- * @param name - the name of the event to listen for
1145
- * @param callback - a function to call when the event occurs
1146
- * @return Returns a cleanup function.
1147
- * @typeParam T - the type of the data that the event will provide
1148
- */
1149
- addEventListener<T>(name:string, callback:(e:CustomEvent<T>)=>void):()=>void;
1150
- nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<CustomEvent<T>>;
1151
- hasListeners(name:string):boolean;
1152
- /**
1153
- * Removes an event listener added to this table.
1154
- * @param name -
1155
- * @param callback -
1156
- * @return
1157
- * @typeParam T -
1158
- */
1159
- removeEventListener<T>(name:string, callback:(e:CustomEvent<T>)=>void):boolean;
1160
- }
1161
-
1162
-
1163
- /**
1164
- * Presently, this is the entrypoint into the Deephaven JS API. By creating an instance of this with the server URL and
1165
- * some options, JS applications can run code on the server, and interact with available exportable objects.
1166
- */
1167
- export class IdeConnection implements HasEventHandling {
1168
- /**
1169
- * @deprecated
1170
- */
1171
- static readonly HACK_CONNECTION_FAILURE:string;
1172
- static readonly EVENT_DISCONNECT:string;
1173
- static readonly EVENT_RECONNECT:string;
1174
- static readonly EVENT_SHUTDOWN:string;
1175
-
1176
- /**
1177
- * creates a new instance, from which console sessions can be made. <b>options</b> are optional.
1178
- * @param serverUrl - The url used when connecting to the server. Read-only.
1179
- * @param connectOptions - Optional Object
1180
- * @param fromJava - Optional boolean
1181
- * @deprecated
1182
- */
1183
- constructor(serverUrl:string, connectOptions?:ConnectOptions, fromJava?:boolean);
1184
-
1185
- /**
1186
- * closes the current connection, releasing any resources on the server or client.
1187
- */
1188
- close():void;
1189
- running():Promise<IdeConnection>;
1190
- getObject(definitionObject:dh.ide.VariableDescriptor):Promise<any>;
1191
- subscribeToFieldUpdates(callback:(arg0:dh.ide.VariableChanges)=>void):()=>void;
1192
- /**
1193
- * Register a callback function to handle any log messages that are emitted on the server. Returns a function ,
1194
- * which can be invoked to remove this log handler. Any log handler registered in this way will receive as many old
1195
- * log messages as are presently available.
1196
- * @param callback -
1197
- * @return {@link io.deephaven.web.shared.fu.JsRunnable}
1198
- */
1199
- onLogMessage(callback:(arg0:dh.ide.LogItem)=>void):()=>void;
1200
- startSession(type:string):Promise<IdeSession>;
1201
- getConsoleTypes():Promise<Array<string>>;
1202
- getWorkerHeapInfo():Promise<WorkerHeapInfo>;
1203
- /**
1204
- * Listen for events on this object.
1205
- * @param name - the name of the event to listen for
1206
- * @param callback - a function to call when the event occurs
1207
- * @return Returns a cleanup function.
1208
- * @typeParam T - the type of the data that the event will provide
1209
- */
1210
- addEventListener<T>(name:string, callback:(e:CustomEvent<T>)=>void):()=>void;
1211
- nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<CustomEvent<T>>;
1212
- hasListeners(name:string):boolean;
1213
- /**
1214
- * Removes an event listener added to this table.
1215
- * @param name -
1216
- * @param callback -
1217
- * @return
1218
- * @typeParam T -
1219
- */
1220
- removeEventListener<T>(name:string, callback:(e:CustomEvent<T>)=>void):boolean;
1221
- }
1222
-
1223
- export class CoreClient implements HasEventHandling {
1224
- static readonly EVENT_CONNECT:string;
1225
- static readonly EVENT_DISCONNECT:string;
1226
- static readonly EVENT_RECONNECT:string;
1227
- static readonly EVENT_RECONNECT_AUTH_FAILED:string;
1228
- static readonly EVENT_REFRESH_TOKEN_UPDATED:string;
1229
- static readonly EVENT_REQUEST_FAILED:string;
1230
- static readonly EVENT_REQUEST_STARTED:string;
1231
- static readonly EVENT_REQUEST_SUCCEEDED:string;
1232
- static readonly LOGIN_TYPE_PASSWORD:string;
1233
- static readonly LOGIN_TYPE_ANONYMOUS:string;
1234
-
1235
- constructor(serverUrl:string, connectOptions?:ConnectOptions);
1236
-
1237
- running():Promise<CoreClient>;
1238
- getServerUrl():string;
1239
- getAuthConfigValues():Promise<string[][]>;
1240
- login(credentials:LoginCredentials):Promise<void>;
1241
- relogin(token:RefreshToken):Promise<void>;
1242
- onConnected(timeoutInMillis?:number):Promise<void>;
1243
- getServerConfigValues():Promise<string[][]>;
1244
- getStorageService():dh.storage.StorageService;
1245
- getAsIdeConnection():Promise<IdeConnection>;
1246
- disconnect():void;
1247
- addEventListener<T>(name:string, callback:(e:CustomEvent<T>)=>void):()=>void;
1248
- nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<CustomEvent<T>>;
1249
- hasListeners(name:string):boolean;
1250
- removeEventListener<T>(name:string, callback:(e:CustomEvent<T>)=>void):boolean;
1251
- }
1252
-
1253
- /**
1254
- * Event fired when a command is issued from the client.
1255
- */
1256
- export class CommandInfo {
1257
- constructor(code:string, result:Promise<dh.ide.CommandResult>);
1258
-
1259
- get result():Promise<dh.ide.CommandResult>;
1260
- get code():string;
1261
- }
1262
-
1263
- export class CustomColumn {
1264
- static readonly TYPE_FORMAT_COLOR:string;
1265
- static readonly TYPE_FORMAT_NUMBER:string;
1266
- static readonly TYPE_FORMAT_DATE:string;
1267
- static readonly TYPE_NEW:string;
1268
1213
 
1269
1214
  protected constructor();
1270
1215
 
1271
- valueOf():string;
1272
- toString():string;
1273
- /**
1274
- * The expression to evaluate this custom column.
1275
- * @return String
1276
- */
1277
- get expression():string;
1278
- /**
1279
- * The name of the column to use.
1280
- * @return String
1281
- */
1282
- get name():string;
1283
- /**
1284
- * Type of custom column. One of
1285
- *
1286
- * <ul>
1287
- * <li>FORMAT_COLOR</li>
1288
- * <li>FORMAT_NUMBER</li>
1289
- * <li>FORMAT_DATE</li>
1290
- * <li>NEW</li>
1291
- * </ul>
1292
- * @return String
1293
- */
1294
- get type():string;
1295
- }
1296
-
1297
- /**
1298
- * Configuration object for running Table.treeTable to produce a hierarchical view of a given "flat" table.
1299
- *
1300
- * Like TotalsTableConfig, `TreeTableConfig` supports an operation map indicating how to aggregate the data, as well as
1301
- * an array of column names which will be the layers in the roll-up tree, grouped at each level. An additional optional
1302
- * value can be provided describing the strategy the engine should use when grouping the rows.
1303
- */
1304
- export class TreeTableConfig {
1305
1216
  /**
1306
- * The column representing the unique ID for each item
1307
- */
1308
- idColumn:string;
1309
- /**
1310
- * The column representing the parent ID for each item
1217
+ * Stops the subscription on the server.
1311
1218
  */
1312
- parentColumn:string;
1219
+ close():void;
1220
+ addEventListener<T>(name:string, callback:(e:CustomEvent<T>)=>void):()=>void;
1221
+ nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<CustomEvent<T>>;
1222
+ hasListeners(name:string):boolean;
1223
+ removeEventListener<T>(name:string, callback:(e:CustomEvent<T>)=>void):boolean;
1313
1224
  /**
1314
- * Optional parameter indicating if items with an invalid parent ID should be promoted to root. Defaults to false.
1225
+ * The columns that were subscribed to when this subscription was created
1226
+ * @return {@link dh.Column}
1315
1227
  */
1316
- promoteOrphansToRoot:boolean;
1317
-
1318
- constructor();
1228
+ get columns():Array<Column>;
1319
1229
  }
1320
1230
 
1321
1231
  /**
1322
- * Wrap BigDecimal values for use in JS. Provides text formatting for display and access to the underlying value.
1232
+ * Presently optional and not used by the server, this allows the client to specify some authentication details. String
1233
+ * authToken <i>- base 64 encoded auth token. String serviceId -</i> The service ID to use for the connection.
1323
1234
  */
1324
- export class BigDecimalWrapper {
1325
- protected constructor();
1235
+ export class ConnectOptions {
1236
+ headers:{ [key: string]: string; };
1326
1237
 
1327
- static ofString(value:string):BigDecimalWrapper;
1328
- asNumber():number;
1329
- valueOf():string;
1330
- toString():string;
1238
+ constructor();
1331
1239
  }
1332
1240
 
1333
- export class QueryInfo {
1334
- static readonly EVENT_TABLE_OPENED:string;
1241
+ export class CoreClient implements HasEventHandling {
1242
+ static readonly EVENT_CONNECT:string;
1335
1243
  static readonly EVENT_DISCONNECT:string;
1336
1244
  static readonly EVENT_RECONNECT:string;
1337
- static readonly EVENT_CONNECT:string;
1338
-
1339
- protected constructor();
1340
- }
1245
+ static readonly EVENT_RECONNECT_AUTH_FAILED:string;
1246
+ static readonly EVENT_REFRESH_TOKEN_UPDATED:string;
1247
+ static readonly EVENT_REQUEST_FAILED:string;
1248
+ static readonly EVENT_REQUEST_STARTED:string;
1249
+ static readonly EVENT_REQUEST_SUCCEEDED:string;
1250
+ static readonly LOGIN_TYPE_PASSWORD:string;
1251
+ static readonly LOGIN_TYPE_ANONYMOUS:string;
1341
1252
 
1342
- export class Ide {
1343
- constructor();
1253
+ constructor(serverUrl:string, connectOptions?:ConnectOptions);
1344
1254
 
1345
- /**
1346
- * @deprecated
1347
- */
1348
- getExistingSession(websocketUrl:string, authToken:string, serviceId:string, language:string):Promise<IdeSession>;
1349
- /**
1350
- * @deprecated
1351
- */
1352
- static getExistingSession(websocketUrl:string, authToken:string, serviceId:string, language:string):Promise<IdeSession>;
1255
+ running():Promise<CoreClient>;
1256
+ getServerUrl():string;
1257
+ getAuthConfigValues():Promise<string[][]>;
1258
+ login(credentials:LoginCredentials):Promise<void>;
1259
+ relogin(token:RefreshToken):Promise<void>;
1260
+ onConnected(timeoutInMillis?:number):Promise<void>;
1261
+ getServerConfigValues():Promise<string[][]>;
1262
+ getStorageService():dh.storage.StorageService;
1263
+ getAsIdeConnection():Promise<IdeConnection>;
1264
+ disconnect():void;
1265
+ addEventListener<T>(name:string, callback:(e:CustomEvent<T>)=>void):()=>void;
1266
+ nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<CustomEvent<T>>;
1267
+ hasListeners(name:string):boolean;
1268
+ removeEventListener<T>(name:string, callback:(e:CustomEvent<T>)=>void):boolean;
1353
1269
  }
1354
1270
 
1355
- /**
1356
- * Describes data that can be filtered, either a column reference or a literal value. Used this way, the type of a value
1357
- * can be specified so that values which are ambiguous or not well supported in JS will not be confused with Strings or
1358
- * imprecise numbers (e.g., nanosecond-precision date values). Additionally, once wrapped in this way, methods can be
1359
- * called on these value literal instances. These instances are immutable - any method called on them returns a new
1360
- * instance.
1361
- */
1362
- export class FilterValue {
1271
+ export class IdeSession implements HasEventHandling {
1272
+ static readonly EVENT_COMMANDSTARTED:string;
1273
+ static readonly EVENT_REQUEST_FAILED:string;
1274
+
1363
1275
  protected constructor();
1364
1276
 
1365
1277
  /**
1366
- * Constructs a number for the filter API from the given parameter. Can also be used on the values returned from
1367
- * {@link TableData.get} for DateTime values. To create
1368
- * a filter with a date, use <b>dh.DateWrapper.ofJsDate</b> or
1369
- * {@link i18n.DateTimeFormat.parse}. To create a filter with a
1370
- * 64-bit long integer, use {@link LongWrapper.ofString}.
1371
- * @param input - the number to wrap as a FilterValue
1372
- * @return an immutable FilterValue that can be built into a filter
1373
- */
1374
- static ofNumber(input:LongWrapper|number):FilterValue;
1375
- /**
1376
- * a filter condition checking if the current value is equal to the given parameter
1377
- * @param term -
1378
- * @return {@link dh.FilterCondition}
1379
- */
1380
- eq(term:FilterValue):FilterCondition;
1381
- /**
1382
- * a filter condition checking if the current value is equal to the given parameter, ignoring differences of upper
1383
- * vs lower case
1384
- * @param term -
1385
- * @return {@link dh.FilterCondition}
1386
- */
1387
- eqIgnoreCase(term:FilterValue):FilterCondition;
1388
- /**
1389
- * a filter condition checking if the current value is not equal to the given parameter
1390
- * @param term -
1391
- * @return {@link dh.FilterCondition}
1392
- */
1393
- notEq(term:FilterValue):FilterCondition;
1394
- /**
1395
- * a filter condition checking if the current value is not equal to the given parameter, ignoring differences of
1396
- * upper vs lower case
1397
- * @param term -
1398
- * @return {@link dh.FilterCondition}
1399
- */
1400
- notEqIgnoreCase(term:FilterValue):FilterCondition;
1401
- /**
1402
- * a filter condition checking if the current value is greater than the given parameter
1403
- * @param term -
1404
- * @return {@link dh.FilterCondition}
1405
- */
1406
- greaterThan(term:FilterValue):FilterCondition;
1407
- /**
1408
- * a filter condition checking if the current value is less than the given parameter
1409
- * @param term -
1410
- * @return {@link dh.FilterCondition}
1411
- */
1412
- lessThan(term:FilterValue):FilterCondition;
1413
- /**
1414
- * a filter condition checking if the current value is greater than or equal to the given parameter
1415
- * @param term -
1416
- * @return {@link dh.FilterCondition}
1417
- */
1418
- greaterThanOrEqualTo(term:FilterValue):FilterCondition;
1419
- /**
1420
- * a filter condition checking if the current value is less than or equal to the given parameter
1421
- * @param term -
1422
- * @return {@link dh.FilterCondition}
1423
- */
1424
- lessThanOrEqualTo(term:FilterValue):FilterCondition;
1425
- /**
1426
- * a filter condition checking if the current value is in the given set of values
1427
- * @param terms -
1428
- * @return {@link dh.FilterCondition}
1278
+ * Load the named table, with columns and size information already fully populated.
1279
+ * @param name -
1280
+ * @param applyPreviewColumns - optional boolean
1281
+ * @return {@link Promise} of {@link dh.Table}
1429
1282
  */
1430
- in(terms:FilterValue[]):FilterCondition;
1283
+ getTable(name:string, applyPreviewColumns?:boolean):Promise<Table>;
1431
1284
  /**
1432
- * a filter condition checking if the current value is in the given set of values, ignoring differences of upper vs
1433
- * lower case
1434
- * @param terms -
1435
- * @return {@link dh.FilterCondition}
1285
+ * Load the named Figure, including its tables and tablemaps as needed.
1286
+ * @param name -
1287
+ * @return promise of dh.plot.Figure
1436
1288
  */
1437
- inIgnoreCase(terms:FilterValue[]):FilterCondition;
1289
+ getFigure(name:string):Promise<dh.plot.Figure>;
1438
1290
  /**
1439
- * a filter condition checking that the current value is not in the given set of values
1440
- * @param terms -
1441
- * @return {@link dh.FilterCondition}
1291
+ * Loads the named tree table or roll-up table, with column data populated. All nodes are collapsed by default, and
1292
+ * size is presently not available until the viewport is first set.
1293
+ * @param name -
1294
+ * @return {@link Promise} of {@link dh.TreeTable}
1442
1295
  */
1443
- notIn(terms:FilterValue[]):FilterCondition;
1296
+ getTreeTable(name:string):Promise<TreeTable>;
1297
+ getHierarchicalTable(name:string):Promise<TreeTable>;
1298
+ getObject(definitionObject:dh.ide.VariableDescriptor):Promise<any>;
1299
+ newTable(columnNames:string[], types:string[], data:string[][], userTimeZone:string):Promise<Table>;
1444
1300
  /**
1445
- * a filter condition checking that the current value is not in the given set of values, ignoring differences of
1446
- * upper vs lower case
1447
- * @param terms -
1448
- * @return {@link dh.FilterCondition}
1301
+ * Merges the given tables into a single table. Assumes all tables have the same structure.
1302
+ * @param tables -
1303
+ * @return {@link Promise} of {@link dh.Table}
1449
1304
  */
1450
- notInIgnoreCase(terms:FilterValue[]):FilterCondition;
1305
+ mergeTables(tables:Table[]):Promise<Table>;
1306
+ bindTableToVariable(table:Table, name:string):Promise<void>;
1307
+ subscribeToFieldUpdates(callback:(arg0:dh.ide.VariableChanges)=>void):()=>void;
1308
+ close():void;
1309
+ runCode(code:string):Promise<dh.ide.CommandResult>;
1310
+ onLogMessage(callback:(arg0:dh.ide.LogItem)=>void):()=>void;
1311
+ openDocument(params:object):void;
1312
+ changeDocument(params:object):void;
1313
+ getCompletionItems(params:object):Promise<Array<dh.lsp.CompletionItem>>;
1314
+ getSignatureHelp(params:object):Promise<Array<dh.lsp.SignatureInformation>>;
1315
+ getHover(params:object):Promise<dh.lsp.Hover>;
1316
+ closeDocument(params:object):void;
1451
1317
  /**
1452
- * a filter condition checking if the given value contains the given string value
1453
- * @param term -
1454
- * @return {@link dh.FilterCondition}
1318
+ * Creates an empty table with the specified number of rows. Optionally columns and types may be specified, but all
1319
+ * values will be null.
1320
+ * @param size -
1321
+ * @return {@link Promise} of {@link dh.Table}
1455
1322
  */
1456
- contains(term:FilterValue):FilterCondition;
1323
+ emptyTable(size:number):Promise<Table>;
1457
1324
  /**
1458
- * a filter condition checking if the given value contains the given string value, ignoring differences of upper vs
1459
- * lower case
1460
- * @param term -
1461
- * @return {@link dh.FilterCondition}
1325
+ * Creates a new table that ticks automatically every "periodNanos" nanoseconds. A start time may be provided; if so
1326
+ * the table will be populated with the interval from the specified date until now.
1327
+ * @param periodNanos -
1328
+ * @param startTime -
1329
+ * @return {@link Promise} of {@link dh.Table}
1462
1330
  */
1463
- containsIgnoreCase(term:FilterValue):FilterCondition;
1331
+ timeTable(periodNanos:number, startTime?:DateWrapper):Promise<Table>;
1332
+ addEventListener<T>(name:string, callback:(e:CustomEvent<T>)=>void):()=>void;
1333
+ nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<CustomEvent<T>>;
1334
+ hasListeners(name:string):boolean;
1335
+ removeEventListener<T>(name:string, callback:(e:CustomEvent<T>)=>void):boolean;
1336
+ }
1337
+
1338
+ /**
1339
+ * Describes a Sort present on the table. No visible constructor, created through the use of Column.sort(), will be tied
1340
+ * to that particular column data. Sort instances are immutable, and use a builder pattern to make modifications. All
1341
+ * methods return a new Sort instance.
1342
+ */
1343
+ export class Sort {
1344
+ static readonly ASCENDING:string;
1345
+ static readonly DESCENDING:string;
1346
+ static readonly REVERSE:string;
1347
+
1348
+ protected constructor();
1349
+
1464
1350
  /**
1465
- * a filter condition checking if the given value matches the provided regular expressions string. Regex patterns
1466
- * use Java regex syntax
1467
- * @param pattern -
1468
- * @return {@link dh.FilterCondition}
1351
+ * Builds a Sort instance to sort values in ascending order.
1352
+ * @return {@link dh.Sort}
1469
1353
  */
1470
- matches(pattern:FilterValue):FilterCondition;
1354
+ asc():Sort;
1471
1355
  /**
1472
- * a filter condition checking if the given value matches the provided regular expressions string, ignoring
1473
- * differences of upper vs lower case. Regex patterns use Java regex syntax
1474
- * @param pattern -
1475
- * @return {@link dh.FilterCondition}
1356
+ * Builds a Sort instance to sort values in descending order.
1357
+ * @return {@link dh.Sort}
1476
1358
  */
1477
- matchesIgnoreCase(pattern:FilterValue):FilterCondition;
1359
+ desc():Sort;
1478
1360
  /**
1479
- * a filter condition checking if the current value is a true boolean
1480
- * @return {@link dh.FilterCondition}
1361
+ * Builds a Sort instance which takes the absolute value before applying order.
1362
+ * @return {@link dh.Sort}
1481
1363
  */
1482
- isTrue():FilterCondition;
1364
+ abs():Sort;
1365
+ toString():string;
1483
1366
  /**
1484
- * a filter condition checking if the current value is a false boolean
1485
- * @return {@link dh.FilterCondition}
1367
+ * True if the absolute value of the column should be used when sorting; defaults to false.
1368
+ * @return boolean
1486
1369
  */
1487
- isFalse():FilterCondition;
1370
+ get isAbs():boolean;
1488
1371
  /**
1489
- * a filter condition checking if the current value is a null value
1490
- * @return {@link dh.FilterCondition}
1372
+ * The column which is sorted.
1373
+ * @return {@link dh.Column}
1491
1374
  */
1492
- isNull():FilterCondition;
1375
+ get column():Column;
1493
1376
  /**
1494
- * a filter condition invoking the given method on the current value, with the given parameters. Currently supported
1495
- * functions that can be invoked on a String:
1496
- * <ul>
1497
- * <li><b>startsWith</b>: Returns true if the current string value starts with the supplied string argument</li>
1498
- * <li><b>endsWith</b>: Returns true if the current string value ends with the supplied string argument</li>
1499
- * <li><b>matches</b>: Returns true if the current string value matches the supplied string argument used as a Java
1500
- * regular expression</li>
1501
- * <li><b>contains</b>: Returns true if the current string value contains the supplied string argument
1502
- * <p>
1503
- * When invoking against a constant, this should be avoided in favor of FilterValue.contains
1504
- * </p>
1505
- * </li>
1506
- * </ul>
1507
- * @param method -
1508
- * @param args -
1509
- * @return
1377
+ * The direction of this sort, either <b>ASC</b>, <b>DESC</b>, or <b>REVERSE</b>.
1378
+ * @return String
1510
1379
  */
1511
- invoke(method:string, ...args:FilterValue[]):FilterCondition;
1512
- toString():string;
1380
+ get direction():string;
1381
+ }
1382
+
1383
+ /**
1384
+ * This class allows iteration over non-contiguous indexes. In the future, this will support the EcmaScript 2015
1385
+ * Iteration protocol, but for now has one method which returns an iterator, and also supports querying the size.
1386
+ * Additionally, we may add support for creating RangeSet objects to better serve some use cases.
1387
+ */
1388
+ export class RangeSet {
1389
+ protected constructor();
1390
+
1391
+ static ofRange(first:number, last:number):RangeSet;
1392
+ static ofItems(rows:number[]):RangeSet;
1393
+ static ofRanges(ranges:RangeSet[]):RangeSet;
1394
+ static ofSortedRanges(ranges:RangeSet[]):RangeSet;
1513
1395
  /**
1514
- * Constructs a string for the filter API from the given parameter.
1515
- * @param input -
1516
- * @return
1396
+ * a new iterator over all indexes in this collection.
1397
+ * @return Iterator of {@link dh.LongWrapper}
1517
1398
  */
1518
- static ofString(input:any):FilterValue;
1399
+ iterator():Iterator<LongWrapper>;
1519
1400
  /**
1520
- * Constructs a boolean for the filter API from the given parameter.
1521
- * @param b -
1522
- * @return
1401
+ * The total count of items contained in this collection. In some cases this can be expensive to compute, and
1402
+ * generally should not be needed except for debugging purposes, or preallocating space (i.e., do not call this
1403
+ * property each time through a loop).
1404
+ * @return double
1523
1405
  */
1524
- static ofBoolean(b:boolean):FilterValue;
1406
+ get size():number;
1407
+ }
1408
+
1409
+ export class LongWrapper {
1410
+ protected constructor();
1411
+
1412
+ static ofString(str:string):LongWrapper;
1413
+ asNumber():number;
1414
+ valueOf():string;
1415
+ toString():string;
1416
+ }
1417
+
1418
+ export class LoginCredentials {
1419
+ type?:string|null;
1420
+ username?:string|null;
1421
+ token?:string|null;
1422
+
1423
+ constructor();
1525
1424
  }
1526
1425
 
1527
1426
  /**
@@ -1596,53 +1495,267 @@ export namespace dh {
1596
1495
  * an internal table instance.</li>
1597
1496
  * </ul>
1598
1497
  *
1599
- * Handling server objects in messages also has more than one potential pattern that can be used:
1600
- * <ul>
1601
- * <li>One object per message - the message clearly is about that object, no other details required.</li>
1602
- * <li>Objects indexed within their message - as each message comes with a list of objects, those objects can be
1603
- * referenced within the payload by index. This is roughly how {@link dh.plot.Figure}
1604
- * behaves, where the figure descriptor schema includes an index for each created series, describing which table should
1605
- * be used, which columns should be mapped to each axis.</li>
1606
- * <li>Objects indexed since widget creation - each message would append its objects to a list created when the widget
1607
- * was first made, and any new exports that arrive in a new message would be appended to that list. Then, subsequent
1608
- * messages can reference objects already sent. This imposes a limitation where the client cannot release any exports
1609
- * without the server somehow signaling that it will never reference that export again.</li>
1610
- * </ul>
1498
+ * Handling server objects in messages also has more than one potential pattern that can be used:
1499
+ * <ul>
1500
+ * <li>One object per message - the message clearly is about that object, no other details required.</li>
1501
+ * <li>Objects indexed within their message - as each message comes with a list of objects, those objects can be
1502
+ * referenced within the payload by index. This is roughly how {@link dh.plot.Figure}
1503
+ * behaves, where the figure descriptor schema includes an index for each created series, describing which table should
1504
+ * be used, which columns should be mapped to each axis.</li>
1505
+ * <li>Objects indexed since widget creation - each message would append its objects to a list created when the widget
1506
+ * was first made, and any new exports that arrive in a new message would be appended to that list. Then, subsequent
1507
+ * messages can reference objects already sent. This imposes a limitation where the client cannot release any exports
1508
+ * without the server somehow signaling that it will never reference that export again.</li>
1509
+ * </ul>
1510
+ */
1511
+ export class Widget implements WidgetMessageDetails, HasEventHandling {
1512
+ static readonly EVENT_MESSAGE:string;
1513
+ static readonly EVENT_CLOSE:string;
1514
+
1515
+ protected constructor();
1516
+
1517
+ /**
1518
+ * Ends the client connection to the server.
1519
+ */
1520
+ close():void;
1521
+ getDataAsBase64():string;
1522
+ getDataAsU8():Uint8Array;
1523
+ getDataAsString():string;
1524
+ /**
1525
+ * Sends a string/bytes payload to the server, along with references to objects that exist on the server.
1526
+ * @param msg - string/buffer/view instance that represents data to send
1527
+ * @param references - an array of objects that can be safely sent to the server
1528
+ */
1529
+ sendMessage(msg:string|ArrayBuffer|ArrayBufferView, references?:Array<Table|Widget|WidgetExportedObject|PartitionedTable|TotalsTable|TreeTable>):void;
1530
+ addEventListener<T>(name:string, callback:(e:CustomEvent<T>)=>void):()=>void;
1531
+ nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<CustomEvent<T>>;
1532
+ hasListeners(name:string):boolean;
1533
+ removeEventListener<T>(name:string, callback:(e:CustomEvent<T>)=>void):boolean;
1534
+ /**
1535
+ *
1536
+ * @return the exported objects sent in the initial message from the server. The client is responsible for closing
1537
+ * them when finished using them.
1538
+ */
1539
+ get exportedObjects():WidgetExportedObject[];
1540
+ /**
1541
+ *
1542
+ * @return the type of this widget
1543
+ */
1544
+ get type():string;
1545
+ }
1546
+
1547
+ /**
1548
+ * Configuration object for running Table.treeTable to produce a hierarchical view of a given "flat" table.
1549
+ *
1550
+ * Like TotalsTableConfig, `TreeTableConfig` supports an operation map indicating how to aggregate the data, as well as
1551
+ * an array of column names which will be the layers in the roll-up tree, grouped at each level. An additional optional
1552
+ * value can be provided describing the strategy the engine should use when grouping the rows.
1553
+ */
1554
+ export class TreeTableConfig {
1555
+ /**
1556
+ * The column representing the unique ID for each item
1557
+ */
1558
+ idColumn:string;
1559
+ /**
1560
+ * The column representing the parent ID for each item
1561
+ */
1562
+ parentColumn:string;
1563
+ /**
1564
+ * Optional parameter indicating if items with an invalid parent ID should be promoted to root. Defaults to false.
1565
+ */
1566
+ promoteOrphansToRoot:boolean;
1567
+
1568
+ constructor();
1569
+ }
1570
+
1571
+ /**
1572
+ * Deprecated for use in Deephaven Core.
1573
+ * @deprecated
1574
+ */
1575
+ export class Client {
1576
+ static readonly EVENT_REQUEST_FAILED:string;
1577
+ static readonly EVENT_REQUEST_STARTED:string;
1578
+ static readonly EVENT_REQUEST_SUCCEEDED:string;
1579
+
1580
+ constructor();
1581
+ }
1582
+
1583
+ /**
1584
+ * Describes the structure of the column, and if desired can be used to get access to the data to be rendered in this
1585
+ * column.
1586
+ */
1587
+ export class Column {
1588
+ /**
1589
+ * If this column is part of a roll-up tree table, represents the type of the row data that can be found in this
1590
+ * column for leaf nodes if includeConstituents is enabled. Otherwise, it is <b>null</b>.
1591
+ * @return String
1592
+ */
1593
+ readonly constituentType?:string|null;
1594
+ readonly description?:string|null;
1595
+
1596
+ protected constructor();
1597
+
1598
+ /**
1599
+ * the value for this column in the given row. Type will be consistent with the type of the Column.
1600
+ * @param row -
1601
+ * @return Any
1602
+ */
1603
+ get(row:Row):any;
1604
+ getFormat(row:Row):Format;
1605
+ /**
1606
+ * Creates a sort builder object, to be used when sorting by this column.
1607
+ * @return {@link dh.Sort}
1608
+ */
1609
+ sort():Sort;
1610
+ /**
1611
+ * Creates a new value for use in filters based on this column. Used either as a parameter to another filter
1612
+ * operation, or as a builder to create a filter operation.
1613
+ * @return {@link dh.FilterValue}
1614
+ */
1615
+ filter():FilterValue;
1616
+ /**
1617
+ * a <b>CustomColumn</b> object to apply using `applyCustomColumns` with the expression specified.
1618
+ * @param expression -
1619
+ * @return {@link dh.CustomColumn}
1620
+ */
1621
+ formatColor(expression:string):CustomColumn;
1622
+ /**
1623
+ * a <b>CustomColumn</b> object to apply using <b>applyCustomColumns</b> with the expression specified.
1624
+ * @param expression -
1625
+ * @return {@link dh.CustomColumn}
1626
+ */
1627
+ formatNumber(expression:string):CustomColumn;
1628
+ /**
1629
+ * a <b>CustomColumn</b> object to apply using <b>applyCustomColumns</b> with the expression specified.
1630
+ * @param expression -
1631
+ * @return {@link dh.CustomColumn}
1632
+ */
1633
+ formatDate(expression:string):CustomColumn;
1634
+ toString():string;
1635
+ /**
1636
+ * Label for this column.
1637
+ * @return String
1638
+ */
1639
+ get name():string;
1640
+ /**
1641
+ * True if this column is a partition column. Partition columns are used for filtering uncoalesced tables (see
1642
+ * <b>isUncoalesced</b> property on <b>Table</b>)
1643
+ * @return boolean
1644
+ */
1645
+ get isPartitionColumn():boolean;
1646
+ /**
1647
+ *
1648
+ * @deprecated do not use. Internal index of the column in the table, to be used as a key on the Row.
1649
+ * @return int
1650
+ */
1651
+ get index():number;
1652
+ get isSortable():boolean;
1653
+ /**
1654
+ * Type of the row data that can be found in this column.
1655
+ * @return String
1656
+ */
1657
+ get type():string;
1658
+ /**
1659
+ * Format entire rows colors using the expression specified. Returns a <b>CustomColumn</b> object to apply to a
1660
+ * table using <b>applyCustomColumns</b> with the parameters specified.
1661
+ * @param expression -
1662
+ * @return {@link dh.CustomColumn}
1663
+ */
1664
+ static formatRowColor(expression:string):CustomColumn;
1665
+ /**
1666
+ * a <b>CustomColumn</b> object to apply using <b>applyCustomColumns</b> with the expression specified.
1667
+ * @param name -
1668
+ * @param expression -
1669
+ * @return {@link dh.CustomColumn}
1670
+ */
1671
+ static createCustomColumn(name:string, expression:string):CustomColumn;
1672
+ }
1673
+
1674
+ /**
1675
+ * A js type for operating on input tables.
1676
+ *
1677
+ * Represents a User Input Table, which can have data added to it from other sources.
1678
+ *
1679
+ * You may add rows using dictionaries of key-value tuples (representing columns by name), add tables containing all the
1680
+ * key/value columns to add, or delete tables containing the keys to delete. Each operation is atomic, and will either
1681
+ * succeed completely or fail completely. To guarantee order of operations, apply an operation and wait for the response
1682
+ * before sending the next operation.
1683
+ *
1684
+ * Each table has one or more key columns, where each unique combination of keys will appear at most once in the table.
1685
+ *
1686
+ * To view the results of the Input Table, you should use standard table operations on the InputTable's source Table
1687
+ * object.
1611
1688
  */
1612
- export class Widget implements WidgetMessageDetails, HasEventHandling {
1613
- static readonly EVENT_MESSAGE:string;
1614
- static readonly EVENT_CLOSE:string;
1615
-
1689
+ export class InputTable {
1616
1690
  protected constructor();
1617
1691
 
1618
1692
  /**
1619
- * Ends the client connection to the server.
1693
+ * Adds a single row to the table. For each key or value column name in the Input Table, we retrieve that javascript
1694
+ * property at that name and validate it can be put into the given column type.
1695
+ * @param row -
1696
+ * @param userTimeZone -
1697
+ * @return Promise of dh.InputTable
1620
1698
  */
1621
- close():void;
1622
- getDataAsBase64():string;
1623
- getDataAsU8():Uint8Array;
1624
- getDataAsString():string;
1699
+ addRow(row:{ [key: string]: any; }, userTimeZone?:string):Promise<InputTable>;
1625
1700
  /**
1626
- * Sends a string/bytes payload to the server, along with references to objects that exist on the server.
1627
- * @param msg - string/buffer/view instance that represents data to send
1628
- * @param references - an array of objects that can be safely sent to the server
1701
+ * Add multiple rows to a table.
1702
+ * @param rows -
1703
+ * @param userTimeZone -
1704
+ * @return Promise of dh.InputTable
1629
1705
  */
1630
- sendMessage(msg:string|ArrayBuffer|ArrayBufferView, references?:Array<Table|Widget|WidgetExportedObject|PartitionedTable|TotalsTable|TreeTable>):void;
1631
- addEventListener<T>(name:string, callback:(e:CustomEvent<T>)=>void):()=>void;
1632
- nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<CustomEvent<T>>;
1633
- hasListeners(name:string):boolean;
1634
- removeEventListener<T>(name:string, callback:(e:CustomEvent<T>)=>void):boolean;
1706
+ addRows(rows:{ [key: string]: any; }[], userTimeZone?:string):Promise<InputTable>;
1635
1707
  /**
1636
- *
1637
- * @return the exported objects sent in the initial message from the server. The client is responsible for closing
1638
- * them when finished using them.
1708
+ * Add an entire table to this Input Table. Only column names that match the definition of the input table will be
1709
+ * copied, and all key columns must have values filled in. This only copies the current state of the source table;
1710
+ * future updates to the source table will not be reflected in the Input Table. The returned promise will be
1711
+ * resolved to the same InputTable instance this method was called upon once the server returns.
1712
+ * @param tableToAdd -
1713
+ * @return Promise of dh.InputTable
1639
1714
  */
1640
- get exportedObjects():WidgetExportedObject[];
1715
+ addTable(tableToAdd:Table):Promise<InputTable>;
1641
1716
  /**
1642
- *
1643
- * @return the type of this widget
1717
+ * Add multiple tables to this Input Table.
1718
+ * @param tablesToAdd -
1719
+ * @return Promise of dh.InputTable
1644
1720
  */
1645
- get type():string;
1721
+ addTables(tablesToAdd:Table[]):Promise<InputTable>;
1722
+ /**
1723
+ * Deletes an entire table from this Input Table. Key columns must match the Input Table.
1724
+ * @param tableToDelete -
1725
+ * @return Promise of dh.InputTable
1726
+ */
1727
+ deleteTable(tableToDelete:Table):Promise<InputTable>;
1728
+ /**
1729
+ * Delete multiple tables from this Input Table.
1730
+ * @param tablesToDelete -
1731
+ * @return
1732
+ */
1733
+ deleteTables(tablesToDelete:Table[]):Promise<InputTable>;
1734
+ /**
1735
+ * A list of the key columns, by name
1736
+ * @return String array.
1737
+ */
1738
+ get keys():string[];
1739
+ /**
1740
+ * A list of the value columns, by name
1741
+ * @return String array.
1742
+ */
1743
+ get values():string[];
1744
+ /**
1745
+ * A list of the key Column objects
1746
+ * @return {@link dh.Column} array.
1747
+ */
1748
+ get keyColumns():Column[];
1749
+ /**
1750
+ * A list of the value Column objects
1751
+ * @return {@link dh.Column} array.
1752
+ */
1753
+ get valueColumns():Column[];
1754
+ /**
1755
+ * The source table for this Input Table
1756
+ * @return dh.table
1757
+ */
1758
+ get table():Table;
1646
1759
  }
1647
1760
 
1648
1761
  /**
@@ -1959,291 +2072,56 @@ export namespace dh {
1959
2072
  */
1960
2073
  get filter():Array<FilterCondition>;
1961
2074
  /**
1962
- * The total count of the rows in the table, excluding any filters. Unlike <b>size</b>, changes to this value will
1963
- * not result in any event. <b>Sort[] sort</b> an ordered list of Sorts to apply to the table. To update, call
1964
- * applySort(). Note that this getter will return the new value immediately, even though it may take a little time
1965
- * to update on the server. You may listen for the <b>sortchanged</b> event to know when to update the UI.
1966
- * @return double
1967
- */
1968
- get totalSize():number;
1969
- /**
1970
- * The total count of rows in the table. The size can and will change; see the <b>sizechanged</b> event for details.
1971
- * Size will be negative in exceptional cases (e.g., the table is uncoalesced; see the <b>isUncoalesced</b>
1972
- * property). for details).
1973
- * @return double
1974
- */
1975
- get size():number;
1976
- /**
1977
- * True if this table has been closed.
1978
- * @return boolean
1979
- */
1980
- get isClosed():boolean;
1981
- /**
1982
- * Read-only. True if this table is uncoalesced. Set a viewport or filter on the partition columns to coalesce the
1983
- * table. Check the <b>isPartitionColumn</b> property on the table columns to retrieve the partition columns. Size
1984
- * will be unavailable until table is coalesced.
1985
- * @return boolean
1986
- */
1987
- get isUncoalesced():boolean;
1988
- /**
1989
- * Listen for events on this object.
1990
- * @param name - the name of the event to listen for
1991
- * @param callback - a function to call when the event occurs
1992
- * @return Returns a cleanup function.
1993
- * @typeParam T - the type of the data that the event will provide
1994
- */
1995
- addEventListener<T>(name:string, callback:(e:CustomEvent<T>)=>void):()=>void;
1996
- nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<CustomEvent<T>>;
1997
- hasListeners(name:string):boolean;
1998
- /**
1999
- * Removes an event listener added to this table.
2000
- * @param name -
2001
- * @param callback -
2002
- * @return
2003
- * @typeParam T -
2004
- */
2005
- removeEventListener<T>(name:string, callback:(e:CustomEvent<T>)=>void):boolean;
2006
- /**
2007
- * a Sort than can be used to reverse a table. This can be passed into n array in applySort. Note that Tree Tables
2008
- * do not support reverse.
2009
- * @return {@link dh.Sort}
2010
- */
2011
- static reverse():Sort;
2012
- }
2013
-
2014
- export class DateWrapper extends LongWrapper {
2015
- protected constructor();
2016
-
2017
- static ofJsDate(date:Date):DateWrapper;
2018
- asDate():Date;
2019
- }
2020
-
2021
- export class IdeSession implements HasEventHandling {
2022
- static readonly EVENT_COMMANDSTARTED:string;
2023
- static readonly EVENT_REQUEST_FAILED:string;
2024
-
2025
- protected constructor();
2026
-
2027
- /**
2028
- * Load the named table, with columns and size information already fully populated.
2029
- * @param name -
2030
- * @param applyPreviewColumns - optional boolean
2031
- * @return {@link Promise} of {@link dh.Table}
2032
- */
2033
- getTable(name:string, applyPreviewColumns?:boolean):Promise<Table>;
2034
- /**
2035
- * Load the named Figure, including its tables and tablemaps as needed.
2036
- * @param name -
2037
- * @return promise of dh.plot.Figure
2038
- */
2039
- getFigure(name:string):Promise<dh.plot.Figure>;
2040
- /**
2041
- * Loads the named tree table or roll-up table, with column data populated. All nodes are collapsed by default, and
2042
- * size is presently not available until the viewport is first set.
2043
- * @param name -
2044
- * @return {@link Promise} of {@link dh.TreeTable}
2045
- */
2046
- getTreeTable(name:string):Promise<TreeTable>;
2047
- getHierarchicalTable(name:string):Promise<TreeTable>;
2048
- getObject(definitionObject:dh.ide.VariableDescriptor):Promise<any>;
2049
- newTable(columnNames:string[], types:string[], data:string[][], userTimeZone:string):Promise<Table>;
2050
- /**
2051
- * Merges the given tables into a single table. Assumes all tables have the same structure.
2052
- * @param tables -
2053
- * @return {@link Promise} of {@link dh.Table}
2054
- */
2055
- mergeTables(tables:Table[]):Promise<Table>;
2056
- bindTableToVariable(table:Table, name:string):Promise<void>;
2057
- subscribeToFieldUpdates(callback:(arg0:dh.ide.VariableChanges)=>void):()=>void;
2058
- close():void;
2059
- runCode(code:string):Promise<dh.ide.CommandResult>;
2060
- onLogMessage(callback:(arg0:dh.ide.LogItem)=>void):()=>void;
2061
- openDocument(params:object):void;
2062
- changeDocument(params:object):void;
2063
- getCompletionItems(params:object):Promise<Array<dh.lsp.CompletionItem>>;
2064
- getSignatureHelp(params:object):Promise<Array<dh.lsp.SignatureInformation>>;
2065
- getHover(params:object):Promise<dh.lsp.Hover>;
2066
- closeDocument(params:object):void;
2067
- /**
2068
- * Creates an empty table with the specified number of rows. Optionally columns and types may be specified, but all
2069
- * values will be null.
2070
- * @param size -
2071
- * @return {@link Promise} of {@link dh.Table}
2072
- */
2073
- emptyTable(size:number):Promise<Table>;
2074
- /**
2075
- * Creates a new table that ticks automatically every "periodNanos" nanoseconds. A start time may be provided; if so
2076
- * the table will be populated with the interval from the specified date until now.
2077
- * @param periodNanos -
2078
- * @param startTime -
2079
- * @return {@link Promise} of {@link dh.Table}
2080
- */
2081
- timeTable(periodNanos:number, startTime?:DateWrapper):Promise<Table>;
2082
- addEventListener<T>(name:string, callback:(e:CustomEvent<T>)=>void):()=>void;
2083
- nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<CustomEvent<T>>;
2084
- hasListeners(name:string):boolean;
2085
- removeEventListener<T>(name:string, callback:(e:CustomEvent<T>)=>void):boolean;
2086
- }
2087
-
2088
- /**
2089
- * Describes a Sort present on the table. No visible constructor, created through the use of Column.sort(), will be tied
2090
- * to that particular column data. Sort instances are immutable, and use a builder pattern to make modifications. All
2091
- * methods return a new Sort instance.
2092
- */
2093
- export class Sort {
2094
- static readonly ASCENDING:string;
2095
- static readonly DESCENDING:string;
2096
- static readonly REVERSE:string;
2097
-
2098
- protected constructor();
2099
-
2100
- /**
2101
- * Builds a Sort instance to sort values in ascending order.
2102
- * @return {@link dh.Sort}
2103
- */
2104
- asc():Sort;
2105
- /**
2106
- * Builds a Sort instance to sort values in descending order.
2107
- * @return {@link dh.Sort}
2108
- */
2109
- desc():Sort;
2110
- /**
2111
- * Builds a Sort instance which takes the absolute value before applying order.
2112
- * @return {@link dh.Sort}
2113
- */
2114
- abs():Sort;
2115
- toString():string;
2116
- /**
2117
- * True if the absolute value of the column should be used when sorting; defaults to false.
2118
- * @return boolean
2075
+ * The total count of the rows in the table, excluding any filters. Unlike <b>size</b>, changes to this value will
2076
+ * not result in any event. <b>Sort[] sort</b> an ordered list of Sorts to apply to the table. To update, call
2077
+ * applySort(). Note that this getter will return the new value immediately, even though it may take a little time
2078
+ * to update on the server. You may listen for the <b>sortchanged</b> event to know when to update the UI.
2079
+ * @return double
2119
2080
  */
2120
- get isAbs():boolean;
2081
+ get totalSize():number;
2121
2082
  /**
2122
- * The column which is sorted.
2123
- * @return {@link dh.Column}
2083
+ * The total count of rows in the table. The size can and will change; see the <b>sizechanged</b> event for details.
2084
+ * Size will be negative in exceptional cases (e.g., the table is uncoalesced; see the <b>isUncoalesced</b>
2085
+ * property). for details).
2086
+ * @return double
2124
2087
  */
2125
- get column():Column;
2088
+ get size():number;
2126
2089
  /**
2127
- * The direction of this sort, either <b>ASC</b>, <b>DESC</b>, or <b>REVERSE</b>.
2128
- * @return String
2090
+ * True if this table has been closed.
2091
+ * @return boolean
2129
2092
  */
2130
- get direction():string;
2131
- }
2132
-
2133
- /**
2134
- * Represents a non-viewport subscription to a table, and all data currently known to be present in the subscribed
2135
- * columns. This class handles incoming snapshots and deltas, and fires events to consumers to notify of data changes.
2136
- *
2137
- * Unlike {@link dh.TableViewportSubscription}, the "original" table does not have a reference to this instance, only the
2138
- * "private" table instance does, since the original cannot modify the subscription, and the private instance must
2139
- * forward data to it.
2140
- *
2141
- * Represents a subscription to the table on the server. Changes made to the table will not be reflected here - the
2142
- * subscription must be closed and a new one optioned to see those changes. The event model is slightly different from
2143
- * viewports to make it less expensive to compute for large tables.
2144
- */
2145
- export class TableSubscription implements HasEventHandling {
2093
+ get isClosed():boolean;
2146
2094
  /**
2147
- * Indicates that some new data is available on the client, either an initial snapshot or a delta update. The
2148
- * <b>detail</b> field of the event will contain a TableSubscriptionEventData detailing what has changed, or
2149
- * allowing access to the entire range of items currently in the subscribed columns.
2095
+ * Read-only. True if this table is uncoalesced. Set a viewport or filter on the partition columns to coalesce the
2096
+ * table. Check the <b>isPartitionColumn</b> property on the table columns to retrieve the partition columns. Size
2097
+ * will be unavailable until table is coalesced.
2098
+ * @return boolean
2150
2099
  */
2151
- static readonly EVENT_UPDATED:string;
2152
-
2153
- protected constructor();
2154
-
2100
+ get isUncoalesced():boolean;
2155
2101
  /**
2156
- * Stops the subscription on the server.
2102
+ * Listen for events on this object.
2103
+ * @param name - the name of the event to listen for
2104
+ * @param callback - a function to call when the event occurs
2105
+ * @return Returns a cleanup function.
2106
+ * @typeParam T - the type of the data that the event will provide
2157
2107
  */
2158
- close():void;
2159
2108
  addEventListener<T>(name:string, callback:(e:CustomEvent<T>)=>void):()=>void;
2160
2109
  nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<CustomEvent<T>>;
2161
2110
  hasListeners(name:string):boolean;
2162
- removeEventListener<T>(name:string, callback:(e:CustomEvent<T>)=>void):boolean;
2163
- /**
2164
- * The columns that were subscribed to when this subscription was created
2165
- * @return {@link dh.Column}
2166
- */
2167
- get columns():Array<Column>;
2168
- }
2169
-
2170
- /**
2171
- * This class allows iteration over non-contiguous indexes. In the future, this will support the EcmaScript 2015
2172
- * Iteration protocol, but for now has one method which returns an iterator, and also supports querying the size.
2173
- * Additionally, we may add support for creating RangeSet objects to better serve some use cases.
2174
- */
2175
- export class RangeSet {
2176
- protected constructor();
2177
-
2178
- static ofRange(first:number, last:number):RangeSet;
2179
- static ofItems(rows:number[]):RangeSet;
2180
- static ofRanges(ranges:RangeSet[]):RangeSet;
2181
- static ofSortedRanges(ranges:RangeSet[]):RangeSet;
2182
2111
  /**
2183
- * a new iterator over all indexes in this collection.
2184
- * @return Iterator of {@link dh.LongWrapper}
2112
+ * Removes an event listener added to this table.
2113
+ * @param name -
2114
+ * @param callback -
2115
+ * @return
2116
+ * @typeParam T -
2185
2117
  */
2186
- iterator():Iterator<LongWrapper>;
2118
+ removeEventListener<T>(name:string, callback:(e:CustomEvent<T>)=>void):boolean;
2187
2119
  /**
2188
- * The total count of items contained in this collection. In some cases this can be expensive to compute, and
2189
- * generally should not be needed except for debugging purposes, or preallocating space (i.e., do not call this
2190
- * property each time through a loop).
2191
- * @return double
2120
+ * a Sort than can be used to reverse a table. This can be passed into n array in applySort. Note that Tree Tables
2121
+ * do not support reverse.
2122
+ * @return {@link dh.Sort}
2192
2123
  */
2193
- get size():number;
2194
- }
2195
-
2196
- /**
2197
- * Exists to keep the dh.TableMap namespace so that the web UI can remain compatible with the DHE API, which still calls
2198
- * this type TableMap.
2199
- * @deprecated
2200
- */
2201
- export class TableMap {
2202
- static readonly EVENT_KEYADDED:string;
2203
- static readonly EVENT_DISCONNECT:string;
2204
- static readonly EVENT_RECONNECT:string;
2205
- static readonly EVENT_RECONNECTFAILED:string;
2206
-
2207
- protected constructor();
2208
- }
2209
-
2210
- /**
2211
- * Presently optional and not used by the server, this allows the client to specify some authentication details. String
2212
- * authToken <i>- base 64 encoded auth token. String serviceId -</i> The service ID to use for the connection.
2213
- */
2214
- export class ConnectOptions {
2215
- headers:{ [key: string]: string; };
2216
-
2217
- constructor();
2218
- }
2219
-
2220
- export class LoginCredentials {
2221
- type?:string|null;
2222
- username?:string|null;
2223
- token?:string|null;
2224
-
2225
- constructor();
2226
- }
2227
-
2228
- /**
2229
- * Wrap BigInteger values for use in JS. Provides text formatting for display and access to the underlying value.
2230
- */
2231
- export class BigIntegerWrapper {
2232
- protected constructor();
2233
-
2234
- static ofString(str:string):BigIntegerWrapper;
2235
- asNumber():number;
2236
- valueOf():string;
2237
- toString():string;
2238
- }
2239
-
2240
- export class LongWrapper {
2241
- protected constructor();
2242
-
2243
- static ofString(str:string):LongWrapper;
2244
- asNumber():number;
2245
- valueOf():string;
2246
- toString():string;
2124
+ static reverse():Sort;
2247
2125
  }
2248
2126
 
2249
2127
  /**
@@ -2315,29 +2193,145 @@ export namespace dh {
2315
2193
  */
2316
2194
  defaultOperation:AggregationOperationType;
2317
2195
  /**
2318
- * Mapping from each column name to the aggregation(s) that should be applied to that column in the resulting Totals
2319
- * Table. If a column is omitted, the defaultOperation is used.
2196
+ * Mapping from each column name to the aggregation(s) that should be applied to that column in the resulting Totals
2197
+ * Table. If a column is omitted, the defaultOperation is used.
2198
+ */
2199
+ operationMap:{ [key: string]: Array<AggregationOperationType>; };
2200
+ /**
2201
+ * Groupings to use when generating the Totals Table. One row will exist for each unique set of values observed in
2202
+ * these columns. See also `Table.selectDistinct`.
2203
+ */
2204
+ groupBy:Array<string>;
2205
+
2206
+ constructor();
2207
+
2208
+ toString():string;
2209
+ }
2210
+
2211
+ /**
2212
+ * Represents a set of Tables each corresponding to some key. The keys are available locally, but a call must be made to
2213
+ * the server to get each Table. All tables will have the same structure.
2214
+ */
2215
+ export class PartitionedTable implements HasEventHandling {
2216
+ /**
2217
+ * Indicates that a new key has been added to the array of keys, which can now be fetched with getTable.
2218
+ */
2219
+ static readonly EVENT_KEYADDED:string;
2220
+ /**
2221
+ * Indicates that a new key has been added to the array of keys, which can now be fetched with getTable.
2222
+ */
2223
+ static readonly EVENT_DISCONNECT:string;
2224
+ /**
2225
+ * Indicates that a new key has been added to the array of keys, which can now be fetched with getTable.
2226
+ */
2227
+ static readonly EVENT_RECONNECT:string;
2228
+ /**
2229
+ * Indicates that a new key has been added to the array of keys, which can now be fetched with getTable.
2230
+ */
2231
+ static readonly EVENT_RECONNECTFAILED:string;
2232
+
2233
+ protected constructor();
2234
+
2235
+ typedTicket():dhinternal.io.deephaven.proto.ticket_pb.TypedTicket;
2236
+ /**
2237
+ * Fetch the table with the given key.
2238
+ * @param key - The key to fetch. An array of values for each key column, in the same order as the key columns are.
2239
+ * @return Promise of dh.Table
2240
+ */
2241
+ getTable(key:object):Promise<Table>;
2242
+ /**
2243
+ * Open a new table that is the result of merging all constituent tables. See
2244
+ * {@link io.deephaven.engine.table.PartitionedTable#merge()} for details.
2245
+ * @return A merged representation of the constituent tables.
2246
+ */
2247
+ getMergedTable():Promise<Table>;
2248
+ /**
2249
+ * The set of all currently known keys. This is kept up to date, so getting the list after adding an event listener
2250
+ * for <b>keyadded</b> will ensure no keys are missed.
2251
+ * @return Set of Object
2252
+ */
2253
+ getKeys():Set<object>;
2254
+ /**
2255
+ * Fetch a table containing all the valid keys of the partitioned table.
2256
+ * @return Promise of a Table
2257
+ */
2258
+ getKeyTable():Promise<Table>;
2259
+ /**
2260
+ * Indicates that this PartitionedTable will no longer be used, removing subcriptions to updated keys, etc. This
2261
+ * will not affect tables in use.
2262
+ */
2263
+ close():void;
2264
+ /**
2265
+ * The count of known keys.
2266
+ * @return int
2267
+ */
2268
+ get size():number;
2269
+ /**
2270
+ * An array of the columns in the tables that can be retrieved from this partitioned table, including both key and
2271
+ * non-key columns.
2272
+ * @return Array of Column
2273
+ */
2274
+ get columns():Column[];
2275
+ /**
2276
+ * An array of all the key columns that the tables are partitioned by.
2277
+ * @return Array of Column
2278
+ */
2279
+ get keyColumns():Column[];
2280
+ /**
2281
+ * Listen for events on this object.
2282
+ * @param name - the name of the event to listen for
2283
+ * @param callback - a function to call when the event occurs
2284
+ * @return Returns a cleanup function.
2285
+ * @typeParam T - the type of the data that the event will provide
2286
+ */
2287
+ addEventListener<T>(name:string, callback:(e:CustomEvent<T>)=>void):()=>void;
2288
+ nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<CustomEvent<T>>;
2289
+ hasListeners(name:string):boolean;
2290
+ /**
2291
+ * Removes an event listener added to this table.
2292
+ * @param name -
2293
+ * @param callback -
2294
+ * @return
2295
+ * @typeParam T -
2296
+ */
2297
+ removeEventListener<T>(name:string, callback:(e:CustomEvent<T>)=>void):boolean;
2298
+ }
2299
+
2300
+ export class Ide {
2301
+ constructor();
2302
+
2303
+ /**
2304
+ * @deprecated
2320
2305
  */
2321
- operationMap:{ [key: string]: Array<AggregationOperationType>; };
2306
+ getExistingSession(websocketUrl:string, authToken:string, serviceId:string, language:string):Promise<IdeSession>;
2322
2307
  /**
2323
- * Groupings to use when generating the Totals Table. One row will exist for each unique set of values observed in
2324
- * these columns. See also `Table.selectDistinct`.
2308
+ * @deprecated
2325
2309
  */
2326
- groupBy:Array<string>;
2310
+ static getExistingSession(websocketUrl:string, authToken:string, serviceId:string, language:string):Promise<IdeSession>;
2311
+ }
2327
2312
 
2328
- constructor();
2313
+ export class QueryInfo {
2314
+ static readonly EVENT_TABLE_OPENED:string;
2315
+ static readonly EVENT_DISCONNECT:string;
2316
+ static readonly EVENT_RECONNECT:string;
2317
+ static readonly EVENT_CONNECT:string;
2329
2318
 
2330
- toString():string;
2319
+ protected constructor();
2331
2320
  }
2332
2321
 
2322
+ /**
2323
+ * Wrap BigInteger values for use in JS. Provides text formatting for display and access to the underlying value.
2324
+ */
2325
+ export class BigIntegerWrapper {
2326
+ protected constructor();
2333
2327
 
2334
- type SearchDisplayModeType = string;
2335
- export class SearchDisplayMode {
2336
- static readonly SEARCH_DISPLAY_DEFAULT:SearchDisplayModeType;
2337
- static readonly SEARCH_DISPLAY_HIDE:SearchDisplayModeType;
2338
- static readonly SEARCH_DISPLAY_SHOW:SearchDisplayModeType;
2328
+ static ofString(str:string):BigIntegerWrapper;
2329
+ asNumber():number;
2330
+ valueOf():string;
2331
+ toString():string;
2339
2332
  }
2340
2333
 
2334
+
2341
2335
  type ValueTypeType = string;
2342
2336
  export class ValueType {
2343
2337
  static readonly STRING:ValueTypeType;
@@ -2348,6 +2342,29 @@ export namespace dh {
2348
2342
  static readonly BOOLEAN:ValueTypeType;
2349
2343
  }
2350
2344
 
2345
+ /**
2346
+ * A set of string constants that can be used to describe the different objects the JS API can export.
2347
+ */
2348
+ type VariableTypeType = string;
2349
+ export class VariableType {
2350
+ static readonly TABLE:VariableTypeType;
2351
+ static readonly TREETABLE:VariableTypeType;
2352
+ static readonly HIERARCHICALTABLE:VariableTypeType;
2353
+ static readonly TABLEMAP:VariableTypeType;
2354
+ static readonly PARTITIONEDTABLE:VariableTypeType;
2355
+ static readonly FIGURE:VariableTypeType;
2356
+ static readonly OTHERWIDGET:VariableTypeType;
2357
+ static readonly PANDAS:VariableTypeType;
2358
+ static readonly TREEMAP:VariableTypeType;
2359
+ }
2360
+
2361
+ type SearchDisplayModeType = string;
2362
+ export class SearchDisplayMode {
2363
+ static readonly SEARCH_DISPLAY_DEFAULT:SearchDisplayModeType;
2364
+ static readonly SEARCH_DISPLAY_HIDE:SearchDisplayModeType;
2365
+ static readonly SEARCH_DISPLAY_SHOW:SearchDisplayModeType;
2366
+ }
2367
+
2351
2368
  /**
2352
2369
  * This enum describes the name of each supported operation/aggregation type when creating a `TreeTable`.
2353
2370
  */
@@ -2369,91 +2386,10 @@ export namespace dh {
2369
2386
  static readonly SKIP:AggregationOperationType;
2370
2387
  }
2371
2388
 
2372
- /**
2373
- * A set of string constants that can be used to describe the different objects the JS API can export.
2374
- */
2375
- type VariableTypeType = string;
2376
- export class VariableType {
2377
- static readonly TABLE:VariableTypeType;
2378
- static readonly TREETABLE:VariableTypeType;
2379
- static readonly HIERARCHICALTABLE:VariableTypeType;
2380
- static readonly TABLEMAP:VariableTypeType;
2381
- static readonly PARTITIONEDTABLE:VariableTypeType;
2382
- static readonly FIGURE:VariableTypeType;
2383
- static readonly OTHERWIDGET:VariableTypeType;
2384
- static readonly PANDAS:VariableTypeType;
2385
- static readonly TREEMAP:VariableTypeType;
2386
- }
2387
-
2388
2389
  }
2389
2390
 
2390
2391
  export namespace dh.ide {
2391
2392
 
2392
- /**
2393
- * Describes changes in the current set of variables in the script session. Note that variables that changed value
2394
- * without changing type will be included as <b>updated</b>, but if a new value with one type replaces an old value with
2395
- * a different type, this will be included as an entry in both <b>removed</b> and <b>created</b> to indicate the old and
2396
- * new types.
2397
- */
2398
- export interface VariableChanges {
2399
- /**
2400
- *
2401
- * @return The variables that no longer exist after this operation, or were replaced by some variable with a
2402
- * different type.
2403
- */
2404
- get removed():Array<VariableDefinition>;
2405
- /**
2406
- *
2407
- * @return The variables that were created by this operation, or have a new type.
2408
- */
2409
- get created():Array<VariableDefinition>;
2410
- /**
2411
- *
2412
- * @return The variables that changed value during this operation.
2413
- */
2414
- get updated():Array<VariableDefinition>;
2415
- }
2416
- /**
2417
- * A format to describe a variable available to be read from the server. Application fields are optional, and only
2418
- * populated when a variable is provided by application mode.
2419
- * <p>
2420
- * APIs which take a VariableDefinition must at least be provided an object with a <b>type</b> and <b>id</b> field.
2421
- */
2422
- export interface VariableDefinition {
2423
- get name():string;
2424
- /**
2425
- * Optional description for the variable's contents, typically used to provide more detail that wouldn't be
2426
- * reasonable to put in the title
2427
- * @return String
2428
- */
2429
- get description():string;
2430
- /**
2431
- * An opaque identifier for this variable
2432
- * @return String
2433
- */
2434
- get id():string;
2435
- /**
2436
- * The type of the variable, one of <b>dh.VariableType</b>
2437
- * @return dh.VariableType.
2438
- */
2439
- get type():dh.VariableTypeType;
2440
- /**
2441
- * The name of the variable, to be used when rendering it to a user
2442
- * @return String
2443
- */
2444
- get title():string;
2445
- /**
2446
- * Optional description for the variable's contents, typically used to provide more detail that wouldn't be
2447
- * reasonable to put in the title
2448
- * @return String
2449
- */
2450
- get applicationId():string;
2451
- /**
2452
- * The name of the application which provided this variable
2453
- * @return String
2454
- */
2455
- get applicationName():string;
2456
- }
2457
2393
  /**
2458
2394
  * Represents a serialized fishlib LogRecord, suitable for display on javascript clients. A log entry sent from the
2459
2395
  * server.
@@ -2476,183 +2412,96 @@ export namespace dh.ide {
2476
2412
  get message():string;
2477
2413
  }
2478
2414
  /**
2479
- * Specifies a type and either id or name (but not both).
2480
- */
2481
- export interface VariableDescriptor {
2482
- type:string;
2483
- id?:string|null;
2484
- name?:string|null;
2485
- }
2486
- /**
2487
- * Indicates the result of code run on the server.
2488
- */
2489
- export interface CommandResult {
2490
- /**
2491
- * Describes changes made in the course of this command.
2492
- * @return {@link dh.ide.VariableChanges}.
2493
- */
2494
- get changes():VariableChanges;
2495
- /**
2496
- * If the command failed, the error message will be provided here.
2497
- * @return String
2498
- */
2499
- get error():string;
2500
- }
2501
- }
2502
-
2503
- export namespace dh.i18n {
2504
-
2505
- /**
2506
- * Exported wrapper of the GWT NumberFormat, plus LongWrapper support
2507
- *
2508
- * Utility class to parse and format numbers, using the same format patterns as are supported by the standard Java
2509
- * implementation used in the Deephaven server and swing client. Works for numeric types including BigInteger and
2510
- * BigDecimal.
2415
+ * Describes changes in the current set of variables in the script session. Note that variables that changed value
2416
+ * without changing type will be included as <b>updated</b>, but if a new value with one type replaces an old value with
2417
+ * a different type, this will be included as an entry in both <b>removed</b> and <b>created</b> to indicate the old and
2418
+ * new types.
2511
2419
  */
2512
- export class NumberFormat {
2513
- /**
2514
- * Creates a new number format instance. This generally should be avoided in favor of the static `getFormat`
2515
- * function, which will create and cache an instance so that later calls share the same instance.
2516
- * @param pattern -
2517
- */
2518
- constructor(pattern:string);
2519
-
2520
- /**
2521
- * a number format instance matching the specified format. If this format has not been specified before, a new
2522
- * instance will be created and cached for later reuse. Prefer this method to calling the constructor directly to
2523
- * take advantage of caching
2524
- * @param pattern -
2525
- * @return dh.i18n.NumberFormat
2526
- */
2527
- static getFormat(pattern:string):NumberFormat;
2528
- /**
2529
- * Parses the given text using the cached format matching the given pattern.
2530
- * @param pattern -
2531
- * @param text -
2532
- * @return double
2533
- */
2534
- static parse(pattern:string, text:string):number;
2420
+ export interface VariableChanges {
2535
2421
  /**
2536
- * Formats the specified number (or Java <b>long</b>, <b>BigInteger</b> or <b>BigDecimal</b> value) using the cached
2537
- * format matching the given pattern string.
2538
- * @param pattern -
2539
- * @param number -
2540
- * @return String
2422
+ *
2423
+ * @return The variables that no longer exist after this operation, or were replaced by some variable with a
2424
+ * different type.
2541
2425
  */
2542
- static format(pattern:string, number:number|dh.BigIntegerWrapper|dh.BigDecimalWrapper|dh.LongWrapper):string;
2426
+ get removed():Array<VariableDefinition>;
2543
2427
  /**
2544
- * Parses the given text using this instance's pattern into a JS Number.
2545
- * @param text -
2546
- * @return double
2428
+ *
2429
+ * @return The variables that were created by this operation, or have a new type.
2547
2430
  */
2548
- parse(text:string):number;
2431
+ get created():Array<VariableDefinition>;
2549
2432
  /**
2550
- * Formats the specified number (or Java `long`, `BigInteger` or `BigDecimal` value) using this instance's pattern.
2551
- * @param number -
2552
- * @return String
2433
+ *
2434
+ * @return The variables that changed value during this operation.
2553
2435
  */
2554
- format(number:number|dh.BigIntegerWrapper|dh.BigDecimalWrapper|dh.LongWrapper):string;
2555
- toString():string;
2436
+ get updated():Array<VariableDefinition>;
2556
2437
  }
2557
-
2558
-
2559
2438
  /**
2560
- * Largely an exported wrapper for the GWT DateFormat, but also includes support for formatting nanoseconds as an
2561
- * additional 6 decimal places after the rest of the number.
2562
- *
2563
- * Other concerns that this handles includes accepting a js Date and ignoring the lack of nanos, accepting a js Number
2564
- * and assuming it to be a lossy nano value, and parsing into a js Date.
2565
- *
2566
- *
2567
- * Utility class to parse and format various date/time values, using the same format patterns as are supported by the
2568
- * standard Java implementation used in the Deephaven server and swing client.
2569
- *
2570
- * As Deephaven internally uses nanosecond precision to record dates, this API expects nanoseconds in most use cases,
2571
- * with the one exception of the JS `Date` type, which is not capable of more precision than milliseconds. Note,
2572
- * however, that when passing nanoseconds as a JS `Number` there is likely to be some loss of precision, though this is
2573
- * still supported for easier interoperability with other JS code. The values returned by `parse()` will be an opaque
2574
- * object wrapping the full precision of the specified date, However, this object supports `toString()` and `valueOf()`
2575
- * to return a string representation of that value, as well as a `asNumber()` to return a JS `Number` value and a
2576
- * `asDate()` to return a JS `Date` value.
2577
- *
2578
- *
2579
- * Caveats:
2580
- *
2581
- *
2582
- * - The `D` format (for "day of year") is not supported by this implementation at this time. - The `%t` format for
2583
- * short timezone code is not supported by this implementation at this time, though `z` will work as expected in the
2584
- * browser to emit the user's own timezone.
2439
+ * Specifies a type and either id or name (but not both).
2440
+ */
2441
+ export interface VariableDescriptor {
2442
+ type:string;
2443
+ id?:string|null;
2444
+ name?:string|null;
2445
+ }
2446
+ /**
2447
+ * Indicates the result of code run on the server.
2585
2448
  */
2586
- export class DateTimeFormat {
2587
- static readonly NANOS_PER_MILLI:number;
2588
-
2449
+ export interface CommandResult {
2589
2450
  /**
2590
- * Creates a new date/time format instance. This generally should be avoided in favor of the static `getFormat`
2591
- * function, which will create and cache an instance so that later calls share the same instance.
2592
- * @param pattern -
2451
+ * Describes changes made in the course of this command.
2452
+ * @return {@link dh.ide.VariableChanges}.
2593
2453
  */
2594
- constructor(pattern:string);
2595
-
2454
+ get changes():VariableChanges;
2596
2455
  /**
2597
- *
2598
- * @param pattern -
2599
- * @return a date format instance matching the specified format. If this format has not been specified before, a new
2600
- * instance will be created and stored for later reuse.
2456
+ * If the command failed, the error message will be provided here.
2457
+ * @return String
2601
2458
  */
2602
- static getFormat(pattern:string):DateTimeFormat;
2459
+ get error():string;
2460
+ }
2461
+ /**
2462
+ * A format to describe a variable available to be read from the server. Application fields are optional, and only
2463
+ * populated when a variable is provided by application mode.
2464
+ * <p>
2465
+ * APIs which take a VariableDefinition must at least be provided an object with a <b>type</b> and <b>id</b> field.
2466
+ */
2467
+ export interface VariableDefinition {
2468
+ get name():string;
2603
2469
  /**
2604
- * Accepts a variety of input objects to interpret as a date, and formats them using the specified pattern. A
2605
- * `TimeZone` object can optionally be provided to format this date as the current date/time in that timezone.See
2606
- * the instance method for more details on input objects.
2607
- * @param pattern -
2608
- * @param date -
2609
- * @param timeZone -
2610
- * @return
2470
+ * Optional description for the variable's contents, typically used to provide more detail that wouldn't be
2471
+ * reasonable to put in the title
2472
+ * @return String
2611
2473
  */
2612
- static format(pattern:string, date:any, timeZone?:TimeZone):string;
2474
+ get description():string;
2613
2475
  /**
2614
- * Parses the given input string using the provided pattern, and returns a JS `Date` object in milliseconds.
2615
- * @param pattern -
2616
- * @param text -
2617
- * @return
2476
+ * An opaque identifier for this variable
2477
+ * @return String
2618
2478
  */
2619
- static parseAsDate(pattern:string, text:string):Date;
2479
+ get id():string;
2620
2480
  /**
2621
- * Parses the given input string using the provided pattern, and returns a wrapped Java `long` value in nanoseconds.
2622
- * A `TimeZone` object can optionally be provided to parse to a desired timezone.
2623
- * @param pattern -
2624
- * @param text -
2625
- * @param tz -
2626
- * @return
2481
+ * The type of the variable, one of <b>dh.VariableType</b>
2482
+ * @return dh.VariableType.
2627
2483
  */
2628
- static parse(pattern:string, text:string, tz?:TimeZone):dh.DateWrapper;
2484
+ get type():dh.VariableTypeType;
2629
2485
  /**
2630
- * Takes a variety of objects to interpret as a date, and formats them using this instance's pattern. Inputs can
2631
- * include a <b>String</b> value of a number expressed in nanoseconds, a <b>Number</b> value expressed in
2632
- * nanoseconds, a JS <b>Date</b> object (necessarily in milliseconds), or a wrapped Java <b>long</b> value,
2633
- * expressed in nanoseconds. A <b>TimeZone</b> object can optionally be provided to format this date as the current
2634
- * date/time in that timezone.
2635
- * @param date -
2636
- * @param timeZone -
2486
+ * The name of the variable, to be used when rendering it to a user
2637
2487
  * @return String
2638
2488
  */
2639
- format(date:any, timeZone?:TimeZone):string;
2489
+ get title():string;
2640
2490
  /**
2641
- * Parses the given string using this instance's pattern, and returns a wrapped Java <b>long</b> value in
2642
- * nanoseconds. A <b>TimeZone</b> object can optionally be provided to parse to a desired timezone.
2643
- * @param text -
2644
- * @param tz -
2645
- * @return
2491
+ * Optional description for the variable's contents, typically used to provide more detail that wouldn't be
2492
+ * reasonable to put in the title
2493
+ * @return String
2646
2494
  */
2647
- parse(text:string, tz?:TimeZone):dh.DateWrapper;
2495
+ get applicationId():string;
2648
2496
  /**
2649
- * Parses the given string using this instance's pattern, and returns a JS <b>Date</b> object in milliseconds.
2650
- * @param text -
2651
- * @return
2497
+ * The name of the application which provided this variable
2498
+ * @return String
2652
2499
  */
2653
- parseAsDate(text:string):Date;
2654
- toString():string;
2500
+ get applicationName():string;
2655
2501
  }
2502
+ }
2503
+
2504
+ export namespace dh.i18n {
2656
2505
 
2657
2506
  /**
2658
2507
  * Represents the timezones supported by Deephaven. Can be used to format dates, taking into account the offset changing
@@ -2765,29 +2614,176 @@ export namespace dh.i18n {
2765
2614
  get id():string;
2766
2615
  }
2767
2616
 
2768
- }
2617
+ /**
2618
+ * Largely an exported wrapper for the GWT DateFormat, but also includes support for formatting nanoseconds as an
2619
+ * additional 6 decimal places after the rest of the number.
2620
+ *
2621
+ * Other concerns that this handles includes accepting a js Date and ignoring the lack of nanos, accepting a js Number
2622
+ * and assuming it to be a lossy nano value, and parsing into a js Date.
2623
+ *
2624
+ *
2625
+ * Utility class to parse and format various date/time values, using the same format patterns as are supported by the
2626
+ * standard Java implementation used in the Deephaven server and swing client.
2627
+ *
2628
+ * As Deephaven internally uses nanosecond precision to record dates, this API expects nanoseconds in most use cases,
2629
+ * with the one exception of the JS `Date` type, which is not capable of more precision than milliseconds. Note,
2630
+ * however, that when passing nanoseconds as a JS `Number` there is likely to be some loss of precision, though this is
2631
+ * still supported for easier interoperability with other JS code. The values returned by `parse()` will be an opaque
2632
+ * object wrapping the full precision of the specified date, However, this object supports `toString()` and `valueOf()`
2633
+ * to return a string representation of that value, as well as a `asNumber()` to return a JS `Number` value and a
2634
+ * `asDate()` to return a JS `Date` value.
2635
+ *
2636
+ *
2637
+ * Caveats:
2638
+ *
2639
+ *
2640
+ * - The `D` format (for "day of year") is not supported by this implementation at this time. - The `%t` format for
2641
+ * short timezone code is not supported by this implementation at this time, though `z` will work as expected in the
2642
+ * browser to emit the user's own timezone.
2643
+ */
2644
+ export class DateTimeFormat {
2645
+ static readonly NANOS_PER_MILLI:number;
2769
2646
 
2770
- export namespace dh.plot {
2647
+ /**
2648
+ * Creates a new date/time format instance. This generally should be avoided in favor of the static `getFormat`
2649
+ * function, which will create and cache an instance so that later calls share the same instance.
2650
+ * @param pattern -
2651
+ */
2652
+ constructor(pattern:string);
2653
+
2654
+ /**
2655
+ *
2656
+ * @param pattern -
2657
+ * @return a date format instance matching the specified format. If this format has not been specified before, a new
2658
+ * instance will be created and stored for later reuse.
2659
+ */
2660
+ static getFormat(pattern:string):DateTimeFormat;
2661
+ /**
2662
+ * Accepts a variety of input objects to interpret as a date, and formats them using the specified pattern. A
2663
+ * `TimeZone` object can optionally be provided to format this date as the current date/time in that timezone.See
2664
+ * the instance method for more details on input objects.
2665
+ * @param pattern -
2666
+ * @param date -
2667
+ * @param timeZone -
2668
+ * @return
2669
+ */
2670
+ static format(pattern:string, date:any, timeZone?:TimeZone):string;
2671
+ /**
2672
+ * Parses the given input string using the provided pattern, and returns a JS `Date` object in milliseconds.
2673
+ * @param pattern -
2674
+ * @param text -
2675
+ * @return
2676
+ */
2677
+ static parseAsDate(pattern:string, text:string):Date;
2678
+ /**
2679
+ * Parses the given input string using the provided pattern, and returns a wrapped Java `long` value in nanoseconds.
2680
+ * A `TimeZone` object can optionally be provided to parse to a desired timezone.
2681
+ * @param pattern -
2682
+ * @param text -
2683
+ * @param tz -
2684
+ * @return
2685
+ */
2686
+ static parse(pattern:string, text:string, tz?:TimeZone):dh.DateWrapper;
2687
+ /**
2688
+ * Takes a variety of objects to interpret as a date, and formats them using this instance's pattern. Inputs can
2689
+ * include a <b>String</b> value of a number expressed in nanoseconds, a <b>Number</b> value expressed in
2690
+ * nanoseconds, a JS <b>Date</b> object (necessarily in milliseconds), or a wrapped Java <b>long</b> value,
2691
+ * expressed in nanoseconds. A <b>TimeZone</b> object can optionally be provided to format this date as the current
2692
+ * date/time in that timezone.
2693
+ * @param date -
2694
+ * @param timeZone -
2695
+ * @return String
2696
+ */
2697
+ format(date:any, timeZone?:TimeZone):string;
2698
+ /**
2699
+ * Parses the given string using this instance's pattern, and returns a wrapped Java <b>long</b> value in
2700
+ * nanoseconds. A <b>TimeZone</b> object can optionally be provided to parse to a desired timezone.
2701
+ * @param text -
2702
+ * @param tz -
2703
+ * @return
2704
+ */
2705
+ parse(text:string, tz?:TimeZone):dh.DateWrapper;
2706
+ /**
2707
+ * Parses the given string using this instance's pattern, and returns a JS <b>Date</b> object in milliseconds.
2708
+ * @param text -
2709
+ * @return
2710
+ */
2711
+ parseAsDate(text:string):Date;
2712
+ toString():string;
2713
+ }
2771
2714
 
2772
2715
  /**
2773
- * Describes how to access and display data required within a series.
2716
+ * Exported wrapper of the GWT NumberFormat, plus LongWrapper support
2717
+ *
2718
+ * Utility class to parse and format numbers, using the same format patterns as are supported by the standard Java
2719
+ * implementation used in the Deephaven server and swing client. Works for numeric types including BigInteger and
2720
+ * BigDecimal.
2774
2721
  */
2775
- export interface SeriesDataSource {
2722
+ export class NumberFormat {
2776
2723
  /**
2777
- * the type of data stored in the underlying table's Column.
2724
+ * Creates a new number format instance. This generally should be avoided in favor of the static `getFormat`
2725
+ * function, which will create and cache an instance so that later calls share the same instance.
2726
+ * @param pattern -
2727
+ */
2728
+ constructor(pattern:string);
2729
+
2730
+ /**
2731
+ * a number format instance matching the specified format. If this format has not been specified before, a new
2732
+ * instance will be created and cached for later reuse. Prefer this method to calling the constructor directly to
2733
+ * take advantage of caching
2734
+ * @param pattern -
2735
+ * @return dh.i18n.NumberFormat
2736
+ */
2737
+ static getFormat(pattern:string):NumberFormat;
2738
+ /**
2739
+ * Parses the given text using the cached format matching the given pattern.
2740
+ * @param pattern -
2741
+ * @param text -
2742
+ * @return double
2743
+ */
2744
+ static parse(pattern:string, text:string):number;
2745
+ /**
2746
+ * Formats the specified number (or Java <b>long</b>, <b>BigInteger</b> or <b>BigDecimal</b> value) using the cached
2747
+ * format matching the given pattern string.
2748
+ * @param pattern -
2749
+ * @param number -
2778
2750
  * @return String
2779
2751
  */
2780
- get columnType():string;
2752
+ static format(pattern:string, number:number|dh.BigIntegerWrapper|dh.BigDecimalWrapper|dh.LongWrapper):string;
2781
2753
  /**
2782
- * the axis that this source should be drawn on.
2783
- * @return dh.plot.Axis
2754
+ * Parses the given text using this instance's pattern into a JS Number.
2755
+ * @param text -
2756
+ * @return double
2757
+ */
2758
+ parse(text:string):number;
2759
+ /**
2760
+ * Formats the specified number (or Java `long`, `BigInteger` or `BigDecimal` value) using this instance's pattern.
2761
+ * @param number -
2762
+ * @return String
2763
+ */
2764
+ format(number:number|dh.BigIntegerWrapper|dh.BigDecimalWrapper|dh.LongWrapper):string;
2765
+ toString():string;
2766
+ }
2767
+
2768
+
2769
+ }
2770
+
2771
+ export namespace dh.plot {
2772
+
2773
+ /**
2774
+ * Describes a template that will be used to make new series instances when a new table added to a plotBy.
2775
+ */
2776
+ export interface MultiSeries {
2777
+ /**
2778
+ * The name for this multi-series.
2779
+ * @return String
2784
2780
  */
2785
- get axis():Axis;
2781
+ get name():string;
2786
2782
  /**
2787
- * the feature of this series represented by this source. See the <b>SourceType</b> enum for more details.
2783
+ * The plotting style to use for the series that will be created. See <b>SeriesPlotStyle</b> enum for more details.
2788
2784
  * @return int
2789
2785
  */
2790
- get type():SourceTypeType;
2786
+ get plotStyle():SeriesPlotStyleType;
2791
2787
  }
2792
2788
  /**
2793
2789
  * Provides access to the data for displaying in a figure.
@@ -2833,9 +2829,31 @@ export namespace dh.plot {
2833
2829
  get multiSeries():MultiSeries;
2834
2830
  get shapeLabel():string;
2835
2831
  }
2836
- export interface FigureDataUpdatedEvent {
2837
- getArray(series:Series, sourceType:number, mappingFunc?:(arg0:any)=>any):Array<any>;
2838
- get series():Series[];
2832
+ export interface OneClick {
2833
+ setValueForColumn(columnName:string, value:any):void;
2834
+ getValueForColumn(columName:string):any;
2835
+ get requireAllFiltersToDisplay():boolean;
2836
+ get columns():dh.Column[];
2837
+ }
2838
+ /**
2839
+ * Describes how to access and display data required within a series.
2840
+ */
2841
+ export interface SeriesDataSource {
2842
+ /**
2843
+ * the type of data stored in the underlying table's Column.
2844
+ * @return String
2845
+ */
2846
+ get columnType():string;
2847
+ /**
2848
+ * the axis that this source should be drawn on.
2849
+ * @return dh.plot.Axis
2850
+ */
2851
+ get axis():Axis;
2852
+ /**
2853
+ * the feature of this series represented by this source. See the <b>SourceType</b> enum for more details.
2854
+ * @return int
2855
+ */
2856
+ get type():SourceTypeType;
2839
2857
  }
2840
2858
  /**
2841
2859
  * Defines one axis used with by series. These instances will be found both on the Chart and the Series instances, and
@@ -2905,62 +2923,79 @@ export namespace dh.plot {
2905
2923
  get formatType():AxisFormatTypeType;
2906
2924
  get minRange():number;
2907
2925
  }
2908
- export interface OneClick {
2909
- setValueForColumn(columnName:string, value:any):void;
2910
- getValueForColumn(columName:string):any;
2911
- get requireAllFiltersToDisplay():boolean;
2912
- get columns():dh.Column[];
2926
+ export interface FigureDataUpdatedEvent {
2927
+ getArray(series:Series, sourceType:number, mappingFunc?:(arg0:any)=>any):Array<any>;
2928
+ get series():Series[];
2913
2929
  }
2930
+
2914
2931
  /**
2915
- * Describes a template that will be used to make new series instances when a new table added to a plotBy.
2932
+ * Provide the details for a chart.
2916
2933
  */
2917
- export interface MultiSeries {
2934
+ export class Chart implements dh.HasEventHandling {
2918
2935
  /**
2919
- * The name for this multi-series.
2936
+ * a new series was added to this chart as part of a multi-series. The series instance is the detail for this event.
2937
+ */
2938
+ static readonly EVENT_SERIES_ADDED:string;
2939
+ /**
2940
+ * The title of the chart.
2920
2941
  * @return String
2921
2942
  */
2922
- get name():string;
2943
+ readonly title?:string|null;
2944
+
2945
+ protected constructor();
2946
+
2947
+ addEventListener<T>(name:string, callback:(e:CustomEvent<T>)=>void):()=>void;
2948
+ nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<CustomEvent<T>>;
2949
+ hasListeners(name:string):boolean;
2950
+ removeEventListener<T>(name:string, callback:(e:CustomEvent<T>)=>void):boolean;
2951
+ get column():number;
2952
+ get showLegend():boolean;
2923
2953
  /**
2924
- * The plotting style to use for the series that will be created. See <b>SeriesPlotStyle</b> enum for more details.
2954
+ * The axes used in this chart.
2955
+ * @return dh.plot.Axis
2956
+ */
2957
+ get axes():Axis[];
2958
+ get is3d():boolean;
2959
+ get titleFont():string;
2960
+ get colspan():number;
2961
+ get titleColor():string;
2962
+ get series():Series[];
2963
+ get rowspan():number;
2964
+ /**
2965
+ * The type of this chart, see <b>ChartType</b> enum for more details.
2925
2966
  * @return int
2926
2967
  */
2927
- get plotStyle():SeriesPlotStyleType;
2968
+ get chartType():ChartTypeType;
2969
+ get row():number;
2970
+ get legendColor():string;
2971
+ get legendFont():string;
2972
+ get multiSeries():MultiSeries[];
2973
+ }
2974
+
2975
+ export class ChartDescriptor {
2976
+ colspan?:number|null;
2977
+ rowspan?:number|null;
2978
+ series:Array<SeriesDescriptor>;
2979
+ axes:Array<AxisDescriptor>;
2980
+ chartType:string;
2981
+ title?:string|null;
2982
+ titleFont?:string|null;
2983
+ titleColor?:string|null;
2984
+ showLegend?:boolean|null;
2985
+ legendFont?:string|null;
2986
+ legendColor?:string|null;
2987
+ is3d?:boolean|null;
2988
+
2989
+ constructor();
2990
+ }
2991
+
2992
+ export class FigureSourceException {
2993
+ table:dh.Table;
2994
+ source:SeriesDataSource;
2995
+
2996
+ protected constructor();
2928
2997
  }
2929
2998
 
2930
- /**
2931
- * Provides the details for a figure.
2932
- *
2933
- * The Deephaven JS API supports automatic lossless downsampling of time-series data, when that data is plotted in one
2934
- * or more line series. Using a scatter plot or a X-axis of some type other than DateTime will prevent this feature from
2935
- * being applied to a series. To enable this feature, invoke <b>Axis.range(...)</b> to specify the length in pixels of
2936
- * the axis on the screen, and the range of values that are visible, and the server will use that width (and range, if
2937
- * any) to reduce the number of points sent to the client.
2938
- *
2939
- * Downsampling can also be controlled when calling either <b>Figure.subscribe()</b> or <b>Series.subscribe()</b> - both
2940
- * can be given an optional <b>dh.plot.DownsampleOptions</b> argument. Presently only two valid values exist,
2941
- * <b>DEFAULT</b>, and <b>DISABLE</b>, and if no argument is specified, <b>DEFAULT</b> is assumed. If there are more
2942
- * than 30,000 rows in a table, downsampling will be encouraged - data will not load without calling
2943
- * <b>subscribe(DISABLE)</b> or enabling downsampling via <b>Axis.range(...)</b>. If there are more than 200,000 rows,
2944
- * data will refuse to load without downsampling and <b>subscribe(DISABLE)</b> would have no effect.
2945
- *
2946
- * Downsampled data looks like normal data, except that select items have been removed if they would be redundant in the
2947
- * UI given the current configuration. Individual rows are intact, so that a tooltip or some other UI item is sure to be
2948
- * accurate and consistent, and at least the highest and lowest value for each axis will be retained as well, to ensure
2949
- * that the "important" values are visible.
2950
- *
2951
- * Four events exist to help with interacting with downsampled data, all fired from the <b>Figure</b> instance itself.
2952
- * First, <b>downsampleneeded</b> indicates that more than 30,000 rows would be fetched, and so specifying downsampling
2953
- * is no longer optional - it must either be enabled (calling <b>axis.range(...)</b>), or disabled. If the figure is
2954
- * configured for downsampling, when a change takes place that requires that the server perform some downsampling work,
2955
- * the <b>downsamplestarted</b> event will first be fired, which can be used to present a brief loading message,
2956
- * indicating to the user why data is not ready yet - when the server side process is complete,
2957
- * <b>downsamplefinished</b> will be fired. These events will repeat when the range changes, such as when zooming,
2958
- * panning, or resizing the figure. Finally, <b>downsamplefailed</b> indicates that something when wrong when
2959
- * downsampling, or possibly that downsampling cannot be disabled due to the number of rows in the table.
2960
- *
2961
- * At this time, not marked as a ServerObject, due to internal implementation issues which leave the door open to
2962
- * client-created figures.
2963
- */
2964
2999
  export class Figure implements dh.HasEventHandling {
2965
3000
  /**
2966
3001
  * The title of the figure.
@@ -3004,8 +3039,7 @@ export namespace dh.plot {
3004
3039
  */
3005
3040
  static readonly EVENT_DOWNSAMPLENEEDED:string;
3006
3041
 
3007
- protected constructor();
3008
-
3042
+ static create(config:FigureDescriptor):Promise<Figure>;
3009
3043
  subscribe(forceDisableDownsample?:DownsampleOptions):void;
3010
3044
  /**
3011
3045
  * Disable updates for all series in this figure.
@@ -3044,96 +3078,21 @@ export namespace dh.plot {
3044
3078
  * @typeParam T -
3045
3079
  */
3046
3080
  removeEventListener<T>(name:string, callback:(e:CustomEvent<T>)=>void):boolean;
3047
- static create(config:FigureDescriptor):Promise<Figure>;
3048
3081
  }
3049
3082
 
3050
3083
  /**
3051
- * Helper class to manage snapshots and deltas and keep not only a contiguous JS array of data per column in the
3052
- * underlying table, but also support a mapping function to let client code translate data in some way for display and
3053
- * keep that cached as well.
3084
+ * A descriptor used with JsFigureFactory.create to create a figure from JS.
3054
3085
  */
3055
- export class ChartData {
3056
- constructor(table:dh.Table);
3057
-
3058
- update(tableData:dh.SubscriptionTableData):void;
3059
- getColumn(columnName:string, mappingFunc:(arg0:any)=>any, currentUpdate:dh.TableData):Array<any>;
3060
- /**
3061
- * Removes some column from the cache, avoiding extra computation on incoming events, and possibly freeing some
3062
- * memory. If this pair of column name and map function are requested again, it will be recomputed from scratch.
3063
- */
3064
- removeColumn(columnName:string, mappingFunc:(arg0:any)=>any):void;
3065
- }
3066
-
3067
- export class ChartDescriptor {
3068
- colspan?:number|null;
3069
- rowspan?:number|null;
3070
- series:Array<SeriesDescriptor>;
3071
- axes:Array<AxisDescriptor>;
3072
- chartType:string;
3086
+ export class FigureDescriptor {
3073
3087
  title?:string|null;
3074
3088
  titleFont?:string|null;
3075
3089
  titleColor?:string|null;
3076
- showLegend?:boolean|null;
3077
- legendFont?:string|null;
3078
- legendColor?:string|null;
3079
- is3d?:boolean|null;
3080
-
3081
- constructor();
3082
- }
3083
-
3084
- export class DownsampleOptions {
3085
- /**
3086
- * Max number of items in the series before DEFAULT will not attempt to load the series without downsampling. Above
3087
- * this size if downsample fails or is not applicable, the series won't be loaded unless DISABLE is passed to
3088
- * series.subscribe().
3089
- */
3090
- static MAX_SERIES_SIZE:number;
3091
- /**
3092
- * Max number of items in the series where the subscription will be allowed at all. Above this limit, even with
3093
- * downsampling disabled, the series will not load data.
3094
- */
3095
- static MAX_SUBSCRIPTION_SIZE:number;
3096
- /**
3097
- * Flag to let the API decide what data will be available, based on the nature of the data, the series, and how the
3098
- * axes are configured.
3099
- */
3100
- static readonly DEFAULT:DownsampleOptions;
3101
- /**
3102
- * Flat to entirely disable downsampling, and force all data to load, no matter how many items that would be, up to
3103
- * the limit of MAX_SUBSCRIPTION_SIZE.
3104
- */
3105
- static readonly DISABLE:DownsampleOptions;
3106
-
3107
- protected constructor();
3108
- }
3109
-
3110
- export class SeriesDataSourceException {
3111
- protected constructor();
3112
-
3113
- get source():SeriesDataSource;
3114
- get message():string;
3115
- }
3116
-
3117
- export class AxisDescriptor {
3118
- formatType:string;
3119
- type:string;
3120
- position:string;
3121
- log?:boolean|null;
3122
- label?:string|null;
3123
- labelFont?:string|null;
3124
- ticksFont?:string|null;
3125
- formatPattern?:string|null;
3126
- color?:string|null;
3127
- minRange?:number|null;
3128
- maxRange?:number|null;
3129
- minorTicksVisible?:boolean|null;
3130
- majorTicksVisible?:boolean|null;
3131
- minorTickCount?:number|null;
3132
- gapBetweenMajorTicks?:number|null;
3133
- majorTickLocations?:Array<number>|null;
3134
- tickLabelAngle?:number|null;
3135
- invert?:boolean|null;
3136
- isTimeAxis?:boolean|null;
3090
+ isResizable?:boolean|null;
3091
+ isDefaultTheme?:boolean|null;
3092
+ updateInterval?:number|null;
3093
+ cols?:number|null;
3094
+ rows?:number|null;
3095
+ charts:Array<ChartDescriptor>;
3137
3096
 
3138
3097
  constructor();
3139
3098
  }
@@ -3141,61 +3100,27 @@ export namespace dh.plot {
3141
3100
  export class SourceDescriptor {
3142
3101
  axis:AxisDescriptor;
3143
3102
  table:dh.Table;
3144
- columnName:string;
3145
- type:string;
3146
-
3147
- constructor();
3148
- }
3149
-
3150
- /**
3151
- * Provide the details for a chart.
3152
- */
3153
- export class Chart implements dh.HasEventHandling {
3154
- /**
3155
- * a new series was added to this chart as part of a multi-series. The series instance is the detail for this event.
3156
- */
3157
- static readonly EVENT_SERIES_ADDED:string;
3158
- /**
3159
- * The title of the chart.
3160
- * @return String
3161
- */
3162
- readonly title?:string|null;
3163
-
3164
- protected constructor();
3165
-
3166
- addEventListener<T>(name:string, callback:(e:CustomEvent<T>)=>void):()=>void;
3167
- nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<CustomEvent<T>>;
3168
- hasListeners(name:string):boolean;
3169
- removeEventListener<T>(name:string, callback:(e:CustomEvent<T>)=>void):boolean;
3170
- get column():number;
3171
- get showLegend():boolean;
3172
- /**
3173
- * The axes used in this chart.
3174
- * @return dh.plot.Axis
3175
- */
3176
- get axes():Axis[];
3177
- get is3d():boolean;
3178
- get titleFont():string;
3179
- get colspan():number;
3180
- get titleColor():string;
3181
- get series():Series[];
3182
- get rowspan():number;
3183
- /**
3184
- * The type of this chart, see <b>ChartType</b> enum for more details.
3185
- * @return int
3186
- */
3187
- get chartType():ChartTypeType;
3188
- get row():number;
3189
- get legendColor():string;
3190
- get legendFont():string;
3191
- get multiSeries():MultiSeries[];
3103
+ columnName:string;
3104
+ type:string;
3105
+
3106
+ constructor();
3192
3107
  }
3193
3108
 
3194
- export class FigureSourceException {
3195
- table:dh.Table;
3196
- source:SeriesDataSource;
3109
+ /**
3110
+ * Helper class to manage snapshots and deltas and keep not only a contiguous JS array of data per column in the
3111
+ * underlying table, but also support a mapping function to let client code translate data in some way for display and
3112
+ * keep that cached as well.
3113
+ */
3114
+ export class ChartData {
3115
+ constructor(table:dh.Table);
3197
3116
 
3198
- protected constructor();
3117
+ update(tableData:dh.SubscriptionTableData):void;
3118
+ getColumn(columnName:string, mappingFunc:(arg0:any)=>any, currentUpdate:dh.TableData):Array<any>;
3119
+ /**
3120
+ * Removes some column from the cache, avoiding extra computation on incoming events, and possibly freeing some
3121
+ * memory. If this pair of column name and map function are requested again, it will be recomputed from scratch.
3122
+ */
3123
+ removeColumn(columnName:string, mappingFunc:(arg0:any)=>any):void;
3199
3124
  }
3200
3125
 
3201
3126
  export class SeriesDescriptor {
@@ -3217,6 +3142,39 @@ export namespace dh.plot {
3217
3142
  constructor();
3218
3143
  }
3219
3144
 
3145
+ export class SeriesDataSourceException {
3146
+ protected constructor();
3147
+
3148
+ get source():SeriesDataSource;
3149
+ get message():string;
3150
+ }
3151
+
3152
+ export class DownsampleOptions {
3153
+ /**
3154
+ * Max number of items in the series before DEFAULT will not attempt to load the series without downsampling. Above
3155
+ * this size if downsample fails or is not applicable, the series won't be loaded unless DISABLE is passed to
3156
+ * series.subscribe().
3157
+ */
3158
+ static MAX_SERIES_SIZE:number;
3159
+ /**
3160
+ * Max number of items in the series where the subscription will be allowed at all. Above this limit, even with
3161
+ * downsampling disabled, the series will not load data.
3162
+ */
3163
+ static MAX_SUBSCRIPTION_SIZE:number;
3164
+ /**
3165
+ * Flag to let the API decide what data will be available, based on the nature of the data, the series, and how the
3166
+ * axes are configured.
3167
+ */
3168
+ static readonly DEFAULT:DownsampleOptions;
3169
+ /**
3170
+ * Flat to entirely disable downsampling, and force all data to load, no matter how many items that would be, up to
3171
+ * the limit of MAX_SUBSCRIPTION_SIZE.
3172
+ */
3173
+ static readonly DISABLE:DownsampleOptions;
3174
+
3175
+ protected constructor();
3176
+ }
3177
+
3220
3178
  export class FigureFetchError {
3221
3179
  error:object;
3222
3180
  errors:Array<string>;
@@ -3224,40 +3182,31 @@ export namespace dh.plot {
3224
3182
  protected constructor();
3225
3183
  }
3226
3184
 
3227
- /**
3228
- * A descriptor used with JsFigureFactory.create to create a figure from JS.
3229
- */
3230
- export class FigureDescriptor {
3231
- title?:string|null;
3232
- titleFont?:string|null;
3233
- titleColor?:string|null;
3234
- isResizable?:boolean|null;
3235
- isDefaultTheme?:boolean|null;
3236
- updateInterval?:number|null;
3237
- cols?:number|null;
3238
- rows?:number|null;
3239
- charts:Array<ChartDescriptor>;
3185
+ export class AxisDescriptor {
3186
+ formatType:string;
3187
+ type:string;
3188
+ position:string;
3189
+ log?:boolean|null;
3190
+ label?:string|null;
3191
+ labelFont?:string|null;
3192
+ ticksFont?:string|null;
3193
+ formatPattern?:string|null;
3194
+ color?:string|null;
3195
+ minRange?:number|null;
3196
+ maxRange?:number|null;
3197
+ minorTicksVisible?:boolean|null;
3198
+ majorTicksVisible?:boolean|null;
3199
+ minorTickCount?:number|null;
3200
+ gapBetweenMajorTicks?:number|null;
3201
+ majorTickLocations?:Array<number>|null;
3202
+ tickLabelAngle?:number|null;
3203
+ invert?:boolean|null;
3204
+ isTimeAxis?:boolean|null;
3240
3205
 
3241
3206
  constructor();
3242
3207
  }
3243
3208
 
3244
3209
 
3245
- type SeriesPlotStyleType = number;
3246
- export class SeriesPlotStyle {
3247
- static readonly BAR:SeriesPlotStyleType;
3248
- static readonly STACKED_BAR:SeriesPlotStyleType;
3249
- static readonly LINE:SeriesPlotStyleType;
3250
- static readonly AREA:SeriesPlotStyleType;
3251
- static readonly STACKED_AREA:SeriesPlotStyleType;
3252
- static readonly PIE:SeriesPlotStyleType;
3253
- static readonly HISTOGRAM:SeriesPlotStyleType;
3254
- static readonly OHLC:SeriesPlotStyleType;
3255
- static readonly SCATTER:SeriesPlotStyleType;
3256
- static readonly STEP:SeriesPlotStyleType;
3257
- static readonly ERROR_BAR:SeriesPlotStyleType;
3258
- static readonly TREEMAP:SeriesPlotStyleType;
3259
- }
3260
-
3261
3210
  type AxisPositionType = number;
3262
3211
  export class AxisPosition {
3263
3212
  static readonly TOP:AxisPositionType;
@@ -3267,19 +3216,14 @@ export namespace dh.plot {
3267
3216
  static readonly NONE:AxisPositionType;
3268
3217
  }
3269
3218
 
3270
- /**
3271
- * This enum describes what kind of chart is being drawn. This may limit what kinds of series can be found on it, or how
3272
- * those series should be rendered.
3273
- */
3274
- type ChartTypeType = number;
3275
- export class ChartType {
3276
- static readonly XY:ChartTypeType;
3277
- static readonly PIE:ChartTypeType;
3278
- static readonly OHLC:ChartTypeType;
3279
- static readonly CATEGORY:ChartTypeType;
3280
- static readonly XYZ:ChartTypeType;
3281
- static readonly CATEGORY_3D:ChartTypeType;
3282
- static readonly TREEMAP:ChartTypeType;
3219
+ type AxisTypeType = number;
3220
+ export class AxisType {
3221
+ static readonly X:AxisTypeType;
3222
+ static readonly Y:AxisTypeType;
3223
+ static readonly SHAPE:AxisTypeType;
3224
+ static readonly SIZE:AxisTypeType;
3225
+ static readonly LABEL:AxisTypeType;
3226
+ static readonly COLOR:AxisTypeType;
3283
3227
  }
3284
3228
 
3285
3229
  /**
@@ -3311,31 +3255,65 @@ export namespace dh.plot {
3311
3255
  static readonly HOVER_TEXT:SourceTypeType;
3312
3256
  }
3313
3257
 
3258
+ /**
3259
+ * This enum describes what kind of chart is being drawn. This may limit what kinds of series can be found on it, or how
3260
+ * those series should be rendered.
3261
+ */
3262
+ type ChartTypeType = number;
3263
+ export class ChartType {
3264
+ static readonly XY:ChartTypeType;
3265
+ static readonly PIE:ChartTypeType;
3266
+ static readonly OHLC:ChartTypeType;
3267
+ static readonly CATEGORY:ChartTypeType;
3268
+ static readonly XYZ:ChartTypeType;
3269
+ static readonly CATEGORY_3D:ChartTypeType;
3270
+ static readonly TREEMAP:ChartTypeType;
3271
+ }
3272
+
3273
+ type SeriesPlotStyleType = number;
3274
+ export class SeriesPlotStyle {
3275
+ static readonly BAR:SeriesPlotStyleType;
3276
+ static readonly STACKED_BAR:SeriesPlotStyleType;
3277
+ static readonly LINE:SeriesPlotStyleType;
3278
+ static readonly AREA:SeriesPlotStyleType;
3279
+ static readonly STACKED_AREA:SeriesPlotStyleType;
3280
+ static readonly PIE:SeriesPlotStyleType;
3281
+ static readonly HISTOGRAM:SeriesPlotStyleType;
3282
+ static readonly OHLC:SeriesPlotStyleType;
3283
+ static readonly SCATTER:SeriesPlotStyleType;
3284
+ static readonly STEP:SeriesPlotStyleType;
3285
+ static readonly ERROR_BAR:SeriesPlotStyleType;
3286
+ static readonly TREEMAP:SeriesPlotStyleType;
3287
+ }
3288
+
3314
3289
  type AxisFormatTypeType = number;
3315
3290
  export class AxisFormatType {
3316
3291
  static readonly CATEGORY:AxisFormatTypeType;
3317
3292
  static readonly NUMBER:AxisFormatTypeType;
3318
3293
  }
3319
3294
 
3320
- type AxisTypeType = number;
3321
- export class AxisType {
3322
- static readonly X:AxisTypeType;
3323
- static readonly Y:AxisTypeType;
3324
- static readonly SHAPE:AxisTypeType;
3325
- static readonly SIZE:AxisTypeType;
3326
- static readonly LABEL:AxisTypeType;
3327
- static readonly COLOR:AxisTypeType;
3328
- }
3329
-
3330
3295
  }
3331
3296
 
3332
3297
  export namespace dh.lsp {
3333
3298
 
3334
- export class SignatureInformation {
3335
- label:string;
3336
- documentation:MarkupContent;
3337
- parameters:Array<ParameterInformation>;
3338
- activeParameter:number;
3299
+ export class TextEdit {
3300
+ range:Range;
3301
+ text:string;
3302
+
3303
+ constructor();
3304
+ }
3305
+
3306
+ export class TextDocumentContentChangeEvent {
3307
+ range:Range;
3308
+ rangeLength:number;
3309
+ text:string;
3310
+
3311
+ constructor();
3312
+ }
3313
+
3314
+ export class MarkupContent {
3315
+ kind:string;
3316
+ value:string;
3339
3317
 
3340
3318
  constructor();
3341
3319
  }
@@ -3356,17 +3334,9 @@ export namespace dh.lsp {
3356
3334
  constructor();
3357
3335
  }
3358
3336
 
3359
- export class TextEdit {
3360
- range:Range;
3361
- text:string;
3362
-
3363
- constructor();
3364
- }
3365
-
3366
- export class TextDocumentContentChangeEvent {
3337
+ export class Hover {
3338
+ contents:MarkupContent;
3367
3339
  range:Range;
3368
- rangeLength:number;
3369
- text:string;
3370
3340
 
3371
3341
  constructor();
3372
3342
  }
@@ -3384,20 +3354,6 @@ export namespace dh.lsp {
3384
3354
  copy():Position;
3385
3355
  }
3386
3356
 
3387
- export class Hover {
3388
- contents:MarkupContent;
3389
- range:Range;
3390
-
3391
- constructor();
3392
- }
3393
-
3394
- export class MarkupContent {
3395
- kind:string;
3396
- value:string;
3397
-
3398
- constructor();
3399
- }
3400
-
3401
3357
  export class CompletionItem {
3402
3358
  label:string;
3403
3359
  kind:number;
@@ -3415,10 +3371,35 @@ export namespace dh.lsp {
3415
3371
  constructor();
3416
3372
  }
3417
3373
 
3374
+ export class SignatureInformation {
3375
+ label:string;
3376
+ documentation:MarkupContent;
3377
+ parameters:Array<ParameterInformation>;
3378
+ activeParameter:number;
3379
+
3380
+ constructor();
3381
+ }
3382
+
3418
3383
  }
3419
3384
 
3420
3385
  export namespace dh.calendar {
3421
3386
 
3387
+ export interface Holiday {
3388
+ /**
3389
+ * The date of the Holiday.
3390
+ * @return {@link dh.LocalDateWrapper}
3391
+ */
3392
+ get date():dh.LocalDateWrapper;
3393
+ /**
3394
+ * The business periods that are open on the holiday.
3395
+ * @return dh.calendar.BusinessPeriod
3396
+ */
3397
+ get businessPeriods():Array<BusinessPeriod>;
3398
+ }
3399
+ export interface BusinessPeriod {
3400
+ get close():string;
3401
+ get open():string;
3402
+ }
3422
3403
  /**
3423
3404
  * Defines a calendar with business hours and holidays.
3424
3405
  */
@@ -3449,22 +3430,6 @@ export namespace dh.calendar {
3449
3430
  */
3450
3431
  get businessPeriods():Array<BusinessPeriod>;
3451
3432
  }
3452
- export interface Holiday {
3453
- /**
3454
- * The date of the Holiday.
3455
- * @return {@link dh.LocalDateWrapper}
3456
- */
3457
- get date():dh.LocalDateWrapper;
3458
- /**
3459
- * The business periods that are open on the holiday.
3460
- * @return dh.calendar.BusinessPeriod
3461
- */
3462
- get businessPeriods():Array<BusinessPeriod>;
3463
- }
3464
- export interface BusinessPeriod {
3465
- get close():string;
3466
- get open():string;
3467
- }
3468
3433
 
3469
3434
  type DayOfWeekType = string;
3470
3435
  export class DayOfWeek {