@deephaven/jsapi-types 1.0.0-dev0.34.2 → 1.0.0-dev0.34.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 +1580 -1580
  2. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -17,22 +17,6 @@ export interface IIterableResult<T> {
17
17
  }
18
18
  export namespace dh.storage {
19
19
 
20
- /**
21
- * Represents a file's contents loaded from the server. If an etag was specified when loading, client should first test
22
- * if the etag of this instance matches - if so, the contents will be empty, and the client's existing contents should
23
- * be used.
24
- */
25
- export class FileContents {
26
- protected constructor();
27
-
28
- static blob(blob:Blob):FileContents;
29
- static text(...text:string[]):FileContents;
30
- static arrayBuffers(...buffers:ArrayBuffer[]):FileContents;
31
- text():Promise<string>;
32
- arrayBuffer():Promise<ArrayBuffer>;
33
- get etag():string;
34
- }
35
-
36
20
  /**
37
21
  * Storage service metadata about files and folders.
38
22
  */
@@ -105,6 +89,22 @@ export namespace dh.storage {
105
89
  createDirectory(path:string):Promise<void>;
106
90
  }
107
91
 
92
+ /**
93
+ * Represents a file's contents loaded from the server. If an etag was specified when loading, client should first test
94
+ * if the etag of this instance matches - if so, the contents will be empty, and the client's existing contents should
95
+ * be used.
96
+ */
97
+ export class FileContents {
98
+ protected constructor();
99
+
100
+ static blob(blob:Blob):FileContents;
101
+ static text(...text:string[]):FileContents;
102
+ static arrayBuffers(...buffers:ArrayBuffer[]):FileContents;
103
+ text():Promise<string>;
104
+ arrayBuffer():Promise<ArrayBuffer>;
105
+ get etag():string;
106
+ }
107
+
108
108
 
109
109
  type ItemTypeType = string;
110
110
  export class ItemType {
@@ -114,327 +114,128 @@ export namespace dh.storage {
114
114
 
115
115
  }
116
116
 
117
- export namespace dh {
117
+ export namespace dh.ide {
118
118
 
119
119
  /**
120
- * Represents the contents of a single widget data message from the server, with a binary data paylod and exported
121
- * objects. Implemented both by Widget itself and by the `event.details` when data is received by the client.
122
- *
123
- * Terminology note: the name of this type should probably use "Data" instead of "Message", and the methods should use
124
- * "payload" rather than "data" to match other platforms and the protobuf itself. These names are instead used for
125
- * backwards compatibility and to better follow JS expectations.
120
+ * Represents a serialized fishlib LogRecord, suitable for display on javascript clients. A log entry sent from the
121
+ * server.
126
122
  */
127
- export interface WidgetMessageDetails {
128
- /**
129
- * Returns the data from this message as a base64-encoded string.
130
- */
131
- getDataAsBase64():string;
123
+ export interface LogItem {
132
124
  /**
133
- * Returns the data from this message as a Uint8Array.
125
+ * The level of the log message, enabling the client to ignore messages.
126
+ * @return String
134
127
  */
135
- getDataAsU8():Uint8Array;
128
+ get logLevel():string;
136
129
  /**
137
- * Returns the data from this message as a utf-8 string.
130
+ * Timestamp of the message in microseconds since Jan 1, 1970 UTC.
131
+ * @return double
138
132
  */
139
- getDataAsString():string;
133
+ get micros():number;
140
134
  /**
141
- * Returns an array of exported objects sent from the server. The plugin implementation is now responsible for these
142
- * objects, and should close them when no longer needed.
135
+ * The log message written on the server.
136
+ * @return String
143
137
  */
144
- get exportedObjects():WidgetExportedObject[];
145
- }
146
- export interface ColumnGroup {
147
- get name():string|null;
148
- get children():string[]|null;
149
- get color():string|null;
138
+ get message():string;
150
139
  }
151
140
  /**
152
- * Represents a server-side object that may not yet have been fetched by the client. When this object will no longer be
153
- * used, if {@link fetch} is not called on this object, then {@link close} must be to ensure server-side resources
154
- * are correctly freed.
141
+ * Indicates the result of code run on the server.
155
142
  */
156
- export interface WidgetExportedObject {
157
- /**
158
- * Returns the type of this export, typically one of {@link dh.VariableType}, but may also include plugin types. If
159
- * null, this object cannot be fetched, but can be passed to the server, such as via
160
- * {@link Widget.sendMessage}.
161
- * @return the string type of this server-side object, or null.
162
- */
163
- readonly type?:string|null;
164
-
165
- /**
166
- * Exports another copy of this reference, allowing it to be fetched separately. Results in rejection if the ticket
167
- * was already closed (either by calling {@link WidgetExportedObject.close} or closing the object returned from {@link WidgetExportedObject.fetch}).
168
- * @return a promise returning a reexported copy of this object, still referencing the same server-side object.
169
- */
170
- reexport():Promise<WidgetExportedObject>;
143
+ export interface CommandResult {
171
144
  /**
172
- * Returns a promise that will fetch the object represented by this reference. Multiple calls to this will return
173
- * the same instance.
174
- * @return a promise that will resolve to a client side object that represents the reference on the server.
145
+ * Describes changes made in the course of this command.
146
+ * @return {@link dh.ide.VariableChanges}.
175
147
  */
176
- fetch():Promise<any>;
148
+ get changes():VariableChanges;
177
149
  /**
178
- * Releases the server-side resources associated with this object, regardless of whether other client-side objects
179
- * exist that also use that object. Should not be called after fetch() has been invoked.
150
+ * If the command failed, the error message will be provided here.
151
+ * @return String
180
152
  */
181
- close():void;
182
- }
183
- export interface TreeViewportData extends TableData {
184
- get offset():number;
185
- get columns():Array<Column>;
186
- get rows():Array<TreeRow>;
153
+ get error():string;
187
154
  }
188
155
  /**
189
- * Event data, describing the indexes that were added/removed/updated, and providing access to Rows (and thus data
190
- * in columns) either by index, or scanning the complete present index.
191
- *
192
- * This class supports two ways of reading the table - checking the changes made since the last update, and reading
193
- * all data currently in the table. While it is more expensive to always iterate over every single row in the table,
194
- * it may in some cases actually be cheaper than maintaining state separately and updating only the changes, though
195
- * both options should be considered.
196
- *
197
- * The RangeSet objects allow iterating over the LongWrapper indexes in the table. Note that these "indexes" are not
198
- * necessarily contiguous and may be negative, and represent some internal state on the server, allowing it to keep
199
- * track of data efficiently. Those LongWrapper objects can be passed to the various methods on this instance to
200
- * read specific rows or cells out of the table.
156
+ * A format to describe a variable available to be read from the server. Application fields are optional, and only
157
+ * populated when a variable is provided by application mode.
158
+ * <p>
159
+ * APIs which take a VariableDefinition must at least be provided an object with a <b>type</b> and <b>id</b> field.
201
160
  */
202
- export interface SubscriptionTableData extends TableData {
203
- get fullIndex():RangeSet;
161
+ export interface VariableDefinition {
162
+ get name():string;
204
163
  /**
205
- * The ordered set of row indexes removed since the last update
206
- * @return dh.RangeSet
164
+ * Optional description for the variable's contents, typically used to provide more detail that wouldn't be
165
+ * reasonable to put in the title
166
+ * @return String
207
167
  */
208
- get removed():RangeSet;
168
+ get description():string;
209
169
  /**
210
- * The ordered set of row indexes added since the last update
211
- * @return dh.RangeSet
170
+ * An opaque identifier for this variable
171
+ * @return String
212
172
  */
213
- get added():RangeSet;
214
- get columns():Array<Column>;
173
+ get id():string;
215
174
  /**
216
- * The ordered set of row indexes updated since the last update
217
- * @return dh.RangeSet
175
+ * The type of the variable, one of <b>dh.VariableType</b>
176
+ * @return dh.VariableType.
218
177
  */
219
- get modified():RangeSet;
220
- get rows():Array<Row>;
221
- }
222
- export interface WorkerHeapInfo {
178
+ get type():dh.VariableTypeType;
223
179
  /**
224
- * Total heap size available for this worker.
180
+ * The name of the variable, to be used when rendering it to a user
181
+ * @return String
225
182
  */
226
- get totalHeapSize():number;
227
- get freeMemory():number;
228
- get maximumHeapSize():number;
229
- }
230
- /**
231
- * Behaves like a Table, but doesn't expose all of its API for changing the internal state. Instead, state is driven by
232
- * the upstream table - when it changes handle, this listens and updates its own handle accordingly.
233
- *
234
- * Additionally, this is automatically subscribed to its one and only row, across all columns.
235
- *
236
- * A new config is returned any time it is accessed, to prevent accidental mutation, and to allow it to be used as a
237
- * template when fetching a new totals table, or changing the totals table in use.
238
- *
239
- * A simplistic Table, providing access to aggregation of the table it is sourced from. This table is always
240
- * automatically subscribed to its parent, and adopts changes automatically from it. This class has limited methods
241
- * found on Table. Instances of this type always have a size of one when no groupBy is set on the config, but may
242
- * potentially contain as few as zero rows, or as many as the parent table if each row gets its own group.
243
- *
244
- * When using the `groupBy` feature, it may be desireable to also provide a row to the user with all values across all
245
- * rows. To achieve this, request the same Totals Table again, but remove the `groupBy` setting.
246
- */
247
- export interface TotalsTable extends JoinableTable {
183
+ get title():string;
248
184
  /**
249
- * Specifies the range of items to pass to the client and update as they change. If the columns parameter is not
250
- * provided, all columns will be used. Until this is called, no data will be available. Invoking this will result in
251
- * events to be fired once data becomes available, starting with an <b>updated</b> event and one <b>rowadded</b>
252
- * event per row in that range.
253
- * @param firstRow -
254
- * @param lastRow -
255
- * @param columns -
256
- * @param updateIntervalMs -
185
+ * Optional description for the variable's contents, typically used to provide more detail that wouldn't be
186
+ * reasonable to put in the title
187
+ * @return String
257
188
  */
258
- setViewport(firstRow:number, lastRow:number, columns?:Array<Column>, updateIntervalMs?:number):void;
189
+ get applicationId():string;
259
190
  /**
260
- * the currently visible viewport. If the current set of operations has not yet resulted in data, it will not
261
- * resolve until that data is ready.
262
- * @return Promise of {@link dh.TableData}
191
+ * The name of the application which provided this variable
192
+ * @return String
263
193
  */
264
- getViewportData():Promise<TableData>;
194
+ get applicationName():string;
195
+ }
196
+ /**
197
+ * Describes changes in the current set of variables in the script session. Note that variables that changed value
198
+ * without changing type will be included as <b>updated</b>, but if a new value with one type replaces an old value with
199
+ * a different type, this will be included as an entry in both <b>removed</b> and <b>created</b> to indicate the old and
200
+ * new types.
201
+ */
202
+ export interface VariableChanges {
265
203
  /**
266
- * a column by the given name. You should prefer to always retrieve a new Column instance instead of caching a
267
- * returned value.
268
- * @param key -
269
- * @return {@link dh.Column}
204
+ *
205
+ * @return The variables that no longer exist after this operation, or were replaced by some variable with a
206
+ * different type.
270
207
  */
271
- findColumn(key:string):Column;
208
+ get removed():Array<VariableDefinition>;
272
209
  /**
273
- * multiple columns specified by the given names.
274
- * @param keys -
275
- * @return {@link dh.Column} array
210
+ *
211
+ * @return The variables that were created by this operation, or have a new type.
276
212
  */
277
- findColumns(keys:string[]):Column[];
213
+ get created():Array<VariableDefinition>;
278
214
  /**
279
- * Indicates that the table will no longer be used, and resources used to provide it can be freed up on the server.
215
+ *
216
+ * @return The variables that changed value during this operation.
280
217
  */
281
- close():void;
282
- addEventListener<T>(name:string, callback:(e:CustomEvent<T>)=>void):()=>void;
283
- removeEventListener<T>(name:string, callback:(e:CustomEvent<T>)=>void):boolean;
284
- nextEvent<T>(eventName:string, timeoutInMillis:number):Promise<CustomEvent<T>>;
285
- hasListeners(name:string):boolean;
286
- /**
287
- * Replace the currently set sort on this table. Returns the previously set value. Note that the sort property will
288
- * immediately return the new value, but you may receive update events using the old sort before the new sort is
289
- * applied, and the <b>sortchanged</b> event fires. Reusing existing, applied sorts may enable this to perform
290
- * better on the server. The <b>updated</b> event will also fire, but <b>rowadded</b> and <b>rowremoved</b> will
291
- * not.
292
- * @param sort -
293
- * @return {@link dh.Sort} array
294
- */
295
- applySort(sort:Sort[]):Array<Sort>;
296
- /**
297
- * Replace the current custom columns with a new set. These columns can be used when adding new filter and sort
298
- * operations to the table, as long as they are present.
299
- * @param customColumns -
300
- * @return
301
- */
302
- applyCustomColumns(customColumns:Array<string|CustomColumn>):Array<CustomColumn>;
303
- /**
304
- * Replace the currently set filters on the table. Returns the previously set value. Note that the filter property
305
- * will immediately return the new value, but you may receive update events using the old filter before the new one
306
- * is applied, and the <b>filterchanged</b> event fires. Reusing existing, applied filters may enable this to
307
- * perform better on the server. The <b>updated</b> event will also fire, but <b>rowadded</b> and <b>rowremoved</b>
308
- * will not.
309
- * @param filter -
310
- * @return {@link dh.FilterCondition} array
311
- */
312
- applyFilter(filter:FilterCondition[]):Array<FilterCondition>;
313
- /**
314
- * An ordered list of Filters to apply to the table. To update, call applyFilter(). Note that this getter will
315
- * return the new value immediately, even though it may take a little time to update on the server. You may listen
316
- * for the <b>filterchanged</b> event to know when to update the UI.
317
- * @return {@link dh.FilterCondition} array
318
- */
319
- get filter():Array<FilterCondition>;
320
- /**
321
- * True if this table has been closed.
322
- * @return boolean
323
- */
324
- get isClosed():boolean;
325
- /**
326
- * The total number of rows in this table. This may change as the base table's configuration, filter, or contents
327
- * change.
328
- * @return double
329
- */
330
- get size():number;
331
- /**
332
- * The columns present on this table. Note that this may not include all columns in the parent table, and in cases
333
- * where a given column has more than one aggregation applied, the column name will have a suffix indicating the
334
- * aggregation used. This suffixed name will be of the form <b>columnName + '__' + aggregationName</b>.
335
- * @return {@link dh.Column} array
336
- */
337
- get columns():Array<Column>;
338
- get totalsTableConfig():TotalsTableConfig;
339
- /**
340
- * An ordered list of Sorts to apply to the table. To update, call applySort(). Note that this getter will return
341
- * the new value immediately, even though it may take a little time to update on the server. You may listen for the
342
- * <b>sortchanged</b> event to know when to update the UI.
343
- * @return {@link dh.Sort} array
344
- */
345
- get sort():Array<Sort>;
346
- /**
347
- * Read-only. An ordered list of custom column formulas to add to the table, either adding new columns or replacing
348
- * existing ones. To update, call <b>applyCustomColumns()</b>.
349
- * @return {@link dh.CustomColumn} array
350
- */
351
- get customColumns():Array<CustomColumn>;
352
- /**
353
- * True if this table may receive updates from the server, including size changed events, updated events after
354
- * initial snapshot.
355
- * @return boolean
356
- */
357
- get isRefreshing():boolean;
358
- }
359
- export interface HasEventHandling {
360
- /**
361
- * Listen for events on this object.
362
- * @param name - the name of the event to listen for
363
- * @param callback - a function to call when the event occurs
364
- * @return Returns a cleanup function.
365
- * @typeParam T - the type of the data that the event will provide
366
- */
367
- addEventListener<T>(name:string, callback:(e:CustomEvent<T>)=>void):()=>void;
368
- nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<CustomEvent<T>>;
369
- hasListeners(name:string):boolean;
370
- /**
371
- * Removes an event listener added to this table.
372
- * @param name -
373
- * @param callback -
374
- * @return
375
- * @typeParam T -
376
- */
377
- removeEventListener<T>(name:string, callback:(e:CustomEvent<T>)=>void):boolean;
378
- }
379
- /**
380
- * Common interface for various ways of accessing table data and formatting.
381
- *
382
- * Java note: this interface contains some extra overloads that aren't available in JS. Implementations are expected to
383
- * implement only abstract methods, and default methods present in this interface will dispatch accordingly.
384
- */
385
- export interface TableData {
386
- get(index:LongWrapper|number):Row;
387
- getData(index:LongWrapper|number, column:Column):any;
388
- getFormat(index:LongWrapper|number, column:Column):Format;
389
- get columns():Array<Column>;
390
- get rows():Array<Row>;
391
- }
392
- export interface LayoutHints {
393
- readonly searchDisplayMode?:SearchDisplayModeType|null;
394
-
395
- get hiddenColumns():string[]|null;
396
- get frozenColumns():string[]|null;
397
- get columnGroups():ColumnGroup[]|null;
398
- get areSavedLayoutsAllowed():boolean;
399
- get frontColumns():string[]|null;
400
- get backColumns():string[]|null;
401
- }
402
- /**
403
- * This object may be pooled internally or discarded and not updated. Do not retain references to it. Instead, request
404
- * the viewport again.
405
- */
406
- export interface ViewportRow extends Row {
407
- get index():LongWrapper;
408
- }
409
- /**
410
- * Contains data in the current viewport. Also contains the offset to this data, so that the actual row number may be
411
- * determined. Do not assume that the first row in `rows` is the first visible row, because extra rows may be provided
412
- * for easier scrolling without going to the server.
413
- */
414
- export interface ViewportData extends TableData {
415
- /**
416
- * The index of the first returned row
417
- * @return double
418
- */
419
- get offset():number;
420
- /**
421
- * A list of columns describing the data types in each row
422
- * @return {@link dh.Column} array.
423
- */
424
- get columns():Array<Column>;
425
- /**
426
- * An array of rows of data
427
- * @return {@link dh.ViewportRow} array.
428
- */
429
- get rows():Array<ViewportRow>;
430
- }
431
- /**
432
- * Represents a table which can be joined to another table. Current implementations are {@link dh.Table} and
433
- * {@link dh.TotalsTable}.
434
- */
435
- export interface JoinableTable {
436
- freeze():Promise<Table>;
437
- snapshot(baseTable:Table, doInitialSnapshot?:boolean, stampColumns?:string[]):Promise<Table>;
218
+ get updated():Array<VariableDefinition>;
219
+ }
220
+ /**
221
+ * Specifies a type and either id or name (but not both).
222
+ */
223
+ export interface VariableDescriptor {
224
+ type:string;
225
+ id?:string|null;
226
+ name?:string|null;
227
+ }
228
+ }
229
+
230
+ export namespace dh {
231
+
232
+ /**
233
+ * Represents a table which can be joined to another table. Current implementations are {@link dh.Table} and
234
+ * {@link dh.TotalsTable}.
235
+ */
236
+ export interface JoinableTable {
237
+ freeze():Promise<Table>;
238
+ snapshot(baseTable:Table, doInitialSnapshot?:boolean, stampColumns?:string[]):Promise<Table>;
438
239
  /**
439
240
  * Joins this table to the provided table, using one of the specified join types:
440
241
  * <ul>
@@ -518,97 +319,38 @@ export namespace dh {
518
319
  naturalJoin(rightTable:JoinableTable, columnsToMatch:Array<string>, columnsToAdd?:Array<string>|undefined|null):Promise<Table>;
519
320
  }
520
321
  /**
521
- * Row implementation that also provides additional read-only properties. represents visible rows in the table,
522
- * but with additional properties to reflect the tree structure.
523
- */
524
- export interface TreeRow extends ViewportRow {
525
- /**
526
- * True if this node is currently expanded to show its children; false otherwise. Those children will be the
527
- * rows below this one with a greater depth than this one
528
- * @return boolean
529
- */
530
- get isExpanded():boolean;
531
- /**
532
- * The number of levels above this node; zero for top level nodes. Generally used by the UI to indent the
533
- * row and its expand/collapse icon
534
- * @return int
535
- */
536
- get depth():number;
537
- /**
538
- * True if this node has children and can be expanded; false otherwise. Note that this value may change when
539
- * the table updates, depending on the table's configuration
540
- * @return boolean
541
- */
542
- get hasChildren():boolean;
543
- get index():LongWrapper;
544
- }
545
- /**
546
- * This object may be pooled internally or discarded and not updated. Do not retain references to it.
547
- */
548
- export interface Format {
549
- /**
550
- * The format string to apply to the value of this cell.
551
- * @return String
552
- */
553
- readonly formatString?:string|null;
554
- /**
555
- * Color to apply to the cell's background, in <b>#rrggbb</b> format.
556
- * @return String
557
- */
558
- readonly backgroundColor?:string|null;
559
- /**
560
- * Color to apply to the text, in <b>#rrggbb</b> format.
561
- * @return String
562
- */
563
- readonly color?:string|null;
564
- /**
565
- *
566
- * @deprecated Prefer formatString. Number format string to apply to the value in this cell.
567
- */
568
- readonly numberFormat?:string|null;
569
- }
570
- /**
571
- * Javascript wrapper for {@link io.deephaven.web.shared.data.ColumnStatistics} This class holds the results of a call to generate statistics on a
572
- * table column.
322
+ * Event data, describing the indexes that were added/removed/updated, and providing access to Rows (and thus data
323
+ * in columns) either by index, or scanning the complete present index.
324
+ *
325
+ * This class supports two ways of reading the table - checking the changes made since the last update, and reading
326
+ * all data currently in the table. While it is more expensive to always iterate over every single row in the table,
327
+ * it may in some cases actually be cheaper than maintaining state separately and updating only the changes, though
328
+ * both options should be considered.
329
+ *
330
+ * The RangeSet objects allow iterating over the LongWrapper indexes in the table. Note that these "indexes" are not
331
+ * necessarily contiguous and may be negative, and represent some internal state on the server, allowing it to keep
332
+ * track of data efficiently. Those LongWrapper objects can be passed to the various methods on this instance to
333
+ * read specific rows or cells out of the table.
573
334
  */
574
- export interface ColumnStatistics {
335
+ export interface SubscriptionTableData extends TableData {
336
+ get fullIndex():RangeSet;
575
337
  /**
576
- * Gets the type of formatting that should be used for given statistic.
577
- * <p>
578
- * the format type for a statistic. A null return value means that the column formatting should be used.
579
- * @param name - the display name of the statistic
580
- * @return String
338
+ * The ordered set of row indexes removed since the last update
339
+ * @return dh.RangeSet
581
340
  */
582
- getType(name:string):string;
341
+ get removed():RangeSet;
583
342
  /**
584
- * Gets a map with the name of each unique value as key and the count as the value. A map of each unique value's
585
- * name to the count of how many times it occurred in the column. This map will be empty for tables containing more
586
- * than 19 unique values.
587
- * @return Map of String double
343
+ * The ordered set of row indexes added since the last update
344
+ * @return dh.RangeSet
588
345
  */
589
- get uniqueValues():Map<string, number>;
346
+ get added():RangeSet;
347
+ get columns():Array<Column>;
590
348
  /**
591
- * Gets a map with the display name of statistics as keys and the numeric stat as a value.
592
- * <p>
593
- * A map of each statistic's name to its value.
594
- * @return Map of String and Object
349
+ * The ordered set of row indexes updated since the last update
350
+ * @return dh.RangeSet
595
351
  */
596
- get statisticsMap():Map<string, object>;
597
- }
598
- export interface Row {
599
- get(column:Column):any;
600
- getFormat(column:Column):Format;
601
- get index():LongWrapper;
602
- }
603
- /**
604
- * Wrap LocalDate values for use in JS. Provides text formatting for display and access to the underlying value.
605
- */
606
- export interface LocalDateWrapper {
607
- valueOf():string;
608
- getYear():number;
609
- getMonthValue():number;
610
- getDayOfMonth():number;
611
- toString():string;
352
+ get modified():RangeSet;
353
+ get rows():Array<Row>;
612
354
  }
613
355
  /**
614
356
  * Encapsulates event handling around table subscriptions by "cheating" and wrapping up a JsTable instance to do the
@@ -655,581 +397,658 @@ export namespace dh {
655
397
  getViewportData():Promise<TableData>;
656
398
  snapshot(rows:RangeSet, columns:Column[]):Promise<TableData>;
657
399
  }
658
- /**
659
- * Wrap LocalTime values for use in JS. Provides text formatting for display and access to the underlying value.
660
- */
661
- export interface LocalTimeWrapper {
662
- valueOf():string;
663
- getHour():number;
664
- getMinute():number;
665
- getSecond():number;
666
- getNano():number;
667
- toString():string;
668
- }
669
- export interface RefreshToken {
670
- get bytes():string;
671
- get expiry():number;
400
+ export interface WorkerHeapInfo {
401
+ /**
402
+ * Total heap size available for this worker.
403
+ */
404
+ get totalHeapSize():number;
405
+ get freeMemory():number;
406
+ get maximumHeapSize():number;
672
407
  }
673
-
674
- export class IdeSession implements HasEventHandling {
675
- static readonly EVENT_COMMANDSTARTED:string;
676
- static readonly EVENT_REQUEST_FAILED:string;
677
-
678
- protected constructor();
679
-
408
+ /**
409
+ * Row implementation that also provides additional read-only properties. represents visible rows in the table,
410
+ * but with additional properties to reflect the tree structure.
411
+ */
412
+ export interface TreeRow extends ViewportRow {
680
413
  /**
681
- * Load the named table, with columns and size information already fully populated.
682
- * @param name -
683
- * @param applyPreviewColumns - optional boolean
684
- * @return {@link Promise} of {@link dh.Table}
414
+ * True if this node is currently expanded to show its children; false otherwise. Those children will be the
415
+ * rows below this one with a greater depth than this one
416
+ * @return boolean
685
417
  */
686
- getTable(name:string, applyPreviewColumns?:boolean):Promise<Table>;
418
+ get isExpanded():boolean;
687
419
  /**
688
- * Load the named Figure, including its tables and tablemaps as needed.
689
- * @param name -
690
- * @return promise of dh.plot.Figure
420
+ * The number of levels above this node; zero for top level nodes. Generally used by the UI to indent the
421
+ * row and its expand/collapse icon
422
+ * @return int
691
423
  */
692
- getFigure(name:string):Promise<dh.plot.Figure>;
424
+ get depth():number;
693
425
  /**
694
- * Loads the named tree table or roll-up table, with column data populated. All nodes are collapsed by default, and
695
- * size is presently not available until the viewport is first set.
696
- * @param name -
697
- * @return {@link Promise} of {@link dh.TreeTable}
426
+ * True if this node has children and can be expanded; false otherwise. Note that this value may change when
427
+ * the table updates, depending on the table's configuration
428
+ * @return boolean
698
429
  */
699
- getTreeTable(name:string):Promise<TreeTable>;
700
- getHierarchicalTable(name:string):Promise<TreeTable>;
701
- getPartitionedTable(name:string):Promise<PartitionedTable>;
702
- getObject(definitionObject:dh.ide.VariableDescriptor):Promise<any>;
703
- newTable(columnNames:string[], types:string[], data:string[][], userTimeZone:string):Promise<Table>;
430
+ get hasChildren():boolean;
431
+ get index():LongWrapper;
432
+ }
433
+ export interface LayoutHints {
434
+ readonly searchDisplayMode?:SearchDisplayModeType|null;
435
+
436
+ get hiddenColumns():string[]|null;
437
+ get frozenColumns():string[]|null;
438
+ get columnGroups():ColumnGroup[]|null;
439
+ get areSavedLayoutsAllowed():boolean;
440
+ get frontColumns():string[]|null;
441
+ get backColumns():string[]|null;
442
+ }
443
+ /**
444
+ * This object may be pooled internally or discarded and not updated. Do not retain references to it.
445
+ */
446
+ export interface Format {
704
447
  /**
705
- * Merges the given tables into a single table. Assumes all tables have the same structure.
706
- * @param tables -
707
- * @return {@link Promise} of {@link dh.Table}
448
+ * The format string to apply to the value of this cell.
449
+ * @return String
708
450
  */
709
- mergeTables(tables:Table[]):Promise<Table>;
710
- bindTableToVariable(table:Table, name:string):Promise<void>;
711
- subscribeToFieldUpdates(callback:(arg0:dh.ide.VariableChanges)=>void):()=>void;
712
- close():void;
713
- runCode(code:string):Promise<dh.ide.CommandResult>;
714
- onLogMessage(callback:(arg0:dh.ide.LogItem)=>void):()=>void;
715
- openDocument(params:object):void;
716
- changeDocument(params:object):void;
717
- getCompletionItems(params:object):Promise<Array<dh.lsp.CompletionItem>>;
718
- getSignatureHelp(params:object):Promise<Array<dh.lsp.SignatureInformation>>;
719
- getHover(params:object):Promise<dh.lsp.Hover>;
720
- closeDocument(params:object):void;
451
+ readonly formatString?:string|null;
721
452
  /**
722
- * Creates an empty table with the specified number of rows. Optionally columns and types may be specified, but all
723
- * values will be null.
724
- * @param size -
725
- * @return {@link Promise} of {@link dh.Table}
453
+ * Color to apply to the cell's background, in <b>#rrggbb</b> format.
454
+ * @return String
726
455
  */
727
- emptyTable(size:number):Promise<Table>;
456
+ readonly backgroundColor?:string|null;
728
457
  /**
729
- * Creates a new table that ticks automatically every "periodNanos" nanoseconds. A start time may be provided; if so
730
- * the table will be populated with the interval from the specified date until now.
731
- * @param periodNanos -
732
- * @param startTime -
733
- * @return {@link Promise} of {@link dh.Table}
458
+ * Color to apply to the text, in <b>#rrggbb</b> format.
459
+ * @return String
734
460
  */
735
- timeTable(periodNanos:number, startTime?:DateWrapper):Promise<Table>;
736
- addEventListener<T>(name:string, callback:(e:CustomEvent<T>)=>void):()=>void;
737
- nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<CustomEvent<T>>;
738
- hasListeners(name:string):boolean;
739
- removeEventListener<T>(name:string, callback:(e:CustomEvent<T>)=>void):boolean;
461
+ readonly color?:string|null;
462
+ /**
463
+ *
464
+ * @deprecated Prefer formatString. Number format string to apply to the value in this cell.
465
+ */
466
+ readonly numberFormat?:string|null;
467
+ }
468
+ export interface TreeViewportData extends TableData {
469
+ get offset():number;
470
+ get columns():Array<Column>;
471
+ get rows():Array<TreeRow>;
740
472
  }
741
-
742
473
  /**
743
- * Describes a Sort present on the table. No visible constructor, created through the use of Column.sort(), will be tied
744
- * to that particular column data. Sort instances are immutable, and use a builder pattern to make modifications. All
745
- * methods return a new Sort instance.
474
+ * Common interface for various ways of accessing table data and formatting.
475
+ *
476
+ * Java note: this interface contains some extra overloads that aren't available in JS. Implementations are expected to
477
+ * implement only abstract methods, and default methods present in this interface will dispatch accordingly.
746
478
  */
747
- export class Sort {
748
- static readonly ASCENDING:string;
749
- static readonly DESCENDING:string;
750
- static readonly REVERSE:string;
751
-
752
- protected constructor();
753
-
479
+ export interface TableData {
480
+ get(index:LongWrapper|number):Row;
481
+ getData(index:LongWrapper|number, column:Column):any;
482
+ getFormat(index:LongWrapper|number, column:Column):Format;
483
+ get columns():Array<Column>;
484
+ get rows():Array<Row>;
485
+ }
486
+ /**
487
+ * Wrap LocalDate values for use in JS. Provides text formatting for display and access to the underlying value.
488
+ */
489
+ export interface LocalDateWrapper {
490
+ valueOf():string;
491
+ getYear():number;
492
+ getMonthValue():number;
493
+ getDayOfMonth():number;
494
+ toString():string;
495
+ }
496
+ export interface ColumnGroup {
497
+ get name():string|null;
498
+ get children():string[]|null;
499
+ get color():string|null;
500
+ }
501
+ /**
502
+ * Javascript wrapper for {@link io.deephaven.web.shared.data.ColumnStatistics} This class holds the results of a call to generate statistics on a
503
+ * table column.
504
+ */
505
+ export interface ColumnStatistics {
754
506
  /**
755
- * Builds a Sort instance to sort values in ascending order.
756
- * @return {@link dh.Sort}
507
+ * Gets the type of formatting that should be used for given statistic.
508
+ * <p>
509
+ * the format type for a statistic. A null return value means that the column formatting should be used.
510
+ * @param name - the display name of the statistic
511
+ * @return String
757
512
  */
758
- asc():Sort;
513
+ getType(name:string):string;
759
514
  /**
760
- * Builds a Sort instance to sort values in descending order.
761
- * @return {@link dh.Sort}
515
+ * 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
516
+ * name to the count of how many times it occurred in the column. This map will be empty for tables containing more
517
+ * than 19 unique values.
518
+ * @return Map of String double
762
519
  */
763
- desc():Sort;
520
+ get uniqueValues():Map<string, number>;
764
521
  /**
765
- * Builds a Sort instance which takes the absolute value before applying order.
766
- * @return {@link dh.Sort}
522
+ * Gets a map with the display name of statistics as keys and the numeric stat as a value.
523
+ * <p>
524
+ * A map of each statistic's name to its value.
525
+ * @return Map of String and Object
767
526
  */
768
- abs():Sort;
769
- toString():string;
527
+ get statisticsMap():Map<string, object>;
528
+ }
529
+ /**
530
+ * This object may be pooled internally or discarded and not updated. Do not retain references to it. Instead, request
531
+ * the viewport again.
532
+ */
533
+ export interface ViewportRow extends Row {
534
+ get index():LongWrapper;
535
+ }
536
+ /**
537
+ * Represents the contents of a single widget data message from the server, with a binary data paylod and exported
538
+ * objects. Implemented both by Widget itself and by the `event.details` when data is received by the client.
539
+ *
540
+ * Terminology note: the name of this type should probably use "Data" instead of "Message", and the methods should use
541
+ * "payload" rather than "data" to match other platforms and the protobuf itself. These names are instead used for
542
+ * backwards compatibility and to better follow JS expectations.
543
+ */
544
+ export interface WidgetMessageDetails {
770
545
  /**
771
- * True if the absolute value of the column should be used when sorting; defaults to false.
772
- * @return boolean
546
+ * Returns the data from this message as a base64-encoded string.
773
547
  */
774
- get isAbs():boolean;
548
+ getDataAsBase64():string;
775
549
  /**
776
- * The column which is sorted.
777
- * @return {@link dh.Column}
550
+ * Returns the data from this message as a Uint8Array.
778
551
  */
779
- get column():Column;
552
+ getDataAsU8():Uint8Array;
780
553
  /**
781
- * The direction of this sort, either <b>ASC</b>, <b>DESC</b>, or <b>REVERSE</b>.
782
- * @return String
554
+ * Returns the data from this message as a utf-8 string.
783
555
  */
784
- get direction():string;
785
- }
786
-
787
- export class DateWrapper extends LongWrapper {
788
- protected constructor();
789
-
790
- static ofJsDate(date:Date):DateWrapper;
791
- asDate():Date;
556
+ getDataAsString():string;
557
+ /**
558
+ * Returns an array of exported objects sent from the server. The plugin implementation is now responsible for these
559
+ * objects, and should close them when no longer needed.
560
+ */
561
+ get exportedObjects():WidgetExportedObject[];
792
562
  }
793
-
794
- export class QueryInfo {
795
- static readonly EVENT_TABLE_OPENED:string;
796
- static readonly EVENT_DISCONNECT:string;
797
- static readonly EVENT_RECONNECT:string;
798
- static readonly EVENT_CONNECT:string;
799
-
800
- protected constructor();
563
+ export interface Row {
564
+ get(column:Column):any;
565
+ getFormat(column:Column):Format;
566
+ get index():LongWrapper;
801
567
  }
802
-
803
568
  /**
804
- * Describes the structure of the column, and if desired can be used to get access to the data to be rendered in this
805
- * column.
569
+ * Behaves like a Table, but doesn't expose all of its API for changing the internal state. Instead, state is driven by
570
+ * the upstream table - when it changes handle, this listens and updates its own handle accordingly.
571
+ *
572
+ * Additionally, this is automatically subscribed to its one and only row, across all columns.
573
+ *
574
+ * A new config is returned any time it is accessed, to prevent accidental mutation, and to allow it to be used as a
575
+ * template when fetching a new totals table, or changing the totals table in use.
576
+ *
577
+ * A simplistic Table, providing access to aggregation of the table it is sourced from. This table is always
578
+ * automatically subscribed to its parent, and adopts changes automatically from it. This class has limited methods
579
+ * found on Table. Instances of this type always have a size of one when no groupBy is set on the config, but may
580
+ * potentially contain as few as zero rows, or as many as the parent table if each row gets its own group.
581
+ *
582
+ * When using the `groupBy` feature, it may be desireable to also provide a row to the user with all values across all
583
+ * rows. To achieve this, request the same Totals Table again, but remove the `groupBy` setting.
806
584
  */
807
- export class Column {
585
+ export interface TotalsTable extends JoinableTable {
808
586
  /**
809
- * If this column is part of a roll-up tree table, represents the type of the row data that can be found in this
810
- * column for leaf nodes if includeConstituents is enabled. Otherwise, it is <b>null</b>.
811
- * @return String
587
+ * Specifies the range of items to pass to the client and update as they change. If the columns parameter is not
588
+ * provided, all columns will be used. Until this is called, no data will be available. Invoking this will result in
589
+ * events to be fired once data becomes available, starting with an <b>updated</b> event and one <b>rowadded</b>
590
+ * event per row in that range.
591
+ * @param firstRow -
592
+ * @param lastRow -
593
+ * @param columns -
594
+ * @param updateIntervalMs -
812
595
  */
813
- readonly constituentType?:string|null;
814
- readonly description?:string|null;
815
-
816
- protected constructor();
817
-
596
+ setViewport(firstRow:number, lastRow:number, columns?:Array<Column>, updateIntervalMs?:number):void;
818
597
  /**
819
- * the value for this column in the given row. Type will be consistent with the type of the Column.
820
- * @param row -
821
- * @return Any
598
+ * the currently visible viewport. If the current set of operations has not yet resulted in data, it will not
599
+ * resolve until that data is ready.
600
+ * @return Promise of {@link dh.TableData}
822
601
  */
823
- get(row:Row):any;
824
- getFormat(row:Row):Format;
602
+ getViewportData():Promise<TableData>;
825
603
  /**
826
- * Creates a sort builder object, to be used when sorting by this column.
827
- * @return {@link dh.Sort}
604
+ * a column by the given name. You should prefer to always retrieve a new Column instance instead of caching a
605
+ * returned value.
606
+ * @param key -
607
+ * @return {@link dh.Column}
828
608
  */
829
- sort():Sort;
609
+ findColumn(key:string):Column;
830
610
  /**
831
- * Creates a new value for use in filters based on this column. Used either as a parameter to another filter
832
- * operation, or as a builder to create a filter operation.
833
- * @return {@link dh.FilterValue}
611
+ * multiple columns specified by the given names.
612
+ * @param keys -
613
+ * @return {@link dh.Column} array
614
+ */
615
+ findColumns(keys:string[]):Column[];
616
+ /**
617
+ * Indicates that the table will no longer be used, and resources used to provide it can be freed up on the server.
618
+ */
619
+ close():void;
620
+ addEventListener<T>(name:string, callback:(e:CustomEvent<T>)=>void):()=>void;
621
+ removeEventListener<T>(name:string, callback:(e:CustomEvent<T>)=>void):boolean;
622
+ nextEvent<T>(eventName:string, timeoutInMillis:number):Promise<CustomEvent<T>>;
623
+ hasListeners(name:string):boolean;
624
+ /**
625
+ * Replace the currently set sort on this table. Returns the previously set value. Note that the sort property will
626
+ * immediately return the new value, but you may receive update events using the old sort before the new sort is
627
+ * applied, and the <b>sortchanged</b> event fires. Reusing existing, applied sorts may enable this to perform
628
+ * better on the server. The <b>updated</b> event will also fire, but <b>rowadded</b> and <b>rowremoved</b> will
629
+ * not.
630
+ * @param sort -
631
+ * @return {@link dh.Sort} array
632
+ */
633
+ applySort(sort:Sort[]):Array<Sort>;
634
+ /**
635
+ * Replace the current custom columns with a new set. These columns can be used when adding new filter and sort
636
+ * operations to the table, as long as they are present.
637
+ * @param customColumns -
638
+ * @return
639
+ */
640
+ applyCustomColumns(customColumns:Array<string|CustomColumn>):Array<CustomColumn>;
641
+ /**
642
+ * Replace the currently set filters on the table. Returns the previously set value. Note that the filter property
643
+ * will immediately return the new value, but you may receive update events using the old filter before the new one
644
+ * is applied, and the <b>filterchanged</b> event fires. Reusing existing, applied filters may enable this to
645
+ * perform better on the server. The <b>updated</b> event will also fire, but <b>rowadded</b> and <b>rowremoved</b>
646
+ * will not.
647
+ * @param filter -
648
+ * @return {@link dh.FilterCondition} array
834
649
  */
835
- filter():FilterValue;
650
+ applyFilter(filter:FilterCondition[]):Array<FilterCondition>;
836
651
  /**
837
- * a <b>CustomColumn</b> object to apply using `applyCustomColumns` with the expression specified.
838
- * @param expression -
839
- * @return {@link dh.CustomColumn}
652
+ * An ordered list of Filters to apply to the table. To update, call applyFilter(). Note that this getter will
653
+ * return the new value immediately, even though it may take a little time to update on the server. You may listen
654
+ * for the <b>filterchanged</b> event to know when to update the UI.
655
+ * @return {@link dh.FilterCondition} array
840
656
  */
841
- formatColor(expression:string):CustomColumn;
657
+ get filter():Array<FilterCondition>;
842
658
  /**
843
- * a <b>CustomColumn</b> object to apply using <b>applyCustomColumns</b> with the expression specified.
844
- * @param expression -
845
- * @return {@link dh.CustomColumn}
659
+ * True if this table has been closed.
660
+ * @return boolean
846
661
  */
847
- formatNumber(expression:string):CustomColumn;
662
+ get isClosed():boolean;
848
663
  /**
849
- * a <b>CustomColumn</b> object to apply using <b>applyCustomColumns</b> with the expression specified.
850
- * @param expression -
851
- * @return {@link dh.CustomColumn}
664
+ * The total number of rows in this table. This may change as the base table's configuration, filter, or contents
665
+ * change.
666
+ * @return double
852
667
  */
853
- formatDate(expression:string):CustomColumn;
854
- toString():string;
668
+ get size():number;
855
669
  /**
856
- * Label for this column.
857
- * @return String
670
+ * The columns present on this table. Note that this may not include all columns in the parent table, and in cases
671
+ * where a given column has more than one aggregation applied, the column name will have a suffix indicating the
672
+ * aggregation used. This suffixed name will be of the form <b>columnName + '__' + aggregationName</b>.
673
+ * @return {@link dh.Column} array
858
674
  */
859
- get name():string;
675
+ get columns():Array<Column>;
676
+ get totalsTableConfig():TotalsTableConfig;
860
677
  /**
861
- * True if this column is a partition column. Partition columns are used for filtering uncoalesced tables (see
862
- * <b>isUncoalesced</b> property on <b>Table</b>)
863
- * @return boolean
678
+ * An ordered list of Sorts to apply to the table. To update, call applySort(). Note that this getter will return
679
+ * the new value immediately, even though it may take a little time to update on the server. You may listen for the
680
+ * <b>sortchanged</b> event to know when to update the UI.
681
+ * @return {@link dh.Sort} array
864
682
  */
865
- get isPartitionColumn():boolean;
683
+ get sort():Array<Sort>;
866
684
  /**
867
- *
868
- * @deprecated do not use. Internal index of the column in the table, to be used as a key on the Row.
869
- * @return int
685
+ * Read-only. An ordered list of custom column formulas to add to the table, either adding new columns or replacing
686
+ * existing ones. To update, call <b>applyCustomColumns()</b>.
687
+ * @return {@link dh.CustomColumn} array
870
688
  */
871
- get index():number;
872
- get isSortable():boolean;
689
+ get customColumns():Array<CustomColumn>;
873
690
  /**
874
- * Type of the row data that can be found in this column.
875
- * @return String
691
+ * True if this table may receive updates from the server, including size changed events, updated events after
692
+ * initial snapshot.
693
+ * @return boolean
876
694
  */
877
- get type():string;
695
+ get isRefreshing():boolean;
696
+ }
697
+ export interface HasEventHandling {
878
698
  /**
879
- * Format entire rows colors using the expression specified. Returns a <b>CustomColumn</b> object to apply to a
880
- * table using <b>applyCustomColumns</b> with the parameters specified.
881
- * @param expression -
882
- * @return {@link dh.CustomColumn}
699
+ * Listen for events on this object.
700
+ * @param name - the name of the event to listen for
701
+ * @param callback - a function to call when the event occurs
702
+ * @return Returns a cleanup function.
703
+ * @typeParam T - the type of the data that the event will provide
883
704
  */
884
- static formatRowColor(expression:string):CustomColumn;
705
+ addEventListener<T>(name:string, callback:(e:CustomEvent<T>)=>void):()=>void;
706
+ nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<CustomEvent<T>>;
707
+ hasListeners(name:string):boolean;
885
708
  /**
886
- * a <b>CustomColumn</b> object to apply using <b>applyCustomColumns</b> with the expression specified.
709
+ * Removes an event listener added to this table.
887
710
  * @param name -
888
- * @param expression -
889
- * @return {@link dh.CustomColumn}
711
+ * @param callback -
712
+ * @return
713
+ * @typeParam T -
890
714
  */
891
- static createCustomColumn(name:string, expression:string):CustomColumn;
892
- }
893
-
894
- /**
895
- * Exists to keep the dh.TableMap namespace so that the web UI can remain compatible with the DHE API, which still calls
896
- * this type TableMap.
897
- * @deprecated
898
- */
899
- export class TableMap {
900
- static readonly EVENT_KEYADDED:string;
901
- static readonly EVENT_DISCONNECT:string;
902
- static readonly EVENT_RECONNECT:string;
903
- static readonly EVENT_RECONNECTFAILED:string;
904
-
905
- protected constructor();
715
+ removeEventListener<T>(name:string, callback:(e:CustomEvent<T>)=>void):boolean;
906
716
  }
907
-
908
717
  /**
909
- * A js type for operating on input tables.
910
- *
911
- * Represents a User Input Table, which can have data added to it from other sources.
912
- *
913
- * You may add rows using dictionaries of key-value tuples (representing columns by name), add tables containing all the
914
- * key/value columns to add, or delete tables containing the keys to delete. Each operation is atomic, and will either
915
- * succeed completely or fail completely. To guarantee order of operations, apply an operation and wait for the response
916
- * before sending the next operation.
917
- *
918
- * Each table has one or more key columns, where each unique combination of keys will appear at most once in the table.
919
- *
920
- * To view the results of the Input Table, you should use standard table operations on the InputTable's source Table
921
- * object.
718
+ * Represents a server-side object that may not yet have been fetched by the client. When this object will no longer be
719
+ * used, if {@link fetch} is not called on this object, then {@link close} must be to ensure server-side resources
720
+ * are correctly freed.
922
721
  */
923
- export class InputTable {
924
- protected constructor();
925
-
926
- /**
927
- * Adds a single row to the table. For each key or value column name in the Input Table, we retrieve that javascript
928
- * property at that name and validate it can be put into the given column type.
929
- * @param row -
930
- * @param userTimeZone -
931
- * @return Promise of dh.InputTable
932
- */
933
- addRow(row:{ [key: string]: any; }, userTimeZone?:string):Promise<InputTable>;
934
- /**
935
- * Add multiple rows to a table.
936
- * @param rows -
937
- * @param userTimeZone -
938
- * @return Promise of dh.InputTable
939
- */
940
- addRows(rows:{ [key: string]: any; }[], userTimeZone?:string):Promise<InputTable>;
941
- /**
942
- * Add an entire table to this Input Table. Only column names that match the definition of the input table will be
943
- * copied, and all key columns must have values filled in. This only copies the current state of the source table;
944
- * future updates to the source table will not be reflected in the Input Table. The returned promise will be
945
- * resolved to the same InputTable instance this method was called upon once the server returns.
946
- * @param tableToAdd -
947
- * @return Promise of dh.InputTable
948
- */
949
- addTable(tableToAdd:Table):Promise<InputTable>;
950
- /**
951
- * Add multiple tables to this Input Table.
952
- * @param tablesToAdd -
953
- * @return Promise of dh.InputTable
954
- */
955
- addTables(tablesToAdd:Table[]):Promise<InputTable>;
722
+ export interface WidgetExportedObject {
956
723
  /**
957
- * Deletes an entire table from this Input Table. Key columns must match the Input Table.
958
- * @param tableToDelete -
959
- * @return Promise of dh.InputTable
724
+ * Returns the type of this export, typically one of {@link dh.VariableType}, but may also include plugin types. If
725
+ * null, this object cannot be fetched, but can be passed to the server, such as via
726
+ * {@link Widget.sendMessage}.
727
+ * @return the string type of this server-side object, or null.
960
728
  */
961
- deleteTable(tableToDelete:Table):Promise<InputTable>;
729
+ readonly type?:string|null;
730
+
962
731
  /**
963
- * Delete multiple tables from this Input Table.
964
- * @param tablesToDelete -
965
- * @return
732
+ * Exports another copy of this reference, allowing it to be fetched separately. Results in rejection if the ticket
733
+ * was already closed (either by calling {@link WidgetExportedObject.close} or closing the object returned from {@link WidgetExportedObject.fetch}).
734
+ * @return a promise returning a reexported copy of this object, still referencing the same server-side object.
966
735
  */
967
- deleteTables(tablesToDelete:Table[]):Promise<InputTable>;
736
+ reexport():Promise<WidgetExportedObject>;
968
737
  /**
969
- * A list of the key columns, by name
970
- * @return String array.
738
+ * Returns a promise that will fetch the object represented by this reference. Multiple calls to this will return
739
+ * the same instance.
740
+ * @return a promise that will resolve to a client side object that represents the reference on the server.
971
741
  */
972
- get keys():string[];
742
+ fetch():Promise<any>;
973
743
  /**
974
- * A list of the value columns, by name
975
- * @return String array.
744
+ * Releases the server-side resources associated with this object, regardless of whether other client-side objects
745
+ * exist that also use that object. Should not be called after fetch() has been invoked.
976
746
  */
977
- get values():string[];
747
+ close():void;
748
+ }
749
+ export interface RefreshToken {
750
+ get bytes():string;
751
+ get expiry():number;
752
+ }
753
+ /**
754
+ * Wrap LocalTime values for use in JS. Provides text formatting for display and access to the underlying value.
755
+ */
756
+ export interface LocalTimeWrapper {
757
+ valueOf():string;
758
+ getHour():number;
759
+ getMinute():number;
760
+ getSecond():number;
761
+ getNano():number;
762
+ toString():string;
763
+ }
764
+ /**
765
+ * Contains data in the current viewport. Also contains the offset to this data, so that the actual row number may be
766
+ * determined. Do not assume that the first row in `rows` is the first visible row, because extra rows may be provided
767
+ * for easier scrolling without going to the server.
768
+ */
769
+ export interface ViewportData extends TableData {
978
770
  /**
979
- * A list of the key Column objects
980
- * @return {@link dh.Column} array.
771
+ * The index of the first returned row
772
+ * @return double
981
773
  */
982
- get keyColumns():Column[];
774
+ get offset():number;
983
775
  /**
984
- * A list of the value Column objects
776
+ * A list of columns describing the data types in each row
985
777
  * @return {@link dh.Column} array.
986
778
  */
987
- get valueColumns():Column[];
779
+ get columns():Array<Column>;
988
780
  /**
989
- * The source table for this Input Table
990
- * @return dh.table
781
+ * An array of rows of data
782
+ * @return {@link dh.ViewportRow} array.
991
783
  */
992
- get table():Table;
784
+ get rows():Array<ViewportRow>;
993
785
  }
994
786
 
995
787
  /**
996
- * Represents a non-viewport subscription to a table, and all data currently known to be present in the subscribed
997
- * columns. This class handles incoming snapshots and deltas, and fires events to consumers to notify of data changes.
998
- *
999
- * Unlike {@link dh.TableViewportSubscription}, the "original" table does not have a reference to this instance, only the
1000
- * "private" table instance does, since the original cannot modify the subscription, and the private instance must
1001
- * forward data to it.
788
+ * Configuration object for running Table.treeTable to produce a hierarchical view of a given "flat" table.
1002
789
  *
1003
- * Represents a subscription to the table on the server. Changes made to the table will not be reflected here - the
1004
- * subscription must be closed and a new one optioned to see those changes. The event model is slightly different from
1005
- * viewports to make it less expensive to compute for large tables.
790
+ * Like TotalsTableConfig, `TreeTableConfig` supports an operation map indicating how to aggregate the data, as well as
791
+ * an array of column names which will be the layers in the roll-up tree, grouped at each level. An additional optional
792
+ * value can be provided describing the strategy the engine should use when grouping the rows.
1006
793
  */
1007
- export class TableSubscription implements HasEventHandling {
794
+ export class TreeTableConfig {
1008
795
  /**
1009
- * Indicates that some new data is available on the client, either an initial snapshot or a delta update. The
1010
- * <b>detail</b> field of the event will contain a TableSubscriptionEventData detailing what has changed, or
1011
- * allowing access to the entire range of items currently in the subscribed columns.
796
+ * The column representing the unique ID for each item
1012
797
  */
1013
- static readonly EVENT_UPDATED:string;
1014
-
1015
- protected constructor();
1016
-
798
+ idColumn:string;
1017
799
  /**
1018
- * Stops the subscription on the server.
800
+ * The column representing the parent ID for each item
1019
801
  */
1020
- close():void;
1021
- addEventListener<T>(name:string, callback:(e:CustomEvent<T>)=>void):()=>void;
1022
- nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<CustomEvent<T>>;
1023
- hasListeners(name:string):boolean;
1024
- removeEventListener<T>(name:string, callback:(e:CustomEvent<T>)=>void):boolean;
802
+ parentColumn:string;
1025
803
  /**
1026
- * The columns that were subscribed to when this subscription was created
1027
- * @return {@link dh.Column}
804
+ * Optional parameter indicating if items with an invalid parent ID should be promoted to root. Defaults to false.
1028
805
  */
1029
- get columns():Array<Column>;
1030
- }
1031
-
1032
- /**
1033
- * Wrap BigInteger values for use in JS. Provides text formatting for display and access to the underlying value.
1034
- */
1035
- export class BigIntegerWrapper {
1036
- protected constructor();
806
+ promoteOrphansToRoot:boolean;
1037
807
 
1038
- static ofString(str:string):BigIntegerWrapper;
1039
- asNumber():number;
1040
- valueOf():string;
1041
- toString():string;
808
+ constructor();
1042
809
  }
1043
810
 
1044
811
  /**
1045
- * Represents a set of Tables each corresponding to some key. The keys are available locally, but a call must be made to
1046
- * the server to get each Table. All tables will have the same structure.
812
+ * Describes the structure of the column, and if desired can be used to get access to the data to be rendered in this
813
+ * column.
1047
814
  */
1048
- export class PartitionedTable implements HasEventHandling {
815
+ export class Column {
1049
816
  /**
1050
- * Indicates that a new key has been added to the array of keys, which can now be fetched with getTable.
817
+ * If this column is part of a roll-up tree table, represents the type of the row data that can be found in this
818
+ * column for leaf nodes if includeConstituents is enabled. Otherwise, it is <b>null</b>.
819
+ * @return String
1051
820
  */
1052
- static readonly EVENT_KEYADDED:string;
821
+ readonly constituentType?:string|null;
822
+ readonly description?:string|null;
823
+
824
+ protected constructor();
825
+
1053
826
  /**
1054
- * Indicates that a new key has been added to the array of keys, which can now be fetched with getTable.
827
+ * the value for this column in the given row. Type will be consistent with the type of the Column.
828
+ * @param row -
829
+ * @return Any
1055
830
  */
1056
- static readonly EVENT_DISCONNECT:string;
831
+ get(row:Row):any;
832
+ getFormat(row:Row):Format;
1057
833
  /**
1058
- * Indicates that a new key has been added to the array of keys, which can now be fetched with getTable.
834
+ * Creates a sort builder object, to be used when sorting by this column.
835
+ * @return {@link dh.Sort}
1059
836
  */
1060
- static readonly EVENT_RECONNECT:string;
837
+ sort():Sort;
1061
838
  /**
1062
- * Indicates that a new key has been added to the array of keys, which can now be fetched with getTable.
839
+ * Creates a new value for use in filters based on this column. Used either as a parameter to another filter
840
+ * operation, or as a builder to create a filter operation.
841
+ * @return {@link dh.FilterValue}
1063
842
  */
1064
- static readonly EVENT_RECONNECTFAILED:string;
1065
-
1066
- protected constructor();
1067
-
1068
- typedTicket():dhinternal.io.deephaven.proto.ticket_pb.TypedTicket;
843
+ filter():FilterValue;
1069
844
  /**
1070
- * Fetch the table with the given key. If the key does not exist, returns `null`.
1071
- * @param key - The key to fetch. An array of values for each key column, in the same order as the key columns are.
1072
- * @return Promise of dh.Table, or `null` if the key does not exist.
845
+ * a <b>CustomColumn</b> object to apply using `applyCustomColumns` with the expression specified.
846
+ * @param expression -
847
+ * @return {@link dh.CustomColumn}
1073
848
  */
1074
- getTable(key:object):Promise<Table|undefined|null>;
849
+ formatColor(expression:string):CustomColumn;
1075
850
  /**
1076
- * Open a new table that is the result of merging all constituent tables. See
1077
- * {@link io.deephaven.engine.table.PartitionedTable#merge()} for details.
1078
- * @return A merged representation of the constituent tables.
851
+ * a <b>CustomColumn</b> object to apply using <b>applyCustomColumns</b> with the expression specified.
852
+ * @param expression -
853
+ * @return {@link dh.CustomColumn}
1079
854
  */
1080
- getMergedTable():Promise<Table>;
855
+ formatNumber(expression:string):CustomColumn;
1081
856
  /**
1082
- * The set of all currently known keys. This is kept up to date, so getting the list after adding an event listener
1083
- * for <b>keyadded</b> will ensure no keys are missed.
1084
- * @return Set of Object
857
+ * a <b>CustomColumn</b> object to apply using <b>applyCustomColumns</b> with the expression specified.
858
+ * @param expression -
859
+ * @return {@link dh.CustomColumn}
1085
860
  */
1086
- getKeys():Set<object>;
861
+ formatDate(expression:string):CustomColumn;
862
+ toString():string;
1087
863
  /**
1088
- * Fetch a table containing all the valid keys of the partitioned table.
1089
- * @return Promise of a Table
864
+ * Label for this column.
865
+ * @return String
1090
866
  */
1091
- getKeyTable():Promise<Table>;
867
+ get name():string;
1092
868
  /**
1093
- * Indicates that this PartitionedTable will no longer be used, removing subcriptions to updated keys, etc. This
1094
- * will not affect tables in use.
869
+ * True if this column is a partition column. Partition columns are used for filtering uncoalesced tables (see
870
+ * <b>isUncoalesced</b> property on <b>Table</b>)
871
+ * @return boolean
1095
872
  */
1096
- close():void;
873
+ get isPartitionColumn():boolean;
1097
874
  /**
1098
- * The count of known keys.
875
+ *
876
+ * @deprecated do not use. Internal index of the column in the table, to be used as a key on the Row.
1099
877
  * @return int
1100
878
  */
1101
- get size():number;
1102
- /**
1103
- * An array of the columns in the tables that can be retrieved from this partitioned table, including both key and
1104
- * non-key columns.
1105
- * @return Array of Column
1106
- */
1107
- get columns():Column[];
879
+ get index():number;
880
+ get isSortable():boolean;
1108
881
  /**
1109
- * An array of all the key columns that the tables are partitioned by.
1110
- * @return Array of Column
882
+ * Type of the row data that can be found in this column.
883
+ * @return String
1111
884
  */
1112
- get keyColumns():Column[];
885
+ get type():string;
1113
886
  /**
1114
- * Listen for events on this object.
1115
- * @param name - the name of the event to listen for
1116
- * @param callback - a function to call when the event occurs
1117
- * @return Returns a cleanup function.
1118
- * @typeParam T - the type of the data that the event will provide
887
+ * Format entire rows colors using the expression specified. Returns a <b>CustomColumn</b> object to apply to a
888
+ * table using <b>applyCustomColumns</b> with the parameters specified.
889
+ * @param expression -
890
+ * @return {@link dh.CustomColumn}
1119
891
  */
1120
- addEventListener<T>(name:string, callback:(e:CustomEvent<T>)=>void):()=>void;
1121
- nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<CustomEvent<T>>;
1122
- hasListeners(name:string):boolean;
892
+ static formatRowColor(expression:string):CustomColumn;
1123
893
  /**
1124
- * Removes an event listener added to this table.
894
+ * a <b>CustomColumn</b> object to apply using <b>applyCustomColumns</b> with the expression specified.
1125
895
  * @param name -
1126
- * @param callback -
1127
- * @return
1128
- * @typeParam T -
896
+ * @param expression -
897
+ * @return {@link dh.CustomColumn}
1129
898
  */
1130
- removeEventListener<T>(name:string, callback:(e:CustomEvent<T>)=>void):boolean;
899
+ static createCustomColumn(name:string, expression:string):CustomColumn;
1131
900
  }
1132
901
 
1133
902
  /**
1134
- * Presently, this is the entrypoint into the Deephaven JS API. By creating an instance of this with the server URL and
1135
- * some options, JS applications can run code on the server, and interact with available exportable objects.
903
+ * Wrap BigInteger values for use in JS. Provides text formatting for display and access to the underlying value.
1136
904
  */
1137
- export class IdeConnection implements HasEventHandling {
1138
- /**
1139
- * @deprecated
1140
- */
1141
- static readonly HACK_CONNECTION_FAILURE:string;
905
+ export class BigIntegerWrapper {
906
+ protected constructor();
907
+
908
+ static ofString(str:string):BigIntegerWrapper;
909
+ asNumber():number;
910
+ valueOf():string;
911
+ toString():string;
912
+ }
913
+
914
+ export class CoreClient implements HasEventHandling {
915
+ static readonly EVENT_CONNECT:string;
1142
916
  static readonly EVENT_DISCONNECT:string;
1143
917
  static readonly EVENT_RECONNECT:string;
1144
- static readonly EVENT_SHUTDOWN:string;
918
+ static readonly EVENT_RECONNECT_AUTH_FAILED:string;
919
+ static readonly EVENT_REFRESH_TOKEN_UPDATED:string;
920
+ static readonly EVENT_REQUEST_FAILED:string;
921
+ static readonly EVENT_REQUEST_STARTED:string;
922
+ static readonly EVENT_REQUEST_SUCCEEDED:string;
923
+ static readonly LOGIN_TYPE_PASSWORD:string;
924
+ static readonly LOGIN_TYPE_ANONYMOUS:string;
1145
925
 
1146
- /**
1147
- * creates a new instance, from which console sessions can be made. <b>options</b> are optional.
1148
- * @param serverUrl - The url used when connecting to the server. Read-only.
1149
- * @param connectOptions - Optional Object
1150
- * @param fromJava - Optional boolean
1151
- * @deprecated
1152
- */
1153
- constructor(serverUrl:string, connectOptions?:ConnectOptions, fromJava?:boolean);
926
+ constructor(serverUrl:string, connectOptions?:ConnectOptions);
927
+
928
+ running():Promise<CoreClient>;
929
+ getServerUrl():string;
930
+ getAuthConfigValues():Promise<string[][]>;
931
+ login(credentials:LoginCredentials):Promise<void>;
932
+ relogin(token:RefreshToken):Promise<void>;
933
+ onConnected(timeoutInMillis?:number):Promise<void>;
934
+ getServerConfigValues():Promise<string[][]>;
935
+ getStorageService():dh.storage.StorageService;
936
+ getAsIdeConnection():Promise<IdeConnection>;
937
+ disconnect():void;
938
+ addEventListener<T>(name:string, callback:(e:CustomEvent<T>)=>void):()=>void;
939
+ nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<CustomEvent<T>>;
940
+ hasListeners(name:string):boolean;
941
+ removeEventListener<T>(name:string, callback:(e:CustomEvent<T>)=>void):boolean;
942
+ }
943
+
944
+ export class LongWrapper {
945
+ protected constructor();
946
+
947
+ static ofString(str:string):LongWrapper;
948
+ asNumber():number;
949
+ valueOf():string;
950
+ toString():string;
951
+ }
952
+
953
+ /**
954
+ * A Widget represents a server side object that sends one or more responses to the client. The client can then
955
+ * interpret these responses to see what to render, or how to respond.
956
+ * <p>
957
+ * Most custom object types result in a single response being sent to the client, often with other exported objects, but
958
+ * some will have streamed responses, and allow the client to send follow-up requests of its own. This class's API is
959
+ * backwards compatible, but as such does not offer a way to tell the difference between a streaming or non-streaming
960
+ * object type, the client code that handles the payloads is expected to know what to expect. See
961
+ * {@link dh.WidgetMessageDetails} for more information.
962
+ * <p>
963
+ * When the promise that returns this object resolves, it will have the first response assigned to its fields. Later
964
+ * responses from the server will be emitted as "message" events. When the connection with the server ends, the "close"
965
+ * event will be emitted. In this way, the connection will behave roughly in the same way as a WebSocket - either side
966
+ * can close, and after close no more messages will be processed. There can be some latency in closing locally while
967
+ * remote messages are still pending - it is up to implementations of plugins to handle this case.
968
+ * <p>
969
+ * Also like WebSockets, the plugin API doesn't define how to serialize messages, and just handles any binary payloads.
970
+ * What it does handle however, is allowing those messages to include references to server-side objects with those
971
+ * payloads. Those server side objects might be tables or other built-in types in the Deephaven JS API, or could be
972
+ * objects usable through their own plugins. They also might have no plugin at all, allowing the client to hold a
973
+ * reference to them and pass them back to the server, either to the current plugin instance, or through another API.
974
+ * The `Widget` type does not specify how those objects should be used or their lifecycle, but leaves that
975
+ * entirely to the plugin. Messages will arrive in the order they were sent.
976
+ * <p>
977
+ * This can suggest several patterns for how plugins operate:
978
+ * <ul>
979
+ * <li>The plugin merely exists to transport some other object to the client. This can be useful for objects which can
980
+ * easily be translated to some other type (like a Table) when the user clicks on it. An example of this is
981
+ * `pandas.DataFrame` will result in a widget that only contains a static
982
+ * {@link dh.Table}. Presently, the widget is immediately closed, and only the Table is
983
+ * provided to the JS API consumer.</li>
984
+ * <li>The plugin provides references to Tables and other objects, and those objects can live longer than the object
985
+ * which provided them. One concrete example of this could have been
986
+ * {@link dh.PartitionedTable} when fetching constituent tables, but it was implemented
987
+ * before bidirectional plugins were implemented. Another example of this is plugins that serve as a "factory", giving
988
+ * the user access to table manipulation/creation methods not supported by gRPC or the JS API.</li>
989
+ * <li>The plugin provides reference to Tables and other objects that only make sense within the context of the widget
990
+ * instance, so when the widget goes away, those objects should be released as well. This is also an example of
991
+ * {@link dh.PartitionedTable}, as the partitioned table tracks creation of new keys through
992
+ * an internal table instance.</li>
993
+ * </ul>
994
+ *
995
+ * Handling server objects in messages also has more than one potential pattern that can be used:
996
+ * <ul>
997
+ * <li>One object per message - the message clearly is about that object, no other details required.</li>
998
+ * <li>Objects indexed within their message - as each message comes with a list of objects, those objects can be
999
+ * referenced within the payload by index. This is roughly how {@link dh.plot.Figure}
1000
+ * behaves, where the figure descriptor schema includes an index for each created series, describing which table should
1001
+ * be used, which columns should be mapped to each axis.</li>
1002
+ * <li>Objects indexed since widget creation - each message would append its objects to a list created when the widget
1003
+ * was first made, and any new exports that arrive in a new message would be appended to that list. Then, subsequent
1004
+ * messages can reference objects already sent. This imposes a limitation where the client cannot release any exports
1005
+ * without the server somehow signaling that it will never reference that export again.</li>
1006
+ * </ul>
1007
+ */
1008
+ export class Widget implements WidgetMessageDetails, HasEventHandling {
1009
+ static readonly EVENT_MESSAGE:string;
1010
+ static readonly EVENT_CLOSE:string;
1011
+
1012
+ protected constructor();
1154
1013
 
1155
1014
  /**
1156
- * closes the current connection, releasing any resources on the server or client.
1157
- */
1158
- close():void;
1159
- running():Promise<IdeConnection>;
1160
- getObject(definitionObject:dh.ide.VariableDescriptor):Promise<any>;
1161
- subscribeToFieldUpdates(callback:(arg0:dh.ide.VariableChanges)=>void):()=>void;
1162
- /**
1163
- * Register a callback function to handle any log messages that are emitted on the server. Returns a function ,
1164
- * which can be invoked to remove this log handler. Any log handler registered in this way will receive as many old
1165
- * log messages as are presently available.
1166
- * @param callback -
1167
- * @return {@link io.deephaven.web.shared.fu.JsRunnable}
1015
+ * Ends the client connection to the server.
1168
1016
  */
1169
- onLogMessage(callback:(arg0:dh.ide.LogItem)=>void):()=>void;
1170
- startSession(type:string):Promise<IdeSession>;
1171
- getConsoleTypes():Promise<Array<string>>;
1172
- getWorkerHeapInfo():Promise<WorkerHeapInfo>;
1017
+ close():void;
1018
+ getDataAsBase64():string;
1019
+ getDataAsU8():Uint8Array;
1020
+ getDataAsString():string;
1173
1021
  /**
1174
- * Listen for events on this object.
1175
- * @param name - the name of the event to listen for
1176
- * @param callback - a function to call when the event occurs
1177
- * @return Returns a cleanup function.
1178
- * @typeParam T - the type of the data that the event will provide
1022
+ * Sends a string/bytes payload to the server, along with references to objects that exist on the server.
1023
+ * @param msg - string/buffer/view instance that represents data to send
1024
+ * @param references - an array of objects that can be safely sent to the server
1179
1025
  */
1026
+ sendMessage(msg:string|ArrayBuffer|ArrayBufferView, references?:Array<Table|Widget|WidgetExportedObject|PartitionedTable|TotalsTable|TreeTable>):void;
1180
1027
  addEventListener<T>(name:string, callback:(e:CustomEvent<T>)=>void):()=>void;
1181
1028
  nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<CustomEvent<T>>;
1182
1029
  hasListeners(name:string):boolean;
1030
+ removeEventListener<T>(name:string, callback:(e:CustomEvent<T>)=>void):boolean;
1183
1031
  /**
1184
- * Removes an event listener added to this table.
1185
- * @param name -
1186
- * @param callback -
1187
- * @return
1188
- * @typeParam T -
1032
+ *
1033
+ * @return the exported objects sent in the initial message from the server. The client is responsible for closing
1034
+ * them when finished using them.
1189
1035
  */
1190
- removeEventListener<T>(name:string, callback:(e:CustomEvent<T>)=>void):boolean;
1036
+ get exportedObjects():WidgetExportedObject[];
1037
+ /**
1038
+ *
1039
+ * @return the type of this widget
1040
+ */
1041
+ get type():string;
1191
1042
  }
1192
1043
 
1193
- /**
1194
- * Deprecated for use in Deephaven Core.
1195
- * @deprecated
1196
- */
1197
- export class Client {
1198
- static readonly EVENT_REQUEST_FAILED:string;
1199
- static readonly EVENT_REQUEST_STARTED:string;
1200
- static readonly EVENT_REQUEST_SUCCEEDED:string;
1201
-
1202
- constructor();
1203
- }
1204
1044
 
1205
- export class CoreClient implements HasEventHandling {
1206
- static readonly EVENT_CONNECT:string;
1045
+ export class QueryInfo {
1046
+ static readonly EVENT_TABLE_OPENED:string;
1207
1047
  static readonly EVENT_DISCONNECT:string;
1208
1048
  static readonly EVENT_RECONNECT:string;
1209
- static readonly EVENT_RECONNECT_AUTH_FAILED:string;
1210
- static readonly EVENT_REFRESH_TOKEN_UPDATED:string;
1211
- static readonly EVENT_REQUEST_FAILED:string;
1212
- static readonly EVENT_REQUEST_STARTED:string;
1213
- static readonly EVENT_REQUEST_SUCCEEDED:string;
1214
- static readonly LOGIN_TYPE_PASSWORD:string;
1215
- static readonly LOGIN_TYPE_ANONYMOUS:string;
1216
-
1217
- constructor(serverUrl:string, connectOptions?:ConnectOptions);
1049
+ static readonly EVENT_CONNECT:string;
1218
1050
 
1219
- running():Promise<CoreClient>;
1220
- getServerUrl():string;
1221
- getAuthConfigValues():Promise<string[][]>;
1222
- login(credentials:LoginCredentials):Promise<void>;
1223
- relogin(token:RefreshToken):Promise<void>;
1224
- onConnected(timeoutInMillis?:number):Promise<void>;
1225
- getServerConfigValues():Promise<string[][]>;
1226
- getStorageService():dh.storage.StorageService;
1227
- getAsIdeConnection():Promise<IdeConnection>;
1228
- disconnect():void;
1229
- addEventListener<T>(name:string, callback:(e:CustomEvent<T>)=>void):()=>void;
1230
- nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<CustomEvent<T>>;
1231
- hasListeners(name:string):boolean;
1232
- removeEventListener<T>(name:string, callback:(e:CustomEvent<T>)=>void):boolean;
1051
+ protected constructor();
1233
1052
  }
1234
1053
 
1235
1054
  /**
@@ -1305,6 +1124,73 @@ export namespace dh {
1305
1124
  static search(value:FilterValue, columns?:FilterValue[]):FilterCondition;
1306
1125
  }
1307
1126
 
1127
+ /**
1128
+ * Presently optional and not used by the server, this allows the client to specify some authentication details. String
1129
+ * authToken <i>- base 64 encoded auth token. String serviceId -</i> The service ID to use for the connection.
1130
+ */
1131
+ export class ConnectOptions {
1132
+ headers:{ [key: string]: string; };
1133
+
1134
+ constructor();
1135
+ }
1136
+
1137
+ /**
1138
+ * Deprecated for use in Deephaven Core.
1139
+ * @deprecated
1140
+ */
1141
+ export class Client {
1142
+ static readonly EVENT_REQUEST_FAILED:string;
1143
+ static readonly EVENT_REQUEST_STARTED:string;
1144
+ static readonly EVENT_REQUEST_SUCCEEDED:string;
1145
+
1146
+ constructor();
1147
+ }
1148
+
1149
+ /**
1150
+ * Describes a Sort present on the table. No visible constructor, created through the use of Column.sort(), will be tied
1151
+ * to that particular column data. Sort instances are immutable, and use a builder pattern to make modifications. All
1152
+ * methods return a new Sort instance.
1153
+ */
1154
+ export class Sort {
1155
+ static readonly ASCENDING:string;
1156
+ static readonly DESCENDING:string;
1157
+ static readonly REVERSE:string;
1158
+
1159
+ protected constructor();
1160
+
1161
+ /**
1162
+ * Builds a Sort instance to sort values in ascending order.
1163
+ * @return {@link dh.Sort}
1164
+ */
1165
+ asc():Sort;
1166
+ /**
1167
+ * Builds a Sort instance to sort values in descending order.
1168
+ * @return {@link dh.Sort}
1169
+ */
1170
+ desc():Sort;
1171
+ /**
1172
+ * Builds a Sort instance which takes the absolute value before applying order.
1173
+ * @return {@link dh.Sort}
1174
+ */
1175
+ abs():Sort;
1176
+ toString():string;
1177
+ /**
1178
+ * True if the absolute value of the column should be used when sorting; defaults to false.
1179
+ * @return boolean
1180
+ */
1181
+ get isAbs():boolean;
1182
+ /**
1183
+ * The column which is sorted.
1184
+ * @return {@link dh.Column}
1185
+ */
1186
+ get column():Column;
1187
+ /**
1188
+ * The direction of this sort, either <b>ASC</b>, <b>DESC</b>, or <b>REVERSE</b>.
1189
+ * @return String
1190
+ */
1191
+ get direction():string;
1192
+ }
1193
+
1308
1194
  /**
1309
1195
  * Provides access to data in a table. Note that several methods present their response through Promises. This allows
1310
1196
  * the client to both avoid actually connecting to the server until necessary, and also will permit some changes not to
@@ -1611,142 +1497,93 @@ export namespace dh {
1611
1497
  static reverse():Sort;
1612
1498
  }
1613
1499
 
1614
-
1615
- export class CustomColumn {
1616
- static readonly TYPE_FORMAT_COLOR:string;
1617
- static readonly TYPE_FORMAT_NUMBER:string;
1618
- static readonly TYPE_FORMAT_DATE:string;
1619
- static readonly TYPE_NEW:string;
1620
-
1621
- protected constructor();
1622
-
1623
- valueOf():string;
1624
- toString():string;
1500
+ /**
1501
+ * Represents a set of Tables each corresponding to some key. The keys are available locally, but a call must be made to
1502
+ * the server to get each Table. All tables will have the same structure.
1503
+ */
1504
+ export class PartitionedTable implements HasEventHandling {
1625
1505
  /**
1626
- * The expression to evaluate this custom column.
1627
- * @return String
1506
+ * Indicates that a new key has been added to the array of keys, which can now be fetched with getTable.
1628
1507
  */
1629
- get expression():string;
1508
+ static readonly EVENT_KEYADDED:string;
1630
1509
  /**
1631
- * The name of the column to use.
1632
- * @return String
1510
+ * Indicates that a new key has been added to the array of keys, which can now be fetched with getTable.
1633
1511
  */
1634
- get name():string;
1512
+ static readonly EVENT_DISCONNECT:string;
1635
1513
  /**
1636
- * Type of custom column. One of
1637
- *
1638
- * <ul>
1639
- * <li>FORMAT_COLOR</li>
1640
- * <li>FORMAT_NUMBER</li>
1641
- * <li>FORMAT_DATE</li>
1642
- * <li>NEW</li>
1643
- * </ul>
1644
- * @return String
1514
+ * Indicates that a new key has been added to the array of keys, which can now be fetched with getTable.
1645
1515
  */
1646
- get type():string;
1647
- }
1648
-
1649
- /**
1650
- * A Widget represents a server side object that sends one or more responses to the client. The client can then
1651
- * interpret these responses to see what to render, or how to respond.
1652
- * <p>
1653
- * Most custom object types result in a single response being sent to the client, often with other exported objects, but
1654
- * some will have streamed responses, and allow the client to send follow-up requests of its own. This class's API is
1655
- * backwards compatible, but as such does not offer a way to tell the difference between a streaming or non-streaming
1656
- * object type, the client code that handles the payloads is expected to know what to expect. See
1657
- * {@link dh.WidgetMessageDetails} for more information.
1658
- * <p>
1659
- * When the promise that returns this object resolves, it will have the first response assigned to its fields. Later
1660
- * responses from the server will be emitted as "message" events. When the connection with the server ends, the "close"
1661
- * event will be emitted. In this way, the connection will behave roughly in the same way as a WebSocket - either side
1662
- * can close, and after close no more messages will be processed. There can be some latency in closing locally while
1663
- * remote messages are still pending - it is up to implementations of plugins to handle this case.
1664
- * <p>
1665
- * Also like WebSockets, the plugin API doesn't define how to serialize messages, and just handles any binary payloads.
1666
- * What it does handle however, is allowing those messages to include references to server-side objects with those
1667
- * payloads. Those server side objects might be tables or other built-in types in the Deephaven JS API, or could be
1668
- * objects usable through their own plugins. They also might have no plugin at all, allowing the client to hold a
1669
- * reference to them and pass them back to the server, either to the current plugin instance, or through another API.
1670
- * The `Widget` type does not specify how those objects should be used or their lifecycle, but leaves that
1671
- * entirely to the plugin. Messages will arrive in the order they were sent.
1672
- * <p>
1673
- * This can suggest several patterns for how plugins operate:
1674
- * <ul>
1675
- * <li>The plugin merely exists to transport some other object to the client. This can be useful for objects which can
1676
- * easily be translated to some other type (like a Table) when the user clicks on it. An example of this is
1677
- * `pandas.DataFrame` will result in a widget that only contains a static
1678
- * {@link dh.Table}. Presently, the widget is immediately closed, and only the Table is
1679
- * provided to the JS API consumer.</li>
1680
- * <li>The plugin provides references to Tables and other objects, and those objects can live longer than the object
1681
- * which provided them. One concrete example of this could have been
1682
- * {@link dh.PartitionedTable} when fetching constituent tables, but it was implemented
1683
- * before bidirectional plugins were implemented. Another example of this is plugins that serve as a "factory", giving
1684
- * the user access to table manipulation/creation methods not supported by gRPC or the JS API.</li>
1685
- * <li>The plugin provides reference to Tables and other objects that only make sense within the context of the widget
1686
- * instance, so when the widget goes away, those objects should be released as well. This is also an example of
1687
- * {@link dh.PartitionedTable}, as the partitioned table tracks creation of new keys through
1688
- * an internal table instance.</li>
1689
- * </ul>
1690
- *
1691
- * Handling server objects in messages also has more than one potential pattern that can be used:
1692
- * <ul>
1693
- * <li>One object per message - the message clearly is about that object, no other details required.</li>
1694
- * <li>Objects indexed within their message - as each message comes with a list of objects, those objects can be
1695
- * referenced within the payload by index. This is roughly how {@link dh.plot.Figure}
1696
- * behaves, where the figure descriptor schema includes an index for each created series, describing which table should
1697
- * be used, which columns should be mapped to each axis.</li>
1698
- * <li>Objects indexed since widget creation - each message would append its objects to a list created when the widget
1699
- * was first made, and any new exports that arrive in a new message would be appended to that list. Then, subsequent
1700
- * messages can reference objects already sent. This imposes a limitation where the client cannot release any exports
1701
- * without the server somehow signaling that it will never reference that export again.</li>
1702
- * </ul>
1703
- */
1704
- export class Widget implements WidgetMessageDetails, HasEventHandling {
1705
- static readonly EVENT_MESSAGE:string;
1706
- static readonly EVENT_CLOSE:string;
1516
+ static readonly EVENT_RECONNECT:string;
1517
+ /**
1518
+ * Indicates that a new key has been added to the array of keys, which can now be fetched with getTable.
1519
+ */
1520
+ static readonly EVENT_RECONNECTFAILED:string;
1707
1521
 
1708
1522
  protected constructor();
1709
1523
 
1524
+ typedTicket():dhinternal.io.deephaven.proto.ticket_pb.TypedTicket;
1525
+ /**
1526
+ * Fetch the table with the given key. If the key does not exist, returns `null`.
1527
+ * @param key - The key to fetch. An array of values for each key column, in the same order as the key columns are.
1528
+ * @return Promise of dh.Table, or `null` if the key does not exist.
1529
+ */
1530
+ getTable(key:object):Promise<Table|undefined|null>;
1710
1531
  /**
1711
- * Ends the client connection to the server.
1532
+ * Open a new table that is the result of merging all constituent tables. See
1533
+ * {@link io.deephaven.engine.table.PartitionedTable#merge()} for details.
1534
+ * @return A merged representation of the constituent tables.
1535
+ */
1536
+ getMergedTable():Promise<Table>;
1537
+ /**
1538
+ * The set of all currently known keys. This is kept up to date, so getting the list after adding an event listener
1539
+ * for <b>keyadded</b> will ensure no keys are missed.
1540
+ * @return Set of Object
1541
+ */
1542
+ getKeys():Set<object>;
1543
+ /**
1544
+ * Fetch a table containing all the valid keys of the partitioned table.
1545
+ * @return Promise of a Table
1546
+ */
1547
+ getKeyTable():Promise<Table>;
1548
+ /**
1549
+ * Indicates that this PartitionedTable will no longer be used, removing subcriptions to updated keys, etc. This
1550
+ * will not affect tables in use.
1712
1551
  */
1713
1552
  close():void;
1714
- getDataAsBase64():string;
1715
- getDataAsU8():Uint8Array;
1716
- getDataAsString():string;
1717
1553
  /**
1718
- * Sends a string/bytes payload to the server, along with references to objects that exist on the server.
1719
- * @param msg - string/buffer/view instance that represents data to send
1720
- * @param references - an array of objects that can be safely sent to the server
1554
+ * The count of known keys.
1555
+ * @return int
1556
+ */
1557
+ get size():number;
1558
+ /**
1559
+ * An array of the columns in the tables that can be retrieved from this partitioned table, including both key and
1560
+ * non-key columns.
1561
+ * @return Array of Column
1562
+ */
1563
+ get columns():Column[];
1564
+ /**
1565
+ * An array of all the key columns that the tables are partitioned by.
1566
+ * @return Array of Column
1567
+ */
1568
+ get keyColumns():Column[];
1569
+ /**
1570
+ * Listen for events on this object.
1571
+ * @param name - the name of the event to listen for
1572
+ * @param callback - a function to call when the event occurs
1573
+ * @return Returns a cleanup function.
1574
+ * @typeParam T - the type of the data that the event will provide
1721
1575
  */
1722
- sendMessage(msg:string|ArrayBuffer|ArrayBufferView, references?:Array<Table|Widget|WidgetExportedObject|PartitionedTable|TotalsTable|TreeTable>):void;
1723
1576
  addEventListener<T>(name:string, callback:(e:CustomEvent<T>)=>void):()=>void;
1724
1577
  nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<CustomEvent<T>>;
1725
1578
  hasListeners(name:string):boolean;
1726
- removeEventListener<T>(name:string, callback:(e:CustomEvent<T>)=>void):boolean;
1727
- /**
1728
- *
1729
- * @return the exported objects sent in the initial message from the server. The client is responsible for closing
1730
- * them when finished using them.
1731
- */
1732
- get exportedObjects():WidgetExportedObject[];
1733
1579
  /**
1734
- *
1735
- * @return the type of this widget
1580
+ * Removes an event listener added to this table.
1581
+ * @param name -
1582
+ * @param callback -
1583
+ * @return
1584
+ * @typeParam T -
1736
1585
  */
1737
- get type():string;
1738
- }
1739
-
1740
- /**
1741
- * Wrap BigDecimal values for use in JS. Provides text formatting for display and access to the underlying value.
1742
- */
1743
- export class BigDecimalWrapper {
1744
- protected constructor();
1745
-
1746
- static ofString(value:string):BigDecimalWrapper;
1747
- asNumber():number;
1748
- valueOf():string;
1749
- toString():string;
1586
+ removeEventListener<T>(name:string, callback:(e:CustomEvent<T>)=>void):boolean;
1750
1587
  }
1751
1588
 
1752
1589
  /**
@@ -1833,134 +1670,178 @@ export namespace dh {
1833
1670
  toString():string;
1834
1671
  }
1835
1672
 
1836
- /**
1837
- * Describes a grouping and aggregations for a roll-up table. Pass to the <b>Table.rollup</b> function to create a
1838
- * roll-up table.
1839
- */
1840
- export class RollupConfig {
1841
- /**
1842
- * Ordered list of columns to group by to form the hierarchy of the resulting roll-up table.
1843
- */
1844
- groupingColumns:Array<String>;
1845
- /**
1846
- * Mapping from each aggregation name to the ordered list of columns it should be applied to in the resulting
1847
- * roll-up table.
1848
- */
1849
- aggregations:{ [key: string]: Array<AggregationOperationType>; };
1673
+ export class Ide {
1674
+ constructor();
1675
+
1850
1676
  /**
1851
- * Optional parameter indicating if an extra leaf node should be added at the bottom of the hierarchy, showing the
1852
- * rows in the underlying table which make up that grouping. Since these values might be a different type from the
1853
- * rest of the column, any client code must check if TreeRow.hasChildren = false, and if so, interpret those values
1854
- * as if they were Column.constituentType instead of Column.type. Defaults to false.
1677
+ * @deprecated
1855
1678
  */
1856
- includeConstituents:boolean;
1857
- includeOriginalColumns?:boolean|null;
1679
+ getExistingSession(websocketUrl:string, authToken:string, serviceId:string, language:string):Promise<IdeSession>;
1858
1680
  /**
1859
- * Optional parameter indicating if original column descriptions should be included. Defaults to true.
1681
+ * @deprecated
1860
1682
  */
1861
- includeDescriptions:boolean;
1862
-
1863
- constructor();
1683
+ static getExistingSession(websocketUrl:string, authToken:string, serviceId:string, language:string):Promise<IdeSession>;
1864
1684
  }
1865
1685
 
1866
- /**
1867
- * Presently optional and not used by the server, this allows the client to specify some authentication details. String
1868
- * authToken <i>- base 64 encoded auth token. String serviceId -</i> The service ID to use for the connection.
1869
- */
1870
- export class ConnectOptions {
1871
- headers:{ [key: string]: string; };
1686
+ export class LoginCredentials {
1687
+ type?:string|null;
1688
+ username?:string|null;
1689
+ token?:string|null;
1872
1690
 
1873
1691
  constructor();
1874
1692
  }
1875
1693
 
1876
- export class LongWrapper {
1877
- protected constructor();
1878
-
1879
- static ofString(str:string):LongWrapper;
1880
- asNumber():number;
1881
- valueOf():string;
1882
- toString():string;
1883
- }
1884
-
1885
1694
  /**
1886
- * Event fired when a command is issued from the client.
1695
+ * Exists to keep the dh.TableMap namespace so that the web UI can remain compatible with the DHE API, which still calls
1696
+ * this type TableMap.
1697
+ * @deprecated
1887
1698
  */
1888
- export class CommandInfo {
1889
- constructor(code:string, result:Promise<dh.ide.CommandResult>);
1699
+ export class TableMap {
1700
+ static readonly EVENT_KEYADDED:string;
1701
+ static readonly EVENT_DISCONNECT:string;
1702
+ static readonly EVENT_RECONNECT:string;
1703
+ static readonly EVENT_RECONNECTFAILED:string;
1890
1704
 
1891
- get result():Promise<dh.ide.CommandResult>;
1892
- get code():string;
1705
+ protected constructor();
1893
1706
  }
1894
1707
 
1895
- export class LoginCredentials {
1896
- type?:string|null;
1897
- username?:string|null;
1898
- token?:string|null;
1708
+ export class IdeSession implements HasEventHandling {
1709
+ static readonly EVENT_COMMANDSTARTED:string;
1710
+ static readonly EVENT_REQUEST_FAILED:string;
1899
1711
 
1900
- constructor();
1901
- }
1712
+ protected constructor();
1902
1713
 
1903
- /**
1904
- * Configuration object for running Table.treeTable to produce a hierarchical view of a given "flat" table.
1905
- *
1906
- * Like TotalsTableConfig, `TreeTableConfig` supports an operation map indicating how to aggregate the data, as well as
1907
- * an array of column names which will be the layers in the roll-up tree, grouped at each level. An additional optional
1908
- * value can be provided describing the strategy the engine should use when grouping the rows.
1909
- */
1910
- export class TreeTableConfig {
1911
1714
  /**
1912
- * The column representing the unique ID for each item
1715
+ * Load the named table, with columns and size information already fully populated.
1716
+ * @param name -
1717
+ * @param applyPreviewColumns - optional boolean
1718
+ * @return {@link Promise} of {@link dh.Table}
1913
1719
  */
1914
- idColumn:string;
1720
+ getTable(name:string, applyPreviewColumns?:boolean):Promise<Table>;
1915
1721
  /**
1916
- * The column representing the parent ID for each item
1722
+ * Load the named Figure, including its tables and tablemaps as needed.
1723
+ * @param name -
1724
+ * @return promise of dh.plot.Figure
1917
1725
  */
1918
- parentColumn:string;
1726
+ getFigure(name:string):Promise<dh.plot.Figure>;
1919
1727
  /**
1920
- * Optional parameter indicating if items with an invalid parent ID should be promoted to root. Defaults to false.
1728
+ * Loads the named tree table or roll-up table, with column data populated. All nodes are collapsed by default, and
1729
+ * size is presently not available until the viewport is first set.
1730
+ * @param name -
1731
+ * @return {@link Promise} of {@link dh.TreeTable}
1921
1732
  */
1922
- promoteOrphansToRoot:boolean;
1733
+ getTreeTable(name:string):Promise<TreeTable>;
1734
+ getHierarchicalTable(name:string):Promise<TreeTable>;
1735
+ getPartitionedTable(name:string):Promise<PartitionedTable>;
1736
+ getObject(definitionObject:dh.ide.VariableDescriptor):Promise<any>;
1737
+ newTable(columnNames:string[], types:string[], data:string[][], userTimeZone:string):Promise<Table>;
1738
+ /**
1739
+ * Merges the given tables into a single table. Assumes all tables have the same structure.
1740
+ * @param tables -
1741
+ * @return {@link Promise} of {@link dh.Table}
1742
+ */
1743
+ mergeTables(tables:Table[]):Promise<Table>;
1744
+ bindTableToVariable(table:Table, name:string):Promise<void>;
1745
+ subscribeToFieldUpdates(callback:(arg0:dh.ide.VariableChanges)=>void):()=>void;
1746
+ close():void;
1747
+ runCode(code:string):Promise<dh.ide.CommandResult>;
1748
+ onLogMessage(callback:(arg0:dh.ide.LogItem)=>void):()=>void;
1749
+ openDocument(params:object):void;
1750
+ changeDocument(params:object):void;
1751
+ getCompletionItems(params:object):Promise<Array<dh.lsp.CompletionItem>>;
1752
+ getSignatureHelp(params:object):Promise<Array<dh.lsp.SignatureInformation>>;
1753
+ getHover(params:object):Promise<dh.lsp.Hover>;
1754
+ closeDocument(params:object):void;
1755
+ /**
1756
+ * Creates an empty table with the specified number of rows. Optionally columns and types may be specified, but all
1757
+ * values will be null.
1758
+ * @param size -
1759
+ * @return {@link Promise} of {@link dh.Table}
1760
+ */
1761
+ emptyTable(size:number):Promise<Table>;
1762
+ /**
1763
+ * Creates a new table that ticks automatically every "periodNanos" nanoseconds. A start time may be provided; if so
1764
+ * the table will be populated with the interval from the specified date until now.
1765
+ * @param periodNanos -
1766
+ * @param startTime -
1767
+ * @return {@link Promise} of {@link dh.Table}
1768
+ */
1769
+ timeTable(periodNanos:number, startTime?:DateWrapper):Promise<Table>;
1770
+ addEventListener<T>(name:string, callback:(e:CustomEvent<T>)=>void):()=>void;
1771
+ nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<CustomEvent<T>>;
1772
+ hasListeners(name:string):boolean;
1773
+ removeEventListener<T>(name:string, callback:(e:CustomEvent<T>)=>void):boolean;
1774
+ }
1923
1775
 
1924
- constructor();
1776
+ export class DateWrapper extends LongWrapper {
1777
+ protected constructor();
1778
+
1779
+ static ofJsDate(date:Date):DateWrapper;
1780
+ asDate():Date;
1925
1781
  }
1926
1782
 
1927
- export class Ide {
1928
- constructor();
1783
+ export class CustomColumn {
1784
+ static readonly TYPE_FORMAT_COLOR:string;
1785
+ static readonly TYPE_FORMAT_NUMBER:string;
1786
+ static readonly TYPE_FORMAT_DATE:string;
1787
+ static readonly TYPE_NEW:string;
1788
+
1789
+ protected constructor();
1929
1790
 
1791
+ valueOf():string;
1792
+ toString():string;
1930
1793
  /**
1931
- * @deprecated
1794
+ * The expression to evaluate this custom column.
1795
+ * @return String
1932
1796
  */
1933
- getExistingSession(websocketUrl:string, authToken:string, serviceId:string, language:string):Promise<IdeSession>;
1797
+ get expression():string;
1934
1798
  /**
1935
- * @deprecated
1799
+ * The name of the column to use.
1800
+ * @return String
1801
+ */
1802
+ get name():string;
1803
+ /**
1804
+ * Type of custom column. One of
1805
+ *
1806
+ * <ul>
1807
+ * <li>FORMAT_COLOR</li>
1808
+ * <li>FORMAT_NUMBER</li>
1809
+ * <li>FORMAT_DATE</li>
1810
+ * <li>NEW</li>
1811
+ * </ul>
1812
+ * @return String
1936
1813
  */
1937
- static getExistingSession(websocketUrl:string, authToken:string, serviceId:string, language:string):Promise<IdeSession>;
1814
+ get type():string;
1938
1815
  }
1939
1816
 
1940
1817
  /**
1941
- * This class allows iteration over non-contiguous indexes. In the future, this will support the EcmaScript 2015
1942
- * Iteration protocol, but for now has one method which returns an iterator, and also supports querying the size.
1943
- * Additionally, we may add support for creating RangeSet objects to better serve some use cases.
1818
+ * Describes a grouping and aggregations for a roll-up table. Pass to the <b>Table.rollup</b> function to create a
1819
+ * roll-up table.
1944
1820
  */
1945
- export class RangeSet {
1946
- protected constructor();
1947
-
1948
- static ofRange(first:number, last:number):RangeSet;
1949
- static ofItems(rows:number[]):RangeSet;
1950
- static ofRanges(ranges:RangeSet[]):RangeSet;
1951
- static ofSortedRanges(ranges:RangeSet[]):RangeSet;
1821
+ export class RollupConfig {
1952
1822
  /**
1953
- * a new iterator over all indexes in this collection.
1954
- * @return Iterator of {@link dh.LongWrapper}
1823
+ * Ordered list of columns to group by to form the hierarchy of the resulting roll-up table.
1955
1824
  */
1956
- iterator():Iterator<LongWrapper>;
1825
+ groupingColumns:Array<String>;
1957
1826
  /**
1958
- * The total count of items contained in this collection. In some cases this can be expensive to compute, and
1959
- * generally should not be needed except for debugging purposes, or preallocating space (i.e., do not call this
1960
- * property each time through a loop).
1961
- * @return double
1827
+ * Mapping from each aggregation name to the ordered list of columns it should be applied to in the resulting
1828
+ * roll-up table.
1962
1829
  */
1963
- get size():number;
1830
+ aggregations:{ [key: string]: Array<string>; };
1831
+ /**
1832
+ * Optional parameter indicating if an extra leaf node should be added at the bottom of the hierarchy, showing the
1833
+ * rows in the underlying table which make up that grouping. Since these values might be a different type from the
1834
+ * rest of the column, any client code must check if TreeRow.hasChildren = false, and if so, interpret those values
1835
+ * as if they were Column.constituentType instead of Column.type. Defaults to false.
1836
+ */
1837
+ includeConstituents:boolean;
1838
+ includeOriginalColumns?:boolean|null;
1839
+ /**
1840
+ * Optional parameter indicating if original column descriptions should be included. Defaults to true.
1841
+ */
1842
+ includeDescriptions:boolean;
1843
+
1844
+ constructor();
1964
1845
  }
1965
1846
 
1966
1847
  /**
@@ -2095,44 +1976,276 @@ export namespace dh {
2095
1976
  * a filter condition checking if the current value is a false boolean
2096
1977
  * @return {@link dh.FilterCondition}
2097
1978
  */
2098
- isFalse():FilterCondition;
1979
+ isFalse():FilterCondition;
1980
+ /**
1981
+ * a filter condition checking if the current value is a null value
1982
+ * @return {@link dh.FilterCondition}
1983
+ */
1984
+ isNull():FilterCondition;
1985
+ /**
1986
+ * a filter condition invoking the given method on the current value, with the given parameters. Currently supported
1987
+ * functions that can be invoked on a String:
1988
+ * <ul>
1989
+ * <li><b>startsWith</b>: Returns true if the current string value starts with the supplied string argument</li>
1990
+ * <li><b>endsWith</b>: Returns true if the current string value ends with the supplied string argument</li>
1991
+ * <li><b>matches</b>: Returns true if the current string value matches the supplied string argument used as a Java
1992
+ * regular expression</li>
1993
+ * <li><b>contains</b>: Returns true if the current string value contains the supplied string argument
1994
+ * <p>
1995
+ * When invoking against a constant, this should be avoided in favor of FilterValue.contains
1996
+ * </p>
1997
+ * </li>
1998
+ * </ul>
1999
+ * @param method -
2000
+ * @param args -
2001
+ * @return
2002
+ */
2003
+ invoke(method:string, ...args:FilterValue[]):FilterCondition;
2004
+ toString():string;
2005
+ /**
2006
+ * Constructs a string for the filter API from the given parameter.
2007
+ * @param input -
2008
+ * @return
2009
+ */
2010
+ static ofString(input:any):FilterValue;
2011
+ /**
2012
+ * Constructs a boolean for the filter API from the given parameter.
2013
+ * @param b -
2014
+ * @return
2015
+ */
2016
+ static ofBoolean(b:boolean):FilterValue;
2017
+ }
2018
+
2019
+ /**
2020
+ * Presently, this is the entrypoint into the Deephaven JS API. By creating an instance of this with the server URL and
2021
+ * some options, JS applications can run code on the server, and interact with available exportable objects.
2022
+ */
2023
+ export class IdeConnection implements HasEventHandling {
2024
+ /**
2025
+ * @deprecated
2026
+ */
2027
+ static readonly HACK_CONNECTION_FAILURE:string;
2028
+ static readonly EVENT_DISCONNECT:string;
2029
+ static readonly EVENT_RECONNECT:string;
2030
+ static readonly EVENT_SHUTDOWN:string;
2031
+
2032
+ /**
2033
+ * creates a new instance, from which console sessions can be made. <b>options</b> are optional.
2034
+ * @param serverUrl - The url used when connecting to the server. Read-only.
2035
+ * @param connectOptions - Optional Object
2036
+ * @param fromJava - Optional boolean
2037
+ * @deprecated
2038
+ */
2039
+ constructor(serverUrl:string, connectOptions?:ConnectOptions, fromJava?:boolean);
2040
+
2041
+ /**
2042
+ * closes the current connection, releasing any resources on the server or client.
2043
+ */
2044
+ close():void;
2045
+ running():Promise<IdeConnection>;
2046
+ getObject(definitionObject:dh.ide.VariableDescriptor):Promise<any>;
2047
+ subscribeToFieldUpdates(callback:(arg0:dh.ide.VariableChanges)=>void):()=>void;
2048
+ /**
2049
+ * Register a callback function to handle any log messages that are emitted on the server. Returns a function ,
2050
+ * which can be invoked to remove this log handler. Any log handler registered in this way will receive as many old
2051
+ * log messages as are presently available.
2052
+ * @param callback -
2053
+ * @return {@link io.deephaven.web.shared.fu.JsRunnable}
2054
+ */
2055
+ onLogMessage(callback:(arg0:dh.ide.LogItem)=>void):()=>void;
2056
+ startSession(type:string):Promise<IdeSession>;
2057
+ getConsoleTypes():Promise<Array<string>>;
2058
+ getWorkerHeapInfo():Promise<WorkerHeapInfo>;
2059
+ /**
2060
+ * Listen for events on this object.
2061
+ * @param name - the name of the event to listen for
2062
+ * @param callback - a function to call when the event occurs
2063
+ * @return Returns a cleanup function.
2064
+ * @typeParam T - the type of the data that the event will provide
2065
+ */
2066
+ addEventListener<T>(name:string, callback:(e:CustomEvent<T>)=>void):()=>void;
2067
+ nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<CustomEvent<T>>;
2068
+ hasListeners(name:string):boolean;
2069
+ /**
2070
+ * Removes an event listener added to this table.
2071
+ * @param name -
2072
+ * @param callback -
2073
+ * @return
2074
+ * @typeParam T -
2075
+ */
2076
+ removeEventListener<T>(name:string, callback:(e:CustomEvent<T>)=>void):boolean;
2077
+ }
2078
+
2079
+ /**
2080
+ * A js type for operating on input tables.
2081
+ *
2082
+ * Represents a User Input Table, which can have data added to it from other sources.
2083
+ *
2084
+ * You may add rows using dictionaries of key-value tuples (representing columns by name), add tables containing all the
2085
+ * key/value columns to add, or delete tables containing the keys to delete. Each operation is atomic, and will either
2086
+ * succeed completely or fail completely. To guarantee order of operations, apply an operation and wait for the response
2087
+ * before sending the next operation.
2088
+ *
2089
+ * Each table has one or more key columns, where each unique combination of keys will appear at most once in the table.
2090
+ *
2091
+ * To view the results of the Input Table, you should use standard table operations on the InputTable's source Table
2092
+ * object.
2093
+ */
2094
+ export class InputTable {
2095
+ protected constructor();
2096
+
2097
+ /**
2098
+ * Adds a single row to the table. For each key or value column name in the Input Table, we retrieve that javascript
2099
+ * property at that name and validate it can be put into the given column type.
2100
+ * @param row -
2101
+ * @param userTimeZone -
2102
+ * @return Promise of dh.InputTable
2103
+ */
2104
+ addRow(row:{ [key: string]: any; }, userTimeZone?:string):Promise<InputTable>;
2105
+ /**
2106
+ * Add multiple rows to a table.
2107
+ * @param rows -
2108
+ * @param userTimeZone -
2109
+ * @return Promise of dh.InputTable
2110
+ */
2111
+ addRows(rows:{ [key: string]: any; }[], userTimeZone?:string):Promise<InputTable>;
2112
+ /**
2113
+ * Add an entire table to this Input Table. Only column names that match the definition of the input table will be
2114
+ * copied, and all key columns must have values filled in. This only copies the current state of the source table;
2115
+ * future updates to the source table will not be reflected in the Input Table. The returned promise will be
2116
+ * resolved to the same InputTable instance this method was called upon once the server returns.
2117
+ * @param tableToAdd -
2118
+ * @return Promise of dh.InputTable
2119
+ */
2120
+ addTable(tableToAdd:Table):Promise<InputTable>;
2121
+ /**
2122
+ * Add multiple tables to this Input Table.
2123
+ * @param tablesToAdd -
2124
+ * @return Promise of dh.InputTable
2125
+ */
2126
+ addTables(tablesToAdd:Table[]):Promise<InputTable>;
2127
+ /**
2128
+ * Deletes an entire table from this Input Table. Key columns must match the Input Table.
2129
+ * @param tableToDelete -
2130
+ * @return Promise of dh.InputTable
2131
+ */
2132
+ deleteTable(tableToDelete:Table):Promise<InputTable>;
2133
+ /**
2134
+ * Delete multiple tables from this Input Table.
2135
+ * @param tablesToDelete -
2136
+ * @return
2137
+ */
2138
+ deleteTables(tablesToDelete:Table[]):Promise<InputTable>;
2139
+ /**
2140
+ * A list of the key columns, by name
2141
+ * @return String array.
2142
+ */
2143
+ get keys():string[];
2144
+ /**
2145
+ * A list of the value columns, by name
2146
+ * @return String array.
2147
+ */
2148
+ get values():string[];
2149
+ /**
2150
+ * A list of the key Column objects
2151
+ * @return {@link dh.Column} array.
2152
+ */
2153
+ get keyColumns():Column[];
2154
+ /**
2155
+ * A list of the value Column objects
2156
+ * @return {@link dh.Column} array.
2157
+ */
2158
+ get valueColumns():Column[];
2159
+ /**
2160
+ * The source table for this Input Table
2161
+ * @return dh.table
2162
+ */
2163
+ get table():Table;
2164
+ }
2165
+
2166
+ /**
2167
+ * Wrap BigDecimal values for use in JS. Provides text formatting for display and access to the underlying value.
2168
+ */
2169
+ export class BigDecimalWrapper {
2170
+ protected constructor();
2171
+
2172
+ static ofString(value:string):BigDecimalWrapper;
2173
+ asNumber():number;
2174
+ valueOf():string;
2175
+ toString():string;
2176
+ }
2177
+
2178
+ /**
2179
+ * Represents a non-viewport subscription to a table, and all data currently known to be present in the subscribed
2180
+ * columns. This class handles incoming snapshots and deltas, and fires events to consumers to notify of data changes.
2181
+ *
2182
+ * Unlike {@link dh.TableViewportSubscription}, the "original" table does not have a reference to this instance, only the
2183
+ * "private" table instance does, since the original cannot modify the subscription, and the private instance must
2184
+ * forward data to it.
2185
+ *
2186
+ * Represents a subscription to the table on the server. Changes made to the table will not be reflected here - the
2187
+ * subscription must be closed and a new one optioned to see those changes. The event model is slightly different from
2188
+ * viewports to make it less expensive to compute for large tables.
2189
+ */
2190
+ export class TableSubscription implements HasEventHandling {
2191
+ /**
2192
+ * Indicates that some new data is available on the client, either an initial snapshot or a delta update. The
2193
+ * <b>detail</b> field of the event will contain a TableSubscriptionEventData detailing what has changed, or
2194
+ * allowing access to the entire range of items currently in the subscribed columns.
2195
+ */
2196
+ static readonly EVENT_UPDATED:string;
2197
+
2198
+ protected constructor();
2199
+
2099
2200
  /**
2100
- * a filter condition checking if the current value is a null value
2101
- * @return {@link dh.FilterCondition}
2201
+ * Stops the subscription on the server.
2102
2202
  */
2103
- isNull():FilterCondition;
2203
+ close():void;
2204
+ addEventListener<T>(name:string, callback:(e:CustomEvent<T>)=>void):()=>void;
2205
+ nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<CustomEvent<T>>;
2206
+ hasListeners(name:string):boolean;
2207
+ removeEventListener<T>(name:string, callback:(e:CustomEvent<T>)=>void):boolean;
2104
2208
  /**
2105
- * a filter condition invoking the given method on the current value, with the given parameters. Currently supported
2106
- * functions that can be invoked on a String:
2107
- * <ul>
2108
- * <li><b>startsWith</b>: Returns true if the current string value starts with the supplied string argument</li>
2109
- * <li><b>endsWith</b>: Returns true if the current string value ends with the supplied string argument</li>
2110
- * <li><b>matches</b>: Returns true if the current string value matches the supplied string argument used as a Java
2111
- * regular expression</li>
2112
- * <li><b>contains</b>: Returns true if the current string value contains the supplied string argument
2113
- * <p>
2114
- * When invoking against a constant, this should be avoided in favor of FilterValue.contains
2115
- * </p>
2116
- * </li>
2117
- * </ul>
2118
- * @param method -
2119
- * @param args -
2120
- * @return
2209
+ * The columns that were subscribed to when this subscription was created
2210
+ * @return {@link dh.Column}
2121
2211
  */
2122
- invoke(method:string, ...args:FilterValue[]):FilterCondition;
2123
- toString():string;
2212
+ get columns():Array<Column>;
2213
+ }
2214
+
2215
+ /**
2216
+ * Event fired when a command is issued from the client.
2217
+ */
2218
+ export class CommandInfo {
2219
+ constructor(code:string, result:Promise<dh.ide.CommandResult>);
2220
+
2221
+ get result():Promise<dh.ide.CommandResult>;
2222
+ get code():string;
2223
+ }
2224
+
2225
+ /**
2226
+ * This class allows iteration over non-contiguous indexes. In the future, this will support the EcmaScript 2015
2227
+ * Iteration protocol, but for now has one method which returns an iterator, and also supports querying the size.
2228
+ * Additionally, we may add support for creating RangeSet objects to better serve some use cases.
2229
+ */
2230
+ export class RangeSet {
2231
+ protected constructor();
2232
+
2233
+ static ofRange(first:number, last:number):RangeSet;
2234
+ static ofItems(rows:number[]):RangeSet;
2235
+ static ofRanges(ranges:RangeSet[]):RangeSet;
2236
+ static ofSortedRanges(ranges:RangeSet[]):RangeSet;
2124
2237
  /**
2125
- * Constructs a string for the filter API from the given parameter.
2126
- * @param input -
2127
- * @return
2238
+ * a new iterator over all indexes in this collection.
2239
+ * @return Iterator of {@link dh.LongWrapper}
2128
2240
  */
2129
- static ofString(input:any):FilterValue;
2241
+ iterator():Iterator<LongWrapper>;
2130
2242
  /**
2131
- * Constructs a boolean for the filter API from the given parameter.
2132
- * @param b -
2133
- * @return
2243
+ * The total count of items contained in this collection. In some cases this can be expensive to compute, and
2244
+ * generally should not be needed except for debugging purposes, or preallocating space (i.e., do not call this
2245
+ * property each time through a loop).
2246
+ * @return double
2134
2247
  */
2135
- static ofBoolean(b:boolean):FilterValue;
2248
+ get size():number;
2136
2249
  }
2137
2250
 
2138
2251
  /**
@@ -2323,257 +2436,188 @@ export namespace dh {
2323
2436
  */
2324
2437
  get sort():Array<Sort>;
2325
2438
  /**
2326
- * True if this table may receive updates from the server, including size changed events, updated events after
2327
- * initial snapshot.
2328
- * @return boolean
2329
- */
2330
- get isRefreshing():boolean;
2331
- /**
2332
- * Listen for events on this object.
2333
- * @param name - the name of the event to listen for
2334
- * @param callback - a function to call when the event occurs
2335
- * @return Returns a cleanup function.
2336
- * @typeParam T - the type of the data that the event will provide
2337
- */
2338
- addEventListener<T>(name:string, callback:(e:CustomEvent<T>)=>void):()=>void;
2339
- nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<CustomEvent<T>>;
2340
- hasListeners(name:string):boolean;
2341
- /**
2342
- * Removes an event listener added to this table.
2343
- * @param name -
2344
- * @param callback -
2345
- * @return
2346
- * @typeParam T -
2347
- */
2348
- removeEventListener<T>(name:string, callback:(e:CustomEvent<T>)=>void):boolean;
2349
- }
2350
-
2351
-
2352
- /**
2353
- * This enum describes the name of each supported operation/aggregation type when creating a `TreeTable`.
2354
- */
2355
- type AggregationOperationType = string;
2356
- export class AggregationOperation {
2357
- static readonly COUNT:AggregationOperationType;
2358
- static readonly COUNT_DISTINCT:AggregationOperationType;
2359
- static readonly DISTINCT:AggregationOperationType;
2360
- static readonly MIN:AggregationOperationType;
2361
- static readonly MAX:AggregationOperationType;
2362
- static readonly SUM:AggregationOperationType;
2363
- static readonly ABS_SUM:AggregationOperationType;
2364
- static readonly VAR:AggregationOperationType;
2365
- static readonly AVG:AggregationOperationType;
2366
- static readonly STD:AggregationOperationType;
2367
- static readonly FIRST:AggregationOperationType;
2368
- static readonly LAST:AggregationOperationType;
2369
- static readonly UNIQUE:AggregationOperationType;
2370
- static readonly SKIP:AggregationOperationType;
2371
- }
2372
-
2373
- type SearchDisplayModeType = string;
2374
- export class SearchDisplayMode {
2375
- static readonly SEARCH_DISPLAY_DEFAULT:SearchDisplayModeType;
2376
- static readonly SEARCH_DISPLAY_HIDE:SearchDisplayModeType;
2377
- static readonly SEARCH_DISPLAY_SHOW:SearchDisplayModeType;
2378
- }
2379
-
2380
- /**
2381
- * A set of string constants that can be used to describe the different objects the JS API can export.
2382
- */
2383
- type VariableTypeType = string;
2384
- export class VariableType {
2385
- static readonly TABLE:VariableTypeType;
2386
- static readonly TREETABLE:VariableTypeType;
2387
- static readonly HIERARCHICALTABLE:VariableTypeType;
2388
- static readonly TABLEMAP:VariableTypeType;
2389
- static readonly PARTITIONEDTABLE:VariableTypeType;
2390
- static readonly FIGURE:VariableTypeType;
2391
- static readonly OTHERWIDGET:VariableTypeType;
2392
- static readonly PANDAS:VariableTypeType;
2393
- static readonly TREEMAP:VariableTypeType;
2394
- }
2395
-
2396
- type ValueTypeType = string;
2397
- export class ValueType {
2398
- static readonly STRING:ValueTypeType;
2399
- static readonly NUMBER:ValueTypeType;
2400
- static readonly DOUBLE:ValueTypeType;
2401
- static readonly LONG:ValueTypeType;
2402
- static readonly DATETIME:ValueTypeType;
2403
- static readonly BOOLEAN:ValueTypeType;
2404
- }
2405
-
2406
- }
2407
-
2408
- export namespace dh.ide {
2409
-
2410
- /**
2411
- * Indicates the result of code run on the server.
2412
- */
2413
- export interface CommandResult {
2414
- /**
2415
- * Describes changes made in the course of this command.
2416
- * @return {@link dh.ide.VariableChanges}.
2417
- */
2418
- get changes():VariableChanges;
2419
- /**
2420
- * If the command failed, the error message will be provided here.
2421
- * @return String
2422
- */
2423
- get error():string;
2424
- }
2425
- /**
2426
- * Represents a serialized fishlib LogRecord, suitable for display on javascript clients. A log entry sent from the
2427
- * server.
2428
- */
2429
- export interface LogItem {
2430
- /**
2431
- * The level of the log message, enabling the client to ignore messages.
2432
- * @return String
2433
- */
2434
- get logLevel():string;
2435
- /**
2436
- * Timestamp of the message in microseconds since Jan 1, 1970 UTC.
2437
- * @return double
2438
- */
2439
- get micros():number;
2440
- /**
2441
- * The log message written on the server.
2442
- * @return String
2443
- */
2444
- get message():string;
2445
- }
2446
- /**
2447
- * Specifies a type and either id or name (but not both).
2448
- */
2449
- export interface VariableDescriptor {
2450
- type:string;
2451
- id?:string|null;
2452
- name?:string|null;
2453
- }
2454
- /**
2455
- * A format to describe a variable available to be read from the server. Application fields are optional, and only
2456
- * populated when a variable is provided by application mode.
2457
- * <p>
2458
- * APIs which take a VariableDefinition must at least be provided an object with a <b>type</b> and <b>id</b> field.
2459
- */
2460
- export interface VariableDefinition {
2461
- get name():string;
2462
- /**
2463
- * Optional description for the variable's contents, typically used to provide more detail that wouldn't be
2464
- * reasonable to put in the title
2465
- * @return String
2466
- */
2467
- get description():string;
2468
- /**
2469
- * An opaque identifier for this variable
2470
- * @return String
2471
- */
2472
- get id():string;
2473
- /**
2474
- * The type of the variable, one of <b>dh.VariableType</b>
2475
- * @return dh.VariableType.
2476
- */
2477
- get type():dh.VariableTypeType;
2478
- /**
2479
- * The name of the variable, to be used when rendering it to a user
2480
- * @return String
2481
- */
2482
- get title():string;
2483
- /**
2484
- * Optional description for the variable's contents, typically used to provide more detail that wouldn't be
2485
- * reasonable to put in the title
2486
- * @return String
2487
- */
2488
- get applicationId():string;
2489
- /**
2490
- * The name of the application which provided this variable
2491
- * @return String
2492
- */
2493
- get applicationName():string;
2494
- }
2495
- /**
2496
- * Describes changes in the current set of variables in the script session. Note that variables that changed value
2497
- * without changing type will be included as <b>updated</b>, but if a new value with one type replaces an old value with
2498
- * a different type, this will be included as an entry in both <b>removed</b> and <b>created</b> to indicate the old and
2499
- * new types.
2500
- */
2501
- export interface VariableChanges {
2502
- /**
2503
- *
2504
- * @return The variables that no longer exist after this operation, or were replaced by some variable with a
2505
- * different type.
2439
+ * True if this table may receive updates from the server, including size changed events, updated events after
2440
+ * initial snapshot.
2441
+ * @return boolean
2506
2442
  */
2507
- get removed():Array<VariableDefinition>;
2443
+ get isRefreshing():boolean;
2508
2444
  /**
2509
- *
2510
- * @return The variables that were created by this operation, or have a new type.
2445
+ * Listen for events on this object.
2446
+ * @param name - the name of the event to listen for
2447
+ * @param callback - a function to call when the event occurs
2448
+ * @return Returns a cleanup function.
2449
+ * @typeParam T - the type of the data that the event will provide
2511
2450
  */
2512
- get created():Array<VariableDefinition>;
2451
+ addEventListener<T>(name:string, callback:(e:CustomEvent<T>)=>void):()=>void;
2452
+ nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<CustomEvent<T>>;
2453
+ hasListeners(name:string):boolean;
2513
2454
  /**
2514
- *
2515
- * @return The variables that changed value during this operation.
2455
+ * Removes an event listener added to this table.
2456
+ * @param name -
2457
+ * @param callback -
2458
+ * @return
2459
+ * @typeParam T -
2516
2460
  */
2517
- get updated():Array<VariableDefinition>;
2461
+ removeEventListener<T>(name:string, callback:(e:CustomEvent<T>)=>void):boolean;
2462
+ }
2463
+
2464
+
2465
+ type ValueTypeType = string;
2466
+ export class ValueType {
2467
+ static readonly STRING:ValueTypeType;
2468
+ static readonly NUMBER:ValueTypeType;
2469
+ static readonly DOUBLE:ValueTypeType;
2470
+ static readonly LONG:ValueTypeType;
2471
+ static readonly DATETIME:ValueTypeType;
2472
+ static readonly BOOLEAN:ValueTypeType;
2473
+ }
2474
+
2475
+ type SearchDisplayModeType = string;
2476
+ export class SearchDisplayMode {
2477
+ static readonly SEARCH_DISPLAY_DEFAULT:SearchDisplayModeType;
2478
+ static readonly SEARCH_DISPLAY_HIDE:SearchDisplayModeType;
2479
+ static readonly SEARCH_DISPLAY_SHOW:SearchDisplayModeType;
2480
+ }
2481
+
2482
+ /**
2483
+ * This enum describes the name of each supported operation/aggregation type when creating a `TreeTable`.
2484
+ */
2485
+ type AggregationOperationType = string;
2486
+ export class AggregationOperation {
2487
+ static readonly COUNT:AggregationOperationType;
2488
+ static readonly COUNT_DISTINCT:AggregationOperationType;
2489
+ static readonly DISTINCT:AggregationOperationType;
2490
+ static readonly MIN:AggregationOperationType;
2491
+ static readonly MAX:AggregationOperationType;
2492
+ static readonly SUM:AggregationOperationType;
2493
+ static readonly ABS_SUM:AggregationOperationType;
2494
+ static readonly VAR:AggregationOperationType;
2495
+ static readonly AVG:AggregationOperationType;
2496
+ static readonly STD:AggregationOperationType;
2497
+ static readonly FIRST:AggregationOperationType;
2498
+ static readonly LAST:AggregationOperationType;
2499
+ static readonly UNIQUE:AggregationOperationType;
2500
+ static readonly SKIP:AggregationOperationType;
2501
+ }
2502
+
2503
+ /**
2504
+ * A set of string constants that can be used to describe the different objects the JS API can export.
2505
+ */
2506
+ type VariableTypeType = string;
2507
+ export class VariableType {
2508
+ static readonly TABLE:VariableTypeType;
2509
+ static readonly TREETABLE:VariableTypeType;
2510
+ static readonly HIERARCHICALTABLE:VariableTypeType;
2511
+ static readonly TABLEMAP:VariableTypeType;
2512
+ static readonly PARTITIONEDTABLE:VariableTypeType;
2513
+ static readonly FIGURE:VariableTypeType;
2514
+ static readonly OTHERWIDGET:VariableTypeType;
2515
+ static readonly PANDAS:VariableTypeType;
2516
+ static readonly TREEMAP:VariableTypeType;
2518
2517
  }
2518
+
2519
2519
  }
2520
2520
 
2521
2521
  export namespace dh.i18n {
2522
2522
 
2523
2523
  /**
2524
- * Exported wrapper of the GWT NumberFormat, plus LongWrapper support
2524
+ * Largely an exported wrapper for the GWT DateFormat, but also includes support for formatting nanoseconds as an
2525
+ * additional 6 decimal places after the rest of the number.
2525
2526
  *
2526
- * Utility class to parse and format numbers, using the same format patterns as are supported by the standard Java
2527
- * implementation used in the Deephaven server and swing client. Works for numeric types including BigInteger and
2528
- * BigDecimal.
2527
+ * Other concerns that this handles includes accepting a js Date and ignoring the lack of nanos, accepting a js Number
2528
+ * and assuming it to be a lossy nano value, and parsing into a js Date.
2529
+ *
2530
+ *
2531
+ * Utility class to parse and format various date/time values, using the same format patterns as are supported by the
2532
+ * standard Java implementation used in the Deephaven server and swing client.
2533
+ *
2534
+ * As Deephaven internally uses nanosecond precision to record dates, this API expects nanoseconds in most use cases,
2535
+ * with the one exception of the JS `Date` type, which is not capable of more precision than milliseconds. Note,
2536
+ * however, that when passing nanoseconds as a JS `Number` there is likely to be some loss of precision, though this is
2537
+ * still supported for easier interoperability with other JS code. The values returned by `parse()` will be an opaque
2538
+ * object wrapping the full precision of the specified date, However, this object supports `toString()` and `valueOf()`
2539
+ * to return a string representation of that value, as well as a `asNumber()` to return a JS `Number` value and a
2540
+ * `asDate()` to return a JS `Date` value.
2541
+ *
2542
+ *
2543
+ * Caveats:
2544
+ *
2545
+ *
2546
+ * - The `D` format (for "day of year") is not supported by this implementation at this time. - The `%t` format for
2547
+ * short timezone code is not supported by this implementation at this time, though `z` will work as expected in the
2548
+ * browser to emit the user's own timezone.
2529
2549
  */
2530
- export class NumberFormat {
2550
+ export class DateTimeFormat {
2551
+ static readonly NANOS_PER_MILLI:number;
2552
+
2531
2553
  /**
2532
- * Creates a new number format instance. This generally should be avoided in favor of the static `getFormat`
2554
+ * Creates a new date/time format instance. This generally should be avoided in favor of the static `getFormat`
2533
2555
  * function, which will create and cache an instance so that later calls share the same instance.
2534
2556
  * @param pattern -
2535
2557
  */
2536
2558
  constructor(pattern:string);
2537
2559
 
2538
2560
  /**
2539
- * a number format instance matching the specified format. If this format has not been specified before, a new
2540
- * instance will be created and cached for later reuse. Prefer this method to calling the constructor directly to
2541
- * take advantage of caching
2561
+ *
2542
2562
  * @param pattern -
2543
- * @return dh.i18n.NumberFormat
2563
+ * @return a date format instance matching the specified format. If this format has not been specified before, a new
2564
+ * instance will be created and stored for later reuse.
2544
2565
  */
2545
- static getFormat(pattern:string):NumberFormat;
2566
+ static getFormat(pattern:string):DateTimeFormat;
2546
2567
  /**
2547
- * Parses the given text using the cached format matching the given pattern.
2568
+ * Accepts a variety of input objects to interpret as a date, and formats them using the specified pattern. A
2569
+ * `TimeZone` object can optionally be provided to format this date as the current date/time in that timezone.See
2570
+ * the instance method for more details on input objects.
2571
+ * @param pattern -
2572
+ * @param date -
2573
+ * @param timeZone -
2574
+ * @return
2575
+ */
2576
+ static format(pattern:string, date:any, timeZone?:TimeZone):string;
2577
+ /**
2578
+ * Parses the given input string using the provided pattern, and returns a JS `Date` object in milliseconds.
2548
2579
  * @param pattern -
2549
2580
  * @param text -
2550
- * @return double
2581
+ * @return
2551
2582
  */
2552
- static parse(pattern:string, text:string):number;
2583
+ static parseAsDate(pattern:string, text:string):Date;
2553
2584
  /**
2554
- * Formats the specified number (or Java <b>long</b>, <b>BigInteger</b> or <b>BigDecimal</b> value) using the cached
2555
- * format matching the given pattern string.
2585
+ * Parses the given input string using the provided pattern, and returns a wrapped Java `long` value in nanoseconds.
2586
+ * A `TimeZone` object can optionally be provided to parse to a desired timezone.
2556
2587
  * @param pattern -
2557
- * @param number -
2588
+ * @param text -
2589
+ * @param tz -
2590
+ * @return
2591
+ */
2592
+ static parse(pattern:string, text:string, tz?:TimeZone):dh.DateWrapper;
2593
+ /**
2594
+ * Takes a variety of objects to interpret as a date, and formats them using this instance's pattern. Inputs can
2595
+ * include a <b>String</b> value of a number expressed in nanoseconds, a <b>Number</b> value expressed in
2596
+ * nanoseconds, a JS <b>Date</b> object (necessarily in milliseconds), or a wrapped Java <b>long</b> value,
2597
+ * expressed in nanoseconds. A <b>TimeZone</b> object can optionally be provided to format this date as the current
2598
+ * date/time in that timezone.
2599
+ * @param date -
2600
+ * @param timeZone -
2558
2601
  * @return String
2559
2602
  */
2560
- static format(pattern:string, number:number|dh.BigIntegerWrapper|dh.BigDecimalWrapper|dh.LongWrapper):string;
2603
+ format(date:any, timeZone?:TimeZone):string;
2561
2604
  /**
2562
- * Parses the given text using this instance's pattern into a JS Number.
2605
+ * Parses the given string using this instance's pattern, and returns a wrapped Java <b>long</b> value in
2606
+ * nanoseconds. A <b>TimeZone</b> object can optionally be provided to parse to a desired timezone.
2563
2607
  * @param text -
2564
- * @return double
2608
+ * @param tz -
2609
+ * @return
2565
2610
  */
2566
- parse(text:string):number;
2611
+ parse(text:string, tz?:TimeZone):dh.DateWrapper;
2567
2612
  /**
2568
- * Formats the specified number (or Java `long`, `BigInteger` or `BigDecimal` value) using this instance's pattern.
2569
- * @param number -
2570
- * @return String
2613
+ * Parses the given string using this instance's pattern, and returns a JS <b>Date</b> object in milliseconds.
2614
+ * @param text -
2615
+ * @return
2571
2616
  */
2572
- format(number:number|dh.BigIntegerWrapper|dh.BigDecimalWrapper|dh.LongWrapper):string;
2617
+ parseAsDate(text:string):Date;
2573
2618
  toString():string;
2574
2619
  }
2575
2620
 
2576
-
2577
2621
  /**
2578
2622
  * Represents the timezones supported by Deephaven. Can be used to format dates, taking into account the offset changing
2579
2623
  * throughout the year (potentially changing each year). These instances mostly are useful at this time to pass to the
@@ -2686,107 +2730,93 @@ export namespace dh.i18n {
2686
2730
  }
2687
2731
 
2688
2732
  /**
2689
- * Largely an exported wrapper for the GWT DateFormat, but also includes support for formatting nanoseconds as an
2690
- * additional 6 decimal places after the rest of the number.
2691
- *
2692
- * Other concerns that this handles includes accepting a js Date and ignoring the lack of nanos, accepting a js Number
2693
- * and assuming it to be a lossy nano value, and parsing into a js Date.
2694
- *
2695
- *
2696
- * Utility class to parse and format various date/time values, using the same format patterns as are supported by the
2697
- * standard Java implementation used in the Deephaven server and swing client.
2698
- *
2699
- * As Deephaven internally uses nanosecond precision to record dates, this API expects nanoseconds in most use cases,
2700
- * with the one exception of the JS `Date` type, which is not capable of more precision than milliseconds. Note,
2701
- * however, that when passing nanoseconds as a JS `Number` there is likely to be some loss of precision, though this is
2702
- * still supported for easier interoperability with other JS code. The values returned by `parse()` will be an opaque
2703
- * object wrapping the full precision of the specified date, However, this object supports `toString()` and `valueOf()`
2704
- * to return a string representation of that value, as well as a `asNumber()` to return a JS `Number` value and a
2705
- * `asDate()` to return a JS `Date` value.
2706
- *
2707
- *
2708
- * Caveats:
2709
- *
2733
+ * Exported wrapper of the GWT NumberFormat, plus LongWrapper support
2710
2734
  *
2711
- * - The `D` format (for "day of year") is not supported by this implementation at this time. - The `%t` format for
2712
- * short timezone code is not supported by this implementation at this time, though `z` will work as expected in the
2713
- * browser to emit the user's own timezone.
2735
+ * Utility class to parse and format numbers, using the same format patterns as are supported by the standard Java
2736
+ * implementation used in the Deephaven server and swing client. Works for numeric types including BigInteger and
2737
+ * BigDecimal.
2714
2738
  */
2715
- export class DateTimeFormat {
2716
- static readonly NANOS_PER_MILLI:number;
2717
-
2739
+ export class NumberFormat {
2718
2740
  /**
2719
- * Creates a new date/time format instance. This generally should be avoided in favor of the static `getFormat`
2741
+ * Creates a new number format instance. This generally should be avoided in favor of the static `getFormat`
2720
2742
  * function, which will create and cache an instance so that later calls share the same instance.
2721
2743
  * @param pattern -
2722
2744
  */
2723
2745
  constructor(pattern:string);
2724
2746
 
2725
2747
  /**
2726
- *
2727
- * @param pattern -
2728
- * @return a date format instance matching the specified format. If this format has not been specified before, a new
2729
- * instance will be created and stored for later reuse.
2730
- */
2731
- static getFormat(pattern:string):DateTimeFormat;
2732
- /**
2733
- * Accepts a variety of input objects to interpret as a date, and formats them using the specified pattern. A
2734
- * `TimeZone` object can optionally be provided to format this date as the current date/time in that timezone.See
2735
- * the instance method for more details on input objects.
2736
- * @param pattern -
2737
- * @param date -
2738
- * @param timeZone -
2739
- * @return
2740
- */
2741
- static format(pattern:string, date:any, timeZone?:TimeZone):string;
2742
- /**
2743
- * Parses the given input string using the provided pattern, and returns a JS `Date` object in milliseconds.
2748
+ * a number format instance matching the specified format. If this format has not been specified before, a new
2749
+ * instance will be created and cached for later reuse. Prefer this method to calling the constructor directly to
2750
+ * take advantage of caching
2744
2751
  * @param pattern -
2745
- * @param text -
2746
- * @return
2752
+ * @return dh.i18n.NumberFormat
2747
2753
  */
2748
- static parseAsDate(pattern:string, text:string):Date;
2754
+ static getFormat(pattern:string):NumberFormat;
2749
2755
  /**
2750
- * Parses the given input string using the provided pattern, and returns a wrapped Java `long` value in nanoseconds.
2751
- * A `TimeZone` object can optionally be provided to parse to a desired timezone.
2756
+ * Parses the given text using the cached format matching the given pattern.
2752
2757
  * @param pattern -
2753
2758
  * @param text -
2754
- * @param tz -
2755
- * @return
2759
+ * @return double
2756
2760
  */
2757
- static parse(pattern:string, text:string, tz?:TimeZone):dh.DateWrapper;
2758
- /**
2759
- * Takes a variety of objects to interpret as a date, and formats them using this instance's pattern. Inputs can
2760
- * include a <b>String</b> value of a number expressed in nanoseconds, a <b>Number</b> value expressed in
2761
- * nanoseconds, a JS <b>Date</b> object (necessarily in milliseconds), or a wrapped Java <b>long</b> value,
2762
- * expressed in nanoseconds. A <b>TimeZone</b> object can optionally be provided to format this date as the current
2763
- * date/time in that timezone.
2764
- * @param date -
2765
- * @param timeZone -
2761
+ static parse(pattern:string, text:string):number;
2762
+ /**
2763
+ * Formats the specified number (or Java <b>long</b>, <b>BigInteger</b> or <b>BigDecimal</b> value) using the cached
2764
+ * format matching the given pattern string.
2765
+ * @param pattern -
2766
+ * @param number -
2766
2767
  * @return String
2767
2768
  */
2768
- format(date:any, timeZone?:TimeZone):string;
2769
+ static format(pattern:string, number:number|dh.BigIntegerWrapper|dh.BigDecimalWrapper|dh.LongWrapper):string;
2769
2770
  /**
2770
- * Parses the given string using this instance's pattern, and returns a wrapped Java <b>long</b> value in
2771
- * nanoseconds. A <b>TimeZone</b> object can optionally be provided to parse to a desired timezone.
2771
+ * Parses the given text using this instance's pattern into a JS Number.
2772
2772
  * @param text -
2773
- * @param tz -
2774
- * @return
2773
+ * @return double
2775
2774
  */
2776
- parse(text:string, tz?:TimeZone):dh.DateWrapper;
2775
+ parse(text:string):number;
2777
2776
  /**
2778
- * Parses the given string using this instance's pattern, and returns a JS <b>Date</b> object in milliseconds.
2779
- * @param text -
2780
- * @return
2777
+ * Formats the specified number (or Java `long`, `BigInteger` or `BigDecimal` value) using this instance's pattern.
2778
+ * @param number -
2779
+ * @return String
2781
2780
  */
2782
- parseAsDate(text:string):Date;
2781
+ format(number:number|dh.BigIntegerWrapper|dh.BigDecimalWrapper|dh.LongWrapper):string;
2783
2782
  toString():string;
2784
2783
  }
2785
2784
 
2785
+
2786
2786
  }
2787
2787
 
2788
2788
  export namespace dh.plot {
2789
2789
 
2790
+ /**
2791
+ * Describes how to access and display data required within a series.
2792
+ */
2793
+ export interface SeriesDataSource {
2794
+ /**
2795
+ * the type of data stored in the underlying table's Column.
2796
+ * @return String
2797
+ */
2798
+ get columnType():string;
2799
+ /**
2800
+ * the axis that this source should be drawn on.
2801
+ * @return dh.plot.Axis
2802
+ */
2803
+ get axis():Axis;
2804
+ /**
2805
+ * the feature of this series represented by this source. See the <b>SourceType</b> enum for more details.
2806
+ * @return int
2807
+ */
2808
+ get type():SourceTypeType;
2809
+ }
2810
+ export interface OneClick {
2811
+ setValueForColumn(columnName:string, value:any):void;
2812
+ getValueForColumn(columName:string):any;
2813
+ get requireAllFiltersToDisplay():boolean;
2814
+ get columns():dh.Column[];
2815
+ }
2816
+ export interface FigureDataUpdatedEvent {
2817
+ getArray(series:Series, sourceType:number, mappingFunc?:(arg0:any)=>any):Array<any>;
2818
+ get series():Series[];
2819
+ }
2790
2820
  /**
2791
2821
  * Provides access to the data for displaying in a figure.
2792
2822
  */
@@ -2831,31 +2861,6 @@ export namespace dh.plot {
2831
2861
  get multiSeries():MultiSeries;
2832
2862
  get shapeLabel():string;
2833
2863
  }
2834
- export interface OneClick {
2835
- setValueForColumn(columnName:string, value:any):void;
2836
- getValueForColumn(columName:string):any;
2837
- get requireAllFiltersToDisplay():boolean;
2838
- get columns():dh.Column[];
2839
- }
2840
- /**
2841
- * Describes a template that will be used to make new series instances when a new table added to a plotBy.
2842
- */
2843
- export interface MultiSeries {
2844
- /**
2845
- * The name for this multi-series.
2846
- * @return String
2847
- */
2848
- get name():string;
2849
- /**
2850
- * The plotting style to use for the series that will be created. See <b>SeriesPlotStyle</b> enum for more details.
2851
- * @return int
2852
- */
2853
- get plotStyle():SeriesPlotStyleType;
2854
- }
2855
- export interface FigureDataUpdatedEvent {
2856
- getArray(series:Series, sourceType:number, mappingFunc?:(arg0:any)=>any):Array<any>;
2857
- get series():Series[];
2858
- }
2859
2864
  /**
2860
2865
  * Defines one axis used with by series. These instances will be found both on the Chart and the Series instances, and
2861
2866
  * may be shared between Series instances.
@@ -2925,144 +2930,19 @@ export namespace dh.plot {
2925
2930
  get minRange():number;
2926
2931
  }
2927
2932
  /**
2928
- * Describes how to access and display data required within a series.
2929
- */
2930
- export interface SeriesDataSource {
2931
- /**
2932
- * the type of data stored in the underlying table's Column.
2933
- * @return String
2934
- */
2935
- get columnType():string;
2936
- /**
2937
- * the axis that this source should be drawn on.
2938
- * @return dh.plot.Axis
2939
- */
2940
- get axis():Axis;
2941
- /**
2942
- * the feature of this series represented by this source. See the <b>SourceType</b> enum for more details.
2943
- * @return int
2944
- */
2945
- get type():SourceTypeType;
2946
- }
2947
-
2948
- export class FigureSourceException {
2949
- table:dh.Table;
2950
- source:SeriesDataSource;
2951
-
2952
- protected constructor();
2953
- }
2954
-
2955
- export class SourceDescriptor {
2956
- axis:AxisDescriptor;
2957
- table:dh.Table;
2958
- columnName:string;
2959
- type:string;
2960
-
2961
- constructor();
2962
- }
2963
-
2964
- export class SeriesDataSourceException {
2965
- protected constructor();
2966
-
2967
- get source():SeriesDataSource;
2968
- get message():string;
2969
- }
2970
-
2971
- /**
2972
- * A descriptor used with JsFigureFactory.create to create a figure from JS.
2973
- */
2974
- export class FigureDescriptor {
2975
- title?:string|null;
2976
- titleFont?:string|null;
2977
- titleColor?:string|null;
2978
- isResizable?:boolean|null;
2979
- isDefaultTheme?:boolean|null;
2980
- updateInterval?:number|null;
2981
- cols?:number|null;
2982
- rows?:number|null;
2983
- charts:Array<ChartDescriptor>;
2984
-
2985
- constructor();
2986
- }
2987
-
2988
- /**
2989
- * Helper class for plot downsampling methods.
2990
- */
2991
- export class Downsample {
2992
- protected constructor();
2993
-
2994
- /**
2995
- * Downsamples a table so that the data can be used for a time-series line plot. The downsampled table should have
2996
- * the same visual fidelity as the original table, but with fewer rows.
2997
- * @param table - The table to downsample.
2998
- * @param xCol - The name of the X column to downsample. Must be an Instant or long.
2999
- * @param yCols - The names of the Y columns to downsample.
3000
- * @param width - The width of the visible area in pixels.
3001
- * @param xRange - The visible range as `[start, end]` or null to always use all data.
3002
- * @return A promise that resolves to the downsampled table.
3003
- */
3004
- static runChartDownsample(table:dh.Table, xCol:string, yCols:string[], width:number, xRange?:dh.LongWrapper[]|undefined|null):Promise<dh.Table>;
3005
- }
3006
-
3007
- /**
3008
- * Helper class to manage snapshots and deltas and keep not only a contiguous JS array of data per column in the
3009
- * underlying table, but also support a mapping function to let client code translate data in some way for display and
3010
- * keep that cached as well.
3011
- */
3012
- export class ChartData {
3013
- constructor(table:dh.Table);
3014
-
3015
- update(tableData:dh.SubscriptionTableData):void;
3016
- getColumn(columnName:string, mappingFunc:(arg0:any)=>any, currentUpdate:dh.TableData):Array<any>;
3017
- /**
3018
- * Removes some column from the cache, avoiding extra computation on incoming events, and possibly freeing some
3019
- * memory. If this pair of column name and map function are requested again, it will be recomputed from scratch.
3020
- */
3021
- removeColumn(columnName:string, mappingFunc:(arg0:any)=>any):void;
3022
- }
3023
-
3024
- /**
3025
- * Provide the details for a chart.
2933
+ * Describes a template that will be used to make new series instances when a new table added to a plotBy.
3026
2934
  */
3027
- export class Chart implements dh.HasEventHandling {
3028
- /**
3029
- * a new series was added to this chart as part of a multi-series. The series instance is the detail for this event.
3030
- */
3031
- static readonly EVENT_SERIES_ADDED:string;
2935
+ export interface MultiSeries {
3032
2936
  /**
3033
- * The title of the chart.
2937
+ * The name for this multi-series.
3034
2938
  * @return String
3035
2939
  */
3036
- readonly title?:string|null;
3037
-
3038
- protected constructor();
3039
-
3040
- addEventListener<T>(name:string, callback:(e:CustomEvent<T>)=>void):()=>void;
3041
- nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<CustomEvent<T>>;
3042
- hasListeners(name:string):boolean;
3043
- removeEventListener<T>(name:string, callback:(e:CustomEvent<T>)=>void):boolean;
3044
- get column():number;
3045
- get showLegend():boolean;
3046
- /**
3047
- * The axes used in this chart.
3048
- * @return dh.plot.Axis
3049
- */
3050
- get axes():Axis[];
3051
- get is3d():boolean;
3052
- get titleFont():string;
3053
- get colspan():number;
3054
- get titleColor():string;
3055
- get series():Series[];
3056
- get rowspan():number;
2940
+ get name():string;
3057
2941
  /**
3058
- * The type of this chart, see <b>ChartType</b> enum for more details.
2942
+ * The plotting style to use for the series that will be created. See <b>SeriesPlotStyle</b> enum for more details.
3059
2943
  * @return int
3060
2944
  */
3061
- get chartType():ChartTypeType;
3062
- get row():number;
3063
- get legendColor():string;
3064
- get legendFont():string;
3065
- get multiSeries():MultiSeries[];
2945
+ get plotStyle():SeriesPlotStyleType;
3066
2946
  }
3067
2947
 
3068
2948
  /**
@@ -3202,21 +3082,36 @@ export namespace dh.plot {
3202
3082
  constructor();
3203
3083
  }
3204
3084
 
3205
- export class SeriesDescriptor {
3206
- plotStyle:string;
3207
- name?:string|null;
3208
- linesVisible?:boolean|null;
3209
- shapesVisible?:boolean|null;
3210
- gradientVisible?:boolean|null;
3211
- lineColor?:string|null;
3212
- pointLabelFormat?:string|null;
3213
- xToolTipPattern?:string|null;
3214
- yToolTipPattern?:string|null;
3215
- shapeLabel?:string|null;
3216
- shapeSize?:number|null;
3217
- shapeColor?:string|null;
3218
- shape?:string|null;
3219
- dataSources:Array<SourceDescriptor>;
3085
+ /**
3086
+ * Helper class to manage snapshots and deltas and keep not only a contiguous JS array of data per column in the
3087
+ * underlying table, but also support a mapping function to let client code translate data in some way for display and
3088
+ * keep that cached as well.
3089
+ */
3090
+ export class ChartData {
3091
+ constructor(table:dh.Table);
3092
+
3093
+ update(tableData:dh.SubscriptionTableData):void;
3094
+ getColumn(columnName:string, mappingFunc:(arg0:any)=>any, currentUpdate:dh.TableData):Array<any>;
3095
+ /**
3096
+ * Removes some column from the cache, avoiding extra computation on incoming events, and possibly freeing some
3097
+ * memory. If this pair of column name and map function are requested again, it will be recomputed from scratch.
3098
+ */
3099
+ removeColumn(columnName:string, mappingFunc:(arg0:any)=>any):void;
3100
+ }
3101
+
3102
+ /**
3103
+ * A descriptor used with JsFigureFactory.create to create a figure from JS.
3104
+ */
3105
+ export class FigureDescriptor {
3106
+ title?:string|null;
3107
+ titleFont?:string|null;
3108
+ titleColor?:string|null;
3109
+ isResizable?:boolean|null;
3110
+ isDefaultTheme?:boolean|null;
3111
+ updateInterval?:number|null;
3112
+ cols?:number|null;
3113
+ rows?:number|null;
3114
+ charts:Array<ChartDescriptor>;
3220
3115
 
3221
3116
  constructor();
3222
3117
  }
@@ -3252,6 +3147,13 @@ export namespace dh.plot {
3252
3147
  constructor();
3253
3148
  }
3254
3149
 
3150
+ export class SeriesDataSourceException {
3151
+ protected constructor();
3152
+
3153
+ get source():SeriesDataSource;
3154
+ get message():string;
3155
+ }
3156
+
3255
3157
  export class DownsampleOptions {
3256
3158
  /**
3257
3159
  * Max number of items in the series before DEFAULT will not attempt to load the series without downsampling. Above
@@ -3278,47 +3180,105 @@ export namespace dh.plot {
3278
3180
  protected constructor();
3279
3181
  }
3280
3182
 
3183
+ export class SeriesDescriptor {
3184
+ plotStyle:string;
3185
+ name?:string|null;
3186
+ linesVisible?:boolean|null;
3187
+ shapesVisible?:boolean|null;
3188
+ gradientVisible?:boolean|null;
3189
+ lineColor?:string|null;
3190
+ pointLabelFormat?:string|null;
3191
+ xToolTipPattern?:string|null;
3192
+ yToolTipPattern?:string|null;
3193
+ shapeLabel?:string|null;
3194
+ shapeSize?:number|null;
3195
+ shapeColor?:string|null;
3196
+ shape?:string|null;
3197
+ dataSources:Array<SourceDescriptor>;
3281
3198
 
3282
- type AxisTypeType = number;
3283
- export class AxisType {
3284
- static readonly X:AxisTypeType;
3285
- static readonly Y:AxisTypeType;
3286
- static readonly SHAPE:AxisTypeType;
3287
- static readonly SIZE:AxisTypeType;
3288
- static readonly LABEL:AxisTypeType;
3289
- static readonly COLOR:AxisTypeType;
3199
+ constructor();
3290
3200
  }
3291
3201
 
3292
- type AxisFormatTypeType = number;
3293
- export class AxisFormatType {
3294
- static readonly CATEGORY:AxisFormatTypeType;
3295
- static readonly NUMBER:AxisFormatTypeType;
3202
+ /**
3203
+ * Helper class for plot downsampling methods.
3204
+ */
3205
+ export class Downsample {
3206
+ protected constructor();
3207
+
3208
+ /**
3209
+ * Downsamples a table so that the data can be used for a time-series line plot. The downsampled table should have
3210
+ * the same visual fidelity as the original table, but with fewer rows.
3211
+ * @param table - The table to downsample.
3212
+ * @param xCol - The name of the X column to downsample. Must be an Instant or long.
3213
+ * @param yCols - The names of the Y columns to downsample.
3214
+ * @param width - The width of the visible area in pixels.
3215
+ * @param xRange - The visible range as `[start, end]` or null to always use all data.
3216
+ * @return A promise that resolves to the downsampled table.
3217
+ */
3218
+ static runChartDownsample(table:dh.Table, xCol:string, yCols:string[], width:number, xRange?:dh.LongWrapper[]|undefined|null):Promise<dh.Table>;
3296
3219
  }
3297
3220
 
3298
- type AxisPositionType = number;
3299
- export class AxisPosition {
3300
- static readonly TOP:AxisPositionType;
3301
- static readonly BOTTOM:AxisPositionType;
3302
- static readonly LEFT:AxisPositionType;
3303
- static readonly RIGHT:AxisPositionType;
3304
- static readonly NONE:AxisPositionType;
3221
+ export class SourceDescriptor {
3222
+ axis:AxisDescriptor;
3223
+ table:dh.Table;
3224
+ columnName:string;
3225
+ type:string;
3226
+
3227
+ constructor();
3305
3228
  }
3306
3229
 
3307
3230
  /**
3308
- * This enum describes what kind of chart is being drawn. This may limit what kinds of series can be found on it, or how
3309
- * those series should be rendered.
3231
+ * Provide the details for a chart.
3310
3232
  */
3311
- type ChartTypeType = number;
3312
- export class ChartType {
3313
- static readonly XY:ChartTypeType;
3314
- static readonly PIE:ChartTypeType;
3315
- static readonly OHLC:ChartTypeType;
3316
- static readonly CATEGORY:ChartTypeType;
3317
- static readonly XYZ:ChartTypeType;
3318
- static readonly CATEGORY_3D:ChartTypeType;
3319
- static readonly TREEMAP:ChartTypeType;
3233
+ export class Chart implements dh.HasEventHandling {
3234
+ /**
3235
+ * a new series was added to this chart as part of a multi-series. The series instance is the detail for this event.
3236
+ */
3237
+ static readonly EVENT_SERIES_ADDED:string;
3238
+ /**
3239
+ * The title of the chart.
3240
+ * @return String
3241
+ */
3242
+ readonly title?:string|null;
3243
+
3244
+ protected constructor();
3245
+
3246
+ addEventListener<T>(name:string, callback:(e:CustomEvent<T>)=>void):()=>void;
3247
+ nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<CustomEvent<T>>;
3248
+ hasListeners(name:string):boolean;
3249
+ removeEventListener<T>(name:string, callback:(e:CustomEvent<T>)=>void):boolean;
3250
+ get column():number;
3251
+ get showLegend():boolean;
3252
+ /**
3253
+ * The axes used in this chart.
3254
+ * @return dh.plot.Axis
3255
+ */
3256
+ get axes():Axis[];
3257
+ get is3d():boolean;
3258
+ get titleFont():string;
3259
+ get colspan():number;
3260
+ get titleColor():string;
3261
+ get series():Series[];
3262
+ get rowspan():number;
3263
+ /**
3264
+ * The type of this chart, see <b>ChartType</b> enum for more details.
3265
+ * @return int
3266
+ */
3267
+ get chartType():ChartTypeType;
3268
+ get row():number;
3269
+ get legendColor():string;
3270
+ get legendFont():string;
3271
+ get multiSeries():MultiSeries[];
3272
+ }
3273
+
3274
+ export class FigureSourceException {
3275
+ table:dh.Table;
3276
+ source:SeriesDataSource;
3277
+
3278
+ protected constructor();
3320
3279
  }
3321
3280
 
3281
+
3322
3282
  /**
3323
3283
  * This enum describes the source it is in, and how this aspect of the data in the series should be used to render the
3324
3284
  * 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
@@ -3364,6 +3324,46 @@ export namespace dh.plot {
3364
3324
  static readonly TREEMAP:SeriesPlotStyleType;
3365
3325
  }
3366
3326
 
3327
+ type AxisFormatTypeType = number;
3328
+ export class AxisFormatType {
3329
+ static readonly CATEGORY:AxisFormatTypeType;
3330
+ static readonly NUMBER:AxisFormatTypeType;
3331
+ }
3332
+
3333
+ type AxisPositionType = number;
3334
+ export class AxisPosition {
3335
+ static readonly TOP:AxisPositionType;
3336
+ static readonly BOTTOM:AxisPositionType;
3337
+ static readonly LEFT:AxisPositionType;
3338
+ static readonly RIGHT:AxisPositionType;
3339
+ static readonly NONE:AxisPositionType;
3340
+ }
3341
+
3342
+ /**
3343
+ * This enum describes what kind of chart is being drawn. This may limit what kinds of series can be found on it, or how
3344
+ * those series should be rendered.
3345
+ */
3346
+ type ChartTypeType = number;
3347
+ export class ChartType {
3348
+ static readonly XY:ChartTypeType;
3349
+ static readonly PIE:ChartTypeType;
3350
+ static readonly OHLC:ChartTypeType;
3351
+ static readonly CATEGORY:ChartTypeType;
3352
+ static readonly XYZ:ChartTypeType;
3353
+ static readonly CATEGORY_3D:ChartTypeType;
3354
+ static readonly TREEMAP:ChartTypeType;
3355
+ }
3356
+
3357
+ type AxisTypeType = number;
3358
+ export class AxisType {
3359
+ static readonly X:AxisTypeType;
3360
+ static readonly Y:AxisTypeType;
3361
+ static readonly SHAPE:AxisTypeType;
3362
+ static readonly SIZE:AxisTypeType;
3363
+ static readonly LABEL:AxisTypeType;
3364
+ static readonly COLOR:AxisTypeType;
3365
+ }
3366
+
3367
3367
  }
3368
3368
 
3369
3369
  export namespace dh.lsp {
@@ -3375,23 +3375,6 @@ export namespace dh.lsp {
3375
3375
  constructor();
3376
3376
  }
3377
3377
 
3378
- export class CompletionItem {
3379
- label:string;
3380
- kind:number;
3381
- detail:string;
3382
- documentation:MarkupContent;
3383
- deprecated:boolean;
3384
- preselect:boolean;
3385
- textEdit:TextEdit;
3386
- sortText:string;
3387
- filterText:string;
3388
- insertTextFormat:number;
3389
- additionalTextEdits:Array<TextEdit>;
3390
- commitCharacters:Array<string>;
3391
-
3392
- constructor();
3393
- }
3394
-
3395
3378
  export class Hover {
3396
3379
  contents:MarkupContent;
3397
3380
  range:Range;
@@ -3399,13 +3382,6 @@ export namespace dh.lsp {
3399
3382
  constructor();
3400
3383
  }
3401
3384
 
3402
- export class ParameterInformation {
3403
- label:string;
3404
- documentation:MarkupContent;
3405
-
3406
- constructor();
3407
- }
3408
-
3409
3385
  export class Range {
3410
3386
  start:Position;
3411
3387
  end:Position;
@@ -3424,6 +3400,21 @@ export namespace dh.lsp {
3424
3400
  constructor();
3425
3401
  }
3426
3402
 
3403
+ export class TextDocumentContentChangeEvent {
3404
+ range:Range;
3405
+ rangeLength:number;
3406
+ text:string;
3407
+
3408
+ constructor();
3409
+ }
3410
+
3411
+ export class MarkupContent {
3412
+ kind:string;
3413
+ value:string;
3414
+
3415
+ constructor();
3416
+ }
3417
+
3427
3418
  export class Position {
3428
3419
  line:number;
3429
3420
  character:number;
@@ -3437,17 +3428,26 @@ export namespace dh.lsp {
3437
3428
  copy():Position;
3438
3429
  }
3439
3430
 
3440
- export class MarkupContent {
3441
- kind:string;
3442
- value:string;
3431
+ export class CompletionItem {
3432
+ label:string;
3433
+ kind:number;
3434
+ detail:string;
3435
+ documentation:MarkupContent;
3436
+ deprecated:boolean;
3437
+ preselect:boolean;
3438
+ textEdit:TextEdit;
3439
+ sortText:string;
3440
+ filterText:string;
3441
+ insertTextFormat:number;
3442
+ additionalTextEdits:Array<TextEdit>;
3443
+ commitCharacters:Array<string>;
3443
3444
 
3444
3445
  constructor();
3445
3446
  }
3446
3447
 
3447
- export class TextDocumentContentChangeEvent {
3448
- range:Range;
3449
- rangeLength:number;
3450
- text:string;
3448
+ export class ParameterInformation {
3449
+ label:string;
3450
+ documentation:MarkupContent;
3451
3451
 
3452
3452
  constructor();
3453
3453
  }
@@ -3456,18 +3456,6 @@ export namespace dh.lsp {
3456
3456
 
3457
3457
  export namespace dh.calendar {
3458
3458
 
3459
- export interface Holiday {
3460
- /**
3461
- * The date of the Holiday.
3462
- * @return {@link dh.LocalDateWrapper}
3463
- */
3464
- get date():dh.LocalDateWrapper;
3465
- /**
3466
- * The business periods that are open on the holiday.
3467
- * @return dh.calendar.BusinessPeriod
3468
- */
3469
- get businessPeriods():Array<BusinessPeriod>;
3470
- }
3471
3459
  /**
3472
3460
  * Defines a calendar with business hours and holidays.
3473
3461
  */
@@ -3498,6 +3486,18 @@ export namespace dh.calendar {
3498
3486
  */
3499
3487
  get businessPeriods():Array<BusinessPeriod>;
3500
3488
  }
3489
+ export interface Holiday {
3490
+ /**
3491
+ * The date of the Holiday.
3492
+ * @return {@link dh.LocalDateWrapper}
3493
+ */
3494
+ get date():dh.LocalDateWrapper;
3495
+ /**
3496
+ * The business periods that are open on the holiday.
3497
+ * @return dh.calendar.BusinessPeriod
3498
+ */
3499
+ get businessPeriods():Array<BusinessPeriod>;
3500
+ }
3501
3501
  export interface BusinessPeriod {
3502
3502
  get close():string;
3503
3503
  get open():string;