@deephaven/jsapi-types 1.0.0-dev0.33.2 → 1.0.0-dev0.34.0

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