@deephaven/jsapi-types 1.0.0-dev0.39.2 → 1.0.0-dev0.39.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.d.ts +2064 -2088
  2. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -1,10 +1,6 @@
1
1
  // Minimum TypeScript Version: 4.3
2
2
  // Generated using com.vertispan.tsdefs.doclet.TsDoclet
3
3
 
4
- export interface IIterableResult<T> {
5
- value:T;
6
- done:boolean;
7
- }
8
4
  /**
9
5
  * This is part of EcmaScript 2015, documented here for completeness. It supports a single method, <b>next()</b>, which
10
6
  * returns an object with a <b>boolean</b> named <b>done</b> (true if there are no more items to return; false
@@ -15,23 +11,12 @@ export interface Iterator<T> {
15
11
  hasNext():boolean;
16
12
  next():IIterableResult<T>;
17
13
  }
14
+ export interface IIterableResult<T> {
15
+ value:T;
16
+ done:boolean;
17
+ }
18
18
  export namespace dh.storage {
19
19
 
20
- /**
21
- * Storage service metadata about files and folders.
22
- */
23
- export class ItemDetails {
24
- protected constructor();
25
-
26
- toString():string;
27
- get filename():string;
28
- get basename():string;
29
- get size():number;
30
- get etag():string;
31
- get type():ItemTypeType;
32
- get dirname():string;
33
- }
34
-
35
20
  /**
36
21
  * Represents a file's contents loaded from the server. If an etag was specified when loading, client should first test
37
22
  * if the etag of this instance matches - if so, the contents will be empty, and the client's existing contents should
@@ -48,6 +33,21 @@ export namespace dh.storage {
48
33
  get etag():string;
49
34
  }
50
35
 
36
+ /**
37
+ * Storage service metadata about files and folders.
38
+ */
39
+ export class ItemDetails {
40
+ protected constructor();
41
+
42
+ toString():string;
43
+ get filename():string;
44
+ get basename():string;
45
+ get size():number;
46
+ get etag():string;
47
+ get type():ItemTypeType;
48
+ get dirname():string;
49
+ }
50
+
51
51
  /**
52
52
  * Remote service to read and write files on the server. Paths use "/" as a separator, and should not start with "/".
53
53
  */
@@ -115,131 +115,121 @@ export namespace dh.storage {
115
115
 
116
116
  }
117
117
 
118
- export namespace dh {
118
+ export namespace dh.ide {
119
119
 
120
120
  /**
121
- * Similar to the browser `CustomEvent` type, this class holds only the type of the event, and optionally some
122
- * details about the event.
123
- * @typeParam T - the type of the event detail
121
+ * Indicates the result of code run on the server.
124
122
  */
125
- export interface Event<T> {
126
- get detail():T;
127
- get type():string;
123
+ export interface CommandResult {
124
+ /**
125
+ * Describes changes made in the course of this command.
126
+ * @return {@link dh.ide.VariableChanges}.
127
+ */
128
+ get changes():VariableChanges;
129
+ /**
130
+ * If the command failed, the error message will be provided here.
131
+ * @return String
132
+ */
133
+ get error():string;
128
134
  }
129
135
  /**
130
- * Represents statistics for a given table column.
136
+ * Represents a serialized fishlib LogRecord, suitable for display on javascript clients. A log entry sent from the
137
+ * server.
131
138
  */
132
- export interface ColumnStatistics {
139
+ export interface LogItem {
133
140
  /**
134
- * Gets the type of formatting that should be used for given statistic.
135
- * <p>
136
- * the format type for a statistic. A null return value means that the column formatting should be used.
137
- * @param name - the display name of the statistic
141
+ * The level of the log message, enabling the client to ignore messages.
138
142
  * @return String
139
143
  */
140
- getType(name:string):string;
144
+ get logLevel():string;
141
145
  /**
142
- * 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
143
- * name to the count of how many times it occurred in the column. This map will be empty for tables containing more
144
- * than 19 unique values.
145
- * @return Map of String double
146
+ * Timestamp of the message in microseconds since Jan 1, 1970 UTC.
147
+ * @return double
146
148
  */
147
- get uniqueValues():Map<string, number>;
149
+ get micros():number;
148
150
  /**
149
- * Gets a map with the display name of statistics as keys and the numeric stat as a value.
150
- * <p>
151
- * A map of each statistic's name to its value.
152
- * @return Map of String and Object
151
+ * The log message written on the server.
152
+ * @return String
153
153
  */
154
- get statisticsMap():Map<string, object>;
154
+ get message():string;
155
155
  }
156
- export interface HasEventHandling {
156
+ /**
157
+ * Specifies a type and either id or name (but not both).
158
+ */
159
+ export interface VariableDescriptor {
160
+ type:string;
161
+ id?:string|null;
162
+ name?:string|null;
163
+ }
164
+ /**
165
+ * A format to describe a variable available to be read from the server. Application fields are optional, and only
166
+ * populated when a variable is provided by application mode.
167
+ * <p>
168
+ * APIs which take a VariableDefinition must at least be provided an object with a <b>type</b> and <b>id</b> field.
169
+ */
170
+ export interface VariableDefinition {
171
+ get name():string;
157
172
  /**
158
- * Listen for events on this object.
159
- * @param name - the name of the event to listen for
160
- * @param callback - a function to call when the event occurs
161
- * @return Returns a cleanup function.
162
- * @typeParam T - the type of the data that the event will provide
173
+ * Optional description for the variable's contents, typically used to provide more detail that wouldn't be
174
+ * reasonable to put in the title
175
+ * @return String
163
176
  */
164
- addEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):()=>void;
165
- nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<Event<T>>;
166
- hasListeners(name:string):boolean;
177
+ get description():string;
167
178
  /**
168
- * Removes an event listener added to this table.
169
- * @param name -
170
- * @param callback -
171
- * @return
172
- * @typeParam T -
179
+ * An opaque identifier for this variable
180
+ * @return String
173
181
  */
174
- removeEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):boolean;
175
- }
176
- export interface WorkerHeapInfo {
182
+ get id():string;
177
183
  /**
178
- * Total heap size available for this worker.
184
+ * The type of the variable, one of <b>dh.VariableType</b>
185
+ * @return dh.VariableType.
179
186
  */
180
- get totalHeapSize():number;
181
- get freeMemory():number;
182
- get maximumHeapSize():number;
183
- }
184
- /**
185
- * Row implementation that also provides additional read-only properties. represents visible rows in the table, but
186
- * with additional properties to reflect the tree structure.
187
- */
188
- export interface TreeRow extends Row {
189
- get(column:Column):any;
190
- getFormat(column:Column):Format;
187
+ get type():dh.VariableTypeType;
191
188
  /**
192
- * True if this node is currently expanded to show its children; false otherwise. Those children will be the
193
- * rows below this one with a greater depth than this one.
194
- * @return boolean
189
+ * The name of the variable, to be used when rendering it to a user
190
+ * @return String
195
191
  */
196
- get isExpanded():boolean;
192
+ get title():string;
197
193
  /**
198
- * The number of levels above this node; zero for top level nodes. Generally used by the UI to indent the row
199
- * and its expand/collapse icon.
200
- * @return int
194
+ * Optional description for the variable's contents, typically used to provide more detail that wouldn't be
195
+ * reasonable to put in the title
196
+ * @return String
201
197
  */
202
- get depth():number;
198
+ get applicationId():string;
203
199
  /**
204
- * True if this node has children and can be expanded; false otherwise. Note that this value may change when the
205
- * table updates, depending on the table's configuration.
206
- * @return boolean
200
+ * The name of the application which provided this variable
201
+ * @return String
207
202
  */
208
- get hasChildren():boolean;
209
- get index():LongWrapper;
203
+ get applicationName():string;
210
204
  }
211
205
  /**
212
- * Represents the contents of a single widget data message from the server, with a binary data paylod and exported
213
- * objects. Implemented both by Widget itself and by the `event.details` when data is received by the client.
214
- *
215
- * Terminology note: the name of this type should probably use "Data" instead of "Message", and the methods should use
216
- * "payload" rather than "data" to match other platforms and the protobuf itself. These names are instead used for
217
- * backwards compatibility and to better follow JS expectations.
206
+ * Describes changes in the current set of variables in the script session. Note that variables that changed value
207
+ * without changing type will be included as <b>updated</b>, but if a new value with one type replaces an old value with
208
+ * a different type, this will be included as an entry in both <b>removed</b> and <b>created</b> to indicate the old and
209
+ * new types.
218
210
  */
219
- export interface WidgetMessageDetails {
220
- /**
221
- * Returns the data from this message as a base64-encoded string.
222
- */
223
- getDataAsBase64():string;
211
+ export interface VariableChanges {
224
212
  /**
225
- * Returns the data from this message as a Uint8Array.
213
+ *
214
+ * @return The variables that no longer exist after this operation, or were replaced by some variable with a
215
+ * different type.
226
216
  */
227
- getDataAsU8():Uint8Array;
217
+ get removed():Array<VariableDefinition>;
228
218
  /**
229
- * Returns the data from this message as a utf-8 string.
219
+ *
220
+ * @return The variables that were created by this operation, or have a new type.
230
221
  */
231
- getDataAsString():string;
222
+ get created():Array<VariableDefinition>;
232
223
  /**
233
- * Returns an array of exported objects sent from the server. The plugin implementation is now responsible for these
234
- * objects, and should close them when no longer needed.
224
+ *
225
+ * @return The variables that changed value during this operation.
235
226
  */
236
- get exportedObjects():WidgetExportedObject[];
237
- }
238
- export interface ColumnGroup {
239
- get name():string|null;
240
- get children():string[]|null;
241
- get color():string|null;
227
+ get updated():Array<VariableDefinition>;
242
228
  }
229
+ }
230
+
231
+ export namespace dh {
232
+
243
233
  /**
244
234
  * This object may be pooled internally or discarded and not updated. Do not retain references to it.
245
235
  */
@@ -265,27 +255,164 @@ export namespace dh {
265
255
  */
266
256
  readonly numberFormat?:string|null;
267
257
  }
258
+ export interface WorkerHeapInfo {
259
+ /**
260
+ * Total heap size available for this worker.
261
+ */
262
+ get totalHeapSize():number;
263
+ get freeMemory():number;
264
+ get maximumHeapSize():number;
265
+ }
268
266
  /**
269
- * Event data, describing the indexes that were added/removed/updated, and providing access to Rows (and thus data in
270
- * columns) either by index, or scanning the complete present index.
271
- * <p>
272
- * This class supports two ways of reading the table - checking the changes made since the last update, and reading all
273
- * data currently in the table. While it is more expensive to always iterate over every single row in the table, it may
274
- * in some cases actually be cheaper than maintaining state separately and updating only the changes, though both
275
- * options should be considered.
276
- * <p>
277
- * The RangeSet objects allow iterating over the LongWrapper indexes in the table. Note that these "indexes" are not
278
- * necessarily contiguous and may be negative, and represent some internal state on the server, allowing it to keep
279
- * track of data efficiently. Those LongWrapper objects can be passed to the various methods on this instance to read
280
- * specific rows or cells out of the table.
267
+ * Behaves like a Table, but doesn't expose all of its API for changing the internal state. Instead, state is driven by
268
+ * the upstream table - when it changes handle, this listens and updates its own handle accordingly.
269
+ *
270
+ * Additionally, this is automatically subscribed to its one and only row, across all columns.
271
+ *
272
+ * A new config is returned any time it is accessed, to prevent accidental mutation, and to allow it to be used as a
273
+ * template when fetching a new totals table, or changing the totals table in use.
274
+ *
275
+ * A simplistic Table, providing access to aggregation of the table it is sourced from. This table is always
276
+ * automatically subscribed to its parent, and adopts changes automatically from it. This class has limited methods
277
+ * found on Table. Instances of this type always have a size of one when no groupBy is set on the config, but may
278
+ * potentially contain as few as zero rows, or as many as the parent table if each row gets its own group.
279
+ *
280
+ * When using the `groupBy` feature, it may be desireable to also provide a row to the user with all values across all
281
+ * rows. To achieve this, request the same Totals Table again, but remove the `groupBy` setting.
281
282
  */
282
- export interface SubscriptionTableData extends TableData {
283
- get fullIndex():RangeSet;
283
+ export interface TotalsTable extends JoinableTable {
284
284
  /**
285
- * The ordered set of row indexes removed since the last update
286
- * @return the rangeset of removed rows
285
+ * Specifies the range of items to pass to the client and update as they change. If the columns parameter is not
286
+ * provided, all columns will be used. Until this is called, no data will be available. Invoking this will result in
287
+ * events to be fired once data becomes available, starting with an <b>updated</b> event and one <b>rowadded</b>
288
+ * event per row in that range.
289
+ * @param firstRow -
290
+ * @param lastRow -
291
+ * @param columns -
292
+ * @param updateIntervalMs -
287
293
  */
288
- get removed():RangeSet;
294
+ setViewport(firstRow:number, lastRow:number, columns?:Array<Column>, updateIntervalMs?:number, isReverseViewport?:boolean|undefined|null):void;
295
+ /**
296
+ * the currently visible viewport. If the current set of operations has not yet resulted in data, it will not
297
+ * resolve until that data is ready.
298
+ * @return Promise of {@link dh.TableData}
299
+ */
300
+ getViewportData():Promise<ViewportData>;
301
+ /**
302
+ * a column by the given name. You should prefer to always retrieve a new Column instance instead of caching a
303
+ * returned value.
304
+ * @param key -
305
+ * @return {@link dh.Column}
306
+ */
307
+ findColumn(key:string):Column;
308
+ /**
309
+ * multiple columns specified by the given names.
310
+ * @param keys -
311
+ * @return {@link dh.Column} array
312
+ */
313
+ findColumns(keys:string[]):Column[];
314
+ /**
315
+ * Indicates that the table will no longer be used, and resources used to provide it can be freed up on the server.
316
+ */
317
+ close():void;
318
+ addEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):()=>void;
319
+ removeEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):boolean;
320
+ nextEvent<T>(eventName:string, timeoutInMillis:number):Promise<Event<T>>;
321
+ hasListeners(name:string):boolean;
322
+ /**
323
+ * Replace the currently set sort on this table. Returns the previously set value. Note that the sort property will
324
+ * immediately return the new value, but you may receive update events using the old sort before the new sort is
325
+ * applied, and the <b>sortchanged</b> event fires. Reusing existing, applied sorts may enable this to perform
326
+ * better on the server. The <b>updated</b> event will also fire, but <b>rowadded</b> and <b>rowremoved</b> will
327
+ * not.
328
+ * @param sort -
329
+ * @return {@link dh.Sort} array
330
+ */
331
+ applySort(sort:Sort[]):Array<Sort>;
332
+ /**
333
+ * Replace the current custom columns with a new set. These columns can be used when adding new filter and sort
334
+ * operations to the table, as long as they are present.
335
+ * @param customColumns -
336
+ * @return
337
+ */
338
+ applyCustomColumns(customColumns:Array<string|CustomColumn>):Array<CustomColumn>;
339
+ /**
340
+ * Replace the currently set filters on the table. Returns the previously set value. Note that the filter property
341
+ * will immediately return the new value, but you may receive update events using the old filter before the new one
342
+ * is applied, and the <b>filterchanged</b> event fires. Reusing existing, applied filters may enable this to
343
+ * perform better on the server. The <b>updated</b> event will also fire, but <b>rowadded</b> and <b>rowremoved</b>
344
+ * will not.
345
+ * @param filter -
346
+ * @return {@link dh.FilterCondition} array
347
+ */
348
+ applyFilter(filter:FilterCondition[]):Array<FilterCondition>;
349
+ /**
350
+ * An ordered list of Filters to apply to the table. To update, call applyFilter(). Note that this getter will
351
+ * return the new value immediately, even though it may take a little time to update on the server. You may listen
352
+ * for the <b>filterchanged</b> event to know when to update the UI.
353
+ * @return {@link dh.FilterCondition} array
354
+ */
355
+ get filter():Array<FilterCondition>;
356
+ /**
357
+ * True if this table has been closed.
358
+ * @return boolean
359
+ */
360
+ get isClosed():boolean;
361
+ /**
362
+ * The total number of rows in this table. This may change as the base table's configuration, filter, or contents
363
+ * change.
364
+ * @return double
365
+ */
366
+ get size():number;
367
+ /**
368
+ * The columns present on this table. Note that this may not include all columns in the parent table, and in cases
369
+ * where a given column has more than one aggregation applied, the column name will have a suffix indicating the
370
+ * aggregation used. This suffixed name will be of the form <b>columnName + '__' + aggregationName</b>.
371
+ * @return {@link dh.Column} array
372
+ */
373
+ get columns():Array<Column>;
374
+ get totalsTableConfig():TotalsTableConfig;
375
+ /**
376
+ * An ordered list of Sorts to apply to the table. To update, call applySort(). Note that this getter will return
377
+ * the new value immediately, even though it may take a little time to update on the server. You may listen for the
378
+ * <b>sortchanged</b> event to know when to update the UI.
379
+ * @return {@link dh.Sort} array
380
+ */
381
+ get sort():Array<Sort>;
382
+ /**
383
+ * Read-only. An ordered list of custom column formulas to add to the table, either adding new columns or replacing
384
+ * existing ones. To update, call <b>applyCustomColumns()</b>.
385
+ * @return {@link dh.CustomColumn} array
386
+ */
387
+ get customColumns():Array<CustomColumn>;
388
+ /**
389
+ * True if this table may receive updates from the server, including size changed events, updated events after
390
+ * initial snapshot.
391
+ * @return boolean
392
+ */
393
+ get isRefreshing():boolean;
394
+ }
395
+ /**
396
+ * Event data, describing the indexes that were added/removed/updated, and providing access to Rows (and thus data in
397
+ * columns) either by index, or scanning the complete present index.
398
+ * <p>
399
+ * This class supports two ways of reading the table - checking the changes made since the last update, and reading all
400
+ * data currently in the table. While it is more expensive to always iterate over every single row in the table, it may
401
+ * in some cases actually be cheaper than maintaining state separately and updating only the changes, though both
402
+ * options should be considered.
403
+ * <p>
404
+ * The RangeSet objects allow iterating over the LongWrapper indexes in the table. Note that these "indexes" are not
405
+ * necessarily contiguous and may be negative, and represent some internal state on the server, allowing it to keep
406
+ * track of data efficiently. Those LongWrapper objects can be passed to the various methods on this instance to read
407
+ * specific rows or cells out of the table.
408
+ */
409
+ export interface SubscriptionTableData extends TableData {
410
+ get fullIndex():RangeSet;
411
+ /**
412
+ * The ordered set of row indexes removed since the last update
413
+ * @return the rangeset of removed rows
414
+ */
415
+ get removed():RangeSet;
289
416
  /**
290
417
  * The ordered set of row indexes added since the last update.
291
418
  * @return the rangeset of rows added
@@ -395,6 +522,16 @@ export namespace dh {
395
522
  */
396
523
  naturalJoin(rightTable:JoinableTable, columnsToMatch:Array<string>, columnsToAdd?:Array<string>|undefined|null):Promise<Table>;
397
524
  }
525
+ export interface LayoutHints {
526
+ readonly searchDisplayMode?:SearchDisplayModeType|null;
527
+
528
+ get hiddenColumns():string[]|null;
529
+ get frozenColumns():string[]|null;
530
+ get columnGroups():ColumnGroup[]|null;
531
+ get areSavedLayoutsAllowed():boolean;
532
+ get frontColumns():string[]|null;
533
+ get backColumns():string[]|null;
534
+ }
398
535
  /**
399
536
  * Similar to {@link dh.ViewportData}, but with additional properties to reflect
400
537
  * the tree structure.
@@ -412,6 +549,70 @@ export namespace dh {
412
549
  get rows():Array<TreeRow>;
413
550
  }
414
551
  /**
552
+ * Row implementation that also provides additional read-only properties. represents visible rows in the table, but
553
+ * with additional properties to reflect the tree structure.
554
+ */
555
+ export interface TreeRow extends Row {
556
+ get(column:Column):any;
557
+ getFormat(column:Column):Format;
558
+ /**
559
+ * True if this node is currently expanded to show its children; false otherwise. Those children will be the
560
+ * rows below this one with a greater depth than this one.
561
+ * @return boolean
562
+ */
563
+ get isExpanded():boolean;
564
+ /**
565
+ * The number of levels above this node; zero for top level nodes. Generally used by the UI to indent the row
566
+ * and its expand/collapse icon.
567
+ * @return int
568
+ */
569
+ get depth():number;
570
+ /**
571
+ * True if this node has children and can be expanded; false otherwise. Note that this value may change when the
572
+ * table updates, depending on the table's configuration.
573
+ * @return boolean
574
+ */
575
+ get hasChildren():boolean;
576
+ get index():LongWrapper;
577
+ }
578
+ /**
579
+ * Represents a row available in a subscription/snapshot on the client. Do not retain references to rows - they will
580
+ * not function properly when the event isn't actively going off (or promise resolving). Instead, wait for the next
581
+ * event, or re-request the viewport data.
582
+ */
583
+ export interface Row {
584
+ get(column:Column):any;
585
+ getFormat(column:Column):Format;
586
+ get index():LongWrapper;
587
+ }
588
+ /**
589
+ * Represents the contents of a single widget data message from the server, with a binary data paylod and exported
590
+ * objects. Implemented both by Widget itself and by the `event.details` when data is received by the client.
591
+ *
592
+ * Terminology note: the name of this type should probably use "Data" instead of "Message", and the methods should use
593
+ * "payload" rather than "data" to match other platforms and the protobuf itself. These names are instead used for
594
+ * backwards compatibility and to better follow JS expectations.
595
+ */
596
+ export interface WidgetMessageDetails {
597
+ /**
598
+ * Returns the data from this message as a base64-encoded string.
599
+ */
600
+ getDataAsBase64():string;
601
+ /**
602
+ * Returns the data from this message as a Uint8Array.
603
+ */
604
+ getDataAsU8():Uint8Array;
605
+ /**
606
+ * Returns the data from this message as a utf-8 string.
607
+ */
608
+ getDataAsString():string;
609
+ /**
610
+ * Returns an array of exported objects sent from the server. The plugin implementation is now responsible for these
611
+ * objects, and should close them when no longer needed.
612
+ */
613
+ get exportedObjects():WidgetExportedObject[];
614
+ }
615
+ /**
415
616
  * Represents a server-side object that may not yet have been fetched by the client. When this object will no longer be
416
617
  * used, if {@link fetch} is not called on this object, then {@link close} must be to ensure server-side resources
417
618
  * are correctly freed.
@@ -443,27 +644,6 @@ export namespace dh {
443
644
  */
444
645
  close():void;
445
646
  }
446
- export interface LayoutHints {
447
- readonly searchDisplayMode?:SearchDisplayModeType|null;
448
-
449
- get hiddenColumns():string[]|null;
450
- get frozenColumns():string[]|null;
451
- get columnGroups():ColumnGroup[]|null;
452
- get areSavedLayoutsAllowed():boolean;
453
- get frontColumns():string[]|null;
454
- get backColumns():string[]|null;
455
- }
456
- /**
457
- * Wrap LocalTime values for use in JS. Provides text formatting for display and access to the underlying value.
458
- */
459
- export interface LocalTimeWrapper {
460
- valueOf():string;
461
- getHour():number;
462
- getMinute():number;
463
- getSecond():number;
464
- getNano():number;
465
- toString():string;
466
- }
467
647
  /**
468
648
  * This object may be pooled internally or discarded and not updated. Do not retain references to it. Instead,
469
649
  * request the viewport again.
@@ -474,153 +654,99 @@ export namespace dh {
474
654
  get index():LongWrapper;
475
655
  }
476
656
  /**
477
- * Wrap LocalDate values for use in JS. Provides text formatting for display and access to the underlying value.
657
+ * Represents statistics for a given table column.
478
658
  */
479
- export interface LocalDateWrapper {
659
+ export interface ColumnStatistics {
660
+ /**
661
+ * Gets the type of formatting that should be used for given statistic.
662
+ * <p>
663
+ * the format type for a statistic. A null return value means that the column formatting should be used.
664
+ * @param name - the display name of the statistic
665
+ * @return String
666
+ */
667
+ getType(name:string):string;
668
+ /**
669
+ * 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
670
+ * name to the count of how many times it occurred in the column. This map will be empty for tables containing more
671
+ * than 19 unique values.
672
+ * @return Map of String double
673
+ */
674
+ get uniqueValues():Map<string, number>;
675
+ /**
676
+ * Gets a map with the display name of statistics as keys and the numeric stat as a value.
677
+ * <p>
678
+ * A map of each statistic's name to its value.
679
+ * @return Map of String and Object
680
+ */
681
+ get statisticsMap():Map<string, object>;
682
+ }
683
+ /**
684
+ * Wrap LocalTime values for use in JS. Provides text formatting for display and access to the underlying value.
685
+ */
686
+ export interface LocalTimeWrapper {
480
687
  valueOf():string;
481
- getYear():number;
482
- getMonthValue():number;
483
- getDayOfMonth():number;
688
+ getHour():number;
689
+ getMinute():number;
690
+ getSecond():number;
691
+ getNano():number;
484
692
  toString():string;
485
693
  }
486
694
  /**
487
- * Represents a row available in a subscription/snapshot on the client. Do not retain references to rows - they will
488
- * not function properly when the event isn't actively going off (or promise resolving). Instead, wait for the next
489
- * event, or re-request the viewport data.
490
- */
491
- export interface Row {
492
- get(column:Column):any;
493
- getFormat(column:Column):Format;
494
- get index():LongWrapper;
495
- }
496
- /**
497
- * Behaves like a Table, but doesn't expose all of its API for changing the internal state. Instead, state is driven by
498
- * the upstream table - when it changes handle, this listens and updates its own handle accordingly.
499
- *
500
- * Additionally, this is automatically subscribed to its one and only row, across all columns.
501
- *
502
- * A new config is returned any time it is accessed, to prevent accidental mutation, and to allow it to be used as a
503
- * template when fetching a new totals table, or changing the totals table in use.
504
- *
505
- * A simplistic Table, providing access to aggregation of the table it is sourced from. This table is always
506
- * automatically subscribed to its parent, and adopts changes automatically from it. This class has limited methods
507
- * found on Table. Instances of this type always have a size of one when no groupBy is set on the config, but may
508
- * potentially contain as few as zero rows, or as many as the parent table if each row gets its own group.
509
- *
510
- * When using the `groupBy` feature, it may be desireable to also provide a row to the user with all values across all
511
- * rows. To achieve this, request the same Totals Table again, but remove the `groupBy` setting.
695
+ * Extends {@link dh.TableData}, but only contains data in the current viewport. The only API change from TableData is that
696
+ * ViewportData also contains the offset to this data, so that the actual row number may be determined.
697
+ * <p>
698
+ * For viewport subscriptions, it is not necessary to read with the key, only with the position.
699
+ * <p>
700
+ * Do not assume that the first row in `rows` is the first visible row, because extra rows may be provided for easier
701
+ * scrolling without going to the server.
512
702
  */
513
- export interface TotalsTable extends JoinableTable {
514
- /**
515
- * Specifies the range of items to pass to the client and update as they change. If the columns parameter is not
516
- * provided, all columns will be used. Until this is called, no data will be available. Invoking this will result in
517
- * events to be fired once data becomes available, starting with an <b>updated</b> event and one <b>rowadded</b>
518
- * event per row in that range.
519
- * @param firstRow -
520
- * @param lastRow -
521
- * @param columns -
522
- * @param updateIntervalMs -
523
- */
524
- setViewport(firstRow:number, lastRow:number, columns?:Array<Column>, updateIntervalMs?:number, isReverseViewport?:boolean|undefined|null):void;
525
- /**
526
- * the currently visible viewport. If the current set of operations has not yet resulted in data, it will not
527
- * resolve until that data is ready.
528
- * @return Promise of {@link dh.TableData}
529
- */
530
- getViewportData():Promise<ViewportData>;
703
+ export interface ViewportData extends TableData {
531
704
  /**
532
- * a column by the given name. You should prefer to always retrieve a new Column instance instead of caching a
533
- * returned value.
534
- * @param key -
535
- * @return {@link dh.Column}
705
+ * Reads a row object from the viewport, based on its position in the table.
536
706
  */
537
- findColumn(key:string):Column;
707
+ get(index:LongWrapper|number):ViewportRow;
708
+ getData(index:LongWrapper|number, column:Column):any;
709
+ getFormat(index:LongWrapper|number, column:Column):Format;
538
710
  /**
539
- * multiple columns specified by the given names.
540
- * @param keys -
541
- * @return {@link dh.Column} array
711
+ * The position of the first returned row within the table.
542
712
  */
543
- findColumns(keys:string[]):Column[];
713
+ get offset():number;
714
+ get columns():Array<Column>;
715
+ get rows():Array<ViewportRow>;
716
+ }
717
+ export interface ColumnGroup {
718
+ get name():string|null;
719
+ get children():string[]|null;
720
+ get color():string|null;
721
+ }
722
+ export interface HasEventHandling {
544
723
  /**
545
- * Indicates that the table will no longer be used, and resources used to provide it can be freed up on the server.
724
+ * Listen for events on this object.
725
+ * @param name - the name of the event to listen for
726
+ * @param callback - a function to call when the event occurs
727
+ * @return Returns a cleanup function.
728
+ * @typeParam T - the type of the data that the event will provide
546
729
  */
547
- close():void;
548
730
  addEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):()=>void;
549
- removeEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):boolean;
550
- nextEvent<T>(eventName:string, timeoutInMillis:number):Promise<Event<T>>;
731
+ nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<Event<T>>;
551
732
  hasListeners(name:string):boolean;
552
733
  /**
553
- * Replace the currently set sort on this table. Returns the previously set value. Note that the sort property will
554
- * immediately return the new value, but you may receive update events using the old sort before the new sort is
555
- * applied, and the <b>sortchanged</b> event fires. Reusing existing, applied sorts may enable this to perform
556
- * better on the server. The <b>updated</b> event will also fire, but <b>rowadded</b> and <b>rowremoved</b> will
557
- * not.
558
- * @param sort -
559
- * @return {@link dh.Sort} array
560
- */
561
- applySort(sort:Sort[]):Array<Sort>;
562
- /**
563
- * Replace the current custom columns with a new set. These columns can be used when adding new filter and sort
564
- * operations to the table, as long as they are present.
565
- * @param customColumns -
734
+ * Removes an event listener added to this table.
735
+ * @param name -
736
+ * @param callback -
566
737
  * @return
738
+ * @typeParam T -
567
739
  */
568
- applyCustomColumns(customColumns:Array<string|CustomColumn>):Array<CustomColumn>;
569
- /**
570
- * Replace the currently set filters on the table. Returns the previously set value. Note that the filter property
571
- * will immediately return the new value, but you may receive update events using the old filter before the new one
572
- * is applied, and the <b>filterchanged</b> event fires. Reusing existing, applied filters may enable this to
573
- * perform better on the server. The <b>updated</b> event will also fire, but <b>rowadded</b> and <b>rowremoved</b>
574
- * will not.
575
- * @param filter -
576
- * @return {@link dh.FilterCondition} array
577
- */
578
- applyFilter(filter:FilterCondition[]):Array<FilterCondition>;
579
- /**
580
- * An ordered list of Filters to apply to the table. To update, call applyFilter(). Note that this getter will
581
- * return the new value immediately, even though it may take a little time to update on the server. You may listen
582
- * for the <b>filterchanged</b> event to know when to update the UI.
583
- * @return {@link dh.FilterCondition} array
584
- */
585
- get filter():Array<FilterCondition>;
586
- /**
587
- * True if this table has been closed.
588
- * @return boolean
589
- */
590
- get isClosed():boolean;
591
- /**
592
- * The total number of rows in this table. This may change as the base table's configuration, filter, or contents
593
- * change.
594
- * @return double
595
- */
596
- get size():number;
597
- /**
598
- * The columns present on this table. Note that this may not include all columns in the parent table, and in cases
599
- * where a given column has more than one aggregation applied, the column name will have a suffix indicating the
600
- * aggregation used. This suffixed name will be of the form <b>columnName + '__' + aggregationName</b>.
601
- * @return {@link dh.Column} array
602
- */
603
- get columns():Array<Column>;
604
- get totalsTableConfig():TotalsTableConfig;
605
- /**
606
- * An ordered list of Sorts to apply to the table. To update, call applySort(). Note that this getter will return
607
- * the new value immediately, even though it may take a little time to update on the server. You may listen for the
608
- * <b>sortchanged</b> event to know when to update the UI.
609
- * @return {@link dh.Sort} array
610
- */
611
- get sort():Array<Sort>;
612
- /**
613
- * Read-only. An ordered list of custom column formulas to add to the table, either adding new columns or replacing
614
- * existing ones. To update, call <b>applyCustomColumns()</b>.
615
- * @return {@link dh.CustomColumn} array
616
- */
617
- get customColumns():Array<CustomColumn>;
618
- /**
619
- * True if this table may receive updates from the server, including size changed events, updated events after
620
- * initial snapshot.
621
- * @return boolean
622
- */
623
- get isRefreshing():boolean;
740
+ removeEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):boolean;
741
+ }
742
+ /**
743
+ * Similar to the browser `CustomEvent` type, this class holds only the type of the event, and optionally some
744
+ * details about the event.
745
+ * @typeParam T - the type of the event detail
746
+ */
747
+ export interface Event<T> {
748
+ get detail():T;
749
+ get type():string;
624
750
  }
625
751
  /**
626
752
  * Common interface for various ways of accessing table data and formatting for viewport or non-viewport subscriptions
@@ -658,265 +784,89 @@ export namespace dh {
658
784
  get rows():Array<Row>;
659
785
  }
660
786
  /**
661
- * Extends {@link dh.TableData}, but only contains data in the current viewport. The only API change from TableData is that
662
- * ViewportData also contains the offset to this data, so that the actual row number may be determined.
663
- * <p>
664
- * For viewport subscriptions, it is not necessary to read with the key, only with the position.
665
- * <p>
666
- * Do not assume that the first row in `rows` is the first visible row, because extra rows may be provided for easier
667
- * scrolling without going to the server.
787
+ * Wrap LocalDate values for use in JS. Provides text formatting for display and access to the underlying value.
668
788
  */
669
- export interface ViewportData extends TableData {
670
- /**
671
- * Reads a row object from the viewport, based on its position in the table.
672
- */
673
- get(index:LongWrapper|number):ViewportRow;
674
- getData(index:LongWrapper|number, column:Column):any;
675
- getFormat(index:LongWrapper|number, column:Column):Format;
676
- /**
677
- * The position of the first returned row within the table.
678
- */
679
- get offset():number;
680
- get columns():Array<Column>;
681
- get rows():Array<ViewportRow>;
789
+ export interface LocalDateWrapper {
790
+ valueOf():string;
791
+ getYear():number;
792
+ getMonthValue():number;
793
+ getDayOfMonth():number;
794
+ toString():string;
682
795
  }
683
796
 
684
797
  /**
685
- * This object serves as a "handle" to a subscription, allowing it to be acted on directly or canceled outright. If you
686
- * retain an instance of this, you have two choices - either only use it to call `close()` on it to stop the table's
687
- * viewport without creating a new one, or listen directly to this object instead of the table for data events, and
688
- * always call `close()` when finished. Calling any method on this object other than close() will result in it
689
- * continuing to live on after `setViewport` is called on the original table, or after the table is modified.
798
+ * Describes a grouping and aggregations for a roll-up table. Pass to the <b>Table.rollup</b> function to create a
799
+ * roll-up table.
690
800
  */
691
- export class TableViewportSubscription implements HasEventHandling {
692
- protected constructor();
693
-
694
- /**
695
- * Changes the rows and columns set on this viewport. This cannot be used to change the update interval.
696
- * @param firstRow -
697
- * @param lastRow -
698
- * @param columns -
699
- * @param updateIntervalMs -
700
- */
701
- setViewport(firstRow:number, lastRow:number, columns?:Column[]|undefined|null, updateIntervalMs?:number|undefined|null, isReverseViewport?:boolean|undefined|null):void;
702
- /**
703
- * Stops this viewport from running, stopping all events on itself and on the table that created it.
704
- */
705
- close():void;
801
+ export class RollupConfig {
706
802
  /**
707
- * Gets the data currently visible in this viewport
708
- * @return Promise of {@link dh.TableData}.
803
+ * Ordered list of columns to group by to form the hierarchy of the resulting roll-up table.
709
804
  */
710
- getViewportData():Promise<ViewportData>;
711
- snapshot(rows:RangeSet, columns:Column[]):Promise<TableData>;
805
+ groupingColumns:Array<String>;
712
806
  /**
713
- * Listen for events on this object.
714
- * @param name - the name of the event to listen for
715
- * @param callback - a function to call when the event occurs
716
- * @return Returns a cleanup function.
717
- * @typeParam T - the type of the data that the event will provide
807
+ * Mapping from each aggregation name to the ordered list of columns it should be applied to in the resulting
808
+ * roll-up table.
718
809
  */
719
- addEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):()=>void;
720
- nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<Event<T>>;
721
- hasListeners(name:string):boolean;
810
+ aggregations:{ [key: string]: Array<string>; };
722
811
  /**
723
- * Removes an event listener added to this table.
724
- * @param name -
725
- * @param callback -
726
- * @return
727
- * @typeParam T -
812
+ * Optional parameter indicating if an extra leaf node should be added at the bottom of the hierarchy, showing the
813
+ * rows in the underlying table which make up that grouping. Since these values might be a different type from the
814
+ * rest of the column, any client code must check if TreeRow.hasChildren = false, and if so, interpret those values
815
+ * as if they were Column.constituentType instead of Column.type. Defaults to false.
728
816
  */
729
- removeEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):boolean;
730
- }
731
-
732
- /**
733
- * Options for custom columns.
734
- */
735
- export class CustomColumnOptions {
817
+ includeConstituents:boolean;
818
+ includeOriginalColumns?:boolean|null;
736
819
  /**
737
- * When specified for custom columns on a rollup table, specifies if the formula apply to rollup or constituent
738
- * nodes.
820
+ * Optional parameter indicating if original column descriptions should be included. Defaults to true.
739
821
  */
740
- rollupNodeType?:RollupNodeTypeType|null;
822
+ includeDescriptions:boolean;
741
823
 
742
824
  constructor();
743
825
  }
744
826
 
745
827
  /**
746
- * Wrap BigInteger values for use in JS. Provides text formatting for display and access to the underlying value.
828
+ * Describes a Sort present on the table. No visible constructor, created through the use of Column.sort(), will be tied
829
+ * to that particular column data. Sort instances are immutable, and use a builder pattern to make modifications. All
830
+ * methods return a new Sort instance.
747
831
  */
748
- export class BigIntegerWrapper {
749
- protected constructor();
832
+ export class Sort {
833
+ static readonly ASCENDING:string;
834
+ static readonly DESCENDING:string;
835
+ static readonly REVERSE:string;
750
836
 
751
- static ofString(str:string):BigIntegerWrapper;
752
- asNumber():number;
753
- valueOf():string;
754
- toString():string;
755
- equals(o:object):boolean;
756
- hashCode():number;
757
- }
837
+ protected constructor();
758
838
 
759
- /**
760
- * Describes how a Totals Table will be generated from its parent table. Each table has a default (which may be null)
761
- * indicating how that table was configured when it was declared, and each Totals Table has a similar property
762
- * describing how it was created. Both the <b>Table.getTotalsTable</b> and <b>Table.getGrandTotalsTable</b> methods take
763
- * this config as an optional parameter - without it, the table's default will be used, or if null, a default instance
764
- * of <b>TotalsTableConfig</b> will be supplied.
765
- *
766
- * This class has a no-arg constructor, allowing an instance to be made with the default values provided. However, any
767
- * JS object can be passed in to the methods which accept instances of this type, provided their values adhere to the
768
- * expected formats.
769
- */
770
- export class TotalsTableConfig {
771
- /**
772
- * @deprecated
773
- */
774
- static readonly COUNT:string;
775
- /**
776
- * @deprecated
777
- */
778
- static readonly MIN:string;
779
- /**
780
- * @deprecated
781
- */
782
- static readonly MAX:string;
783
- /**
784
- * @deprecated
785
- */
786
- static readonly SUM:string;
787
- /**
788
- * @deprecated
789
- */
790
- static readonly ABS_SUM:string;
791
- /**
792
- * @deprecated
793
- */
794
- static readonly VAR:string;
795
- /**
796
- * @deprecated
797
- */
798
- static readonly AVG:string;
799
- /**
800
- * @deprecated
801
- */
802
- static readonly STD:string;
803
- /**
804
- * @deprecated
805
- */
806
- static readonly FIRST:string;
807
- /**
808
- * @deprecated
809
- */
810
- static readonly LAST:string;
811
- /**
812
- * @deprecated
813
- */
814
- static readonly SKIP:string;
815
- /**
816
- * Specifies if a Totals Table should be expanded by default in the UI. Defaults to false.
817
- */
818
- showTotalsByDefault:boolean;
819
- /**
820
- * Specifies if a Grand Totals Table should be expanded by default in the UI. Defaults to false.
821
- */
822
- showGrandTotalsByDefault:boolean;
823
839
  /**
824
- * Specifies the default operation for columns that do not have a specific operation applied; defaults to "Sum".
840
+ * Builds a Sort instance to sort values in ascending order.
841
+ * @return {@link dh.Sort}
825
842
  */
826
- defaultOperation:AggregationOperationType;
843
+ asc():Sort;
827
844
  /**
828
- * Mapping from each column name to the aggregation(s) that should be applied to that column in the resulting Totals
829
- * Table. If a column is omitted, the defaultOperation is used.
845
+ * Builds a Sort instance to sort values in descending order.
846
+ * @return {@link dh.Sort}
830
847
  */
831
- operationMap:{ [key: string]: Array<AggregationOperationType>; };
848
+ desc():Sort;
832
849
  /**
833
- * Groupings to use when generating the Totals Table. One row will exist for each unique set of values observed in
834
- * these columns. See also `Table.selectDistinct`.
850
+ * Builds a Sort instance which takes the absolute value before applying order.
851
+ * @return {@link dh.Sort}
835
852
  */
836
- groupBy:Array<string>;
837
-
838
- constructor();
839
-
853
+ abs():Sort;
840
854
  toString():string;
841
- }
842
-
843
- /**
844
- * Represents a non-viewport subscription to a table, and all data currently known to be present in the subscribed
845
- * columns. This class handles incoming snapshots and deltas, and fires events to consumers to notify of data changes.
846
- *
847
- * Unlike {@link dh.TableViewportSubscription}, the "original" table does not have a reference to this instance, only the
848
- * "private" table instance does, since the original cannot modify the subscription, and the private instance must
849
- * forward data to it.
850
- *
851
- * Represents a subscription to the table on the server. Changes made to the table will not be reflected here - the
852
- * subscription must be closed and a new one optioned to see those changes. The event model is slightly different from
853
- * viewports to make it less expensive to compute for large tables.
854
- */
855
- export class TableSubscription implements HasEventHandling {
856
- protected constructor();
857
-
858
- /**
859
- * Updates the subscription to use the given columns and update interval.
860
- * @param columns - the new columns to subscribe to
861
- * @param updateIntervalMs - the new update interval, or null/omit to use the default of one second
862
- */
863
- changeSubscription(columns:Array<Column>, updateIntervalMs:number|undefined|null):void;
864
- get columns():Array<Column>;
865
- /**
866
- * Stops the subscription on the server.
867
- */
868
- close():void;
869
855
  /**
870
- * Listen for events on this object.
871
- * @param name - the name of the event to listen for
872
- * @param callback - a function to call when the event occurs
873
- * @return Returns a cleanup function.
874
- * @typeParam T - the type of the data that the event will provide
856
+ * True if the absolute value of the column should be used when sorting; defaults to false.
857
+ * @return boolean
875
858
  */
876
- addEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):()=>void;
877
- nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<Event<T>>;
878
- hasListeners(name:string):boolean;
859
+ get isAbs():boolean;
879
860
  /**
880
- * Removes an event listener added to this table.
881
- * @param name -
882
- * @param callback -
883
- * @return
884
- * @typeParam T -
861
+ * The column which is sorted.
862
+ * @return {@link dh.Column}
885
863
  */
886
- removeEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):boolean;
887
- }
888
-
889
- export class CoreClient implements HasEventHandling {
890
- static readonly EVENT_CONNECT:string;
891
- static readonly EVENT_DISCONNECT:string;
892
- static readonly EVENT_RECONNECT:string;
893
- static readonly EVENT_RECONNECT_AUTH_FAILED:string;
894
- static readonly EVENT_REQUEST_FAILED:string;
895
- static readonly EVENT_REQUEST_STARTED:string;
896
- static readonly EVENT_REQUEST_SUCCEEDED:string;
864
+ get column():Column;
897
865
  /**
898
- * @deprecated
866
+ * The direction of this sort, either <b>ASC</b>, <b>DESC</b>, or <b>REVERSE</b>.
867
+ * @return String
899
868
  */
900
- static readonly EVENT_REFRESH_TOKEN_UPDATED:string;
901
- static readonly LOGIN_TYPE_PASSWORD:string;
902
- static readonly LOGIN_TYPE_ANONYMOUS:string;
903
-
904
- constructor(serverUrl:string, connectOptions?:ConnectOptions);
905
-
906
- running():Promise<CoreClient>;
907
- getServerUrl():string;
908
- getAuthConfigValues():Promise<string[][]>;
909
- login(credentials:LoginCredentials):Promise<void>;
910
- relogin(token:RefreshToken):Promise<void>;
911
- onConnected(timeoutInMillis?:number):Promise<void>;
912
- getServerConfigValues():Promise<string[][]>;
913
- getStorageService():dh.storage.StorageService;
914
- getAsIdeConnection():Promise<IdeConnection>;
915
- disconnect():void;
916
- addEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):()=>void;
917
- nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<Event<T>>;
918
- hasListeners(name:string):boolean;
919
- removeEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):boolean;
869
+ get direction():string;
920
870
  }
921
871
 
922
872
  /**
@@ -1013,192 +963,87 @@ export namespace dh {
1013
963
  }
1014
964
 
1015
965
  /**
1016
- * Exists to keep the dh.TableMap namespace so that the web UI can remain compatible with the DHE API, which still calls
1017
- * this type TableMap.
1018
- * @deprecated
966
+ * Event fired when a command is issued from the client.
1019
967
  */
1020
- export class TableMap {
1021
- static readonly EVENT_KEYADDED:string;
1022
- static readonly EVENT_DISCONNECT:string;
1023
- static readonly EVENT_RECONNECT:string;
1024
- static readonly EVENT_RECONNECTFAILED:string;
968
+ export class CommandInfo {
969
+ constructor(code:string, result:Promise<dh.ide.CommandResult>);
1025
970
 
1026
- protected constructor();
971
+ get result():Promise<dh.ide.CommandResult>;
972
+ get code():string;
1027
973
  }
1028
974
 
1029
975
  /**
1030
- * Describes data that can be filtered, either a column reference or a literal value. Used this way, the type of a value
1031
- * can be specified so that values which are ambiguous or not well supported in JS will not be confused with Strings or
1032
- * imprecise numbers (e.g., nanosecond-precision date values). Additionally, once wrapped in this way, methods can be
1033
- * called on these value literal instances. These instances are immutable - any method called on them returns a new
1034
- * instance.
976
+ * Addition optional configuration that can be passed to the {@link dh.CoreClient} constructor.
1035
977
  */
1036
- export class FilterValue {
1037
- protected constructor();
1038
-
1039
- /**
1040
- * Constructs a number for the filter API from the given parameter. Can also be used on the values returned from
1041
- * {@link TableData.get} for DateTime values. To create
1042
- * a filter with a date, use <b>dh.DateWrapper.ofJsDate</b> or
1043
- * {@link i18n.DateTimeFormat.parse}. To create a filter with a
1044
- * 64-bit long integer, use {@link LongWrapper.ofString}.
1045
- * @param input - the number to wrap as a FilterValue
1046
- * @return an immutable FilterValue that can be built into a filter
1047
- */
1048
- static ofNumber(input:LongWrapper|number):FilterValue;
1049
- /**
1050
- * a filter condition checking if the current value is equal to the given parameter
1051
- * @param term -
1052
- * @return {@link dh.FilterCondition}
1053
- */
1054
- eq(term:FilterValue):FilterCondition;
978
+ export class ConnectOptions {
1055
979
  /**
1056
- * a filter condition checking if the current value is equal to the given parameter, ignoring differences of upper
1057
- * vs lower case
1058
- * @param term -
1059
- * @return {@link dh.FilterCondition}
980
+ * Optional map of http header names and values to send to the server with each request.
1060
981
  */
1061
- eqIgnoreCase(term:FilterValue):FilterCondition;
982
+ headers?:{ [key: string]: string; }|null;
1062
983
  /**
1063
- * a filter condition checking if the current value is not equal to the given parameter
1064
- * @param term -
1065
- * @return {@link dh.FilterCondition}
984
+ * True to enable debug logging. At this time, only enables logging for gRPC calls.
1066
985
  */
1067
- notEq(term:FilterValue):FilterCondition;
986
+ debug?:boolean|null;
1068
987
  /**
1069
- * a filter condition checking if the current value is not equal to the given parameter, ignoring differences of
1070
- * upper vs lower case
1071
- * @param term -
1072
- * @return {@link dh.FilterCondition}
988
+ * Set this to true to force the use of websockets when connecting to the deephaven instance, false to force the use
989
+ * of `fetch`. Ignored if {@link dh.transportFactory} is set.
990
+ * <p>
991
+ * Defaults to null, indicating that the server URL should be checked to see if we connect with fetch or websockets.
1073
992
  */
1074
- notEqIgnoreCase(term:FilterValue):FilterCondition;
993
+ useWebsockets?:boolean|null;
1075
994
  /**
1076
- * a filter condition checking if the current value is greater than the given parameter
1077
- * @param term -
1078
- * @return {@link dh.FilterCondition}
995
+ * The transport factory to use for creating gRPC streams. If specified, the JS API will ignore
996
+ * {@link dh.useWebsockets} and its own internal logic for determining the appropriate transport to use.
997
+ * <p>
998
+ * Defaults to null, indicating that the JS API should determine the appropriate transport to use. If
999
+ * `useWebsockets` is set to true, the JS API will use websockets, otherwise if the server url begins with
1000
+ * https, it will use fetch, otherwise it will use websockets.
1079
1001
  */
1080
- greaterThan(term:FilterValue):FilterCondition;
1081
- /**
1082
- * a filter condition checking if the current value is less than the given parameter
1083
- * @param term -
1084
- * @return {@link dh.FilterCondition}
1085
- */
1086
- lessThan(term:FilterValue):FilterCondition;
1087
- /**
1088
- * a filter condition checking if the current value is greater than or equal to the given parameter
1089
- * @param term -
1090
- * @return {@link dh.FilterCondition}
1091
- */
1092
- greaterThanOrEqualTo(term:FilterValue):FilterCondition;
1093
- /**
1094
- * a filter condition checking if the current value is less than or equal to the given parameter
1095
- * @param term -
1096
- * @return {@link dh.FilterCondition}
1097
- */
1098
- lessThanOrEqualTo(term:FilterValue):FilterCondition;
1099
- /**
1100
- * a filter condition checking if the current value is in the given set of values
1101
- * @param terms -
1102
- * @return {@link dh.FilterCondition}
1103
- */
1104
- in(terms:FilterValue[]):FilterCondition;
1105
- /**
1106
- * a filter condition checking if the current value is in the given set of values, ignoring differences of upper vs
1107
- * lower case
1108
- * @param terms -
1109
- * @return {@link dh.FilterCondition}
1110
- */
1111
- inIgnoreCase(terms:FilterValue[]):FilterCondition;
1112
- /**
1113
- * a filter condition checking that the current value is not in the given set of values
1114
- * @param terms -
1115
- * @return {@link dh.FilterCondition}
1116
- */
1117
- notIn(terms:FilterValue[]):FilterCondition;
1118
- /**
1119
- * a filter condition checking that the current value is not in the given set of values, ignoring differences of
1120
- * upper vs lower case
1121
- * @param terms -
1122
- * @return {@link dh.FilterCondition}
1123
- */
1124
- notInIgnoreCase(terms:FilterValue[]):FilterCondition;
1125
- /**
1126
- * a filter condition checking if the given value contains the given string value
1127
- * @param term -
1128
- * @return {@link dh.FilterCondition}
1129
- */
1130
- contains(term:FilterValue):FilterCondition;
1131
- /**
1132
- * a filter condition checking if the given value contains the given string value, ignoring differences of upper vs
1133
- * lower case
1134
- * @param term -
1135
- * @return {@link dh.FilterCondition}
1136
- */
1137
- containsIgnoreCase(term:FilterValue):FilterCondition;
1138
- /**
1139
- * a filter condition checking if the given value matches the provided regular expressions string. Regex patterns
1140
- * use Java regex syntax
1141
- * @param pattern -
1142
- * @return {@link dh.FilterCondition}
1143
- */
1144
- matches(pattern:FilterValue):FilterCondition;
1145
- /**
1146
- * a filter condition checking if the given value matches the provided regular expressions string, ignoring
1147
- * differences of upper vs lower case. Regex patterns use Java regex syntax
1148
- * @param pattern -
1149
- * @return {@link dh.FilterCondition}
1150
- */
1151
- matchesIgnoreCase(pattern:FilterValue):FilterCondition;
1002
+ transportFactory?:dh.grpc.GrpcTransportFactory|null;
1003
+
1004
+ constructor();
1005
+ }
1006
+
1007
+ export class CustomColumn {
1008
+ static readonly TYPE_FORMAT_COLOR:string;
1009
+ static readonly TYPE_FORMAT_NUMBER:string;
1010
+ static readonly TYPE_FORMAT_DATE:string;
1011
+ static readonly TYPE_NEW:string;
1012
+
1013
+ protected constructor();
1014
+
1015
+ valueOf():string;
1016
+ toString():string;
1017
+ static from(columnInfo:string):CustomColumn;
1152
1018
  /**
1153
- * a filter condition checking if the current value is a true boolean
1154
- * @return {@link dh.FilterCondition}
1019
+ * The expression to evaluate this custom column.
1020
+ * @return String
1155
1021
  */
1156
- isTrue():FilterCondition;
1022
+ get expression():string;
1157
1023
  /**
1158
- * a filter condition checking if the current value is a false boolean
1159
- * @return {@link dh.FilterCondition}
1024
+ * The name of the column to use.
1025
+ * @return String
1160
1026
  */
1161
- isFalse():FilterCondition;
1027
+ get name():string;
1162
1028
  /**
1163
- * a filter condition checking if the current value is a null value
1164
- * @return {@link dh.FilterCondition}
1029
+ * The options for this custom column.
1030
+ * @return CustomColumOptions
1165
1031
  */
1166
- isNull():FilterCondition;
1032
+ get options():CustomColumnOptions;
1167
1033
  /**
1168
- * a filter condition invoking the given method on the current value, with the given parameters. Currently supported
1169
- * functions that can be invoked on a String:
1034
+ * Type of custom column. One of
1035
+ *
1170
1036
  * <ul>
1171
- * <li><b>startsWith</b>: Returns true if the current string value starts with the supplied string argument</li>
1172
- * <li><b>endsWith</b>: Returns true if the current string value ends with the supplied string argument</li>
1173
- * <li><b>matches</b>: Returns true if the current string value matches the supplied string argument used as a Java
1174
- * regular expression</li>
1175
- * <li><b>contains</b>: Returns true if the current string value contains the supplied string argument
1176
- * <p>
1177
- * When invoking against a constant, this should be avoided in favor of FilterValue.contains
1178
- * </p>
1179
- * </li>
1037
+ * <li>FORMAT_COLOR</li>
1038
+ * <li>FORMAT_NUMBER</li>
1039
+ * <li>FORMAT_DATE</li>
1040
+ * <li>NEW</li>
1180
1041
  * </ul>
1181
- * @param method -
1182
- * @param args -
1183
- * @return
1184
- */
1185
- invoke(method:string, ...args:FilterValue[]):FilterCondition;
1186
- toString():string;
1187
- /**
1188
- * Constructs a string for the filter API from the given parameter.
1189
- * @param input -
1190
- * @return
1191
- */
1192
- static ofString(input:any):FilterValue;
1193
- /**
1194
- * Constructs a boolean for the filter API from the given parameter.
1195
- * @param b -
1196
- * @return
1042
+ * @return String
1197
1043
  */
1198
- static ofBoolean(b:boolean):FilterValue;
1044
+ get type():string;
1199
1045
  }
1200
1046
 
1201
-
1202
1047
  /**
1203
1048
  * Behaves like a {@link dh.Table} externally, but data, state, and viewports are managed by an entirely different
1204
1049
  * mechanism, and so reimplemented here.
@@ -1361,28 +1206,10 @@ export namespace dh {
1361
1206
  */
1362
1207
  copy():Promise<TreeTable>;
1363
1208
  /**
1364
- * The current filter configuration of this Tree Table.
1365
- * @return {@link dh.FilterCondition} array
1366
- */
1367
- get filter():Array<FilterCondition>;
1368
- /**
1369
- * True if this is a roll-up and will provide the original rows that make up each grouping.
1370
- * @return boolean
1371
- */
1372
- get includeConstituents():boolean;
1373
- get groupedColumns():Array<Column>;
1374
- /**
1375
- * True if this table has been closed.
1376
- * @return boolean
1377
- */
1378
- get isClosed():boolean;
1379
- /**
1380
- * The current number of rows given the table's contents and the various expand/collapse states of each node. (No
1381
- * totalSize is provided at this time; its definition becomes unclear between roll-up and tree tables, especially
1382
- * when considering collapse/expand states).
1383
- * @return double
1209
+ * Returns the columns that are aggregated.
1210
+ * @return array of aggregated columns
1384
1211
  */
1385
- get size():number;
1212
+ get aggregatedColumns():Array<Column>;
1386
1213
  /**
1387
1214
  * The columns that can be shown in this Tree Table.
1388
1215
  * @return {@link dh.Column} array
@@ -1405,6 +1232,29 @@ export namespace dh {
1405
1232
  */
1406
1233
  get isRefreshing():boolean;
1407
1234
  /**
1235
+ * The current filter configuration of this Tree Table.
1236
+ * @return {@link dh.FilterCondition} array
1237
+ */
1238
+ get filter():Array<FilterCondition>;
1239
+ /**
1240
+ * True if this is a roll-up and will provide the original rows that make up each grouping.
1241
+ * @return boolean
1242
+ */
1243
+ get includeConstituents():boolean;
1244
+ get groupedColumns():Array<Column>;
1245
+ /**
1246
+ * True if this table has been closed.
1247
+ * @return boolean
1248
+ */
1249
+ get isClosed():boolean;
1250
+ /**
1251
+ * The current number of rows given the table's contents and the various expand/collapse states of each node. (No
1252
+ * totalSize is provided at this time; its definition becomes unclear between roll-up and tree tables, especially
1253
+ * when considering collapse/expand states).
1254
+ * @return double
1255
+ */
1256
+ get size():number;
1257
+ /**
1408
1258
  * Listen for events on this object.
1409
1259
  * @param name - the name of the event to listen for
1410
1260
  * @param callback - a function to call when the event occurs
@@ -1424,163 +1274,176 @@ export namespace dh {
1424
1274
  removeEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):boolean;
1425
1275
  }
1426
1276
 
1277
+
1427
1278
  /**
1428
- * Presently, this is the entrypoint into the Deephaven JS API. By creating an instance of this with the server URL and
1429
- * some options, JS applications can run code on the server, and interact with available exportable objects.
1279
+ * Describes a filter which can be applied to a table. Replacing these instances may be more expensive than reusing
1280
+ * them. These instances are immutable - all operations that compose them to build bigger expressions return a new
1281
+ * instance.
1430
1282
  */
1431
- export class IdeConnection implements HasEventHandling {
1432
- /**
1433
- * @deprecated
1434
- */
1435
- static readonly HACK_CONNECTION_FAILURE:string;
1436
- static readonly EVENT_DISCONNECT:string;
1437
- static readonly EVENT_RECONNECT:string;
1438
- static readonly EVENT_SHUTDOWN:string;
1439
-
1283
+ export class FilterCondition {
1440
1284
  protected constructor();
1441
1285
 
1442
1286
  /**
1443
- * Closes the current connection, releasing any resources on the server or client.
1287
+ * the opposite of this condition
1288
+ * @return FilterCondition
1444
1289
  */
1445
- close():void;
1446
- running():Promise<IdeConnection>;
1447
- getObject(definitionObject:dh.ide.VariableDescriptor):Promise<any>;
1448
- subscribeToFieldUpdates(callback:(arg0:dh.ide.VariableChanges)=>void):()=>void;
1290
+ not():FilterCondition;
1449
1291
  /**
1450
- * Makes an `object` available to another user or another client on this same server which knows the value of
1451
- * the `sharedTicketBytes`. Use that sharedTicketBytes value like a one-time use password - any other client
1452
- * which knows this value can read the same object.
1453
- * <p>
1454
- * Shared objects will remain available using the sharedTicketBytes until the client that first shared them
1455
- * releases/closes their copy of the object. Whatever side-channel is used to share the bytes, be sure to wait until
1456
- * the remote end has signaled that it has successfully fetched the object before releasing it from this client.
1457
- * <p>
1458
- * Be sure to use an unpredictable value for the shared ticket bytes, like a UUID or other large, random value to
1459
- * prevent access by unauthorized clients.
1460
- * @param object - the object to share with another client/user
1461
- * @param sharedTicketBytes - the value which another client/user must know to obtain the object. It may be a unicode
1462
- * string (will be encoded as utf8 bytes), or a {@link Uint8Array} value.
1463
- * @return A promise that will resolve to the value passed as sharedTicketBytes when the object is ready to be read
1464
- * by another client, or will reject if an error occurs.
1292
+ * a condition representing the current condition logically ANDed with the other parameters
1293
+ * @param filters -
1294
+ * @return FilterCondition
1465
1295
  */
1466
- shareObject(object:Table|Widget|WidgetExportedObject|PartitionedTable|TotalsTable|TreeTable, sharedTicketBytes:string|Uint8Array):Promise<string|Uint8Array>;
1296
+ and(...filters:FilterCondition[]):FilterCondition;
1467
1297
  /**
1468
- * Reads an object shared by another client to this server with the `sharedTicketBytes`. Until the other
1469
- * client releases this object (or their session ends), the object will be available on the server.
1470
- * <p>
1471
- * The type of the object must be passed so that the object can be read from the server correct - the other client
1472
- * should provide this information.
1473
- * @param sharedTicketBytes - the value provided by another client/user to obtain the object. It may be a unicode
1474
- * string (will be encoded as utf8 bytes), or a {@link Uint8Array} value.
1475
- * @param type - The type of the object, so it can be correctly read from the server
1476
- * @return A promise that will resolve to the shared object, or will reject with an error if it cannot be read.
1298
+ * a condition representing the current condition logically ORed with the other parameters
1299
+ * @param filters -
1300
+ * @return FilterCondition.
1477
1301
  */
1478
- getSharedObject(sharedTicketBytes:string|Uint8Array, type:string):Promise<any>;
1302
+ or(...filters:FilterCondition[]):FilterCondition;
1479
1303
  /**
1480
- * Register a callback function to handle any log messages that are emitted on the server. Returns a function ,
1481
- * which can be invoked to remove this log handler. Any log handler registered in this way will receive as many old
1482
- * log messages as are presently available.
1483
- * @param callback -
1484
- * @return {@link io.deephaven.web.shared.fu.JsRunnable}
1304
+ * a string suitable for debugging showing the details of this condition.
1305
+ * @return String.
1485
1306
  */
1486
- onLogMessage(callback:(arg0:dh.ide.LogItem)=>void):()=>void;
1487
- startSession(type:string):Promise<IdeSession>;
1488
- getConsoleTypes():Promise<Array<string>>;
1489
- getWorkerHeapInfo():Promise<WorkerHeapInfo>;
1307
+ toString():string;
1308
+ get columns():Array<Column>;
1490
1309
  /**
1491
- * Listen for events on this object.
1492
- * @param name - the name of the event to listen for
1493
- * @param callback - a function to call when the event occurs
1494
- * @return Returns a cleanup function.
1495
- * @typeParam T - the type of the data that the event will provide
1310
+ * a filter condition invoking a static function with the given parameters. Currently supported Deephaven static
1311
+ * functions:
1312
+ * <ul>
1313
+ * <li><b>inRange</b>: Given three comparable values, returns true if the first is less than the second but greater
1314
+ * than the third</li>
1315
+ * <li><b>isInf</b>:Returns true if the given number is <i>infinity</i></li>
1316
+ * <li><b>isNaN</b>:Returns true if the given number is <i>not a number</i></li>
1317
+ * <li><b>isNormal</b>:Returns true if the given number <i>is not null</i>, <i>is not infinity</i>, and <i>is not
1318
+ * "not a number"</i></li>
1319
+ * <li><b>startsWith</b>:Returns true if the first string starts with the second string</li>
1320
+ * <li><b>endsWith</b>Returns true if the first string ends with the second string</li>
1321
+ * <li><b>matches</b>:Returns true if the first string argument matches the second string used as a Java regular
1322
+ * expression</li>
1323
+ * <li><b>contains</b>:Returns true if the first string argument contains the second string as a substring</li>
1324
+ * <li><b>in</b>:Returns true if the first string argument can be found in the second array argument.
1325
+ * <p>
1326
+ * Note that the array can only be specified as a column reference at this time - typically the `FilterValue.in`
1327
+ * method should be used in other cases
1328
+ * </p>
1329
+ * </li>
1330
+ * </ul>
1331
+ * @param function -
1332
+ * @param args -
1333
+ * @return dh.FilterCondition
1496
1334
  */
1497
- addEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):()=>void;
1498
- nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<Event<T>>;
1499
- hasListeners(name:string):boolean;
1335
+ static invoke(func:string, ...args:FilterValue[]):FilterCondition;
1500
1336
  /**
1501
- * Removes an event listener added to this table.
1502
- * @param name -
1503
- * @param callback -
1504
- * @return
1505
- * @typeParam T -
1337
+ * a filter condition which will check if the given value can be found in any supported column on whatever table
1338
+ * this FilterCondition is passed to. This FilterCondition is somewhat unique in that it need not be given a column
1339
+ * instance, but will adapt to any table. On numeric columns, with a value passed in which can be parsed as a
1340
+ * number, the column will be filtered to numbers which equal, or can be "rounded" effectively to this number. On
1341
+ * String columns, the given value will match any column which contains this string in a case-insensitive search. An
1342
+ * optional second argument can be passed, an array of `FilterValue` from the columns to limit this search to (see
1343
+ * {@link dh.Column.filter}).
1344
+ * @param value -
1345
+ * @param columns -
1346
+ * @return dh.FilterCondition
1506
1347
  */
1507
- removeEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):boolean;
1348
+ static search(value:FilterValue, columns?:FilterValue[]):FilterCondition;
1508
1349
  }
1509
1350
 
1510
1351
  /**
1511
- * Represents a set of Tables each corresponding to some key. The keys are available locally, but a call must be made to
1512
- * the server to get each Table. All tables will have the same structure.
1352
+ * This class allows iteration over non-contiguous indexes. In the future, this will support the EcmaScript 2015
1353
+ * Iteration protocol, but for now has one method which returns an iterator, and also supports querying the size.
1354
+ * Additionally, we may add support for creating RangeSet objects to better serve some use cases.
1513
1355
  */
1514
- export class PartitionedTable implements HasEventHandling {
1356
+ export class RangeSet {
1357
+ protected constructor();
1358
+
1359
+ static ofRange(first:number, last:number):RangeSet;
1360
+ static ofItems(rows:number[]):RangeSet;
1361
+ static ofRanges(ranges:RangeSet[]):RangeSet;
1362
+ static ofSortedRanges(ranges:RangeSet[]):RangeSet;
1515
1363
  /**
1516
- * Indicates that a new key has been added to the array of keys, which can now be fetched with getTable.
1364
+ * a new iterator over all indexes in this collection.
1365
+ * @return Iterator of {@link dh.LongWrapper}
1517
1366
  */
1518
- static readonly EVENT_KEYADDED:string;
1367
+ iterator():Iterator<LongWrapper>;
1519
1368
  /**
1520
- * Indicates that a new key has been added to the array of keys, which can now be fetched with getTable.
1369
+ * The total count of items contained in this collection. In some cases this can be expensive to compute, and
1370
+ * generally should not be needed except for debugging purposes, or preallocating space (i.e., do not call this
1371
+ * property each time through a loop).
1372
+ * @return double
1521
1373
  */
1522
- static readonly EVENT_DISCONNECT:string;
1374
+ get size():number;
1375
+ }
1376
+
1377
+ /**
1378
+ * Presently, this is the entrypoint into the Deephaven JS API. By creating an instance of this with the server URL and
1379
+ * some options, JS applications can run code on the server, and interact with available exportable objects.
1380
+ */
1381
+ export class IdeConnection implements HasEventHandling {
1523
1382
  /**
1524
- * Indicates that a new key has been added to the array of keys, which can now be fetched with getTable.
1383
+ * @deprecated
1525
1384
  */
1385
+ static readonly HACK_CONNECTION_FAILURE:string;
1386
+ static readonly EVENT_DISCONNECT:string;
1526
1387
  static readonly EVENT_RECONNECT:string;
1527
- /**
1528
- * Indicates that a new key has been added to the array of keys, which can now be fetched with getTable.
1529
- */
1530
- static readonly EVENT_RECONNECTFAILED:string;
1388
+ static readonly EVENT_SHUTDOWN:string;
1531
1389
 
1532
1390
  protected constructor();
1533
1391
 
1534
1392
  /**
1535
- * Fetch the table with the given key. If the key does not exist, returns `null`.
1536
- * @param key - The key to fetch. An array of values for each key column, in the same order as the key columns are.
1537
- * @return Promise of dh.Table, or `null` if the key does not exist.
1538
- */
1539
- getTable(key:object):Promise<Table|undefined|null>;
1540
- /**
1541
- * Open a new table that is the result of merging all constituent tables. See
1542
- * {@link io.deephaven.engine.table.PartitionedTable.merge} for details.
1543
- * @return A merged representation of the constituent tables.
1544
- */
1545
- getMergedTable():Promise<Table>;
1546
- /**
1547
- * The set of all currently known keys. This is kept up to date, so getting the list after adding an event listener
1548
- * for <b>keyadded</b> will ensure no keys are missed.
1549
- * @return Set of Object
1550
- */
1551
- getKeys():Set<object>;
1552
- /**
1553
- * Fetch a table containing all the valid keys of the partitioned table.
1554
- * @return Promise of a Table
1555
- * @deprecated
1556
- */
1557
- getKeyTable():Promise<Table>;
1558
- /**
1559
- * Fetch the underlying base table of the partitioned table.
1560
- * @return Promise of a Table
1393
+ * Closes the current connection, releasing any resources on the server or client.
1561
1394
  */
1562
- getBaseTable():Promise<Table>;
1395
+ close():void;
1396
+ running():Promise<IdeConnection>;
1397
+ getObject(definitionObject:dh.ide.VariableDescriptor):Promise<any>;
1398
+ subscribeToFieldUpdates(callback:(arg0:dh.ide.VariableChanges)=>void):()=>void;
1563
1399
  /**
1564
- * Indicates that this PartitionedTable will no longer be used, removing subcriptions to updated keys, etc. This
1565
- * will not affect tables in use.
1400
+ * Makes an `object` available to another user or another client on this same server which knows the value of
1401
+ * the `sharedTicketBytes`. Use that sharedTicketBytes value like a one-time use password - any other client
1402
+ * which knows this value can read the same object.
1403
+ * <p>
1404
+ * Shared objects will remain available using the sharedTicketBytes until the client that first shared them
1405
+ * releases/closes their copy of the object. Whatever side-channel is used to share the bytes, be sure to wait until
1406
+ * the remote end has signaled that it has successfully fetched the object before releasing it from this client.
1407
+ * <p>
1408
+ * Be sure to use an unpredictable value for the shared ticket bytes, like a UUID or other large, random value to
1409
+ * prevent access by unauthorized clients.
1410
+ * @param object - the object to share with another client/user
1411
+ * @param sharedTicketBytes - the value which another client/user must know to obtain the object. It may be a unicode
1412
+ * string (will be encoded as utf8 bytes), or a {@link Uint8Array} value.
1413
+ * @return A promise that will resolve to the value passed as sharedTicketBytes when the object is ready to be read
1414
+ * by another client, or will reject if an error occurs.
1566
1415
  */
1567
- close():void;
1416
+ shareObject(object:Table|Widget|WidgetExportedObject|PartitionedTable|TotalsTable|TreeTable, sharedTicketBytes:string|Uint8Array):Promise<string|Uint8Array>;
1568
1417
  /**
1569
- * The count of known keys.
1570
- * @return int
1418
+ * Reads an object shared by another client to this server with the `sharedTicketBytes`. Until the other
1419
+ * client releases this object (or their session ends), the object will be available on the server.
1420
+ * <p>
1421
+ * The type of the object must be passed so that the object can be read from the server correct - the other client
1422
+ * should provide this information.
1423
+ * @param sharedTicketBytes - the value provided by another client/user to obtain the object. It may be a unicode
1424
+ * string (will be encoded as utf8 bytes), or a {@link Uint8Array} value.
1425
+ * @param type - The type of the object, so it can be correctly read from the server
1426
+ * @return A promise that will resolve to the shared object, or will reject with an error if it cannot be read.
1571
1427
  */
1572
- get size():number;
1428
+ getSharedObject(sharedTicketBytes:string|Uint8Array, type:string):Promise<any>;
1429
+ newTable(columnNames:string[], types:string[], data:string[][], userTimeZone:string):Promise<Table>;
1573
1430
  /**
1574
- * An array of the columns in the tables that can be retrieved from this partitioned table, including both key and
1575
- * non-key columns.
1576
- * @return Array of Column
1431
+ * Merges the given tables into a single table. Assumes all tables have the same structure.
1432
+ * @param tables -
1433
+ * @return {@link Promise} of {@link dh.Table}
1577
1434
  */
1578
- get columns():Column[];
1435
+ mergeTables(tables:Table[]):Promise<Table>;
1579
1436
  /**
1580
- * An array of all the key columns that the tables are partitioned by.
1581
- * @return Array of Column
1437
+ * Register a callback function to handle any log messages that are emitted on the server. Returns a function ,
1438
+ * which can be invoked to remove this log handler. Any log handler registered in this way will receive as many old
1439
+ * log messages as are presently available.
1440
+ * @param callback -
1441
+ * @return {@link io.deephaven.web.shared.fu.JsRunnable}
1582
1442
  */
1583
- get keyColumns():Column[];
1443
+ onLogMessage(callback:(arg0:dh.ide.LogItem)=>void):()=>void;
1444
+ startSession(type:string):Promise<IdeSession>;
1445
+ getConsoleTypes():Promise<Array<string>>;
1446
+ getWorkerHeapInfo():Promise<WorkerHeapInfo>;
1584
1447
  /**
1585
1448
  * Listen for events on this object.
1586
1449
  * @param name - the name of the event to listen for
@@ -1602,263 +1465,833 @@ export namespace dh {
1602
1465
  }
1603
1466
 
1604
1467
  /**
1605
- * A js type for operating on input tables.
1606
- *
1607
- * Represents a User Input Table, which can have data added to it from other sources.
1608
- *
1609
- * You may add rows using dictionaries of key-value tuples (representing columns by name), add tables containing all the
1610
- * key/value columns to add, or delete tables containing the keys to delete. Each operation is atomic, and will either
1611
- * succeed completely or fail completely. To guarantee order of operations, apply an operation and wait for the response
1612
- * before sending the next operation.
1613
- *
1614
- * Each table has one or more key columns, where each unique combination of keys will appear at most once in the table.
1468
+ * Configuration object for running Table.treeTable to produce a hierarchical view of a given "flat" table.
1615
1469
  *
1616
- * To view the results of the Input Table, you should use standard table operations on the InputTable's source Table
1617
- * object.
1470
+ * Like TotalsTableConfig, `TreeTableConfig` supports an operation map indicating how to aggregate the data, as well as
1471
+ * an array of column names which will be the layers in the roll-up tree, grouped at each level. An additional optional
1472
+ * value can be provided describing the strategy the engine should use when grouping the rows.
1618
1473
  */
1619
- export class InputTable {
1620
- protected constructor();
1621
-
1622
- /**
1623
- * Adds a single row to the table. For each key or value column name in the Input Table, we retrieve that javascript
1624
- * property at that name and validate it can be put into the given column type.
1625
- * @param row -
1626
- * @param userTimeZone -
1627
- * @return Promise of dh.InputTable
1628
- */
1629
- addRow(row:{ [key: string]: any; }, userTimeZone?:string):Promise<InputTable>;
1474
+ export class TreeTableConfig {
1630
1475
  /**
1631
- * Add multiple rows to a table.
1632
- * @param rows -
1633
- * @param userTimeZone -
1634
- * @return Promise of dh.InputTable
1476
+ * The column representing the unique ID for each item
1635
1477
  */
1636
- addRows(rows:{ [key: string]: any; }[], userTimeZone?:string):Promise<InputTable>;
1478
+ idColumn:string;
1637
1479
  /**
1638
- * Add an entire table to this Input Table. Only column names that match the definition of the input table will be
1639
- * copied, and all key columns must have values filled in. This only copies the current state of the source table;
1640
- * future updates to the source table will not be reflected in the Input Table. The returned promise will be
1641
- * resolved to the same InputTable instance this method was called upon once the server returns.
1642
- * @param tableToAdd -
1643
- * @return Promise of dh.InputTable
1480
+ * The column representing the parent ID for each item
1644
1481
  */
1645
- addTable(tableToAdd:Table):Promise<InputTable>;
1482
+ parentColumn:string;
1646
1483
  /**
1647
- * Add multiple tables to this Input Table.
1648
- * @param tablesToAdd -
1649
- * @return Promise of dh.InputTable
1484
+ * Optional parameter indicating if items with an invalid parent ID should be promoted to root. Defaults to false.
1650
1485
  */
1651
- addTables(tablesToAdd:Table[]):Promise<InputTable>;
1486
+ promoteOrphansToRoot:boolean;
1487
+
1488
+ constructor();
1489
+ }
1490
+
1491
+ export class QueryInfo {
1492
+ static readonly EVENT_TABLE_OPENED:string;
1493
+ static readonly EVENT_DISCONNECT:string;
1494
+ static readonly EVENT_RECONNECT:string;
1495
+ static readonly EVENT_CONNECT:string;
1496
+
1497
+ protected constructor();
1498
+ }
1499
+
1500
+ export class CoreClient implements HasEventHandling {
1501
+ static readonly EVENT_CONNECT:string;
1502
+ static readonly EVENT_DISCONNECT:string;
1503
+ static readonly EVENT_RECONNECT:string;
1504
+ static readonly EVENT_RECONNECT_AUTH_FAILED:string;
1505
+ static readonly EVENT_REQUEST_FAILED:string;
1506
+ static readonly EVENT_REQUEST_STARTED:string;
1507
+ static readonly EVENT_REQUEST_SUCCEEDED:string;
1652
1508
  /**
1653
- * Deletes an entire table from this Input Table. Key columns must match the Input Table.
1654
- * @param tableToDelete -
1655
- * @return Promise of dh.InputTable
1509
+ * @deprecated
1656
1510
  */
1657
- deleteTable(tableToDelete:Table):Promise<InputTable>;
1658
- /**
1659
- * Delete multiple tables from this Input Table.
1660
- * @param tablesToDelete -
1661
- * @return
1511
+ static readonly EVENT_REFRESH_TOKEN_UPDATED:string;
1512
+ static readonly LOGIN_TYPE_PASSWORD:string;
1513
+ static readonly LOGIN_TYPE_ANONYMOUS:string;
1514
+
1515
+ constructor(serverUrl:string, connectOptions?:ConnectOptions);
1516
+
1517
+ running():Promise<CoreClient>;
1518
+ getServerUrl():string;
1519
+ getAuthConfigValues():Promise<string[][]>;
1520
+ login(credentials:LoginCredentials):Promise<void>;
1521
+ relogin(token:RefreshToken):Promise<void>;
1522
+ onConnected(timeoutInMillis?:number):Promise<void>;
1523
+ getServerConfigValues():Promise<string[][]>;
1524
+ getStorageService():dh.storage.StorageService;
1525
+ getAsIdeConnection():Promise<IdeConnection>;
1526
+ disconnect():void;
1527
+ addEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):()=>void;
1528
+ nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<Event<T>>;
1529
+ hasListeners(name:string):boolean;
1530
+ removeEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):boolean;
1531
+ }
1532
+
1533
+ /**
1534
+ * Describes how a Totals Table will be generated from its parent table. Each table has a default (which may be null)
1535
+ * indicating how that table was configured when it was declared, and each Totals Table has a similar property
1536
+ * describing how it was created. Both the <b>Table.getTotalsTable</b> and <b>Table.getGrandTotalsTable</b> methods take
1537
+ * this config as an optional parameter - without it, the table's default will be used, or if null, a default instance
1538
+ * of <b>TotalsTableConfig</b> will be supplied.
1539
+ *
1540
+ * This class has a no-arg constructor, allowing an instance to be made with the default values provided. However, any
1541
+ * JS object can be passed in to the methods which accept instances of this type, provided their values adhere to the
1542
+ * expected formats.
1543
+ */
1544
+ export class TotalsTableConfig {
1545
+ /**
1546
+ * @deprecated
1662
1547
  */
1663
- deleteTables(tablesToDelete:Table[]):Promise<InputTable>;
1548
+ static readonly COUNT:string;
1664
1549
  /**
1665
- * A list of the key columns, by name
1666
- * @return String array.
1550
+ * @deprecated
1667
1551
  */
1668
- get keys():string[];
1552
+ static readonly MIN:string;
1669
1553
  /**
1670
- * A list of the value columns, by name
1671
- * @return String array.
1554
+ * @deprecated
1672
1555
  */
1673
- get values():string[];
1556
+ static readonly MAX:string;
1674
1557
  /**
1675
- * A list of the key columns.
1676
- * @return Column array.
1558
+ * @deprecated
1677
1559
  */
1678
- get keyColumns():Column[];
1560
+ static readonly SUM:string;
1679
1561
  /**
1680
- * A list of the value Column objects
1681
- * @return {@link dh.Column} array.
1562
+ * @deprecated
1682
1563
  */
1683
- get valueColumns():Column[];
1564
+ static readonly ABS_SUM:string;
1684
1565
  /**
1685
- * The source table for this Input Table
1686
- * @return dh.table
1566
+ * @deprecated
1687
1567
  */
1688
- get table():Table;
1689
- }
1690
-
1691
- /**
1692
- * Describes a Sort present on the table. No visible constructor, created through the use of Column.sort(), will be tied
1693
- * to that particular column data. Sort instances are immutable, and use a builder pattern to make modifications. All
1694
- * methods return a new Sort instance.
1695
- */
1696
- export class Sort {
1697
- static readonly ASCENDING:string;
1698
- static readonly DESCENDING:string;
1699
- static readonly REVERSE:string;
1700
-
1701
- protected constructor();
1702
-
1568
+ static readonly VAR:string;
1703
1569
  /**
1704
- * Builds a Sort instance to sort values in ascending order.
1705
- * @return {@link dh.Sort}
1570
+ * @deprecated
1706
1571
  */
1707
- asc():Sort;
1572
+ static readonly AVG:string;
1708
1573
  /**
1709
- * Builds a Sort instance to sort values in descending order.
1710
- * @return {@link dh.Sort}
1574
+ * @deprecated
1711
1575
  */
1712
- desc():Sort;
1576
+ static readonly STD:string;
1713
1577
  /**
1714
- * Builds a Sort instance which takes the absolute value before applying order.
1715
- * @return {@link dh.Sort}
1578
+ * @deprecated
1716
1579
  */
1717
- abs():Sort;
1718
- toString():string;
1580
+ static readonly FIRST:string;
1719
1581
  /**
1720
- * True if the absolute value of the column should be used when sorting; defaults to false.
1721
- * @return boolean
1582
+ * @deprecated
1722
1583
  */
1723
- get isAbs():boolean;
1584
+ static readonly LAST:string;
1724
1585
  /**
1725
- * The column which is sorted.
1726
- * @return {@link dh.Column}
1586
+ * @deprecated
1727
1587
  */
1728
- get column():Column;
1588
+ static readonly SKIP:string;
1729
1589
  /**
1730
- * The direction of this sort, either <b>ASC</b>, <b>DESC</b>, or <b>REVERSE</b>.
1731
- * @return String
1590
+ * Specifies if a Totals Table should be expanded by default in the UI. Defaults to false.
1732
1591
  */
1733
- get direction():string;
1734
- }
1735
-
1736
- /**
1737
- * Addition optional configuration that can be passed to the {@link dh.CoreClient} constructor.
1738
- */
1739
- export class ConnectOptions {
1592
+ showTotalsByDefault:boolean;
1740
1593
  /**
1741
- * Optional map of http header names and values to send to the server with each request.
1594
+ * Specifies if a Grand Totals Table should be expanded by default in the UI. Defaults to false.
1742
1595
  */
1743
- headers?:{ [key: string]: string; }|null;
1596
+ showGrandTotalsByDefault:boolean;
1744
1597
  /**
1745
- * True to enable debug logging. At this time, only enables logging for gRPC calls.
1598
+ * Specifies the default operation for columns that do not have a specific operation applied; defaults to "Sum".
1746
1599
  */
1747
- debug?:boolean|null;
1600
+ defaultOperation:AggregationOperationType;
1748
1601
  /**
1749
- * Set this to true to force the use of websockets when connecting to the deephaven instance, false to force the use
1750
- * of `fetch`. Ignored if {@link dh.transportFactory} is set.
1751
- * <p>
1752
- * Defaults to null, indicating that the server URL should be checked to see if we connect with fetch or websockets.
1602
+ * Mapping from each column name to the aggregation(s) that should be applied to that column in the resulting Totals
1603
+ * Table. If a column is omitted, the defaultOperation is used.
1753
1604
  */
1754
- useWebsockets?:boolean|null;
1605
+ operationMap:{ [key: string]: Array<AggregationOperationType>; };
1755
1606
  /**
1756
- * The transport factory to use for creating gRPC streams. If specified, the JS API will ignore
1757
- * {@link dh.useWebsockets} and its own internal logic for determining the appropriate transport to use.
1758
- * <p>
1759
- * Defaults to null, indicating that the JS API should determine the appropriate transport to use. If
1760
- * `useWebsockets` is set to true, the JS API will use websockets, otherwise if the server url begins with
1761
- * https, it will use fetch, otherwise it will use websockets.
1607
+ * Groupings to use when generating the Totals Table. One row will exist for each unique set of values observed in
1608
+ * these columns. See also `Table.selectDistinct`.
1762
1609
  */
1763
- transportFactory?:dh.grpc.GrpcTransportFactory|null;
1610
+ groupBy:Array<string>;
1764
1611
 
1765
1612
  constructor();
1766
- }
1767
-
1768
- export class LongWrapper {
1769
- protected constructor();
1770
1613
 
1771
- static ofString(str:string):LongWrapper;
1772
- asNumber():number;
1773
- valueOf():string;
1774
1614
  toString():string;
1775
1615
  }
1776
1616
 
1777
- /**
1778
- * Wrap BigDecimal values for use in JS. Provides text formatting for display and access to the underlying value.
1779
- */
1780
- export class BigDecimalWrapper {
1617
+ export class LongWrapper {
1781
1618
  protected constructor();
1782
1619
 
1783
- static ofString(value:string):BigDecimalWrapper;
1620
+ static ofString(str:string):LongWrapper;
1784
1621
  asNumber():number;
1785
1622
  valueOf():string;
1786
1623
  toString():string;
1787
- equals(o:object):boolean;
1788
- hashCode():number;
1789
1624
  }
1790
1625
 
1791
1626
  /**
1792
- * This class allows iteration over non-contiguous indexes. In the future, this will support the EcmaScript 2015
1793
- * Iteration protocol, but for now has one method which returns an iterator, and also supports querying the size.
1794
- * Additionally, we may add support for creating RangeSet objects to better serve some use cases.
1627
+ * Describes data that can be filtered, either a column reference or a literal value. Used this way, the type of a value
1628
+ * can be specified so that values which are ambiguous or not well supported in JS will not be confused with Strings or
1629
+ * imprecise numbers (e.g., nanosecond-precision date values). Additionally, once wrapped in this way, methods can be
1630
+ * called on these value literal instances. These instances are immutable - any method called on them returns a new
1631
+ * instance.
1795
1632
  */
1796
- export class RangeSet {
1633
+ export class FilterValue {
1797
1634
  protected constructor();
1798
1635
 
1799
- static ofRange(first:number, last:number):RangeSet;
1800
- static ofItems(rows:number[]):RangeSet;
1801
- static ofRanges(ranges:RangeSet[]):RangeSet;
1802
- static ofSortedRanges(ranges:RangeSet[]):RangeSet;
1803
1636
  /**
1804
- * a new iterator over all indexes in this collection.
1805
- * @return Iterator of {@link dh.LongWrapper}
1637
+ * Constructs a number for the filter API from the given parameter. Can also be used on the values returned from
1638
+ * {@link TableData.get} for DateTime values. To create
1639
+ * a filter with a date, use <b>dh.DateWrapper.ofJsDate</b> or
1640
+ * {@link i18n.DateTimeFormat.parse}. To create a filter with a
1641
+ * 64-bit long integer, use {@link LongWrapper.ofString}.
1642
+ * @param input - the number to wrap as a FilterValue
1643
+ * @return an immutable FilterValue that can be built into a filter
1806
1644
  */
1807
- iterator():Iterator<LongWrapper>;
1645
+ static ofNumber(input:LongWrapper|number):FilterValue;
1808
1646
  /**
1809
- * The total count of items contained in this collection. In some cases this can be expensive to compute, and
1810
- * generally should not be needed except for debugging purposes, or preallocating space (i.e., do not call this
1811
- * property each time through a loop).
1812
- * @return double
1647
+ * a filter condition checking if the current value is equal to the given parameter
1648
+ * @param term -
1649
+ * @return {@link dh.FilterCondition}
1813
1650
  */
1814
- get size():number;
1815
- }
1816
-
1817
- /**
1818
- * Provides access to data in a table. Note that several methods present their response through Promises. This allows
1819
- * the client to both avoid actually connecting to the server until necessary, and also will permit some changes not to
1820
- * inform the UI right away that they have taken place.
1821
- */
1822
- export class Table implements JoinableTable, HasEventHandling {
1823
- readonly description?:string|null;
1824
- readonly pluginName?:string|null;
1825
- readonly layoutHints?:null|LayoutHints;
1651
+ eq(term:FilterValue):FilterCondition;
1826
1652
  /**
1827
- * The table size has updated, so live scrollbars and the like can be updated accordingly.
1653
+ * a filter condition checking if the current value is equal to the given parameter, ignoring differences of upper
1654
+ * vs lower case
1655
+ * @param term -
1656
+ * @return {@link dh.FilterCondition}
1828
1657
  */
1829
- static readonly EVENT_SIZECHANGED:string;
1658
+ eqIgnoreCase(term:FilterValue):FilterCondition;
1830
1659
  /**
1831
- * The table size has updated, so live scrollbars and the like can be updated accordingly.
1660
+ * a filter condition checking if the current value is not equal to the given parameter
1661
+ * @param term -
1662
+ * @return {@link dh.FilterCondition}
1832
1663
  */
1833
- static readonly EVENT_UPDATED:string;
1664
+ notEq(term:FilterValue):FilterCondition;
1834
1665
  /**
1835
- * The table size has updated, so live scrollbars and the like can be updated accordingly.
1666
+ * a filter condition checking if the current value is not equal to the given parameter, ignoring differences of
1667
+ * upper vs lower case
1668
+ * @param term -
1669
+ * @return {@link dh.FilterCondition}
1836
1670
  */
1837
- static readonly EVENT_ROWADDED:string;
1671
+ notEqIgnoreCase(term:FilterValue):FilterCondition;
1838
1672
  /**
1839
- * The table size has updated, so live scrollbars and the like can be updated accordingly.
1673
+ * a filter condition checking if the current value is greater than the given parameter
1674
+ * @param term -
1675
+ * @return {@link dh.FilterCondition}
1840
1676
  */
1841
- static readonly EVENT_ROWREMOVED:string;
1677
+ greaterThan(term:FilterValue):FilterCondition;
1842
1678
  /**
1843
- * The table size has updated, so live scrollbars and the like can be updated accordingly.
1679
+ * a filter condition checking if the current value is less than the given parameter
1680
+ * @param term -
1681
+ * @return {@link dh.FilterCondition}
1844
1682
  */
1845
- static readonly EVENT_ROWUPDATED:string;
1683
+ lessThan(term:FilterValue):FilterCondition;
1846
1684
  /**
1847
- * The table size has updated, so live scrollbars and the like can be updated accordingly.
1685
+ * a filter condition checking if the current value is greater than or equal to the given parameter
1686
+ * @param term -
1687
+ * @return {@link dh.FilterCondition}
1848
1688
  */
1849
- static readonly EVENT_SORTCHANGED:string;
1689
+ greaterThanOrEqualTo(term:FilterValue):FilterCondition;
1850
1690
  /**
1851
- * The table size has updated, so live scrollbars and the like can be updated accordingly.
1691
+ * a filter condition checking if the current value is less than or equal to the given parameter
1692
+ * @param term -
1693
+ * @return {@link dh.FilterCondition}
1852
1694
  */
1853
- static readonly EVENT_FILTERCHANGED:string;
1695
+ lessThanOrEqualTo(term:FilterValue):FilterCondition;
1854
1696
  /**
1855
- * The table size has updated, so live scrollbars and the like can be updated accordingly.
1697
+ * a filter condition checking if the current value is in the given set of values
1698
+ * @param terms -
1699
+ * @return {@link dh.FilterCondition}
1856
1700
  */
1857
- static readonly EVENT_CUSTOMCOLUMNSCHANGED:string;
1701
+ in(terms:FilterValue[]):FilterCondition;
1858
1702
  /**
1859
- * The table size has updated, so live scrollbars and the like can be updated accordingly.
1860
- */
1861
- static readonly EVENT_DISCONNECT:string;
1703
+ * a filter condition checking if the current value is in the given set of values, ignoring differences of upper vs
1704
+ * lower case
1705
+ * @param terms -
1706
+ * @return {@link dh.FilterCondition}
1707
+ */
1708
+ inIgnoreCase(terms:FilterValue[]):FilterCondition;
1709
+ /**
1710
+ * a filter condition checking that the current value is not in the given set of values
1711
+ * @param terms -
1712
+ * @return {@link dh.FilterCondition}
1713
+ */
1714
+ notIn(terms:FilterValue[]):FilterCondition;
1715
+ /**
1716
+ * a filter condition checking that the current value is not in the given set of values, ignoring differences of
1717
+ * upper vs lower case
1718
+ * @param terms -
1719
+ * @return {@link dh.FilterCondition}
1720
+ */
1721
+ notInIgnoreCase(terms:FilterValue[]):FilterCondition;
1722
+ /**
1723
+ * a filter condition checking if the given value contains the given string value
1724
+ * @param term -
1725
+ * @return {@link dh.FilterCondition}
1726
+ */
1727
+ contains(term:FilterValue):FilterCondition;
1728
+ /**
1729
+ * a filter condition checking if the given value contains the given string value, ignoring differences of upper vs
1730
+ * lower case
1731
+ * @param term -
1732
+ * @return {@link dh.FilterCondition}
1733
+ */
1734
+ containsIgnoreCase(term:FilterValue):FilterCondition;
1735
+ /**
1736
+ * a filter condition checking if the given value matches the provided regular expressions string. Regex patterns
1737
+ * use Java regex syntax
1738
+ * @param pattern -
1739
+ * @return {@link dh.FilterCondition}
1740
+ */
1741
+ matches(pattern:FilterValue):FilterCondition;
1742
+ /**
1743
+ * a filter condition checking if the given value matches the provided regular expressions string, ignoring
1744
+ * differences of upper vs lower case. Regex patterns use Java regex syntax
1745
+ * @param pattern -
1746
+ * @return {@link dh.FilterCondition}
1747
+ */
1748
+ matchesIgnoreCase(pattern:FilterValue):FilterCondition;
1749
+ /**
1750
+ * a filter condition checking if the current value is a true boolean
1751
+ * @return {@link dh.FilterCondition}
1752
+ */
1753
+ isTrue():FilterCondition;
1754
+ /**
1755
+ * a filter condition checking if the current value is a false boolean
1756
+ * @return {@link dh.FilterCondition}
1757
+ */
1758
+ isFalse():FilterCondition;
1759
+ /**
1760
+ * a filter condition checking if the current value is a null value
1761
+ * @return {@link dh.FilterCondition}
1762
+ */
1763
+ isNull():FilterCondition;
1764
+ /**
1765
+ * a filter condition invoking the given method on the current value, with the given parameters. Currently supported
1766
+ * functions that can be invoked on a String:
1767
+ * <ul>
1768
+ * <li><b>startsWith</b>: Returns true if the current string value starts with the supplied string argument</li>
1769
+ * <li><b>endsWith</b>: Returns true if the current string value ends with the supplied string argument</li>
1770
+ * <li><b>matches</b>: Returns true if the current string value matches the supplied string argument used as a Java
1771
+ * regular expression</li>
1772
+ * <li><b>contains</b>: Returns true if the current string value contains the supplied string argument
1773
+ * <p>
1774
+ * When invoking against a constant, this should be avoided in favor of FilterValue.contains
1775
+ * </p>
1776
+ * </li>
1777
+ * </ul>
1778
+ * @param method -
1779
+ * @param args -
1780
+ * @return
1781
+ */
1782
+ invoke(method:string, ...args:FilterValue[]):FilterCondition;
1783
+ toString():string;
1784
+ /**
1785
+ * Constructs a string for the filter API from the given parameter.
1786
+ * @param input -
1787
+ * @return
1788
+ */
1789
+ static ofString(input:any):FilterValue;
1790
+ /**
1791
+ * Constructs a boolean for the filter API from the given parameter.
1792
+ * @param b -
1793
+ * @return
1794
+ */
1795
+ static ofBoolean(b:boolean):FilterValue;
1796
+ }
1797
+
1798
+ /**
1799
+ * A Widget represents a server side object that sends one or more responses to the client. The client can then
1800
+ * interpret these responses to see what to render, or how to respond.
1801
+ * <p>
1802
+ * Most custom object types result in a single response being sent to the client, often with other exported objects, but
1803
+ * some will have streamed responses, and allow the client to send follow-up requests of its own. This class's API is
1804
+ * backwards compatible, but as such does not offer a way to tell the difference between a streaming or non-streaming
1805
+ * object type, the client code that handles the payloads is expected to know what to expect. See
1806
+ * {@link dh.WidgetMessageDetails} for more information.
1807
+ * <p>
1808
+ * When the promise that returns this object resolves, it will have the first response assigned to its fields. Later
1809
+ * responses from the server will be emitted as "message" events. When the connection with the server ends, the "close"
1810
+ * event will be emitted. In this way, the connection will behave roughly in the same way as a WebSocket - either side
1811
+ * can close, and after close no more messages will be processed. There can be some latency in closing locally while
1812
+ * remote messages are still pending - it is up to implementations of plugins to handle this case.
1813
+ * <p>
1814
+ * Also like WebSockets, the plugin API doesn't define how to serialize messages, and just handles any binary payloads.
1815
+ * What it does handle however, is allowing those messages to include references to server-side objects with those
1816
+ * payloads. Those server side objects might be tables or other built-in types in the Deephaven JS API, or could be
1817
+ * objects usable through their own plugins. They also might have no plugin at all, allowing the client to hold a
1818
+ * reference to them and pass them back to the server, either to the current plugin instance, or through another API.
1819
+ * The `Widget` type does not specify how those objects should be used or their lifecycle, but leaves that
1820
+ * entirely to the plugin. Messages will arrive in the order they were sent.
1821
+ * <p>
1822
+ * This can suggest several patterns for how plugins operate:
1823
+ * <ul>
1824
+ * <li>The plugin merely exists to transport some other object to the client. This can be useful for objects which can
1825
+ * easily be translated to some other type (like a Table) when the user clicks on it. An example of this is
1826
+ * `pandas.DataFrame` will result in a widget that only contains a static
1827
+ * {@link dh.Table}. Presently, the widget is immediately closed, and only the Table is
1828
+ * provided to the JS API consumer.</li>
1829
+ * <li>The plugin provides references to Tables and other objects, and those objects can live longer than the object
1830
+ * which provided them. One concrete example of this could have been
1831
+ * {@link dh.PartitionedTable} when fetching constituent tables, but it was implemented
1832
+ * before bidirectional plugins were implemented. Another example of this is plugins that serve as a "factory", giving
1833
+ * the user access to table manipulation/creation methods not supported by gRPC or the JS API.</li>
1834
+ * <li>The plugin provides reference to Tables and other objects that only make sense within the context of the widget
1835
+ * instance, so when the widget goes away, those objects should be released as well. This is also an example of
1836
+ * {@link dh.PartitionedTable}, as the partitioned table tracks creation of new keys through
1837
+ * an internal table instance.</li>
1838
+ * </ul>
1839
+ *
1840
+ * Handling server objects in messages also has more than one potential pattern that can be used:
1841
+ * <ul>
1842
+ * <li>One object per message - the message clearly is about that object, no other details required.</li>
1843
+ * <li>Objects indexed within their message - as each message comes with a list of objects, those objects can be
1844
+ * referenced within the payload by index. This is roughly how {@link dh.plot.Figure}
1845
+ * behaves, where the figure descriptor schema includes an index for each created series, describing which table should
1846
+ * be used, which columns should be mapped to each axis.</li>
1847
+ * <li>Objects indexed since widget creation - each message would append its objects to a list created when the widget
1848
+ * was first made, and any new exports that arrive in a new message would be appended to that list. Then, subsequent
1849
+ * messages can reference objects already sent. This imposes a limitation where the client cannot release any exports
1850
+ * without the server somehow signaling that it will never reference that export again.</li>
1851
+ * </ul>
1852
+ */
1853
+ export class Widget implements WidgetMessageDetails, HasEventHandling {
1854
+ static readonly EVENT_MESSAGE:string;
1855
+ static readonly EVENT_CLOSE:string;
1856
+
1857
+ protected constructor();
1858
+
1859
+ /**
1860
+ * Ends the client connection to the server.
1861
+ */
1862
+ close():void;
1863
+ getDataAsBase64():string;
1864
+ getDataAsU8():Uint8Array;
1865
+ getDataAsString():string;
1866
+ /**
1867
+ * Sends a string/bytes payload to the server, along with references to objects that exist on the server.
1868
+ * @param msg - string/buffer/view instance that represents data to send
1869
+ * @param references - an array of objects that can be safely sent to the server
1870
+ */
1871
+ sendMessage(msg:string|ArrayBuffer|ArrayBufferView, references?:Array<Table|Widget|WidgetExportedObject|PartitionedTable|TotalsTable|TreeTable>):void;
1872
+ addEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):()=>void;
1873
+ nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<Event<T>>;
1874
+ hasListeners(name:string):boolean;
1875
+ removeEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):boolean;
1876
+ /**
1877
+ *
1878
+ * @return the exported objects sent in the initial message from the server. The client is responsible for closing
1879
+ * them when finished using them.
1880
+ */
1881
+ get exportedObjects():WidgetExportedObject[];
1882
+ /**
1883
+ *
1884
+ * @return the type of this widget
1885
+ */
1886
+ get type():string;
1887
+ }
1888
+
1889
+ /**
1890
+ * A js type for operating on input tables.
1891
+ *
1892
+ * Represents a User Input Table, which can have data added to it from other sources.
1893
+ *
1894
+ * You may add rows using dictionaries of key-value tuples (representing columns by name), add tables containing all the
1895
+ * key/value columns to add, or delete tables containing the keys to delete. Each operation is atomic, and will either
1896
+ * succeed completely or fail completely. To guarantee order of operations, apply an operation and wait for the response
1897
+ * before sending the next operation.
1898
+ *
1899
+ * Each table has one or more key columns, where each unique combination of keys will appear at most once in the table.
1900
+ *
1901
+ * To view the results of the Input Table, you should use standard table operations on the InputTable's source Table
1902
+ * object.
1903
+ */
1904
+ export class InputTable {
1905
+ protected constructor();
1906
+
1907
+ /**
1908
+ * Adds a single row to the table. For each key or value column name in the Input Table, we retrieve that javascript
1909
+ * property at that name and validate it can be put into the given column type.
1910
+ * @param row -
1911
+ * @param userTimeZone -
1912
+ * @return Promise of dh.InputTable
1913
+ */
1914
+ addRow(row:{ [key: string]: any; }, userTimeZone?:string):Promise<InputTable>;
1915
+ /**
1916
+ * Add multiple rows to a table.
1917
+ * @param rows -
1918
+ * @param userTimeZone -
1919
+ * @return Promise of dh.InputTable
1920
+ */
1921
+ addRows(rows:{ [key: string]: any; }[], userTimeZone?:string):Promise<InputTable>;
1922
+ /**
1923
+ * Add an entire table to this Input Table. Only column names that match the definition of the input table will be
1924
+ * copied, and all key columns must have values filled in. This only copies the current state of the source table;
1925
+ * future updates to the source table will not be reflected in the Input Table. The returned promise will be
1926
+ * resolved to the same InputTable instance this method was called upon once the server returns.
1927
+ * @param tableToAdd -
1928
+ * @return Promise of dh.InputTable
1929
+ */
1930
+ addTable(tableToAdd:Table):Promise<InputTable>;
1931
+ /**
1932
+ * Add multiple tables to this Input Table.
1933
+ * @param tablesToAdd -
1934
+ * @return Promise of dh.InputTable
1935
+ */
1936
+ addTables(tablesToAdd:Table[]):Promise<InputTable>;
1937
+ /**
1938
+ * Deletes an entire table from this Input Table. Key columns must match the Input Table.
1939
+ * @param tableToDelete -
1940
+ * @return Promise of dh.InputTable
1941
+ */
1942
+ deleteTable(tableToDelete:Table):Promise<InputTable>;
1943
+ /**
1944
+ * Delete multiple tables from this Input Table.
1945
+ * @param tablesToDelete -
1946
+ * @return
1947
+ */
1948
+ deleteTables(tablesToDelete:Table[]):Promise<InputTable>;
1949
+ /**
1950
+ * A list of the key columns, by name
1951
+ * @return String array.
1952
+ */
1953
+ get keys():string[];
1954
+ /**
1955
+ * A list of the value columns, by name
1956
+ * @return String array.
1957
+ */
1958
+ get values():string[];
1959
+ /**
1960
+ * A list of the key columns.
1961
+ * @return Column array.
1962
+ */
1963
+ get keyColumns():Column[];
1964
+ /**
1965
+ * A list of the value Column objects
1966
+ * @return {@link dh.Column} array.
1967
+ */
1968
+ get valueColumns():Column[];
1969
+ /**
1970
+ * The source table for this Input Table
1971
+ * @return dh.table
1972
+ */
1973
+ get table():Table;
1974
+ }
1975
+
1976
+ /**
1977
+ * Wrap BigDecimal values for use in JS. Provides text formatting for display and access to the underlying value.
1978
+ */
1979
+ export class BigDecimalWrapper {
1980
+ protected constructor();
1981
+
1982
+ static ofString(value:string):BigDecimalWrapper;
1983
+ asNumber():number;
1984
+ valueOf():string;
1985
+ toString():string;
1986
+ equals(o:object):boolean;
1987
+ hashCode():number;
1988
+ }
1989
+
1990
+ /**
1991
+ * Exists to keep the dh.TableMap namespace so that the web UI can remain compatible with the DHE API, which still calls
1992
+ * this type TableMap.
1993
+ * @deprecated
1994
+ */
1995
+ export class TableMap {
1996
+ static readonly EVENT_KEYADDED:string;
1997
+ static readonly EVENT_DISCONNECT:string;
1998
+ static readonly EVENT_RECONNECT:string;
1999
+ static readonly EVENT_RECONNECTFAILED:string;
2000
+
2001
+ protected constructor();
2002
+ }
2003
+
2004
+ /**
2005
+ * This object serves as a "handle" to a subscription, allowing it to be acted on directly or canceled outright. If you
2006
+ * retain an instance of this, you have two choices - either only use it to call `close()` on it to stop the table's
2007
+ * viewport without creating a new one, or listen directly to this object instead of the table for data events, and
2008
+ * always call `close()` when finished. Calling any method on this object other than close() will result in it
2009
+ * continuing to live on after `setViewport` is called on the original table, or after the table is modified.
2010
+ */
2011
+ export class TableViewportSubscription implements HasEventHandling {
2012
+ protected constructor();
2013
+
2014
+ /**
2015
+ * Changes the rows and columns set on this viewport. This cannot be used to change the update interval.
2016
+ * @param firstRow -
2017
+ * @param lastRow -
2018
+ * @param columns -
2019
+ * @param updateIntervalMs -
2020
+ */
2021
+ setViewport(firstRow:number, lastRow:number, columns?:Column[]|undefined|null, updateIntervalMs?:number|undefined|null, isReverseViewport?:boolean|undefined|null):void;
2022
+ /**
2023
+ * Stops this viewport from running, stopping all events on itself and on the table that created it.
2024
+ */
2025
+ close():void;
2026
+ /**
2027
+ * Gets the data currently visible in this viewport
2028
+ * @return Promise of {@link dh.TableData}.
2029
+ */
2030
+ getViewportData():Promise<ViewportData>;
2031
+ snapshot(rows:RangeSet, columns:Column[]):Promise<TableData>;
2032
+ /**
2033
+ * Listen for events on this object.
2034
+ * @param name - the name of the event to listen for
2035
+ * @param callback - a function to call when the event occurs
2036
+ * @return Returns a cleanup function.
2037
+ * @typeParam T - the type of the data that the event will provide
2038
+ */
2039
+ addEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):()=>void;
2040
+ nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<Event<T>>;
2041
+ hasListeners(name:string):boolean;
2042
+ /**
2043
+ * Removes an event listener added to this table.
2044
+ * @param name -
2045
+ * @param callback -
2046
+ * @return
2047
+ * @typeParam T -
2048
+ */
2049
+ removeEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):boolean;
2050
+ }
2051
+
2052
+ export class DateWrapper extends LongWrapper {
2053
+ protected constructor();
2054
+
2055
+ static ofJsDate(date:Date):DateWrapper;
2056
+ asDate():Date;
2057
+ }
2058
+
2059
+ export class LoginCredentials {
2060
+ type?:string|null;
2061
+ username?:string|null;
2062
+ token?:string|null;
2063
+
2064
+ constructor();
2065
+ }
2066
+
2067
+ /**
2068
+ * Options for custom columns.
2069
+ */
2070
+ export class CustomColumnOptions {
2071
+ /**
2072
+ * When specified for custom columns on a rollup table, specifies if the formula apply to rollup or constituent
2073
+ * nodes.
2074
+ */
2075
+ rollupNodeType?:RollupNodeTypeType|null;
2076
+
2077
+ constructor();
2078
+ }
2079
+
2080
+ /**
2081
+ * Wrap BigInteger values for use in JS. Provides text formatting for display and access to the underlying value.
2082
+ */
2083
+ export class BigIntegerWrapper {
2084
+ protected constructor();
2085
+
2086
+ static ofString(str:string):BigIntegerWrapper;
2087
+ asNumber():number;
2088
+ valueOf():string;
2089
+ toString():string;
2090
+ equals(o:object):boolean;
2091
+ hashCode():number;
2092
+ }
2093
+
2094
+ /**
2095
+ * Represents a non-viewport subscription to a table, and all data currently known to be present in the subscribed
2096
+ * columns. This class handles incoming snapshots and deltas, and fires events to consumers to notify of data changes.
2097
+ *
2098
+ * Unlike {@link dh.TableViewportSubscription}, the "original" table does not have a reference to this instance, only the
2099
+ * "private" table instance does, since the original cannot modify the subscription, and the private instance must
2100
+ * forward data to it.
2101
+ *
2102
+ * Represents a subscription to the table on the server. Changes made to the table will not be reflected here - the
2103
+ * subscription must be closed and a new one optioned to see those changes. The event model is slightly different from
2104
+ * viewports to make it less expensive to compute for large tables.
2105
+ */
2106
+ export class TableSubscription implements HasEventHandling {
2107
+ protected constructor();
2108
+
2109
+ /**
2110
+ * Updates the subscription to use the given columns and update interval.
2111
+ * @param columns - the new columns to subscribe to
2112
+ * @param updateIntervalMs - the new update interval, or null/omit to use the default of one second
2113
+ */
2114
+ changeSubscription(columns:Array<Column>, updateIntervalMs:number|undefined|null):void;
2115
+ get columns():Array<Column>;
2116
+ /**
2117
+ * Stops the subscription on the server.
2118
+ */
2119
+ close():void;
2120
+ /**
2121
+ * Listen for events on this object.
2122
+ * @param name - the name of the event to listen for
2123
+ * @param callback - a function to call when the event occurs
2124
+ * @return Returns a cleanup function.
2125
+ * @typeParam T - the type of the data that the event will provide
2126
+ */
2127
+ addEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):()=>void;
2128
+ nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<Event<T>>;
2129
+ hasListeners(name:string):boolean;
2130
+ /**
2131
+ * Removes an event listener added to this table.
2132
+ * @param name -
2133
+ * @param callback -
2134
+ * @return
2135
+ * @typeParam T -
2136
+ */
2137
+ removeEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):boolean;
2138
+ }
2139
+
2140
+ export class IdeSession implements HasEventHandling {
2141
+ static readonly EVENT_COMMANDSTARTED:string;
2142
+ static readonly EVENT_REQUEST_FAILED:string;
2143
+
2144
+ protected constructor();
2145
+
2146
+ /**
2147
+ * Load the named table, with columns and size information already fully populated.
2148
+ * @param name -
2149
+ * @param applyPreviewColumns - optional boolean
2150
+ * @return {@link Promise} of {@link dh.Table}
2151
+ */
2152
+ getTable(name:string, applyPreviewColumns?:boolean):Promise<Table>;
2153
+ /**
2154
+ * Load the named Figure, including its tables and tablemaps as needed.
2155
+ * @param name -
2156
+ * @return promise of dh.plot.Figure
2157
+ */
2158
+ getFigure(name:string):Promise<dh.plot.Figure>;
2159
+ /**
2160
+ * Loads the named tree table or roll-up table, with column data populated. All nodes are collapsed by default, and
2161
+ * size is presently not available until the viewport is first set.
2162
+ * @param name -
2163
+ * @return {@link Promise} of {@link dh.TreeTable}
2164
+ */
2165
+ getTreeTable(name:string):Promise<TreeTable>;
2166
+ getHierarchicalTable(name:string):Promise<TreeTable>;
2167
+ getPartitionedTable(name:string):Promise<PartitionedTable>;
2168
+ getObject(definitionObject:dh.ide.VariableDescriptor):Promise<any>;
2169
+ newTable(columnNames:string[], types:string[], data:string[][], userTimeZone:string):Promise<Table>;
2170
+ /**
2171
+ * Merges the given tables into a single table. Assumes all tables have the same structure.
2172
+ * @param tables -
2173
+ * @return {@link Promise} of {@link dh.Table}
2174
+ */
2175
+ mergeTables(tables:Table[]):Promise<Table>;
2176
+ bindTableToVariable(table:Table, name:string):Promise<void>;
2177
+ /**
2178
+ * Makes the `object` available to another user or another client on this same server which knows the value of
2179
+ * the `sharedTicketBytes`. Use that sharedTicketBytes value like a one-time use password - any other client
2180
+ * which knows this value can read the same object.
2181
+ * <p>
2182
+ * Shared objects will remain available using the sharedTicketBytes until the client that first shared them
2183
+ * releases/closes their copy of the object. Whatever side-channel is used to share the bytes, be sure to wait until
2184
+ * the remote end has signaled that it has successfully fetched the object before releasing it from this client.
2185
+ * <p>
2186
+ * Be sure to use an unpredictable value for the shared ticket bytes, like a UUID or other large, random value to
2187
+ * prevent access by unauthorized clients.
2188
+ * @param object - the object to share with another client/user
2189
+ * @param sharedTicketBytes - the value which another client/user must know to obtain the object. It may be a unicode
2190
+ * string (will be encoded as utf8 bytes), or a {@link Uint8Array} value.
2191
+ * @return A promise that will resolve to the value passed as sharedTicketBytes when the object is ready to be read
2192
+ * by another client, or will reject if an error occurs.
2193
+ */
2194
+ shareObject(object:Table|Widget|WidgetExportedObject|PartitionedTable|TotalsTable|TreeTable, sharedTicketBytes:string|Uint8Array):Promise<string|Uint8Array>;
2195
+ /**
2196
+ * Reads an object shared by another client to this server with the `sharedTicketBytes`. Until the other
2197
+ * client releases this object (or their session ends), the object will be available on the server.
2198
+ * <p>
2199
+ * The type of the object must be passed so that the object can be read from the server correct - the other client
2200
+ * should provide this information.
2201
+ * @param sharedTicketBytes - the value provided by another client/user to obtain the object. It may be a unicode
2202
+ * string (will be encoded as utf8 bytes), or a {@link Uint8Array} value.
2203
+ * @param type - The type of the object, so it can be correctly read from the server
2204
+ * @return A promise that will resolve to the shared object, or will reject with an error if it cannot be read.
2205
+ */
2206
+ getSharedObject(sharedTicketBytes:string|Uint8Array, type:string):Promise<any>;
2207
+ subscribeToFieldUpdates(callback:(arg0:dh.ide.VariableChanges)=>void):()=>void;
2208
+ close():void;
2209
+ runCode(code:string):Promise<dh.ide.CommandResult>;
2210
+ onLogMessage(callback:(arg0:dh.ide.LogItem)=>void):()=>void;
2211
+ openDocument(params:object):void;
2212
+ changeDocument(params:object):void;
2213
+ getCompletionItems(params:object):Promise<Array<dh.lsp.CompletionItem>>;
2214
+ getSignatureHelp(params:object):Promise<Array<dh.lsp.SignatureInformation>>;
2215
+ getHover(params:object):Promise<dh.lsp.Hover>;
2216
+ closeDocument(params:object):void;
2217
+ /**
2218
+ * Creates an empty table with the specified number of rows. Optionally columns and types may be specified, but all
2219
+ * values will be null.
2220
+ * @param size -
2221
+ * @return {@link Promise} of {@link dh.Table}
2222
+ */
2223
+ emptyTable(size:number):Promise<Table>;
2224
+ /**
2225
+ * Creates a new table that ticks automatically every "periodNanos" nanoseconds. A start time may be provided; if so
2226
+ * the table will be populated with the interval from the specified date until now.
2227
+ * @param periodNanos -
2228
+ * @param startTime -
2229
+ * @return {@link Promise} of {@link dh.Table}
2230
+ */
2231
+ timeTable(periodNanos:number, startTime?:DateWrapper):Promise<Table>;
2232
+ addEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):()=>void;
2233
+ nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<Event<T>>;
2234
+ hasListeners(name:string):boolean;
2235
+ removeEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):boolean;
2236
+ }
2237
+
2238
+ /**
2239
+ * Deprecated for use in Deephaven Core.
2240
+ * @deprecated
2241
+ */
2242
+ export class Client {
2243
+ static readonly EVENT_REQUEST_FAILED:string;
2244
+ static readonly EVENT_REQUEST_STARTED:string;
2245
+ static readonly EVENT_REQUEST_SUCCEEDED:string;
2246
+
2247
+ constructor();
2248
+ }
2249
+
2250
+ /**
2251
+ * Provides access to data in a table. Note that several methods present their response through Promises. This allows
2252
+ * the client to both avoid actually connecting to the server until necessary, and also will permit some changes not to
2253
+ * inform the UI right away that they have taken place.
2254
+ */
2255
+ export class Table implements JoinableTable, HasEventHandling {
2256
+ readonly description?:string|null;
2257
+ readonly pluginName?:string|null;
2258
+ readonly layoutHints?:null|LayoutHints;
2259
+ /**
2260
+ * The table size has updated, so live scrollbars and the like can be updated accordingly.
2261
+ */
2262
+ static readonly EVENT_SIZECHANGED:string;
2263
+ /**
2264
+ * The table size has updated, so live scrollbars and the like can be updated accordingly.
2265
+ */
2266
+ static readonly EVENT_UPDATED:string;
2267
+ /**
2268
+ * The table size has updated, so live scrollbars and the like can be updated accordingly.
2269
+ */
2270
+ static readonly EVENT_ROWADDED:string;
2271
+ /**
2272
+ * The table size has updated, so live scrollbars and the like can be updated accordingly.
2273
+ */
2274
+ static readonly EVENT_ROWREMOVED:string;
2275
+ /**
2276
+ * The table size has updated, so live scrollbars and the like can be updated accordingly.
2277
+ */
2278
+ static readonly EVENT_ROWUPDATED:string;
2279
+ /**
2280
+ * The table size has updated, so live scrollbars and the like can be updated accordingly.
2281
+ */
2282
+ static readonly EVENT_SORTCHANGED:string;
2283
+ /**
2284
+ * The table size has updated, so live scrollbars and the like can be updated accordingly.
2285
+ */
2286
+ static readonly EVENT_FILTERCHANGED:string;
2287
+ /**
2288
+ * The table size has updated, so live scrollbars and the like can be updated accordingly.
2289
+ */
2290
+ static readonly EVENT_CUSTOMCOLUMNSCHANGED:string;
2291
+ /**
2292
+ * The table size has updated, so live scrollbars and the like can be updated accordingly.
2293
+ */
2294
+ static readonly EVENT_DISCONNECT:string;
1862
2295
  /**
1863
2296
  * The table size has updated, so live scrollbars and the like can be updated accordingly.
1864
2297
  */
@@ -2058,519 +2491,233 @@ export namespace dh {
2058
2491
  * @param seekValue - Value to seek
2059
2492
  * @param insensitive - Optional value to flag a search as case-insensitive. Defaults to `false`.
2060
2493
  * @param contains - Optional value to have the seek value do a contains search instead of exact equality. Defaults to
2061
- * `false`.
2062
- * @param isBackwards - Optional value to seek backwards through the table instead of forwards. Defaults to `false`.
2063
- * @return A promise that resolves to the row value found.
2064
- */
2065
- seekRow(startingRow:number, column:Column, valueType:ValueTypeType, seekValue:any, insensitive?:boolean|undefined|null, contains?:boolean|undefined|null, isBackwards?:boolean|undefined|null):Promise<number>;
2066
- toString():string;
2067
- /**
2068
- * True if this table represents a user Input Table (created by InputTable.newInputTable). When true, you may call
2069
- * .inputTable() to add or remove data from the underlying table.
2070
- * @return boolean
2071
- */
2072
- get hasInputTable():boolean;
2073
- /**
2074
- * The columns that are present on this table. This is always all possible columns. If you specify fewer columns in
2075
- * .setViewport(), you will get only those columns in your ViewportData. <b>Number size</b> The total count of rows
2076
- * in the table. The size can and will change; see the <b>sizechanged</b> event for details. Size will be negative
2077
- * in exceptional cases (eg. the table is uncoalesced, see the <b>isUncoalesced</b> property for details).
2078
- * @return {@link dh.Column} array
2079
- */
2080
- get columns():Array<Column>;
2081
- /**
2082
- * The default configuration to be used when building a <b>TotalsTable</b> for this table.
2083
- * @return dh.TotalsTableConfig
2084
- */
2085
- get totalsTableConfig():TotalsTableConfig;
2086
- /**
2087
- * An ordered list of Sorts to apply to the table. To update, call <b>applySort()</b>. Note that this getter will
2088
- * return the new value immediately, even though it may take a little time to update on the server. You may listen
2089
- * for the <b>sortchanged</b> event to know when to update the UI.
2090
- * @return {@link dh.Sort} array
2091
- */
2092
- get sort():Array<Sort>;
2093
- /**
2094
- * An ordered list of custom column formulas to add to the table, either adding new columns or replacing existing
2095
- * ones. To update, call <b>applyCustomColumns()</b>.
2096
- * @return {@link dh.CustomColumn} array
2097
- */
2098
- get customColumns():Array<CustomColumn>;
2099
- /**
2100
- * True if this table may receive updates from the server, including size changed events, updated events after
2101
- * initial snapshot.
2102
- * @return boolean
2103
- */
2104
- get isRefreshing():boolean;
2105
- /**
2106
- * An ordered list of Filters to apply to the table. To update, call applyFilter(). Note that this getter will
2107
- * return the new value immediately, even though it may take a little time to update on the server. You may listen
2108
- * for the <b>filterchanged</b> event to know when to update the UI.
2109
- * @return {@link dh.FilterCondition} array
2110
- */
2111
- get filter():Array<FilterCondition>;
2112
- /**
2113
- * The total count of the rows in the table, excluding any filters. Unlike {@link Table.size}, changes to this value
2114
- * will not result in any event. If the table is unfiltered, this will return the same size as {@link Table.size}.
2115
- * If this table was uncoalesced before it was filtered, this will return {@link dh.Table.SIZE_UNCOALESCED}.
2116
- * @return the size of the table before filters, or {@link dh.Table.SIZE_UNCOALESCED}
2117
- */
2118
- get totalSize():number;
2119
- /**
2120
- * The total count of rows in the table. If there is a viewport subscription active, this size will be updated when
2121
- * the subscription updates. If not, and {@link Table.uncoalesced} is true, the size will be
2122
- * {@link dh.Table.SIZE_UNCOALESCED}. Otherwise, the size will be updated when the server's update graph processes changes.
2123
- * <p>
2124
- * When the size changes, the {@link dh.Table.EVENT_SIZECHANGED} event will be fired.
2125
- * @return the size of the table, or {@link dh.Table.SIZE_UNCOALESCED} if there is no subscription and the table is
2126
- * uncoalesced.
2127
- */
2128
- get size():number;
2129
- /**
2130
- * True if this table has been closed.
2131
- * @return boolean
2132
- */
2133
- get isClosed():boolean;
2134
- /**
2135
- * Read-only. True if this table is uncoalesced, indicating that work must be done before the table can be used.
2136
- * <p>
2137
- * Uncoalesced tables are expensive to operate on - filter to a single partition or range of partitions before
2138
- * subscribing to access only the desired data efficiently. A subscription can be specified without a filter, but
2139
- * this can be very expensive. To see which partitions are available, check each column on the table to see which
2140
- * have {@link Column.isPartitionColumn} as `true`, and filter those columns. To read the possible values
2141
- * for those columns, use {@link Table.selectDistinct}.
2142
- * @return True if the table is uncoaleced and should be filtered before operating on it, otherwise false.
2143
- */
2144
- get isUncoalesced():boolean;
2145
- /**
2146
- * Listen for events on this object.
2147
- * @param name - the name of the event to listen for
2148
- * @param callback - a function to call when the event occurs
2149
- * @return Returns a cleanup function.
2150
- * @typeParam T - the type of the data that the event will provide
2151
- */
2152
- addEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):()=>void;
2153
- nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<Event<T>>;
2154
- hasListeners(name:string):boolean;
2155
- /**
2156
- * Removes an event listener added to this table.
2157
- * @param name -
2158
- * @param callback -
2159
- * @return
2160
- * @typeParam T -
2161
- */
2162
- removeEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):boolean;
2163
- /**
2164
- * a Sort than can be used to reverse a table. This can be passed into n array in applySort. Note that Tree Tables
2165
- * do not support reverse.
2166
- * @return {@link dh.Sort}
2167
- */
2168
- static reverse():Sort;
2169
- }
2170
-
2171
- /**
2172
- * Event fired when a command is issued from the client.
2173
- */
2174
- export class CommandInfo {
2175
- constructor(code:string, result:Promise<dh.ide.CommandResult>);
2176
-
2177
- get result():Promise<dh.ide.CommandResult>;
2178
- get code():string;
2179
- }
2180
-
2181
- /**
2182
- * Describes a filter which can be applied to a table. Replacing these instances may be more expensive than reusing
2183
- * them. These instances are immutable - all operations that compose them to build bigger expressions return a new
2184
- * instance.
2185
- */
2186
- export class FilterCondition {
2187
- protected constructor();
2188
-
2189
- /**
2190
- * the opposite of this condition
2191
- * @return FilterCondition
2192
- */
2193
- not():FilterCondition;
2194
- /**
2195
- * a condition representing the current condition logically ANDed with the other parameters
2196
- * @param filters -
2197
- * @return FilterCondition
2198
- */
2199
- and(...filters:FilterCondition[]):FilterCondition;
2200
- /**
2201
- * a condition representing the current condition logically ORed with the other parameters
2202
- * @param filters -
2203
- * @return FilterCondition.
2204
- */
2205
- or(...filters:FilterCondition[]):FilterCondition;
2206
- /**
2207
- * a string suitable for debugging showing the details of this condition.
2208
- * @return String.
2209
- */
2210
- toString():string;
2211
- get columns():Array<Column>;
2212
- /**
2213
- * a filter condition invoking a static function with the given parameters. Currently supported Deephaven static
2214
- * functions:
2215
- * <ul>
2216
- * <li><b>inRange</b>: Given three comparable values, returns true if the first is less than the second but greater
2217
- * than the third</li>
2218
- * <li><b>isInf</b>:Returns true if the given number is <i>infinity</i></li>
2219
- * <li><b>isNaN</b>:Returns true if the given number is <i>not a number</i></li>
2220
- * <li><b>isNormal</b>:Returns true if the given number <i>is not null</i>, <i>is not infinity</i>, and <i>is not
2221
- * "not a number"</i></li>
2222
- * <li><b>startsWith</b>:Returns true if the first string starts with the second string</li>
2223
- * <li><b>endsWith</b>Returns true if the first string ends with the second string</li>
2224
- * <li><b>matches</b>:Returns true if the first string argument matches the second string used as a Java regular
2225
- * expression</li>
2226
- * <li><b>contains</b>:Returns true if the first string argument contains the second string as a substring</li>
2227
- * <li><b>in</b>:Returns true if the first string argument can be found in the second array argument.
2228
- * <p>
2229
- * Note that the array can only be specified as a column reference at this time - typically the `FilterValue.in`
2230
- * method should be used in other cases
2231
- * </p>
2232
- * </li>
2233
- * </ul>
2234
- * @param function -
2235
- * @param args -
2236
- * @return dh.FilterCondition
2237
- */
2238
- static invoke(func:string, ...args:FilterValue[]):FilterCondition;
2239
- /**
2240
- * a filter condition which will check if the given value can be found in any supported column on whatever table
2241
- * this FilterCondition is passed to. This FilterCondition is somewhat unique in that it need not be given a column
2242
- * instance, but will adapt to any table. On numeric columns, with a value passed in which can be parsed as a
2243
- * number, the column will be filtered to numbers which equal, or can be "rounded" effectively to this number. On
2244
- * String columns, the given value will match any column which contains this string in a case-insensitive search. An
2245
- * optional second argument can be passed, an array of `FilterValue` from the columns to limit this search to (see
2246
- * {@link dh.Column.filter}).
2247
- * @param value -
2248
- * @param columns -
2249
- * @return dh.FilterCondition
2250
- */
2251
- static search(value:FilterValue, columns?:FilterValue[]):FilterCondition;
2252
- }
2253
-
2254
- export class CustomColumn {
2255
- static readonly TYPE_FORMAT_COLOR:string;
2256
- static readonly TYPE_FORMAT_NUMBER:string;
2257
- static readonly TYPE_FORMAT_DATE:string;
2258
- static readonly TYPE_NEW:string;
2259
-
2260
- protected constructor();
2261
-
2262
- valueOf():string;
2494
+ * `false`.
2495
+ * @param isBackwards - Optional value to seek backwards through the table instead of forwards. Defaults to `false`.
2496
+ * @return A promise that resolves to the row value found.
2497
+ */
2498
+ seekRow(startingRow:number, column:Column, valueType:ValueTypeType, seekValue:any, insensitive?:boolean|undefined|null, contains?:boolean|undefined|null, isBackwards?:boolean|undefined|null):Promise<number>;
2263
2499
  toString():string;
2264
- static from(columnInfo:string):CustomColumn;
2265
2500
  /**
2266
- * The expression to evaluate this custom column.
2267
- * @return String
2501
+ * True if this table represents a user Input Table (created by InputTable.newInputTable). When true, you may call
2502
+ * .inputTable() to add or remove data from the underlying table.
2503
+ * @return boolean
2268
2504
  */
2269
- get expression():string;
2505
+ get hasInputTable():boolean;
2270
2506
  /**
2271
- * The name of the column to use.
2272
- * @return String
2507
+ * The columns that are present on this table. This is always all possible columns. If you specify fewer columns in
2508
+ * .setViewport(), you will get only those columns in your ViewportData. <b>Number size</b> The total count of rows
2509
+ * in the table. The size can and will change; see the <b>sizechanged</b> event for details. Size will be negative
2510
+ * in exceptional cases (eg. the table is uncoalesced, see the <b>isUncoalesced</b> property for details).
2511
+ * @return {@link dh.Column} array
2273
2512
  */
2274
- get name():string;
2513
+ get columns():Array<Column>;
2275
2514
  /**
2276
- * The options for this custom column.
2277
- * @return CustomColumOptions
2515
+ * The default configuration to be used when building a <b>TotalsTable</b> for this table.
2516
+ * @return dh.TotalsTableConfig
2278
2517
  */
2279
- get options():CustomColumnOptions;
2518
+ get totalsTableConfig():TotalsTableConfig;
2280
2519
  /**
2281
- * Type of custom column. One of
2282
- *
2283
- * <ul>
2284
- * <li>FORMAT_COLOR</li>
2285
- * <li>FORMAT_NUMBER</li>
2286
- * <li>FORMAT_DATE</li>
2287
- * <li>NEW</li>
2288
- * </ul>
2289
- * @return String
2520
+ * An ordered list of Sorts to apply to the table. To update, call <b>applySort()</b>. Note that this getter will
2521
+ * return the new value immediately, even though it may take a little time to update on the server. You may listen
2522
+ * for the <b>sortchanged</b> event to know when to update the UI.
2523
+ * @return {@link dh.Sort} array
2290
2524
  */
2291
- get type():string;
2292
- }
2293
-
2294
- export class LoginCredentials {
2295
- type?:string|null;
2296
- username?:string|null;
2297
- token?:string|null;
2298
-
2299
- constructor();
2300
- }
2301
-
2302
- /**
2303
- * Deprecated for use in Deephaven Core.
2304
- * @deprecated
2305
- */
2306
- export class Client {
2307
- static readonly EVENT_REQUEST_FAILED:string;
2308
- static readonly EVENT_REQUEST_STARTED:string;
2309
- static readonly EVENT_REQUEST_SUCCEEDED:string;
2310
-
2311
- constructor();
2312
- }
2313
-
2314
- /**
2315
- * Configuration object for running Table.treeTable to produce a hierarchical view of a given "flat" table.
2316
- *
2317
- * Like TotalsTableConfig, `TreeTableConfig` supports an operation map indicating how to aggregate the data, as well as
2318
- * an array of column names which will be the layers in the roll-up tree, grouped at each level. An additional optional
2319
- * value can be provided describing the strategy the engine should use when grouping the rows.
2320
- */
2321
- export class TreeTableConfig {
2525
+ get sort():Array<Sort>;
2322
2526
  /**
2323
- * The column representing the unique ID for each item
2527
+ * An ordered list of custom column formulas to add to the table, either adding new columns or replacing existing
2528
+ * ones. To update, call <b>applyCustomColumns()</b>.
2529
+ * @return {@link dh.CustomColumn} array
2324
2530
  */
2325
- idColumn:string;
2531
+ get customColumns():Array<CustomColumn>;
2326
2532
  /**
2327
- * The column representing the parent ID for each item
2533
+ * True if this table may receive updates from the server, including size changed events, updated events after
2534
+ * initial snapshot.
2535
+ * @return boolean
2328
2536
  */
2329
- parentColumn:string;
2537
+ get isRefreshing():boolean;
2330
2538
  /**
2331
- * Optional parameter indicating if items with an invalid parent ID should be promoted to root. Defaults to false.
2539
+ * An ordered list of Filters to apply to the table. To update, call applyFilter(). Note that this getter will
2540
+ * return the new value immediately, even though it may take a little time to update on the server. You may listen
2541
+ * for the <b>filterchanged</b> event to know when to update the UI.
2542
+ * @return {@link dh.FilterCondition} array
2332
2543
  */
2333
- promoteOrphansToRoot:boolean;
2334
-
2335
- constructor();
2336
- }
2337
-
2338
- export class DateWrapper extends LongWrapper {
2339
- protected constructor();
2340
-
2341
- static ofJsDate(date:Date):DateWrapper;
2342
- asDate():Date;
2343
- }
2344
-
2345
- /**
2346
- * Describes a grouping and aggregations for a roll-up table. Pass to the <b>Table.rollup</b> function to create a
2347
- * roll-up table.
2348
- */
2349
- export class RollupConfig {
2544
+ get filter():Array<FilterCondition>;
2350
2545
  /**
2351
- * Ordered list of columns to group by to form the hierarchy of the resulting roll-up table.
2546
+ * The total count of the rows in the table, excluding any filters. Unlike {@link Table.size}, changes to this value
2547
+ * will not result in any event. If the table is unfiltered, this will return the same size as {@link Table.size}.
2548
+ * If this table was uncoalesced before it was filtered, this will return {@link dh.Table.SIZE_UNCOALESCED}.
2549
+ * @return the size of the table before filters, or {@link dh.Table.SIZE_UNCOALESCED}
2352
2550
  */
2353
- groupingColumns:Array<String>;
2551
+ get totalSize():number;
2354
2552
  /**
2355
- * Mapping from each aggregation name to the ordered list of columns it should be applied to in the resulting
2356
- * roll-up table.
2553
+ * The total count of rows in the table. If there is a viewport subscription active, this size will be updated when
2554
+ * the subscription updates. If not, and {@link Table.uncoalesced} is true, the size will be
2555
+ * {@link dh.Table.SIZE_UNCOALESCED}. Otherwise, the size will be updated when the server's update graph processes changes.
2556
+ * <p>
2557
+ * When the size changes, the {@link dh.Table.EVENT_SIZECHANGED} event will be fired.
2558
+ * @return the size of the table, or {@link dh.Table.SIZE_UNCOALESCED} if there is no subscription and the table is
2559
+ * uncoalesced.
2357
2560
  */
2358
- aggregations:{ [key: string]: Array<string>; };
2561
+ get size():number;
2359
2562
  /**
2360
- * Optional parameter indicating if an extra leaf node should be added at the bottom of the hierarchy, showing the
2361
- * rows in the underlying table which make up that grouping. Since these values might be a different type from the
2362
- * rest of the column, any client code must check if TreeRow.hasChildren = false, and if so, interpret those values
2363
- * as if they were Column.constituentType instead of Column.type. Defaults to false.
2563
+ * True if this table has been closed.
2564
+ * @return boolean
2364
2565
  */
2365
- includeConstituents:boolean;
2366
- includeOriginalColumns?:boolean|null;
2566
+ get isClosed():boolean;
2367
2567
  /**
2368
- * Optional parameter indicating if original column descriptions should be included. Defaults to true.
2568
+ * Read-only. True if this table is uncoalesced, indicating that work must be done before the table can be used.
2569
+ * <p>
2570
+ * Uncoalesced tables are expensive to operate on - filter to a single partition or range of partitions before
2571
+ * subscribing to access only the desired data efficiently. A subscription can be specified without a filter, but
2572
+ * this can be very expensive. To see which partitions are available, check each column on the table to see which
2573
+ * have {@link Column.isPartitionColumn} as `true`, and filter those columns. To read the possible values
2574
+ * for those columns, use {@link Table.selectDistinct}.
2575
+ * @return True if the table is uncoaleced and should be filtered before operating on it, otherwise false.
2369
2576
  */
2370
- includeDescriptions:boolean;
2371
-
2372
- constructor();
2577
+ get isUncoalesced():boolean;
2578
+ /**
2579
+ * Listen for events on this object.
2580
+ * @param name - the name of the event to listen for
2581
+ * @param callback - a function to call when the event occurs
2582
+ * @return Returns a cleanup function.
2583
+ * @typeParam T - the type of the data that the event will provide
2584
+ */
2585
+ addEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):()=>void;
2586
+ nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<Event<T>>;
2587
+ hasListeners(name:string):boolean;
2588
+ /**
2589
+ * Removes an event listener added to this table.
2590
+ * @param name -
2591
+ * @param callback -
2592
+ * @return
2593
+ * @typeParam T -
2594
+ */
2595
+ removeEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):boolean;
2596
+ /**
2597
+ * a Sort than can be used to reverse a table. This can be passed into n array in applySort. Note that Tree Tables
2598
+ * do not support reverse.
2599
+ * @return {@link dh.Sort}
2600
+ */
2601
+ static reverse():Sort;
2373
2602
  }
2374
2603
 
2375
2604
  /**
2376
- * A Widget represents a server side object that sends one or more responses to the client. The client can then
2377
- * interpret these responses to see what to render, or how to respond.
2378
- * <p>
2379
- * Most custom object types result in a single response being sent to the client, often with other exported objects, but
2380
- * some will have streamed responses, and allow the client to send follow-up requests of its own. This class's API is
2381
- * backwards compatible, but as such does not offer a way to tell the difference between a streaming or non-streaming
2382
- * object type, the client code that handles the payloads is expected to know what to expect. See
2383
- * {@link dh.WidgetMessageDetails} for more information.
2384
- * <p>
2385
- * When the promise that returns this object resolves, it will have the first response assigned to its fields. Later
2386
- * responses from the server will be emitted as "message" events. When the connection with the server ends, the "close"
2387
- * event will be emitted. In this way, the connection will behave roughly in the same way as a WebSocket - either side
2388
- * can close, and after close no more messages will be processed. There can be some latency in closing locally while
2389
- * remote messages are still pending - it is up to implementations of plugins to handle this case.
2390
- * <p>
2391
- * Also like WebSockets, the plugin API doesn't define how to serialize messages, and just handles any binary payloads.
2392
- * What it does handle however, is allowing those messages to include references to server-side objects with those
2393
- * payloads. Those server side objects might be tables or other built-in types in the Deephaven JS API, or could be
2394
- * objects usable through their own plugins. They also might have no plugin at all, allowing the client to hold a
2395
- * reference to them and pass them back to the server, either to the current plugin instance, or through another API.
2396
- * The `Widget` type does not specify how those objects should be used or their lifecycle, but leaves that
2397
- * entirely to the plugin. Messages will arrive in the order they were sent.
2398
- * <p>
2399
- * This can suggest several patterns for how plugins operate:
2400
- * <ul>
2401
- * <li>The plugin merely exists to transport some other object to the client. This can be useful for objects which can
2402
- * easily be translated to some other type (like a Table) when the user clicks on it. An example of this is
2403
- * `pandas.DataFrame` will result in a widget that only contains a static
2404
- * {@link dh.Table}. Presently, the widget is immediately closed, and only the Table is
2405
- * provided to the JS API consumer.</li>
2406
- * <li>The plugin provides references to Tables and other objects, and those objects can live longer than the object
2407
- * which provided them. One concrete example of this could have been
2408
- * {@link dh.PartitionedTable} when fetching constituent tables, but it was implemented
2409
- * before bidirectional plugins were implemented. Another example of this is plugins that serve as a "factory", giving
2410
- * the user access to table manipulation/creation methods not supported by gRPC or the JS API.</li>
2411
- * <li>The plugin provides reference to Tables and other objects that only make sense within the context of the widget
2412
- * instance, so when the widget goes away, those objects should be released as well. This is also an example of
2413
- * {@link dh.PartitionedTable}, as the partitioned table tracks creation of new keys through
2414
- * an internal table instance.</li>
2415
- * </ul>
2416
- *
2417
- * Handling server objects in messages also has more than one potential pattern that can be used:
2418
- * <ul>
2419
- * <li>One object per message - the message clearly is about that object, no other details required.</li>
2420
- * <li>Objects indexed within their message - as each message comes with a list of objects, those objects can be
2421
- * referenced within the payload by index. This is roughly how {@link dh.plot.Figure}
2422
- * behaves, where the figure descriptor schema includes an index for each created series, describing which table should
2423
- * be used, which columns should be mapped to each axis.</li>
2424
- * <li>Objects indexed since widget creation - each message would append its objects to a list created when the widget
2425
- * was first made, and any new exports that arrive in a new message would be appended to that list. Then, subsequent
2426
- * messages can reference objects already sent. This imposes a limitation where the client cannot release any exports
2427
- * without the server somehow signaling that it will never reference that export again.</li>
2428
- * </ul>
2605
+ * Represents a set of Tables each corresponding to some key. The keys are available locally, but a call must be made to
2606
+ * the server to get each Table. All tables will have the same structure.
2429
2607
  */
2430
- export class Widget implements WidgetMessageDetails, HasEventHandling {
2431
- static readonly EVENT_MESSAGE:string;
2432
- static readonly EVENT_CLOSE:string;
2433
-
2434
- protected constructor();
2435
-
2608
+ export class PartitionedTable implements HasEventHandling {
2436
2609
  /**
2437
- * Ends the client connection to the server.
2610
+ * Indicates that a new key has been added to the array of keys, which can now be fetched with getTable.
2438
2611
  */
2439
- close():void;
2440
- getDataAsBase64():string;
2441
- getDataAsU8():Uint8Array;
2442
- getDataAsString():string;
2612
+ static readonly EVENT_KEYADDED:string;
2443
2613
  /**
2444
- * Sends a string/bytes payload to the server, along with references to objects that exist on the server.
2445
- * @param msg - string/buffer/view instance that represents data to send
2446
- * @param references - an array of objects that can be safely sent to the server
2614
+ * Indicates that a new key has been added to the array of keys, which can now be fetched with getTable.
2447
2615
  */
2448
- sendMessage(msg:string|ArrayBuffer|ArrayBufferView, references?:Array<Table|Widget|WidgetExportedObject|PartitionedTable|TotalsTable|TreeTable>):void;
2449
- addEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):()=>void;
2450
- nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<Event<T>>;
2451
- hasListeners(name:string):boolean;
2452
- removeEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):boolean;
2616
+ static readonly EVENT_DISCONNECT:string;
2453
2617
  /**
2454
- *
2455
- * @return the exported objects sent in the initial message from the server. The client is responsible for closing
2456
- * them when finished using them.
2618
+ * Indicates that a new key has been added to the array of keys, which can now be fetched with getTable.
2457
2619
  */
2458
- get exportedObjects():WidgetExportedObject[];
2620
+ static readonly EVENT_RECONNECT:string;
2459
2621
  /**
2460
- *
2461
- * @return the type of this widget
2622
+ * Indicates that a new key has been added to the array of keys, which can now be fetched with getTable.
2462
2623
  */
2463
- get type():string;
2464
- }
2465
-
2466
- export class IdeSession implements HasEventHandling {
2467
- static readonly EVENT_COMMANDSTARTED:string;
2468
- static readonly EVENT_REQUEST_FAILED:string;
2624
+ static readonly EVENT_RECONNECTFAILED:string;
2469
2625
 
2470
2626
  protected constructor();
2471
2627
 
2472
2628
  /**
2473
- * Load the named table, with columns and size information already fully populated.
2474
- * @param name -
2475
- * @param applyPreviewColumns - optional boolean
2476
- * @return {@link Promise} of {@link dh.Table}
2629
+ * Fetch the table with the given key. If the key does not exist, returns `null`.
2630
+ * @param key - The key to fetch. An array of values for each key column, in the same order as the key columns are.
2631
+ * @return Promise of dh.Table, or `null` if the key does not exist.
2477
2632
  */
2478
- getTable(name:string, applyPreviewColumns?:boolean):Promise<Table>;
2633
+ getTable(key:object):Promise<Table|undefined|null>;
2479
2634
  /**
2480
- * Load the named Figure, including its tables and tablemaps as needed.
2481
- * @param name -
2482
- * @return promise of dh.plot.Figure
2635
+ * Open a new table that is the result of merging all constituent tables. See
2636
+ * {@link io.deephaven.engine.table.PartitionedTable.merge} for details.
2637
+ * @return A merged representation of the constituent tables.
2483
2638
  */
2484
- getFigure(name:string):Promise<dh.plot.Figure>;
2639
+ getMergedTable():Promise<Table>;
2485
2640
  /**
2486
- * Loads the named tree table or roll-up table, with column data populated. All nodes are collapsed by default, and
2487
- * size is presently not available until the viewport is first set.
2488
- * @param name -
2489
- * @return {@link Promise} of {@link dh.TreeTable}
2641
+ * The set of all currently known keys. This is kept up to date, so getting the list after adding an event listener
2642
+ * for <b>keyadded</b> will ensure no keys are missed.
2643
+ * @return Set of Object
2490
2644
  */
2491
- getTreeTable(name:string):Promise<TreeTable>;
2492
- getHierarchicalTable(name:string):Promise<TreeTable>;
2493
- getPartitionedTable(name:string):Promise<PartitionedTable>;
2494
- getObject(definitionObject:dh.ide.VariableDescriptor):Promise<any>;
2495
- newTable(columnNames:string[], types:string[], data:string[][], userTimeZone:string):Promise<Table>;
2645
+ getKeys():Set<object>;
2496
2646
  /**
2497
- * Merges the given tables into a single table. Assumes all tables have the same structure.
2498
- * @param tables -
2499
- * @return {@link Promise} of {@link dh.Table}
2647
+ * Fetch a table containing all the valid keys of the partitioned table.
2648
+ * @return Promise of a Table
2649
+ * @deprecated
2500
2650
  */
2501
- mergeTables(tables:Table[]):Promise<Table>;
2502
- bindTableToVariable(table:Table, name:string):Promise<void>;
2651
+ getKeyTable():Promise<Table>;
2503
2652
  /**
2504
- * Makes the `object` available to another user or another client on this same server which knows the value of
2505
- * the `sharedTicketBytes`. Use that sharedTicketBytes value like a one-time use password - any other client
2506
- * which knows this value can read the same object.
2507
- * <p>
2508
- * Shared objects will remain available using the sharedTicketBytes until the client that first shared them
2509
- * releases/closes their copy of the object. Whatever side-channel is used to share the bytes, be sure to wait until
2510
- * the remote end has signaled that it has successfully fetched the object before releasing it from this client.
2511
- * <p>
2512
- * Be sure to use an unpredictable value for the shared ticket bytes, like a UUID or other large, random value to
2513
- * prevent access by unauthorized clients.
2514
- * @param object - the object to share with another client/user
2515
- * @param sharedTicketBytes - the value which another client/user must know to obtain the object. It may be a unicode
2516
- * string (will be encoded as utf8 bytes), or a {@link Uint8Array} value.
2517
- * @return A promise that will resolve to the value passed as sharedTicketBytes when the object is ready to be read
2518
- * by another client, or will reject if an error occurs.
2653
+ * Fetch the underlying base table of the partitioned table.
2654
+ * @return Promise of a Table
2519
2655
  */
2520
- shareObject(object:Table|Widget|WidgetExportedObject|PartitionedTable|TotalsTable|TreeTable, sharedTicketBytes:string|Uint8Array):Promise<string|Uint8Array>;
2656
+ getBaseTable():Promise<Table>;
2521
2657
  /**
2522
- * Reads an object shared by another client to this server with the `sharedTicketBytes`. Until the other
2523
- * client releases this object (or their session ends), the object will be available on the server.
2524
- * <p>
2525
- * The type of the object must be passed so that the object can be read from the server correct - the other client
2526
- * should provide this information.
2527
- * @param sharedTicketBytes - the value provided by another client/user to obtain the object. It may be a unicode
2528
- * string (will be encoded as utf8 bytes), or a {@link Uint8Array} value.
2529
- * @param type - The type of the object, so it can be correctly read from the server
2530
- * @return A promise that will resolve to the shared object, or will reject with an error if it cannot be read.
2658
+ * Indicates that this PartitionedTable will no longer be used, removing subcriptions to updated keys, etc. This
2659
+ * will not affect tables in use.
2531
2660
  */
2532
- getSharedObject(sharedTicketBytes:string|Uint8Array, type:string):Promise<any>;
2533
- subscribeToFieldUpdates(callback:(arg0:dh.ide.VariableChanges)=>void):()=>void;
2534
2661
  close():void;
2535
- runCode(code:string):Promise<dh.ide.CommandResult>;
2536
- onLogMessage(callback:(arg0:dh.ide.LogItem)=>void):()=>void;
2537
- openDocument(params:object):void;
2538
- changeDocument(params:object):void;
2539
- getCompletionItems(params:object):Promise<Array<dh.lsp.CompletionItem>>;
2540
- getSignatureHelp(params:object):Promise<Array<dh.lsp.SignatureInformation>>;
2541
- getHover(params:object):Promise<dh.lsp.Hover>;
2542
- closeDocument(params:object):void;
2543
2662
  /**
2544
- * Creates an empty table with the specified number of rows. Optionally columns and types may be specified, but all
2545
- * values will be null.
2546
- * @param size -
2547
- * @return {@link Promise} of {@link dh.Table}
2663
+ * The count of known keys.
2664
+ * @return int
2548
2665
  */
2549
- emptyTable(size:number):Promise<Table>;
2666
+ get size():number;
2550
2667
  /**
2551
- * Creates a new table that ticks automatically every "periodNanos" nanoseconds. A start time may be provided; if so
2552
- * the table will be populated with the interval from the specified date until now.
2553
- * @param periodNanos -
2554
- * @param startTime -
2555
- * @return {@link Promise} of {@link dh.Table}
2668
+ * An array of the columns in the tables that can be retrieved from this partitioned table, including both key and
2669
+ * non-key columns.
2670
+ * @return Array of Column
2671
+ */
2672
+ get columns():Column[];
2673
+ /**
2674
+ * An array of all the key columns that the tables are partitioned by.
2675
+ * @return Array of Column
2676
+ */
2677
+ get keyColumns():Column[];
2678
+ /**
2679
+ * Listen for events on this object.
2680
+ * @param name - the name of the event to listen for
2681
+ * @param callback - a function to call when the event occurs
2682
+ * @return Returns a cleanup function.
2683
+ * @typeParam T - the type of the data that the event will provide
2556
2684
  */
2557
- timeTable(periodNanos:number, startTime?:DateWrapper):Promise<Table>;
2558
2685
  addEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):()=>void;
2559
2686
  nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<Event<T>>;
2560
2687
  hasListeners(name:string):boolean;
2688
+ /**
2689
+ * Removes an event listener added to this table.
2690
+ * @param name -
2691
+ * @param callback -
2692
+ * @return
2693
+ * @typeParam T -
2694
+ */
2561
2695
  removeEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):boolean;
2562
2696
  }
2563
2697
 
2564
- export class QueryInfo {
2565
- static readonly EVENT_TABLE_OPENED:string;
2566
- static readonly EVENT_DISCONNECT:string;
2567
- static readonly EVENT_RECONNECT:string;
2568
- static readonly EVENT_CONNECT:string;
2569
2698
 
2570
- protected constructor();
2699
+ /**
2700
+ * This enum describes the name of each supported operation/aggregation type when creating a `TreeTable`.
2701
+ */
2702
+ type AggregationOperationType = string;
2703
+ export class AggregationOperation {
2704
+ static readonly COUNT:AggregationOperationType;
2705
+ static readonly COUNT_DISTINCT:AggregationOperationType;
2706
+ static readonly DISTINCT:AggregationOperationType;
2707
+ static readonly MIN:AggregationOperationType;
2708
+ static readonly MAX:AggregationOperationType;
2709
+ static readonly SUM:AggregationOperationType;
2710
+ static readonly ABS_SUM:AggregationOperationType;
2711
+ static readonly VAR:AggregationOperationType;
2712
+ static readonly AVG:AggregationOperationType;
2713
+ static readonly MEDIAN:AggregationOperationType;
2714
+ static readonly STD:AggregationOperationType;
2715
+ static readonly FIRST:AggregationOperationType;
2716
+ static readonly LAST:AggregationOperationType;
2717
+ static readonly UNIQUE:AggregationOperationType;
2718
+ static readonly SKIP:AggregationOperationType;
2571
2719
  }
2572
2720
 
2573
-
2574
2721
  /**
2575
2722
  * Describes the type of node in a rollup table.
2576
2723
  */
@@ -2580,6 +2727,16 @@ export namespace dh {
2580
2727
  static readonly ROLLUP_NODE_TYPE_CONSTITUENT:RollupNodeTypeType;
2581
2728
  }
2582
2729
 
2730
+ type ValueTypeType = string;
2731
+ export class ValueType {
2732
+ static readonly STRING:ValueTypeType;
2733
+ static readonly NUMBER:ValueTypeType;
2734
+ static readonly DOUBLE:ValueTypeType;
2735
+ static readonly LONG:ValueTypeType;
2736
+ static readonly DATETIME:ValueTypeType;
2737
+ static readonly BOOLEAN:ValueTypeType;
2738
+ }
2739
+
2583
2740
  type SearchDisplayModeType = string;
2584
2741
  export class SearchDisplayMode {
2585
2742
  static readonly SEARCH_DISPLAY_DEFAULT:SearchDisplayModeType;
@@ -2599,159 +2756,57 @@ export namespace dh {
2599
2756
  static readonly PARTITIONEDTABLE:VariableTypeType;
2600
2757
  static readonly FIGURE:VariableTypeType;
2601
2758
  static readonly OTHERWIDGET:VariableTypeType;
2602
- static readonly PANDAS:VariableTypeType;
2603
- static readonly TREEMAP:VariableTypeType;
2604
- }
2605
-
2606
- type ValueTypeType = string;
2607
- export class ValueType {
2608
- static readonly STRING:ValueTypeType;
2609
- static readonly NUMBER:ValueTypeType;
2610
- static readonly DOUBLE:ValueTypeType;
2611
- static readonly LONG:ValueTypeType;
2612
- static readonly DATETIME:ValueTypeType;
2613
- static readonly BOOLEAN:ValueTypeType;
2614
- }
2615
-
2616
- /**
2617
- * This enum describes the name of each supported operation/aggregation type when creating a `TreeTable`.
2618
- */
2619
- type AggregationOperationType = string;
2620
- export class AggregationOperation {
2621
- static readonly COUNT:AggregationOperationType;
2622
- static readonly COUNT_DISTINCT:AggregationOperationType;
2623
- static readonly DISTINCT:AggregationOperationType;
2624
- static readonly MIN:AggregationOperationType;
2625
- static readonly MAX:AggregationOperationType;
2626
- static readonly SUM:AggregationOperationType;
2627
- static readonly ABS_SUM:AggregationOperationType;
2628
- static readonly VAR:AggregationOperationType;
2629
- static readonly AVG:AggregationOperationType;
2630
- static readonly MEDIAN:AggregationOperationType;
2631
- static readonly STD:AggregationOperationType;
2632
- static readonly FIRST:AggregationOperationType;
2633
- static readonly LAST:AggregationOperationType;
2634
- static readonly UNIQUE:AggregationOperationType;
2635
- static readonly SKIP:AggregationOperationType;
2636
- }
2637
-
2638
- }
2639
-
2640
- export namespace dh.ide {
2641
-
2642
- /**
2643
- * Describes changes in the current set of variables in the script session. Note that variables that changed value
2644
- * without changing type will be included as <b>updated</b>, but if a new value with one type replaces an old value with
2645
- * a different type, this will be included as an entry in both <b>removed</b> and <b>created</b> to indicate the old and
2646
- * new types.
2647
- */
2648
- export interface VariableChanges {
2649
- /**
2650
- *
2651
- * @return The variables that no longer exist after this operation, or were replaced by some variable with a
2652
- * different type.
2653
- */
2654
- get removed():Array<VariableDefinition>;
2655
- /**
2656
- *
2657
- * @return The variables that were created by this operation, or have a new type.
2658
- */
2659
- get created():Array<VariableDefinition>;
2660
- /**
2661
- *
2662
- * @return The variables that changed value during this operation.
2663
- */
2664
- get updated():Array<VariableDefinition>;
2665
- }
2666
- /**
2667
- * Represents a serialized fishlib LogRecord, suitable for display on javascript clients. A log entry sent from the
2668
- * server.
2669
- */
2670
- export interface LogItem {
2671
- /**
2672
- * The level of the log message, enabling the client to ignore messages.
2673
- * @return String
2674
- */
2675
- get logLevel():string;
2676
- /**
2677
- * Timestamp of the message in microseconds since Jan 1, 1970 UTC.
2678
- * @return double
2679
- */
2680
- get micros():number;
2681
- /**
2682
- * The log message written on the server.
2683
- * @return String
2684
- */
2685
- get message():string;
2686
- }
2687
- /**
2688
- * Specifies a type and either id or name (but not both).
2689
- */
2690
- export interface VariableDescriptor {
2691
- type:string;
2692
- id?:string|null;
2693
- name?:string|null;
2759
+ static readonly PANDAS:VariableTypeType;
2760
+ static readonly TREEMAP:VariableTypeType;
2694
2761
  }
2762
+
2763
+ }
2764
+
2765
+ export namespace dh.grpc {
2766
+
2695
2767
  /**
2696
- * Indicates the result of code run on the server.
2768
+ * Factory for creating gRPC transports.
2697
2769
  */
2698
- export interface CommandResult {
2770
+ export interface GrpcTransportFactory {
2699
2771
  /**
2700
- * Describes changes made in the course of this command.
2701
- * @return {@link dh.ide.VariableChanges}.
2772
+ * Create a new transport instance.
2773
+ * @param options - options for creating the transport
2774
+ * @return a transport instance to use for gRPC communication
2702
2775
  */
2703
- get changes():VariableChanges;
2776
+ create(options:GrpcTransportOptions):GrpcTransport;
2704
2777
  /**
2705
- * If the command failed, the error message will be provided here.
2706
- * @return String
2778
+ * Return true to signal that created transports may have {@link GrpcTransport.sendMessage} called on it
2779
+ * more than once before {@link GrpcTransport.finishSend} should be called.
2780
+ * @return true to signal that the implementation can stream multiple messages, false otherwise indicating that
2781
+ * Open/Next gRPC calls should be used
2707
2782
  */
2708
- get error():string;
2783
+ get supportsClientStreaming():boolean;
2709
2784
  }
2710
2785
  /**
2711
- * A format to describe a variable available to be read from the server. Application fields are optional, and only
2712
- * populated when a variable is provided by application mode.
2713
- * <p>
2714
- * APIs which take a VariableDefinition must at least be provided an object with a <b>type</b> and <b>id</b> field.
2786
+ * gRPC transport implementation.
2715
2787
  */
2716
- export interface VariableDefinition {
2717
- get name():string;
2718
- /**
2719
- * Optional description for the variable's contents, typically used to provide more detail that wouldn't be
2720
- * reasonable to put in the title
2721
- * @return String
2722
- */
2723
- get description():string;
2724
- /**
2725
- * An opaque identifier for this variable
2726
- * @return String
2727
- */
2728
- get id():string;
2788
+ export interface GrpcTransport {
2729
2789
  /**
2730
- * The type of the variable, one of <b>dh.VariableType</b>
2731
- * @return dh.VariableType.
2790
+ * Starts the stream, sending metadata to the server.
2791
+ * @param metadata - the headers to send the server when opening the connection
2732
2792
  */
2733
- get type():dh.VariableTypeType;
2793
+ start(metadata:{ [key: string]: string|Array<string>; }):void;
2734
2794
  /**
2735
- * The name of the variable, to be used when rendering it to a user
2736
- * @return String
2795
+ * Sends a message to the server.
2796
+ * @param msgBytes - bytes to send to the server
2737
2797
  */
2738
- get title():string;
2798
+ sendMessage(msgBytes:Uint8Array):void;
2739
2799
  /**
2740
- * Optional description for the variable's contents, typically used to provide more detail that wouldn't be
2741
- * reasonable to put in the title
2742
- * @return String
2800
+ * "Half close" the stream, signaling to the server that no more messages will be sent, but that the client is still
2801
+ * open to receiving messages.
2743
2802
  */
2744
- get applicationId():string;
2803
+ finishSend():void;
2745
2804
  /**
2746
- * The name of the application which provided this variable
2747
- * @return String
2805
+ * End the stream, both notifying the server that no more messages will be sent nor received, and preventing the
2806
+ * client from receiving any more events.
2748
2807
  */
2749
- get applicationName():string;
2808
+ cancel():void;
2750
2809
  }
2751
- }
2752
-
2753
- export namespace dh.grpc {
2754
-
2755
2810
  /**
2756
2811
  * Options for creating a gRPC stream transport instance.
2757
2812
  */
@@ -2779,52 +2834,107 @@ export namespace dh.grpc {
2779
2834
  */
2780
2835
  onEnd:(error?:Error|undefined|null)=>void;
2781
2836
  }
2837
+ }
2838
+
2839
+ export namespace dh.i18n {
2840
+
2782
2841
  /**
2783
- * gRPC transport implementation.
2842
+ * Largely an exported wrapper for the GWT DateFormat, but also includes support for formatting nanoseconds as an
2843
+ * additional 6 decimal places after the rest of the number.
2844
+ *
2845
+ * Other concerns that this handles includes accepting a js Date and ignoring the lack of nanos, accepting a js Number
2846
+ * and assuming it to be a lossy nano value, and parsing into a js Date.
2847
+ *
2848
+ *
2849
+ * Utility class to parse and format various date/time values, using the same format patterns as are supported by the
2850
+ * standard Java implementation used in the Deephaven server and swing client.
2851
+ *
2852
+ * As Deephaven internally uses nanosecond precision to record dates, this API expects nanoseconds in most use cases,
2853
+ * with the one exception of the JS `Date` type, which is not capable of more precision than milliseconds. Note,
2854
+ * however, that when passing nanoseconds as a JS `Number` there is likely to be some loss of precision, though this is
2855
+ * still supported for easier interoperability with other JS code. The values returned by `parse()` will be an opaque
2856
+ * object wrapping the full precision of the specified date, However, this object supports `toString()` and `valueOf()`
2857
+ * to return a string representation of that value, as well as a `asNumber()` to return a JS `Number` value and a
2858
+ * `asDate()` to return a JS `Date` value.
2859
+ *
2860
+ *
2861
+ * Caveats:
2862
+ *
2863
+ *
2864
+ * - The `D` format (for "day of year") is not supported by this implementation at this time. - The `%t` format for
2865
+ * short timezone code is not supported by this implementation at this time, though `z` will work as expected in the
2866
+ * browser to emit the user's own timezone.
2784
2867
  */
2785
- export interface GrpcTransport {
2868
+ export class DateTimeFormat {
2869
+ static readonly NANOS_PER_MILLI:number;
2870
+
2786
2871
  /**
2787
- * Starts the stream, sending metadata to the server.
2788
- * @param metadata - the headers to send the server when opening the connection
2872
+ * Creates a new date/time format instance. This generally should be avoided in favor of the static `getFormat`
2873
+ * function, which will create and cache an instance so that later calls share the same instance.
2874
+ * @param pattern -
2789
2875
  */
2790
- start(metadata:{ [key: string]: string|Array<string>; }):void;
2876
+ constructor(pattern:string);
2877
+
2791
2878
  /**
2792
- * Sends a message to the server.
2793
- * @param msgBytes - bytes to send to the server
2879
+ *
2880
+ * @param pattern -
2881
+ * @return a date format instance matching the specified format. If this format has not been specified before, a new
2882
+ * instance will be created and stored for later reuse.
2794
2883
  */
2795
- sendMessage(msgBytes:Uint8Array):void;
2884
+ static getFormat(pattern:string):DateTimeFormat;
2796
2885
  /**
2797
- * "Half close" the stream, signaling to the server that no more messages will be sent, but that the client is still
2798
- * open to receiving messages.
2886
+ * Accepts a variety of input objects to interpret as a date, and formats them using the specified pattern. A
2887
+ * `TimeZone` object can optionally be provided to format this date as the current date/time in that timezone.See
2888
+ * the instance method for more details on input objects.
2889
+ * @param pattern -
2890
+ * @param date -
2891
+ * @param timeZone -
2892
+ * @return
2799
2893
  */
2800
- finishSend():void;
2894
+ static format(pattern:string, date:any, timeZone?:TimeZone):string;
2801
2895
  /**
2802
- * End the stream, both notifying the server that no more messages will be sent nor received, and preventing the
2803
- * client from receiving any more events.
2896
+ * Parses the given input string using the provided pattern, and returns a JS `Date` object in milliseconds.
2897
+ * @param pattern -
2898
+ * @param text -
2899
+ * @return
2804
2900
  */
2805
- cancel():void;
2806
- }
2807
- /**
2808
- * Factory for creating gRPC transports.
2809
- */
2810
- export interface GrpcTransportFactory {
2901
+ static parseAsDate(pattern:string, text:string):Date;
2811
2902
  /**
2812
- * Create a new transport instance.
2813
- * @param options - options for creating the transport
2814
- * @return a transport instance to use for gRPC communication
2903
+ * Parses the given input string using the provided pattern, and returns a wrapped Java `long` value in nanoseconds.
2904
+ * A `TimeZone` object can optionally be provided to parse to a desired timezone.
2905
+ * @param pattern -
2906
+ * @param text -
2907
+ * @param tz -
2908
+ * @return
2815
2909
  */
2816
- create(options:GrpcTransportOptions):GrpcTransport;
2910
+ static parse(pattern:string, text:string, tz?:TimeZone):dh.DateWrapper;
2817
2911
  /**
2818
- * Return true to signal that created transports may have {@link GrpcTransport.sendMessage} called on it
2819
- * more than once before {@link GrpcTransport.finishSend} should be called.
2820
- * @return true to signal that the implementation can stream multiple messages, false otherwise indicating that
2821
- * Open/Next gRPC calls should be used
2912
+ * Takes a variety of objects to interpret as a date, and formats them using this instance's pattern. Inputs can
2913
+ * include a <b>String</b> value of a number expressed in nanoseconds, a <b>Number</b> value expressed in
2914
+ * nanoseconds, a JS <b>Date</b> object (necessarily in milliseconds), or a wrapped Java <b>long</b> value,
2915
+ * expressed in nanoseconds. A <b>TimeZone</b> object can optionally be provided to format this date as the current
2916
+ * date/time in that timezone.
2917
+ * @param date -
2918
+ * @param timeZone -
2919
+ * @return String
2822
2920
  */
2823
- get supportsClientStreaming():boolean;
2921
+ format(date:any, timeZone?:TimeZone):string;
2922
+ /**
2923
+ * Parses the given string using this instance's pattern, and returns a wrapped Java <b>long</b> value in
2924
+ * nanoseconds. A <b>TimeZone</b> object can optionally be provided to parse to a desired timezone.
2925
+ * @param text -
2926
+ * @param tz -
2927
+ * @return
2928
+ */
2929
+ parse(text:string, tz?:TimeZone):dh.DateWrapper;
2930
+ /**
2931
+ * Parses the given string using this instance's pattern, and returns a JS <b>Date</b> object in milliseconds.
2932
+ * @param text -
2933
+ * @return
2934
+ */
2935
+ parseAsDate(text:string):Date;
2936
+ toString():string;
2824
2937
  }
2825
- }
2826
-
2827
- export namespace dh.i18n {
2828
2938
 
2829
2939
  /**
2830
2940
  * Exported wrapper of the GWT NumberFormat, plus LongWrapper support
@@ -2962,182 +3072,39 @@ export namespace dh.i18n {
2962
3072
  * <li>BST</li>
2963
3073
  * <li>MOS</li>
2964
3074
  * <li>SHG</li>
2965
- * <li>CH</li>
2966
- * <li>NL</li>
2967
- * <li>TW</li>
2968
- * <li>SYD</li>
2969
- * <li>AEST</li>
2970
- * <li>AEDT</li>
2971
- * </ul>
2972
- */
2973
- export class TimeZone {
2974
- protected constructor();
2975
-
2976
- /**
2977
- * Factory method which creates timezone instances from one of the supported keys.
2978
- * @param tzCode -
2979
- * @return dh.i18n.TimeZone
2980
- */
2981
- static getTimeZone(tzCode:string):TimeZone;
2982
- /**
2983
- * the standard offset of this timezone, in minutes
2984
- * @return int
2985
- */
2986
- get standardOffset():number;
2987
- /**
2988
- * the timezone code that represents this `TimeZone`, usually the same key as was use to create this instance
2989
- * @return String
2990
- */
2991
- get id():string;
2992
- }
2993
-
2994
- /**
2995
- * Largely an exported wrapper for the GWT DateFormat, but also includes support for formatting nanoseconds as an
2996
- * additional 6 decimal places after the rest of the number.
2997
- *
2998
- * Other concerns that this handles includes accepting a js Date and ignoring the lack of nanos, accepting a js Number
2999
- * and assuming it to be a lossy nano value, and parsing into a js Date.
3000
- *
3001
- *
3002
- * Utility class to parse and format various date/time values, using the same format patterns as are supported by the
3003
- * standard Java implementation used in the Deephaven server and swing client.
3004
- *
3005
- * As Deephaven internally uses nanosecond precision to record dates, this API expects nanoseconds in most use cases,
3006
- * with the one exception of the JS `Date` type, which is not capable of more precision than milliseconds. Note,
3007
- * however, that when passing nanoseconds as a JS `Number` there is likely to be some loss of precision, though this is
3008
- * still supported for easier interoperability with other JS code. The values returned by `parse()` will be an opaque
3009
- * object wrapping the full precision of the specified date, However, this object supports `toString()` and `valueOf()`
3010
- * to return a string representation of that value, as well as a `asNumber()` to return a JS `Number` value and a
3011
- * `asDate()` to return a JS `Date` value.
3012
- *
3013
- *
3014
- * Caveats:
3015
- *
3016
- *
3017
- * - The `D` format (for "day of year") is not supported by this implementation at this time. - The `%t` format for
3018
- * short timezone code is not supported by this implementation at this time, though `z` will work as expected in the
3019
- * browser to emit the user's own timezone.
3020
- */
3021
- export class DateTimeFormat {
3022
- static readonly NANOS_PER_MILLI:number;
3023
-
3024
- /**
3025
- * Creates a new date/time format instance. This generally should be avoided in favor of the static `getFormat`
3026
- * function, which will create and cache an instance so that later calls share the same instance.
3027
- * @param pattern -
3028
- */
3029
- constructor(pattern:string);
3075
+ * <li>CH</li>
3076
+ * <li>NL</li>
3077
+ * <li>TW</li>
3078
+ * <li>SYD</li>
3079
+ * <li>AEST</li>
3080
+ * <li>AEDT</li>
3081
+ * </ul>
3082
+ */
3083
+ export class TimeZone {
3084
+ protected constructor();
3030
3085
 
3031
3086
  /**
3032
- *
3033
- * @param pattern -
3034
- * @return a date format instance matching the specified format. If this format has not been specified before, a new
3035
- * instance will be created and stored for later reuse.
3036
- */
3037
- static getFormat(pattern:string):DateTimeFormat;
3038
- /**
3039
- * Accepts a variety of input objects to interpret as a date, and formats them using the specified pattern. A
3040
- * `TimeZone` object can optionally be provided to format this date as the current date/time in that timezone.See
3041
- * the instance method for more details on input objects.
3042
- * @param pattern -
3043
- * @param date -
3044
- * @param timeZone -
3045
- * @return
3046
- */
3047
- static format(pattern:string, date:any, timeZone?:TimeZone):string;
3048
- /**
3049
- * Parses the given input string using the provided pattern, and returns a JS `Date` object in milliseconds.
3050
- * @param pattern -
3051
- * @param text -
3052
- * @return
3087
+ * Factory method which creates timezone instances from one of the supported keys.
3088
+ * @param tzCode -
3089
+ * @return dh.i18n.TimeZone
3053
3090
  */
3054
- static parseAsDate(pattern:string, text:string):Date;
3091
+ static getTimeZone(tzCode:string):TimeZone;
3055
3092
  /**
3056
- * Parses the given input string using the provided pattern, and returns a wrapped Java `long` value in nanoseconds.
3057
- * A `TimeZone` object can optionally be provided to parse to a desired timezone.
3058
- * @param pattern -
3059
- * @param text -
3060
- * @param tz -
3061
- * @return
3093
+ * the standard offset of this timezone, in minutes
3094
+ * @return int
3062
3095
  */
3063
- static parse(pattern:string, text:string, tz?:TimeZone):dh.DateWrapper;
3096
+ get standardOffset():number;
3064
3097
  /**
3065
- * Takes a variety of objects to interpret as a date, and formats them using this instance's pattern. Inputs can
3066
- * include a <b>String</b> value of a number expressed in nanoseconds, a <b>Number</b> value expressed in
3067
- * nanoseconds, a JS <b>Date</b> object (necessarily in milliseconds), or a wrapped Java <b>long</b> value,
3068
- * expressed in nanoseconds. A <b>TimeZone</b> object can optionally be provided to format this date as the current
3069
- * date/time in that timezone.
3070
- * @param date -
3071
- * @param timeZone -
3098
+ * the timezone code that represents this `TimeZone`, usually the same key as was use to create this instance
3072
3099
  * @return String
3073
3100
  */
3074
- format(date:any, timeZone?:TimeZone):string;
3075
- /**
3076
- * Parses the given string using this instance's pattern, and returns a wrapped Java <b>long</b> value in
3077
- * nanoseconds. A <b>TimeZone</b> object can optionally be provided to parse to a desired timezone.
3078
- * @param text -
3079
- * @param tz -
3080
- * @return
3081
- */
3082
- parse(text:string, tz?:TimeZone):dh.DateWrapper;
3083
- /**
3084
- * Parses the given string using this instance's pattern, and returns a JS <b>Date</b> object in milliseconds.
3085
- * @param text -
3086
- * @return
3087
- */
3088
- parseAsDate(text:string):Date;
3089
- toString():string;
3101
+ get id():string;
3090
3102
  }
3091
3103
 
3092
3104
  }
3093
3105
 
3094
3106
  export namespace dh.plot {
3095
3107
 
3096
- /**
3097
- * Describes how to access and display data required within a series.
3098
- */
3099
- export interface SeriesDataSource {
3100
- /**
3101
- * the type of data stored in the underlying table's Column.
3102
- * @return String
3103
- */
3104
- get columnType():string;
3105
- /**
3106
- * the axis that this source should be drawn on.
3107
- * @return dh.plot.Axis
3108
- */
3109
- get axis():Axis;
3110
- /**
3111
- * the feature of this series represented by this source. See the <b>SourceType</b> enum for more details.
3112
- * @return int
3113
- */
3114
- get type():SourceTypeType;
3115
- }
3116
- export interface OneClick {
3117
- setValueForColumn(columnName:string, value:any):void;
3118
- getValueForColumn(columName:string):any;
3119
- get requireAllFiltersToDisplay():boolean;
3120
- get columns():dh.Column[];
3121
- }
3122
- export interface FigureDataUpdatedEvent {
3123
- getArray(series:Series, sourceType:number, mappingFunc?:(arg0:any)=>any):Array<any>;
3124
- get series():Series[];
3125
- }
3126
- /**
3127
- * Describes a template that will be used to make new series instances when a new table added to a plotBy.
3128
- */
3129
- export interface MultiSeries {
3130
- /**
3131
- * The name for this multi-series.
3132
- * @return String
3133
- */
3134
- get name():string;
3135
- /**
3136
- * The plotting style to use for the series that will be created. See <b>SeriesPlotStyle</b> enum for more details.
3137
- * @return int
3138
- */
3139
- get plotStyle():SeriesPlotStyleType;
3140
- }
3141
3108
  /**
3142
3109
  * Provides access to the data for displaying in a figure.
3143
3110
  */
@@ -3183,261 +3150,117 @@ export namespace dh.plot {
3183
3150
  get shapeLabel():string;
3184
3151
  }
3185
3152
  /**
3186
- * Defines one axis used with by series. These instances will be found both on the Chart and the Series instances, and
3187
- * may be shared between Series instances.
3153
+ * Describes a template that will be used to make new series instances when a new table added to a plotBy.
3188
3154
  */
3189
- export interface Axis {
3190
- /**
3191
- * The format pattern to use with this axis. Use the type to determine which type of formatter to use.
3192
- * @return String
3193
- */
3194
- readonly formatPattern?:string|null;
3195
- readonly gapBetweenMajorTicks?:number|null;
3196
-
3197
- /**
3198
- * Indicates that this axis is only `widthInPixels` wide, so any extra data can be downsampled out, if this can be
3199
- * done losslessly. The second two arguments represent the current zoom range of this axis, and if provided, most of
3200
- * the data outside of this range will be filtered out automatically and the visible width mapped to that range.
3201
- * When the UI zooms, pans, or resizes, this method should be called again to update these three values to ensure
3202
- * that data is correct and current.
3203
- * @param pixelCount -
3204
- * @param min -
3205
- * @param max -
3206
- */
3207
- range(pixelCount?:number|undefined|null, min?:unknown|undefined|null, max?:unknown|undefined|null):void;
3208
- get tickLabelAngle():number;
3209
- get labelFont():string;
3210
- get color():string;
3211
- get invert():boolean;
3212
- get log():boolean;
3213
- get maxRange():number;
3214
- /**
3215
- * The label for this axis.
3216
- * @return String
3217
- */
3218
- get label():string;
3219
- get timeAxis():boolean;
3220
- /**
3221
- * The type for this axis, indicating how it will be drawn. See <b>AxisType</b> enum for more details.
3222
- * @return int
3223
- */
3224
- get type():AxisTypeType;
3225
- get minorTicksVisible():boolean;
3226
- get minorTickCount():number;
3227
- get majorTickLocations():number[];
3228
- get majorTicksVisible():boolean;
3229
- get ticksFont():string;
3155
+ export interface MultiSeries {
3230
3156
  /**
3231
- * The unique id for this axis.
3157
+ * The name for this multi-series.
3232
3158
  * @return String
3233
3159
  */
3234
- get id():string;
3235
- /**
3236
- * The position for this axis. See <b>AxisPosition</b> enum for more details.
3237
- * @return int
3238
- */
3239
- get position():AxisPositionType;
3240
- /**
3241
- * The calendar with the business hours and holidays to transform plot data against. Defaults to null, or no
3242
- * transform.
3243
- * @return dh.calendar.BusinessCalendar
3244
- */
3245
- get businessCalendar():dh.calendar.BusinessCalendar;
3160
+ get name():string;
3246
3161
  /**
3247
- * The type for this axis. See <b>AxisFormatType</b> enum for more details.
3162
+ * The plotting style to use for the series that will be created. See <b>SeriesPlotStyle</b> enum for more details.
3248
3163
  * @return int
3249
3164
  */
3250
- get formatType():AxisFormatTypeType;
3251
- get minRange():number;
3252
- }
3253
-
3254
- export class SeriesDescriptor {
3255
- plotStyle:string;
3256
- name?:string|null;
3257
- linesVisible?:boolean|null;
3258
- shapesVisible?:boolean|null;
3259
- gradientVisible?:boolean|null;
3260
- lineColor?:string|null;
3261
- pointLabelFormat?:string|null;
3262
- xToolTipPattern?:string|null;
3263
- yToolTipPattern?:string|null;
3264
- shapeLabel?:string|null;
3265
- shapeSize?:number|null;
3266
- shapeColor?:string|null;
3267
- shape?:string|null;
3268
- dataSources:Array<SourceDescriptor>;
3269
-
3270
- constructor();
3271
- }
3272
-
3273
- export class SourceDescriptor {
3274
- axis:AxisDescriptor;
3275
- table:dh.Table;
3276
- columnName:string;
3277
- type:string;
3278
-
3279
- constructor();
3280
- }
3281
-
3282
- /**
3283
- * Helper class to manage snapshots and deltas and keep not only a contiguous JS array of data per column in the
3284
- * underlying table, but also support a mapping function to let client code translate data in some way for display and
3285
- * keep that cached as well.
3286
- */
3287
- export class ChartData {
3288
- constructor(table:dh.Table);
3289
-
3290
- update(tableData:dh.SubscriptionTableData):void;
3291
- getColumn(columnName:string, mappingFunc:(arg0:any)=>any, currentUpdate:dh.TableData):Array<any>;
3292
- /**
3293
- * Removes some column from the cache, avoiding extra computation on incoming events, and possibly freeing some
3294
- * memory. If this pair of column name and map function are requested again, it will be recomputed from scratch.
3295
- */
3296
- removeColumn(columnName:string, mappingFunc:(arg0:any)=>any):void;
3165
+ get plotStyle():SeriesPlotStyleType;
3297
3166
  }
3298
-
3299
- /**
3300
- * Provides the details for a figure.
3301
- *
3302
- * The Deephaven JS API supports automatic lossless downsampling of time-series data, when that data is plotted in one
3303
- * or more line series. Using a scatter plot or a X-axis of some type other than DateTime will prevent this feature from
3304
- * being applied to a series. To enable this feature, invoke <b>Axis.range(...)</b> to specify the length in pixels of
3305
- * the axis on the screen, and the range of values that are visible, and the server will use that width (and range, if
3306
- * any) to reduce the number of points sent to the client.
3307
- *
3308
- * Downsampling can also be controlled when calling either <b>Figure.subscribe()</b> or <b>Series.subscribe()</b> - both
3309
- * can be given an optional <b>dh.plot.DownsampleOptions</b> argument. Presently only two valid values exist,
3310
- * <b>DEFAULT</b>, and <b>DISABLE</b>, and if no argument is specified, <b>DEFAULT</b> is assumed. If there are more
3311
- * than 30,000 rows in a table, downsampling will be encouraged - data will not load without calling
3312
- * <b>subscribe(DISABLE)</b> or enabling downsampling via <b>Axis.range(...)</b>. If there are more than 200,000 rows,
3313
- * data will refuse to load without downsampling and <b>subscribe(DISABLE)</b> would have no effect.
3314
- *
3315
- * Downsampled data looks like normal data, except that select items have been removed if they would be redundant in the
3316
- * UI given the current configuration. Individual rows are intact, so that a tooltip or some other UI item is sure to be
3317
- * accurate and consistent, and at least the highest and lowest value for each axis will be retained as well, to ensure
3318
- * that the "important" values are visible.
3319
- *
3320
- * Four events exist to help with interacting with downsampled data, all fired from the <b>Figure</b> instance itself.
3321
- * First, <b>downsampleneeded</b> indicates that more than 30,000 rows would be fetched, and so specifying downsampling
3322
- * is no longer optional - it must either be enabled (calling <b>axis.range(...)</b>), or disabled. If the figure is
3323
- * configured for downsampling, when a change takes place that requires that the server perform some downsampling work,
3324
- * the <b>downsamplestarted</b> event will first be fired, which can be used to present a brief loading message,
3325
- * indicating to the user why data is not ready yet - when the server side process is complete,
3326
- * <b>downsamplefinished</b> will be fired. These events will repeat when the range changes, such as when zooming,
3327
- * panning, or resizing the figure. Finally, <b>downsamplefailed</b> indicates that something when wrong when
3328
- * downsampling, or possibly that downsampling cannot be disabled due to the number of rows in the table.
3329
- *
3330
- * At this time, not marked as a ServerObject, due to internal implementation issues which leave the door open to
3331
- * client-created figures.
3332
- */
3333
- export class Figure implements dh.HasEventHandling {
3334
- /**
3335
- * The title of the figure.
3336
- * @return String
3337
- */
3338
- readonly title?:string|null;
3339
- /**
3340
- * The data within this figure was updated. <b>event.detail</b> is <b>FigureUpdateEventData</b>
3341
- */
3342
- static readonly EVENT_UPDATED:string;
3343
- /**
3344
- * The data within this figure was updated. <b>event.detail</b> is <b>FigureUpdateEventData</b>
3345
- */
3346
- static readonly EVENT_SERIES_ADDED:string;
3347
- /**
3348
- * The data within this figure was updated. <b>event.detail</b> is <b>FigureUpdateEventData</b>
3349
- */
3350
- static readonly EVENT_DISCONNECT:string;
3167
+ export interface OneClick {
3168
+ setValueForColumn(columnName:string, value:any):void;
3169
+ getValueForColumn(columName:string):any;
3170
+ get requireAllFiltersToDisplay():boolean;
3171
+ get columns():dh.Column[];
3172
+ }
3173
+ export interface FigureDataUpdatedEvent {
3174
+ getArray(series:Series, sourceType:number, mappingFunc?:(arg0:any)=>any):Array<any>;
3175
+ get series():Series[];
3176
+ }
3177
+ /**
3178
+ * Defines one axis used with by series. These instances will be found both on the Chart and the Series instances, and
3179
+ * may be shared between Series instances.
3180
+ */
3181
+ export interface Axis {
3351
3182
  /**
3352
- * The data within this figure was updated. <b>event.detail</b> is <b>FigureUpdateEventData</b>
3183
+ * The format pattern to use with this axis. Use the type to determine which type of formatter to use.
3184
+ * @return String
3353
3185
  */
3354
- static readonly EVENT_RECONNECT:string;
3186
+ readonly formatPattern?:string|null;
3187
+ readonly gapBetweenMajorTicks?:number|null;
3188
+
3355
3189
  /**
3356
- * The data within this figure was updated. <b>event.detail</b> is <b>FigureUpdateEventData</b>
3190
+ * Indicates that this axis is only `widthInPixels` wide, so any extra data can be downsampled out, if this can be
3191
+ * done losslessly. The second two arguments represent the current zoom range of this axis, and if provided, most of
3192
+ * the data outside of this range will be filtered out automatically and the visible width mapped to that range.
3193
+ * When the UI zooms, pans, or resizes, this method should be called again to update these three values to ensure
3194
+ * that data is correct and current.
3195
+ * @param pixelCount -
3196
+ * @param min -
3197
+ * @param max -
3357
3198
  */
3358
- static readonly EVENT_RECONNECTFAILED:string;
3199
+ range(pixelCount?:number|undefined|null, min?:unknown|undefined|null, max?:unknown|undefined|null):void;
3200
+ get tickLabelAngle():number;
3201
+ get labelFont():string;
3202
+ get color():string;
3203
+ get invert():boolean;
3204
+ get log():boolean;
3205
+ get maxRange():number;
3359
3206
  /**
3360
- * The data within this figure was updated. <b>event.detail</b> is <b>FigureUpdateEventData</b>
3207
+ * The label for this axis.
3208
+ * @return String
3361
3209
  */
3362
- static readonly EVENT_DOWNSAMPLESTARTED:string;
3210
+ get label():string;
3211
+ get timeAxis():boolean;
3363
3212
  /**
3364
- * The data within this figure was updated. <b>event.detail</b> is <b>FigureUpdateEventData</b>
3213
+ * The type for this axis, indicating how it will be drawn. See <b>AxisType</b> enum for more details.
3214
+ * @return int
3365
3215
  */
3366
- static readonly EVENT_DOWNSAMPLEFINISHED:string;
3216
+ get type():AxisTypeType;
3217
+ get minorTicksVisible():boolean;
3218
+ get minorTickCount():number;
3219
+ get majorTickLocations():number[];
3220
+ get majorTicksVisible():boolean;
3221
+ get ticksFont():string;
3367
3222
  /**
3368
- * The data within this figure was updated. <b>event.detail</b> is <b>FigureUpdateEventData</b>
3223
+ * The unique id for this axis.
3224
+ * @return String
3369
3225
  */
3370
- static readonly EVENT_DOWNSAMPLEFAILED:string;
3226
+ get id():string;
3371
3227
  /**
3372
- * The data within this figure was updated. <b>event.detail</b> is <b>FigureUpdateEventData</b>
3228
+ * The position for this axis. See <b>AxisPosition</b> enum for more details.
3229
+ * @return int
3373
3230
  */
3374
- static readonly EVENT_DOWNSAMPLENEEDED:string;
3375
-
3376
- protected constructor();
3377
-
3378
- subscribe(forceDisableDownsample?:DownsampleOptions):void;
3231
+ get position():AxisPositionType;
3379
3232
  /**
3380
- * Disable updates for all series in this figure.
3233
+ * The calendar with the business hours and holidays to transform plot data against. Defaults to null, or no
3234
+ * transform.
3235
+ * @return dh.calendar.BusinessCalendar
3381
3236
  */
3382
- unsubscribe():void;
3237
+ get businessCalendar():dh.calendar.BusinessCalendar;
3383
3238
  /**
3384
- * Close the figure, and clean up subscriptions.
3239
+ * The type for this axis. See <b>AxisFormatType</b> enum for more details.
3240
+ * @return int
3385
3241
  */
3386
- close():void;
3242
+ get formatType():AxisFormatTypeType;
3243
+ get minRange():number;
3244
+ }
3245
+ /**
3246
+ * Describes how to access and display data required within a series.
3247
+ */
3248
+ export interface SeriesDataSource {
3387
3249
  /**
3388
- * The charts to draw.
3389
- * @return dh.plot.Chart
3250
+ * the type of data stored in the underlying table's Column.
3251
+ * @return String
3390
3252
  */
3391
- get charts():Chart[];
3392
- get updateInterval():number;
3393
- get titleColor():string;
3394
- get titleFont():string;
3395
- get rows():number;
3396
- get cols():number;
3397
- get errors():Array<string>;
3253
+ get columnType():string;
3398
3254
  /**
3399
- * Listen for events on this object.
3400
- * @param name - the name of the event to listen for
3401
- * @param callback - a function to call when the event occurs
3402
- * @return Returns a cleanup function.
3403
- * @typeParam T - the type of the data that the event will provide
3255
+ * the axis that this source should be drawn on.
3256
+ * @return dh.plot.Axis
3404
3257
  */
3405
- addEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):()=>void;
3406
- nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<dh.Event<T>>;
3407
- hasListeners(name:string):boolean;
3258
+ get axis():Axis;
3408
3259
  /**
3409
- * Removes an event listener added to this table.
3410
- * @param name -
3411
- * @param callback -
3412
- * @return
3413
- * @typeParam T -
3260
+ * the feature of this series represented by this source. See the <b>SourceType</b> enum for more details.
3261
+ * @return int
3414
3262
  */
3415
- removeEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):boolean;
3416
- static create(config:FigureDescriptor):Promise<Figure>;
3417
- }
3418
-
3419
- export class AxisDescriptor {
3420
- formatType:string;
3421
- type:string;
3422
- position:string;
3423
- log?:boolean|null;
3424
- label?:string|null;
3425
- labelFont?:string|null;
3426
- ticksFont?:string|null;
3427
- formatPattern?:string|null;
3428
- color?:string|null;
3429
- minRange?:number|null;
3430
- maxRange?:number|null;
3431
- minorTicksVisible?:boolean|null;
3432
- majorTicksVisible?:boolean|null;
3433
- minorTickCount?:number|null;
3434
- gapBetweenMajorTicks?:number|null;
3435
- majorTickLocations?:Array<number>|null;
3436
- tickLabelAngle?:number|null;
3437
- invert?:boolean|null;
3438
- isTimeAxis?:boolean|null;
3439
-
3440
- constructor();
3263
+ get type():SourceTypeType;
3441
3264
  }
3442
3265
 
3443
3266
  export class SeriesDataSourceException {
@@ -3447,49 +3270,29 @@ export namespace dh.plot {
3447
3270
  get message():string;
3448
3271
  }
3449
3272
 
3450
- /**
3451
- * A descriptor used with JsFigureFactory.create to create a figure from JS.
3452
- */
3453
- export class FigureDescriptor {
3454
- title?:string|null;
3455
- titleFont?:string|null;
3456
- titleColor?:string|null;
3457
- isResizable?:boolean|null;
3458
- isDefaultTheme?:boolean|null;
3459
- updateInterval?:number|null;
3460
- cols?:number|null;
3461
- rows?:number|null;
3462
- charts:Array<ChartDescriptor>;
3273
+ export class FigureSourceException {
3274
+ table:dh.Table;
3275
+ source:SeriesDataSource;
3463
3276
 
3464
- constructor();
3277
+ protected constructor();
3465
3278
  }
3466
3279
 
3467
- export class DownsampleOptions {
3468
- /**
3469
- * Max number of items in the series before DEFAULT will not attempt to load the series without downsampling. Above
3470
- * this size if downsample fails or is not applicable, the series won't be loaded unless DISABLE is passed to
3471
- * series.subscribe().
3472
- */
3473
- static MAX_SERIES_SIZE:number;
3474
- /**
3475
- * Max number of items in the series where the subscription will be allowed at all. Above this limit, even with
3476
- * downsampling disabled, the series will not load data.
3477
- */
3478
- static MAX_SUBSCRIPTION_SIZE:number;
3479
- /**
3480
- * Flag to let the API decide what data will be available, based on the nature of the data, the series, and how the
3481
- * axes are configured.
3482
- */
3483
- static readonly DEFAULT:DownsampleOptions;
3484
- /**
3485
- * Flat to entirely disable downsampling, and force all data to load, no matter how many items that would be, up to
3486
- * the limit of MAX_SUBSCRIPTION_SIZE.
3487
- */
3488
- static readonly DISABLE:DownsampleOptions;
3280
+ export class FigureFetchError {
3281
+ error:object;
3282
+ errors:Array<string>;
3489
3283
 
3490
3284
  protected constructor();
3491
3285
  }
3492
3286
 
3287
+ export class SourceDescriptor {
3288
+ axis:AxisDescriptor;
3289
+ table:dh.Table;
3290
+ columnName:string;
3291
+ type:string;
3292
+
3293
+ constructor();
3294
+ }
3295
+
3493
3296
  /**
3494
3297
  * Provide the details for a chart.
3495
3298
  */
@@ -3534,11 +3337,81 @@ export namespace dh.plot {
3534
3337
  get multiSeries():MultiSeries[];
3535
3338
  }
3536
3339
 
3537
- export class FigureSourceException {
3538
- table:dh.Table;
3539
- source:SeriesDataSource;
3340
+ export class SeriesDescriptor {
3341
+ plotStyle:string;
3342
+ name?:string|null;
3343
+ linesVisible?:boolean|null;
3344
+ shapesVisible?:boolean|null;
3345
+ gradientVisible?:boolean|null;
3346
+ lineColor?:string|null;
3347
+ pointLabelFormat?:string|null;
3348
+ xToolTipPattern?:string|null;
3349
+ yToolTipPattern?:string|null;
3350
+ shapeLabel?:string|null;
3351
+ shapeSize?:number|null;
3352
+ shapeColor?:string|null;
3353
+ shape?:string|null;
3354
+ dataSources:Array<SourceDescriptor>;
3355
+
3356
+ constructor();
3357
+ }
3358
+
3359
+ /**
3360
+ * A descriptor used with JsFigureFactory.create to create a figure from JS.
3361
+ */
3362
+ export class FigureDescriptor {
3363
+ title?:string|null;
3364
+ titleFont?:string|null;
3365
+ titleColor?:string|null;
3366
+ isResizable?:boolean|null;
3367
+ isDefaultTheme?:boolean|null;
3368
+ updateInterval?:number|null;
3369
+ cols?:number|null;
3370
+ rows?:number|null;
3371
+ charts:Array<ChartDescriptor>;
3372
+
3373
+ constructor();
3374
+ }
3375
+
3376
+ /**
3377
+ * Helper class to manage snapshots and deltas and keep not only a contiguous JS array of data per column in the
3378
+ * underlying table, but also support a mapping function to let client code translate data in some way for display and
3379
+ * keep that cached as well.
3380
+ */
3381
+ export class ChartData {
3382
+ constructor(table:dh.Table);
3383
+
3384
+ update(tableData:dh.SubscriptionTableData):void;
3385
+ getColumn(columnName:string, mappingFunc:(arg0:any)=>any, currentUpdate:dh.TableData):Array<any>;
3386
+ /**
3387
+ * Removes some column from the cache, avoiding extra computation on incoming events, and possibly freeing some
3388
+ * memory. If this pair of column name and map function are requested again, it will be recomputed from scratch.
3389
+ */
3390
+ removeColumn(columnName:string, mappingFunc:(arg0:any)=>any):void;
3391
+ }
3392
+
3393
+ export class AxisDescriptor {
3394
+ formatType:string;
3395
+ type:string;
3396
+ position:string;
3397
+ log?:boolean|null;
3398
+ label?:string|null;
3399
+ labelFont?:string|null;
3400
+ ticksFont?:string|null;
3401
+ formatPattern?:string|null;
3402
+ color?:string|null;
3403
+ minRange?:number|null;
3404
+ maxRange?:number|null;
3405
+ minorTicksVisible?:boolean|null;
3406
+ majorTicksVisible?:boolean|null;
3407
+ minorTickCount?:number|null;
3408
+ gapBetweenMajorTicks?:number|null;
3409
+ majorTickLocations?:Array<number>|null;
3410
+ tickLabelAngle?:number|null;
3411
+ invert?:boolean|null;
3412
+ isTimeAxis?:boolean|null;
3540
3413
 
3541
- protected constructor();
3414
+ constructor();
3542
3415
  }
3543
3416
 
3544
3417
  /**
@@ -3560,9 +3433,28 @@ export namespace dh.plot {
3560
3433
  static runChartDownsample(table:dh.Table, xCol:string, yCols:string[], width:number, xRange?:dh.LongWrapper[]|undefined|null):Promise<dh.Table>;
3561
3434
  }
3562
3435
 
3563
- export class FigureFetchError {
3564
- error:object;
3565
- errors:Array<string>;
3436
+ export class DownsampleOptions {
3437
+ /**
3438
+ * Max number of items in the series before DEFAULT will not attempt to load the series without downsampling. Above
3439
+ * this size if downsample fails or is not applicable, the series won't be loaded unless DISABLE is passed to
3440
+ * series.subscribe().
3441
+ */
3442
+ static MAX_SERIES_SIZE:number;
3443
+ /**
3444
+ * Max number of items in the series where the subscription will be allowed at all. Above this limit, even with
3445
+ * downsampling disabled, the series will not load data.
3446
+ */
3447
+ static MAX_SUBSCRIPTION_SIZE:number;
3448
+ /**
3449
+ * Flag to let the API decide what data will be available, based on the nature of the data, the series, and how the
3450
+ * axes are configured.
3451
+ */
3452
+ static readonly DEFAULT:DownsampleOptions;
3453
+ /**
3454
+ * Flat to entirely disable downsampling, and force all data to load, no matter how many items that would be, up to
3455
+ * the limit of MAX_SUBSCRIPTION_SIZE.
3456
+ */
3457
+ static readonly DISABLE:DownsampleOptions;
3566
3458
 
3567
3459
  protected constructor();
3568
3460
  }
@@ -3584,13 +3476,91 @@ export namespace dh.plot {
3584
3476
  constructor();
3585
3477
  }
3586
3478
 
3479
+ export class Figure implements dh.HasEventHandling {
3480
+ /**
3481
+ * The title of the figure.
3482
+ * @return String
3483
+ */
3484
+ readonly title?:string|null;
3485
+ /**
3486
+ * The data within this figure was updated. <b>event.detail</b> is <b>FigureUpdateEventData</b>
3487
+ */
3488
+ static readonly EVENT_UPDATED:string;
3489
+ /**
3490
+ * The data within this figure was updated. <b>event.detail</b> is <b>FigureUpdateEventData</b>
3491
+ */
3492
+ static readonly EVENT_SERIES_ADDED:string;
3493
+ /**
3494
+ * The data within this figure was updated. <b>event.detail</b> is <b>FigureUpdateEventData</b>
3495
+ */
3496
+ static readonly EVENT_DISCONNECT:string;
3497
+ /**
3498
+ * The data within this figure was updated. <b>event.detail</b> is <b>FigureUpdateEventData</b>
3499
+ */
3500
+ static readonly EVENT_RECONNECT:string;
3501
+ /**
3502
+ * The data within this figure was updated. <b>event.detail</b> is <b>FigureUpdateEventData</b>
3503
+ */
3504
+ static readonly EVENT_RECONNECTFAILED:string;
3505
+ /**
3506
+ * The data within this figure was updated. <b>event.detail</b> is <b>FigureUpdateEventData</b>
3507
+ */
3508
+ static readonly EVENT_DOWNSAMPLESTARTED:string;
3509
+ /**
3510
+ * The data within this figure was updated. <b>event.detail</b> is <b>FigureUpdateEventData</b>
3511
+ */
3512
+ static readonly EVENT_DOWNSAMPLEFINISHED:string;
3513
+ /**
3514
+ * The data within this figure was updated. <b>event.detail</b> is <b>FigureUpdateEventData</b>
3515
+ */
3516
+ static readonly EVENT_DOWNSAMPLEFAILED:string;
3517
+ /**
3518
+ * The data within this figure was updated. <b>event.detail</b> is <b>FigureUpdateEventData</b>
3519
+ */
3520
+ static readonly EVENT_DOWNSAMPLENEEDED:string;
3587
3521
 
3588
- type AxisFormatTypeType = number;
3589
- export class AxisFormatType {
3590
- static readonly CATEGORY:AxisFormatTypeType;
3591
- static readonly NUMBER:AxisFormatTypeType;
3522
+ static create(config:FigureDescriptor):Promise<Figure>;
3523
+ subscribe(forceDisableDownsample?:DownsampleOptions):void;
3524
+ /**
3525
+ * Disable updates for all series in this figure.
3526
+ */
3527
+ unsubscribe():void;
3528
+ /**
3529
+ * Close the figure, and clean up subscriptions.
3530
+ */
3531
+ close():void;
3532
+ /**
3533
+ * The charts to draw.
3534
+ * @return dh.plot.Chart
3535
+ */
3536
+ get charts():Chart[];
3537
+ get updateInterval():number;
3538
+ get titleColor():string;
3539
+ get titleFont():string;
3540
+ get rows():number;
3541
+ get cols():number;
3542
+ get errors():Array<string>;
3543
+ /**
3544
+ * Listen for events on this object.
3545
+ * @param name - the name of the event to listen for
3546
+ * @param callback - a function to call when the event occurs
3547
+ * @return Returns a cleanup function.
3548
+ * @typeParam T - the type of the data that the event will provide
3549
+ */
3550
+ addEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):()=>void;
3551
+ nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<dh.Event<T>>;
3552
+ hasListeners(name:string):boolean;
3553
+ /**
3554
+ * Removes an event listener added to this table.
3555
+ * @param name -
3556
+ * @param callback -
3557
+ * @return
3558
+ * @typeParam T -
3559
+ */
3560
+ removeEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):boolean;
3592
3561
  }
3593
3562
 
3563
+
3594
3564
  type AxisTypeType = number;
3595
3565
  export class AxisType {
3596
3566
  static readonly X:AxisTypeType;
@@ -3601,6 +3571,36 @@ export namespace dh.plot {
3601
3571
  static readonly COLOR:AxisTypeType;
3602
3572
  }
3603
3573
 
3574
+ type AxisFormatTypeType = number;
3575
+ export class AxisFormatType {
3576
+ static readonly CATEGORY:AxisFormatTypeType;
3577
+ static readonly NUMBER:AxisFormatTypeType;
3578
+ }
3579
+
3580
+ /**
3581
+ * This enum describes what kind of chart is being drawn. This may limit what kinds of series can be found on it, or how
3582
+ * those series should be rendered.
3583
+ */
3584
+ type ChartTypeType = number;
3585
+ export class ChartType {
3586
+ static readonly XY:ChartTypeType;
3587
+ static readonly PIE:ChartTypeType;
3588
+ static readonly OHLC:ChartTypeType;
3589
+ static readonly CATEGORY:ChartTypeType;
3590
+ static readonly XYZ:ChartTypeType;
3591
+ static readonly CATEGORY_3D:ChartTypeType;
3592
+ static readonly TREEMAP:ChartTypeType;
3593
+ }
3594
+
3595
+ type AxisPositionType = number;
3596
+ export class AxisPosition {
3597
+ static readonly TOP:AxisPositionType;
3598
+ static readonly BOTTOM:AxisPositionType;
3599
+ static readonly LEFT:AxisPositionType;
3600
+ static readonly RIGHT:AxisPositionType;
3601
+ static readonly NONE:AxisPositionType;
3602
+ }
3603
+
3604
3604
  /**
3605
3605
  * This enum describes the source it is in, and how this aspect of the data in the series should be used to render the
3606
3606
  * 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
@@ -3630,15 +3630,6 @@ export namespace dh.plot {
3630
3630
  static readonly HOVER_TEXT:SourceTypeType;
3631
3631
  }
3632
3632
 
3633
- type AxisPositionType = number;
3634
- export class AxisPosition {
3635
- static readonly TOP:AxisPositionType;
3636
- static readonly BOTTOM:AxisPositionType;
3637
- static readonly LEFT:AxisPositionType;
3638
- static readonly RIGHT:AxisPositionType;
3639
- static readonly NONE:AxisPositionType;
3640
- }
3641
-
3642
3633
  type SeriesPlotStyleType = number;
3643
3634
  export class SeriesPlotStyle {
3644
3635
  static readonly BAR:SeriesPlotStyleType;
@@ -3655,25 +3646,27 @@ export namespace dh.plot {
3655
3646
  static readonly TREEMAP:SeriesPlotStyleType;
3656
3647
  }
3657
3648
 
3658
- /**
3659
- * This enum describes what kind of chart is being drawn. This may limit what kinds of series can be found on it, or how
3660
- * those series should be rendered.
3661
- */
3662
- type ChartTypeType = number;
3663
- export class ChartType {
3664
- static readonly XY:ChartTypeType;
3665
- static readonly PIE:ChartTypeType;
3666
- static readonly OHLC:ChartTypeType;
3667
- static readonly CATEGORY:ChartTypeType;
3668
- static readonly XYZ:ChartTypeType;
3669
- static readonly CATEGORY_3D:ChartTypeType;
3670
- static readonly TREEMAP:ChartTypeType;
3671
- }
3672
-
3673
3649
  }
3674
3650
 
3675
3651
  export namespace dh.lsp {
3676
3652
 
3653
+ export class Range {
3654
+ start:Position;
3655
+ end:Position;
3656
+
3657
+ constructor();
3658
+
3659
+ isInside(innerStart:Position, innerEnd:Position):boolean;
3660
+ }
3661
+
3662
+ export class TextDocumentContentChangeEvent {
3663
+ range:Range;
3664
+ rangeLength:number;
3665
+ text:string;
3666
+
3667
+ constructor();
3668
+ }
3669
+
3677
3670
  export class CompletionItem {
3678
3671
  label:string;
3679
3672
  kind:number;
@@ -3691,13 +3684,6 @@ export namespace dh.lsp {
3691
3684
  constructor();
3692
3685
  }
3693
3686
 
3694
- export class ParameterInformation {
3695
- label:string;
3696
- documentation:MarkupContent;
3697
-
3698
- constructor();
3699
- }
3700
-
3701
3687
  export class TextEdit {
3702
3688
  range:Range;
3703
3689
  text:string;
@@ -3705,14 +3691,6 @@ export namespace dh.lsp {
3705
3691
  constructor();
3706
3692
  }
3707
3693
 
3708
- export class TextDocumentContentChangeEvent {
3709
- range:Range;
3710
- rangeLength:number;
3711
- text:string;
3712
-
3713
- constructor();
3714
- }
3715
-
3716
3694
  export class Position {
3717
3695
  line:number;
3718
3696
  character:number;
@@ -3726,6 +3704,13 @@ export namespace dh.lsp {
3726
3704
  copy():Position;
3727
3705
  }
3728
3706
 
3707
+ export class MarkupContent {
3708
+ kind:string;
3709
+ value:string;
3710
+
3711
+ constructor();
3712
+ }
3713
+
3729
3714
  export class Hover {
3730
3715
  contents:MarkupContent;
3731
3716
  range:Range;
@@ -3733,9 +3718,9 @@ export namespace dh.lsp {
3733
3718
  constructor();
3734
3719
  }
3735
3720
 
3736
- export class MarkupContent {
3737
- kind:string;
3738
- value:string;
3721
+ export class ParameterInformation {
3722
+ label:string;
3723
+ documentation:MarkupContent;
3739
3724
 
3740
3725
  constructor();
3741
3726
  }
@@ -3749,31 +3734,10 @@ export namespace dh.lsp {
3749
3734
  constructor();
3750
3735
  }
3751
3736
 
3752
- export class Range {
3753
- start:Position;
3754
- end:Position;
3755
-
3756
- constructor();
3757
-
3758
- isInside(innerStart:Position, innerEnd:Position):boolean;
3759
- }
3760
-
3761
3737
  }
3762
3738
 
3763
3739
  export namespace dh.calendar {
3764
3740
 
3765
- export interface Holiday {
3766
- /**
3767
- * The date of the Holiday.
3768
- * @return {@link dh.LocalDateWrapper}
3769
- */
3770
- get date():dh.LocalDateWrapper;
3771
- /**
3772
- * The business periods that are open on the holiday.
3773
- * @return dh.calendar.BusinessPeriod
3774
- */
3775
- get businessPeriods():Array<BusinessPeriod>;
3776
- }
3777
3741
  /**
3778
3742
  * Defines a calendar with business hours and holidays.
3779
3743
  */
@@ -3804,6 +3768,18 @@ export namespace dh.calendar {
3804
3768
  */
3805
3769
  get businessPeriods():Array<BusinessPeriod>;
3806
3770
  }
3771
+ export interface Holiday {
3772
+ /**
3773
+ * The date of the Holiday.
3774
+ * @return {@link dh.LocalDateWrapper}
3775
+ */
3776
+ get date():dh.LocalDateWrapper;
3777
+ /**
3778
+ * The business periods that are open on the holiday.
3779
+ * @return dh.calendar.BusinessPeriod
3780
+ */
3781
+ get businessPeriods():Array<BusinessPeriod>;
3782
+ }
3807
3783
  export interface BusinessPeriod {
3808
3784
  get close():string;
3809
3785
  get open():string;