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