@deephaven/jsapi-types 1.0.0-dev0.34.3 → 1.0.0-dev0.35.1

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 +1949 -1947
  2. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -33,20 +33,6 @@ export namespace dh.storage {
33
33
  get etag():string;
34
34
  }
35
35
 
36
- /**
37
- * Storage service metadata about files and folders.
38
- */
39
- export class ItemDetails {
40
- protected constructor();
41
-
42
- get filename():string;
43
- get basename():string;
44
- get size():number;
45
- get etag():string;
46
- get type():ItemTypeType;
47
- get dirname():string;
48
- }
49
-
50
36
  /**
51
37
  * Remote service to read and write files on the server. Paths use "/" as a separator, and should not start with "/".
52
38
  */
@@ -105,6 +91,21 @@ export namespace dh.storage {
105
91
  createDirectory(path:string):Promise<void>;
106
92
  }
107
93
 
94
+ /**
95
+ * Storage service metadata about files and folders.
96
+ */
97
+ export class ItemDetails {
98
+ protected constructor();
99
+
100
+ toString():string;
101
+ get filename():string;
102
+ get basename():string;
103
+ get size():number;
104
+ get etag():string;
105
+ get type():ItemTypeType;
106
+ get dirname():string;
107
+ }
108
+
108
109
 
109
110
  type ItemTypeType = string;
110
111
  export class ItemType {
@@ -117,36 +118,154 @@ export namespace dh.storage {
117
118
  export namespace dh {
118
119
 
119
120
  /**
120
- * Represents the contents of a single widget data message from the server, with a binary data paylod and exported
121
- * objects. Implemented both by Widget itself and by the `event.details` when data is received by the client.
122
- *
123
- * Terminology note: the name of this type should probably use "Data" instead of "Message", and the methods should use
124
- * "payload" rather than "data" to match other platforms and the protobuf itself. These names are instead used for
125
- * backwards compatibility and to better follow JS expectations.
121
+ * Contains data in the current viewport. Also contains the offset to this data, so that the actual row number may be
122
+ * determined. Do not assume that the first row in `rows` is the first visible row, because extra rows may be provided
123
+ * for easier scrolling without going to the server.
126
124
  */
127
- export interface WidgetMessageDetails {
125
+ export interface ViewportData extends TableData {
128
126
  /**
129
- * Returns the data from this message as a base64-encoded string.
127
+ * The index of the first returned row
128
+ * @return double
130
129
  */
131
- getDataAsBase64():string;
130
+ get offset():number;
132
131
  /**
133
- * Returns the data from this message as a Uint8Array.
132
+ * A list of columns describing the data types in each row
133
+ * @return {@link dh.Column} array.
134
134
  */
135
- getDataAsU8():Uint8Array;
135
+ get columns():Array<Column>;
136
136
  /**
137
- * Returns the data from this message as a utf-8 string.
137
+ * An array of rows of data
138
+ * @return {@link dh.ViewportRow} array.
138
139
  */
139
- getDataAsString():string;
140
+ get rows():Array<ViewportRow>;
141
+ }
142
+ /**
143
+ * Wrap LocalTime values for use in JS. Provides text formatting for display and access to the underlying value.
144
+ */
145
+ export interface LocalTimeWrapper {
146
+ valueOf():string;
147
+ getHour():number;
148
+ getMinute():number;
149
+ getSecond():number;
150
+ getNano():number;
151
+ toString():string;
152
+ }
153
+ export interface LayoutHints {
154
+ readonly searchDisplayMode?:SearchDisplayModeType|null;
155
+
156
+ get hiddenColumns():string[]|null;
157
+ get frozenColumns():string[]|null;
158
+ get columnGroups():ColumnGroup[]|null;
159
+ get areSavedLayoutsAllowed():boolean;
160
+ get frontColumns():string[]|null;
161
+ get backColumns():string[]|null;
162
+ }
163
+ export interface Row {
164
+ get(column:Column):any;
165
+ getFormat(column:Column):Format;
166
+ get index():LongWrapper;
167
+ }
168
+ /**
169
+ * Represents a table which can be joined to another table. Current implementations are {@link dh.Table} and
170
+ * {@link dh.TotalsTable}.
171
+ */
172
+ export interface JoinableTable {
173
+ freeze():Promise<Table>;
174
+ snapshot(baseTable:Table, doInitialSnapshot?:boolean, stampColumns?:string[]):Promise<Table>;
140
175
  /**
141
- * Returns an array of exported objects sent from the server. The plugin implementation is now responsible for these
142
- * objects, and should close them when no longer needed.
176
+ * Joins this table to the provided table, using one of the specified join types:
177
+ * <ul>
178
+ * <li><code>AJ</code>, <code>ReverseAJ</code> (or <code>RAJ</code>) - inexact timeseries joins, based on the
179
+ * provided matching rule.</li>
180
+ * <li><code>CROSS_JOIN</code> (or <code>Join</code>) - cross join of all rows that have matching values in both
181
+ * tables.</li>
182
+ * <li><code>EXACT_JOIN</code> (or <code>ExactJoin</code> - matches values in exactly one row in the right table,
183
+ * with errors if there is not exactly one.</li>
184
+ * <li><code>NATURAL_JOIN</code> (or <code>Natural</code> - matches values in at most one row in the right table,
185
+ * with nulls if there is no match or errors if there are multiple matches.</li>
186
+ * </ul>
187
+ *
188
+ * Note that <code>Left</code> join is not supported here, unlike DHE.
189
+ * <p>
190
+ * See the <a href="https://deephaven.io/core/docs/conceptual/choose-joins/">Choose a join method</a> document for
191
+ * more guidance on picking a join operation.
192
+ * @deprecated Instead, call the specific method for the join type.
193
+ * @param joinType - The type of join to perform, see the list above.
194
+ * @param rightTable - The table to match to values in this table
195
+ * @param columnsToMatch - Columns that should match
196
+ * @param columnsToAdd - Columns from the right table to add to the result - empty/null/absent to add all columns
197
+ * @param asOfMatchRule - If joinType is AJ/RAJ/ReverseAJ, the match rule to use
198
+ * @return a promise that will resolve to the joined table
143
199
  */
144
- get exportedObjects():WidgetExportedObject[];
200
+ join(joinType:string, rightTable:JoinableTable, columnsToMatch:Array<string>, columnsToAdd?:Array<string>|undefined|null, asOfMatchRule?:string|undefined|null):Promise<Table>;
201
+ /**
202
+ * Performs an inexact timeseries join, where rows in this table will have columns added from the closest matching
203
+ * row from the right table.
204
+ * <p>
205
+ * The `asOfMatchRule` value can be one of:
206
+ * <ul>
207
+ * <li>LESS_THAN_EQUAL</li>
208
+ * <li>LESS_THAN</li>
209
+ * <li>GREATER_THAN_EQUAL</li>
210
+ * <li>GREATER_THAN</li>
211
+ * </ul>
212
+ * @param rightTable - the table to match to values in this table
213
+ * @param columnsToMatch - the columns that should match, according to the asOfMatchRole
214
+ * @param columnsToAdd - columns from the right table to add to the resulting table, empty/null/absent to add all
215
+ * columns
216
+ * @param asOfMatchRule - the match rule to use, see above
217
+ * @return a promise that will resolve to the joined table
218
+ */
219
+ asOfJoin(rightTable:JoinableTable, columnsToMatch:Array<string>, columnsToAdd?:Array<string>|undefined|null, asOfMatchRule?:string|undefined|null):Promise<Table>;
220
+ /**
221
+ * a promise that will be resolved with the newly created table holding the results of the specified cross join
222
+ * operation. The <b>columnsToAdd</b> parameter is optional, not specifying it will result in all columns from the
223
+ * right table being added to the output. The <b>reserveBits</b> optional parameter lets the client control how the
224
+ * key space is distributed between the rows in the two tables, see the Java <b>Table</b> class for details.
225
+ * @param rightTable - the table to match to values in this table
226
+ * @param columnsToMatch - the columns that should match exactly
227
+ * @param columnsToAdd - columns from the right table to add to the resulting table, empty/null/absent to add all
228
+ * columns
229
+ * @param reserveBits - the number of bits of key-space to initially reserve per group, null/absent will let the
230
+ * server select a value
231
+ * @return a promise that will resolve to the joined table
232
+ */
233
+ crossJoin(rightTable:JoinableTable, columnsToMatch:Array<string>, columnsToAdd?:Array<string>|undefined|null, reserveBits?:number|undefined|null):Promise<Table>;
234
+ /**
235
+ * a promise that will be resolved with the newly created table holding the results of the specified exact join
236
+ * operation. The `columnsToAdd` parameter is optional, not specifying it will result in all columns from the right
237
+ * table being added to the output.
238
+ * @param rightTable - the table to match to values in this table
239
+ * @param columnsToMatch - the columns that should match exactly
240
+ * @param columnsToAdd - columns from the right table to add to the resulting table, empty/null/absent to add all
241
+ * columns
242
+ * @return a promise that will resolve to the joined table
243
+ */
244
+ exactJoin(rightTable:JoinableTable, columnsToMatch:Array<string>, columnsToAdd?:Array<string>|undefined|null):Promise<Table>;
245
+ /**
246
+ * a promise that will be resolved with the newly created table holding the results of the specified natural join
247
+ * operation. The <b>columnsToAdd</b> parameter is optional, not specifying it will result in all columns from the
248
+ * right table being added to the output.
249
+ * @param rightTable - the table to match to values in this table
250
+ * @param columnsToMatch - the columns that should match exactly
251
+ * @param columnsToAdd - columns from the right table to add to the resulting table, empty/null/absent to add all
252
+ * columns
253
+ * @return a promise that will resolve to the joined table
254
+ */
255
+ naturalJoin(rightTable:JoinableTable, columnsToMatch:Array<string>, columnsToAdd?:Array<string>|undefined|null):Promise<Table>;
145
256
  }
146
- export interface ColumnGroup {
147
- get name():string|null;
148
- get children():string[]|null;
149
- get color():string|null;
257
+ /**
258
+ * Common interface for various ways of accessing table data and formatting.
259
+ *
260
+ * Java note: this interface contains some extra overloads that aren't available in JS. Implementations are expected to
261
+ * implement only abstract methods, and default methods present in this interface will dispatch accordingly.
262
+ */
263
+ export interface TableData {
264
+ get(index:LongWrapper|number):Row;
265
+ getData(index:LongWrapper|number, column:Column):any;
266
+ getFormat(index:LongWrapper|number, column:Column):Format;
267
+ get columns():Array<Column>;
268
+ get rows():Array<Row>;
150
269
  }
151
270
  /**
152
271
  * Represents a server-side object that may not yet have been fetched by the client. When this object will no longer be
@@ -180,52 +299,105 @@ export namespace dh {
180
299
  */
181
300
  close():void;
182
301
  }
183
- export interface TreeViewportData extends TableData {
184
- get offset():number;
185
- get columns():Array<Column>;
186
- get rows():Array<TreeRow>;
187
- }
188
302
  /**
189
- * Event data, describing the indexes that were added/removed/updated, and providing access to Rows (and thus data
190
- * in columns) either by index, or scanning the complete present index.
191
- *
192
- * This class supports two ways of reading the table - checking the changes made since the last update, and reading
193
- * all data currently in the table. While it is more expensive to always iterate over every single row in the table,
194
- * it may in some cases actually be cheaper than maintaining state separately and updating only the changes, though
195
- * both options should be considered.
303
+ * Encapsulates event handling around table subscriptions by "cheating" and wrapping up a JsTable instance to do the
304
+ * real dirty work. This allows a viewport to stay open on the old table if desired, while this one remains open.
305
+ * <p>
306
+ * As this just wraps a JsTable (and thus a CTS), it holds its own flattened, pUT'd handle to get deltas from the
307
+ * server. The setViewport method can be used to adjust this table instead of creating a new one.
308
+ * <p>
309
+ * Existing methods on JsTable like setViewport and getViewportData are intended to proxy to this, which then will talk
310
+ * to the underlying handle and accumulated data.
311
+ * <p>
312
+ * As long as we keep the existing methods/events on JsTable, close() is not required if no other method is called, with
313
+ * the idea then that the caller did not actually use this type. This means that for every exported method (which then
314
+ * will mark the instance of "actually being used, please don't automatically close me"), there must be an internal
315
+ * version called by those existing JsTable method, which will allow this instance to be cleaned up once the JsTable
316
+ * deems it no longer in use.
317
+ * <p>
318
+ * Note that if the caller does close an instance, this shuts down the JsTable's use of this (while the converse is not
319
+ * true), providing a way to stop the server from streaming updates to the client.
196
320
  *
197
- * The RangeSet objects allow iterating over the LongWrapper indexes in the table. Note that these "indexes" are not
198
- * necessarily contiguous and may be negative, and represent some internal state on the server, allowing it to keep
199
- * track of data efficiently. Those LongWrapper objects can be passed to the various methods on this instance to
200
- * read specific rows or cells out of the table.
321
+ * This object serves as a "handle" to a subscription, allowing it to be acted on directly or canceled outright. If you
322
+ * retain an instance of this, you have two choices - either only use it to call `close()` on it to stop the table's
323
+ * viewport without creating a new one, or listen directly to this object instead of the table for data events, and
324
+ * always call `close()` when finished. Calling any method on this object other than close() will result in it
325
+ * continuing to live on after `setViewport` is called on the original table, or after the table is modified.
201
326
  */
202
- export interface SubscriptionTableData extends TableData {
203
- get fullIndex():RangeSet;
327
+ export interface TableViewportSubscription extends HasEventHandling {
204
328
  /**
205
- * The ordered set of row indexes removed since the last update
206
- * @return dh.RangeSet
329
+ * Changes the rows and columns set on this viewport. This cannot be used to change the update interval.
330
+ * @param firstRow -
331
+ * @param lastRow -
332
+ * @param columns -
333
+ * @param updateIntervalMs -
207
334
  */
208
- get removed():RangeSet;
335
+ setViewport(firstRow:number, lastRow:number, columns?:Column[]|undefined|null, updateIntervalMs?:number|undefined|null):void;
209
336
  /**
210
- * The ordered set of row indexes added since the last update
211
- * @return dh.RangeSet
337
+ * Stops this viewport from running, stopping all events on itself and on the table that created it.
212
338
  */
213
- get added():RangeSet;
214
- get columns():Array<Column>;
339
+ close():void;
215
340
  /**
216
- * The ordered set of row indexes updated since the last update
217
- * @return dh.RangeSet
341
+ * Gets the data currently visible in this viewport
342
+ * @return Promise of {@link dh.TableData}.
218
343
  */
219
- get modified():RangeSet;
220
- get rows():Array<Row>;
344
+ getViewportData():Promise<TableData>;
345
+ snapshot(rows:RangeSet, columns:Column[]):Promise<TableData>;
221
346
  }
222
- export interface WorkerHeapInfo {
223
- /**
224
- * Total heap size available for this worker.
225
- */
226
- get totalHeapSize():number;
227
- get freeMemory():number;
228
- get maximumHeapSize():number;
347
+ /**
348
+ * Javascript wrapper for {@link io.deephaven.web.shared.data.ColumnStatistics} This class holds the results of a call to generate statistics on a
349
+ * table column.
350
+ */
351
+ export interface ColumnStatistics {
352
+ /**
353
+ * Gets the type of formatting that should be used for given statistic.
354
+ * <p>
355
+ * the format type for a statistic. A null return value means that the column formatting should be used.
356
+ * @param name - the display name of the statistic
357
+ * @return String
358
+ */
359
+ getType(name:string):string;
360
+ /**
361
+ * 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
362
+ * name to the count of how many times it occurred in the column. This map will be empty for tables containing more
363
+ * than 19 unique values.
364
+ * @return Map of String double
365
+ */
366
+ get uniqueValues():Map<string, number>;
367
+ /**
368
+ * Gets a map with the display name of statistics as keys and the numeric stat as a value.
369
+ * <p>
370
+ * A map of each statistic's name to its value.
371
+ * @return Map of String and Object
372
+ */
373
+ get statisticsMap():Map<string, object>;
374
+ }
375
+ /**
376
+ * Represents the contents of a single widget data message from the server, with a binary data paylod and exported
377
+ * objects. Implemented both by Widget itself and by the `event.details` when data is received by the client.
378
+ *
379
+ * Terminology note: the name of this type should probably use "Data" instead of "Message", and the methods should use
380
+ * "payload" rather than "data" to match other platforms and the protobuf itself. These names are instead used for
381
+ * backwards compatibility and to better follow JS expectations.
382
+ */
383
+ export interface WidgetMessageDetails {
384
+ /**
385
+ * Returns the data from this message as a base64-encoded string.
386
+ */
387
+ getDataAsBase64():string;
388
+ /**
389
+ * Returns the data from this message as a Uint8Array.
390
+ */
391
+ getDataAsU8():Uint8Array;
392
+ /**
393
+ * Returns the data from this message as a utf-8 string.
394
+ */
395
+ getDataAsString():string;
396
+ /**
397
+ * Returns an array of exported objects sent from the server. The plugin implementation is now responsible for these
398
+ * objects, and should close them when no longer needed.
399
+ */
400
+ get exportedObjects():WidgetExportedObject[];
229
401
  }
230
402
  /**
231
403
  * Behaves like a Table, but doesn't expose all of its API for changing the internal state. Instead, state is driven by
@@ -356,6 +528,79 @@ export namespace dh {
356
528
  */
357
529
  get isRefreshing():boolean;
358
530
  }
531
+ export interface RefreshToken {
532
+ get bytes():string;
533
+ get expiry():number;
534
+ }
535
+ /**
536
+ * This object may be pooled internally or discarded and not updated. Do not retain references to it.
537
+ */
538
+ export interface Format {
539
+ /**
540
+ * The format string to apply to the value of this cell.
541
+ * @return String
542
+ */
543
+ readonly formatString?:string|null;
544
+ /**
545
+ * Color to apply to the cell's background, in <b>#rrggbb</b> format.
546
+ * @return String
547
+ */
548
+ readonly backgroundColor?:string|null;
549
+ /**
550
+ * Color to apply to the text, in <b>#rrggbb</b> format.
551
+ * @return String
552
+ */
553
+ readonly color?:string|null;
554
+ /**
555
+ *
556
+ * @deprecated Prefer formatString. Number format string to apply to the value in this cell.
557
+ */
558
+ readonly numberFormat?:string|null;
559
+ }
560
+ /**
561
+ * Wrap LocalDate values for use in JS. Provides text formatting for display and access to the underlying value.
562
+ */
563
+ export interface LocalDateWrapper {
564
+ valueOf():string;
565
+ getYear():number;
566
+ getMonthValue():number;
567
+ getDayOfMonth():number;
568
+ toString():string;
569
+ }
570
+ /**
571
+ * Event data, describing the indexes that were added/removed/updated, and providing access to Rows (and thus data
572
+ * in columns) either by index, or scanning the complete present index.
573
+ *
574
+ * This class supports two ways of reading the table - checking the changes made since the last update, and reading
575
+ * all data currently in the table. While it is more expensive to always iterate over every single row in the table,
576
+ * it may in some cases actually be cheaper than maintaining state separately and updating only the changes, though
577
+ * both options should be considered.
578
+ *
579
+ * The RangeSet objects allow iterating over the LongWrapper indexes in the table. Note that these "indexes" are not
580
+ * necessarily contiguous and may be negative, and represent some internal state on the server, allowing it to keep
581
+ * track of data efficiently. Those LongWrapper objects can be passed to the various methods on this instance to
582
+ * read specific rows or cells out of the table.
583
+ */
584
+ export interface SubscriptionTableData extends TableData {
585
+ get fullIndex():RangeSet;
586
+ /**
587
+ * The ordered set of row indexes removed since the last update
588
+ * @return dh.RangeSet
589
+ */
590
+ get removed():RangeSet;
591
+ /**
592
+ * The ordered set of row indexes added since the last update
593
+ * @return dh.RangeSet
594
+ */
595
+ get added():RangeSet;
596
+ get columns():Array<Column>;
597
+ /**
598
+ * The ordered set of row indexes updated since the last update
599
+ * @return dh.RangeSet
600
+ */
601
+ get modified():RangeSet;
602
+ get rows():Array<Row>;
603
+ }
359
604
  export interface HasEventHandling {
360
605
  /**
361
606
  * Listen for events on this object.
@@ -376,28 +621,10 @@ export namespace dh {
376
621
  */
377
622
  removeEventListener<T>(name:string, callback:(e:CustomEvent<T>)=>void):boolean;
378
623
  }
379
- /**
380
- * Common interface for various ways of accessing table data and formatting.
381
- *
382
- * Java note: this interface contains some extra overloads that aren't available in JS. Implementations are expected to
383
- * implement only abstract methods, and default methods present in this interface will dispatch accordingly.
384
- */
385
- export interface TableData {
386
- get(index:LongWrapper|number):Row;
387
- getData(index:LongWrapper|number, column:Column):any;
388
- getFormat(index:LongWrapper|number, column:Column):Format;
624
+ export interface TreeViewportData extends TableData {
625
+ get offset():number;
389
626
  get columns():Array<Column>;
390
- get rows():Array<Row>;
391
- }
392
- export interface LayoutHints {
393
- readonly searchDisplayMode?:SearchDisplayModeType|null;
394
-
395
- get hiddenColumns():string[]|null;
396
- get frozenColumns():string[]|null;
397
- get columnGroups():ColumnGroup[]|null;
398
- get areSavedLayoutsAllowed():boolean;
399
- get frontColumns():string[]|null;
400
- get backColumns():string[]|null;
627
+ get rows():Array<TreeRow>;
401
628
  }
402
629
  /**
403
630
  * This object may be pooled internally or discarded and not updated. Do not retain references to it. Instead, request
@@ -407,268 +634,303 @@ export namespace dh {
407
634
  get index():LongWrapper;
408
635
  }
409
636
  /**
410
- * Contains data in the current viewport. Also contains the offset to this data, so that the actual row number may be
411
- * determined. Do not assume that the first row in `rows` is the first visible row, because extra rows may be provided
412
- * for easier scrolling without going to the server.
637
+ * Row implementation that also provides additional read-only properties. represents visible rows in the table,
638
+ * but with additional properties to reflect the tree structure.
413
639
  */
414
- export interface ViewportData extends TableData {
640
+ export interface TreeRow extends ViewportRow {
415
641
  /**
416
- * The index of the first returned row
417
- * @return double
642
+ * True if this node is currently expanded to show its children; false otherwise. Those children will be the
643
+ * rows below this one with a greater depth than this one
644
+ * @return boolean
418
645
  */
419
- get offset():number;
646
+ get isExpanded():boolean;
420
647
  /**
421
- * A list of columns describing the data types in each row
422
- * @return {@link dh.Column} array.
648
+ * The number of levels above this node; zero for top level nodes. Generally used by the UI to indent the
649
+ * row and its expand/collapse icon
650
+ * @return int
423
651
  */
424
- get columns():Array<Column>;
652
+ get depth():number;
425
653
  /**
426
- * An array of rows of data
427
- * @return {@link dh.ViewportRow} array.
654
+ * True if this node has children and can be expanded; false otherwise. Note that this value may change when
655
+ * the table updates, depending on the table's configuration
656
+ * @return boolean
428
657
  */
429
- get rows():Array<ViewportRow>;
658
+ get hasChildren():boolean;
659
+ get index():LongWrapper;
660
+ }
661
+ export interface WorkerHeapInfo {
662
+ /**
663
+ * Total heap size available for this worker.
664
+ */
665
+ get totalHeapSize():number;
666
+ get freeMemory():number;
667
+ get maximumHeapSize():number;
668
+ }
669
+ export interface ColumnGroup {
670
+ get name():string|null;
671
+ get children():string[]|null;
672
+ get color():string|null;
430
673
  }
674
+
431
675
  /**
432
- * Represents a table which can be joined to another table. Current implementations are {@link dh.Table} and
433
- * {@link dh.TotalsTable}.
676
+ * Describes a Sort present on the table. No visible constructor, created through the use of Column.sort(), will be tied
677
+ * to that particular column data. Sort instances are immutable, and use a builder pattern to make modifications. All
678
+ * methods return a new Sort instance.
434
679
  */
435
- export interface JoinableTable {
436
- freeze():Promise<Table>;
437
- snapshot(baseTable:Table, doInitialSnapshot?:boolean, stampColumns?:string[]):Promise<Table>;
680
+ export class Sort {
681
+ static readonly ASCENDING:string;
682
+ static readonly DESCENDING:string;
683
+ static readonly REVERSE:string;
684
+
685
+ protected constructor();
686
+
438
687
  /**
439
- * Joins this table to the provided table, using one of the specified join types:
440
- * <ul>
441
- * <li><code>AJ</code>, <code>ReverseAJ</code> (or <code>RAJ</code>) - inexact timeseries joins, based on the
442
- * provided matching rule.</li>
443
- * <li><code>CROSS_JOIN</code> (or <code>Join</code>) - cross join of all rows that have matching values in both
444
- * tables.</li>
445
- * <li><code>EXACT_JOIN</code> (or <code>ExactJoin</code> - matches values in exactly one row in the right table,
446
- * with errors if there is not exactly one.</li>
447
- * <li><code>NATURAL_JOIN</code> (or <code>Natural</code> - matches values in at most one row in the right table,
448
- * with nulls if there is no match or errors if there are multiple matches.</li>
449
- * </ul>
450
- *
451
- * Note that <code>Left</code> join is not supported here, unlike DHE.
452
- * <p>
453
- * See the <a href="https://deephaven.io/core/docs/conceptual/choose-joins/">Choose a join method</a> document for
454
- * more guidance on picking a join operation.
455
- * @deprecated Instead, call the specific method for the join type.
456
- * @param joinType - The type of join to perform, see the list above.
457
- * @param rightTable - The table to match to values in this table
458
- * @param columnsToMatch - Columns that should match
459
- * @param columnsToAdd - Columns from the right table to add to the result - empty/null/absent to add all columns
460
- * @param asOfMatchRule - If joinType is AJ/RAJ/ReverseAJ, the match rule to use
461
- * @return a promise that will resolve to the joined table
688
+ * Builds a Sort instance to sort values in ascending order.
689
+ * @return {@link dh.Sort}
462
690
  */
463
- join(joinType:string, rightTable:JoinableTable, columnsToMatch:Array<string>, columnsToAdd?:Array<string>|undefined|null, asOfMatchRule?:string|undefined|null):Promise<Table>;
691
+ asc():Sort;
464
692
  /**
465
- * Performs an inexact timeseries join, where rows in this table will have columns added from the closest matching
466
- * row from the right table.
467
- * <p>
468
- * The `asOfMatchRule` value can be one of:
469
- * <ul>
470
- * <li>LESS_THAN_EQUAL</li>
471
- * <li>LESS_THAN</li>
472
- * <li>GREATER_THAN_EQUAL</li>
473
- * <li>GREATER_THAN</li>
474
- * </ul>
475
- * @param rightTable - the table to match to values in this table
476
- * @param columnsToMatch - the columns that should match, according to the asOfMatchRole
477
- * @param columnsToAdd - columns from the right table to add to the resulting table, empty/null/absent to add all
478
- * columns
479
- * @param asOfMatchRule - the match rule to use, see above
480
- * @return a promise that will resolve to the joined table
693
+ * Builds a Sort instance to sort values in descending order.
694
+ * @return {@link dh.Sort}
481
695
  */
482
- asOfJoin(rightTable:JoinableTable, columnsToMatch:Array<string>, columnsToAdd?:Array<string>|undefined|null, asOfMatchRule?:string|undefined|null):Promise<Table>;
696
+ desc():Sort;
483
697
  /**
484
- * a promise that will be resolved with the newly created table holding the results of the specified cross join
485
- * operation. The <b>columnsToAdd</b> parameter is optional, not specifying it will result in all columns from the
486
- * right table being added to the output. The <b>reserveBits</b> optional parameter lets the client control how the
487
- * key space is distributed between the rows in the two tables, see the Java <b>Table</b> class for details.
488
- * @param rightTable - the table to match to values in this table
489
- * @param columnsToMatch - the columns that should match exactly
490
- * @param columnsToAdd - columns from the right table to add to the resulting table, empty/null/absent to add all
491
- * columns
492
- * @param reserveBits - the number of bits of key-space to initially reserve per group, null/absent will let the
493
- * server select a value
494
- * @return a promise that will resolve to the joined table
698
+ * Builds a Sort instance which takes the absolute value before applying order.
699
+ * @return {@link dh.Sort}
495
700
  */
496
- crossJoin(rightTable:JoinableTable, columnsToMatch:Array<string>, columnsToAdd?:Array<string>|undefined|null, reserveBits?:number|undefined|null):Promise<Table>;
701
+ abs():Sort;
702
+ toString():string;
497
703
  /**
498
- * a promise that will be resolved with the newly created table holding the results of the specified exact join
499
- * operation. The `columnsToAdd` parameter is optional, not specifying it will result in all columns from the right
500
- * table being added to the output.
501
- * @param rightTable - the table to match to values in this table
502
- * @param columnsToMatch - the columns that should match exactly
503
- * @param columnsToAdd - columns from the right table to add to the resulting table, empty/null/absent to add all
504
- * columns
505
- * @return a promise that will resolve to the joined table
704
+ * True if the absolute value of the column should be used when sorting; defaults to false.
705
+ * @return boolean
506
706
  */
507
- exactJoin(rightTable:JoinableTable, columnsToMatch:Array<string>, columnsToAdd?:Array<string>|undefined|null):Promise<Table>;
707
+ get isAbs():boolean;
508
708
  /**
509
- * a promise that will be resolved with the newly created table holding the results of the specified natural join
510
- * operation. The <b>columnsToAdd</b> parameter is optional, not specifying it will result in all columns from the
511
- * right table being added to the output.
512
- * @param rightTable - the table to match to values in this table
513
- * @param columnsToMatch - the columns that should match exactly
514
- * @param columnsToAdd - columns from the right table to add to the resulting table, empty/null/absent to add all
515
- * columns
516
- * @return a promise that will resolve to the joined table
709
+ * The column which is sorted.
710
+ * @return {@link dh.Column}
517
711
  */
518
- naturalJoin(rightTable:JoinableTable, columnsToMatch:Array<string>, columnsToAdd?:Array<string>|undefined|null):Promise<Table>;
712
+ get column():Column;
713
+ /**
714
+ * The direction of this sort, either <b>ASC</b>, <b>DESC</b>, or <b>REVERSE</b>.
715
+ * @return String
716
+ */
717
+ get direction():string;
519
718
  }
719
+
520
720
  /**
521
- * Row implementation that also provides additional read-only properties. represents visible rows in the table,
522
- * but with additional properties to reflect the tree structure.
721
+ * Wrap BigInteger values for use in JS. Provides text formatting for display and access to the underlying value.
523
722
  */
524
- export interface TreeRow extends ViewportRow {
723
+ export class BigIntegerWrapper {
724
+ protected constructor();
725
+
726
+ static ofString(str:string):BigIntegerWrapper;
727
+ asNumber():number;
728
+ valueOf():string;
729
+ toString():string;
730
+ }
731
+
732
+ /**
733
+ * Event fired when a command is issued from the client.
734
+ */
735
+ export class CommandInfo {
736
+ constructor(code:string, result:Promise<dh.ide.CommandResult>);
737
+
738
+ get result():Promise<dh.ide.CommandResult>;
739
+ get code():string;
740
+ }
741
+
742
+ /**
743
+ * Describes data that can be filtered, either a column reference or a literal value. Used this way, the type of a value
744
+ * can be specified so that values which are ambiguous or not well supported in JS will not be confused with Strings or
745
+ * imprecise numbers (e.g., nanosecond-precision date values). Additionally, once wrapped in this way, methods can be
746
+ * called on these value literal instances. These instances are immutable - any method called on them returns a new
747
+ * instance.
748
+ */
749
+ export class FilterValue {
750
+ protected constructor();
751
+
525
752
  /**
526
- * True if this node is currently expanded to show its children; false otherwise. Those children will be the
527
- * rows below this one with a greater depth than this one
528
- * @return boolean
753
+ * Constructs a number for the filter API from the given parameter. Can also be used on the values returned from
754
+ * {@link TableData.get} for DateTime values. To create
755
+ * a filter with a date, use <b>dh.DateWrapper.ofJsDate</b> or
756
+ * {@link i18n.DateTimeFormat.parse}. To create a filter with a
757
+ * 64-bit long integer, use {@link LongWrapper.ofString}.
758
+ * @param input - the number to wrap as a FilterValue
759
+ * @return an immutable FilterValue that can be built into a filter
529
760
  */
530
- get isExpanded():boolean;
761
+ static ofNumber(input:LongWrapper|number):FilterValue;
531
762
  /**
532
- * The number of levels above this node; zero for top level nodes. Generally used by the UI to indent the
533
- * row and its expand/collapse icon
534
- * @return int
763
+ * a filter condition checking if the current value is equal to the given parameter
764
+ * @param term -
765
+ * @return {@link dh.FilterCondition}
535
766
  */
536
- get depth():number;
767
+ eq(term:FilterValue):FilterCondition;
537
768
  /**
538
- * True if this node has children and can be expanded; false otherwise. Note that this value may change when
539
- * the table updates, depending on the table's configuration
540
- * @return boolean
769
+ * a filter condition checking if the current value is equal to the given parameter, ignoring differences of upper
770
+ * vs lower case
771
+ * @param term -
772
+ * @return {@link dh.FilterCondition}
541
773
  */
542
- get hasChildren():boolean;
543
- get index():LongWrapper;
544
- }
545
- /**
546
- * This object may be pooled internally or discarded and not updated. Do not retain references to it.
547
- */
548
- export interface Format {
774
+ eqIgnoreCase(term:FilterValue):FilterCondition;
549
775
  /**
550
- * The format string to apply to the value of this cell.
551
- * @return String
776
+ * a filter condition checking if the current value is not equal to the given parameter
777
+ * @param term -
778
+ * @return {@link dh.FilterCondition}
552
779
  */
553
- readonly formatString?:string|null;
780
+ notEq(term:FilterValue):FilterCondition;
554
781
  /**
555
- * Color to apply to the cell's background, in <b>#rrggbb</b> format.
556
- * @return String
782
+ * a filter condition checking if the current value is not equal to the given parameter, ignoring differences of
783
+ * upper vs lower case
784
+ * @param term -
785
+ * @return {@link dh.FilterCondition}
557
786
  */
558
- readonly backgroundColor?:string|null;
787
+ notEqIgnoreCase(term:FilterValue):FilterCondition;
559
788
  /**
560
- * Color to apply to the text, in <b>#rrggbb</b> format.
561
- * @return String
789
+ * a filter condition checking if the current value is greater than the given parameter
790
+ * @param term -
791
+ * @return {@link dh.FilterCondition}
562
792
  */
563
- readonly color?:string|null;
793
+ greaterThan(term:FilterValue):FilterCondition;
564
794
  /**
565
- *
566
- * @deprecated Prefer formatString. Number format string to apply to the value in this cell.
795
+ * a filter condition checking if the current value is less than the given parameter
796
+ * @param term -
797
+ * @return {@link dh.FilterCondition}
567
798
  */
568
- readonly numberFormat?:string|null;
569
- }
570
- /**
571
- * Javascript wrapper for {@link io.deephaven.web.shared.data.ColumnStatistics} This class holds the results of a call to generate statistics on a
572
- * table column.
573
- */
574
- export interface ColumnStatistics {
799
+ lessThan(term:FilterValue):FilterCondition;
575
800
  /**
576
- * Gets the type of formatting that should be used for given statistic.
577
- * <p>
578
- * the format type for a statistic. A null return value means that the column formatting should be used.
579
- * @param name - the display name of the statistic
580
- * @return String
801
+ * a filter condition checking if the current value is greater than or equal to the given parameter
802
+ * @param term -
803
+ * @return {@link dh.FilterCondition}
581
804
  */
582
- getType(name:string):string;
805
+ greaterThanOrEqualTo(term:FilterValue):FilterCondition;
583
806
  /**
584
- * 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
585
- * name to the count of how many times it occurred in the column. This map will be empty for tables containing more
586
- * than 19 unique values.
587
- * @return Map of String double
807
+ * a filter condition checking if the current value is less than or equal to the given parameter
808
+ * @param term -
809
+ * @return {@link dh.FilterCondition}
588
810
  */
589
- get uniqueValues():Map<string, number>;
811
+ lessThanOrEqualTo(term:FilterValue):FilterCondition;
590
812
  /**
591
- * Gets a map with the display name of statistics as keys and the numeric stat as a value.
592
- * <p>
593
- * A map of each statistic's name to its value.
594
- * @return Map of String and Object
813
+ * a filter condition checking if the current value is in the given set of values
814
+ * @param terms -
815
+ * @return {@link dh.FilterCondition}
595
816
  */
596
- get statisticsMap():Map<string, object>;
597
- }
598
- export interface Row {
599
- get(column:Column):any;
600
- getFormat(column:Column):Format;
601
- get index():LongWrapper;
602
- }
603
- /**
604
- * Wrap LocalDate values for use in JS. Provides text formatting for display and access to the underlying value.
605
- */
606
- export interface LocalDateWrapper {
607
- valueOf():string;
608
- getYear():number;
609
- getMonthValue():number;
610
- getDayOfMonth():number;
611
- toString():string;
612
- }
613
- /**
614
- * Encapsulates event handling around table subscriptions by "cheating" and wrapping up a JsTable instance to do the
615
- * real dirty work. This allows a viewport to stay open on the old table if desired, while this one remains open.
616
- * <p>
617
- * As this just wraps a JsTable (and thus a CTS), it holds its own flattened, pUT'd handle to get deltas from the
618
- * server. The setViewport method can be used to adjust this table instead of creating a new one.
619
- * <p>
620
- * Existing methods on JsTable like setViewport and getViewportData are intended to proxy to this, which then will talk
621
- * to the underlying handle and accumulated data.
622
- * <p>
623
- * As long as we keep the existing methods/events on JsTable, close() is not required if no other method is called, with
624
- * the idea then that the caller did not actually use this type. This means that for every exported method (which then
625
- * will mark the instance of "actually being used, please don't automatically close me"), there must be an internal
626
- * version called by those existing JsTable method, which will allow this instance to be cleaned up once the JsTable
627
- * deems it no longer in use.
628
- * <p>
629
- * Note that if the caller does close an instance, this shuts down the JsTable's use of this (while the converse is not
630
- * true), providing a way to stop the server from streaming updates to the client.
631
- *
632
- * This object serves as a "handle" to a subscription, allowing it to be acted on directly or canceled outright. If you
633
- * retain an instance of this, you have two choices - either only use it to call `close()` on it to stop the table's
634
- * viewport without creating a new one, or listen directly to this object instead of the table for data events, and
635
- * always call `close()` when finished. Calling any method on this object other than close() will result in it
636
- * continuing to live on after `setViewport` is called on the original table, or after the table is modified.
637
- */
638
- export interface TableViewportSubscription extends HasEventHandling {
817
+ in(terms:FilterValue[]):FilterCondition;
639
818
  /**
640
- * Changes the rows and columns set on this viewport. This cannot be used to change the update interval.
641
- * @param firstRow -
642
- * @param lastRow -
643
- * @param columns -
644
- * @param updateIntervalMs -
819
+ * a filter condition checking if the current value is in the given set of values, ignoring differences of upper vs
820
+ * lower case
821
+ * @param terms -
822
+ * @return {@link dh.FilterCondition}
645
823
  */
646
- setViewport(firstRow:number, lastRow:number, columns?:Column[]|undefined|null, updateIntervalMs?:number|undefined|null):void;
824
+ inIgnoreCase(terms:FilterValue[]):FilterCondition;
647
825
  /**
648
- * Stops this viewport from running, stopping all events on itself and on the table that created it.
826
+ * a filter condition checking that the current value is not in the given set of values
827
+ * @param terms -
828
+ * @return {@link dh.FilterCondition}
829
+ */
830
+ notIn(terms:FilterValue[]):FilterCondition;
831
+ /**
832
+ * a filter condition checking that the current value is not in the given set of values, ignoring differences of
833
+ * upper vs lower case
834
+ * @param terms -
835
+ * @return {@link dh.FilterCondition}
836
+ */
837
+ notInIgnoreCase(terms:FilterValue[]):FilterCondition;
838
+ /**
839
+ * a filter condition checking if the given value contains the given string value
840
+ * @param term -
841
+ * @return {@link dh.FilterCondition}
842
+ */
843
+ contains(term:FilterValue):FilterCondition;
844
+ /**
845
+ * a filter condition checking if the given value contains the given string value, ignoring differences of upper vs
846
+ * lower case
847
+ * @param term -
848
+ * @return {@link dh.FilterCondition}
849
+ */
850
+ containsIgnoreCase(term:FilterValue):FilterCondition;
851
+ /**
852
+ * a filter condition checking if the given value matches the provided regular expressions string. Regex patterns
853
+ * use Java regex syntax
854
+ * @param pattern -
855
+ * @return {@link dh.FilterCondition}
856
+ */
857
+ matches(pattern:FilterValue):FilterCondition;
858
+ /**
859
+ * a filter condition checking if the given value matches the provided regular expressions string, ignoring
860
+ * differences of upper vs lower case. Regex patterns use Java regex syntax
861
+ * @param pattern -
862
+ * @return {@link dh.FilterCondition}
863
+ */
864
+ matchesIgnoreCase(pattern:FilterValue):FilterCondition;
865
+ /**
866
+ * a filter condition checking if the current value is a true boolean
867
+ * @return {@link dh.FilterCondition}
868
+ */
869
+ isTrue():FilterCondition;
870
+ /**
871
+ * a filter condition checking if the current value is a false boolean
872
+ * @return {@link dh.FilterCondition}
873
+ */
874
+ isFalse():FilterCondition;
875
+ /**
876
+ * a filter condition checking if the current value is a null value
877
+ * @return {@link dh.FilterCondition}
878
+ */
879
+ isNull():FilterCondition;
880
+ /**
881
+ * a filter condition invoking the given method on the current value, with the given parameters. Currently supported
882
+ * functions that can be invoked on a String:
883
+ * <ul>
884
+ * <li><b>startsWith</b>: Returns true if the current string value starts with the supplied string argument</li>
885
+ * <li><b>endsWith</b>: Returns true if the current string value ends with the supplied string argument</li>
886
+ * <li><b>matches</b>: Returns true if the current string value matches the supplied string argument used as a Java
887
+ * regular expression</li>
888
+ * <li><b>contains</b>: Returns true if the current string value contains the supplied string argument
889
+ * <p>
890
+ * When invoking against a constant, this should be avoided in favor of FilterValue.contains
891
+ * </p>
892
+ * </li>
893
+ * </ul>
894
+ * @param method -
895
+ * @param args -
896
+ * @return
897
+ */
898
+ invoke(method:string, ...args:FilterValue[]):FilterCondition;
899
+ toString():string;
900
+ /**
901
+ * Constructs a string for the filter API from the given parameter.
902
+ * @param input -
903
+ * @return
649
904
  */
650
- close():void;
905
+ static ofString(input:any):FilterValue;
651
906
  /**
652
- * Gets the data currently visible in this viewport
653
- * @return Promise of {@link dh.TableData}.
907
+ * Constructs a boolean for the filter API from the given parameter.
908
+ * @param b -
909
+ * @return
654
910
  */
655
- getViewportData():Promise<TableData>;
656
- snapshot(rows:RangeSet, columns:Column[]):Promise<TableData>;
911
+ static ofBoolean(b:boolean):FilterValue;
657
912
  }
658
- /**
659
- * Wrap LocalTime values for use in JS. Provides text formatting for display and access to the underlying value.
660
- */
661
- export interface LocalTimeWrapper {
913
+
914
+
915
+ export class LongWrapper {
916
+ protected constructor();
917
+
918
+ static ofString(str:string):LongWrapper;
919
+ asNumber():number;
662
920
  valueOf():string;
663
- getHour():number;
664
- getMinute():number;
665
- getSecond():number;
666
- getNano():number;
667
921
  toString():string;
668
922
  }
669
- export interface RefreshToken {
670
- get bytes():string;
671
- get expiry():number;
923
+
924
+ /**
925
+ * Deprecated for use in Deephaven Core.
926
+ * @deprecated
927
+ */
928
+ export class Client {
929
+ static readonly EVENT_REQUEST_FAILED:string;
930
+ static readonly EVENT_REQUEST_STARTED:string;
931
+ static readonly EVENT_REQUEST_SUCCEEDED:string;
932
+
933
+ constructor();
672
934
  }
673
935
 
674
936
  export class IdeSession implements HasEventHandling {
@@ -739,58 +1001,6 @@ export namespace dh {
739
1001
  removeEventListener<T>(name:string, callback:(e:CustomEvent<T>)=>void):boolean;
740
1002
  }
741
1003
 
742
- /**
743
- * Describes a Sort present on the table. No visible constructor, created through the use of Column.sort(), will be tied
744
- * to that particular column data. Sort instances are immutable, and use a builder pattern to make modifications. All
745
- * methods return a new Sort instance.
746
- */
747
- export class Sort {
748
- static readonly ASCENDING:string;
749
- static readonly DESCENDING:string;
750
- static readonly REVERSE:string;
751
-
752
- protected constructor();
753
-
754
- /**
755
- * Builds a Sort instance to sort values in ascending order.
756
- * @return {@link dh.Sort}
757
- */
758
- asc():Sort;
759
- /**
760
- * Builds a Sort instance to sort values in descending order.
761
- * @return {@link dh.Sort}
762
- */
763
- desc():Sort;
764
- /**
765
- * Builds a Sort instance which takes the absolute value before applying order.
766
- * @return {@link dh.Sort}
767
- */
768
- abs():Sort;
769
- toString():string;
770
- /**
771
- * True if the absolute value of the column should be used when sorting; defaults to false.
772
- * @return boolean
773
- */
774
- get isAbs():boolean;
775
- /**
776
- * The column which is sorted.
777
- * @return {@link dh.Column}
778
- */
779
- get column():Column;
780
- /**
781
- * The direction of this sort, either <b>ASC</b>, <b>DESC</b>, or <b>REVERSE</b>.
782
- * @return String
783
- */
784
- get direction():string;
785
- }
786
-
787
- export class DateWrapper extends LongWrapper {
788
- protected constructor();
789
-
790
- static ofJsDate(date:Date):DateWrapper;
791
- asDate():Date;
792
- }
793
-
794
1004
  export class QueryInfo {
795
1005
  static readonly EVENT_TABLE_OPENED:string;
796
1006
  static readonly EVENT_DISCONNECT:string;
@@ -801,241 +1011,241 @@ export namespace dh {
801
1011
  }
802
1012
 
803
1013
  /**
804
- * Describes the structure of the column, and if desired can be used to get access to the data to be rendered in this
805
- * column.
1014
+ * A Widget represents a server side object that sends one or more responses to the client. The client can then
1015
+ * interpret these responses to see what to render, or how to respond.
1016
+ * <p>
1017
+ * Most custom object types result in a single response being sent to the client, often with other exported objects, but
1018
+ * some will have streamed responses, and allow the client to send follow-up requests of its own. This class's API is
1019
+ * backwards compatible, but as such does not offer a way to tell the difference between a streaming or non-streaming
1020
+ * object type, the client code that handles the payloads is expected to know what to expect. See
1021
+ * {@link dh.WidgetMessageDetails} for more information.
1022
+ * <p>
1023
+ * When the promise that returns this object resolves, it will have the first response assigned to its fields. Later
1024
+ * responses from the server will be emitted as "message" events. When the connection with the server ends, the "close"
1025
+ * event will be emitted. In this way, the connection will behave roughly in the same way as a WebSocket - either side
1026
+ * can close, and after close no more messages will be processed. There can be some latency in closing locally while
1027
+ * remote messages are still pending - it is up to implementations of plugins to handle this case.
1028
+ * <p>
1029
+ * Also like WebSockets, the plugin API doesn't define how to serialize messages, and just handles any binary payloads.
1030
+ * What it does handle however, is allowing those messages to include references to server-side objects with those
1031
+ * payloads. Those server side objects might be tables or other built-in types in the Deephaven JS API, or could be
1032
+ * objects usable through their own plugins. They also might have no plugin at all, allowing the client to hold a
1033
+ * reference to them and pass them back to the server, either to the current plugin instance, or through another API.
1034
+ * The `Widget` type does not specify how those objects should be used or their lifecycle, but leaves that
1035
+ * entirely to the plugin. Messages will arrive in the order they were sent.
1036
+ * <p>
1037
+ * This can suggest several patterns for how plugins operate:
1038
+ * <ul>
1039
+ * <li>The plugin merely exists to transport some other object to the client. This can be useful for objects which can
1040
+ * easily be translated to some other type (like a Table) when the user clicks on it. An example of this is
1041
+ * `pandas.DataFrame` will result in a widget that only contains a static
1042
+ * {@link dh.Table}. Presently, the widget is immediately closed, and only the Table is
1043
+ * provided to the JS API consumer.</li>
1044
+ * <li>The plugin provides references to Tables and other objects, and those objects can live longer than the object
1045
+ * which provided them. One concrete example of this could have been
1046
+ * {@link dh.PartitionedTable} when fetching constituent tables, but it was implemented
1047
+ * before bidirectional plugins were implemented. Another example of this is plugins that serve as a "factory", giving
1048
+ * the user access to table manipulation/creation methods not supported by gRPC or the JS API.</li>
1049
+ * <li>The plugin provides reference to Tables and other objects that only make sense within the context of the widget
1050
+ * instance, so when the widget goes away, those objects should be released as well. This is also an example of
1051
+ * {@link dh.PartitionedTable}, as the partitioned table tracks creation of new keys through
1052
+ * an internal table instance.</li>
1053
+ * </ul>
1054
+ *
1055
+ * Handling server objects in messages also has more than one potential pattern that can be used:
1056
+ * <ul>
1057
+ * <li>One object per message - the message clearly is about that object, no other details required.</li>
1058
+ * <li>Objects indexed within their message - as each message comes with a list of objects, those objects can be
1059
+ * referenced within the payload by index. This is roughly how {@link dh.plot.Figure}
1060
+ * behaves, where the figure descriptor schema includes an index for each created series, describing which table should
1061
+ * be used, which columns should be mapped to each axis.</li>
1062
+ * <li>Objects indexed since widget creation - each message would append its objects to a list created when the widget
1063
+ * was first made, and any new exports that arrive in a new message would be appended to that list. Then, subsequent
1064
+ * messages can reference objects already sent. This imposes a limitation where the client cannot release any exports
1065
+ * without the server somehow signaling that it will never reference that export again.</li>
1066
+ * </ul>
806
1067
  */
807
- export class Column {
808
- /**
809
- * If this column is part of a roll-up tree table, represents the type of the row data that can be found in this
810
- * column for leaf nodes if includeConstituents is enabled. Otherwise, it is <b>null</b>.
811
- * @return String
812
- */
813
- readonly constituentType?:string|null;
814
- readonly description?:string|null;
1068
+ export class Widget implements WidgetMessageDetails, HasEventHandling {
1069
+ static readonly EVENT_MESSAGE:string;
1070
+ static readonly EVENT_CLOSE:string;
815
1071
 
816
1072
  protected constructor();
817
1073
 
818
1074
  /**
819
- * the value for this column in the given row. Type will be consistent with the type of the Column.
820
- * @param row -
821
- * @return Any
822
- */
823
- get(row:Row):any;
824
- getFormat(row:Row):Format;
825
- /**
826
- * Creates a sort builder object, to be used when sorting by this column.
827
- * @return {@link dh.Sort}
828
- */
829
- sort():Sort;
830
- /**
831
- * Creates a new value for use in filters based on this column. Used either as a parameter to another filter
832
- * operation, or as a builder to create a filter operation.
833
- * @return {@link dh.FilterValue}
834
- */
835
- filter():FilterValue;
836
- /**
837
- * a <b>CustomColumn</b> object to apply using `applyCustomColumns` with the expression specified.
838
- * @param expression -
839
- * @return {@link dh.CustomColumn}
840
- */
841
- formatColor(expression:string):CustomColumn;
842
- /**
843
- * a <b>CustomColumn</b> object to apply using <b>applyCustomColumns</b> with the expression specified.
844
- * @param expression -
845
- * @return {@link dh.CustomColumn}
846
- */
847
- formatNumber(expression:string):CustomColumn;
848
- /**
849
- * a <b>CustomColumn</b> object to apply using <b>applyCustomColumns</b> with the expression specified.
850
- * @param expression -
851
- * @return {@link dh.CustomColumn}
852
- */
853
- formatDate(expression:string):CustomColumn;
854
- toString():string;
855
- /**
856
- * Label for this column.
857
- * @return String
1075
+ * Ends the client connection to the server.
858
1076
  */
859
- get name():string;
1077
+ close():void;
1078
+ getDataAsBase64():string;
1079
+ getDataAsU8():Uint8Array;
1080
+ getDataAsString():string;
860
1081
  /**
861
- * True if this column is a partition column. Partition columns are used for filtering uncoalesced tables (see
862
- * <b>isUncoalesced</b> property on <b>Table</b>)
863
- * @return boolean
1082
+ * Sends a string/bytes payload to the server, along with references to objects that exist on the server.
1083
+ * @param msg - string/buffer/view instance that represents data to send
1084
+ * @param references - an array of objects that can be safely sent to the server
864
1085
  */
865
- get isPartitionColumn():boolean;
1086
+ sendMessage(msg:string|ArrayBuffer|ArrayBufferView, references?:Array<Table|Widget|WidgetExportedObject|PartitionedTable|TotalsTable|TreeTable>):void;
1087
+ addEventListener<T>(name:string, callback:(e:CustomEvent<T>)=>void):()=>void;
1088
+ nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<CustomEvent<T>>;
1089
+ hasListeners(name:string):boolean;
1090
+ removeEventListener<T>(name:string, callback:(e:CustomEvent<T>)=>void):boolean;
866
1091
  /**
867
1092
  *
868
- * @deprecated do not use. Internal index of the column in the table, to be used as a key on the Row.
869
- * @return int
870
- */
871
- get index():number;
872
- get isSortable():boolean;
873
- /**
874
- * Type of the row data that can be found in this column.
875
- * @return String
876
- */
877
- get type():string;
878
- /**
879
- * Format entire rows colors using the expression specified. Returns a <b>CustomColumn</b> object to apply to a
880
- * table using <b>applyCustomColumns</b> with the parameters specified.
881
- * @param expression -
882
- * @return {@link dh.CustomColumn}
883
- */
884
- static formatRowColor(expression:string):CustomColumn;
885
- /**
886
- * a <b>CustomColumn</b> object to apply using <b>applyCustomColumns</b> with the expression specified.
887
- * @param name -
888
- * @param expression -
889
- * @return {@link dh.CustomColumn}
1093
+ * @return the exported objects sent in the initial message from the server. The client is responsible for closing
1094
+ * them when finished using them.
890
1095
  */
891
- static createCustomColumn(name:string, expression:string):CustomColumn;
892
- }
893
-
894
- /**
895
- * Exists to keep the dh.TableMap namespace so that the web UI can remain compatible with the DHE API, which still calls
896
- * this type TableMap.
897
- * @deprecated
898
- */
899
- export class TableMap {
900
- static readonly EVENT_KEYADDED:string;
901
- static readonly EVENT_DISCONNECT:string;
902
- static readonly EVENT_RECONNECT:string;
903
- static readonly EVENT_RECONNECTFAILED:string;
904
-
905
- protected constructor();
1096
+ get exportedObjects():WidgetExportedObject[];
1097
+ /**
1098
+ *
1099
+ * @return the type of this widget
1100
+ */
1101
+ get type():string;
906
1102
  }
907
1103
 
908
1104
  /**
909
- * A js type for operating on input tables.
910
- *
911
- * Represents a User Input Table, which can have data added to it from other sources.
912
- *
913
- * You may add rows using dictionaries of key-value tuples (representing columns by name), add tables containing all the
914
- * key/value columns to add, or delete tables containing the keys to delete. Each operation is atomic, and will either
915
- * succeed completely or fail completely. To guarantee order of operations, apply an operation and wait for the response
916
- * before sending the next operation.
917
- *
918
- * Each table has one or more key columns, where each unique combination of keys will appear at most once in the table.
1105
+ * Describes how a Totals Table will be generated from its parent table. Each table has a default (which may be null)
1106
+ * indicating how that table was configured when it was declared, and each Totals Table has a similar property
1107
+ * describing how it was created. Both the <b>Table.getTotalsTable</b> and <b>Table.getGrandTotalsTable</b> methods take
1108
+ * this config as an optional parameter - without it, the table's default will be used, or if null, a default instance
1109
+ * of <b>TotalsTableConfig</b> will be supplied.
919
1110
  *
920
- * To view the results of the Input Table, you should use standard table operations on the InputTable's source Table
921
- * object.
1111
+ * This class has a no-arg constructor, allowing an instance to be made with the default values provided. However, any
1112
+ * JS object can be passed in to the methods which accept instances of this type, provided their values adhere to the
1113
+ * expected formats.
922
1114
  */
923
- export class InputTable {
924
- protected constructor();
925
-
1115
+ export class TotalsTableConfig {
926
1116
  /**
927
- * Adds a single row to the table. For each key or value column name in the Input Table, we retrieve that javascript
928
- * property at that name and validate it can be put into the given column type.
929
- * @param row -
930
- * @param userTimeZone -
931
- * @return Promise of dh.InputTable
1117
+ * @deprecated
932
1118
  */
933
- addRow(row:{ [key: string]: any; }, userTimeZone?:string):Promise<InputTable>;
1119
+ static readonly COUNT:string;
934
1120
  /**
935
- * Add multiple rows to a table.
936
- * @param rows -
937
- * @param userTimeZone -
938
- * @return Promise of dh.InputTable
1121
+ * @deprecated
939
1122
  */
940
- addRows(rows:{ [key: string]: any; }[], userTimeZone?:string):Promise<InputTable>;
1123
+ static readonly MIN:string;
941
1124
  /**
942
- * Add an entire table to this Input Table. Only column names that match the definition of the input table will be
943
- * copied, and all key columns must have values filled in. This only copies the current state of the source table;
944
- * future updates to the source table will not be reflected in the Input Table. The returned promise will be
945
- * resolved to the same InputTable instance this method was called upon once the server returns.
946
- * @param tableToAdd -
947
- * @return Promise of dh.InputTable
1125
+ * @deprecated
948
1126
  */
949
- addTable(tableToAdd:Table):Promise<InputTable>;
1127
+ static readonly MAX:string;
950
1128
  /**
951
- * Add multiple tables to this Input Table.
952
- * @param tablesToAdd -
953
- * @return Promise of dh.InputTable
1129
+ * @deprecated
954
1130
  */
955
- addTables(tablesToAdd:Table[]):Promise<InputTable>;
1131
+ static readonly SUM:string;
956
1132
  /**
957
- * Deletes an entire table from this Input Table. Key columns must match the Input Table.
958
- * @param tableToDelete -
959
- * @return Promise of dh.InputTable
1133
+ * @deprecated
960
1134
  */
961
- deleteTable(tableToDelete:Table):Promise<InputTable>;
1135
+ static readonly ABS_SUM:string;
962
1136
  /**
963
- * Delete multiple tables from this Input Table.
964
- * @param tablesToDelete -
965
- * @return
1137
+ * @deprecated
966
1138
  */
967
- deleteTables(tablesToDelete:Table[]):Promise<InputTable>;
1139
+ static readonly VAR:string;
968
1140
  /**
969
- * A list of the key columns, by name
970
- * @return String array.
1141
+ * @deprecated
971
1142
  */
972
- get keys():string[];
1143
+ static readonly AVG:string;
973
1144
  /**
974
- * A list of the value columns, by name
975
- * @return String array.
1145
+ * @deprecated
976
1146
  */
977
- get values():string[];
1147
+ static readonly STD:string;
978
1148
  /**
979
- * A list of the key Column objects
980
- * @return {@link dh.Column} array.
1149
+ * @deprecated
981
1150
  */
982
- get keyColumns():Column[];
1151
+ static readonly FIRST:string;
983
1152
  /**
984
- * A list of the value Column objects
985
- * @return {@link dh.Column} array.
1153
+ * @deprecated
986
1154
  */
987
- get valueColumns():Column[];
1155
+ static readonly LAST:string;
988
1156
  /**
989
- * The source table for this Input Table
990
- * @return dh.table
1157
+ * @deprecated
991
1158
  */
992
- get table():Table;
1159
+ static readonly SKIP:string;
1160
+ /**
1161
+ * Specifies if a Totals Table should be expanded by default in the UI. Defaults to false.
1162
+ */
1163
+ showTotalsByDefault:boolean;
1164
+ /**
1165
+ * Specifies if a Grand Totals Table should be expanded by default in the UI. Defaults to false.
1166
+ */
1167
+ showGrandTotalsByDefault:boolean;
1168
+ /**
1169
+ * Specifies the default operation for columns that do not have a specific operation applied; defaults to "Sum".
1170
+ */
1171
+ defaultOperation:AggregationOperationType;
1172
+ /**
1173
+ * Mapping from each column name to the aggregation(s) that should be applied to that column in the resulting Totals
1174
+ * Table. If a column is omitted, the defaultOperation is used.
1175
+ */
1176
+ operationMap:{ [key: string]: Array<AggregationOperationType>; };
1177
+ /**
1178
+ * Groupings to use when generating the Totals Table. One row will exist for each unique set of values observed in
1179
+ * these columns. See also `Table.selectDistinct`.
1180
+ */
1181
+ groupBy:Array<string>;
1182
+
1183
+ constructor();
1184
+
1185
+ toString():string;
993
1186
  }
994
1187
 
995
1188
  /**
996
- * Represents a non-viewport subscription to a table, and all data currently known to be present in the subscribed
997
- * columns. This class handles incoming snapshots and deltas, and fires events to consumers to notify of data changes.
998
- *
999
- * Unlike {@link dh.TableViewportSubscription}, the "original" table does not have a reference to this instance, only the
1000
- * "private" table instance does, since the original cannot modify the subscription, and the private instance must
1001
- * forward data to it.
1189
+ * Configuration object for running Table.treeTable to produce a hierarchical view of a given "flat" table.
1002
1190
  *
1003
- * Represents a subscription to the table on the server. Changes made to the table will not be reflected here - the
1004
- * subscription must be closed and a new one optioned to see those changes. The event model is slightly different from
1005
- * viewports to make it less expensive to compute for large tables.
1191
+ * Like TotalsTableConfig, `TreeTableConfig` supports an operation map indicating how to aggregate the data, as well as
1192
+ * an array of column names which will be the layers in the roll-up tree, grouped at each level. An additional optional
1193
+ * value can be provided describing the strategy the engine should use when grouping the rows.
1006
1194
  */
1007
- export class TableSubscription implements HasEventHandling {
1195
+ export class TreeTableConfig {
1008
1196
  /**
1009
- * Indicates that some new data is available on the client, either an initial snapshot or a delta update. The
1010
- * <b>detail</b> field of the event will contain a TableSubscriptionEventData detailing what has changed, or
1011
- * allowing access to the entire range of items currently in the subscribed columns.
1197
+ * The column representing the unique ID for each item
1012
1198
  */
1013
- static readonly EVENT_UPDATED:string;
1199
+ idColumn:string;
1200
+ /**
1201
+ * The column representing the parent ID for each item
1202
+ */
1203
+ parentColumn:string;
1204
+ /**
1205
+ * Optional parameter indicating if items with an invalid parent ID should be promoted to root. Defaults to false.
1206
+ */
1207
+ promoteOrphansToRoot:boolean;
1014
1208
 
1015
- protected constructor();
1209
+ constructor();
1210
+ }
1016
1211
 
1212
+ /**
1213
+ * Describes a grouping and aggregations for a roll-up table. Pass to the <b>Table.rollup</b> function to create a
1214
+ * roll-up table.
1215
+ */
1216
+ export class RollupConfig {
1017
1217
  /**
1018
- * Stops the subscription on the server.
1218
+ * Ordered list of columns to group by to form the hierarchy of the resulting roll-up table.
1019
1219
  */
1020
- close():void;
1021
- addEventListener<T>(name:string, callback:(e:CustomEvent<T>)=>void):()=>void;
1022
- nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<CustomEvent<T>>;
1023
- hasListeners(name:string):boolean;
1024
- removeEventListener<T>(name:string, callback:(e:CustomEvent<T>)=>void):boolean;
1220
+ groupingColumns:Array<String>;
1025
1221
  /**
1026
- * The columns that were subscribed to when this subscription was created
1027
- * @return {@link dh.Column}
1222
+ * Mapping from each aggregation name to the ordered list of columns it should be applied to in the resulting
1223
+ * roll-up table.
1028
1224
  */
1029
- get columns():Array<Column>;
1225
+ aggregations:{ [key: string]: Array<AggregationOperationType>; };
1226
+ /**
1227
+ * Optional parameter indicating if an extra leaf node should be added at the bottom of the hierarchy, showing the
1228
+ * rows in the underlying table which make up that grouping. Since these values might be a different type from the
1229
+ * rest of the column, any client code must check if TreeRow.hasChildren = false, and if so, interpret those values
1230
+ * as if they were Column.constituentType instead of Column.type. Defaults to false.
1231
+ */
1232
+ includeConstituents:boolean;
1233
+ includeOriginalColumns?:boolean|null;
1234
+ /**
1235
+ * Optional parameter indicating if original column descriptions should be included. Defaults to true.
1236
+ */
1237
+ includeDescriptions:boolean;
1238
+
1239
+ constructor();
1030
1240
  }
1031
1241
 
1032
1242
  /**
1033
- * Wrap BigInteger values for use in JS. Provides text formatting for display and access to the underlying value.
1243
+ * Wrap BigDecimal values for use in JS. Provides text formatting for display and access to the underlying value.
1034
1244
  */
1035
- export class BigIntegerWrapper {
1245
+ export class BigDecimalWrapper {
1036
1246
  protected constructor();
1037
1247
 
1038
- static ofString(str:string):BigIntegerWrapper;
1248
+ static ofString(value:string):BigDecimalWrapper;
1039
1249
  asNumber():number;
1040
1250
  valueOf():string;
1041
1251
  toString():string;
@@ -1085,91 +1295,31 @@ export namespace dh {
1085
1295
  */
1086
1296
  getKeys():Set<object>;
1087
1297
  /**
1088
- * Fetch a table containing all the valid keys of the partitioned table.
1089
- * @return Promise of a Table
1090
- */
1091
- getKeyTable():Promise<Table>;
1092
- /**
1093
- * Indicates that this PartitionedTable will no longer be used, removing subcriptions to updated keys, etc. This
1094
- * will not affect tables in use.
1095
- */
1096
- close():void;
1097
- /**
1098
- * The count of known keys.
1099
- * @return int
1100
- */
1101
- get size():number;
1102
- /**
1103
- * An array of the columns in the tables that can be retrieved from this partitioned table, including both key and
1104
- * non-key columns.
1105
- * @return Array of Column
1106
- */
1107
- get columns():Column[];
1108
- /**
1109
- * An array of all the key columns that the tables are partitioned by.
1110
- * @return Array of Column
1111
- */
1112
- get keyColumns():Column[];
1113
- /**
1114
- * Listen for events on this object.
1115
- * @param name - the name of the event to listen for
1116
- * @param callback - a function to call when the event occurs
1117
- * @return Returns a cleanup function.
1118
- * @typeParam T - the type of the data that the event will provide
1119
- */
1120
- addEventListener<T>(name:string, callback:(e:CustomEvent<T>)=>void):()=>void;
1121
- nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<CustomEvent<T>>;
1122
- hasListeners(name:string):boolean;
1123
- /**
1124
- * Removes an event listener added to this table.
1125
- * @param name -
1126
- * @param callback -
1127
- * @return
1128
- * @typeParam T -
1129
- */
1130
- removeEventListener<T>(name:string, callback:(e:CustomEvent<T>)=>void):boolean;
1131
- }
1132
-
1133
- /**
1134
- * Presently, this is the entrypoint into the Deephaven JS API. By creating an instance of this with the server URL and
1135
- * some options, JS applications can run code on the server, and interact with available exportable objects.
1136
- */
1137
- export class IdeConnection implements HasEventHandling {
1138
- /**
1139
- * @deprecated
1140
- */
1141
- static readonly HACK_CONNECTION_FAILURE:string;
1142
- static readonly EVENT_DISCONNECT:string;
1143
- static readonly EVENT_RECONNECT:string;
1144
- static readonly EVENT_SHUTDOWN:string;
1145
-
1146
- /**
1147
- * creates a new instance, from which console sessions can be made. <b>options</b> are optional.
1148
- * @param serverUrl - The url used when connecting to the server. Read-only.
1149
- * @param connectOptions - Optional Object
1150
- * @param fromJava - Optional boolean
1151
- * @deprecated
1298
+ * Fetch a table containing all the valid keys of the partitioned table.
1299
+ * @return Promise of a Table
1152
1300
  */
1153
- constructor(serverUrl:string, connectOptions?:ConnectOptions, fromJava?:boolean);
1154
-
1301
+ getKeyTable():Promise<Table>;
1155
1302
  /**
1156
- * closes the current connection, releasing any resources on the server or client.
1303
+ * Indicates that this PartitionedTable will no longer be used, removing subcriptions to updated keys, etc. This
1304
+ * will not affect tables in use.
1157
1305
  */
1158
1306
  close():void;
1159
- running():Promise<IdeConnection>;
1160
- getObject(definitionObject:dh.ide.VariableDescriptor):Promise<any>;
1161
- subscribeToFieldUpdates(callback:(arg0:dh.ide.VariableChanges)=>void):()=>void;
1162
1307
  /**
1163
- * Register a callback function to handle any log messages that are emitted on the server. Returns a function ,
1164
- * which can be invoked to remove this log handler. Any log handler registered in this way will receive as many old
1165
- * log messages as are presently available.
1166
- * @param callback -
1167
- * @return {@link io.deephaven.web.shared.fu.JsRunnable}
1308
+ * The count of known keys.
1309
+ * @return int
1168
1310
  */
1169
- onLogMessage(callback:(arg0:dh.ide.LogItem)=>void):()=>void;
1170
- startSession(type:string):Promise<IdeSession>;
1171
- getConsoleTypes():Promise<Array<string>>;
1172
- getWorkerHeapInfo():Promise<WorkerHeapInfo>;
1311
+ get size():number;
1312
+ /**
1313
+ * An array of the columns in the tables that can be retrieved from this partitioned table, including both key and
1314
+ * non-key columns.
1315
+ * @return Array of Column
1316
+ */
1317
+ get columns():Column[];
1318
+ /**
1319
+ * An array of all the key columns that the tables are partitioned by.
1320
+ * @return Array of Column
1321
+ */
1322
+ get keyColumns():Column[];
1173
1323
  /**
1174
1324
  * Listen for events on this object.
1175
1325
  * @param name - the name of the event to listen for
@@ -1191,400 +1341,242 @@ export namespace dh {
1191
1341
  }
1192
1342
 
1193
1343
  /**
1194
- * Deprecated for use in Deephaven Core.
1195
- * @deprecated
1196
- */
1197
- export class Client {
1198
- static readonly EVENT_REQUEST_FAILED:string;
1199
- static readonly EVENT_REQUEST_STARTED:string;
1200
- static readonly EVENT_REQUEST_SUCCEEDED:string;
1201
-
1202
- constructor();
1203
- }
1204
-
1205
- export class CoreClient implements HasEventHandling {
1206
- static readonly EVENT_CONNECT:string;
1207
- static readonly EVENT_DISCONNECT:string;
1208
- static readonly EVENT_RECONNECT:string;
1209
- static readonly EVENT_RECONNECT_AUTH_FAILED:string;
1210
- static readonly EVENT_REFRESH_TOKEN_UPDATED:string;
1211
- static readonly EVENT_REQUEST_FAILED:string;
1212
- static readonly EVENT_REQUEST_STARTED:string;
1213
- static readonly EVENT_REQUEST_SUCCEEDED:string;
1214
- static readonly LOGIN_TYPE_PASSWORD:string;
1215
- static readonly LOGIN_TYPE_ANONYMOUS:string;
1216
-
1217
- constructor(serverUrl:string, connectOptions?:ConnectOptions);
1218
-
1219
- running():Promise<CoreClient>;
1220
- getServerUrl():string;
1221
- getAuthConfigValues():Promise<string[][]>;
1222
- login(credentials:LoginCredentials):Promise<void>;
1223
- relogin(token:RefreshToken):Promise<void>;
1224
- onConnected(timeoutInMillis?:number):Promise<void>;
1225
- getServerConfigValues():Promise<string[][]>;
1226
- getStorageService():dh.storage.StorageService;
1227
- getAsIdeConnection():Promise<IdeConnection>;
1228
- disconnect():void;
1229
- addEventListener<T>(name:string, callback:(e:CustomEvent<T>)=>void):()=>void;
1230
- nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<CustomEvent<T>>;
1231
- hasListeners(name:string):boolean;
1232
- removeEventListener<T>(name:string, callback:(e:CustomEvent<T>)=>void):boolean;
1233
- }
1234
-
1235
- /**
1236
- * Describes a filter which can be applied to a table. Replacing these instances may be more expensive than reusing
1237
- * them. These instances are immutable - all operations that compose them to build bigger expressions return a new
1238
- * instance.
1344
+ * This class allows iteration over non-contiguous indexes. In the future, this will support the EcmaScript 2015
1345
+ * Iteration protocol, but for now has one method which returns an iterator, and also supports querying the size.
1346
+ * Additionally, we may add support for creating RangeSet objects to better serve some use cases.
1239
1347
  */
1240
- export class FilterCondition {
1348
+ export class RangeSet {
1241
1349
  protected constructor();
1242
1350
 
1351
+ static ofRange(first:number, last:number):RangeSet;
1352
+ static ofItems(rows:number[]):RangeSet;
1353
+ static ofRanges(ranges:RangeSet[]):RangeSet;
1354
+ static ofSortedRanges(ranges:RangeSet[]):RangeSet;
1243
1355
  /**
1244
- * the opposite of this condition
1245
- * @return FilterCondition
1246
- */
1247
- not():FilterCondition;
1248
- /**
1249
- * a condition representing the current condition logically ANDed with the other parameters
1250
- * @param filters -
1251
- * @return FilterCondition
1252
- */
1253
- and(...filters:FilterCondition[]):FilterCondition;
1254
- /**
1255
- * a condition representing the current condition logically ORed with the other parameters
1256
- * @param filters -
1257
- * @return FilterCondition.
1258
- */
1259
- or(...filters:FilterCondition[]):FilterCondition;
1260
- /**
1261
- * a string suitable for debugging showing the details of this condition.
1262
- * @return String.
1263
- */
1264
- toString():string;
1265
- get columns():Array<Column>;
1266
- /**
1267
- * a filter condition invoking a static function with the given parameters. Currently supported Deephaven static
1268
- * functions:
1269
- * <ul>
1270
- * <li><b>inRange</b>: Given three comparable values, returns true if the first is less than the second but greater
1271
- * than the third</li>
1272
- * <li><b>isInf</b>:Returns true if the given number is <i>infinity</i></li>
1273
- * <li><b>isNaN</b>:Returns true if the given number is <i>not a number</i></li>
1274
- * <li><b>isNormal</b>:Returns true if the given number <i>is not null</i>, <i>is not infinity</i>, and <i>is not
1275
- * "not a number"</i></li>
1276
- * <li><b>startsWith</b>:Returns true if the first string starts with the second string</li>
1277
- * <li><b>endsWith</b>Returns true if the first string ends with the second string</li>
1278
- * <li><b>matches</b>:Returns true if the first string argument matches the second string used as a Java regular
1279
- * expression</li>
1280
- * <li><b>contains</b>:Returns true if the first string argument contains the second string as a substring</li>
1281
- * <li><b>in</b>:Returns true if the first string argument can be found in the second array argument.
1282
- * <p>
1283
- * Note that the array can only be specified as a column reference at this time - typically the `FilterValue.in`
1284
- * method should be used in other cases
1285
- * </p>
1286
- * </li>
1287
- * </ul>
1288
- * @param function -
1289
- * @param args -
1290
- * @return dh.FilterCondition
1356
+ * a new iterator over all indexes in this collection.
1357
+ * @return Iterator of {@link dh.LongWrapper}
1291
1358
  */
1292
- static invoke(func:string, ...args:FilterValue[]):FilterCondition;
1359
+ iterator():Iterator<LongWrapper>;
1293
1360
  /**
1294
- * a filter condition which will check if the given value can be found in any supported column on whatever table
1295
- * this FilterCondition is passed to. This FilterCondition is somewhat unique in that it need not be given a column
1296
- * instance, but will adapt to any table. On numeric columns, with a value passed in which can be parsed as a
1297
- * number, the column will be filtered to numbers which equal, or can be "rounded" effectively to this number. On
1298
- * String columns, the given value will match any column which contains this string in a case-insensitive search. An
1299
- * optional second argument can be passed, an array of `FilterValue` from the columns to limit this search to (see
1300
- * {@link dh.Column.filter}).
1301
- * @param value -
1302
- * @param columns -
1303
- * @return dh.FilterCondition
1361
+ * The total count of items contained in this collection. In some cases this can be expensive to compute, and
1362
+ * generally should not be needed except for debugging purposes, or preallocating space (i.e., do not call this
1363
+ * property each time through a loop).
1364
+ * @return double
1304
1365
  */
1305
- static search(value:FilterValue, columns?:FilterValue[]):FilterCondition;
1366
+ get size():number;
1367
+ }
1368
+
1369
+ export class DateWrapper extends LongWrapper {
1370
+ protected constructor();
1371
+
1372
+ static ofJsDate(date:Date):DateWrapper;
1373
+ asDate():Date;
1306
1374
  }
1307
1375
 
1308
1376
  /**
1309
- * Provides access to data in a table. Note that several methods present their response through Promises. This allows
1310
- * the client to both avoid actually connecting to the server until necessary, and also will permit some changes not to
1311
- * inform the UI right away that they have taken place.
1377
+ * Presently optional and not used by the server, this allows the client to specify some authentication details. String
1378
+ * authToken <i>- base 64 encoded auth token. String serviceId -</i> The service ID to use for the connection.
1312
1379
  */
1313
- export class Table implements JoinableTable, HasEventHandling {
1314
- readonly description?:string|null;
1315
- readonly pluginName?:string|null;
1316
- readonly layoutHints?:null|LayoutHints;
1317
- static readonly EVENT_SIZECHANGED:string;
1318
- static readonly EVENT_UPDATED:string;
1319
- static readonly EVENT_ROWADDED:string;
1320
- static readonly EVENT_ROWREMOVED:string;
1321
- static readonly EVENT_ROWUPDATED:string;
1322
- static readonly EVENT_SORTCHANGED:string;
1323
- static readonly EVENT_FILTERCHANGED:string;
1324
- static readonly EVENT_CUSTOMCOLUMNSCHANGED:string;
1325
- static readonly EVENT_DISCONNECT:string;
1326
- static readonly EVENT_RECONNECT:string;
1327
- static readonly EVENT_RECONNECTFAILED:string;
1328
- static readonly EVENT_REQUEST_FAILED:string;
1329
- static readonly EVENT_REQUEST_SUCCEEDED:string;
1330
- static readonly SIZE_UNCOALESCED:number;
1380
+ export class ConnectOptions {
1381
+ headers:{ [key: string]: string; };
1331
1382
 
1332
- protected constructor();
1383
+ constructor();
1384
+ }
1333
1385
 
1334
- batch(userCode:(arg0:unknown)=>void):Promise<Table>;
1335
- /**
1336
- * Retrieve a column by the given name. You should prefer to always retrieve a new Column instance instead of
1337
- * caching a returned value.
1338
- * @param key -
1339
- * @return {@link dh.Column}
1340
- */
1341
- findColumn(key:string):Column;
1342
- /**
1343
- * Retrieve multiple columns specified by the given names.
1344
- * @param keys -
1345
- * @return {@link dh.Column} array
1346
- */
1347
- findColumns(keys:string[]):Column[];
1348
- isBlinkTable():boolean;
1349
- /**
1350
- * If .hasInputTable is true, you may call this method to gain access to an InputTable object which can be used to
1351
- * mutate the data within the table. If the table is not an Input Table, the promise will be immediately rejected.
1352
- * @return Promise of dh.InputTable
1353
- */
1354
- inputTable():Promise<InputTable>;
1355
- /**
1356
- * Indicates that this Table instance will no longer be used, and its connection to the server can be cleaned up.
1357
- */
1358
- close():void;
1359
- getAttributes():string[];
1360
- /**
1361
- * null if no property exists, a string if it is an easily serializable property, or a ```Promise
1362
- * &lt;Table&gt;``` that will either resolve with a table or error out if the object can't be passed to JS.
1363
- * @param attributeName -
1364
- * @return Object
1365
- */
1366
- getAttribute(attributeName:string):unknown|undefined|null;
1367
- /**
1368
- * Replace the currently set sort on this table. Returns the previously set value. Note that the sort property will
1369
- * immediately return the new value, but you may receive update events using the old sort before the new sort is
1370
- * applied, and the <b>sortchanged</b> event fires. Reusing existing, applied sorts may enable this to perform
1371
- * better on the server. The <b>updated</b> event will also fire, but <b>rowadded</b> and <b>rowremoved</b> will
1372
- * not.
1373
- * @param sort -
1374
- * @return {@link dh.Sort} array
1375
- */
1376
- applySort(sort:Sort[]):Array<Sort>;
1386
+ /**
1387
+ * Behaves like a {@link dh.Table} externally, but data, state, and viewports are managed by an entirely different
1388
+ * mechanism, and so reimplemented here.
1389
+ * <p>
1390
+ * Any time a change is made, we build a new request and send it to the server, and wait for the updated state.
1391
+ * <p>
1392
+ * Semantics around getting updates from the server are slightly different - we don't "unset" the viewport here after
1393
+ * operations are performed, but encourage the client code to re-set them to the desired position.
1394
+ * <p>
1395
+ * The table size will be -1 until a viewport has been fetched.
1396
+ * <p>
1397
+ * Similar to a table, a Tree Table provides access to subscribed viewport data on the current hierarchy. A different
1398
+ * Row type is used within that viewport, showing the depth of that node within the tree and indicating details about
1399
+ * whether it has children or is expanded. The Tree Table itself then provides the ability to change if a row is
1400
+ * expanded or not. Methods used to control or check if a row should be expanded or not can be invoked on a TreeRow
1401
+ * instance, or on the number of the row (thus allowing for expanding/collapsing rows which are not currently visible in
1402
+ * the viewport).
1403
+ * <p>
1404
+ * Events and viewports are somewhat different from tables, due to the expense of computing the expanded/collapsed rows
1405
+ * and count of children at each level of the hierarchy, and differences in the data that is available.
1406
+ * <p>
1407
+ * <ul>
1408
+ * <li>There is no {@link Table.totalSize | totalSize} property.</li>
1409
+ * <li>The viewport is not un-set when changes are made to filter or sort, but changes will continue to be streamed in.
1410
+ * It is suggested that the viewport be changed to the desired position (usually the first N rows) after any filter/sort
1411
+ * change is made. Likewise, {@link getViewportData} will always return the most recent data, and will not wait if a
1412
+ * new operation is pending.</li>
1413
+ * <li>Custom columns are not directly supported. If the TreeTable was created client-side, the original Table can have
1414
+ * custom columns applied, and the TreeTable can be recreated.</li>
1415
+ * <li>Whereas Table has a {@link Table.totalsTableConfig} property, it is defined here as a method,
1416
+ * {@link getTotalsTableConfig}. This returns a promise so the config can be fetched asynchronously.</li>
1417
+ * <li>Totals Tables for trees vary in behavior between tree tables and roll-up tables. This behavior is based on the
1418
+ * original flat table used to produce the Tree Table - for a hierarchical table (i.e. Table.treeTable in the query
1419
+ * config), the totals will include non-leaf nodes (since they are themselves actual rows in the table), but in a
1420
+ * roll-up table, the totals only include leaf nodes (as non-leaf nodes are generated through grouping the contents of
1421
+ * the original table). Roll-ups also have the {@link dh.includeConstituents} property, indicating that a
1422
+ * {@link dh.Column} in the tree may have a {@link Column.constituentType} property reflecting that the type of cells
1423
+ * where {@link TreeRow.hasChildren} is false will be different from usual.</li>
1424
+ * </ul>
1425
+ */
1426
+ export class TreeTable implements HasEventHandling {
1377
1427
  /**
1378
- * Replace the currently set filters on the table. Returns the previously set value. Note that the filter property
1379
- * will immediately return the new value, but you may receive update events using the old filter before the new one
1380
- * is applied, and the <b>filterchanged</b> event fires. Reusing existing, applied filters may enable this to
1381
- * perform better on the server. The <b>updated</b> event will also fire, but <b>rowadded</b> and <b>rowremoved</b>
1382
- * will not.
1383
- * @param filter -
1384
- * @return {@link dh.FilterCondition} array
1428
+ * event.detail is the currently visible viewport data based on the active viewport configuration.
1385
1429
  */
1386
- applyFilter(filter:FilterCondition[]):Array<FilterCondition>;
1430
+ static readonly EVENT_UPDATED:string;
1387
1431
  /**
1388
- * used when adding new filter and sort operations to the table, as long as they are present.
1389
- * @param customColumns -
1390
- * @return {@link dh.CustomColumn} array
1432
+ * event.detail is the currently visible viewport data based on the active viewport configuration.
1391
1433
  */
1392
- applyCustomColumns(customColumns:Array<string|CustomColumn>):Array<CustomColumn>;
1434
+ static readonly EVENT_DISCONNECT:string;
1393
1435
  /**
1394
- * If the columns parameter is not provided, all columns will be used. If the updateIntervalMs parameter is not
1395
- * provided, a default of one second will be used. Until this is called, no data will be available. Invoking this
1396
- * will result in events to be fired once data becomes available, starting with an `updated` event and a
1397
- * <b>rowadded</b> event per row in that range. The returned object allows the viewport to be closed when no longer
1398
- * needed.
1399
- * @param firstRow -
1400
- * @param lastRow -
1401
- * @param columns -
1402
- * @param updateIntervalMs -
1403
- * @return {@link dh.TableViewportSubscription}
1436
+ * event.detail is the currently visible viewport data based on the active viewport configuration.
1404
1437
  */
1405
- setViewport(firstRow:number, lastRow:number, columns?:Array<Column>|undefined|null, updateIntervalMs?:number|undefined|null):TableViewportSubscription;
1438
+ static readonly EVENT_RECONNECT:string;
1406
1439
  /**
1407
- * Gets the currently visible viewport. If the current set of operations has not yet resulted in data, it will not
1408
- * resolve until that data is ready. If this table is closed before the promise resolves, it will be rejected - to
1409
- * separate the lifespan of this promise from the table itself, call
1410
- * {@link TableViewportSubscription.getViewportData} on the result from {@link Table.setViewport}.
1411
- * @return Promise of {@link dh.TableData}
1440
+ * event.detail is the currently visible viewport data based on the active viewport configuration.
1412
1441
  */
1413
- getViewportData():Promise<TableData>;
1442
+ static readonly EVENT_RECONNECTFAILED:string;
1414
1443
  /**
1415
- * Creates a subscription to the specified columns, across all rows in the table. The optional parameter
1416
- * updateIntervalMs may be specified to indicate how often the server should send updates, defaulting to one second
1417
- * if omitted. Useful for charts or taking a snapshot of the table atomically. The initial snapshot will arrive in a
1418
- * single event, but later changes will be sent as updates. However, this may still be very expensive to run from a
1419
- * browser for very large tables. Each call to subscribe creates a new subscription, which must have <b>close()</b>
1420
- * called on it to stop it, and all events are fired from the TableSubscription instance.
1421
- * @param columns -
1422
- * @param updateIntervalMs -
1423
- * @return {@link dh.TableSubscription}
1444
+ * event.detail is the currently visible viewport data based on the active viewport configuration.
1424
1445
  */
1425
- subscribe(columns:Array<Column>, updateIntervalMs?:number):TableSubscription;
1446
+ static readonly EVENT_REQUEST_FAILED:string;
1447
+ readonly description?:string|null;
1448
+ readonly layoutHints?:null|LayoutHints;
1449
+
1450
+ protected constructor();
1451
+
1426
1452
  /**
1427
- * a new table containing the distinct tuples of values from the given columns that are present in the original
1428
- * table. This table can be manipulated as any other table. Sorting is often desired as the default sort is the
1429
- * order of appearance of values from the original table.
1430
- * @param columns -
1431
- * @return Promise of dh.Table
1453
+ * Expands the given node, so that its children are visible when they are in the viewport. The parameter can be the
1454
+ * row index, or the row object itself. The second parameter is a boolean value, false by default, specifying if the
1455
+ * row and all descendants should be fully expanded. Equivalent to `setExpanded(row, true)` with an optional third
1456
+ * boolean parameter.
1457
+ * @param row -
1458
+ * @param expandDescendants -
1432
1459
  */
1433
- selectDistinct(columns:Column[]):Promise<Table>;
1460
+ expand(row:TreeRow|number, expandDescendants?:boolean):void;
1434
1461
  /**
1435
- * Creates a new copy of this table, so it can be sorted and filtered separately, and maintain a different viewport.
1436
- * @return Promise of dh.Table
1462
+ * Collapses the given node, so that its children and descendants are not visible in the size or the viewport. The
1463
+ * parameter can be the row index, or the row object itself. Equivalent to <b>setExpanded(row, false, false)</b>.
1464
+ * @param row -
1437
1465
  */
1438
- copy():Promise<Table>;
1466
+ collapse(row:TreeRow|number):void;
1439
1467
  /**
1440
- * a promise that will resolve to a Totals Table of this table. This table will obey the configurations provided as
1441
- * a parameter, or will use the table's default if no parameter is provided, and be updated once per second as
1442
- * necessary. Note that multiple calls to this method will each produce a new TotalsTable which must have close()
1443
- * called on it when not in use.
1444
- * @param config -
1445
- * @return Promise of dh.TotalsTable
1468
+ * Specifies if the given node should be expanded or collapsed. If this node has children, and the value is changed,
1469
+ * the size of the table will change. If node is to be expanded and the third parameter, <b>expandDescendants</b>,
1470
+ * is true, then its children will also be expanded.
1471
+ * @param row -
1472
+ * @param isExpanded -
1473
+ * @param expandDescendants -
1446
1474
  */
1447
- getTotalsTable(config?:TotalsTableConfig|undefined|null):Promise<TotalsTable>;
1475
+ setExpanded(row:TreeRow|number, isExpanded:boolean, expandDescendants?:boolean):void;
1476
+ expandAll():void;
1477
+ collapseAll():void;
1448
1478
  /**
1449
- * a promise that will resolve to a Totals Table of this table, ignoring any filters. See <b>getTotalsTable()</b>
1450
- * above for more specifics.
1451
- * @param config -
1452
- * @return promise of dh.TotalsTable
1479
+ * true if the given row is expanded, false otherwise. Equivalent to `TreeRow.isExpanded`, if an instance of the row
1480
+ * is available
1481
+ * @param row -
1482
+ * @return boolean
1453
1483
  */
1454
- getGrandTotalsTable(config?:TotalsTableConfig|undefined|null):Promise<TotalsTable>;
1484
+ isExpanded(row:TreeRow|number):boolean;
1485
+ setViewport(firstRow:number, lastRow:number, columns?:Array<Column>|undefined|null, updateInterval?:number|undefined|null):void;
1486
+ getViewportData():Promise<TreeViewportData>;
1455
1487
  /**
1456
- * a promise that will resolve to a new roll-up <b>TreeTable</b> of this table. Multiple calls to this method will
1457
- * each produce a new <b>TreeTable</b> which must have close() called on it when not in use.
1458
- * @param configObject -
1459
- * @return Promise of dh.TreeTable
1488
+ * Indicates that the table will no longer be used, and server resources can be freed.
1460
1489
  */
1461
- rollup(configObject:RollupConfig):Promise<TreeTable>;
1490
+ close():void;
1491
+ typedTicket():dhinternal.io.deephaven.proto.ticket_pb.TypedTicket;
1462
1492
  /**
1463
- * a promise that will resolve to a new `TreeTable` of this table. Multiple calls to this method will each produce a
1464
- * new `TreeTable` which must have close() called on it when not in use.
1465
- * @param configObject -
1466
- * @return Promise dh.TreeTable
1493
+ * Applies the given sort to all levels of the tree. Returns the previous sort in use.
1494
+ * @param sort -
1495
+ * @return {@link dh.Sort} array
1467
1496
  */
1468
- treeTable(configObject:TreeTableConfig):Promise<TreeTable>;
1497
+ applySort(sort:Sort[]):Array<Sort>;
1469
1498
  /**
1470
- * a "frozen" version of this table (a server-side snapshot of the entire source table). Viewports on the frozen
1471
- * table will not update. This does not change the original table, and the new table will not have any of the client
1472
- * side sorts/filters/columns. New client side sorts/filters/columns can be added to the frozen copy.
1473
- * @return Promise of dh.Table
1499
+ * Applies the given filter to the contents of the tree in such a way that if any node is visible, then any parent
1500
+ * node will be visible as well even if that parent node would not normally be visible due to the filter's
1501
+ * condition. Returns the previous sort in use.
1502
+ * @param filter -
1503
+ * @return {@link dh.FilterCondition} array
1474
1504
  */
1475
- freeze():Promise<Table>;
1476
- snapshot(baseTable:Table, doInitialSnapshot?:boolean, stampColumns?:string[]):Promise<Table>;
1505
+ applyFilter(filter:FilterCondition[]):Array<FilterCondition>;
1477
1506
  /**
1478
- *
1479
- * @inheritDoc
1480
- * @deprecated
1507
+ * a column with the given name, or throws an exception if it cannot be found
1508
+ * @param key -
1509
+ * @return {@link dh.Column}
1481
1510
  */
1482
- join(joinType:string, rightTable:JoinableTable, columnsToMatch:Array<string>, columnsToAdd?:Array<string>|undefined|null, asOfMatchRule?:string|undefined|null):Promise<Table>;
1483
- asOfJoin(rightTable:JoinableTable, columnsToMatch:Array<string>, columnsToAdd?:Array<string>|undefined|null, asOfMatchRule?:string|undefined|null):Promise<Table>;
1484
- crossJoin(rightTable:JoinableTable, columnsToMatch:Array<string>, columnsToAdd?:Array<string>|undefined|null, reserveBits?:number|undefined|null):Promise<Table>;
1485
- exactJoin(rightTable:JoinableTable, columnsToMatch:Array<string>, columnsToAdd?:Array<string>):Promise<Table>;
1486
- naturalJoin(rightTable:JoinableTable, columnsToMatch:Array<string>, columnsToAdd?:Array<string>):Promise<Table>;
1487
- byExternal(keys:object, dropKeys?:boolean):Promise<PartitionedTable>;
1511
+ findColumn(key:string):Column;
1488
1512
  /**
1489
- * Creates a new PartitionedTable from the contents of the current table, partitioning data based on the specified
1490
- * keys.
1513
+ * an array with all of the named columns in order, or throws an exception if one cannot be found.
1491
1514
  * @param keys -
1492
- * @param dropKeys -
1493
- * @return Promise dh.PartitionedTable
1494
- */
1495
- partitionBy(keys:object, dropKeys?:boolean):Promise<PartitionedTable>;
1496
- /**
1497
- * a promise that will resolve to ColumnStatistics for the column of this table.
1498
- * @param column -
1499
- * @return Promise of dh.ColumnStatistics
1500
- */
1501
- getColumnStatistics(column:Column):Promise<ColumnStatistics>;
1502
- /**
1503
- * Seek the row matching the data provided
1504
- * @param startingRow - Row to start the seek from
1505
- * @param column - Column to seek for value on
1506
- * @param valueType - Type of value provided
1507
- * @param seekValue - Value to seek
1508
- * @param insensitive - Optional value to flag a search as case-insensitive. Defaults to `false`.
1509
- * @param contains - Optional value to have the seek value do a contains search instead of exact equality. Defaults to
1510
- * `false`.
1511
- * @param isBackwards - Optional value to seek backwards through the table instead of forwards. Defaults to `false`.
1512
- * @return A promise that resolves to the row value found.
1513
- */
1514
- seekRow(startingRow:number, column:Column, valueType:ValueTypeType, seekValue:any, insensitive?:boolean|undefined|null, contains?:boolean|undefined|null, isBackwards?:boolean|undefined|null):Promise<number>;
1515
- toString():string;
1516
- /**
1517
- * True if this table represents a user Input Table (created by InputTable.newInputTable). When true, you may call
1518
- * .inputTable() to add or remove data from the underlying table.
1519
- * @return boolean
1520
- */
1521
- get hasInputTable():boolean;
1522
- /**
1523
- * The columns that are present on this table. This is always all possible columns. If you specify fewer columns in
1524
- * .setViewport(), you will get only those columns in your ViewportData. <b>Number size</b> The total count of rows
1525
- * in the table. The size can and will change; see the <b>sizechanged</b> event for details. Size will be negative
1526
- * in exceptional cases (eg. the table is uncoalesced, see the <b>isUncoalesced</b> property for details).
1527
1515
  * @return {@link dh.Column} array
1528
1516
  */
1529
- get columns():Array<Column>;
1517
+ findColumns(keys:string[]):Column[];
1530
1518
  /**
1531
- * The default configuration to be used when building a <b>TotalsTable</b> for this table.
1532
- * @return dh.TotalsTableConfig
1519
+ * Provides Table-like selectDistinct functionality, but with a few quirks, since it is only fetching the distinct
1520
+ * values for the given columns in the source table:
1521
+ * <ul>
1522
+ * <li>Rollups may make no sense, since values are aggregated.</li>
1523
+ * <li>Values found on orphaned (and removed) nodes will show up in the resulting table, even though they are not in
1524
+ * the tree.</li>
1525
+ * <li>Values found on parent nodes which are only present in the tree since a child is visible will not be present
1526
+ * in the resulting table.</li>
1527
+ * </ul>
1533
1528
  */
1534
- get totalsTableConfig():TotalsTableConfig;
1529
+ selectDistinct(columns:Column[]):Promise<Table>;
1530
+ getTotalsTableConfig():Promise<TotalsTableConfig>;
1531
+ getTotalsTable(config?:object):Promise<TotalsTable>;
1532
+ getGrandTotalsTable(config?:object):Promise<TotalsTable>;
1535
1533
  /**
1536
- * An ordered list of Sorts to apply to the table. To update, call <b>applySort()</b>. Note that this getter will
1537
- * return the new value immediately, even though it may take a little time to update on the server. You may listen
1538
- * for the <b>sortchanged</b> event to know when to update the UI.
1539
- * @return {@link dh.Sort} array
1534
+ * a new copy of this treetable, so it can be sorted and filtered separately, and maintain a different viewport.
1535
+ * Unlike Table, this will _not_ copy the filter or sort, since tree table viewport semantics differ, and without a
1536
+ * viewport set, the treetable doesn't evaluate these settings, and they aren't readable on the properties. Expanded
1537
+ * state is also not copied.
1538
+ * @return Promise of dh.TreeTable
1540
1539
  */
1541
- get sort():Array<Sort>;
1540
+ copy():Promise<TreeTable>;
1542
1541
  /**
1543
- * An ordered list of custom column formulas to add to the table, either adding new columns or replacing existing
1544
- * ones. To update, call <b>applyCustomColumns()</b>.
1545
- * @return {@link dh.CustomColumn} array
1542
+ * The current filter configuration of this Tree Table.
1543
+ * @return {@link dh.FilterCondition} array
1546
1544
  */
1547
- get customColumns():Array<CustomColumn>;
1545
+ get filter():Array<FilterCondition>;
1548
1546
  /**
1549
- * True if this table may receive updates from the server, including size changed events, updated events after
1550
- * initial snapshot.
1547
+ * True if this is a roll-up and will provide the original rows that make up each grouping.
1551
1548
  * @return boolean
1552
1549
  */
1553
- get isRefreshing():boolean;
1554
- /**
1555
- * An ordered list of Filters to apply to the table. To update, call applyFilter(). Note that this getter will
1556
- * return the new value immediately, even though it may take a little time to update on the server. You may listen
1557
- * for the <b>filterchanged</b> event to know when to update the UI.
1558
- * @return {@link dh.FilterCondition} array
1559
- */
1560
- get filter():Array<FilterCondition>;
1550
+ get includeConstituents():boolean;
1551
+ get groupedColumns():Array<Column>;
1561
1552
  /**
1562
- * The total count of the rows in the table, excluding any filters. Unlike <b>size</b>, changes to this value will
1563
- * not result in any event. <b>Sort[] sort</b> an ordered list of Sorts to apply to the table. To update, call
1564
- * applySort(). Note that this getter will return the new value immediately, even though it may take a little time
1565
- * to update on the server. You may listen for the <b>sortchanged</b> event to know when to update the UI.
1566
- * @return double
1553
+ * True if this table has been closed.
1554
+ * @return boolean
1567
1555
  */
1568
- get totalSize():number;
1556
+ get isClosed():boolean;
1569
1557
  /**
1570
- * The total count of rows in the table. The size can and will change; see the <b>sizechanged</b> event for details.
1571
- * Size will be negative in exceptional cases (e.g., the table is uncoalesced; see the <b>isUncoalesced</b>
1572
- * property). for details).
1558
+ * The current number of rows given the table's contents and the various expand/collapse states of each node. (No
1559
+ * totalSize is provided at this time; its definition becomes unclear between roll-up and tree tables, especially
1560
+ * when considering collapse/expand states).
1573
1561
  * @return double
1574
1562
  */
1575
1563
  get size():number;
1576
1564
  /**
1577
- * True if this table has been closed.
1578
- * @return boolean
1565
+ * The columns that can be shown in this Tree Table.
1566
+ * @return {@link dh.Column} array
1579
1567
  */
1580
- get isClosed():boolean;
1568
+ get columns():Array<Column>;
1581
1569
  /**
1582
- * Read-only. True if this table is uncoalesced. Set a viewport or filter on the partition columns to coalesce the
1583
- * table. Check the <b>isPartitionColumn</b> property on the table columns to retrieve the partition columns. Size
1584
- * will be unavailable until table is coalesced.
1570
+ * The current sort configuration of this Tree Table
1571
+ * @return {@link dh.Sort} array.
1572
+ */
1573
+ get sort():Array<Sort>;
1574
+ /**
1575
+ * True if this table may receive updates from the server, including size changed events, updated events after
1576
+ * initial snapshot.
1585
1577
  * @return boolean
1586
1578
  */
1587
- get isUncoalesced():boolean;
1579
+ get isRefreshing():boolean;
1588
1580
  /**
1589
1581
  * Listen for events on this object.
1590
1582
  * @param name - the name of the event to listen for
@@ -1603,751 +1595,778 @@ export namespace dh {
1603
1595
  * @typeParam T -
1604
1596
  */
1605
1597
  removeEventListener<T>(name:string, callback:(e:CustomEvent<T>)=>void):boolean;
1606
- /**
1607
- * a Sort than can be used to reverse a table. This can be passed into n array in applySort. Note that Tree Tables
1608
- * do not support reverse.
1609
- * @return {@link dh.Sort}
1610
- */
1611
- static reverse():Sort;
1612
- }
1613
-
1614
-
1615
- export class CustomColumn {
1616
- static readonly TYPE_FORMAT_COLOR:string;
1617
- static readonly TYPE_FORMAT_NUMBER:string;
1618
- static readonly TYPE_FORMAT_DATE:string;
1619
- static readonly TYPE_NEW:string;
1620
-
1621
- protected constructor();
1622
-
1623
- valueOf():string;
1624
- toString():string;
1625
- /**
1626
- * The expression to evaluate this custom column.
1627
- * @return String
1628
- */
1629
- get expression():string;
1630
- /**
1631
- * The name of the column to use.
1632
- * @return String
1633
- */
1634
- get name():string;
1635
- /**
1636
- * Type of custom column. One of
1637
- *
1638
- * <ul>
1639
- * <li>FORMAT_COLOR</li>
1640
- * <li>FORMAT_NUMBER</li>
1641
- * <li>FORMAT_DATE</li>
1642
- * <li>NEW</li>
1643
- * </ul>
1644
- * @return String
1645
- */
1646
- get type():string;
1647
1598
  }
1648
1599
 
1649
1600
  /**
1650
- * A Widget represents a server side object that sends one or more responses to the client. The client can then
1651
- * interpret these responses to see what to render, or how to respond.
1652
- * <p>
1653
- * Most custom object types result in a single response being sent to the client, often with other exported objects, but
1654
- * some will have streamed responses, and allow the client to send follow-up requests of its own. This class's API is
1655
- * backwards compatible, but as such does not offer a way to tell the difference between a streaming or non-streaming
1656
- * object type, the client code that handles the payloads is expected to know what to expect. See
1657
- * {@link dh.WidgetMessageDetails} for more information.
1658
- * <p>
1659
- * When the promise that returns this object resolves, it will have the first response assigned to its fields. Later
1660
- * responses from the server will be emitted as "message" events. When the connection with the server ends, the "close"
1661
- * event will be emitted. In this way, the connection will behave roughly in the same way as a WebSocket - either side
1662
- * can close, and after close no more messages will be processed. There can be some latency in closing locally while
1663
- * remote messages are still pending - it is up to implementations of plugins to handle this case.
1664
- * <p>
1665
- * Also like WebSockets, the plugin API doesn't define how to serialize messages, and just handles any binary payloads.
1666
- * What it does handle however, is allowing those messages to include references to server-side objects with those
1667
- * payloads. Those server side objects might be tables or other built-in types in the Deephaven JS API, or could be
1668
- * objects usable through their own plugins. They also might have no plugin at all, allowing the client to hold a
1669
- * reference to them and pass them back to the server, either to the current plugin instance, or through another API.
1670
- * The `Widget` type does not specify how those objects should be used or their lifecycle, but leaves that
1671
- * entirely to the plugin. Messages will arrive in the order they were sent.
1672
- * <p>
1673
- * This can suggest several patterns for how plugins operate:
1674
- * <ul>
1675
- * <li>The plugin merely exists to transport some other object to the client. This can be useful for objects which can
1676
- * easily be translated to some other type (like a Table) when the user clicks on it. An example of this is
1677
- * `pandas.DataFrame` will result in a widget that only contains a static
1678
- * {@link dh.Table}. Presently, the widget is immediately closed, and only the Table is
1679
- * provided to the JS API consumer.</li>
1680
- * <li>The plugin provides references to Tables and other objects, and those objects can live longer than the object
1681
- * which provided them. One concrete example of this could have been
1682
- * {@link dh.PartitionedTable} when fetching constituent tables, but it was implemented
1683
- * before bidirectional plugins were implemented. Another example of this is plugins that serve as a "factory", giving
1684
- * the user access to table manipulation/creation methods not supported by gRPC or the JS API.</li>
1685
- * <li>The plugin provides reference to Tables and other objects that only make sense within the context of the widget
1686
- * instance, so when the widget goes away, those objects should be released as well. This is also an example of
1687
- * {@link dh.PartitionedTable}, as the partitioned table tracks creation of new keys through
1688
- * an internal table instance.</li>
1689
- * </ul>
1601
+ * Represents a non-viewport subscription to a table, and all data currently known to be present in the subscribed
1602
+ * columns. This class handles incoming snapshots and deltas, and fires events to consumers to notify of data changes.
1690
1603
  *
1691
- * Handling server objects in messages also has more than one potential pattern that can be used:
1692
- * <ul>
1693
- * <li>One object per message - the message clearly is about that object, no other details required.</li>
1694
- * <li>Objects indexed within their message - as each message comes with a list of objects, those objects can be
1695
- * referenced within the payload by index. This is roughly how {@link dh.plot.Figure}
1696
- * behaves, where the figure descriptor schema includes an index for each created series, describing which table should
1697
- * be used, which columns should be mapped to each axis.</li>
1698
- * <li>Objects indexed since widget creation - each message would append its objects to a list created when the widget
1699
- * was first made, and any new exports that arrive in a new message would be appended to that list. Then, subsequent
1700
- * messages can reference objects already sent. This imposes a limitation where the client cannot release any exports
1701
- * without the server somehow signaling that it will never reference that export again.</li>
1702
- * </ul>
1604
+ * Unlike {@link dh.TableViewportSubscription}, the "original" table does not have a reference to this instance, only the
1605
+ * "private" table instance does, since the original cannot modify the subscription, and the private instance must
1606
+ * forward data to it.
1607
+ *
1608
+ * Represents a subscription to the table on the server. Changes made to the table will not be reflected here - the
1609
+ * subscription must be closed and a new one optioned to see those changes. The event model is slightly different from
1610
+ * viewports to make it less expensive to compute for large tables.
1703
1611
  */
1704
- export class Widget implements WidgetMessageDetails, HasEventHandling {
1705
- static readonly EVENT_MESSAGE:string;
1706
- static readonly EVENT_CLOSE:string;
1612
+ export class TableSubscription implements HasEventHandling {
1613
+ /**
1614
+ * Indicates that some new data is available on the client, either an initial snapshot or a delta update. The
1615
+ * <b>detail</b> field of the event will contain a TableSubscriptionEventData detailing what has changed, or
1616
+ * allowing access to the entire range of items currently in the subscribed columns.
1617
+ */
1618
+ static readonly EVENT_UPDATED:string;
1707
1619
 
1708
1620
  protected constructor();
1709
1621
 
1710
1622
  /**
1711
- * Ends the client connection to the server.
1623
+ * Stops the subscription on the server.
1712
1624
  */
1713
1625
  close():void;
1714
- getDataAsBase64():string;
1715
- getDataAsU8():Uint8Array;
1716
- getDataAsString():string;
1717
- /**
1718
- * Sends a string/bytes payload to the server, along with references to objects that exist on the server.
1719
- * @param msg - string/buffer/view instance that represents data to send
1720
- * @param references - an array of objects that can be safely sent to the server
1721
- */
1722
- sendMessage(msg:string|ArrayBuffer|ArrayBufferView, references?:Array<Table|Widget|WidgetExportedObject|PartitionedTable|TotalsTable|TreeTable>):void;
1723
1626
  addEventListener<T>(name:string, callback:(e:CustomEvent<T>)=>void):()=>void;
1724
1627
  nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<CustomEvent<T>>;
1725
1628
  hasListeners(name:string):boolean;
1726
1629
  removeEventListener<T>(name:string, callback:(e:CustomEvent<T>)=>void):boolean;
1727
1630
  /**
1728
- *
1729
- * @return the exported objects sent in the initial message from the server. The client is responsible for closing
1730
- * them when finished using them.
1731
- */
1732
- get exportedObjects():WidgetExportedObject[];
1733
- /**
1734
- *
1735
- * @return the type of this widget
1631
+ * The columns that were subscribed to when this subscription was created
1632
+ * @return {@link dh.Column}
1736
1633
  */
1737
- get type():string;
1634
+ get columns():Array<Column>;
1738
1635
  }
1739
1636
 
1740
- /**
1741
- * Wrap BigDecimal values for use in JS. Provides text formatting for display and access to the underlying value.
1742
- */
1743
- export class BigDecimalWrapper {
1744
- protected constructor();
1745
-
1746
- static ofString(value:string):BigDecimalWrapper;
1747
- asNumber():number;
1748
- valueOf():string;
1749
- toString():string;
1750
- }
1637
+ export class Ide {
1638
+ constructor();
1751
1639
 
1752
- /**
1753
- * Describes how a Totals Table will be generated from its parent table. Each table has a default (which may be null)
1754
- * indicating how that table was configured when it was declared, and each Totals Table has a similar property
1755
- * describing how it was created. Both the <b>Table.getTotalsTable</b> and <b>Table.getGrandTotalsTable</b> methods take
1756
- * this config as an optional parameter - without it, the table's default will be used, or if null, a default instance
1757
- * of <b>TotalsTableConfig</b> will be supplied.
1758
- *
1759
- * This class has a no-arg constructor, allowing an instance to be made with the default values provided. However, any
1760
- * JS object can be passed in to the methods which accept instances of this type, provided their values adhere to the
1761
- * expected formats.
1762
- */
1763
- export class TotalsTableConfig {
1764
- /**
1765
- * @deprecated
1766
- */
1767
- static readonly COUNT:string;
1768
- /**
1769
- * @deprecated
1770
- */
1771
- static readonly MIN:string;
1772
- /**
1773
- * @deprecated
1774
- */
1775
- static readonly MAX:string;
1776
- /**
1777
- * @deprecated
1778
- */
1779
- static readonly SUM:string;
1780
- /**
1781
- * @deprecated
1782
- */
1783
- static readonly ABS_SUM:string;
1784
- /**
1785
- * @deprecated
1786
- */
1787
- static readonly VAR:string;
1788
- /**
1789
- * @deprecated
1790
- */
1791
- static readonly AVG:string;
1792
1640
  /**
1793
1641
  * @deprecated
1794
1642
  */
1795
- static readonly STD:string;
1643
+ getExistingSession(websocketUrl:string, authToken:string, serviceId:string, language:string):Promise<IdeSession>;
1796
1644
  /**
1797
1645
  * @deprecated
1798
1646
  */
1799
- static readonly FIRST:string;
1647
+ static getExistingSession(websocketUrl:string, authToken:string, serviceId:string, language:string):Promise<IdeSession>;
1648
+ }
1649
+
1650
+ export class LoginCredentials {
1651
+ type?:string|null;
1652
+ username?:string|null;
1653
+ token?:string|null;
1654
+
1655
+ constructor();
1656
+ }
1657
+
1658
+ export class CoreClient implements HasEventHandling {
1659
+ static readonly EVENT_CONNECT:string;
1660
+ static readonly EVENT_DISCONNECT:string;
1661
+ static readonly EVENT_RECONNECT:string;
1662
+ static readonly EVENT_RECONNECT_AUTH_FAILED:string;
1663
+ static readonly EVENT_REFRESH_TOKEN_UPDATED:string;
1664
+ static readonly EVENT_REQUEST_FAILED:string;
1665
+ static readonly EVENT_REQUEST_STARTED:string;
1666
+ static readonly EVENT_REQUEST_SUCCEEDED:string;
1667
+ static readonly LOGIN_TYPE_PASSWORD:string;
1668
+ static readonly LOGIN_TYPE_ANONYMOUS:string;
1669
+
1670
+ constructor(serverUrl:string, connectOptions?:ConnectOptions);
1671
+
1672
+ running():Promise<CoreClient>;
1673
+ getServerUrl():string;
1674
+ getAuthConfigValues():Promise<string[][]>;
1675
+ login(credentials:LoginCredentials):Promise<void>;
1676
+ relogin(token:RefreshToken):Promise<void>;
1677
+ onConnected(timeoutInMillis?:number):Promise<void>;
1678
+ getServerConfigValues():Promise<string[][]>;
1679
+ getStorageService():dh.storage.StorageService;
1680
+ getAsIdeConnection():Promise<IdeConnection>;
1681
+ disconnect():void;
1682
+ addEventListener<T>(name:string, callback:(e:CustomEvent<T>)=>void):()=>void;
1683
+ nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<CustomEvent<T>>;
1684
+ hasListeners(name:string):boolean;
1685
+ removeEventListener<T>(name:string, callback:(e:CustomEvent<T>)=>void):boolean;
1686
+ }
1687
+
1688
+ /**
1689
+ * Presently, this is the entrypoint into the Deephaven JS API. By creating an instance of this with the server URL and
1690
+ * some options, JS applications can run code on the server, and interact with available exportable objects.
1691
+ */
1692
+ export class IdeConnection implements HasEventHandling {
1800
1693
  /**
1801
1694
  * @deprecated
1802
1695
  */
1803
- static readonly LAST:string;
1696
+ static readonly HACK_CONNECTION_FAILURE:string;
1697
+ static readonly EVENT_DISCONNECT:string;
1698
+ static readonly EVENT_RECONNECT:string;
1699
+ static readonly EVENT_SHUTDOWN:string;
1700
+
1804
1701
  /**
1702
+ * creates a new instance, from which console sessions can be made. <b>options</b> are optional.
1703
+ * @param serverUrl - The url used when connecting to the server. Read-only.
1704
+ * @param connectOptions - Optional Object
1705
+ * @param fromJava - Optional boolean
1805
1706
  * @deprecated
1806
1707
  */
1807
- static readonly SKIP:string;
1808
- /**
1809
- * Specifies if a Totals Table should be expanded by default in the UI. Defaults to false.
1810
- */
1811
- showTotalsByDefault:boolean;
1708
+ constructor(serverUrl:string, connectOptions?:ConnectOptions, fromJava?:boolean);
1709
+
1812
1710
  /**
1813
- * Specifies if a Grand Totals Table should be expanded by default in the UI. Defaults to false.
1711
+ * closes the current connection, releasing any resources on the server or client.
1814
1712
  */
1815
- showGrandTotalsByDefault:boolean;
1713
+ close():void;
1714
+ running():Promise<IdeConnection>;
1715
+ getObject(definitionObject:dh.ide.VariableDescriptor):Promise<any>;
1716
+ subscribeToFieldUpdates(callback:(arg0:dh.ide.VariableChanges)=>void):()=>void;
1816
1717
  /**
1817
- * Specifies the default operation for columns that do not have a specific operation applied; defaults to "Sum".
1718
+ * Register a callback function to handle any log messages that are emitted on the server. Returns a function ,
1719
+ * which can be invoked to remove this log handler. Any log handler registered in this way will receive as many old
1720
+ * log messages as are presently available.
1721
+ * @param callback -
1722
+ * @return {@link io.deephaven.web.shared.fu.JsRunnable}
1818
1723
  */
1819
- defaultOperation:AggregationOperationType;
1724
+ onLogMessage(callback:(arg0:dh.ide.LogItem)=>void):()=>void;
1725
+ startSession(type:string):Promise<IdeSession>;
1726
+ getConsoleTypes():Promise<Array<string>>;
1727
+ getWorkerHeapInfo():Promise<WorkerHeapInfo>;
1820
1728
  /**
1821
- * Mapping from each column name to the aggregation(s) that should be applied to that column in the resulting Totals
1822
- * Table. If a column is omitted, the defaultOperation is used.
1729
+ * Listen for events on this object.
1730
+ * @param name - the name of the event to listen for
1731
+ * @param callback - a function to call when the event occurs
1732
+ * @return Returns a cleanup function.
1733
+ * @typeParam T - the type of the data that the event will provide
1823
1734
  */
1824
- operationMap:{ [key: string]: Array<AggregationOperationType>; };
1735
+ addEventListener<T>(name:string, callback:(e:CustomEvent<T>)=>void):()=>void;
1736
+ nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<CustomEvent<T>>;
1737
+ hasListeners(name:string):boolean;
1825
1738
  /**
1826
- * Groupings to use when generating the Totals Table. One row will exist for each unique set of values observed in
1827
- * these columns. See also `Table.selectDistinct`.
1739
+ * Removes an event listener added to this table.
1740
+ * @param name -
1741
+ * @param callback -
1742
+ * @return
1743
+ * @typeParam T -
1828
1744
  */
1829
- groupBy:Array<string>;
1830
-
1831
- constructor();
1832
-
1833
- toString():string;
1745
+ removeEventListener<T>(name:string, callback:(e:CustomEvent<T>)=>void):boolean;
1834
1746
  }
1835
1747
 
1836
1748
  /**
1837
- * Describes a grouping and aggregations for a roll-up table. Pass to the <b>Table.rollup</b> function to create a
1838
- * roll-up table.
1749
+ * Describes a filter which can be applied to a table. Replacing these instances may be more expensive than reusing
1750
+ * them. These instances are immutable - all operations that compose them to build bigger expressions return a new
1751
+ * instance.
1839
1752
  */
1840
- export class RollupConfig {
1753
+ export class FilterCondition {
1754
+ protected constructor();
1755
+
1841
1756
  /**
1842
- * Ordered list of columns to group by to form the hierarchy of the resulting roll-up table.
1757
+ * the opposite of this condition
1758
+ * @return FilterCondition
1843
1759
  */
1844
- groupingColumns:Array<String>;
1760
+ not():FilterCondition;
1845
1761
  /**
1846
- * Mapping from each aggregation name to the ordered list of columns it should be applied to in the resulting
1847
- * roll-up table.
1762
+ * a condition representing the current condition logically ANDed with the other parameters
1763
+ * @param filters -
1764
+ * @return FilterCondition
1848
1765
  */
1849
- aggregations:{ [key: string]: Array<AggregationOperationType>; };
1766
+ and(...filters:FilterCondition[]):FilterCondition;
1850
1767
  /**
1851
- * Optional parameter indicating if an extra leaf node should be added at the bottom of the hierarchy, showing the
1852
- * rows in the underlying table which make up that grouping. Since these values might be a different type from the
1853
- * rest of the column, any client code must check if TreeRow.hasChildren = false, and if so, interpret those values
1854
- * as if they were Column.constituentType instead of Column.type. Defaults to false.
1768
+ * a condition representing the current condition logically ORed with the other parameters
1769
+ * @param filters -
1770
+ * @return FilterCondition.
1855
1771
  */
1856
- includeConstituents:boolean;
1857
- includeOriginalColumns?:boolean|null;
1772
+ or(...filters:FilterCondition[]):FilterCondition;
1858
1773
  /**
1859
- * Optional parameter indicating if original column descriptions should be included. Defaults to true.
1774
+ * a string suitable for debugging showing the details of this condition.
1775
+ * @return String.
1860
1776
  */
1861
- includeDescriptions:boolean;
1862
-
1863
- constructor();
1777
+ toString():string;
1778
+ get columns():Array<Column>;
1779
+ /**
1780
+ * a filter condition invoking a static function with the given parameters. Currently supported Deephaven static
1781
+ * functions:
1782
+ * <ul>
1783
+ * <li><b>inRange</b>: Given three comparable values, returns true if the first is less than the second but greater
1784
+ * than the third</li>
1785
+ * <li><b>isInf</b>:Returns true if the given number is <i>infinity</i></li>
1786
+ * <li><b>isNaN</b>:Returns true if the given number is <i>not a number</i></li>
1787
+ * <li><b>isNormal</b>:Returns true if the given number <i>is not null</i>, <i>is not infinity</i>, and <i>is not
1788
+ * "not a number"</i></li>
1789
+ * <li><b>startsWith</b>:Returns true if the first string starts with the second string</li>
1790
+ * <li><b>endsWith</b>Returns true if the first string ends with the second string</li>
1791
+ * <li><b>matches</b>:Returns true if the first string argument matches the second string used as a Java regular
1792
+ * expression</li>
1793
+ * <li><b>contains</b>:Returns true if the first string argument contains the second string as a substring</li>
1794
+ * <li><b>in</b>:Returns true if the first string argument can be found in the second array argument.
1795
+ * <p>
1796
+ * Note that the array can only be specified as a column reference at this time - typically the `FilterValue.in`
1797
+ * method should be used in other cases
1798
+ * </p>
1799
+ * </li>
1800
+ * </ul>
1801
+ * @param function -
1802
+ * @param args -
1803
+ * @return dh.FilterCondition
1804
+ */
1805
+ static invoke(func:string, ...args:FilterValue[]):FilterCondition;
1806
+ /**
1807
+ * a filter condition which will check if the given value can be found in any supported column on whatever table
1808
+ * this FilterCondition is passed to. This FilterCondition is somewhat unique in that it need not be given a column
1809
+ * instance, but will adapt to any table. On numeric columns, with a value passed in which can be parsed as a
1810
+ * number, the column will be filtered to numbers which equal, or can be "rounded" effectively to this number. On
1811
+ * String columns, the given value will match any column which contains this string in a case-insensitive search. An
1812
+ * optional second argument can be passed, an array of `FilterValue` from the columns to limit this search to (see
1813
+ * {@link dh.Column.filter}).
1814
+ * @param value -
1815
+ * @param columns -
1816
+ * @return dh.FilterCondition
1817
+ */
1818
+ static search(value:FilterValue, columns?:FilterValue[]):FilterCondition;
1864
1819
  }
1865
1820
 
1866
1821
  /**
1867
- * Presently optional and not used by the server, this allows the client to specify some authentication details. String
1868
- * authToken <i>- base 64 encoded auth token. String serviceId -</i> The service ID to use for the connection.
1822
+ * Exists to keep the dh.TableMap namespace so that the web UI can remain compatible with the DHE API, which still calls
1823
+ * this type TableMap.
1824
+ * @deprecated
1869
1825
  */
1870
- export class ConnectOptions {
1871
- headers:{ [key: string]: string; };
1872
-
1873
- constructor();
1874
- }
1826
+ export class TableMap {
1827
+ static readonly EVENT_KEYADDED:string;
1828
+ static readonly EVENT_DISCONNECT:string;
1829
+ static readonly EVENT_RECONNECT:string;
1830
+ static readonly EVENT_RECONNECTFAILED:string;
1875
1831
 
1876
- export class LongWrapper {
1877
1832
  protected constructor();
1878
-
1879
- static ofString(str:string):LongWrapper;
1880
- asNumber():number;
1881
- valueOf():string;
1882
- toString():string;
1883
1833
  }
1884
1834
 
1885
1835
  /**
1886
- * Event fired when a command is issued from the client.
1836
+ * Provides access to data in a table. Note that several methods present their response through Promises. This allows
1837
+ * the client to both avoid actually connecting to the server until necessary, and also will permit some changes not to
1838
+ * inform the UI right away that they have taken place.
1887
1839
  */
1888
- export class CommandInfo {
1889
- constructor(code:string, result:Promise<dh.ide.CommandResult>);
1890
-
1891
- get result():Promise<dh.ide.CommandResult>;
1892
- get code():string;
1893
- }
1894
-
1895
- export class LoginCredentials {
1896
- type?:string|null;
1897
- username?:string|null;
1898
- token?:string|null;
1840
+ export class Table implements JoinableTable, HasEventHandling {
1841
+ readonly description?:string|null;
1842
+ readonly pluginName?:string|null;
1843
+ readonly layoutHints?:null|LayoutHints;
1844
+ static readonly EVENT_SIZECHANGED:string;
1845
+ static readonly EVENT_UPDATED:string;
1846
+ static readonly EVENT_ROWADDED:string;
1847
+ static readonly EVENT_ROWREMOVED:string;
1848
+ static readonly EVENT_ROWUPDATED:string;
1849
+ static readonly EVENT_SORTCHANGED:string;
1850
+ static readonly EVENT_FILTERCHANGED:string;
1851
+ static readonly EVENT_CUSTOMCOLUMNSCHANGED:string;
1852
+ static readonly EVENT_DISCONNECT:string;
1853
+ static readonly EVENT_RECONNECT:string;
1854
+ static readonly EVENT_RECONNECTFAILED:string;
1855
+ static readonly EVENT_REQUEST_FAILED:string;
1856
+ static readonly EVENT_REQUEST_SUCCEEDED:string;
1857
+ static readonly SIZE_UNCOALESCED:number;
1899
1858
 
1900
- constructor();
1901
- }
1859
+ protected constructor();
1902
1860
 
1903
- /**
1904
- * Configuration object for running Table.treeTable to produce a hierarchical view of a given "flat" table.
1905
- *
1906
- * Like TotalsTableConfig, `TreeTableConfig` supports an operation map indicating how to aggregate the data, as well as
1907
- * an array of column names which will be the layers in the roll-up tree, grouped at each level. An additional optional
1908
- * value can be provided describing the strategy the engine should use when grouping the rows.
1909
- */
1910
- export class TreeTableConfig {
1861
+ batch(userCode:(arg0:unknown)=>void):Promise<Table>;
1911
1862
  /**
1912
- * The column representing the unique ID for each item
1863
+ * Retrieve a column by the given name. You should prefer to always retrieve a new Column instance instead of
1864
+ * caching a returned value.
1865
+ * @param key -
1866
+ * @return {@link dh.Column}
1867
+ */
1868
+ findColumn(key:string):Column;
1869
+ /**
1870
+ * Retrieve multiple columns specified by the given names.
1871
+ * @param keys -
1872
+ * @return {@link dh.Column} array
1873
+ */
1874
+ findColumns(keys:string[]):Column[];
1875
+ isBlinkTable():boolean;
1876
+ /**
1877
+ * If .hasInputTable is true, you may call this method to gain access to an InputTable object which can be used to
1878
+ * mutate the data within the table. If the table is not an Input Table, the promise will be immediately rejected.
1879
+ * @return Promise of dh.InputTable
1880
+ */
1881
+ inputTable():Promise<InputTable>;
1882
+ /**
1883
+ * Indicates that this Table instance will no longer be used, and its connection to the server can be cleaned up.
1884
+ */
1885
+ close():void;
1886
+ getAttributes():string[];
1887
+ /**
1888
+ * null if no property exists, a string if it is an easily serializable property, or a ```Promise
1889
+ * &lt;Table&gt;``` that will either resolve with a table or error out if the object can't be passed to JS.
1890
+ * @param attributeName -
1891
+ * @return Object
1892
+ */
1893
+ getAttribute(attributeName:string):unknown|undefined|null;
1894
+ /**
1895
+ * Replace the currently set sort on this table. Returns the previously set value. Note that the sort property will
1896
+ * immediately return the new value, but you may receive update events using the old sort before the new sort is
1897
+ * applied, and the <b>sortchanged</b> event fires. Reusing existing, applied sorts may enable this to perform
1898
+ * better on the server. The <b>updated</b> event will also fire, but <b>rowadded</b> and <b>rowremoved</b> will
1899
+ * not.
1900
+ * @param sort -
1901
+ * @return {@link dh.Sort} array
1902
+ */
1903
+ applySort(sort:Sort[]):Array<Sort>;
1904
+ /**
1905
+ * Replace the currently set filters on the table. Returns the previously set value. Note that the filter property
1906
+ * will immediately return the new value, but you may receive update events using the old filter before the new one
1907
+ * is applied, and the <b>filterchanged</b> event fires. Reusing existing, applied filters may enable this to
1908
+ * perform better on the server. The <b>updated</b> event will also fire, but <b>rowadded</b> and <b>rowremoved</b>
1909
+ * will not.
1910
+ * @param filter -
1911
+ * @return {@link dh.FilterCondition} array
1913
1912
  */
1914
- idColumn:string;
1913
+ applyFilter(filter:FilterCondition[]):Array<FilterCondition>;
1915
1914
  /**
1916
- * The column representing the parent ID for each item
1915
+ * used when adding new filter and sort operations to the table, as long as they are present.
1916
+ * @param customColumns -
1917
+ * @return {@link dh.CustomColumn} array
1917
1918
  */
1918
- parentColumn:string;
1919
+ applyCustomColumns(customColumns:Array<string|CustomColumn>):Array<CustomColumn>;
1919
1920
  /**
1920
- * Optional parameter indicating if items with an invalid parent ID should be promoted to root. Defaults to false.
1921
+ * If the columns parameter is not provided, all columns will be used. If the updateIntervalMs parameter is not
1922
+ * provided, a default of one second will be used. Until this is called, no data will be available. Invoking this
1923
+ * will result in events to be fired once data becomes available, starting with an `updated` event and a
1924
+ * <b>rowadded</b> event per row in that range. The returned object allows the viewport to be closed when no longer
1925
+ * needed.
1926
+ * @param firstRow -
1927
+ * @param lastRow -
1928
+ * @param columns -
1929
+ * @param updateIntervalMs -
1930
+ * @return {@link dh.TableViewportSubscription}
1921
1931
  */
1922
- promoteOrphansToRoot:boolean;
1923
-
1924
- constructor();
1925
- }
1926
-
1927
- export class Ide {
1928
- constructor();
1929
-
1932
+ setViewport(firstRow:number, lastRow:number, columns?:Array<Column>|undefined|null, updateIntervalMs?:number|undefined|null):TableViewportSubscription;
1930
1933
  /**
1931
- * @deprecated
1934
+ * Gets the currently visible viewport. If the current set of operations has not yet resulted in data, it will not
1935
+ * resolve until that data is ready. If this table is closed before the promise resolves, it will be rejected - to
1936
+ * separate the lifespan of this promise from the table itself, call
1937
+ * {@link TableViewportSubscription.getViewportData} on the result from {@link Table.setViewport}.
1938
+ * @return Promise of {@link dh.TableData}
1932
1939
  */
1933
- getExistingSession(websocketUrl:string, authToken:string, serviceId:string, language:string):Promise<IdeSession>;
1940
+ getViewportData():Promise<TableData>;
1934
1941
  /**
1935
- * @deprecated
1942
+ * Creates a subscription to the specified columns, across all rows in the table. The optional parameter
1943
+ * updateIntervalMs may be specified to indicate how often the server should send updates, defaulting to one second
1944
+ * if omitted. Useful for charts or taking a snapshot of the table atomically. The initial snapshot will arrive in a
1945
+ * single event, but later changes will be sent as updates. However, this may still be very expensive to run from a
1946
+ * browser for very large tables. Each call to subscribe creates a new subscription, which must have <b>close()</b>
1947
+ * called on it to stop it, and all events are fired from the TableSubscription instance.
1948
+ * @param columns -
1949
+ * @param updateIntervalMs -
1950
+ * @return {@link dh.TableSubscription}
1936
1951
  */
1937
- static getExistingSession(websocketUrl:string, authToken:string, serviceId:string, language:string):Promise<IdeSession>;
1938
- }
1939
-
1940
- /**
1941
- * This class allows iteration over non-contiguous indexes. In the future, this will support the EcmaScript 2015
1942
- * Iteration protocol, but for now has one method which returns an iterator, and also supports querying the size.
1943
- * Additionally, we may add support for creating RangeSet objects to better serve some use cases.
1944
- */
1945
- export class RangeSet {
1946
- protected constructor();
1947
-
1948
- static ofRange(first:number, last:number):RangeSet;
1949
- static ofItems(rows:number[]):RangeSet;
1950
- static ofRanges(ranges:RangeSet[]):RangeSet;
1951
- static ofSortedRanges(ranges:RangeSet[]):RangeSet;
1952
+ subscribe(columns:Array<Column>, updateIntervalMs?:number):TableSubscription;
1952
1953
  /**
1953
- * a new iterator over all indexes in this collection.
1954
- * @return Iterator of {@link dh.LongWrapper}
1954
+ * a new table containing the distinct tuples of values from the given columns that are present in the original
1955
+ * table. This table can be manipulated as any other table. Sorting is often desired as the default sort is the
1956
+ * order of appearance of values from the original table.
1957
+ * @param columns -
1958
+ * @return Promise of dh.Table
1955
1959
  */
1956
- iterator():Iterator<LongWrapper>;
1960
+ selectDistinct(columns:Column[]):Promise<Table>;
1957
1961
  /**
1958
- * The total count of items contained in this collection. In some cases this can be expensive to compute, and
1959
- * generally should not be needed except for debugging purposes, or preallocating space (i.e., do not call this
1960
- * property each time through a loop).
1961
- * @return double
1962
+ * Creates a new copy of this table, so it can be sorted and filtered separately, and maintain a different viewport.
1963
+ * @return Promise of dh.Table
1962
1964
  */
1963
- get size():number;
1964
- }
1965
-
1966
- /**
1967
- * Describes data that can be filtered, either a column reference or a literal value. Used this way, the type of a value
1968
- * can be specified so that values which are ambiguous or not well supported in JS will not be confused with Strings or
1969
- * imprecise numbers (e.g., nanosecond-precision date values). Additionally, once wrapped in this way, methods can be
1970
- * called on these value literal instances. These instances are immutable - any method called on them returns a new
1971
- * instance.
1972
- */
1973
- export class FilterValue {
1974
- protected constructor();
1975
-
1965
+ copy():Promise<Table>;
1976
1966
  /**
1977
- * Constructs a number for the filter API from the given parameter. Can also be used on the values returned from
1978
- * {@link TableData.get} for DateTime values. To create
1979
- * a filter with a date, use <b>dh.DateWrapper.ofJsDate</b> or
1980
- * {@link i18n.DateTimeFormat.parse}. To create a filter with a
1981
- * 64-bit long integer, use {@link LongWrapper.ofString}.
1982
- * @param input - the number to wrap as a FilterValue
1983
- * @return an immutable FilterValue that can be built into a filter
1967
+ * a promise that will resolve to a Totals Table of this table. This table will obey the configurations provided as
1968
+ * a parameter, or will use the table's default if no parameter is provided, and be updated once per second as
1969
+ * necessary. Note that multiple calls to this method will each produce a new TotalsTable which must have close()
1970
+ * called on it when not in use.
1971
+ * @param config -
1972
+ * @return Promise of dh.TotalsTable
1984
1973
  */
1985
- static ofNumber(input:LongWrapper|number):FilterValue;
1974
+ getTotalsTable(config?:TotalsTableConfig|undefined|null):Promise<TotalsTable>;
1986
1975
  /**
1987
- * a filter condition checking if the current value is equal to the given parameter
1988
- * @param term -
1989
- * @return {@link dh.FilterCondition}
1976
+ * a promise that will resolve to a Totals Table of this table, ignoring any filters. See <b>getTotalsTable()</b>
1977
+ * above for more specifics.
1978
+ * @param config -
1979
+ * @return promise of dh.TotalsTable
1990
1980
  */
1991
- eq(term:FilterValue):FilterCondition;
1981
+ getGrandTotalsTable(config?:TotalsTableConfig|undefined|null):Promise<TotalsTable>;
1992
1982
  /**
1993
- * a filter condition checking if the current value is equal to the given parameter, ignoring differences of upper
1994
- * vs lower case
1995
- * @param term -
1996
- * @return {@link dh.FilterCondition}
1983
+ * a promise that will resolve to a new roll-up <b>TreeTable</b> of this table. Multiple calls to this method will
1984
+ * each produce a new <b>TreeTable</b> which must have close() called on it when not in use.
1985
+ * @param configObject -
1986
+ * @return Promise of dh.TreeTable
1997
1987
  */
1998
- eqIgnoreCase(term:FilterValue):FilterCondition;
1988
+ rollup(configObject:RollupConfig):Promise<TreeTable>;
1999
1989
  /**
2000
- * a filter condition checking if the current value is not equal to the given parameter
2001
- * @param term -
2002
- * @return {@link dh.FilterCondition}
1990
+ * a promise that will resolve to a new `TreeTable` of this table. Multiple calls to this method will each produce a
1991
+ * new `TreeTable` which must have close() called on it when not in use.
1992
+ * @param configObject -
1993
+ * @return Promise dh.TreeTable
2003
1994
  */
2004
- notEq(term:FilterValue):FilterCondition;
1995
+ treeTable(configObject:TreeTableConfig):Promise<TreeTable>;
2005
1996
  /**
2006
- * a filter condition checking if the current value is not equal to the given parameter, ignoring differences of
2007
- * upper vs lower case
2008
- * @param term -
2009
- * @return {@link dh.FilterCondition}
1997
+ * a "frozen" version of this table (a server-side snapshot of the entire source table). Viewports on the frozen
1998
+ * table will not update. This does not change the original table, and the new table will not have any of the client
1999
+ * side sorts/filters/columns. New client side sorts/filters/columns can be added to the frozen copy.
2000
+ * @return Promise of dh.Table
2010
2001
  */
2011
- notEqIgnoreCase(term:FilterValue):FilterCondition;
2002
+ freeze():Promise<Table>;
2003
+ snapshot(baseTable:Table, doInitialSnapshot?:boolean, stampColumns?:string[]):Promise<Table>;
2012
2004
  /**
2013
- * a filter condition checking if the current value is greater than the given parameter
2014
- * @param term -
2015
- * @return {@link dh.FilterCondition}
2005
+ *
2006
+ * @inheritDoc
2007
+ * @deprecated
2016
2008
  */
2017
- greaterThan(term:FilterValue):FilterCondition;
2009
+ join(joinType:string, rightTable:JoinableTable, columnsToMatch:Array<string>, columnsToAdd?:Array<string>|undefined|null, asOfMatchRule?:string|undefined|null):Promise<Table>;
2010
+ asOfJoin(rightTable:JoinableTable, columnsToMatch:Array<string>, columnsToAdd?:Array<string>|undefined|null, asOfMatchRule?:string|undefined|null):Promise<Table>;
2011
+ crossJoin(rightTable:JoinableTable, columnsToMatch:Array<string>, columnsToAdd?:Array<string>|undefined|null, reserveBits?:number|undefined|null):Promise<Table>;
2012
+ exactJoin(rightTable:JoinableTable, columnsToMatch:Array<string>, columnsToAdd?:Array<string>):Promise<Table>;
2013
+ naturalJoin(rightTable:JoinableTable, columnsToMatch:Array<string>, columnsToAdd?:Array<string>):Promise<Table>;
2014
+ byExternal(keys:object, dropKeys?:boolean):Promise<PartitionedTable>;
2018
2015
  /**
2019
- * a filter condition checking if the current value is less than the given parameter
2020
- * @param term -
2021
- * @return {@link dh.FilterCondition}
2016
+ * Creates a new PartitionedTable from the contents of the current table, partitioning data based on the specified
2017
+ * keys.
2018
+ * @param keys -
2019
+ * @param dropKeys -
2020
+ * @return Promise dh.PartitionedTable
2022
2021
  */
2023
- lessThan(term:FilterValue):FilterCondition;
2022
+ partitionBy(keys:object, dropKeys?:boolean):Promise<PartitionedTable>;
2024
2023
  /**
2025
- * a filter condition checking if the current value is greater than or equal to the given parameter
2026
- * @param term -
2027
- * @return {@link dh.FilterCondition}
2024
+ * a promise that will resolve to ColumnStatistics for the column of this table.
2025
+ * @param column -
2026
+ * @return Promise of dh.ColumnStatistics
2028
2027
  */
2029
- greaterThanOrEqualTo(term:FilterValue):FilterCondition;
2028
+ getColumnStatistics(column:Column):Promise<ColumnStatistics>;
2030
2029
  /**
2031
- * a filter condition checking if the current value is less than or equal to the given parameter
2032
- * @param term -
2033
- * @return {@link dh.FilterCondition}
2030
+ * Seek the row matching the data provided
2031
+ * @param startingRow - Row to start the seek from
2032
+ * @param column - Column to seek for value on
2033
+ * @param valueType - Type of value provided
2034
+ * @param seekValue - Value to seek
2035
+ * @param insensitive - Optional value to flag a search as case-insensitive. Defaults to `false`.
2036
+ * @param contains - Optional value to have the seek value do a contains search instead of exact equality. Defaults to
2037
+ * `false`.
2038
+ * @param isBackwards - Optional value to seek backwards through the table instead of forwards. Defaults to `false`.
2039
+ * @return A promise that resolves to the row value found.
2034
2040
  */
2035
- lessThanOrEqualTo(term:FilterValue):FilterCondition;
2041
+ seekRow(startingRow:number, column:Column, valueType:ValueTypeType, seekValue:any, insensitive?:boolean|undefined|null, contains?:boolean|undefined|null, isBackwards?:boolean|undefined|null):Promise<number>;
2042
+ toString():string;
2036
2043
  /**
2037
- * a filter condition checking if the current value is in the given set of values
2038
- * @param terms -
2039
- * @return {@link dh.FilterCondition}
2044
+ * True if this table represents a user Input Table (created by InputTable.newInputTable). When true, you may call
2045
+ * .inputTable() to add or remove data from the underlying table.
2046
+ * @return boolean
2040
2047
  */
2041
- in(terms:FilterValue[]):FilterCondition;
2048
+ get hasInputTable():boolean;
2042
2049
  /**
2043
- * a filter condition checking if the current value is in the given set of values, ignoring differences of upper vs
2044
- * lower case
2045
- * @param terms -
2046
- * @return {@link dh.FilterCondition}
2050
+ * The columns that are present on this table. This is always all possible columns. If you specify fewer columns in
2051
+ * .setViewport(), you will get only those columns in your ViewportData. <b>Number size</b> The total count of rows
2052
+ * in the table. The size can and will change; see the <b>sizechanged</b> event for details. Size will be negative
2053
+ * in exceptional cases (eg. the table is uncoalesced, see the <b>isUncoalesced</b> property for details).
2054
+ * @return {@link dh.Column} array
2047
2055
  */
2048
- inIgnoreCase(terms:FilterValue[]):FilterCondition;
2056
+ get columns():Array<Column>;
2049
2057
  /**
2050
- * a filter condition checking that the current value is not in the given set of values
2051
- * @param terms -
2052
- * @return {@link dh.FilterCondition}
2058
+ * The default configuration to be used when building a <b>TotalsTable</b> for this table.
2059
+ * @return dh.TotalsTableConfig
2053
2060
  */
2054
- notIn(terms:FilterValue[]):FilterCondition;
2061
+ get totalsTableConfig():TotalsTableConfig;
2055
2062
  /**
2056
- * a filter condition checking that the current value is not in the given set of values, ignoring differences of
2057
- * upper vs lower case
2058
- * @param terms -
2059
- * @return {@link dh.FilterCondition}
2063
+ * An ordered list of Sorts to apply to the table. To update, call <b>applySort()</b>. Note that this getter will
2064
+ * return the new value immediately, even though it may take a little time to update on the server. You may listen
2065
+ * for the <b>sortchanged</b> event to know when to update the UI.
2066
+ * @return {@link dh.Sort} array
2060
2067
  */
2061
- notInIgnoreCase(terms:FilterValue[]):FilterCondition;
2068
+ get sort():Array<Sort>;
2062
2069
  /**
2063
- * a filter condition checking if the given value contains the given string value
2064
- * @param term -
2065
- * @return {@link dh.FilterCondition}
2070
+ * An ordered list of custom column formulas to add to the table, either adding new columns or replacing existing
2071
+ * ones. To update, call <b>applyCustomColumns()</b>.
2072
+ * @return {@link dh.CustomColumn} array
2066
2073
  */
2067
- contains(term:FilterValue):FilterCondition;
2074
+ get customColumns():Array<CustomColumn>;
2068
2075
  /**
2069
- * a filter condition checking if the given value contains the given string value, ignoring differences of upper vs
2070
- * lower case
2071
- * @param term -
2072
- * @return {@link dh.FilterCondition}
2076
+ * True if this table may receive updates from the server, including size changed events, updated events after
2077
+ * initial snapshot.
2078
+ * @return boolean
2073
2079
  */
2074
- containsIgnoreCase(term:FilterValue):FilterCondition;
2080
+ get isRefreshing():boolean;
2075
2081
  /**
2076
- * a filter condition checking if the given value matches the provided regular expressions string. Regex patterns
2077
- * use Java regex syntax
2078
- * @param pattern -
2079
- * @return {@link dh.FilterCondition}
2082
+ * An ordered list of Filters to apply to the table. To update, call applyFilter(). Note that this getter will
2083
+ * return the new value immediately, even though it may take a little time to update on the server. You may listen
2084
+ * for the <b>filterchanged</b> event to know when to update the UI.
2085
+ * @return {@link dh.FilterCondition} array
2080
2086
  */
2081
- matches(pattern:FilterValue):FilterCondition;
2087
+ get filter():Array<FilterCondition>;
2082
2088
  /**
2083
- * a filter condition checking if the given value matches the provided regular expressions string, ignoring
2084
- * differences of upper vs lower case. Regex patterns use Java regex syntax
2085
- * @param pattern -
2086
- * @return {@link dh.FilterCondition}
2089
+ * The total count of the rows in the table, excluding any filters. Unlike <b>size</b>, changes to this value will
2090
+ * not result in any event. <b>Sort[] sort</b> an ordered list of Sorts to apply to the table. To update, call
2091
+ * applySort(). Note that this getter will return the new value immediately, even though it may take a little time
2092
+ * to update on the server. You may listen for the <b>sortchanged</b> event to know when to update the UI.
2093
+ * @return double
2087
2094
  */
2088
- matchesIgnoreCase(pattern:FilterValue):FilterCondition;
2095
+ get totalSize():number;
2089
2096
  /**
2090
- * a filter condition checking if the current value is a true boolean
2091
- * @return {@link dh.FilterCondition}
2097
+ * The total count of rows in the table. The size can and will change; see the <b>sizechanged</b> event for details.
2098
+ * Size will be negative in exceptional cases (e.g., the table is uncoalesced; see the <b>isUncoalesced</b>
2099
+ * property). for details).
2100
+ * @return double
2092
2101
  */
2093
- isTrue():FilterCondition;
2102
+ get size():number;
2094
2103
  /**
2095
- * a filter condition checking if the current value is a false boolean
2096
- * @return {@link dh.FilterCondition}
2104
+ * True if this table has been closed.
2105
+ * @return boolean
2097
2106
  */
2098
- isFalse():FilterCondition;
2107
+ get isClosed():boolean;
2099
2108
  /**
2100
- * a filter condition checking if the current value is a null value
2101
- * @return {@link dh.FilterCondition}
2109
+ * Read-only. True if this table is uncoalesced. Set a viewport or filter on the partition columns to coalesce the
2110
+ * table. Check the <b>isPartitionColumn</b> property on the table columns to retrieve the partition columns. Size
2111
+ * will be unavailable until table is coalesced.
2112
+ * @return boolean
2102
2113
  */
2103
- isNull():FilterCondition;
2114
+ get isUncoalesced():boolean;
2104
2115
  /**
2105
- * a filter condition invoking the given method on the current value, with the given parameters. Currently supported
2106
- * functions that can be invoked on a String:
2107
- * <ul>
2108
- * <li><b>startsWith</b>: Returns true if the current string value starts with the supplied string argument</li>
2109
- * <li><b>endsWith</b>: Returns true if the current string value ends with the supplied string argument</li>
2110
- * <li><b>matches</b>: Returns true if the current string value matches the supplied string argument used as a Java
2111
- * regular expression</li>
2112
- * <li><b>contains</b>: Returns true if the current string value contains the supplied string argument
2113
- * <p>
2114
- * When invoking against a constant, this should be avoided in favor of FilterValue.contains
2115
- * </p>
2116
- * </li>
2117
- * </ul>
2118
- * @param method -
2119
- * @param args -
2120
- * @return
2116
+ * Listen for events on this object.
2117
+ * @param name - the name of the event to listen for
2118
+ * @param callback - a function to call when the event occurs
2119
+ * @return Returns a cleanup function.
2120
+ * @typeParam T - the type of the data that the event will provide
2121
2121
  */
2122
- invoke(method:string, ...args:FilterValue[]):FilterCondition;
2123
- toString():string;
2122
+ addEventListener<T>(name:string, callback:(e:CustomEvent<T>)=>void):()=>void;
2123
+ nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<CustomEvent<T>>;
2124
+ hasListeners(name:string):boolean;
2124
2125
  /**
2125
- * Constructs a string for the filter API from the given parameter.
2126
- * @param input -
2126
+ * Removes an event listener added to this table.
2127
+ * @param name -
2128
+ * @param callback -
2127
2129
  * @return
2130
+ * @typeParam T -
2128
2131
  */
2129
- static ofString(input:any):FilterValue;
2132
+ removeEventListener<T>(name:string, callback:(e:CustomEvent<T>)=>void):boolean;
2130
2133
  /**
2131
- * Constructs a boolean for the filter API from the given parameter.
2132
- * @param b -
2133
- * @return
2134
+ * a Sort than can be used to reverse a table. This can be passed into n array in applySort. Note that Tree Tables
2135
+ * do not support reverse.
2136
+ * @return {@link dh.Sort}
2134
2137
  */
2135
- static ofBoolean(b:boolean):FilterValue;
2138
+ static reverse():Sort;
2136
2139
  }
2137
2140
 
2138
2141
  /**
2139
- * Behaves like a {@link dh.Table} externally, but data, state, and viewports are managed by an entirely different
2140
- * mechanism, and so reimplemented here.
2141
- * <p>
2142
- * Any time a change is made, we build a new request and send it to the server, and wait for the updated state.
2143
- * <p>
2144
- * Semantics around getting updates from the server are slightly different - we don't "unset" the viewport here after
2145
- * operations are performed, but encourage the client code to re-set them to the desired position.
2146
- * <p>
2147
- * The table size will be -1 until a viewport has been fetched.
2148
- * <p>
2149
- * Similar to a table, a Tree Table provides access to subscribed viewport data on the current hierarchy. A different
2150
- * Row type is used within that viewport, showing the depth of that node within the tree and indicating details about
2151
- * whether it has children or is expanded. The Tree Table itself then provides the ability to change if a row is
2152
- * expanded or not. Methods used to control or check if a row should be expanded or not can be invoked on a TreeRow
2153
- * instance, or on the number of the row (thus allowing for expanding/collapsing rows which are not currently visible in
2154
- * the viewport).
2155
- * <p>
2156
- * Events and viewports are somewhat different from tables, due to the expense of computing the expanded/collapsed rows
2157
- * and count of children at each level of the hierarchy, and differences in the data that is available.
2158
- * <p>
2159
- * <ul>
2160
- * <li>There is no {@link Table.totalSize | totalSize} property.</li>
2161
- * <li>The viewport is not un-set when changes are made to filter or sort, but changes will continue to be streamed in.
2162
- * It is suggested that the viewport be changed to the desired position (usually the first N rows) after any filter/sort
2163
- * change is made. Likewise, {@link getViewportData} will always return the most recent data, and will not wait if a
2164
- * new operation is pending.</li>
2165
- * <li>Custom columns are not directly supported. If the TreeTable was created client-side, the original Table can have
2166
- * custom columns applied, and the TreeTable can be recreated.</li>
2167
- * <li>Whereas Table has a {@link Table.totalsTableConfig} property, it is defined here as a method,
2168
- * {@link getTotalsTableConfig}. This returns a promise so the config can be fetched asynchronously.</li>
2169
- * <li>Totals Tables for trees vary in behavior between tree tables and roll-up tables. This behavior is based on the
2170
- * original flat table used to produce the Tree Table - for a hierarchical table (i.e. Table.treeTable in the query
2171
- * config), the totals will include non-leaf nodes (since they are themselves actual rows in the table), but in a
2172
- * roll-up table, the totals only include leaf nodes (as non-leaf nodes are generated through grouping the contents of
2173
- * the original table). Roll-ups also have the {@link dh.includeConstituents} property, indicating that a
2174
- * {@link dh.Column} in the tree may have a {@link Column.constituentType} property reflecting that the type of cells
2175
- * where {@link TreeRow.hasChildren} is false will be different from usual.</li>
2176
- * </ul>
2142
+ * Describes the structure of the column, and if desired can be used to get access to the data to be rendered in this
2143
+ * column.
2177
2144
  */
2178
- export class TreeTable implements HasEventHandling {
2145
+ export class Column {
2179
2146
  /**
2180
- * event.detail is the currently visible viewport data based on the active viewport configuration.
2147
+ * If this column is part of a roll-up tree table, represents the type of the row data that can be found in this
2148
+ * column for leaf nodes if includeConstituents is enabled. Otherwise, it is <b>null</b>.
2149
+ * @return String
2181
2150
  */
2182
- static readonly EVENT_UPDATED:string;
2151
+ readonly constituentType?:string|null;
2152
+ readonly description?:string|null;
2153
+
2154
+ protected constructor();
2155
+
2183
2156
  /**
2184
- * event.detail is the currently visible viewport data based on the active viewport configuration.
2157
+ * the value for this column in the given row. Type will be consistent with the type of the Column.
2158
+ * @param row -
2159
+ * @return Any
2185
2160
  */
2186
- static readonly EVENT_DISCONNECT:string;
2161
+ get(row:Row):any;
2162
+ getFormat(row:Row):Format;
2187
2163
  /**
2188
- * event.detail is the currently visible viewport data based on the active viewport configuration.
2164
+ * Creates a sort builder object, to be used when sorting by this column.
2165
+ * @return {@link dh.Sort}
2189
2166
  */
2190
- static readonly EVENT_RECONNECT:string;
2167
+ sort():Sort;
2191
2168
  /**
2192
- * event.detail is the currently visible viewport data based on the active viewport configuration.
2169
+ * Creates a new value for use in filters based on this column. Used either as a parameter to another filter
2170
+ * operation, or as a builder to create a filter operation.
2171
+ * @return {@link dh.FilterValue}
2193
2172
  */
2194
- static readonly EVENT_RECONNECTFAILED:string;
2173
+ filter():FilterValue;
2195
2174
  /**
2196
- * event.detail is the currently visible viewport data based on the active viewport configuration.
2175
+ * a <b>CustomColumn</b> object to apply using `applyCustomColumns` with the expression specified.
2176
+ * @param expression -
2177
+ * @return {@link dh.CustomColumn}
2197
2178
  */
2198
- static readonly EVENT_REQUEST_FAILED:string;
2199
- readonly description?:string|null;
2200
-
2201
- protected constructor();
2202
-
2179
+ formatColor(expression:string):CustomColumn;
2203
2180
  /**
2204
- * Expands the given node, so that its children are visible when they are in the viewport. The parameter can be the
2205
- * row index, or the row object itself. The second parameter is a boolean value, false by default, specifying if the
2206
- * row and all descendants should be fully expanded. Equivalent to `setExpanded(row, true)` with an optional third
2207
- * boolean parameter.
2208
- * @param row -
2209
- * @param expandDescendants -
2181
+ * a <b>CustomColumn</b> object to apply using <b>applyCustomColumns</b> with the expression specified.
2182
+ * @param expression -
2183
+ * @return {@link dh.CustomColumn}
2210
2184
  */
2211
- expand(row:TreeRow|number, expandDescendants?:boolean):void;
2185
+ formatNumber(expression:string):CustomColumn;
2212
2186
  /**
2213
- * Collapses the given node, so that its children and descendants are not visible in the size or the viewport. The
2214
- * parameter can be the row index, or the row object itself. Equivalent to <b>setExpanded(row, false, false)</b>.
2215
- * @param row -
2187
+ * a <b>CustomColumn</b> object to apply using <b>applyCustomColumns</b> with the expression specified.
2188
+ * @param expression -
2189
+ * @return {@link dh.CustomColumn}
2216
2190
  */
2217
- collapse(row:TreeRow|number):void;
2191
+ formatDate(expression:string):CustomColumn;
2192
+ toString():string;
2218
2193
  /**
2219
- * Specifies if the given node should be expanded or collapsed. If this node has children, and the value is changed,
2220
- * the size of the table will change. If node is to be expanded and the third parameter, <b>expandDescendants</b>,
2221
- * is true, then its children will also be expanded.
2222
- * @param row -
2223
- * @param isExpanded -
2224
- * @param expandDescendants -
2194
+ * Label for this column.
2195
+ * @return String
2225
2196
  */
2226
- setExpanded(row:TreeRow|number, isExpanded:boolean, expandDescendants?:boolean):void;
2227
- expandAll():void;
2228
- collapseAll():void;
2197
+ get name():string;
2229
2198
  /**
2230
- * true if the given row is expanded, false otherwise. Equivalent to `TreeRow.isExpanded`, if an instance of the row
2231
- * is available
2232
- * @param row -
2199
+ * True if this column is a partition column. Partition columns are used for filtering uncoalesced tables (see
2200
+ * <b>isUncoalesced</b> property on <b>Table</b>)
2233
2201
  * @return boolean
2234
2202
  */
2235
- isExpanded(row:TreeRow|number):boolean;
2236
- setViewport(firstRow:number, lastRow:number, columns?:Array<Column>|undefined|null, updateInterval?:number|undefined|null):void;
2237
- getViewportData():Promise<TreeViewportData>;
2203
+ get isPartitionColumn():boolean;
2238
2204
  /**
2239
- * Indicates that the table will no longer be used, and server resources can be freed.
2205
+ *
2206
+ * @deprecated do not use. Internal index of the column in the table, to be used as a key on the Row.
2207
+ * @return int
2240
2208
  */
2241
- close():void;
2242
- typedTicket():dhinternal.io.deephaven.proto.ticket_pb.TypedTicket;
2209
+ get index():number;
2210
+ get isSortable():boolean;
2243
2211
  /**
2244
- * Applies the given sort to all levels of the tree. Returns the previous sort in use.
2245
- * @param sort -
2246
- * @return {@link dh.Sort} array
2212
+ * Type of the row data that can be found in this column.
2213
+ * @return String
2247
2214
  */
2248
- applySort(sort:Sort[]):Array<Sort>;
2215
+ get type():string;
2249
2216
  /**
2250
- * Applies the given filter to the contents of the tree in such a way that if any node is visible, then any parent
2251
- * node will be visible as well even if that parent node would not normally be visible due to the filter's
2252
- * condition. Returns the previous sort in use.
2253
- * @param filter -
2254
- * @return {@link dh.FilterCondition} array
2217
+ * Format entire rows colors using the expression specified. Returns a <b>CustomColumn</b> object to apply to a
2218
+ * table using <b>applyCustomColumns</b> with the parameters specified.
2219
+ * @param expression -
2220
+ * @return {@link dh.CustomColumn}
2255
2221
  */
2256
- applyFilter(filter:FilterCondition[]):Array<FilterCondition>;
2222
+ static formatRowColor(expression:string):CustomColumn;
2257
2223
  /**
2258
- * a column with the given name, or throws an exception if it cannot be found
2259
- * @param key -
2260
- * @return {@link dh.Column}
2224
+ * a <b>CustomColumn</b> object to apply using <b>applyCustomColumns</b> with the expression specified.
2225
+ * @param name -
2226
+ * @param expression -
2227
+ * @return {@link dh.CustomColumn}
2261
2228
  */
2262
- findColumn(key:string):Column;
2229
+ static createCustomColumn(name:string, expression:string):CustomColumn;
2230
+ }
2231
+
2232
+ export class CustomColumn {
2233
+ static readonly TYPE_FORMAT_COLOR:string;
2234
+ static readonly TYPE_FORMAT_NUMBER:string;
2235
+ static readonly TYPE_FORMAT_DATE:string;
2236
+ static readonly TYPE_NEW:string;
2237
+
2238
+ protected constructor();
2239
+
2240
+ valueOf():string;
2241
+ toString():string;
2263
2242
  /**
2264
- * an array with all of the named columns in order, or throws an exception if one cannot be found.
2265
- * @param keys -
2266
- * @return {@link dh.Column} array
2243
+ * The expression to evaluate this custom column.
2244
+ * @return String
2245
+ */
2246
+ get expression():string;
2247
+ /**
2248
+ * The name of the column to use.
2249
+ * @return String
2267
2250
  */
2268
- findColumns(keys:string[]):Column[];
2251
+ get name():string;
2269
2252
  /**
2270
- * Provides Table-like selectDistinct functionality, but with a few quirks, since it is only fetching the distinct
2271
- * values for the given columns in the source table:
2253
+ * Type of custom column. One of
2254
+ *
2272
2255
  * <ul>
2273
- * <li>Rollups may make no sense, since values are aggregated.</li>
2274
- * <li>Values found on orphaned (and removed) nodes will show up in the resulting table, even though they are not in
2275
- * the tree.</li>
2276
- * <li>Values found on parent nodes which are only present in the tree since a child is visible will not be present
2277
- * in the resulting table.</li>
2256
+ * <li>FORMAT_COLOR</li>
2257
+ * <li>FORMAT_NUMBER</li>
2258
+ * <li>FORMAT_DATE</li>
2259
+ * <li>NEW</li>
2278
2260
  * </ul>
2261
+ * @return String
2279
2262
  */
2280
- selectDistinct(columns:Column[]):Promise<Table>;
2281
- getTotalsTableConfig():Promise<TotalsTableConfig>;
2282
- getTotalsTable(config?:object):Promise<TotalsTable>;
2283
- getGrandTotalsTable(config?:object):Promise<TotalsTable>;
2263
+ get type():string;
2264
+ }
2265
+
2266
+ /**
2267
+ * A js type for operating on input tables.
2268
+ *
2269
+ * Represents a User Input Table, which can have data added to it from other sources.
2270
+ *
2271
+ * You may add rows using dictionaries of key-value tuples (representing columns by name), add tables containing all the
2272
+ * key/value columns to add, or delete tables containing the keys to delete. Each operation is atomic, and will either
2273
+ * succeed completely or fail completely. To guarantee order of operations, apply an operation and wait for the response
2274
+ * before sending the next operation.
2275
+ *
2276
+ * Each table has one or more key columns, where each unique combination of keys will appear at most once in the table.
2277
+ *
2278
+ * To view the results of the Input Table, you should use standard table operations on the InputTable's source Table
2279
+ * object.
2280
+ */
2281
+ export class InputTable {
2282
+ protected constructor();
2283
+
2284
2284
  /**
2285
- * a new copy of this treetable, so it can be sorted and filtered separately, and maintain a different viewport.
2286
- * Unlike Table, this will _not_ copy the filter or sort, since tree table viewport semantics differ, and without a
2287
- * viewport set, the treetable doesn't evaluate these settings, and they aren't readable on the properties. Expanded
2288
- * state is also not copied.
2289
- * @return Promise of dh.TreeTable
2285
+ * Adds a single row to the table. For each key or value column name in the Input Table, we retrieve that javascript
2286
+ * property at that name and validate it can be put into the given column type.
2287
+ * @param row -
2288
+ * @param userTimeZone -
2289
+ * @return Promise of dh.InputTable
2290
2290
  */
2291
- copy():Promise<TreeTable>;
2291
+ addRow(row:{ [key: string]: any; }, userTimeZone?:string):Promise<InputTable>;
2292
2292
  /**
2293
- * The current filter configuration of this Tree Table.
2294
- * @return {@link dh.FilterCondition} array
2293
+ * Add multiple rows to a table.
2294
+ * @param rows -
2295
+ * @param userTimeZone -
2296
+ * @return Promise of dh.InputTable
2295
2297
  */
2296
- get filter():Array<FilterCondition>;
2298
+ addRows(rows:{ [key: string]: any; }[], userTimeZone?:string):Promise<InputTable>;
2297
2299
  /**
2298
- * True if this is a roll-up and will provide the original rows that make up each grouping.
2299
- * @return boolean
2300
+ * Add an entire table to this Input Table. Only column names that match the definition of the input table will be
2301
+ * copied, and all key columns must have values filled in. This only copies the current state of the source table;
2302
+ * future updates to the source table will not be reflected in the Input Table. The returned promise will be
2303
+ * resolved to the same InputTable instance this method was called upon once the server returns.
2304
+ * @param tableToAdd -
2305
+ * @return Promise of dh.InputTable
2300
2306
  */
2301
- get includeConstituents():boolean;
2302
- get groupedColumns():Array<Column>;
2307
+ addTable(tableToAdd:Table):Promise<InputTable>;
2303
2308
  /**
2304
- * True if this table has been closed.
2305
- * @return boolean
2309
+ * Add multiple tables to this Input Table.
2310
+ * @param tablesToAdd -
2311
+ * @return Promise of dh.InputTable
2306
2312
  */
2307
- get isClosed():boolean;
2313
+ addTables(tablesToAdd:Table[]):Promise<InputTable>;
2308
2314
  /**
2309
- * The current number of rows given the table's contents and the various expand/collapse states of each node. (No
2310
- * totalSize is provided at this time; its definition becomes unclear between roll-up and tree tables, especially
2311
- * when considering collapse/expand states).
2312
- * @return double
2315
+ * Deletes an entire table from this Input Table. Key columns must match the Input Table.
2316
+ * @param tableToDelete -
2317
+ * @return Promise of dh.InputTable
2313
2318
  */
2314
- get size():number;
2319
+ deleteTable(tableToDelete:Table):Promise<InputTable>;
2315
2320
  /**
2316
- * The columns that can be shown in this Tree Table.
2317
- * @return {@link dh.Column} array
2321
+ * Delete multiple tables from this Input Table.
2322
+ * @param tablesToDelete -
2323
+ * @return
2318
2324
  */
2319
- get columns():Array<Column>;
2325
+ deleteTables(tablesToDelete:Table[]):Promise<InputTable>;
2320
2326
  /**
2321
- * The current sort configuration of this Tree Table
2322
- * @return {@link dh.Sort} array.
2327
+ * A list of the key columns, by name
2328
+ * @return String array.
2323
2329
  */
2324
- get sort():Array<Sort>;
2330
+ get keys():string[];
2325
2331
  /**
2326
- * True if this table may receive updates from the server, including size changed events, updated events after
2327
- * initial snapshot.
2328
- * @return boolean
2332
+ * A list of the value columns, by name
2333
+ * @return String array.
2329
2334
  */
2330
- get isRefreshing():boolean;
2335
+ get values():string[];
2331
2336
  /**
2332
- * Listen for events on this object.
2333
- * @param name - the name of the event to listen for
2334
- * @param callback - a function to call when the event occurs
2335
- * @return Returns a cleanup function.
2336
- * @typeParam T - the type of the data that the event will provide
2337
+ * A list of the key columns.
2338
+ * @return Column array.
2337
2339
  */
2338
- addEventListener<T>(name:string, callback:(e:CustomEvent<T>)=>void):()=>void;
2339
- nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<CustomEvent<T>>;
2340
- hasListeners(name:string):boolean;
2340
+ get keyColumns():Column[];
2341
2341
  /**
2342
- * Removes an event listener added to this table.
2343
- * @param name -
2344
- * @param callback -
2345
- * @return
2346
- * @typeParam T -
2342
+ * A list of the value Column objects
2343
+ * @return {@link dh.Column} array.
2347
2344
  */
2348
- removeEventListener<T>(name:string, callback:(e:CustomEvent<T>)=>void):boolean;
2345
+ get valueColumns():Column[];
2346
+ /**
2347
+ * The source table for this Input Table
2348
+ * @return dh.table
2349
+ */
2350
+ get table():Table;
2351
+ }
2352
+
2353
+
2354
+ type SearchDisplayModeType = string;
2355
+ export class SearchDisplayMode {
2356
+ static readonly SEARCH_DISPLAY_DEFAULT:SearchDisplayModeType;
2357
+ static readonly SEARCH_DISPLAY_HIDE:SearchDisplayModeType;
2358
+ static readonly SEARCH_DISPLAY_SHOW:SearchDisplayModeType;
2349
2359
  }
2350
2360
 
2361
+ type ValueTypeType = string;
2362
+ export class ValueType {
2363
+ static readonly STRING:ValueTypeType;
2364
+ static readonly NUMBER:ValueTypeType;
2365
+ static readonly DOUBLE:ValueTypeType;
2366
+ static readonly LONG:ValueTypeType;
2367
+ static readonly DATETIME:ValueTypeType;
2368
+ static readonly BOOLEAN:ValueTypeType;
2369
+ }
2351
2370
 
2352
2371
  /**
2353
2372
  * This enum describes the name of each supported operation/aggregation type when creating a `TreeTable`.
@@ -2370,13 +2389,6 @@ export namespace dh {
2370
2389
  static readonly SKIP:AggregationOperationType;
2371
2390
  }
2372
2391
 
2373
- type SearchDisplayModeType = string;
2374
- export class SearchDisplayMode {
2375
- static readonly SEARCH_DISPLAY_DEFAULT:SearchDisplayModeType;
2376
- static readonly SEARCH_DISPLAY_HIDE:SearchDisplayModeType;
2377
- static readonly SEARCH_DISPLAY_SHOW:SearchDisplayModeType;
2378
- }
2379
-
2380
2392
  /**
2381
2393
  * A set of string constants that can be used to describe the different objects the JS API can export.
2382
2394
  */
@@ -2393,35 +2405,10 @@ export namespace dh {
2393
2405
  static readonly TREEMAP:VariableTypeType;
2394
2406
  }
2395
2407
 
2396
- type ValueTypeType = string;
2397
- export class ValueType {
2398
- static readonly STRING:ValueTypeType;
2399
- static readonly NUMBER:ValueTypeType;
2400
- static readonly DOUBLE:ValueTypeType;
2401
- static readonly LONG:ValueTypeType;
2402
- static readonly DATETIME:ValueTypeType;
2403
- static readonly BOOLEAN:ValueTypeType;
2404
- }
2405
-
2406
2408
  }
2407
2409
 
2408
2410
  export namespace dh.ide {
2409
2411
 
2410
- /**
2411
- * Indicates the result of code run on the server.
2412
- */
2413
- export interface CommandResult {
2414
- /**
2415
- * Describes changes made in the course of this command.
2416
- * @return {@link dh.ide.VariableChanges}.
2417
- */
2418
- get changes():VariableChanges;
2419
- /**
2420
- * If the command failed, the error message will be provided here.
2421
- * @return String
2422
- */
2423
- get error():string;
2424
- }
2425
2412
  /**
2426
2413
  * Represents a serialized fishlib LogRecord, suitable for display on javascript clients. A log entry sent from the
2427
2414
  * server.
@@ -2516,6 +2503,21 @@ export namespace dh.ide {
2516
2503
  */
2517
2504
  get updated():Array<VariableDefinition>;
2518
2505
  }
2506
+ /**
2507
+ * Indicates the result of code run on the server.
2508
+ */
2509
+ export interface CommandResult {
2510
+ /**
2511
+ * Describes changes made in the course of this command.
2512
+ * @return {@link dh.ide.VariableChanges}.
2513
+ */
2514
+ get changes():VariableChanges;
2515
+ /**
2516
+ * If the command failed, the error message will be provided here.
2517
+ * @return String
2518
+ */
2519
+ get error():string;
2520
+ }
2519
2521
  }
2520
2522
 
2521
2523
  export namespace dh.i18n {
@@ -2523,57 +2525,155 @@ export namespace dh.i18n {
2523
2525
  /**
2524
2526
  * Exported wrapper of the GWT NumberFormat, plus LongWrapper support
2525
2527
  *
2526
- * Utility class to parse and format numbers, using the same format patterns as are supported by the standard Java
2527
- * implementation used in the Deephaven server and swing client. Works for numeric types including BigInteger and
2528
- * BigDecimal.
2528
+ * Utility class to parse and format numbers, using the same format patterns as are supported by the standard Java
2529
+ * implementation used in the Deephaven server and swing client. Works for numeric types including BigInteger and
2530
+ * BigDecimal.
2531
+ */
2532
+ export class NumberFormat {
2533
+ /**
2534
+ * Creates a new number format instance. This generally should be avoided in favor of the static `getFormat`
2535
+ * function, which will create and cache an instance so that later calls share the same instance.
2536
+ * @param pattern -
2537
+ */
2538
+ constructor(pattern:string);
2539
+
2540
+ /**
2541
+ * a number format instance matching the specified format. If this format has not been specified before, a new
2542
+ * instance will be created and cached for later reuse. Prefer this method to calling the constructor directly to
2543
+ * take advantage of caching
2544
+ * @param pattern -
2545
+ * @return dh.i18n.NumberFormat
2546
+ */
2547
+ static getFormat(pattern:string):NumberFormat;
2548
+ /**
2549
+ * Parses the given text using the cached format matching the given pattern.
2550
+ * @param pattern -
2551
+ * @param text -
2552
+ * @return double
2553
+ */
2554
+ static parse(pattern:string, text:string):number;
2555
+ /**
2556
+ * Formats the specified number (or Java <b>long</b>, <b>BigInteger</b> or <b>BigDecimal</b> value) using the cached
2557
+ * format matching the given pattern string.
2558
+ * @param pattern -
2559
+ * @param number -
2560
+ * @return String
2561
+ */
2562
+ static format(pattern:string, number:number|dh.BigIntegerWrapper|dh.BigDecimalWrapper|dh.LongWrapper):string;
2563
+ /**
2564
+ * Parses the given text using this instance's pattern into a JS Number.
2565
+ * @param text -
2566
+ * @return double
2567
+ */
2568
+ parse(text:string):number;
2569
+ /**
2570
+ * Formats the specified number (or Java `long`, `BigInteger` or `BigDecimal` value) using this instance's pattern.
2571
+ * @param number -
2572
+ * @return String
2573
+ */
2574
+ format(number:number|dh.BigIntegerWrapper|dh.BigDecimalWrapper|dh.LongWrapper):string;
2575
+ toString():string;
2576
+ }
2577
+
2578
+
2579
+ /**
2580
+ * Largely an exported wrapper for the GWT DateFormat, but also includes support for formatting nanoseconds as an
2581
+ * additional 6 decimal places after the rest of the number.
2582
+ *
2583
+ * Other concerns that this handles includes accepting a js Date and ignoring the lack of nanos, accepting a js Number
2584
+ * and assuming it to be a lossy nano value, and parsing into a js Date.
2585
+ *
2586
+ *
2587
+ * Utility class to parse and format various date/time values, using the same format patterns as are supported by the
2588
+ * standard Java implementation used in the Deephaven server and swing client.
2589
+ *
2590
+ * As Deephaven internally uses nanosecond precision to record dates, this API expects nanoseconds in most use cases,
2591
+ * with the one exception of the JS `Date` type, which is not capable of more precision than milliseconds. Note,
2592
+ * however, that when passing nanoseconds as a JS `Number` there is likely to be some loss of precision, though this is
2593
+ * still supported for easier interoperability with other JS code. The values returned by `parse()` will be an opaque
2594
+ * object wrapping the full precision of the specified date, However, this object supports `toString()` and `valueOf()`
2595
+ * to return a string representation of that value, as well as a `asNumber()` to return a JS `Number` value and a
2596
+ * `asDate()` to return a JS `Date` value.
2597
+ *
2598
+ *
2599
+ * Caveats:
2600
+ *
2601
+ *
2602
+ * - The `D` format (for "day of year") is not supported by this implementation at this time. - The `%t` format for
2603
+ * short timezone code is not supported by this implementation at this time, though `z` will work as expected in the
2604
+ * browser to emit the user's own timezone.
2529
2605
  */
2530
- export class NumberFormat {
2606
+ export class DateTimeFormat {
2607
+ static readonly NANOS_PER_MILLI:number;
2608
+
2531
2609
  /**
2532
- * Creates a new number format instance. This generally should be avoided in favor of the static `getFormat`
2610
+ * Creates a new date/time format instance. This generally should be avoided in favor of the static `getFormat`
2533
2611
  * function, which will create and cache an instance so that later calls share the same instance.
2534
2612
  * @param pattern -
2535
2613
  */
2536
2614
  constructor(pattern:string);
2537
2615
 
2538
2616
  /**
2539
- * a number format instance matching the specified format. If this format has not been specified before, a new
2540
- * instance will be created and cached for later reuse. Prefer this method to calling the constructor directly to
2541
- * take advantage of caching
2617
+ *
2542
2618
  * @param pattern -
2543
- * @return dh.i18n.NumberFormat
2619
+ * @return a date format instance matching the specified format. If this format has not been specified before, a new
2620
+ * instance will be created and stored for later reuse.
2544
2621
  */
2545
- static getFormat(pattern:string):NumberFormat;
2622
+ static getFormat(pattern:string):DateTimeFormat;
2546
2623
  /**
2547
- * Parses the given text using the cached format matching the given pattern.
2624
+ * Accepts a variety of input objects to interpret as a date, and formats them using the specified pattern. A
2625
+ * `TimeZone` object can optionally be provided to format this date as the current date/time in that timezone.See
2626
+ * the instance method for more details on input objects.
2627
+ * @param pattern -
2628
+ * @param date -
2629
+ * @param timeZone -
2630
+ * @return
2631
+ */
2632
+ static format(pattern:string, date:any, timeZone?:TimeZone):string;
2633
+ /**
2634
+ * Parses the given input string using the provided pattern, and returns a JS `Date` object in milliseconds.
2548
2635
  * @param pattern -
2549
2636
  * @param text -
2550
- * @return double
2637
+ * @return
2551
2638
  */
2552
- static parse(pattern:string, text:string):number;
2639
+ static parseAsDate(pattern:string, text:string):Date;
2553
2640
  /**
2554
- * Formats the specified number (or Java <b>long</b>, <b>BigInteger</b> or <b>BigDecimal</b> value) using the cached
2555
- * format matching the given pattern string.
2641
+ * Parses the given input string using the provided pattern, and returns a wrapped Java `long` value in nanoseconds.
2642
+ * A `TimeZone` object can optionally be provided to parse to a desired timezone.
2556
2643
  * @param pattern -
2557
- * @param number -
2644
+ * @param text -
2645
+ * @param tz -
2646
+ * @return
2647
+ */
2648
+ static parse(pattern:string, text:string, tz?:TimeZone):dh.DateWrapper;
2649
+ /**
2650
+ * Takes a variety of objects to interpret as a date, and formats them using this instance's pattern. Inputs can
2651
+ * include a <b>String</b> value of a number expressed in nanoseconds, a <b>Number</b> value expressed in
2652
+ * nanoseconds, a JS <b>Date</b> object (necessarily in milliseconds), or a wrapped Java <b>long</b> value,
2653
+ * expressed in nanoseconds. A <b>TimeZone</b> object can optionally be provided to format this date as the current
2654
+ * date/time in that timezone.
2655
+ * @param date -
2656
+ * @param timeZone -
2558
2657
  * @return String
2559
2658
  */
2560
- static format(pattern:string, number:number|dh.BigIntegerWrapper|dh.BigDecimalWrapper|dh.LongWrapper):string;
2659
+ format(date:any, timeZone?:TimeZone):string;
2561
2660
  /**
2562
- * Parses the given text using this instance's pattern into a JS Number.
2661
+ * Parses the given string using this instance's pattern, and returns a wrapped Java <b>long</b> value in
2662
+ * nanoseconds. A <b>TimeZone</b> object can optionally be provided to parse to a desired timezone.
2563
2663
  * @param text -
2564
- * @return double
2664
+ * @param tz -
2665
+ * @return
2565
2666
  */
2566
- parse(text:string):number;
2667
+ parse(text:string, tz?:TimeZone):dh.DateWrapper;
2567
2668
  /**
2568
- * Formats the specified number (or Java `long`, `BigInteger` or `BigDecimal` value) using this instance's pattern.
2569
- * @param number -
2570
- * @return String
2669
+ * Parses the given string using this instance's pattern, and returns a JS <b>Date</b> object in milliseconds.
2670
+ * @param text -
2671
+ * @return
2571
2672
  */
2572
- format(number:number|dh.BigIntegerWrapper|dh.BigDecimalWrapper|dh.LongWrapper):string;
2673
+ parseAsDate(text:string):Date;
2573
2674
  toString():string;
2574
2675
  }
2575
2676
 
2576
-
2577
2677
  /**
2578
2678
  * Represents the timezones supported by Deephaven. Can be used to format dates, taking into account the offset changing
2579
2679
  * throughout the year (potentially changing each year). These instances mostly are useful at this time to pass to the
@@ -2682,176 +2782,13 @@ export namespace dh.i18n {
2682
2782
  * the timezone code that represents this `TimeZone`, usually the same key as was use to create this instance
2683
2783
  * @return String
2684
2784
  */
2685
- get id():string;
2686
- }
2687
-
2688
- /**
2689
- * Largely an exported wrapper for the GWT DateFormat, but also includes support for formatting nanoseconds as an
2690
- * additional 6 decimal places after the rest of the number.
2691
- *
2692
- * Other concerns that this handles includes accepting a js Date and ignoring the lack of nanos, accepting a js Number
2693
- * and assuming it to be a lossy nano value, and parsing into a js Date.
2694
- *
2695
- *
2696
- * Utility class to parse and format various date/time values, using the same format patterns as are supported by the
2697
- * standard Java implementation used in the Deephaven server and swing client.
2698
- *
2699
- * As Deephaven internally uses nanosecond precision to record dates, this API expects nanoseconds in most use cases,
2700
- * with the one exception of the JS `Date` type, which is not capable of more precision than milliseconds. Note,
2701
- * however, that when passing nanoseconds as a JS `Number` there is likely to be some loss of precision, though this is
2702
- * still supported for easier interoperability with other JS code. The values returned by `parse()` will be an opaque
2703
- * object wrapping the full precision of the specified date, However, this object supports `toString()` and `valueOf()`
2704
- * to return a string representation of that value, as well as a `asNumber()` to return a JS `Number` value and a
2705
- * `asDate()` to return a JS `Date` value.
2706
- *
2707
- *
2708
- * Caveats:
2709
- *
2710
- *
2711
- * - The `D` format (for "day of year") is not supported by this implementation at this time. - The `%t` format for
2712
- * short timezone code is not supported by this implementation at this time, though `z` will work as expected in the
2713
- * browser to emit the user's own timezone.
2714
- */
2715
- export class DateTimeFormat {
2716
- static readonly NANOS_PER_MILLI:number;
2717
-
2718
- /**
2719
- * Creates a new date/time format instance. This generally should be avoided in favor of the static `getFormat`
2720
- * function, which will create and cache an instance so that later calls share the same instance.
2721
- * @param pattern -
2722
- */
2723
- constructor(pattern:string);
2724
-
2725
- /**
2726
- *
2727
- * @param pattern -
2728
- * @return a date format instance matching the specified format. If this format has not been specified before, a new
2729
- * instance will be created and stored for later reuse.
2730
- */
2731
- static getFormat(pattern:string):DateTimeFormat;
2732
- /**
2733
- * Accepts a variety of input objects to interpret as a date, and formats them using the specified pattern. A
2734
- * `TimeZone` object can optionally be provided to format this date as the current date/time in that timezone.See
2735
- * the instance method for more details on input objects.
2736
- * @param pattern -
2737
- * @param date -
2738
- * @param timeZone -
2739
- * @return
2740
- */
2741
- static format(pattern:string, date:any, timeZone?:TimeZone):string;
2742
- /**
2743
- * Parses the given input string using the provided pattern, and returns a JS `Date` object in milliseconds.
2744
- * @param pattern -
2745
- * @param text -
2746
- * @return
2747
- */
2748
- static parseAsDate(pattern:string, text:string):Date;
2749
- /**
2750
- * Parses the given input string using the provided pattern, and returns a wrapped Java `long` value in nanoseconds.
2751
- * A `TimeZone` object can optionally be provided to parse to a desired timezone.
2752
- * @param pattern -
2753
- * @param text -
2754
- * @param tz -
2755
- * @return
2756
- */
2757
- static parse(pattern:string, text:string, tz?:TimeZone):dh.DateWrapper;
2758
- /**
2759
- * Takes a variety of objects to interpret as a date, and formats them using this instance's pattern. Inputs can
2760
- * include a <b>String</b> value of a number expressed in nanoseconds, a <b>Number</b> value expressed in
2761
- * nanoseconds, a JS <b>Date</b> object (necessarily in milliseconds), or a wrapped Java <b>long</b> value,
2762
- * expressed in nanoseconds. A <b>TimeZone</b> object can optionally be provided to format this date as the current
2763
- * date/time in that timezone.
2764
- * @param date -
2765
- * @param timeZone -
2766
- * @return String
2767
- */
2768
- format(date:any, timeZone?:TimeZone):string;
2769
- /**
2770
- * Parses the given string using this instance's pattern, and returns a wrapped Java <b>long</b> value in
2771
- * nanoseconds. A <b>TimeZone</b> object can optionally be provided to parse to a desired timezone.
2772
- * @param text -
2773
- * @param tz -
2774
- * @return
2775
- */
2776
- parse(text:string, tz?:TimeZone):dh.DateWrapper;
2777
- /**
2778
- * Parses the given string using this instance's pattern, and returns a JS <b>Date</b> object in milliseconds.
2779
- * @param text -
2780
- * @return
2781
- */
2782
- parseAsDate(text:string):Date;
2783
- toString():string;
2784
- }
2785
-
2786
- }
2787
-
2788
- export namespace dh.plot {
2789
-
2790
- /**
2791
- * Provides access to the data for displaying in a figure.
2792
- */
2793
- export interface Series {
2794
- readonly isLinesVisible?:boolean|null;
2795
- readonly pointLabelFormat?:string|null;
2796
- readonly yToolTipPattern?:string|null;
2797
- readonly shapeSize?:number|null;
2798
- readonly xToolTipPattern?:string|null;
2799
- readonly isShapesVisible?:boolean|null;
2800
-
2801
- subscribe(forceDisableDownsample?:DownsampleOptions):void;
2802
- /**
2803
- * Disable updates for this Series.
2804
- */
2805
- unsubscribe():void;
2806
- get shape():string;
2807
- /**
2808
- * Contains details on how to access data within the chart for this series. keyed with the way that this series uses
2809
- * the axis.
2810
- * @return {@link dh.plot.SeriesDataSource}
2811
- */
2812
- get sources():SeriesDataSource[];
2813
- get lineColor():string;
2814
- /**
2815
- * The plotting style to use for this series. See <b>SeriesPlotStyle</b> enum for more details.
2816
- * @return int
2817
- */
2818
- get plotStyle():SeriesPlotStyleType;
2819
- get oneClick():OneClick;
2820
- get gradientVisible():boolean;
2821
- get shapeColor():string;
2822
- /**
2823
- * The name for this series.
2824
- * @return String
2825
- */
2826
- get name():string;
2827
- /**
2828
- * indicates that this series belongs to a MultiSeries, null otherwise
2829
- * @return dh.plot.MultiSeries
2830
- */
2831
- get multiSeries():MultiSeries;
2832
- get shapeLabel():string;
2833
- }
2834
- export interface OneClick {
2835
- setValueForColumn(columnName:string, value:any):void;
2836
- getValueForColumn(columName:string):any;
2837
- get requireAllFiltersToDisplay():boolean;
2838
- get columns():dh.Column[];
2839
- }
2840
- /**
2841
- * Describes a template that will be used to make new series instances when a new table added to a plotBy.
2842
- */
2843
- export interface MultiSeries {
2844
- /**
2845
- * The name for this multi-series.
2846
- * @return String
2847
- */
2848
- get name():string;
2849
- /**
2850
- * The plotting style to use for the series that will be created. See <b>SeriesPlotStyle</b> enum for more details.
2851
- * @return int
2852
- */
2853
- get plotStyle():SeriesPlotStyleType;
2785
+ get id():string;
2854
2786
  }
2787
+
2788
+ }
2789
+
2790
+ export namespace dh.plot {
2791
+
2855
2792
  export interface FigureDataUpdatedEvent {
2856
2793
  getArray(series:Series, sourceType:number, mappingFunc?:(arg0:any)=>any):Array<any>;
2857
2794
  get series():Series[];
@@ -2925,6 +2862,21 @@ export namespace dh.plot {
2925
2862
  get minRange():number;
2926
2863
  }
2927
2864
  /**
2865
+ * Describes a template that will be used to make new series instances when a new table added to a plotBy.
2866
+ */
2867
+ export interface MultiSeries {
2868
+ /**
2869
+ * The name for this multi-series.
2870
+ * @return String
2871
+ */
2872
+ get name():string;
2873
+ /**
2874
+ * The plotting style to use for the series that will be created. See <b>SeriesPlotStyle</b> enum for more details.
2875
+ * @return int
2876
+ */
2877
+ get plotStyle():SeriesPlotStyleType;
2878
+ }
2879
+ /**
2928
2880
  * Describes how to access and display data required within a series.
2929
2881
  */
2930
2882
  export interface SeriesDataSource {
@@ -2944,64 +2896,74 @@ export namespace dh.plot {
2944
2896
  */
2945
2897
  get type():SourceTypeType;
2946
2898
  }
2947
-
2948
- export class FigureSourceException {
2949
- table:dh.Table;
2950
- source:SeriesDataSource;
2951
-
2952
- protected constructor();
2953
- }
2954
-
2955
- export class SourceDescriptor {
2956
- axis:AxisDescriptor;
2957
- table:dh.Table;
2958
- columnName:string;
2959
- type:string;
2960
-
2961
- constructor();
2962
- }
2963
-
2964
- export class SeriesDataSourceException {
2965
- protected constructor();
2966
-
2967
- get source():SeriesDataSource;
2968
- get message():string;
2969
- }
2970
-
2971
2899
  /**
2972
- * A descriptor used with JsFigureFactory.create to create a figure from JS.
2900
+ * Provides access to the data for displaying in a figure.
2973
2901
  */
2974
- export class FigureDescriptor {
2975
- title?:string|null;
2976
- titleFont?:string|null;
2977
- titleColor?:string|null;
2978
- isResizable?:boolean|null;
2979
- isDefaultTheme?:boolean|null;
2980
- updateInterval?:number|null;
2981
- cols?:number|null;
2982
- rows?:number|null;
2983
- charts:Array<ChartDescriptor>;
2902
+ export interface Series {
2903
+ readonly isLinesVisible?:boolean|null;
2904
+ readonly pointLabelFormat?:string|null;
2905
+ readonly yToolTipPattern?:string|null;
2906
+ readonly shapeSize?:number|null;
2907
+ readonly xToolTipPattern?:string|null;
2908
+ readonly isShapesVisible?:boolean|null;
2984
2909
 
2985
- constructor();
2910
+ subscribe(forceDisableDownsample?:DownsampleOptions):void;
2911
+ /**
2912
+ * Disable updates for this Series.
2913
+ */
2914
+ unsubscribe():void;
2915
+ get shape():string;
2916
+ /**
2917
+ * Contains details on how to access data within the chart for this series. keyed with the way that this series uses
2918
+ * the axis.
2919
+ * @return {@link dh.plot.SeriesDataSource}
2920
+ */
2921
+ get sources():SeriesDataSource[];
2922
+ get lineColor():string;
2923
+ /**
2924
+ * The plotting style to use for this series. See <b>SeriesPlotStyle</b> enum for more details.
2925
+ * @return int
2926
+ */
2927
+ get plotStyle():SeriesPlotStyleType;
2928
+ get oneClick():OneClick;
2929
+ get gradientVisible():boolean;
2930
+ get shapeColor():string;
2931
+ /**
2932
+ * The name for this series.
2933
+ * @return String
2934
+ */
2935
+ get name():string;
2936
+ /**
2937
+ * indicates that this series belongs to a MultiSeries, null otherwise
2938
+ * @return dh.plot.MultiSeries
2939
+ */
2940
+ get multiSeries():MultiSeries;
2941
+ get shapeLabel():string;
2942
+ }
2943
+ export interface OneClick {
2944
+ setValueForColumn(columnName:string, value:any):void;
2945
+ getValueForColumn(columName:string):any;
2946
+ get requireAllFiltersToDisplay():boolean;
2947
+ get columns():dh.Column[];
2986
2948
  }
2987
2949
 
2988
- /**
2989
- * Helper class for plot downsampling methods.
2990
- */
2991
- export class Downsample {
2992
- protected constructor();
2950
+ export class SeriesDescriptor {
2951
+ plotStyle:string;
2952
+ name?:string|null;
2953
+ linesVisible?:boolean|null;
2954
+ shapesVisible?:boolean|null;
2955
+ gradientVisible?:boolean|null;
2956
+ lineColor?:string|null;
2957
+ pointLabelFormat?:string|null;
2958
+ xToolTipPattern?:string|null;
2959
+ yToolTipPattern?:string|null;
2960
+ shapeLabel?:string|null;
2961
+ shapeSize?:number|null;
2962
+ shapeColor?:string|null;
2963
+ shape?:string|null;
2964
+ dataSources:Array<SourceDescriptor>;
2993
2965
 
2994
- /**
2995
- * Downsamples a table so that the data can be used for a time-series line plot. The downsampled table should have
2996
- * the same visual fidelity as the original table, but with fewer rows.
2997
- * @param table - The table to downsample.
2998
- * @param xCol - The name of the X column to downsample. Must be an Instant or long.
2999
- * @param yCols - The names of the Y columns to downsample.
3000
- * @param width - The width of the visible area in pixels.
3001
- * @param xRange - The visible range as `[start, end]` or null to always use all data.
3002
- * @return A promise that resolves to the downsampled table.
3003
- */
3004
- static runChartDownsample(table:dh.Table, xCol:string, yCols:string[], width:number, xRange?:dh.LongWrapper[]|undefined|null):Promise<dh.Table>;
2966
+ constructor();
3005
2967
  }
3006
2968
 
3007
2969
  /**
@@ -3021,50 +2983,6 @@ export namespace dh.plot {
3021
2983
  removeColumn(columnName:string, mappingFunc:(arg0:any)=>any):void;
3022
2984
  }
3023
2985
 
3024
- /**
3025
- * Provide the details for a chart.
3026
- */
3027
- export class Chart implements dh.HasEventHandling {
3028
- /**
3029
- * a new series was added to this chart as part of a multi-series. The series instance is the detail for this event.
3030
- */
3031
- static readonly EVENT_SERIES_ADDED:string;
3032
- /**
3033
- * The title of the chart.
3034
- * @return String
3035
- */
3036
- readonly title?:string|null;
3037
-
3038
- protected constructor();
3039
-
3040
- addEventListener<T>(name:string, callback:(e:CustomEvent<T>)=>void):()=>void;
3041
- nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<CustomEvent<T>>;
3042
- hasListeners(name:string):boolean;
3043
- removeEventListener<T>(name:string, callback:(e:CustomEvent<T>)=>void):boolean;
3044
- get column():number;
3045
- get showLegend():boolean;
3046
- /**
3047
- * The axes used in this chart.
3048
- * @return dh.plot.Axis
3049
- */
3050
- get axes():Axis[];
3051
- get is3d():boolean;
3052
- get titleFont():string;
3053
- get colspan():number;
3054
- get titleColor():string;
3055
- get series():Series[];
3056
- get rowspan():number;
3057
- /**
3058
- * The type of this chart, see <b>ChartType</b> enum for more details.
3059
- * @return int
3060
- */
3061
- get chartType():ChartTypeType;
3062
- get row():number;
3063
- get legendColor():string;
3064
- get legendFont():string;
3065
- get multiSeries():MultiSeries[];
3066
- }
3067
-
3068
2986
  /**
3069
2987
  * Provides the details for a figure.
3070
2988
  *
@@ -3185,6 +3103,56 @@ export namespace dh.plot {
3185
3103
  static create(config:FigureDescriptor):Promise<Figure>;
3186
3104
  }
3187
3105
 
3106
+ export class DownsampleOptions {
3107
+ /**
3108
+ * Max number of items in the series before DEFAULT will not attempt to load the series without downsampling. Above
3109
+ * this size if downsample fails or is not applicable, the series won't be loaded unless DISABLE is passed to
3110
+ * series.subscribe().
3111
+ */
3112
+ static MAX_SERIES_SIZE:number;
3113
+ /**
3114
+ * Max number of items in the series where the subscription will be allowed at all. Above this limit, even with
3115
+ * downsampling disabled, the series will not load data.
3116
+ */
3117
+ static MAX_SUBSCRIPTION_SIZE:number;
3118
+ /**
3119
+ * Flag to let the API decide what data will be available, based on the nature of the data, the series, and how the
3120
+ * axes are configured.
3121
+ */
3122
+ static readonly DEFAULT:DownsampleOptions;
3123
+ /**
3124
+ * Flat to entirely disable downsampling, and force all data to load, no matter how many items that would be, up to
3125
+ * the limit of MAX_SUBSCRIPTION_SIZE.
3126
+ */
3127
+ static readonly DISABLE:DownsampleOptions;
3128
+
3129
+ protected constructor();
3130
+ }
3131
+
3132
+ export class FigureFetchError {
3133
+ error:object;
3134
+ errors:Array<string>;
3135
+
3136
+ protected constructor();
3137
+ }
3138
+
3139
+ /**
3140
+ * A descriptor used with JsFigureFactory.create to create a figure from JS.
3141
+ */
3142
+ export class FigureDescriptor {
3143
+ title?:string|null;
3144
+ titleFont?:string|null;
3145
+ titleColor?:string|null;
3146
+ isResizable?:boolean|null;
3147
+ isDefaultTheme?:boolean|null;
3148
+ updateInterval?:number|null;
3149
+ cols?:number|null;
3150
+ rows?:number|null;
3151
+ charts:Array<ChartDescriptor>;
3152
+
3153
+ constructor();
3154
+ }
3155
+
3188
3156
  export class ChartDescriptor {
3189
3157
  colspan?:number|null;
3190
3158
  rowspan?:number|null;
@@ -3202,30 +3170,48 @@ export namespace dh.plot {
3202
3170
  constructor();
3203
3171
  }
3204
3172
 
3205
- export class SeriesDescriptor {
3206
- plotStyle:string;
3207
- name?:string|null;
3208
- linesVisible?:boolean|null;
3209
- shapesVisible?:boolean|null;
3210
- gradientVisible?:boolean|null;
3211
- lineColor?:string|null;
3212
- pointLabelFormat?:string|null;
3213
- xToolTipPattern?:string|null;
3214
- yToolTipPattern?:string|null;
3215
- shapeLabel?:string|null;
3216
- shapeSize?:number|null;
3217
- shapeColor?:string|null;
3218
- shape?:string|null;
3219
- dataSources:Array<SourceDescriptor>;
3220
-
3221
- constructor();
3222
- }
3223
-
3224
- export class FigureFetchError {
3225
- error:object;
3226
- errors:Array<string>;
3173
+ /**
3174
+ * Provide the details for a chart.
3175
+ */
3176
+ export class Chart implements dh.HasEventHandling {
3177
+ /**
3178
+ * a new series was added to this chart as part of a multi-series. The series instance is the detail for this event.
3179
+ */
3180
+ static readonly EVENT_SERIES_ADDED:string;
3181
+ /**
3182
+ * The title of the chart.
3183
+ * @return String
3184
+ */
3185
+ readonly title?:string|null;
3227
3186
 
3228
3187
  protected constructor();
3188
+
3189
+ addEventListener<T>(name:string, callback:(e:CustomEvent<T>)=>void):()=>void;
3190
+ nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<CustomEvent<T>>;
3191
+ hasListeners(name:string):boolean;
3192
+ removeEventListener<T>(name:string, callback:(e:CustomEvent<T>)=>void):boolean;
3193
+ get column():number;
3194
+ get showLegend():boolean;
3195
+ /**
3196
+ * The axes used in this chart.
3197
+ * @return dh.plot.Axis
3198
+ */
3199
+ get axes():Axis[];
3200
+ get is3d():boolean;
3201
+ get titleFont():string;
3202
+ get colspan():number;
3203
+ get titleColor():string;
3204
+ get series():Series[];
3205
+ get rowspan():number;
3206
+ /**
3207
+ * The type of this chart, see <b>ChartType</b> enum for more details.
3208
+ * @return int
3209
+ */
3210
+ get chartType():ChartTypeType;
3211
+ get row():number;
3212
+ get legendColor():string;
3213
+ get legendFont():string;
3214
+ get multiSeries():MultiSeries[];
3229
3215
  }
3230
3216
 
3231
3217
  export class AxisDescriptor {
@@ -3252,49 +3238,49 @@ export namespace dh.plot {
3252
3238
  constructor();
3253
3239
  }
3254
3240
 
3255
- export class DownsampleOptions {
3256
- /**
3257
- * Max number of items in the series before DEFAULT will not attempt to load the series without downsampling. Above
3258
- * this size if downsample fails or is not applicable, the series won't be loaded unless DISABLE is passed to
3259
- * series.subscribe().
3260
- */
3261
- static MAX_SERIES_SIZE:number;
3262
- /**
3263
- * Max number of items in the series where the subscription will be allowed at all. Above this limit, even with
3264
- * downsampling disabled, the series will not load data.
3265
- */
3266
- static MAX_SUBSCRIPTION_SIZE:number;
3267
- /**
3268
- * Flag to let the API decide what data will be available, based on the nature of the data, the series, and how the
3269
- * axes are configured.
3270
- */
3271
- static readonly DEFAULT:DownsampleOptions;
3272
- /**
3273
- * Flat to entirely disable downsampling, and force all data to load, no matter how many items that would be, up to
3274
- * the limit of MAX_SUBSCRIPTION_SIZE.
3275
- */
3276
- static readonly DISABLE:DownsampleOptions;
3277
-
3241
+ export class SeriesDataSourceException {
3278
3242
  protected constructor();
3243
+
3244
+ get source():SeriesDataSource;
3245
+ get message():string;
3246
+ }
3247
+
3248
+ export class SourceDescriptor {
3249
+ axis:AxisDescriptor;
3250
+ table:dh.Table;
3251
+ columnName:string;
3252
+ type:string;
3253
+
3254
+ constructor();
3279
3255
  }
3280
3256
 
3257
+ /**
3258
+ * Helper class for plot downsampling methods.
3259
+ */
3260
+ export class Downsample {
3261
+ protected constructor();
3281
3262
 
3282
- type AxisTypeType = number;
3283
- export class AxisType {
3284
- static readonly X:AxisTypeType;
3285
- static readonly Y:AxisTypeType;
3286
- static readonly SHAPE:AxisTypeType;
3287
- static readonly SIZE:AxisTypeType;
3288
- static readonly LABEL:AxisTypeType;
3289
- static readonly COLOR:AxisTypeType;
3263
+ /**
3264
+ * Downsamples a table so that the data can be used for a time-series line plot. The downsampled table should have
3265
+ * the same visual fidelity as the original table, but with fewer rows.
3266
+ * @param table - The table to downsample.
3267
+ * @param xCol - The name of the X column to downsample. Must be an Instant or long.
3268
+ * @param yCols - The names of the Y columns to downsample.
3269
+ * @param width - The width of the visible area in pixels.
3270
+ * @param xRange - The visible range as `[start, end]` or null to always use all data.
3271
+ * @return A promise that resolves to the downsampled table.
3272
+ */
3273
+ static runChartDownsample(table:dh.Table, xCol:string, yCols:string[], width:number, xRange?:dh.LongWrapper[]|undefined|null):Promise<dh.Table>;
3290
3274
  }
3291
3275
 
3292
- type AxisFormatTypeType = number;
3293
- export class AxisFormatType {
3294
- static readonly CATEGORY:AxisFormatTypeType;
3295
- static readonly NUMBER:AxisFormatTypeType;
3276
+ export class FigureSourceException {
3277
+ table:dh.Table;
3278
+ source:SeriesDataSource;
3279
+
3280
+ protected constructor();
3296
3281
  }
3297
3282
 
3283
+
3298
3284
  type AxisPositionType = number;
3299
3285
  export class AxisPosition {
3300
3286
  static readonly TOP:AxisPositionType;
@@ -3304,6 +3290,16 @@ export namespace dh.plot {
3304
3290
  static readonly NONE:AxisPositionType;
3305
3291
  }
3306
3292
 
3293
+ type AxisTypeType = number;
3294
+ export class AxisType {
3295
+ static readonly X:AxisTypeType;
3296
+ static readonly Y:AxisTypeType;
3297
+ static readonly SHAPE:AxisTypeType;
3298
+ static readonly SIZE:AxisTypeType;
3299
+ static readonly LABEL:AxisTypeType;
3300
+ static readonly COLOR:AxisTypeType;
3301
+ }
3302
+
3307
3303
  /**
3308
3304
  * This enum describes what kind of chart is being drawn. This may limit what kinds of series can be found on it, or how
3309
3305
  * those series should be rendered.
@@ -3319,6 +3315,28 @@ export namespace dh.plot {
3319
3315
  static readonly TREEMAP:ChartTypeType;
3320
3316
  }
3321
3317
 
3318
+ type SeriesPlotStyleType = number;
3319
+ export class SeriesPlotStyle {
3320
+ static readonly BAR:SeriesPlotStyleType;
3321
+ static readonly STACKED_BAR:SeriesPlotStyleType;
3322
+ static readonly LINE:SeriesPlotStyleType;
3323
+ static readonly AREA:SeriesPlotStyleType;
3324
+ static readonly STACKED_AREA:SeriesPlotStyleType;
3325
+ static readonly PIE:SeriesPlotStyleType;
3326
+ static readonly HISTOGRAM:SeriesPlotStyleType;
3327
+ static readonly OHLC:SeriesPlotStyleType;
3328
+ static readonly SCATTER:SeriesPlotStyleType;
3329
+ static readonly STEP:SeriesPlotStyleType;
3330
+ static readonly ERROR_BAR:SeriesPlotStyleType;
3331
+ static readonly TREEMAP:SeriesPlotStyleType;
3332
+ }
3333
+
3334
+ type AxisFormatTypeType = number;
3335
+ export class AxisFormatType {
3336
+ static readonly CATEGORY:AxisFormatTypeType;
3337
+ static readonly NUMBER:AxisFormatTypeType;
3338
+ }
3339
+
3322
3340
  /**
3323
3341
  * This enum describes the source it is in, and how this aspect of the data in the series should be used to render the
3324
3342
  * item. For example, a point in a error-bar plot might have a X value, three Y values (Y, Y_LOW, Y_HIGH), and some
@@ -3348,60 +3366,15 @@ export namespace dh.plot {
3348
3366
  static readonly HOVER_TEXT:SourceTypeType;
3349
3367
  }
3350
3368
 
3351
- type SeriesPlotStyleType = number;
3352
- export class SeriesPlotStyle {
3353
- static readonly BAR:SeriesPlotStyleType;
3354
- static readonly STACKED_BAR:SeriesPlotStyleType;
3355
- static readonly LINE:SeriesPlotStyleType;
3356
- static readonly AREA:SeriesPlotStyleType;
3357
- static readonly STACKED_AREA:SeriesPlotStyleType;
3358
- static readonly PIE:SeriesPlotStyleType;
3359
- static readonly HISTOGRAM:SeriesPlotStyleType;
3360
- static readonly OHLC:SeriesPlotStyleType;
3361
- static readonly SCATTER:SeriesPlotStyleType;
3362
- static readonly STEP:SeriesPlotStyleType;
3363
- static readonly ERROR_BAR:SeriesPlotStyleType;
3364
- static readonly TREEMAP:SeriesPlotStyleType;
3365
- }
3366
-
3367
3369
  }
3368
3370
 
3369
3371
  export namespace dh.lsp {
3370
3372
 
3371
- export class TextEdit {
3372
- range:Range;
3373
- text:string;
3374
-
3375
- constructor();
3376
- }
3377
-
3378
- export class CompletionItem {
3379
- label:string;
3380
- kind:number;
3381
- detail:string;
3382
- documentation:MarkupContent;
3383
- deprecated:boolean;
3384
- preselect:boolean;
3385
- textEdit:TextEdit;
3386
- sortText:string;
3387
- filterText:string;
3388
- insertTextFormat:number;
3389
- additionalTextEdits:Array<TextEdit>;
3390
- commitCharacters:Array<string>;
3391
-
3392
- constructor();
3393
- }
3394
-
3395
- export class Hover {
3396
- contents:MarkupContent;
3397
- range:Range;
3398
-
3399
- constructor();
3400
- }
3401
-
3402
- export class ParameterInformation {
3373
+ export class SignatureInformation {
3403
3374
  label:string;
3404
3375
  documentation:MarkupContent;
3376
+ parameters:Array<ParameterInformation>;
3377
+ activeParameter:number;
3405
3378
 
3406
3379
  constructor();
3407
3380
  }
@@ -3415,11 +3388,26 @@ export namespace dh.lsp {
3415
3388
  isInside(innerStart:Position, innerEnd:Position):boolean;
3416
3389
  }
3417
3390
 
3418
- export class SignatureInformation {
3391
+ export class MarkupContent {
3392
+ kind:string;
3393
+ value:string;
3394
+
3395
+ constructor();
3396
+ }
3397
+
3398
+ export class CompletionItem {
3419
3399
  label:string;
3400
+ kind:number;
3401
+ detail:string;
3420
3402
  documentation:MarkupContent;
3421
- parameters:Array<ParameterInformation>;
3422
- activeParameter:number;
3403
+ deprecated:boolean;
3404
+ preselect:boolean;
3405
+ textEdit:TextEdit;
3406
+ sortText:string;
3407
+ filterText:string;
3408
+ insertTextFormat:number;
3409
+ additionalTextEdits:Array<TextEdit>;
3410
+ commitCharacters:Array<string>;
3423
3411
 
3424
3412
  constructor();
3425
3413
  }
@@ -3437,9 +3425,16 @@ export namespace dh.lsp {
3437
3425
  copy():Position;
3438
3426
  }
3439
3427
 
3440
- export class MarkupContent {
3441
- kind:string;
3442
- value:string;
3428
+ export class Hover {
3429
+ contents:MarkupContent;
3430
+ range:Range;
3431
+
3432
+ constructor();
3433
+ }
3434
+
3435
+ export class ParameterInformation {
3436
+ label:string;
3437
+ documentation:MarkupContent;
3443
3438
 
3444
3439
  constructor();
3445
3440
  }
@@ -3452,22 +3447,18 @@ export namespace dh.lsp {
3452
3447
  constructor();
3453
3448
  }
3454
3449
 
3450
+ export class TextEdit {
3451
+ range:Range;
3452
+ text:string;
3453
+
3454
+ constructor();
3455
+ }
3456
+
3455
3457
  }
3456
3458
 
3459
+
3457
3460
  export namespace dh.calendar {
3458
3461
 
3459
- export interface Holiday {
3460
- /**
3461
- * The date of the Holiday.
3462
- * @return {@link dh.LocalDateWrapper}
3463
- */
3464
- get date():dh.LocalDateWrapper;
3465
- /**
3466
- * The business periods that are open on the holiday.
3467
- * @return dh.calendar.BusinessPeriod
3468
- */
3469
- get businessPeriods():Array<BusinessPeriod>;
3470
- }
3471
3462
  /**
3472
3463
  * Defines a calendar with business hours and holidays.
3473
3464
  */
@@ -3502,6 +3493,18 @@ export namespace dh.calendar {
3502
3493
  get close():string;
3503
3494
  get open():string;
3504
3495
  }
3496
+ export interface Holiday {
3497
+ /**
3498
+ * The date of the Holiday.
3499
+ * @return {@link dh.LocalDateWrapper}
3500
+ */
3501
+ get date():dh.LocalDateWrapper;
3502
+ /**
3503
+ * The business periods that are open on the holiday.
3504
+ * @return dh.calendar.BusinessPeriod
3505
+ */
3506
+ get businessPeriods():Array<BusinessPeriod>;
3507
+ }
3505
3508
 
3506
3509
  type DayOfWeekType = string;
3507
3510
  export class DayOfWeek {
@@ -3517,4 +3520,3 @@ export namespace dh.calendar {
3517
3520
  }
3518
3521
 
3519
3522
  }
3520
-