@deephaven/jsapi-types 1.0.0-dev0.37.4 → 1.0.0-dev0.37.6

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