@deephaven/jsapi-types 1.0.0-dev0.40.6 → 41.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.d.ts +1954 -1989
  2. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -1,6 +1,10 @@
1
1
  // Minimum TypeScript Version: 4.3
2
2
  // Generated using com.vertispan.tsdefs.doclet.TsDoclet
3
3
 
4
+ export interface IIterableResult<T> {
5
+ value:T;
6
+ done:boolean;
7
+ }
4
8
  /**
5
9
  * This is part of EcmaScript 2015, documented here for completeness. It supports a single method, <b>next()</b>, which
6
10
  * returns an object with a <b>boolean</b> named <b>done</b> (true if there are no more items to return; false
@@ -11,10 +15,6 @@ export interface Iterator<T> {
11
15
  hasNext():boolean;
12
16
  next():IIterableResult<T>;
13
17
  }
14
- export interface IIterableResult<T> {
15
- value:T;
16
- done:boolean;
17
- }
18
18
  export namespace dh.storage {
19
19
 
20
20
  /**
@@ -118,50 +118,33 @@ export namespace dh.storage {
118
118
  export namespace dh {
119
119
 
120
120
  /**
121
- * Similar to {@link dh.ViewportData}, but with additional properties to reflect
122
- * the tree structure.
121
+ * Wrap LocalDate values for use in JS. Provides text formatting for display and access to the underlying value.
123
122
  */
124
- export interface TreeViewportData extends TableData {
125
- get(index:LongWrapper|number):TreeRow;
126
- getData(index:LongWrapper|number, column:Column):any;
127
- getFormat(index:LongWrapper|number, column:Column):Format;
128
- get treeSize():number;
129
- /**
130
- * The position of the first returned row within the tree.
131
- */
132
- get offset():number;
133
- get columns():Array<Column>;
134
- get rows():Array<TreeRow>;
123
+ export interface LocalDateWrapper {
124
+ valueOf():string;
125
+ getYear():number;
126
+ getMonthValue():number;
127
+ getDayOfMonth():number;
128
+ toString():string;
135
129
  }
136
- export interface LayoutHints {
137
- readonly searchDisplayMode?:SearchDisplayModeType|null;
138
-
139
- get hiddenColumns():string[]|null;
140
- get frozenColumns():string[]|null;
141
- get columnGroups():ColumnGroup[]|null;
142
- get areSavedLayoutsAllowed():boolean;
143
- get frontColumns():string[]|null;
144
- get backColumns():string[]|null;
130
+ /**
131
+ * This object may be pooled internally or discarded and not updated. Do not retain references to it. Instead,
132
+ * request the viewport again.
133
+ */
134
+ export interface ViewportRow extends Row {
135
+ get(column:Column):any;
136
+ getFormat(column:Column):Format;
137
+ get index():LongWrapper;
145
138
  }
146
- export interface HasEventHandling {
147
- /**
148
- * Listen for events on this object.
149
- * @param name - the name of the event to listen for
150
- * @param callback - a function to call when the event occurs
151
- * @return Returns a cleanup function.
152
- * @typeParam T - the type of the data that the event will provide
153
- */
154
- addEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):()=>void;
155
- nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<Event<T>>;
156
- hasListeners(name:string):boolean;
157
- /**
158
- * Removes an event listener added to this table.
159
- * @param name -
160
- * @param callback -
161
- * @return
162
- * @typeParam T -
163
- */
164
- removeEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):boolean;
139
+ /**
140
+ * Represents a row available in a subscription/snapshot on the client. Do not retain references to rows - they will
141
+ * not function properly when the event isn't actively going off (or promise resolving). Instead, wait for the next
142
+ * event, or re-request the viewport data.
143
+ */
144
+ export interface Row {
145
+ get(column:Column):any;
146
+ getFormat(column:Column):Format;
147
+ get index():LongWrapper;
165
148
  }
166
149
  /**
167
150
  * Options for requesting a preview of columns when requesting table data. The two properties
@@ -181,152 +164,68 @@ export namespace dh {
181
164
  */
182
165
  array?:number|null;
183
166
  }
184
- export interface RefreshToken {
185
- get bytes():string;
186
- get expiry():number;
187
- }
188
- /**
189
- * Represents a table which can be joined to another table. Current implementations are {@link dh.Table} and
190
- * {@link dh.TotalsTable}.
191
- */
192
- export interface JoinableTable {
193
- freeze():Promise<Table>;
194
- snapshot(baseTable:Table, doInitialSnapshot?:boolean, stampColumns?:string[]):Promise<Table>;
195
- /**
196
- * Joins this table to the provided table, using one of the specified join types:
197
- * <ul>
198
- * <li><code>AJ</code>, <code>ReverseAJ</code> (or <code>RAJ</code>) - inexact timeseries joins, based on the
199
- * provided matching rule.</li>
200
- * <li><code>CROSS_JOIN</code> (or <code>Join</code>) - cross join of all rows that have matching values in both
201
- * tables.</li>
202
- * <li><code>EXACT_JOIN</code> (or <code>ExactJoin</code> - matches values in exactly one row in the right table,
203
- * with errors if there is not exactly one.</li>
204
- * <li><code>NATURAL_JOIN</code> (or <code>Natural</code> - matches values in at most one row in the right table,
205
- * with nulls if there is no match or errors if there are multiple matches.</li>
206
- * </ul>
207
- *
208
- * Note that <code>Left</code> join is not supported here, unlike DHE.
209
- * <p>
210
- * See the <a href="https://deephaven.io/core/docs/conceptual/choose-joins/">Choose a join method</a> document for
211
- * more guidance on picking a join operation.
212
- * @deprecated Instead, call the specific method for the join type.
213
- * @param joinType - The type of join to perform, see the list above.
214
- * @param rightTable - The table to match to values in this table
215
- * @param columnsToMatch - Columns that should match
216
- * @param columnsToAdd - Columns from the right table to add to the result - empty/null/absent to add all columns
217
- * @param asOfMatchRule - If joinType is AJ/RAJ/ReverseAJ, the match rule to use
218
- * @return a promise that will resolve to the joined table
219
- */
220
- join(joinType:string, rightTable:JoinableTable, columnsToMatch:Array<string>, columnsToAdd?:Array<string>|undefined|null, asOfMatchRule?:string|undefined|null):Promise<Table>;
221
- /**
222
- * Performs an inexact timeseries join, where rows in this table will have columns added from the closest matching
223
- * row from the right table.
224
- * <p>
225
- * The `asOfMatchRule` value can be one of:
226
- * <ul>
227
- * <li>LESS_THAN_EQUAL</li>
228
- * <li>LESS_THAN</li>
229
- * <li>GREATER_THAN_EQUAL</li>
230
- * <li>GREATER_THAN</li>
231
- * </ul>
232
- * @param rightTable - the table to match to values in this table
233
- * @param columnsToMatch - the columns that should match, according to the asOfMatchRole
234
- * @param columnsToAdd - columns from the right table to add to the resulting table, empty/null/absent to add all
235
- * columns
236
- * @param asOfMatchRule - the match rule to use, see above
237
- * @return a promise that will resolve to the joined table
238
- */
239
- asOfJoin(rightTable:JoinableTable, columnsToMatch:Array<string>, columnsToAdd?:Array<string>|undefined|null, asOfMatchRule?:string|undefined|null):Promise<Table>;
240
- /**
241
- * a promise that will be resolved with the newly created table holding the results of the specified cross join
242
- * operation. The <b>columnsToAdd</b> parameter is optional, not specifying it will result in all columns from the
243
- * right table being added to the output. The <b>reserveBits</b> optional parameter lets the client control how the
244
- * key space is distributed between the rows in the two tables, see the Java <b>Table</b> class for details.
245
- * @param rightTable - the table to match to values in this table
246
- * @param columnsToMatch - the columns that should match exactly
247
- * @param columnsToAdd - columns from the right table to add to the resulting table, empty/null/absent to add all
248
- * columns
249
- * @param reserveBits - the number of bits of key-space to initially reserve per group, null/absent will let the
250
- * server select a value
251
- * @return a promise that will resolve to the joined table
252
- */
253
- crossJoin(rightTable:JoinableTable, columnsToMatch:Array<string>, columnsToAdd?:Array<string>|undefined|null, reserveBits?:number|undefined|null):Promise<Table>;
167
+ export interface HasEventHandling {
254
168
  /**
255
- * a promise that will be resolved with the newly created table holding the results of the specified exact join
256
- * operation. The `columnsToAdd` parameter is optional, not specifying it will result in all columns from the right
257
- * table being added to the output.
258
- * @param rightTable - the table to match to values in this table
259
- * @param columnsToMatch - the columns that should match exactly
260
- * @param columnsToAdd - columns from the right table to add to the resulting table, empty/null/absent to add all
261
- * columns
262
- * @return a promise that will resolve to the joined table
169
+ * Listen for events on this object.
170
+ * @param name - the name of the event to listen for
171
+ * @param callback - a function to call when the event occurs
172
+ * @return Returns a cleanup function.
173
+ * @typeParam T - the type of the data that the event will provide
263
174
  */
264
- exactJoin(rightTable:JoinableTable, columnsToMatch:Array<string>, columnsToAdd?:Array<string>|undefined|null):Promise<Table>;
175
+ addEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):()=>void;
176
+ nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<Event<T>>;
177
+ hasListeners(name:string):boolean;
265
178
  /**
266
- * a promise that will be resolved with the newly created table holding the results of the specified natural join
267
- * operation. The <b>columnsToAdd</b> parameter is optional, not specifying it will result in all columns from the
268
- * right table being added to the output.
269
- * @param rightTable - the table to match to values in this table
270
- * @param columnsToMatch - the columns that should match exactly
271
- * @param columnsToAdd - columns from the right table to add to the resulting table, empty/null/absent to add all
272
- * columns
273
- * @return a promise that will resolve to the joined table
179
+ * Removes an event listener added to this table.
180
+ * @param name -
181
+ * @param callback -
182
+ * @return
183
+ * @typeParam T -
274
184
  */
275
- naturalJoin(rightTable:JoinableTable, columnsToMatch:Array<string>, columnsToAdd?:Array<string>|undefined|null):Promise<Table>;
185
+ removeEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):boolean;
276
186
  }
277
187
  /**
278
- * This object may be pooled internally or discarded and not updated. Do not retain references to it.
188
+ * Simple range consisting only of start and end numbers. Will be migrated to deephaven-core in the near future, and
189
+ * subsequently removed from this the coreplus namespace.
279
190
  */
280
- export interface Format {
191
+ export interface SimpleRange {
192
+ first:number;
193
+ last:number;
194
+ }
195
+ /**
196
+ * Common interface for various ways of accessing table data and formatting for viewport or non-viewport subscriptions
197
+ * on tables, data in trees, and snapshots.
198
+ * <p>
199
+ * Generally speaking, it is more efficient to access data in column-major order, rather than iterating through each Row
200
+ * and accessing all columns that it holds. The {@link rows} accessor can be useful to read row data, but may
201
+ * incur other costs - it is likely faster to access data by columns using {@link getData}.
202
+ */
203
+ export interface TableData {
281
204
  /**
282
- * The format string to apply to the value of this cell.
283
- * @return String
205
+ * Reads a row object from the table, from which any subscribed column can be read.
206
+ * @param index - the position or key to access
207
+ * @return the row at the given location
284
208
  */
285
- readonly formatString?:string|null;
209
+ get(index:LongWrapper|number):Row;
286
210
  /**
287
- * Color to apply to the cell's background, in <b>#rrggbb</b> format.
288
- * @return String
211
+ * Reads a specific cell from the table, by row key and column.
212
+ * @param index - the row in the table to get data from
213
+ * @param column - the column to read
214
+ * @return the value in the table
289
215
  */
290
- readonly backgroundColor?:string|null;
216
+ getData(index:LongWrapper|number, column:Column):any;
291
217
  /**
292
- * Color to apply to the text, in <b>#rrggbb</b> format.
293
- * @return String
218
+ * The server-specified Format to use for the cell at the given position.
219
+ * @param index - the row to read
220
+ * @param column - the column to read
221
+ * @return a Format instance with any server-specified details
294
222
  */
295
- readonly color?:string|null;
223
+ getFormat(index:LongWrapper|number, column:Column):Format;
224
+ get columns():Array<Column>;
296
225
  /**
297
- *
298
- * @deprecated Prefer formatString. Number format string to apply to the value in this cell.
226
+ * A lazily computed array of all rows available on the client.
299
227
  */
300
- readonly numberFormat?:string|null;
301
- }
302
- /**
303
- * This object may be pooled internally or discarded and not updated. Do not retain references to it. Instead,
304
- * request the viewport again.
305
- */
306
- export interface ViewportRow extends Row {
307
- get(column:Column):any;
308
- getFormat(column:Column):Format;
309
- get index():LongWrapper;
310
- }
311
- /**
312
- * Similar to the browser `CustomEvent` type, this class holds only the type of the event, and optionally some
313
- * details about the event.
314
- * @typeParam T - the type of the event detail
315
- */
316
- export interface Event<T> {
317
- get detail():T;
318
- get type():string;
319
- }
320
- /**
321
- * Wrap LocalTime values for use in JS. Provides text formatting for display and access to the underlying value.
322
- */
323
- export interface LocalTimeWrapper {
324
- valueOf():string;
325
- getHour():number;
326
- getMinute():number;
327
- getSecond():number;
328
- getNano():number;
329
- toString():string;
228
+ get rows():Array<Row>;
330
229
  }
331
230
  /**
332
231
  * Options for requesting a full-table subscription to a table.
@@ -341,28 +240,217 @@ export namespace dh {
341
240
  */
342
241
  updateIntervalMs?:number|null;
343
242
  }
243
+ export interface RefreshToken {
244
+ get bytes():string;
245
+ get expiry():number;
246
+ }
344
247
  /**
345
- * Extends {@link dh.TableData}, but only contains data in the current viewport. The only API change from TableData is that
346
- * ViewportData also contains the offset to this data, so that the actual row number may be determined.
347
- * <p>
348
- * For viewport subscriptions, it is not necessary to read with the key, only with the position.
349
- * <p>
350
- * Do not assume that the first row in `rows` is the first visible row, because extra rows may be provided for easier
351
- * scrolling without going to the server.
248
+ * Behaves like a Table, but doesn't expose all of its API for changing the internal state. Instead, state is driven by
249
+ * the upstream table - when it changes handle, this listens and updates its own handle accordingly.
250
+ *
251
+ * Additionally, this is automatically subscribed to its one and only row, across all columns.
252
+ *
253
+ * A new config is returned any time it is accessed, to prevent accidental mutation, and to allow it to be used as a
254
+ * template when fetching a new totals table, or changing the totals table in use.
255
+ *
256
+ * A simplistic Table, providing access to aggregation of the table it is sourced from. This table is always
257
+ * automatically subscribed to its parent, and adopts changes automatically from it. This class has limited methods
258
+ * found on Table. Instances of this type always have a size of one when no groupBy is set on the config, but may
259
+ * potentially contain as few as zero rows, or as many as the parent table if each row gets its own group.
260
+ *
261
+ * When using the `groupBy` feature, it may be desireable to also provide a row to the user with all values across all
262
+ * rows. To achieve this, request the same Totals Table again, but remove the `groupBy` setting.
352
263
  */
353
- export interface ViewportData extends TableData {
264
+ export interface TotalsTable extends JoinableTable {
354
265
  /**
355
- * Reads a row object from the viewport, based on its position in the table.
266
+ * Specifies the range of items to pass to the client and update as they change. If the columns parameter is not
267
+ * provided, all columns will be used. Until this is called, no data will be available. Invoking this will result in
268
+ * events to be fired once data becomes available, starting with an <b>updated</b> event and one <b>rowadded</b>
269
+ * event per row in that range.
270
+ * @param firstRow -
271
+ * @param lastRow -
272
+ * @param columns -
273
+ * @param updateIntervalMs -
274
+ * @deprecated Use {@link #createViewportSubscription(Object)} instead.
356
275
  */
357
- get(index:LongWrapper|number):ViewportRow;
358
- getData(index:LongWrapper|number, column:Column):any;
359
- getFormat(index:LongWrapper|number, column:Column):Format;
276
+ setViewport(firstRow:number, lastRow:number, columns?:Array<Column>, updateIntervalMs?:number, isReverseViewport?:boolean|undefined|null):void;
360
277
  /**
361
- * The position of the first returned row within the table.
278
+ * the currently visible viewport. If the current set of operations has not yet resulted in data, it will not
279
+ * resolve until that data is ready.
280
+ * @return Promise of {@link dh.TableData}
281
+ * @deprecated use {@link TableViewportSubscription#getViewportData()} on the result from
282
+ * {@link #createViewportSubscription(Object)} instead.
283
+ */
284
+ getViewportData():Promise<ViewportData>;
285
+ /**
286
+ * Creates a subscription to this table, with the given options. See {@link Table.createSubscription} for
287
+ * more information.
288
+ * @param options - options for the subscription; see {@link dh.SubscriptionOptions} for details
289
+ * @return a new {@link dh.TableSubscription}
290
+ */
291
+ createSubscription(options:object):TableSubscription;
292
+ /**
293
+ * Creates a viewport subscription to this table, with the given options. See
294
+ * {@link Table.createViewportSubscription} for more information.
295
+ * @param options - options for the viewport subscription; see {@link dh.ViewportSubscriptionOptions} for
296
+ * details
297
+ * @return a new {@link dh.TableViewportSubscription}
298
+ */
299
+ createViewportSubscription(options:object):TableViewportSubscription;
300
+ /**
301
+ * Creates a snapshot of this table on the server, with the given options. See
302
+ * {@link Table.createSnapshot} for more information.
303
+ * @param options - options for the snapshot; see {@link dh.SnapshotOptions} for details
304
+ * @return Promise of {@link dh.TableData}
305
+ */
306
+ createSnapshot(options:object):Promise<TableData>;
307
+ /**
308
+ * a column by the given name. You should prefer to always retrieve a new Column instance instead of caching a
309
+ * returned value.
310
+ * @param key -
311
+ * @return {@link dh.Column}
312
+ */
313
+ findColumn(key:string):Column;
314
+ /**
315
+ * multiple columns specified by the given names.
316
+ * @param keys -
317
+ * @return {@link dh.Column} array
318
+ */
319
+ findColumns(keys:string[]):Column[];
320
+ /**
321
+ * Indicates that the table will no longer be used, and resources used to provide it can be freed up on the server.
322
+ */
323
+ close():void;
324
+ addEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):()=>void;
325
+ removeEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):boolean;
326
+ nextEvent<T>(eventName:string, timeoutInMillis:number):Promise<Event<T>>;
327
+ hasListeners(name:string):boolean;
328
+ /**
329
+ * Replace the currently set sort on this table. Returns the previously set value. Note that the sort property will
330
+ * immediately return the new value, but you may receive update events using the old sort before the new sort is
331
+ * applied, and the <b>sortchanged</b> event fires. Reusing existing, applied sorts may enable this to perform
332
+ * better on the server. The <b>updated</b> event will also fire, but <b>rowadded</b> and <b>rowremoved</b> will
333
+ * not.
334
+ * @param sort -
335
+ * @return {@link dh.Sort} array
336
+ */
337
+ applySort(sort:Sort[]):Array<Sort>;
338
+ /**
339
+ * Replace the current custom columns with a new set. These columns can be used when adding new filter and sort
340
+ * operations to the table, as long as they are present.
341
+ * @param customColumns -
342
+ * @return
343
+ */
344
+ applyCustomColumns(customColumns:Array<string|CustomColumn>):Array<CustomColumn>;
345
+ /**
346
+ * Replace the currently set filters on the table. Returns the previously set value. Note that the filter property
347
+ * will immediately return the new value, but you may receive update events using the old filter before the new one
348
+ * is applied, and the <b>filterchanged</b> event fires. Reusing existing, applied filters may enable this to
349
+ * perform better on the server. The <b>updated</b> event will also fire, but <b>rowadded</b> and <b>rowremoved</b>
350
+ * will not.
351
+ * @param filter -
352
+ * @return {@link dh.FilterCondition} array
353
+ */
354
+ applyFilter(filter:FilterCondition[]):Array<FilterCondition>;
355
+ /**
356
+ * An ordered list of Filters to apply to the table. To update, call applyFilter(). Note that this getter will
357
+ * return the new value immediately, even though it may take a little time to update on the server. You may listen
358
+ * for the <b>filterchanged</b> event to know when to update the UI.
359
+ * @return {@link dh.FilterCondition} array
360
+ */
361
+ get filter():Array<FilterCondition>;
362
+ /**
363
+ * True if this table has been closed.
364
+ * @return boolean
365
+ */
366
+ get isClosed():boolean;
367
+ /**
368
+ * The total number of rows in this table. This may change as the base table's configuration, filter, or contents
369
+ * change.
370
+ * @return double
371
+ */
372
+ get size():number;
373
+ /**
374
+ * The columns present on this table. Note that this may not include all columns in the parent table, and in cases
375
+ * where a given column has more than one aggregation applied, the column name will have a suffix indicating the
376
+ * aggregation used. This suffixed name will be of the form <b>columnName + '__' + aggregationName</b>.
377
+ * @return {@link dh.Column} array
362
378
  */
363
- get offset():number;
364
379
  get columns():Array<Column>;
365
- get rows():Array<ViewportRow>;
380
+ get totalsTableConfig():TotalsTableConfig;
381
+ /**
382
+ * An ordered list of Sorts to apply to the table. To update, call applySort(). Note that this getter will return
383
+ * the new value immediately, even though it may take a little time to update on the server. You may listen for the
384
+ * <b>sortchanged</b> event to know when to update the UI.
385
+ * @return {@link dh.Sort} array
386
+ */
387
+ get sort():Array<Sort>;
388
+ /**
389
+ * Read-only. An ordered list of custom column formulas to add to the table, either adding new columns or replacing
390
+ * existing ones. To update, call <b>applyCustomColumns()</b>.
391
+ * @return {@link dh.CustomColumn} array
392
+ */
393
+ get customColumns():Array<CustomColumn>;
394
+ /**
395
+ * True if this table may receive updates from the server, including size changed events, updated events after
396
+ * initial snapshot.
397
+ * @return boolean
398
+ */
399
+ get isRefreshing():boolean;
400
+ }
401
+ /**
402
+ * Row implementation that also provides additional read-only properties. represents visible rows in the table, but
403
+ * with additional properties to reflect the tree structure.
404
+ */
405
+ export interface TreeRow extends Row {
406
+ get(column:Column):any;
407
+ getFormat(column:Column):Format;
408
+ /**
409
+ * True if this node is currently expanded to show its children; false otherwise. Those children will be the
410
+ * rows below this one with a greater depth than this one.
411
+ * @return boolean
412
+ */
413
+ get isExpanded():boolean;
414
+ /**
415
+ * The number of levels above this node; zero for top level nodes. Generally used by the UI to indent the row
416
+ * and its expand/collapse icon.
417
+ * @return int
418
+ */
419
+ get depth():number;
420
+ /**
421
+ * True if this node has children and can be expanded; false otherwise. Note that this value may change when the
422
+ * table updates, depending on the table's configuration.
423
+ * @return boolean
424
+ */
425
+ get hasChildren():boolean;
426
+ get index():LongWrapper;
427
+ }
428
+ /**
429
+ * Represents statistics for a given table column.
430
+ */
431
+ export interface ColumnStatistics {
432
+ /**
433
+ * Gets the type of formatting that should be used for given statistic.
434
+ * <p>
435
+ * the format type for a statistic. A null return value means that the column formatting should be used.
436
+ * @param name - the display name of the statistic
437
+ * @return String
438
+ */
439
+ getType(name:string):string;
440
+ /**
441
+ * 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
442
+ * name to the count of how many times it occurred in the column. This map will be empty for tables containing more
443
+ * than 19 unique values.
444
+ * @return Map of String double
445
+ */
446
+ get uniqueValues():Map<string, number>;
447
+ /**
448
+ * Gets a map with the display name of statistics as keys and the numeric stat as a value.
449
+ * <p>
450
+ * A map of each statistic's name to its value.
451
+ * @return Map of String and Object
452
+ */
453
+ get statisticsMap():Map<string, object>;
366
454
  }
367
455
  export interface WorkerHeapInfo {
368
456
  /**
@@ -391,6 +479,31 @@ export namespace dh {
391
479
  columns:Array<Column>;
392
480
  }
393
481
  /**
482
+ * This object may be pooled internally or discarded and not updated. Do not retain references to it.
483
+ */
484
+ export interface Format {
485
+ /**
486
+ * The format string to apply to the value of this cell.
487
+ * @return String
488
+ */
489
+ readonly formatString?:string|null;
490
+ /**
491
+ * Color to apply to the cell's background, in <b>#rrggbb</b> format.
492
+ * @return String
493
+ */
494
+ readonly backgroundColor?:string|null;
495
+ /**
496
+ * Color to apply to the text, in <b>#rrggbb</b> format.
497
+ * @return String
498
+ */
499
+ readonly color?:string|null;
500
+ /**
501
+ *
502
+ * @deprecated Prefer formatString. Number format string to apply to the value in this cell.
503
+ */
504
+ readonly numberFormat?:string|null;
505
+ }
506
+ /**
394
507
  * Event data, describing the indexes that were added/removed/updated, and providing access to Rows (and thus data in
395
508
  * columns) either by index, or scanning the complete present index.
396
509
  * <p>
@@ -428,77 +541,215 @@ export namespace dh {
428
541
  get rows():Array<Row>;
429
542
  }
430
543
  /**
431
- * Common interface for various ways of accessing table data and formatting for viewport or non-viewport subscriptions
432
- * on tables, data in trees, and snapshots.
433
- * <p>
434
- * Generally speaking, it is more efficient to access data in column-major order, rather than iterating through each Row
435
- * and accessing all columns that it holds. The {@link rows} accessor can be useful to read row data, but may
436
- * incur other costs - it is likely faster to access data by columns using {@link getData}.
544
+ * Similar to the browser `CustomEvent` type, this class holds only the type of the event, and optionally some
545
+ * details about the event.
546
+ * @typeParam T - the type of the event detail
437
547
  */
438
- export interface TableData {
439
- /**
440
- * Reads a row object from the table, from which any subscribed column can be read.
441
- * @param index - the position or key to access
442
- * @return the row at the given location
443
- */
444
- get(index:LongWrapper|number):Row;
445
- /**
446
- * Reads a specific cell from the table, by row key and column.
447
- * @param index - the row in the table to get data from
448
- * @param column - the column to read
449
- * @return the value in the table
450
- */
451
- getData(index:LongWrapper|number, column:Column):any;
548
+ export interface Event<T> {
549
+ get detail():T;
550
+ get type():string;
551
+ }
552
+ /**
553
+ * Options for requesting a snapshot of a table.
554
+ */
555
+ export interface SnapshotOptions extends DataOptions {
452
556
  /**
453
- * The server-specified Format to use for the cell at the given position.
454
- * @param index - the row to read
455
- * @param column - the column to read
456
- * @return a Format instance with any server-specified details
557
+ * If true, the snapshot will be filled starting from the end of the table, where 0 is the last row of the
558
+ * table. Default is false.
457
559
  */
458
- getFormat(index:LongWrapper|number, column:Column):Format;
459
- get columns():Array<Column>;
560
+ isReverseViewport?:boolean|null;
460
561
  /**
461
- * A lazily computed array of all rows available on the client.
562
+ * The rows to include in the snapshot. This can be either a {@link dh.RangeSet} or a single range with
563
+ * `first` and `last` properties.
462
564
  */
463
- get rows():Array<Row>;
565
+ rows:RangeSet|SimpleRange;
464
566
  }
465
567
  /**
466
- * Row implementation that also provides additional read-only properties. represents visible rows in the table, but
467
- * with additional properties to reflect the tree structure.
568
+ * Represents the contents of a single widget data message from the server, with a binary data paylod and exported
569
+ * objects. Implemented both by Widget itself and by the `event.details` when data is received by the client.
570
+ *
571
+ * Terminology note: the name of this type should probably use "Data" instead of "Message", and the methods should use
572
+ * "payload" rather than "data" to match other platforms and the protobuf itself. These names are instead used for
573
+ * backwards compatibility and to better follow JS expectations.
468
574
  */
469
- export interface TreeRow extends Row {
470
- get(column:Column):any;
471
- getFormat(column:Column):Format;
575
+ export interface WidgetMessageDetails {
472
576
  /**
473
- * True if this node is currently expanded to show its children; false otherwise. Those children will be the
474
- * rows below this one with a greater depth than this one.
475
- * @return boolean
577
+ * Returns the data from this message as a base64-encoded string.
476
578
  */
477
- get isExpanded():boolean;
579
+ getDataAsBase64():string;
478
580
  /**
479
- * The number of levels above this node; zero for top level nodes. Generally used by the UI to indent the row
480
- * and its expand/collapse icon.
481
- * @return int
581
+ * Returns the data from this message as a Uint8Array.
482
582
  */
483
- get depth():number;
583
+ getDataAsU8():Uint8Array;
484
584
  /**
485
- * True if this node has children and can be expanded; false otherwise. Note that this value may change when the
486
- * table updates, depending on the table's configuration.
487
- * @return boolean
585
+ * Returns the data from this message as a utf-8 string.
488
586
  */
489
- get hasChildren():boolean;
490
- get index():LongWrapper;
587
+ getDataAsString():string;
588
+ /**
589
+ * Returns an array of exported objects sent from the server. The plugin implementation is now responsible for these
590
+ * objects, and should close them when no longer needed.
591
+ */
592
+ get exportedObjects():WidgetExportedObject[];
491
593
  }
492
594
  /**
493
- * Wrap LocalDate values for use in JS. Provides text formatting for display and access to the underlying value.
595
+ * Similar to {@link dh.ViewportData}, but with additional properties to reflect
596
+ * the tree structure.
494
597
  */
495
- export interface LocalDateWrapper {
598
+ export interface TreeViewportData extends TableData {
599
+ get(index:LongWrapper|number):TreeRow;
600
+ getData(index:LongWrapper|number, column:Column):any;
601
+ getFormat(index:LongWrapper|number, column:Column):Format;
602
+ get treeSize():number;
603
+ /**
604
+ * The position of the first returned row within the tree.
605
+ */
606
+ get offset():number;
607
+ get columns():Array<Column>;
608
+ get rows():Array<TreeRow>;
609
+ }
610
+ /**
611
+ * Wrap LocalTime values for use in JS. Provides text formatting for display and access to the underlying value.
612
+ */
613
+ export interface LocalTimeWrapper {
496
614
  valueOf():string;
497
- getYear():number;
498
- getMonthValue():number;
499
- getDayOfMonth():number;
615
+ getHour():number;
616
+ getMinute():number;
617
+ getSecond():number;
618
+ getNano():number;
500
619
  toString():string;
501
620
  }
621
+ export interface ColumnGroup {
622
+ get name():string|null;
623
+ get children():string[]|null;
624
+ get color():string|null;
625
+ }
626
+ /**
627
+ * Extends {@link dh.TableData}, but only contains data in the current viewport. The only API change from TableData is that
628
+ * ViewportData also contains the offset to this data, so that the actual row number may be determined.
629
+ * <p>
630
+ * For viewport subscriptions, it is not necessary to read with the key, only with the position.
631
+ * <p>
632
+ * Do not assume that the first row in `rows` is the first visible row, because extra rows may be provided for easier
633
+ * scrolling without going to the server.
634
+ */
635
+ export interface ViewportData extends TableData {
636
+ /**
637
+ * Reads a row object from the viewport, based on its position in the table.
638
+ */
639
+ get(index:LongWrapper|number):ViewportRow;
640
+ getData(index:LongWrapper|number, column:Column):any;
641
+ getFormat(index:LongWrapper|number, column:Column):Format;
642
+ /**
643
+ * The position of the first returned row within the table.
644
+ */
645
+ get offset():number;
646
+ get columns():Array<Column>;
647
+ get rows():Array<ViewportRow>;
648
+ }
649
+ /**
650
+ * Options for requesting a viewport subscription to a table.
651
+ */
652
+ export interface ViewportSubscriptionOptions extends SubscriptionOptions {
653
+ /**
654
+ * If true, the viewport will be filled starting from the end of the table, where 0 is the last row of the
655
+ * table. Default is false.
656
+ */
657
+ isReverseViewport?:boolean|null;
658
+ /**
659
+ * The rows to include in the viewport. This can be either a {@link dh.RangeSet} or a single range with
660
+ * `first` and `last` properties.
661
+ */
662
+ rows:RangeSet|SimpleRange;
663
+ }
664
+ /**
665
+ * Represents a table which can be joined to another table. Current implementations are {@link dh.Table} and
666
+ * {@link dh.TotalsTable}.
667
+ */
668
+ export interface JoinableTable {
669
+ freeze():Promise<Table>;
670
+ snapshot(baseTable:Table, doInitialSnapshot?:boolean, stampColumns?:string[]):Promise<Table>;
671
+ /**
672
+ * Joins this table to the provided table, using one of the specified join types:
673
+ * <ul>
674
+ * <li><code>AJ</code>, <code>ReverseAJ</code> (or <code>RAJ</code>) - inexact timeseries joins, based on the
675
+ * provided matching rule.</li>
676
+ * <li><code>CROSS_JOIN</code> (or <code>Join</code>) - cross join of all rows that have matching values in both
677
+ * tables.</li>
678
+ * <li><code>EXACT_JOIN</code> (or <code>ExactJoin</code> - matches values in exactly one row in the right table,
679
+ * with errors if there is not exactly one.</li>
680
+ * <li><code>NATURAL_JOIN</code> (or <code>Natural</code> - matches values in at most one row in the right table,
681
+ * with nulls if there is no match or errors if there are multiple matches.</li>
682
+ * </ul>
683
+ *
684
+ * Note that <code>Left</code> join is not supported here, unlike DHE.
685
+ * <p>
686
+ * See the <a href="https://deephaven.io/core/docs/conceptual/choose-joins/">Choose a join method</a> document for
687
+ * more guidance on picking a join operation.
688
+ * @deprecated Instead, call the specific method for the join type.
689
+ * @param joinType - The type of join to perform, see the list above.
690
+ * @param rightTable - The table to match to values in this table
691
+ * @param columnsToMatch - Columns that should match
692
+ * @param columnsToAdd - Columns from the right table to add to the result - empty/null/absent to add all columns
693
+ * @param asOfMatchRule - If joinType is AJ/RAJ/ReverseAJ, the match rule to use
694
+ * @return a promise that will resolve to the joined table
695
+ */
696
+ join(joinType:string, rightTable:JoinableTable, columnsToMatch:Array<string>, columnsToAdd?:Array<string>|undefined|null, asOfMatchRule?:string|undefined|null):Promise<Table>;
697
+ /**
698
+ * Performs an inexact timeseries join, where rows in this table will have columns added from the closest matching
699
+ * row from the right table.
700
+ * <p>
701
+ * The `asOfMatchRule` value can be one of:
702
+ * <ul>
703
+ * <li>LESS_THAN_EQUAL</li>
704
+ * <li>LESS_THAN</li>
705
+ * <li>GREATER_THAN_EQUAL</li>
706
+ * <li>GREATER_THAN</li>
707
+ * </ul>
708
+ * @param rightTable - the table to match to values in this table
709
+ * @param columnsToMatch - the columns that should match, according to the asOfMatchRole
710
+ * @param columnsToAdd - columns from the right table to add to the resulting table, empty/null/absent to add all
711
+ * columns
712
+ * @param asOfMatchRule - the match rule to use, see above
713
+ * @return a promise that will resolve to the joined table
714
+ */
715
+ asOfJoin(rightTable:JoinableTable, columnsToMatch:Array<string>, columnsToAdd?:Array<string>|undefined|null, asOfMatchRule?:string|undefined|null):Promise<Table>;
716
+ /**
717
+ * a promise that will be resolved with the newly created table holding the results of the specified cross join
718
+ * operation. The <b>columnsToAdd</b> parameter is optional, not specifying it will result in all columns from the
719
+ * right table being added to the output. The <b>reserveBits</b> optional parameter lets the client control how the
720
+ * key space is distributed between the rows in the two tables, see the Java <b>Table</b> class for details.
721
+ * @param rightTable - the table to match to values in this table
722
+ * @param columnsToMatch - the columns that should match exactly
723
+ * @param columnsToAdd - columns from the right table to add to the resulting table, empty/null/absent to add all
724
+ * columns
725
+ * @param reserveBits - the number of bits of key-space to initially reserve per group, null/absent will let the
726
+ * server select a value
727
+ * @return a promise that will resolve to the joined table
728
+ */
729
+ crossJoin(rightTable:JoinableTable, columnsToMatch:Array<string>, columnsToAdd?:Array<string>|undefined|null, reserveBits?:number|undefined|null):Promise<Table>;
730
+ /**
731
+ * a promise that will be resolved with the newly created table holding the results of the specified exact join
732
+ * operation. The `columnsToAdd` parameter is optional, not specifying it will result in all columns from the right
733
+ * table being added to the output.
734
+ * @param rightTable - the table to match to values in this table
735
+ * @param columnsToMatch - the columns that should match exactly
736
+ * @param columnsToAdd - columns from the right table to add to the resulting table, empty/null/absent to add all
737
+ * columns
738
+ * @return a promise that will resolve to the joined table
739
+ */
740
+ exactJoin(rightTable:JoinableTable, columnsToMatch:Array<string>, columnsToAdd?:Array<string>|undefined|null):Promise<Table>;
741
+ /**
742
+ * a promise that will be resolved with the newly created table holding the results of the specified natural join
743
+ * operation. The <b>columnsToAdd</b> parameter is optional, not specifying it will result in all columns from the
744
+ * right table being added to the output.
745
+ * @param rightTable - the table to match to values in this table
746
+ * @param columnsToMatch - the columns that should match exactly
747
+ * @param columnsToAdd - columns from the right table to add to the resulting table, empty/null/absent to add all
748
+ * columns
749
+ * @return a promise that will resolve to the joined table
750
+ */
751
+ naturalJoin(rightTable:JoinableTable, columnsToMatch:Array<string>, columnsToAdd?:Array<string>|undefined|null):Promise<Table>;
752
+ }
502
753
  /**
503
754
  * Represents a server-side object that may not yet have been fetched by the client. When this object will no longer be
504
755
  * used, if {@link fetch} is not called on this object, then {@link close} must be to ensure server-side resources
@@ -531,403 +782,421 @@ export namespace dh {
531
782
  */
532
783
  close():void;
533
784
  }
785
+ export interface LayoutHints {
786
+ readonly searchDisplayMode?:SearchDisplayModeType|null;
787
+
788
+ get hiddenColumns():string[]|null;
789
+ get frozenColumns():string[]|null;
790
+ get columnGroups():ColumnGroup[]|null;
791
+ get areSavedLayoutsAllowed():boolean;
792
+ get frontColumns():string[]|null;
793
+ get backColumns():string[]|null;
794
+ }
795
+
534
796
  /**
535
- * Options for requesting a viewport subscription to a table.
797
+ * Describes a Sort present on the table. No visible constructor, created through the use of Column.sort(), will be tied
798
+ * to that particular column data. Sort instances are immutable, and use a builder pattern to make modifications. All
799
+ * methods return a new Sort instance.
536
800
  */
537
- export interface ViewportSubscriptionOptions extends SubscriptionOptions {
801
+ export class Sort {
802
+ static readonly ASCENDING:string;
803
+ static readonly DESCENDING:string;
804
+ static readonly REVERSE:string;
805
+
806
+ protected constructor();
807
+
538
808
  /**
539
- * If true, the viewport will be filled starting from the end of the table, where 0 is the last row of the
540
- * table. Default is false.
809
+ * Builds a Sort instance to sort values in ascending order.
810
+ * @return {@link dh.Sort}
541
811
  */
542
- isReverseViewport?:boolean|null;
812
+ asc():Sort;
543
813
  /**
544
- * The rows to include in the viewport. This can be either a {@link dh.RangeSet} or a single range with
545
- * `first` and `last` properties.
814
+ * Builds a Sort instance to sort values in descending order.
815
+ * @return {@link dh.Sort}
546
816
  */
547
- rows:RangeSet|SimpleRange;
548
- }
549
- export interface ColumnGroup {
550
- get name():string|null;
551
- get children():string[]|null;
552
- get color():string|null;
553
- }
554
- /**
555
- * Simple range consisting only of start and end numbers. Will be migrated to deephaven-core in the near future, and
556
- * subsequently removed from this the coreplus namespace.
557
- */
558
- export interface SimpleRange {
559
- first:number;
560
- last:number;
561
- }
562
- /**
563
- * Represents statistics for a given table column.
564
- */
565
- export interface ColumnStatistics {
566
- /**
567
- * Gets the type of formatting that should be used for given statistic.
568
- * <p>
569
- * the format type for a statistic. A null return value means that the column formatting should be used.
570
- * @param name - the display name of the statistic
571
- * @return String
572
- */
573
- getType(name:string):string;
817
+ desc():Sort;
574
818
  /**
575
- * 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
576
- * name to the count of how many times it occurred in the column. This map will be empty for tables containing more
577
- * than 19 unique values.
578
- * @return Map of String double
819
+ * Builds a Sort instance which takes the absolute value before applying order.
820
+ * @return {@link dh.Sort}
579
821
  */
580
- get uniqueValues():Map<string, number>;
822
+ abs():Sort;
823
+ toString():string;
581
824
  /**
582
- * Gets a map with the display name of statistics as keys and the numeric stat as a value.
583
- * <p>
584
- * A map of each statistic's name to its value.
585
- * @return Map of String and Object
825
+ * True if the absolute value of the column should be used when sorting; defaults to false.
826
+ * @return boolean
586
827
  */
587
- get statisticsMap():Map<string, object>;
588
- }
589
- /**
590
- * Options for requesting a snapshot of a table.
591
- */
592
- export interface SnapshotOptions extends DataOptions {
828
+ get isAbs():boolean;
593
829
  /**
594
- * If true, the snapshot will be filled starting from the end of the table, where 0 is the last row of the
595
- * table. Default is false.
830
+ * The column which is sorted.
831
+ * @return {@link dh.Column}
596
832
  */
597
- isReverseViewport?:boolean|null;
833
+ get column():Column;
598
834
  /**
599
- * The rows to include in the snapshot. This can be either a {@link dh.RangeSet} or a single range with
600
- * `first` and `last` properties.
835
+ * The direction of this sort, either <b>ASC</b>, <b>DESC</b>, or <b>REVERSE</b>.
836
+ * @return String
601
837
  */
602
- rows:RangeSet|SimpleRange;
838
+ get direction():string;
603
839
  }
840
+
604
841
  /**
605
- * Represents the contents of a single widget data message from the server, with a binary data paylod and exported
606
- * objects. Implemented both by Widget itself and by the `event.details` when data is received by the client.
607
- *
608
- * Terminology note: the name of this type should probably use "Data" instead of "Message", and the methods should use
609
- * "payload" rather than "data" to match other platforms and the protobuf itself. These names are instead used for
610
- * backwards compatibility and to better follow JS expectations.
842
+ * Addition optional configuration that can be passed to the {@link dh.CoreClient} constructor.
611
843
  */
612
- export interface WidgetMessageDetails {
844
+ export class ConnectOptions {
613
845
  /**
614
- * Returns the data from this message as a base64-encoded string.
846
+ * Optional map of http header names and values to send to the server with each request.
615
847
  */
616
- getDataAsBase64():string;
848
+ headers?:{ [key: string]: string; }|null;
617
849
  /**
618
- * Returns the data from this message as a Uint8Array.
850
+ * True to enable debug logging. At this time, only enables logging for gRPC calls.
619
851
  */
620
- getDataAsU8():Uint8Array;
852
+ debug?:boolean|null;
621
853
  /**
622
- * Returns the data from this message as a utf-8 string.
854
+ * Set this to true to force the use of websockets when connecting to the deephaven instance, false to force the use
855
+ * of `fetch`. Ignored if {@link dh.transportFactory} is set.
856
+ * <p>
857
+ * Defaults to null, indicating that the server URL should be checked to see if we connect with fetch or websockets.
623
858
  */
624
- getDataAsString():string;
859
+ useWebsockets?:boolean|null;
625
860
  /**
626
- * Returns an array of exported objects sent from the server. The plugin implementation is now responsible for these
627
- * objects, and should close them when no longer needed.
861
+ * The transport factory to use for creating gRPC streams. If specified, the JS API will ignore
862
+ * {@link dh.useWebsockets} and its own internal logic for determining the appropriate transport to use.
863
+ * <p>
864
+ * Defaults to null, indicating that the JS API should determine the appropriate transport to use. If
865
+ * `useWebsockets` is set to true, the JS API will use websockets, otherwise if the server url begins with
866
+ * https, it will use fetch, otherwise it will use websockets.
628
867
  */
629
- get exportedObjects():WidgetExportedObject[];
868
+ transportFactory?:dh.grpc.GrpcTransportFactory|null;
869
+
870
+ constructor();
630
871
  }
631
- /**
632
- * Represents a row available in a subscription/snapshot on the client. Do not retain references to rows - they will
633
- * not function properly when the event isn't actively going off (or promise resolving). Instead, wait for the next
634
- * event, or re-request the viewport data.
635
- */
636
- export interface Row {
637
- get(column:Column):any;
638
- getFormat(column:Column):Format;
639
- get index():LongWrapper;
872
+
873
+ export class DateWrapper extends LongWrapper {
874
+ protected constructor();
875
+
876
+ static ofJsDate(date:Date):DateWrapper;
877
+ asDate():Date;
640
878
  }
879
+
641
880
  /**
642
- * Behaves like a Table, but doesn't expose all of its API for changing the internal state. Instead, state is driven by
643
- * the upstream table - when it changes handle, this listens and updates its own handle accordingly.
644
- *
645
- * Additionally, this is automatically subscribed to its one and only row, across all columns.
646
- *
647
- * A new config is returned any time it is accessed, to prevent accidental mutation, and to allow it to be used as a
648
- * template when fetching a new totals table, or changing the totals table in use.
649
- *
650
- * A simplistic Table, providing access to aggregation of the table it is sourced from. This table is always
651
- * automatically subscribed to its parent, and adopts changes automatically from it. This class has limited methods
652
- * found on Table. Instances of this type always have a size of one when no groupBy is set on the config, but may
653
- * potentially contain as few as zero rows, or as many as the parent table if each row gets its own group.
654
- *
655
- * When using the `groupBy` feature, it may be desireable to also provide a row to the user with all values across all
656
- * rows. To achieve this, request the same Totals Table again, but remove the `groupBy` setting.
881
+ * Presently, this is the entrypoint into the Deephaven JS API. By creating an instance of this with the server URL and
882
+ * some options, JS applications can run code on the server, and interact with available exportable objects.
657
883
  */
658
- export interface TotalsTable extends JoinableTable {
884
+ export class IdeConnection implements HasEventHandling {
659
885
  /**
660
- * Specifies the range of items to pass to the client and update as they change. If the columns parameter is not
661
- * provided, all columns will be used. Until this is called, no data will be available. Invoking this will result in
662
- * events to be fired once data becomes available, starting with an <b>updated</b> event and one <b>rowadded</b>
663
- * event per row in that range.
664
- * @param firstRow -
665
- * @param lastRow -
666
- * @param columns -
667
- * @param updateIntervalMs -
668
- * @deprecated Use {@link #createViewportSubscription(Object)} instead.
886
+ * @deprecated
669
887
  */
670
- setViewport(firstRow:number, lastRow:number, columns?:Array<Column>, updateIntervalMs?:number, isReverseViewport?:boolean|undefined|null):void;
888
+ static readonly HACK_CONNECTION_FAILURE:string;
889
+ static readonly EVENT_DISCONNECT:string;
890
+ static readonly EVENT_RECONNECT:string;
891
+ static readonly EVENT_SHUTDOWN:string;
892
+
893
+ protected constructor();
894
+
671
895
  /**
672
- * the currently visible viewport. If the current set of operations has not yet resulted in data, it will not
673
- * resolve until that data is ready.
674
- * @return Promise of {@link dh.TableData}
675
- * @deprecated use {@link TableViewportSubscription#getViewportData()} on the result from
676
- * {@link #createViewportSubscription(Object)} instead.
896
+ * Closes the current connection, releasing any resources on the server or client.
677
897
  */
678
- getViewportData():Promise<ViewportData>;
898
+ close():void;
899
+ running():Promise<IdeConnection>;
679
900
  /**
680
- * Creates a subscription to this table, with the given options. See {@link Table.createSubscription} for
681
- * more information.
682
- * @param options - options for the subscription; see {@link dh.SubscriptionOptions} for details
683
- * @return a new {@link dh.TableSubscription}
901
+ * Load the named table, with columns and size information already fully populated.
902
+ * @param name - the name of the table to fetch
903
+ * @param applyPreviewColumns - false to disable previews, defaults to true
904
+ * @return a {@link Promise} that will resolve to the table, or reject with an error if it cannot be loaded.
905
+ * @deprecated Added to resolve a specific issue, in the future preview will be applied as part of the subscription.
684
906
  */
685
- createSubscription(options:object):TableSubscription;
907
+ getTable(name:string, applyPreviewColumns?:boolean):Promise<Table>;
908
+ getObject(definitionObject:dh.ide.VariableDescriptor):Promise<any>;
909
+ subscribeToFieldUpdates(callback:(arg0:dh.ide.VariableChanges)=>void):()=>void;
686
910
  /**
687
- * Creates a viewport subscription to this table, with the given options. See
688
- * {@link Table.createViewportSubscription} for more information.
689
- * @param options - options for the viewport subscription; see {@link dh.ViewportSubscriptionOptions} for
690
- * details
691
- * @return a new {@link dh.TableViewportSubscription}
911
+ * Makes an `object` available to another user or another client on this same server which knows the value of
912
+ * the `sharedTicketBytes`. Use that sharedTicketBytes value like a one-time use password - any other client
913
+ * which knows this value can read the same object.
914
+ * <p>
915
+ * Shared objects will remain available using the sharedTicketBytes until the client that first shared them
916
+ * releases/closes their copy of the object. Whatever side-channel is used to share the bytes, be sure to wait until
917
+ * the remote end has signaled that it has successfully fetched the object before releasing it from this client.
918
+ * <p>
919
+ * Be sure to use an unpredictable value for the shared ticket bytes, like a UUID or other large, random value to
920
+ * prevent access by unauthorized clients.
921
+ * @param object - the object to share with another client/user
922
+ * @param sharedTicketBytes - the value which another client/user must know to obtain the object. It may be a unicode
923
+ * string (will be encoded as utf8 bytes), or a {@link Uint8Array} value.
924
+ * @return A promise that will resolve to the value passed as sharedTicketBytes when the object is ready to be read
925
+ * by another client, or will reject if an error occurs.
692
926
  */
693
- createViewportSubscription(options:object):TableViewportSubscription;
927
+ shareObject(object:Table|Widget|WidgetExportedObject|PartitionedTable|TotalsTable|TreeTable, sharedTicketBytes:string|Uint8Array):Promise<string|Uint8Array>;
694
928
  /**
695
- * Creates a snapshot of this table on the server, with the given options. See
696
- * {@link Table.createSnapshot} for more information.
697
- * @param options - options for the snapshot; see {@link dh.SnapshotOptions} for details
698
- * @return Promise of {@link dh.TableData}
929
+ * Reads an object shared by another client to this server with the `sharedTicketBytes`. Until the other
930
+ * client releases this object (or their session ends), the object will be available on the server.
931
+ * <p>
932
+ * The type of the object must be passed so that the object can be read from the server correct - the other client
933
+ * should provide this information.
934
+ * @param sharedTicketBytes - the value provided by another client/user to obtain the object. It may be a unicode
935
+ * string (will be encoded as utf8 bytes), or a {@link Uint8Array} value.
936
+ * @param type - The type of the object, so it can be correctly read from the server
937
+ * @return A promise that will resolve to the shared object, or will reject with an error if it cannot be read.
699
938
  */
700
- createSnapshot(options:object):Promise<TableData>;
939
+ getSharedObject(sharedTicketBytes:string|Uint8Array, type:string):Promise<any>;
940
+ newTable(columnNames:string[], types:string[], data:string[][], userTimeZone:string):Promise<Table>;
701
941
  /**
702
- * a column by the given name. You should prefer to always retrieve a new Column instance instead of caching a
703
- * returned value.
704
- * @param key -
705
- * @return {@link dh.Column}
942
+ * Merges the given tables into a single table. Assumes all tables have the same structure.
943
+ * @param tables -
944
+ * @return {@link Promise} of {@link dh.Table}
706
945
  */
707
- findColumn(key:string):Column;
946
+ mergeTables(tables:Table[]):Promise<Table>;
708
947
  /**
709
- * multiple columns specified by the given names.
710
- * @param keys -
711
- * @return {@link dh.Column} array
948
+ * Register a callback function to handle any log messages that are emitted on the server. Returns a function ,
949
+ * which can be invoked to remove this log handler. Any log handler registered in this way will receive as many old
950
+ * log messages as are presently available.
951
+ * @param callback -
952
+ * @return {@link io.deephaven.web.shared.fu.JsRunnable}
712
953
  */
713
- findColumns(keys:string[]):Column[];
954
+ onLogMessage(callback:(arg0:dh.ide.LogItem)=>void):()=>void;
955
+ startSession(type:string):Promise<IdeSession>;
956
+ getConsoleTypes():Promise<Array<string>>;
957
+ getWorkerHeapInfo():Promise<WorkerHeapInfo>;
714
958
  /**
715
- * Indicates that the table will no longer be used, and resources used to provide it can be freed up on the server.
959
+ * Listen for events on this object.
960
+ * @param name - the name of the event to listen for
961
+ * @param callback - a function to call when the event occurs
962
+ * @return Returns a cleanup function.
963
+ * @typeParam T - the type of the data that the event will provide
716
964
  */
717
- close():void;
718
965
  addEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):()=>void;
719
- removeEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):boolean;
720
- nextEvent<T>(eventName:string, timeoutInMillis:number):Promise<Event<T>>;
966
+ nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<Event<T>>;
721
967
  hasListeners(name:string):boolean;
722
968
  /**
723
- * Replace the currently set sort on this table. Returns the previously set value. Note that the sort property will
724
- * immediately return the new value, but you may receive update events using the old sort before the new sort is
725
- * applied, and the <b>sortchanged</b> event fires. Reusing existing, applied sorts may enable this to perform
726
- * better on the server. The <b>updated</b> event will also fire, but <b>rowadded</b> and <b>rowremoved</b> will
727
- * not.
728
- * @param sort -
729
- * @return {@link dh.Sort} array
969
+ * Removes an event listener added to this table.
970
+ * @param name -
971
+ * @param callback -
972
+ * @return
973
+ * @typeParam T -
730
974
  */
731
- applySort(sort:Sort[]):Array<Sort>;
732
- /**
733
- * Replace the current custom columns with a new set. These columns can be used when adding new filter and sort
734
- * operations to the table, as long as they are present.
735
- * @param customColumns -
736
- * @return
737
- */
738
- applyCustomColumns(customColumns:Array<string|CustomColumn>):Array<CustomColumn>;
739
- /**
740
- * Replace the currently set filters on the table. Returns the previously set value. Note that the filter property
741
- * will immediately return the new value, but you may receive update events using the old filter before the new one
742
- * is applied, and the <b>filterchanged</b> event fires. Reusing existing, applied filters may enable this to
743
- * perform better on the server. The <b>updated</b> event will also fire, but <b>rowadded</b> and <b>rowremoved</b>
744
- * will not.
745
- * @param filter -
746
- * @return {@link dh.FilterCondition} array
747
- */
748
- applyFilter(filter:FilterCondition[]):Array<FilterCondition>;
749
- /**
750
- * An ordered list of Filters to apply to the table. To update, call applyFilter(). Note that this getter will
751
- * return the new value immediately, even though it may take a little time to update on the server. You may listen
752
- * for the <b>filterchanged</b> event to know when to update the UI.
753
- * @return {@link dh.FilterCondition} array
754
- */
755
- get filter():Array<FilterCondition>;
756
- /**
757
- * True if this table has been closed.
758
- * @return boolean
759
- */
760
- get isClosed():boolean;
761
- /**
762
- * The total number of rows in this table. This may change as the base table's configuration, filter, or contents
763
- * change.
764
- * @return double
765
- */
766
- get size():number;
767
- /**
768
- * The columns present on this table. Note that this may not include all columns in the parent table, and in cases
769
- * where a given column has more than one aggregation applied, the column name will have a suffix indicating the
770
- * aggregation used. This suffixed name will be of the form <b>columnName + '__' + aggregationName</b>.
771
- * @return {@link dh.Column} array
772
- */
773
- get columns():Array<Column>;
774
- get totalsTableConfig():TotalsTableConfig;
775
- /**
776
- * An ordered list of Sorts to apply to the table. To update, call applySort(). Note that this getter will return
777
- * the new value immediately, even though it may take a little time to update on the server. You may listen for the
778
- * <b>sortchanged</b> event to know when to update the UI.
779
- * @return {@link dh.Sort} array
780
- */
781
- get sort():Array<Sort>;
782
- /**
783
- * Read-only. An ordered list of custom column formulas to add to the table, either adding new columns or replacing
784
- * existing ones. To update, call <b>applyCustomColumns()</b>.
785
- * @return {@link dh.CustomColumn} array
786
- */
787
- get customColumns():Array<CustomColumn>;
975
+ removeEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):boolean;
976
+ }
977
+
978
+ export class CoreClient implements HasEventHandling {
979
+ static readonly EVENT_CONNECT:string;
980
+ static readonly EVENT_DISCONNECT:string;
981
+ static readonly EVENT_RECONNECT:string;
982
+ static readonly EVENT_RECONNECT_AUTH_FAILED:string;
983
+ static readonly EVENT_REQUEST_FAILED:string;
984
+ static readonly EVENT_REQUEST_STARTED:string;
985
+ static readonly EVENT_REQUEST_SUCCEEDED:string;
788
986
  /**
789
- * True if this table may receive updates from the server, including size changed events, updated events after
790
- * initial snapshot.
791
- * @return boolean
987
+ * @deprecated
792
988
  */
793
- get isRefreshing():boolean;
989
+ static readonly EVENT_REFRESH_TOKEN_UPDATED:string;
990
+ static readonly LOGIN_TYPE_PASSWORD:string;
991
+ static readonly LOGIN_TYPE_ANONYMOUS:string;
992
+
993
+ constructor(serverUrl:string, connectOptions?:ConnectOptions);
994
+
995
+ running():Promise<CoreClient>;
996
+ getServerUrl():string;
997
+ getAuthConfigValues():Promise<string[][]>;
998
+ login(credentials:LoginCredentials):Promise<void>;
999
+ relogin(token:RefreshToken):Promise<void>;
1000
+ onConnected(timeoutInMillis?:number):Promise<void>;
1001
+ getServerConfigValues():Promise<string[][]>;
1002
+ getStorageService():dh.storage.StorageService;
1003
+ getAsIdeConnection():Promise<IdeConnection>;
1004
+ disconnect():void;
1005
+ addEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):()=>void;
1006
+ nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<Event<T>>;
1007
+ hasListeners(name:string):boolean;
1008
+ removeEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):boolean;
794
1009
  }
795
1010
 
796
1011
  /**
797
- * Describes the structure of the column, and if desired can be used to get access to the data to be rendered in this
798
- * column.
1012
+ * A js type for operating on input tables.
1013
+ *
1014
+ * Represents a User Input Table, which can have data added to it from other sources.
1015
+ *
1016
+ * You may add rows using dictionaries of key-value tuples (representing columns by name), add tables containing all the
1017
+ * key/value columns to add, or delete tables containing the keys to delete. Each operation is atomic, and will either
1018
+ * succeed completely or fail completely. To guarantee order of operations, apply an operation and wait for the response
1019
+ * before sending the next operation.
1020
+ *
1021
+ * Each table has one or more key columns, where each unique combination of keys will appear at most once in the table.
1022
+ *
1023
+ * To view the results of the Input Table, you should use standard table operations on the InputTable's source Table
1024
+ * object.
799
1025
  */
800
- export class Column {
801
- /**
802
- * If this column is part of a roll-up tree table, represents the type of the row data that can be found in this
803
- * column for leaf nodes if includeConstituents is enabled. Otherwise, it is <b>null</b>.
804
- * @return String
805
- */
806
- readonly constituentType?:string|null;
807
- readonly description?:string|null;
808
-
1026
+ export class InputTable {
809
1027
  protected constructor();
810
1028
 
811
1029
  /**
812
- * the value for this column in the given row. Type will be consistent with the type of the Column.
1030
+ * Adds a single row to the table. For each key or value column name in the Input Table, we retrieve that javascript
1031
+ * property at that name and validate it can be put into the given column type.
813
1032
  * @param row -
814
- * @return Any
815
- */
816
- get(row:Row):any;
817
- getFormat(row:Row):Format;
818
- /**
819
- * Creates a sort builder object, to be used when sorting by this column.
820
- * @return {@link dh.Sort}
1033
+ * @param userTimeZone -
1034
+ * @return Promise of dh.InputTable
821
1035
  */
822
- sort():Sort;
1036
+ addRow(row:{ [key: string]: any; }, userTimeZone?:string):Promise<InputTable>;
823
1037
  /**
824
- * Creates a new value for use in filters based on this column. Used either as a parameter to another filter
825
- * operation, or as a builder to create a filter operation.
826
- * @return {@link dh.FilterValue}
1038
+ * Add multiple rows to a table.
1039
+ * @param rows -
1040
+ * @param userTimeZone -
1041
+ * @return Promise of dh.InputTable
827
1042
  */
828
- filter():FilterValue;
1043
+ addRows(rows:{ [key: string]: any; }[], userTimeZone?:string):Promise<InputTable>;
829
1044
  /**
830
- * a <b>CustomColumn</b> object to apply using `applyCustomColumns` with the expression specified.
831
- * @param expression -
832
- * @return {@link dh.CustomColumn}
1045
+ * Add an entire table to this Input Table. Only column names that match the definition of the input table will be
1046
+ * copied, and all key columns must have values filled in. This only copies the current state of the source table;
1047
+ * future updates to the source table will not be reflected in the Input Table. The returned promise will be
1048
+ * resolved to the same InputTable instance this method was called upon once the server returns.
1049
+ * @param tableToAdd -
1050
+ * @return Promise of dh.InputTable
833
1051
  */
834
- formatColor(expression:string, options?:CustomColumnOptions|undefined|null):CustomColumn;
1052
+ addTable(tableToAdd:Table):Promise<InputTable>;
835
1053
  /**
836
- * a <b>CustomColumn</b> object to apply using <b>applyCustomColumns</b> with the expression specified.
837
- * @param expression -
838
- * @return {@link dh.CustomColumn}
1054
+ * Add multiple tables to this Input Table.
1055
+ * @param tablesToAdd -
1056
+ * @return Promise of dh.InputTable
839
1057
  */
840
- formatNumber(expression:string, options?:CustomColumnOptions|undefined|null):CustomColumn;
1058
+ addTables(tablesToAdd:Table[]):Promise<InputTable>;
841
1059
  /**
842
- * a <b>CustomColumn</b> object to apply using <b>applyCustomColumns</b> with the expression specified.
843
- * @param expression -
844
- * @return {@link dh.CustomColumn}
1060
+ * Deletes an entire table from this Input Table. Key columns must match the Input Table.
1061
+ * @param tableToDelete -
1062
+ * @return Promise of dh.InputTable
845
1063
  */
846
- formatDate(expression:string, options?:CustomColumnOptions|undefined|null):CustomColumn;
847
- toString():string;
1064
+ deleteTable(tableToDelete:Table):Promise<InputTable>;
848
1065
  /**
849
- * Label for this column.
850
- * @return String
1066
+ * Delete multiple tables from this Input Table.
1067
+ * @param tablesToDelete -
1068
+ * @return
851
1069
  */
852
- get name():string;
1070
+ deleteTables(tablesToDelete:Table[]):Promise<InputTable>;
853
1071
  /**
854
- * True if this column is a partition column. Partition columns are used for filtering uncoalesced tables - see
855
- * {@link Table.uncoalesced}.
856
- * @return true if the column is a partition column
1072
+ * A list of the key columns, by name
1073
+ * @return String array.
857
1074
  */
858
- get isPartitionColumn():boolean;
1075
+ get keys():string[];
859
1076
  /**
860
- *
861
- * @deprecated do not use. Internal index of the column in the table, to be used as a key on the Row.
862
- * @return int
1077
+ * A list of the value columns, by name
1078
+ * @return String array.
863
1079
  */
864
- get index():number;
865
- get isSortable():boolean;
1080
+ get values():string[];
866
1081
  /**
867
- * Type of the row data that can be found in this column.
868
- * @return String
1082
+ * A list of the key columns.
1083
+ * @return Column array.
869
1084
  */
870
- get type():string;
1085
+ get keyColumns():Column[];
871
1086
  /**
872
- * Format entire rows colors using the expression specified. Returns a <b>CustomColumn</b> object to apply to a
873
- * table using <b>applyCustomColumns</b> with the parameters specified.
874
- * @param expression -
875
- * @param options -
876
- * @return {@link dh.CustomColumn}
1087
+ * A list of the value Column objects
1088
+ * @return {@link dh.Column} array.
877
1089
  */
878
- static formatRowColor(expression:string, options?:CustomColumnOptions|undefined|null):CustomColumn;
1090
+ get valueColumns():Column[];
879
1091
  /**
880
- * a <b>CustomColumn</b> object to apply using <b>applyCustomColumns</b> with the expression specified.
881
- * @param name -
882
- * @param expression -
883
- * @param options -
884
- * @return {@link dh.CustomColumn}
1092
+ * The source table for this Input Table
1093
+ * @return dh.table
885
1094
  */
886
- static createCustomColumn(name:string, expression:string, options?:CustomColumnOptions|undefined|null):CustomColumn;
1095
+ get table():Table;
887
1096
  }
888
1097
 
889
1098
  /**
890
- * Describes a grouping and aggregations for a roll-up table. Pass to the <b>Table.rollup</b> function to create a
891
- * roll-up table.
1099
+ * Describes a filter which can be applied to a table. Replacing these instances may be more expensive than reusing
1100
+ * them. These instances are immutable - all operations that compose them to build bigger expressions return a new
1101
+ * instance.
892
1102
  */
893
- export class RollupConfig {
1103
+ export class FilterCondition {
1104
+ protected constructor();
1105
+
894
1106
  /**
895
- * Ordered list of columns to group by to form the hierarchy of the resulting roll-up table.
1107
+ * the opposite of this condition
1108
+ * @return FilterCondition
896
1109
  */
897
- groupingColumns:Array<String>;
1110
+ not():FilterCondition;
898
1111
  /**
899
- * Mapping from each aggregation name to the ordered list of columns it should be applied to in the resulting
900
- * roll-up table.
1112
+ * a condition representing the current condition logically ANDed with the other parameters
1113
+ * @param filters -
1114
+ * @return FilterCondition
901
1115
  */
902
- aggregations:{ [key: string]: Array<string>; };
1116
+ and(...filters:FilterCondition[]):FilterCondition;
903
1117
  /**
904
- * Optional parameter indicating if an extra leaf node should be added at the bottom of the hierarchy, showing the
905
- * rows in the underlying table which make up that grouping. Since these values might be a different type from the
906
- * rest of the column, any client code must check if TreeRow.hasChildren = false, and if so, interpret those values
907
- * as if they were Column.constituentType instead of Column.type. Defaults to false.
1118
+ * a condition representing the current condition logically ORed with the other parameters
1119
+ * @param filters -
1120
+ * @return FilterCondition.
908
1121
  */
909
- includeConstituents:boolean;
910
- includeOriginalColumns?:boolean|null;
1122
+ or(...filters:FilterCondition[]):FilterCondition;
911
1123
  /**
912
- * Optional parameter indicating if original column descriptions should be included. Defaults to true.
1124
+ * a string suitable for debugging showing the details of this condition.
1125
+ * @return String.
913
1126
  */
914
- includeDescriptions:boolean;
915
-
916
- constructor();
917
- }
918
-
919
- /**
920
- * Exists to keep the dh.TableMap namespace so that the web UI can remain compatible with the DHE API, which still calls
921
- * this type TableMap.
922
- * @deprecated
923
- */
924
- export class TableMap {
925
- static readonly EVENT_KEYADDED:string;
1127
+ toString():string;
1128
+ get columns():Array<Column>;
1129
+ /**
1130
+ * a filter condition invoking a static function with the given parameters. Currently supported Deephaven static
1131
+ * functions:
1132
+ * <ul>
1133
+ * <li><b>inRange</b>: Given three comparable values, returns true if the first is less than the second but greater
1134
+ * than the third</li>
1135
+ * <li><b>isInf</b>:Returns true if the given number is <i>infinity</i></li>
1136
+ * <li><b>isNaN</b>:Returns true if the given number is <i>not a number</i></li>
1137
+ * <li><b>isNormal</b>:Returns true if the given number <i>is not null</i>, <i>is not infinity</i>, and <i>is not
1138
+ * "not a number"</i></li>
1139
+ * <li><b>startsWith</b>:Returns true if the first string starts with the second string</li>
1140
+ * <li><b>endsWith</b>Returns true if the first string ends with the second string</li>
1141
+ * <li><b>matches</b>:Returns true if the first string argument matches the second string used as a Java regular
1142
+ * expression</li>
1143
+ * <li><b>contains</b>:Returns true if the first string argument contains the second string as a substring</li>
1144
+ * <li><b>in</b>:Returns true if the first string argument can be found in the second array argument.
1145
+ * <p>
1146
+ * Note that the array can only be specified as a column reference at this time - typically the `FilterValue.in`
1147
+ * method should be used in other cases
1148
+ * </p>
1149
+ * </li>
1150
+ * </ul>
1151
+ * @param function -
1152
+ * @param args -
1153
+ * @return dh.FilterCondition
1154
+ */
1155
+ static invoke(func:string, ...args:FilterValue[]):FilterCondition;
1156
+ /**
1157
+ * a filter condition which will check if the given value can be found in any supported column on whatever table
1158
+ * this FilterCondition is passed to. This FilterCondition is somewhat unique in that it need not be given a column
1159
+ * instance, but will adapt to any table. On numeric columns, with a value passed in which can be parsed as a
1160
+ * number, the column will be filtered to numbers which equal, or can be "rounded" effectively to this number. On
1161
+ * String columns, the given value will match any column which contains this string in a case-insensitive search. An
1162
+ * optional second argument can be passed, an array of `FilterValue` from the columns to limit this search to (see
1163
+ * {@link dh.Column.filter}).
1164
+ * @param value -
1165
+ * @param columns -
1166
+ * @return dh.FilterCondition
1167
+ */
1168
+ static search(value:FilterValue, columns?:FilterValue[]):FilterCondition;
1169
+ }
1170
+
1171
+ export class LoginCredentials {
1172
+ type?:string|null;
1173
+ username?:string|null;
1174
+ token?:string|null;
1175
+
1176
+ constructor();
1177
+ }
1178
+
1179
+ export class QueryInfo {
1180
+ static readonly EVENT_TABLE_OPENED:string;
926
1181
  static readonly EVENT_DISCONNECT:string;
927
1182
  static readonly EVENT_RECONNECT:string;
928
- static readonly EVENT_RECONNECTFAILED:string;
1183
+ static readonly EVENT_CONNECT:string;
1184
+
1185
+ protected constructor();
1186
+ }
929
1187
 
1188
+ /**
1189
+ * Wrap BigDecimal values for use in JS. Provides text formatting for display and access to the underlying value.
1190
+ */
1191
+ export class BigDecimalWrapper {
930
1192
  protected constructor();
1193
+
1194
+ static ofString(value:string):BigDecimalWrapper;
1195
+ asNumber():number;
1196
+ valueOf():string;
1197
+ toString():string;
1198
+ equals(o:object):boolean;
1199
+ hashCode():number;
931
1200
  }
932
1201
 
933
1202
  /**
@@ -1022,64 +1291,12 @@ export namespace dh {
1022
1291
  }
1023
1292
 
1024
1293
 
1025
- /**
1026
- * Wrap BigDecimal values for use in JS. Provides text formatting for display and access to the underlying value.
1027
- */
1028
- export class BigDecimalWrapper {
1029
- protected constructor();
1030
-
1031
- static ofString(value:string):BigDecimalWrapper;
1032
- asNumber():number;
1033
- valueOf():string;
1034
- toString():string;
1035
- equals(o:object):boolean;
1036
- hashCode():number;
1037
- }
1038
-
1039
- /**
1040
- * Configuration object for running Table.treeTable to produce a hierarchical view of a given "flat" table.
1041
- *
1042
- * Like TotalsTableConfig, `TreeTableConfig` supports an operation map indicating how to aggregate the data, as well as
1043
- * an array of column names which will be the layers in the roll-up tree, grouped at each level. An additional optional
1044
- * value can be provided describing the strategy the engine should use when grouping the rows.
1045
- */
1046
- export class TreeTableConfig {
1047
- /**
1048
- * The column representing the unique ID for each item
1049
- */
1050
- idColumn:string;
1051
- /**
1052
- * The column representing the parent ID for each item
1053
- */
1054
- parentColumn:string;
1055
- /**
1056
- * Optional parameter indicating if items with an invalid parent ID should be promoted to root. Defaults to false.
1057
- */
1058
- promoteOrphansToRoot:boolean;
1059
-
1060
- constructor();
1061
- }
1062
-
1063
- /**
1064
- * Presently, this is the entrypoint into the Deephaven JS API. By creating an instance of this with the server URL and
1065
- * some options, JS applications can run code on the server, and interact with available exportable objects.
1066
- */
1067
- export class IdeConnection implements HasEventHandling {
1068
- /**
1069
- * @deprecated
1070
- */
1071
- static readonly HACK_CONNECTION_FAILURE:string;
1072
- static readonly EVENT_DISCONNECT:string;
1073
- static readonly EVENT_RECONNECT:string;
1074
- static readonly EVENT_SHUTDOWN:string;
1294
+ export class IdeSession implements HasEventHandling {
1295
+ static readonly EVENT_COMMANDSTARTED:string;
1296
+ static readonly EVENT_REQUEST_FAILED:string;
1075
1297
 
1076
1298
  protected constructor();
1077
1299
 
1078
- /**
1079
- * Closes the current connection, releasing any resources on the server or client.
1080
- */
1081
- close():void;
1082
- running():Promise<IdeConnection>;
1083
1300
  /**
1084
1301
  * Load the named table, with columns and size information already fully populated.
1085
1302
  * @param name - the name of the table to fetch
@@ -1088,10 +1305,32 @@ export namespace dh {
1088
1305
  * @deprecated Added to resolve a specific issue, in the future preview will be applied as part of the subscription.
1089
1306
  */
1090
1307
  getTable(name:string, applyPreviewColumns?:boolean):Promise<Table>;
1308
+ /**
1309
+ * Load the named Figure, including its tables and tablemaps as needed.
1310
+ * @param name -
1311
+ * @return promise of dh.plot.Figure
1312
+ */
1313
+ getFigure(name:string):Promise<dh.plot.Figure>;
1314
+ /**
1315
+ * Loads the named tree table or roll-up table, with column data populated. All nodes are collapsed by default, and
1316
+ * size is presently not available until the viewport is first set.
1317
+ * @param name -
1318
+ * @return {@link Promise} of {@link dh.TreeTable}
1319
+ */
1320
+ getTreeTable(name:string):Promise<TreeTable>;
1321
+ getHierarchicalTable(name:string):Promise<TreeTable>;
1322
+ getPartitionedTable(name:string):Promise<PartitionedTable>;
1091
1323
  getObject(definitionObject:dh.ide.VariableDescriptor):Promise<any>;
1092
- subscribeToFieldUpdates(callback:(arg0:dh.ide.VariableChanges)=>void):()=>void;
1324
+ newTable(columnNames:string[], types:string[], data:string[][], userTimeZone:string):Promise<Table>;
1093
1325
  /**
1094
- * Makes an `object` available to another user or another client on this same server which knows the value of
1326
+ * Merges the given tables into a single table. Assumes all tables have the same structure.
1327
+ * @param tables -
1328
+ * @return {@link Promise} of {@link dh.Table}
1329
+ */
1330
+ mergeTables(tables:Table[]):Promise<Table>;
1331
+ bindTableToVariable(table:Table, name:string):Promise<void>;
1332
+ /**
1333
+ * Makes the `object` available to another user or another client on this same server which knows the value of
1095
1334
  * the `sharedTicketBytes`. Use that sharedTicketBytes value like a one-time use password - any other client
1096
1335
  * which knows this value can read the same object.
1097
1336
  * <p>
@@ -1120,496 +1359,112 @@ export namespace dh {
1120
1359
  * @return A promise that will resolve to the shared object, or will reject with an error if it cannot be read.
1121
1360
  */
1122
1361
  getSharedObject(sharedTicketBytes:string|Uint8Array, type:string):Promise<any>;
1123
- newTable(columnNames:string[], types:string[], data:string[][], userTimeZone:string):Promise<Table>;
1124
- /**
1125
- * Merges the given tables into a single table. Assumes all tables have the same structure.
1126
- * @param tables -
1127
- * @return {@link Promise} of {@link dh.Table}
1128
- */
1129
- mergeTables(tables:Table[]):Promise<Table>;
1130
- /**
1131
- * Register a callback function to handle any log messages that are emitted on the server. Returns a function ,
1132
- * which can be invoked to remove this log handler. Any log handler registered in this way will receive as many old
1133
- * log messages as are presently available.
1134
- * @param callback -
1135
- * @return {@link io.deephaven.web.shared.fu.JsRunnable}
1136
- */
1137
- onLogMessage(callback:(arg0:dh.ide.LogItem)=>void):()=>void;
1138
- startSession(type:string):Promise<IdeSession>;
1139
- getConsoleTypes():Promise<Array<string>>;
1140
- getWorkerHeapInfo():Promise<WorkerHeapInfo>;
1141
- /**
1142
- * Listen for events on this object.
1143
- * @param name - the name of the event to listen for
1144
- * @param callback - a function to call when the event occurs
1145
- * @return Returns a cleanup function.
1146
- * @typeParam T - the type of the data that the event will provide
1147
- */
1148
- addEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):()=>void;
1149
- nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<Event<T>>;
1150
- hasListeners(name:string):boolean;
1151
- /**
1152
- * Removes an event listener added to this table.
1153
- * @param name -
1154
- * @param callback -
1155
- * @return
1156
- * @typeParam T -
1157
- */
1158
- removeEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):boolean;
1159
- }
1160
-
1161
- /**
1162
- * Represents a non-viewport subscription to a table, and all data currently known to be present in the subscribed
1163
- * columns. This class handles incoming snapshots and deltas, and fires events to consumers to notify of data changes.
1164
- * <p>
1165
- * Unlike {@link dh.TableViewportSubscription}, the "original" table does not have a reference to this instance, only the
1166
- * "private" table instance does, since the original cannot modify the subscription, and the private instance must
1167
- * forward data to it.
1168
- * <p>
1169
- * Represents a subscription to the table on the server. Changes made to the table will not be reflected here - the
1170
- * subscription must be closed and a new one optioned to see those changes. The event model is slightly different from
1171
- * viewports to make it less expensive to compute for large tables.
1172
- */
1173
- export class TableSubscription implements HasEventHandling {
1174
- protected constructor();
1175
-
1176
- static createTableSubscription(options:SubscriptionOptions, existingTable:Table):TableSubscription;
1177
- /**
1178
- * Updates the subscription to use the given columns and update interval.
1179
- * @param columns - the new columns to subscribe to
1180
- * @param updateIntervalMs - the new update interval, or null/omit to use the default of one second
1181
- */
1182
- changeSubscription(columns:Array<Column>, updateIntervalMs:number|undefined|null):void;
1183
- /**
1184
- * Update the options for this viewport subscription. This cannot alter the update interval or preview options.
1185
- * @param options - the subscription options
1186
- */
1187
- update(options:SubscriptionOptions):void;
1188
- get columns():Array<Column>;
1189
- /**
1190
- * Stops the subscription on the server.
1191
- */
1362
+ subscribeToFieldUpdates(callback:(arg0:dh.ide.VariableChanges)=>void):()=>void;
1192
1363
  close():void;
1364
+ runCode(code:string):Promise<dh.ide.CommandResult>;
1365
+ onLogMessage(callback:(arg0:dh.ide.LogItem)=>void):()=>void;
1366
+ openDocument(params:object):void;
1367
+ changeDocument(params:object):void;
1368
+ getCompletionItems(params:object):Promise<Array<dh.lsp.CompletionItem>>;
1369
+ getSignatureHelp(params:object):Promise<Array<dh.lsp.SignatureInformation>>;
1370
+ getHover(params:object):Promise<dh.lsp.Hover>;
1371
+ closeDocument(params:object):void;
1193
1372
  /**
1194
- * Listen for events on this object.
1195
- * @param name - the name of the event to listen for
1196
- * @param callback - a function to call when the event occurs
1197
- * @return Returns a cleanup function.
1198
- * @typeParam T - the type of the data that the event will provide
1199
- */
1200
- addEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):()=>void;
1201
- nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<Event<T>>;
1202
- hasListeners(name:string):boolean;
1203
- /**
1204
- * Removes an event listener added to this table.
1205
- * @param name -
1206
- * @param callback -
1207
- * @return
1208
- * @typeParam T -
1209
- */
1210
- removeEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):boolean;
1211
- }
1212
-
1213
- /**
1214
- * Behaves like a {@link dh.Table} externally, but data, state, and viewports are managed by an entirely different
1215
- * mechanism, and so reimplemented here.
1216
- * <p>
1217
- * Any time a change is made, we build a new request and send it to the server, and wait for the updated state.
1218
- * <p>
1219
- * Semantics around getting updates from the server are slightly different - we don't "unset" the viewport here after
1220
- * operations are performed, but encourage the client code to re-set them to the desired position.
1221
- * <p>
1222
- * The table size will be -1 until a viewport has been fetched.
1223
- * <p>
1224
- * Similar to a table, a Tree Table provides access to subscribed viewport data on the current hierarchy. A different
1225
- * Row type is used within that viewport, showing the depth of that node within the tree and indicating details about
1226
- * whether it has children or is expanded. The Tree Table itself then provides the ability to change if a row is
1227
- * expanded or not. Methods used to control or check if a row should be expanded or not can be invoked on a TreeRow
1228
- * instance, or on the number of the row (thus allowing for expanding/collapsing rows which are not currently visible in
1229
- * the viewport).
1230
- * <p>
1231
- * Events and viewports are somewhat different from tables, due to the expense of computing the expanded/collapsed rows
1232
- * and count of children at each level of the hierarchy, and differences in the data that is available.
1233
- * <p>
1234
- * <ul>
1235
- * <li>There is no {@link Table.totalSize | totalSize} property.</li>
1236
- * <li>The viewport is not un-set when changes are made to filter or sort, but changes will continue to be streamed in.
1237
- * It is suggested that the viewport be changed to the desired position (usually the first N rows) after any filter/sort
1238
- * change is made. Likewise, {@link getViewportData} will always return the most recent data, and will not wait if a
1239
- * new operation is pending.</li>
1240
- * <li>Custom columns are supported on Rollup tables, but not on Tree tables. If the TreeTable was created client-side,
1241
- * the original Table can have custom columns applied, and the TreeTable can be recreated.</li>
1242
- * <li>Whereas Table has a {@link Table.totalsTableConfig} property, it is defined here as a method,
1243
- * {@link getTotalsTableConfig}. This returns a promise so the config can be fetched asynchronously.</li>
1244
- * <li>Totals Tables for trees vary in behavior between tree tables and roll-up tables. This behavior is based on the
1245
- * original flat table used to produce the Tree Table - for a hierarchical table (i.e. Table.treeTable in the query
1246
- * config), the totals will include non-leaf nodes (since they are themselves actual rows in the table), but in a
1247
- * roll-up table, the totals only include leaf nodes (as non-leaf nodes are generated through grouping the contents of
1248
- * the original table). Roll-ups also have the {@link dh.includeConstituents} property, indicating that a
1249
- * {@link dh.Column} in the tree may have a {@link Column.constituentType} property reflecting that the type of cells
1250
- * where {@link TreeRowImpl.hasChildren} is false will be different from usual.</li>
1251
- * </ul>
1252
- */
1253
- export class TreeTable implements HasEventHandling {
1254
- /**
1255
- * event.detail is the currently visible viewport data based on the active viewport configuration.
1256
- */
1257
- static readonly EVENT_UPDATED:string;
1258
- /**
1259
- * event.detail is the currently visible viewport data based on the active viewport configuration.
1260
- */
1261
- static readonly EVENT_DISCONNECT:string;
1262
- /**
1263
- * event.detail is the currently visible viewport data based on the active viewport configuration.
1264
- */
1265
- static readonly EVENT_RECONNECT:string;
1266
- /**
1267
- * event.detail is the currently visible viewport data based on the active viewport configuration.
1268
- */
1269
- static readonly EVENT_RECONNECTFAILED:string;
1270
- /**
1271
- * event.detail is the currently visible viewport data based on the active viewport configuration.
1272
- */
1273
- static readonly EVENT_REQUEST_FAILED:string;
1274
- readonly description?:string|null;
1275
- readonly layoutHints?:null|LayoutHints;
1276
-
1277
- protected constructor();
1278
-
1279
- /**
1280
- * Expands the given node, so that its children are visible when they are in the viewport. The parameter can be the
1281
- * row index, or the row object itself. The second parameter is a boolean value, false by default, specifying if the
1282
- * row and all descendants should be fully expanded. Equivalent to `setExpanded(row, true)` with an optional third
1283
- * boolean parameter.
1284
- * @param row -
1285
- * @param expandDescendants -
1286
- */
1287
- expand(row:TreeRow|number, expandDescendants?:boolean):void;
1288
- /**
1289
- * Collapses the given node, so that its children and descendants are not visible in the size or the viewport. The
1290
- * parameter can be the row index, or the row object itself. Equivalent to <b>setExpanded(row, false, false)</b>.
1291
- * @param row -
1292
- */
1293
- collapse(row:TreeRow|number):void;
1294
- /**
1295
- * Specifies if the given node should be expanded or collapsed. If this node has children, and the value is changed,
1296
- * the size of the table will change. If node is to be expanded and the third parameter, <b>expandDescendants</b>,
1297
- * is true, then its children will also be expanded.
1298
- * @param row - the row to expand or collapse, either the absolute row index or the row object
1299
- * @param isExpanded - true to expand the row, false to collapse
1300
- * @param expandDescendants - true to expand the row and all descendants, false to expand only the row, defaults to
1301
- * false
1302
- */
1303
- setExpanded(row:TreeRow|number, isExpanded:boolean, expandDescendants?:boolean):void;
1304
- expandAll():void;
1305
- collapseAll():void;
1306
- /**
1307
- * Tests if the specified row is expanded.
1308
- * @param row - the row to test, either the absolute row index or the row object
1309
- * @return boolean true if the row is expanded, false otherwise
1310
- */
1311
- isExpanded(row:TreeRow|number):boolean;
1312
- setViewport(firstRow:number, lastRow:number, columns?:Array<Column>|undefined|null, updateInterval?:number|undefined|null):void;
1313
- getViewportData():Promise<TreeViewportData>;
1314
- /**
1315
- * Indicates that the table will no longer be used, and server resources can be freed.
1316
- */
1317
- close():void;
1318
- /**
1319
- * Applies the given sort to all levels of the tree. Returns the previous sort in use.
1320
- * @param sort -
1321
- * @return {@link dh.Sort} array
1322
- */
1323
- applySort(sort:Sort[]):Array<Sort>;
1324
- /**
1325
- * Applies the given filter to the contents of the tree in such a way that if any node is visible, then any parent
1326
- * node will be visible as well even if that parent node would not normally be visible due to the filter's
1327
- * condition. Returns the previous sort in use.
1328
- * @param filter -
1329
- * @return {@link dh.FilterCondition} array
1330
- */
1331
- applyFilter(filter:FilterCondition[]):Array<FilterCondition>;
1332
- /**
1333
- * Adding new columns to the table based on other columns using updateView() mechanics. Rollup tables are supported
1334
- * but Tree tables will throw an {@link java.lang.UnsupportedOperationException} if this function is called.
1335
- * @param customColumns -
1336
- * @return {@link dh.CustomColumn} array
1337
- */
1338
- applyCustomColumns(customColumns:Array<string|CustomColumn>):Array<CustomColumn>;
1339
- /**
1340
- * a column with the given name, or throws an exception if it cannot be found
1341
- * @param key -
1342
- * @return {@link dh.Column}
1343
- */
1344
- findColumn(key:string):Column;
1345
- /**
1346
- * an array with all of the named columns in order, or throws an exception if one cannot be found.
1347
- * @param keys -
1348
- * @return {@link dh.Column} array
1349
- */
1350
- findColumns(keys:string[]):Column[];
1351
- /**
1352
- * Provides Table-like selectDistinct functionality, but with a few quirks, since it is only fetching the distinct
1353
- * values for the given columns in the source table:
1354
- * <ul>
1355
- * <li>Rollups may make no sense, since values are aggregated.</li>
1356
- * <li>Values found on orphaned (and removed) nodes will show up in the resulting table, even though they are not in
1357
- * the tree.</li>
1358
- * <li>Values found on parent nodes which are only present in the tree since a child is visible will not be present
1359
- * in the resulting table.</li>
1360
- * </ul>
1361
- */
1362
- selectDistinct(columns:Column[]):Promise<Table>;
1363
- getTotalsTableConfig():Promise<TotalsTableConfig>;
1364
- getTotalsTable(config?:object):Promise<TotalsTable>;
1365
- getGrandTotalsTable(config?:object):Promise<TotalsTable>;
1366
- /**
1367
- * a new copy of this treetable, so it can be sorted and filtered separately, and maintain a different viewport.
1368
- * Unlike Table, this will _not_ copy the filter or sort, since tree table viewport semantics differ, and without a
1369
- * viewport set, the treetable doesn't evaluate these settings, and they aren't readable on the properties. Expanded
1370
- * state is also not copied.
1371
- * @return Promise of dh.TreeTable
1372
- */
1373
- copy():Promise<TreeTable>;
1374
- /**
1375
- * Returns the columns that are aggregated.
1376
- * @return array of aggregated columns
1377
- */
1378
- get aggregatedColumns():Array<Column>;
1379
- /**
1380
- * The columns that can be shown in this Tree Table.
1381
- * @return {@link dh.Column} array
1382
- */
1383
- get columns():Array<Column>;
1384
- /**
1385
- * The current sort configuration of this Tree Table
1386
- * @return {@link dh.Sort} array.
1387
- */
1388
- get sort():Array<Sort>;
1389
- /**
1390
- * The current list of custom columns added to this Tree Table.
1391
- * @return {@link dh.CustomColumn} array
1392
- */
1393
- get customColumns():Array<CustomColumn>;
1394
- /**
1395
- * True if this table may receive updates from the server, including size changed events, updated events after
1396
- * initial snapshot.
1397
- * @return boolean
1398
- */
1399
- get isRefreshing():boolean;
1400
- /**
1401
- * The current filter configuration of this Tree Table.
1402
- * @return {@link dh.FilterCondition} array
1403
- */
1404
- get filter():Array<FilterCondition>;
1405
- /**
1406
- * True if this is a roll-up and will provide the original rows that make up each grouping.
1407
- * @return boolean
1408
- */
1409
- get includeConstituents():boolean;
1410
- get groupedColumns():Array<Column>;
1411
- /**
1412
- * True if this table has been closed.
1413
- * @return boolean
1414
- */
1415
- get isClosed():boolean;
1416
- /**
1417
- * The current number of rows given the table's contents and the various expand/collapse states of each node. (No
1418
- * totalSize is provided at this time; its definition becomes unclear between roll-up and tree tables, especially
1419
- * when considering collapse/expand states).
1420
- * @return double
1421
- */
1422
- get size():number;
1423
- /**
1424
- * Listen for events on this object.
1425
- * @param name - the name of the event to listen for
1426
- * @param callback - a function to call when the event occurs
1427
- * @return Returns a cleanup function.
1428
- * @typeParam T - the type of the data that the event will provide
1429
- */
1430
- addEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):()=>void;
1431
- nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<Event<T>>;
1432
- hasListeners(name:string):boolean;
1433
- /**
1434
- * Removes an event listener added to this table.
1435
- * @param name -
1436
- * @param callback -
1437
- * @return
1438
- * @typeParam T -
1439
- */
1440
- removeEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):boolean;
1441
- }
1442
-
1443
- /**
1444
- * Describes data that can be filtered, either a column reference or a literal value. Used this way, the type of a value
1445
- * can be specified so that values which are ambiguous or not well supported in JS will not be confused with Strings or
1446
- * imprecise numbers (e.g., nanosecond-precision date values). Additionally, once wrapped in this way, methods can be
1447
- * called on these value literal instances. These instances are immutable - any method called on them returns a new
1448
- * instance.
1449
- */
1450
- export class FilterValue {
1451
- protected constructor();
1452
-
1453
- /**
1454
- * Constructs a number for the filter API from the given parameter. Can also be used on the values returned from
1455
- * {@link TableData.get} for DateTime values. To create
1456
- * a filter with a date, use <b>dh.DateWrapper.ofJsDate</b> or
1457
- * {@link i18n.DateTimeFormat.parse}. To create a filter with a
1458
- * 64-bit long integer, use {@link LongWrapper.ofString}.
1459
- * @param input - the number to wrap as a FilterValue
1460
- * @return an immutable FilterValue that can be built into a filter
1461
- */
1462
- static ofNumber(input:LongWrapper|number):FilterValue;
1463
- /**
1464
- * a filter condition checking if the current value is equal to the given parameter
1465
- * @param term -
1466
- * @return {@link dh.FilterCondition}
1467
- */
1468
- eq(term:FilterValue):FilterCondition;
1469
- /**
1470
- * a filter condition checking if the current value is equal to the given parameter, ignoring differences of upper
1471
- * vs lower case
1472
- * @param term -
1473
- * @return {@link dh.FilterCondition}
1474
- */
1475
- eqIgnoreCase(term:FilterValue):FilterCondition;
1476
- /**
1477
- * a filter condition checking if the current value is not equal to the given parameter
1478
- * @param term -
1479
- * @return {@link dh.FilterCondition}
1480
- */
1481
- notEq(term:FilterValue):FilterCondition;
1482
- /**
1483
- * a filter condition checking if the current value is not equal to the given parameter, ignoring differences of
1484
- * upper vs lower case
1485
- * @param term -
1486
- * @return {@link dh.FilterCondition}
1487
- */
1488
- notEqIgnoreCase(term:FilterValue):FilterCondition;
1489
- /**
1490
- * a filter condition checking if the current value is greater than the given parameter
1491
- * @param term -
1492
- * @return {@link dh.FilterCondition}
1493
- */
1494
- greaterThan(term:FilterValue):FilterCondition;
1495
- /**
1496
- * a filter condition checking if the current value is less than the given parameter
1497
- * @param term -
1498
- * @return {@link dh.FilterCondition}
1499
- */
1500
- lessThan(term:FilterValue):FilterCondition;
1501
- /**
1502
- * a filter condition checking if the current value is greater than or equal to the given parameter
1503
- * @param term -
1504
- * @return {@link dh.FilterCondition}
1505
- */
1506
- greaterThanOrEqualTo(term:FilterValue):FilterCondition;
1507
- /**
1508
- * a filter condition checking if the current value is less than or equal to the given parameter
1509
- * @param term -
1510
- * @return {@link dh.FilterCondition}
1511
- */
1512
- lessThanOrEqualTo(term:FilterValue):FilterCondition;
1513
- /**
1514
- * a filter condition checking if the current value is in the given set of values
1515
- * @param terms -
1516
- * @return {@link dh.FilterCondition}
1517
- */
1518
- in(terms:FilterValue[]):FilterCondition;
1519
- /**
1520
- * a filter condition checking if the current value is in the given set of values, ignoring differences of upper vs
1521
- * lower case
1522
- * @param terms -
1523
- * @return {@link dh.FilterCondition}
1524
- */
1525
- inIgnoreCase(terms:FilterValue[]):FilterCondition;
1526
- /**
1527
- * a filter condition checking that the current value is not in the given set of values
1528
- * @param terms -
1529
- * @return {@link dh.FilterCondition}
1530
- */
1531
- notIn(terms:FilterValue[]):FilterCondition;
1532
- /**
1533
- * a filter condition checking that the current value is not in the given set of values, ignoring differences of
1534
- * upper vs lower case
1535
- * @param terms -
1536
- * @return {@link dh.FilterCondition}
1537
- */
1538
- notInIgnoreCase(terms:FilterValue[]):FilterCondition;
1539
- /**
1540
- * a filter condition checking if the given value contains the given string value
1541
- * @param term -
1542
- * @return {@link dh.FilterCondition}
1543
- */
1544
- contains(term:FilterValue):FilterCondition;
1545
- /**
1546
- * a filter condition checking if the given value contains the given string value, ignoring differences of upper vs
1547
- * lower case
1548
- * @param term -
1549
- * @return {@link dh.FilterCondition}
1373
+ * Creates an empty table with the specified number of rows. Optionally columns and types may be specified, but all
1374
+ * values will be null.
1375
+ * @param size -
1376
+ * @return {@link Promise} of {@link dh.Table}
1550
1377
  */
1551
- containsIgnoreCase(term:FilterValue):FilterCondition;
1378
+ emptyTable(size:number):Promise<Table>;
1552
1379
  /**
1553
- * a filter condition checking if the given value matches the provided regular expressions string. Regex patterns
1554
- * use Java regex syntax
1555
- * @param pattern -
1556
- * @return {@link dh.FilterCondition}
1380
+ * Creates a new table that ticks automatically every "periodNanos" nanoseconds. A start time may be provided; if so
1381
+ * the table will be populated with the interval from the specified date until now.
1382
+ * @param periodNanos -
1383
+ * @param startTime -
1384
+ * @return {@link Promise} of {@link dh.Table}
1557
1385
  */
1558
- matches(pattern:FilterValue):FilterCondition;
1386
+ timeTable(periodNanos:number, startTime?:DateWrapper):Promise<Table>;
1387
+ addEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):()=>void;
1388
+ nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<Event<T>>;
1389
+ hasListeners(name:string):boolean;
1390
+ removeEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):boolean;
1391
+ }
1392
+
1393
+ /**
1394
+ * This object serves as a "handle" to a subscription, allowing it to be acted on directly or canceled outright. If you
1395
+ * retain an instance of this, you have two choices - either only use it to call `close()` on it to stop the table's
1396
+ * viewport without creating a new one, or listen directly to this object instead of the table for data events, and
1397
+ * always call `close()` when finished. Calling any method on this object other than close() will result in it
1398
+ * continuing to live on after `setViewport` is called on the original table, or after the table is modified.
1399
+ */
1400
+ export class TableViewportSubscription implements HasEventHandling {
1401
+ protected constructor();
1402
+
1559
1403
  /**
1560
- * a filter condition checking if the given value matches the provided regular expressions string, ignoring
1561
- * differences of upper vs lower case. Regex patterns use Java regex syntax
1562
- * @param pattern -
1563
- * @return {@link dh.FilterCondition}
1404
+ * Changes the rows and columns set on this viewport. This cannot be used to change the update interval.
1405
+ * @param firstRow -
1406
+ * @param lastRow -
1407
+ * @param columns -
1408
+ * @param updateIntervalMs -
1409
+ * @deprecated use {@link #update(Object)} instead
1564
1410
  */
1565
- matchesIgnoreCase(pattern:FilterValue):FilterCondition;
1411
+ setViewport(firstRow:number, lastRow:number, columns?:Column[]|undefined|null, updateIntervalMs?:number|undefined|null, isReverseViewport?:boolean|undefined|null):void;
1566
1412
  /**
1567
- * a filter condition checking if the current value is a true boolean
1568
- * @return {@link dh.FilterCondition}
1413
+ * Update the options for this viewport subscription. This cannot alter the update interval or preview options.
1414
+ * @param options - the subscription options
1569
1415
  */
1570
- isTrue():FilterCondition;
1416
+ update(options:ViewportSubscriptionOptions):void;
1571
1417
  /**
1572
- * a filter condition checking if the current value is a false boolean
1573
- * @return {@link dh.FilterCondition}
1418
+ * Stops this viewport from running, stopping all events on itself and on the table that created it.
1574
1419
  */
1575
- isFalse():FilterCondition;
1420
+ close():void;
1576
1421
  /**
1577
- * a filter condition checking if the current value is a null value
1578
- * @return {@link dh.FilterCondition}
1422
+ * Gets the data currently visible in this viewport
1423
+ * @return Promise of {@link dh.TableData}.
1579
1424
  */
1580
- isNull():FilterCondition;
1425
+ getViewportData():Promise<ViewportData>;
1581
1426
  /**
1582
- * a filter condition invoking the given method on the current value, with the given parameters. Currently supported
1583
- * functions that can be invoked on a String:
1584
- * <ul>
1585
- * <li><b>startsWith</b>: Returns true if the current string value starts with the supplied string argument</li>
1586
- * <li><b>endsWith</b>: Returns true if the current string value ends with the supplied string argument</li>
1587
- * <li><b>matches</b>: Returns true if the current string value matches the supplied string argument used as a Java
1588
- * regular expression</li>
1589
- * <li><b>contains</b>: Returns true if the current string value contains the supplied string argument
1590
- * <p>
1591
- * When invoking against a constant, this should be avoided in favor of FilterValue.contains
1592
- * </p>
1593
- * </li>
1594
- * </ul>
1595
- * @param method -
1596
- * @param args -
1597
- * @return
1427
+ *
1428
+ * @deprecated Use {@link JsTable#createSnapshot(Object)} instead
1598
1429
  */
1599
- invoke(method:string, ...args:FilterValue[]):FilterCondition;
1600
- toString():string;
1430
+ snapshot(rows:RangeSet, columns:Column[]):Promise<TableData>;
1601
1431
  /**
1602
- * Constructs a string for the filter API from the given parameter.
1603
- * @param input -
1604
- * @return
1432
+ * Listen for events on this object.
1433
+ * @param name - the name of the event to listen for
1434
+ * @param callback - a function to call when the event occurs
1435
+ * @return Returns a cleanup function.
1436
+ * @typeParam T - the type of the data that the event will provide
1605
1437
  */
1606
- static ofString(input:any):FilterValue;
1438
+ addEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):()=>void;
1439
+ nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<Event<T>>;
1440
+ hasListeners(name:string):boolean;
1607
1441
  /**
1608
- * Constructs a boolean for the filter API from the given parameter.
1609
- * @param b -
1442
+ * Removes an event listener added to this table.
1443
+ * @param name -
1444
+ * @param callback -
1610
1445
  * @return
1446
+ * @typeParam T -
1611
1447
  */
1612
- static ofBoolean(b:boolean):FilterValue;
1448
+ removeEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):boolean;
1449
+ }
1450
+
1451
+ /**
1452
+ * Event fired when a command is issued from the client.
1453
+ */
1454
+ export class CommandInfo {
1455
+ constructor(code:string, result:Promise<dh.ide.CommandResult>);
1456
+
1457
+ get result():Promise<dh.ide.CommandResult>;
1458
+ get code():string;
1459
+ }
1460
+
1461
+ export class LongWrapper {
1462
+ protected constructor();
1463
+
1464
+ static ofString(str:string):LongWrapper;
1465
+ asNumber():number;
1466
+ valueOf():string;
1467
+ toString():string;
1613
1468
  }
1614
1469
 
1615
1470
  export class CustomColumn {
@@ -1649,119 +1504,206 @@ export namespace dh {
1649
1504
  * </ul>
1650
1505
  * @return String
1651
1506
  */
1652
- get type():string;
1507
+ get type():string;
1508
+ }
1509
+
1510
+ /**
1511
+ * This class allows iteration over non-contiguous indexes. In the future, this will support the EcmaScript 2015
1512
+ * Iteration protocol, but for now has one method which returns an iterator, and also supports querying the size.
1513
+ * Additionally, we may add support for creating RangeSet objects to better serve some use cases.
1514
+ */
1515
+ export class RangeSet {
1516
+ protected constructor();
1517
+
1518
+ static ofRange(first:number, last:number):RangeSet;
1519
+ static ofItems(rows:number[]):RangeSet;
1520
+ static ofRanges(ranges:RangeSet[]):RangeSet;
1521
+ static ofSortedRanges(ranges:RangeSet[]):RangeSet;
1522
+ /**
1523
+ * a new iterator over all indexes in this collection.
1524
+ * @return Iterator of {@link dh.LongWrapper}
1525
+ */
1526
+ iterator():Iterator<LongWrapper>;
1527
+ /**
1528
+ * The total count of items contained in this collection. In some cases this can be expensive to compute, and
1529
+ * generally should not be needed except for debugging purposes, or preallocating space (i.e., do not call this
1530
+ * property each time through a loop).
1531
+ * @return double
1532
+ */
1533
+ get size():number;
1534
+ }
1535
+
1536
+ /**
1537
+ * Exists to keep the dh.TableMap namespace so that the web UI can remain compatible with the DHE API, which still calls
1538
+ * this type TableMap.
1539
+ * @deprecated
1540
+ */
1541
+ export class TableMap {
1542
+ static readonly EVENT_KEYADDED:string;
1543
+ static readonly EVENT_DISCONNECT:string;
1544
+ static readonly EVENT_RECONNECT:string;
1545
+ static readonly EVENT_RECONNECTFAILED:string;
1546
+
1547
+ protected constructor();
1548
+ }
1549
+
1550
+ /**
1551
+ * Represents a set of Tables each corresponding to some key. The keys are available locally, but a call must be made to
1552
+ * the server to get each Table. All tables will have the same structure.
1553
+ */
1554
+ export class PartitionedTable implements HasEventHandling {
1555
+ /**
1556
+ * Indicates that a new key has been added to the array of keys, which can now be fetched with getTable.
1557
+ */
1558
+ static readonly EVENT_KEYADDED:string;
1559
+ /**
1560
+ * Indicates that a new key has been added to the array of keys, which can now be fetched with getTable.
1561
+ */
1562
+ static readonly EVENT_DISCONNECT:string;
1563
+ /**
1564
+ * Indicates that a new key has been added to the array of keys, which can now be fetched with getTable.
1565
+ */
1566
+ static readonly EVENT_RECONNECT:string;
1567
+ /**
1568
+ * Indicates that a new key has been added to the array of keys, which can now be fetched with getTable.
1569
+ */
1570
+ static readonly EVENT_RECONNECTFAILED:string;
1571
+
1572
+ protected constructor();
1573
+
1574
+ /**
1575
+ * Fetch the table with the given key. If the key does not exist, returns `null`.
1576
+ * @param key - The key to fetch. An array of values for each key column, in the same order as the key columns are.
1577
+ * @return Promise of dh.Table, or `null` if the key does not exist.
1578
+ */
1579
+ getTable(key:object):Promise<Table|undefined|null>;
1580
+ /**
1581
+ * Open a new table that is the result of merging all constituent tables. See
1582
+ * {@link io.deephaven.engine.table.PartitionedTable.merge} for details.
1583
+ * @return A merged representation of the constituent tables.
1584
+ */
1585
+ getMergedTable():Promise<Table>;
1586
+ /**
1587
+ * The set of all currently known keys. This is kept up to date, so getting the list after adding an event listener
1588
+ * for <b>keyadded</b> will ensure no keys are missed.
1589
+ * @return Set of Object
1590
+ */
1591
+ getKeys():Set<object>;
1592
+ /**
1593
+ * Fetch a table containing all the valid keys of the partitioned table.
1594
+ * @return Promise of a Table
1595
+ * @deprecated
1596
+ */
1597
+ getKeyTable():Promise<Table>;
1598
+ /**
1599
+ * Fetch the underlying base table of the partitioned table.
1600
+ * @return Promise of a Table
1601
+ */
1602
+ getBaseTable():Promise<Table>;
1603
+ /**
1604
+ * Indicates that this PartitionedTable will no longer be used, removing subcriptions to updated keys, etc. This
1605
+ * will not affect tables in use.
1606
+ */
1607
+ close():void;
1608
+ /**
1609
+ * The count of known keys.
1610
+ * @return int
1611
+ */
1612
+ get size():number;
1613
+ /**
1614
+ * An array of the columns in the tables that can be retrieved from this partitioned table, including both key and
1615
+ * non-key columns.
1616
+ * @return Array of Column
1617
+ */
1618
+ get columns():Column[];
1619
+ /**
1620
+ * An array of all the key columns that the tables are partitioned by.
1621
+ * @return Array of Column
1622
+ */
1623
+ get keyColumns():Column[];
1624
+ /**
1625
+ * Listen for events on this object.
1626
+ * @param name - the name of the event to listen for
1627
+ * @param callback - a function to call when the event occurs
1628
+ * @return Returns a cleanup function.
1629
+ * @typeParam T - the type of the data that the event will provide
1630
+ */
1631
+ addEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):()=>void;
1632
+ nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<Event<T>>;
1633
+ hasListeners(name:string):boolean;
1634
+ /**
1635
+ * Removes an event listener added to this table.
1636
+ * @param name -
1637
+ * @param callback -
1638
+ * @return
1639
+ * @typeParam T -
1640
+ */
1641
+ removeEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):boolean;
1653
1642
  }
1654
1643
 
1655
1644
  /**
1656
- * This class allows iteration over non-contiguous indexes. In the future, this will support the EcmaScript 2015
1657
- * Iteration protocol, but for now has one method which returns an iterator, and also supports querying the size.
1658
- * Additionally, we may add support for creating RangeSet objects to better serve some use cases.
1645
+ * Describes a grouping and aggregations for a roll-up table. Pass to the <b>Table.rollup</b> function to create a
1646
+ * roll-up table.
1659
1647
  */
1660
- export class RangeSet {
1661
- protected constructor();
1662
-
1663
- static ofRange(first:number, last:number):RangeSet;
1664
- static ofItems(rows:number[]):RangeSet;
1665
- static ofRanges(ranges:RangeSet[]):RangeSet;
1666
- static ofSortedRanges(ranges:RangeSet[]):RangeSet;
1648
+ export class RollupConfig {
1667
1649
  /**
1668
- * a new iterator over all indexes in this collection.
1669
- * @return Iterator of {@link dh.LongWrapper}
1650
+ * Ordered list of columns to group by to form the hierarchy of the resulting roll-up table.
1670
1651
  */
1671
- iterator():Iterator<LongWrapper>;
1652
+ groupingColumns:Array<String>;
1672
1653
  /**
1673
- * The total count of items contained in this collection. In some cases this can be expensive to compute, and
1674
- * generally should not be needed except for debugging purposes, or preallocating space (i.e., do not call this
1675
- * property each time through a loop).
1676
- * @return double
1654
+ * Mapping from each aggregation name to the ordered list of columns it should be applied to in the resulting
1655
+ * roll-up table.
1677
1656
  */
1678
- get size():number;
1679
- }
1680
-
1681
- /**
1682
- * Options for custom columns.
1683
- */
1684
- export class CustomColumnOptions {
1657
+ aggregations:{ [key: string]: Array<string>; };
1685
1658
  /**
1686
- * When specified for custom columns on a rollup table, specifies if the formula apply to rollup or constituent
1687
- * nodes.
1659
+ * Optional parameter indicating if an extra leaf node should be added at the bottom of the hierarchy, showing the
1660
+ * rows in the underlying table which make up that grouping. Since these values might be a different type from the
1661
+ * rest of the column, any client code must check if TreeRow.hasChildren = false, and if so, interpret those values
1662
+ * as if they were Column.constituentType instead of Column.type. Defaults to false.
1688
1663
  */
1689
- rollupNodeType?:RollupNodeTypeType|null;
1690
-
1691
- constructor();
1692
- }
1693
-
1694
- export class CoreClient implements HasEventHandling {
1695
- static readonly EVENT_CONNECT:string;
1696
- static readonly EVENT_DISCONNECT:string;
1697
- static readonly EVENT_RECONNECT:string;
1698
- static readonly EVENT_RECONNECT_AUTH_FAILED:string;
1699
- static readonly EVENT_REQUEST_FAILED:string;
1700
- static readonly EVENT_REQUEST_STARTED:string;
1701
- static readonly EVENT_REQUEST_SUCCEEDED:string;
1664
+ includeConstituents:boolean;
1665
+ includeOriginalColumns?:boolean|null;
1702
1666
  /**
1703
- * @deprecated
1667
+ * Optional parameter indicating if original column descriptions should be included. Defaults to true.
1704
1668
  */
1705
- static readonly EVENT_REFRESH_TOKEN_UPDATED:string;
1706
- static readonly LOGIN_TYPE_PASSWORD:string;
1707
- static readonly LOGIN_TYPE_ANONYMOUS:string;
1708
-
1709
- constructor(serverUrl:string, connectOptions?:ConnectOptions);
1669
+ includeDescriptions:boolean;
1710
1670
 
1711
- running():Promise<CoreClient>;
1712
- getServerUrl():string;
1713
- getAuthConfigValues():Promise<string[][]>;
1714
- login(credentials:LoginCredentials):Promise<void>;
1715
- relogin(token:RefreshToken):Promise<void>;
1716
- onConnected(timeoutInMillis?:number):Promise<void>;
1717
- getServerConfigValues():Promise<string[][]>;
1718
- getStorageService():dh.storage.StorageService;
1719
- getAsIdeConnection():Promise<IdeConnection>;
1720
- disconnect():void;
1721
- addEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):()=>void;
1722
- nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<Event<T>>;
1723
- hasListeners(name:string):boolean;
1724
- removeEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):boolean;
1671
+ constructor();
1725
1672
  }
1726
1673
 
1727
1674
  /**
1728
- * This object serves as a "handle" to a subscription, allowing it to be acted on directly or canceled outright. If you
1729
- * retain an instance of this, you have two choices - either only use it to call `close()` on it to stop the table's
1730
- * viewport without creating a new one, or listen directly to this object instead of the table for data events, and
1731
- * always call `close()` when finished. Calling any method on this object other than close() will result in it
1732
- * continuing to live on after `setViewport` is called on the original table, or after the table is modified.
1675
+ * Represents a non-viewport subscription to a table, and all data currently known to be present in the subscribed
1676
+ * columns. This class handles incoming snapshots and deltas, and fires events to consumers to notify of data changes.
1677
+ * <p>
1678
+ * Unlike {@link dh.TableViewportSubscription}, the "original" table does not have a reference to this instance, only the
1679
+ * "private" table instance does, since the original cannot modify the subscription, and the private instance must
1680
+ * forward data to it.
1681
+ * <p>
1682
+ * Represents a subscription to the table on the server. Changes made to the table will not be reflected here - the
1683
+ * subscription must be closed and a new one optioned to see those changes. The event model is slightly different from
1684
+ * viewports to make it less expensive to compute for large tables.
1733
1685
  */
1734
- export class TableViewportSubscription implements HasEventHandling {
1686
+ export class TableSubscription implements HasEventHandling {
1735
1687
  protected constructor();
1736
1688
 
1689
+ static createTableSubscription(options:SubscriptionOptions, existingTable:Table):TableSubscription;
1737
1690
  /**
1738
- * Changes the rows and columns set on this viewport. This cannot be used to change the update interval.
1739
- * @param firstRow -
1740
- * @param lastRow -
1741
- * @param columns -
1742
- * @param updateIntervalMs -
1743
- * @deprecated use {@link #update(Object)} instead
1691
+ * Updates the subscription to use the given columns and update interval.
1692
+ * @param columns - the new columns to subscribe to
1693
+ * @param updateIntervalMs - the new update interval, or null/omit to use the default of one second
1744
1694
  */
1745
- setViewport(firstRow:number, lastRow:number, columns?:Column[]|undefined|null, updateIntervalMs?:number|undefined|null, isReverseViewport?:boolean|undefined|null):void;
1695
+ changeSubscription(columns:Array<Column>, updateIntervalMs:number|undefined|null):void;
1746
1696
  /**
1747
1697
  * Update the options for this viewport subscription. This cannot alter the update interval or preview options.
1748
1698
  * @param options - the subscription options
1749
1699
  */
1750
- update(options:ViewportSubscriptionOptions):void;
1700
+ update(options:SubscriptionOptions):void;
1701
+ get columns():Array<Column>;
1751
1702
  /**
1752
- * Stops this viewport from running, stopping all events on itself and on the table that created it.
1703
+ * Stops the subscription on the server.
1753
1704
  */
1754
1705
  close():void;
1755
1706
  /**
1756
- * Gets the data currently visible in this viewport
1757
- * @return Promise of {@link dh.TableData}.
1758
- */
1759
- getViewportData():Promise<ViewportData>;
1760
- /**
1761
- * @deprecated
1762
- */
1763
- snapshot(rows:RangeSet, columns:Column[]):Promise<TableData>;
1764
- /**
1765
1707
  * Listen for events on this object.
1766
1708
  * @param name - the name of the event to listen for
1767
1709
  * @param callback - a function to call when the event occurs
@@ -1781,158 +1723,124 @@ export namespace dh {
1781
1723
  removeEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):boolean;
1782
1724
  }
1783
1725
 
1784
- export class IdeSession implements HasEventHandling {
1785
- static readonly EVENT_COMMANDSTARTED:string;
1726
+ /**
1727
+ * Deprecated for use in Deephaven Core.
1728
+ * @deprecated
1729
+ */
1730
+ export class Client {
1786
1731
  static readonly EVENT_REQUEST_FAILED:string;
1732
+ static readonly EVENT_REQUEST_STARTED:string;
1733
+ static readonly EVENT_REQUEST_SUCCEEDED:string;
1787
1734
 
1788
- protected constructor();
1735
+ constructor();
1736
+ }
1789
1737
 
1738
+ /**
1739
+ * Configuration object for running Table.treeTable to produce a hierarchical view of a given "flat" table.
1740
+ *
1741
+ * Like TotalsTableConfig, `TreeTableConfig` supports an operation map indicating how to aggregate the data, as well as
1742
+ * an array of column names which will be the layers in the roll-up tree, grouped at each level. An additional optional
1743
+ * value can be provided describing the strategy the engine should use when grouping the rows.
1744
+ */
1745
+ export class TreeTableConfig {
1790
1746
  /**
1791
- * Load the named table, with columns and size information already fully populated.
1792
- * @param name - the name of the table to fetch
1793
- * @param applyPreviewColumns - false to disable previews, defaults to true
1794
- * @return a {@link Promise} that will resolve to the table, or reject with an error if it cannot be loaded.
1795
- * @deprecated Added to resolve a specific issue, in the future preview will be applied as part of the subscription.
1747
+ * The column representing the unique ID for each item
1796
1748
  */
1797
- getTable(name:string, applyPreviewColumns?:boolean):Promise<Table>;
1749
+ idColumn:string;
1798
1750
  /**
1799
- * Load the named Figure, including its tables and tablemaps as needed.
1800
- * @param name -
1801
- * @return promise of dh.plot.Figure
1751
+ * The column representing the parent ID for each item
1802
1752
  */
1803
- getFigure(name:string):Promise<dh.plot.Figure>;
1753
+ parentColumn:string;
1804
1754
  /**
1805
- * Loads the named tree table or roll-up table, with column data populated. All nodes are collapsed by default, and
1806
- * size is presently not available until the viewport is first set.
1807
- * @param name -
1808
- * @return {@link Promise} of {@link dh.TreeTable}
1755
+ * Optional parameter indicating if items with an invalid parent ID should be promoted to root. Defaults to false.
1809
1756
  */
1810
- getTreeTable(name:string):Promise<TreeTable>;
1811
- getHierarchicalTable(name:string):Promise<TreeTable>;
1812
- getPartitionedTable(name:string):Promise<PartitionedTable>;
1813
- getObject(definitionObject:dh.ide.VariableDescriptor):Promise<any>;
1814
- newTable(columnNames:string[], types:string[], data:string[][], userTimeZone:string):Promise<Table>;
1757
+ promoteOrphansToRoot:boolean;
1758
+
1759
+ constructor();
1760
+ }
1761
+
1762
+ /**
1763
+ * Describes how a Totals Table will be generated from its parent table. Each table has a default (which may be null)
1764
+ * indicating how that table was configured when it was declared, and each Totals Table has a similar property
1765
+ * describing how it was created. Both the <b>Table.getTotalsTable</b> and <b>Table.getGrandTotalsTable</b> methods take
1766
+ * this config as an optional parameter - without it, the table's default will be used, or if null, a default instance
1767
+ * of <b>TotalsTableConfig</b> will be supplied.
1768
+ *
1769
+ * This class has a no-arg constructor, allowing an instance to be made with the default values provided. However, any
1770
+ * JS object can be passed in to the methods which accept instances of this type, provided their values adhere to the
1771
+ * expected formats.
1772
+ */
1773
+ export class TotalsTableConfig {
1815
1774
  /**
1816
- * Merges the given tables into a single table. Assumes all tables have the same structure.
1817
- * @param tables -
1818
- * @return {@link Promise} of {@link dh.Table}
1775
+ * @deprecated
1819
1776
  */
1820
- mergeTables(tables:Table[]):Promise<Table>;
1821
- bindTableToVariable(table:Table, name:string):Promise<void>;
1777
+ static readonly COUNT:string;
1822
1778
  /**
1823
- * Makes the `object` available to another user or another client on this same server which knows the value of
1824
- * the `sharedTicketBytes`. Use that sharedTicketBytes value like a one-time use password - any other client
1825
- * which knows this value can read the same object.
1826
- * <p>
1827
- * Shared objects will remain available using the sharedTicketBytes until the client that first shared them
1828
- * releases/closes their copy of the object. Whatever side-channel is used to share the bytes, be sure to wait until
1829
- * the remote end has signaled that it has successfully fetched the object before releasing it from this client.
1830
- * <p>
1831
- * Be sure to use an unpredictable value for the shared ticket bytes, like a UUID or other large, random value to
1832
- * prevent access by unauthorized clients.
1833
- * @param object - the object to share with another client/user
1834
- * @param sharedTicketBytes - the value which another client/user must know to obtain the object. It may be a unicode
1835
- * string (will be encoded as utf8 bytes), or a {@link Uint8Array} value.
1836
- * @return A promise that will resolve to the value passed as sharedTicketBytes when the object is ready to be read
1837
- * by another client, or will reject if an error occurs.
1779
+ * @deprecated
1838
1780
  */
1839
- shareObject(object:Table|Widget|WidgetExportedObject|PartitionedTable|TotalsTable|TreeTable, sharedTicketBytes:string|Uint8Array):Promise<string|Uint8Array>;
1781
+ static readonly MIN:string;
1840
1782
  /**
1841
- * Reads an object shared by another client to this server with the `sharedTicketBytes`. Until the other
1842
- * client releases this object (or their session ends), the object will be available on the server.
1843
- * <p>
1844
- * The type of the object must be passed so that the object can be read from the server correct - the other client
1845
- * should provide this information.
1846
- * @param sharedTicketBytes - the value provided by another client/user to obtain the object. It may be a unicode
1847
- * string (will be encoded as utf8 bytes), or a {@link Uint8Array} value.
1848
- * @param type - The type of the object, so it can be correctly read from the server
1849
- * @return A promise that will resolve to the shared object, or will reject with an error if it cannot be read.
1783
+ * @deprecated
1850
1784
  */
1851
- getSharedObject(sharedTicketBytes:string|Uint8Array, type:string):Promise<any>;
1852
- subscribeToFieldUpdates(callback:(arg0:dh.ide.VariableChanges)=>void):()=>void;
1853
- close():void;
1854
- runCode(code:string):Promise<dh.ide.CommandResult>;
1855
- onLogMessage(callback:(arg0:dh.ide.LogItem)=>void):()=>void;
1856
- openDocument(params:object):void;
1857
- changeDocument(params:object):void;
1858
- getCompletionItems(params:object):Promise<Array<dh.lsp.CompletionItem>>;
1859
- getSignatureHelp(params:object):Promise<Array<dh.lsp.SignatureInformation>>;
1860
- getHover(params:object):Promise<dh.lsp.Hover>;
1861
- closeDocument(params:object):void;
1785
+ static readonly MAX:string;
1786
+ /**
1787
+ * @deprecated
1788
+ */
1789
+ static readonly SUM:string;
1790
+ /**
1791
+ * @deprecated
1792
+ */
1793
+ static readonly ABS_SUM:string;
1794
+ /**
1795
+ * @deprecated
1796
+ */
1797
+ static readonly VAR:string;
1798
+ /**
1799
+ * @deprecated
1800
+ */
1801
+ static readonly AVG:string;
1802
+ /**
1803
+ * @deprecated
1804
+ */
1805
+ static readonly STD:string;
1806
+ /**
1807
+ * @deprecated
1808
+ */
1809
+ static readonly FIRST:string;
1862
1810
  /**
1863
- * Creates an empty table with the specified number of rows. Optionally columns and types may be specified, but all
1864
- * values will be null.
1865
- * @param size -
1866
- * @return {@link Promise} of {@link dh.Table}
1811
+ * @deprecated
1867
1812
  */
1868
- emptyTable(size:number):Promise<Table>;
1813
+ static readonly LAST:string;
1869
1814
  /**
1870
- * Creates a new table that ticks automatically every "periodNanos" nanoseconds. A start time may be provided; if so
1871
- * the table will be populated with the interval from the specified date until now.
1872
- * @param periodNanos -
1873
- * @param startTime -
1874
- * @return {@link Promise} of {@link dh.Table}
1815
+ * @deprecated
1875
1816
  */
1876
- timeTable(periodNanos:number, startTime?:DateWrapper):Promise<Table>;
1877
- addEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):()=>void;
1878
- nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<Event<T>>;
1879
- hasListeners(name:string):boolean;
1880
- removeEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):boolean;
1881
- }
1882
-
1883
- /**
1884
- * Wrap BigInteger values for use in JS. Provides text formatting for display and access to the underlying value.
1885
- */
1886
- export class BigIntegerWrapper {
1887
- protected constructor();
1888
-
1889
- static ofString(str:string):BigIntegerWrapper;
1890
- asNumber():number;
1891
- valueOf():string;
1892
- toString():string;
1893
- equals(o:object):boolean;
1894
- hashCode():number;
1895
- }
1896
-
1897
- export class QueryInfo {
1898
- static readonly EVENT_TABLE_OPENED:string;
1899
- static readonly EVENT_DISCONNECT:string;
1900
- static readonly EVENT_RECONNECT:string;
1901
- static readonly EVENT_CONNECT:string;
1902
-
1903
- protected constructor();
1904
- }
1905
-
1906
- /**
1907
- * Addition optional configuration that can be passed to the {@link dh.CoreClient} constructor.
1908
- */
1909
- export class ConnectOptions {
1817
+ static readonly SKIP:string;
1910
1818
  /**
1911
- * Optional map of http header names and values to send to the server with each request.
1819
+ * Specifies if a Totals Table should be expanded by default in the UI. Defaults to false.
1912
1820
  */
1913
- headers?:{ [key: string]: string; }|null;
1821
+ showTotalsByDefault:boolean;
1914
1822
  /**
1915
- * True to enable debug logging. At this time, only enables logging for gRPC calls.
1823
+ * Specifies if a Grand Totals Table should be expanded by default in the UI. Defaults to false.
1916
1824
  */
1917
- debug?:boolean|null;
1825
+ showGrandTotalsByDefault:boolean;
1918
1826
  /**
1919
- * Set this to true to force the use of websockets when connecting to the deephaven instance, false to force the use
1920
- * of `fetch`. Ignored if {@link dh.transportFactory} is set.
1921
- * <p>
1922
- * Defaults to null, indicating that the server URL should be checked to see if we connect with fetch or websockets.
1827
+ * Specifies the default operation for columns that do not have a specific operation applied; defaults to "Sum".
1923
1828
  */
1924
- useWebsockets?:boolean|null;
1829
+ defaultOperation:AggregationOperationType;
1925
1830
  /**
1926
- * The transport factory to use for creating gRPC streams. If specified, the JS API will ignore
1927
- * {@link dh.useWebsockets} and its own internal logic for determining the appropriate transport to use.
1928
- * <p>
1929
- * Defaults to null, indicating that the JS API should determine the appropriate transport to use. If
1930
- * `useWebsockets` is set to true, the JS API will use websockets, otherwise if the server url begins with
1931
- * https, it will use fetch, otherwise it will use websockets.
1831
+ * Mapping from each column name to the aggregation(s) that should be applied to that column in the resulting Totals
1832
+ * Table. If a column is omitted, the defaultOperation is used.
1932
1833
  */
1933
- transportFactory?:dh.grpc.GrpcTransportFactory|null;
1834
+ operationMap:{ [key: string]: Array<AggregationOperationType>; };
1835
+ /**
1836
+ * Groupings to use when generating the Totals Table. One row will exist for each unique set of values observed in
1837
+ * these columns. See also `Table.selectDistinct`.
1838
+ */
1839
+ groupBy:Array<string>;
1934
1840
 
1935
1841
  constructor();
1842
+
1843
+ toString():string;
1936
1844
  }
1937
1845
 
1938
1846
  /**
@@ -2322,152 +2230,242 @@ export namespace dh {
2322
2230
  }
2323
2231
 
2324
2232
  /**
2325
- * Describes a filter which can be applied to a table. Replacing these instances may be more expensive than reusing
2326
- * them. These instances are immutable - all operations that compose them to build bigger expressions return a new
2327
- * instance.
2233
+ * Wrap BigInteger values for use in JS. Provides text formatting for display and access to the underlying value.
2328
2234
  */
2329
- export class FilterCondition {
2235
+ export class BigIntegerWrapper {
2330
2236
  protected constructor();
2331
2237
 
2238
+ static ofString(str:string):BigIntegerWrapper;
2239
+ asNumber():number;
2240
+ valueOf():string;
2241
+ toString():string;
2242
+ equals(o:object):boolean;
2243
+ hashCode():number;
2244
+ }
2245
+
2246
+ /**
2247
+ * Options for custom columns.
2248
+ */
2249
+ export class CustomColumnOptions {
2332
2250
  /**
2333
- * the opposite of this condition
2334
- * @return FilterCondition
2251
+ * When specified for custom columns on a rollup table, specifies if the formula apply to rollup or constituent
2252
+ * nodes.
2335
2253
  */
2336
- not():FilterCondition;
2254
+ rollupNodeType?:RollupNodeTypeType|null;
2255
+
2256
+ constructor();
2257
+ }
2258
+
2259
+ /**
2260
+ * Behaves like a {@link dh.Table} externally, but data, state, and viewports are managed by an entirely different
2261
+ * mechanism, and so reimplemented here.
2262
+ * <p>
2263
+ * Any time a change is made, we build a new request and send it to the server, and wait for the updated state.
2264
+ * <p>
2265
+ * Semantics around getting updates from the server are slightly different - we don't "unset" the viewport here after
2266
+ * operations are performed, but encourage the client code to re-set them to the desired position.
2267
+ * <p>
2268
+ * The table size will be -1 until a viewport has been fetched.
2269
+ * <p>
2270
+ * Similar to a table, a Tree Table provides access to subscribed viewport data on the current hierarchy. A different
2271
+ * Row type is used within that viewport, showing the depth of that node within the tree and indicating details about
2272
+ * whether it has children or is expanded. The Tree Table itself then provides the ability to change if a row is
2273
+ * expanded or not. Methods used to control or check if a row should be expanded or not can be invoked on a TreeRow
2274
+ * instance, or on the number of the row (thus allowing for expanding/collapsing rows which are not currently visible in
2275
+ * the viewport).
2276
+ * <p>
2277
+ * Events and viewports are somewhat different from tables, due to the expense of computing the expanded/collapsed rows
2278
+ * and count of children at each level of the hierarchy, and differences in the data that is available.
2279
+ * <p>
2280
+ * <ul>
2281
+ * <li>There is no {@link Table.totalSize | totalSize} property.</li>
2282
+ * <li>The viewport is not un-set when changes are made to filter or sort, but changes will continue to be streamed in.
2283
+ * It is suggested that the viewport be changed to the desired position (usually the first N rows) after any filter/sort
2284
+ * change is made. Likewise, {@link getViewportData} will always return the most recent data, and will not wait if a
2285
+ * new operation is pending.</li>
2286
+ * <li>Custom columns are supported on Rollup tables, but not on Tree tables. If the TreeTable was created client-side,
2287
+ * the original Table can have custom columns applied, and the TreeTable can be recreated.</li>
2288
+ * <li>Whereas Table has a {@link Table.totalsTableConfig} property, it is defined here as a method,
2289
+ * {@link getTotalsTableConfig}. This returns a promise so the config can be fetched asynchronously.</li>
2290
+ * <li>Totals Tables for trees vary in behavior between tree tables and roll-up tables. This behavior is based on the
2291
+ * original flat table used to produce the Tree Table - for a hierarchical table (i.e. Table.treeTable in the query
2292
+ * config), the totals will include non-leaf nodes (since they are themselves actual rows in the table), but in a
2293
+ * roll-up table, the totals only include leaf nodes (as non-leaf nodes are generated through grouping the contents of
2294
+ * the original table). Roll-ups also have the {@link dh.includeConstituents} property, indicating that a
2295
+ * {@link dh.Column} in the tree may have a {@link Column.constituentType} property reflecting that the type of cells
2296
+ * where {@link TreeRowImpl.hasChildren} is false will be different from usual.</li>
2297
+ * </ul>
2298
+ */
2299
+ export class TreeTable implements HasEventHandling {
2337
2300
  /**
2338
- * a condition representing the current condition logically ANDed with the other parameters
2339
- * @param filters -
2340
- * @return FilterCondition
2301
+ * event.detail is the currently visible viewport data based on the active viewport configuration.
2341
2302
  */
2342
- and(...filters:FilterCondition[]):FilterCondition;
2303
+ static readonly EVENT_UPDATED:string;
2343
2304
  /**
2344
- * a condition representing the current condition logically ORed with the other parameters
2345
- * @param filters -
2346
- * @return FilterCondition.
2305
+ * event.detail is the currently visible viewport data based on the active viewport configuration.
2347
2306
  */
2348
- or(...filters:FilterCondition[]):FilterCondition;
2307
+ static readonly EVENT_DISCONNECT:string;
2349
2308
  /**
2350
- * a string suitable for debugging showing the details of this condition.
2351
- * @return String.
2309
+ * event.detail is the currently visible viewport data based on the active viewport configuration.
2352
2310
  */
2353
- toString():string;
2354
- get columns():Array<Column>;
2311
+ static readonly EVENT_RECONNECT:string;
2355
2312
  /**
2356
- * a filter condition invoking a static function with the given parameters. Currently supported Deephaven static
2357
- * functions:
2358
- * <ul>
2359
- * <li><b>inRange</b>: Given three comparable values, returns true if the first is less than the second but greater
2360
- * than the third</li>
2361
- * <li><b>isInf</b>:Returns true if the given number is <i>infinity</i></li>
2362
- * <li><b>isNaN</b>:Returns true if the given number is <i>not a number</i></li>
2363
- * <li><b>isNormal</b>:Returns true if the given number <i>is not null</i>, <i>is not infinity</i>, and <i>is not
2364
- * "not a number"</i></li>
2365
- * <li><b>startsWith</b>:Returns true if the first string starts with the second string</li>
2366
- * <li><b>endsWith</b>Returns true if the first string ends with the second string</li>
2367
- * <li><b>matches</b>:Returns true if the first string argument matches the second string used as a Java regular
2368
- * expression</li>
2369
- * <li><b>contains</b>:Returns true if the first string argument contains the second string as a substring</li>
2370
- * <li><b>in</b>:Returns true if the first string argument can be found in the second array argument.
2371
- * <p>
2372
- * Note that the array can only be specified as a column reference at this time - typically the `FilterValue.in`
2373
- * method should be used in other cases
2374
- * </p>
2375
- * </li>
2376
- * </ul>
2377
- * @param function -
2378
- * @param args -
2379
- * @return dh.FilterCondition
2313
+ * event.detail is the currently visible viewport data based on the active viewport configuration.
2314
+ */
2315
+ static readonly EVENT_RECONNECTFAILED:string;
2316
+ /**
2317
+ * event.detail is the currently visible viewport data based on the active viewport configuration.
2318
+ */
2319
+ static readonly EVENT_REQUEST_FAILED:string;
2320
+ readonly description?:string|null;
2321
+ readonly layoutHints?:null|LayoutHints;
2322
+
2323
+ protected constructor();
2324
+
2325
+ /**
2326
+ * Expands the given node, so that its children are visible when they are in the viewport. The parameter can be the
2327
+ * row index, or the row object itself. The second parameter is a boolean value, false by default, specifying if the
2328
+ * row and all descendants should be fully expanded. Equivalent to `setExpanded(row, true)` with an optional third
2329
+ * boolean parameter.
2330
+ * @param row -
2331
+ * @param expandDescendants -
2332
+ */
2333
+ expand(row:TreeRow|number, expandDescendants?:boolean):void;
2334
+ /**
2335
+ * Collapses the given node, so that its children and descendants are not visible in the size or the viewport. The
2336
+ * parameter can be the row index, or the row object itself. Equivalent to <b>setExpanded(row, false, false)</b>.
2337
+ * @param row -
2338
+ */
2339
+ collapse(row:TreeRow|number):void;
2340
+ /**
2341
+ * Specifies if the given node should be expanded or collapsed. If this node has children, and the value is changed,
2342
+ * the size of the table will change. If node is to be expanded and the third parameter, <b>expandDescendants</b>,
2343
+ * is true, then its children will also be expanded.
2344
+ * @param row - the row to expand or collapse, either the absolute row index or the row object
2345
+ * @param isExpanded - true to expand the row, false to collapse
2346
+ * @param expandDescendants - true to expand the row and all descendants, false to expand only the row, defaults to
2347
+ * false
2348
+ */
2349
+ setExpanded(row:TreeRow|number, isExpanded:boolean, expandDescendants?:boolean):void;
2350
+ expandAll():void;
2351
+ collapseAll():void;
2352
+ /**
2353
+ * Tests if the specified row is expanded.
2354
+ * @param row - the row to test, either the absolute row index or the row object
2355
+ * @return boolean true if the row is expanded, false otherwise
2356
+ */
2357
+ isExpanded(row:TreeRow|number):boolean;
2358
+ setViewport(firstRow:number, lastRow:number, columns?:Array<Column>|undefined|null, updateInterval?:number|undefined|null):void;
2359
+ getViewportData():Promise<TreeViewportData>;
2360
+ /**
2361
+ * Indicates that the table will no longer be used, and server resources can be freed.
2362
+ */
2363
+ close():void;
2364
+ /**
2365
+ * Applies the given sort to all levels of the tree. Returns the previous sort in use.
2366
+ * @param sort -
2367
+ * @return {@link dh.Sort} array
2368
+ */
2369
+ applySort(sort:Sort[]):Array<Sort>;
2370
+ /**
2371
+ * Applies the given filter to the contents of the tree in such a way that if any node is visible, then any parent
2372
+ * node will be visible as well even if that parent node would not normally be visible due to the filter's
2373
+ * condition. Returns the previous sort in use.
2374
+ * @param filter -
2375
+ * @return {@link dh.FilterCondition} array
2380
2376
  */
2381
- static invoke(func:string, ...args:FilterValue[]):FilterCondition;
2377
+ applyFilter(filter:FilterCondition[]):Array<FilterCondition>;
2382
2378
  /**
2383
- * a filter condition which will check if the given value can be found in any supported column on whatever table
2384
- * this FilterCondition is passed to. This FilterCondition is somewhat unique in that it need not be given a column
2385
- * instance, but will adapt to any table. On numeric columns, with a value passed in which can be parsed as a
2386
- * number, the column will be filtered to numbers which equal, or can be "rounded" effectively to this number. On
2387
- * String columns, the given value will match any column which contains this string in a case-insensitive search. An
2388
- * optional second argument can be passed, an array of `FilterValue` from the columns to limit this search to (see
2389
- * {@link dh.Column.filter}).
2390
- * @param value -
2391
- * @param columns -
2392
- * @return dh.FilterCondition
2379
+ * Adding new columns to the table based on other columns using updateView() mechanics. Rollup tables are supported
2380
+ * but Tree tables will throw an {@link java.lang.UnsupportedOperationException} if this function is called.
2381
+ * @param customColumns -
2382
+ * @return {@link dh.CustomColumn} array
2393
2383
  */
2394
- static search(value:FilterValue, columns?:FilterValue[]):FilterCondition;
2395
- }
2396
-
2397
- /**
2398
- * Represents a set of Tables each corresponding to some key. The keys are available locally, but a call must be made to
2399
- * the server to get each Table. All tables will have the same structure.
2400
- */
2401
- export class PartitionedTable implements HasEventHandling {
2384
+ applyCustomColumns(customColumns:Array<string|CustomColumn>):Array<CustomColumn>;
2402
2385
  /**
2403
- * Indicates that a new key has been added to the array of keys, which can now be fetched with getTable.
2386
+ * a column with the given name, or throws an exception if it cannot be found
2387
+ * @param key -
2388
+ * @return {@link dh.Column}
2404
2389
  */
2405
- static readonly EVENT_KEYADDED:string;
2390
+ findColumn(key:string):Column;
2406
2391
  /**
2407
- * Indicates that a new key has been added to the array of keys, which can now be fetched with getTable.
2392
+ * an array with all of the named columns in order, or throws an exception if one cannot be found.
2393
+ * @param keys -
2394
+ * @return {@link dh.Column} array
2408
2395
  */
2409
- static readonly EVENT_DISCONNECT:string;
2396
+ findColumns(keys:string[]):Column[];
2410
2397
  /**
2411
- * Indicates that a new key has been added to the array of keys, which can now be fetched with getTable.
2398
+ * Provides Table-like selectDistinct functionality, but with a few quirks, since it is only fetching the distinct
2399
+ * values for the given columns in the source table:
2400
+ * <ul>
2401
+ * <li>Rollups may make no sense, since values are aggregated.</li>
2402
+ * <li>Values found on orphaned (and removed) nodes will show up in the resulting table, even though they are not in
2403
+ * the tree.</li>
2404
+ * <li>Values found on parent nodes which are only present in the tree since a child is visible will not be present
2405
+ * in the resulting table.</li>
2406
+ * </ul>
2412
2407
  */
2413
- static readonly EVENT_RECONNECT:string;
2408
+ selectDistinct(columns:Column[]):Promise<Table>;
2409
+ getTotalsTableConfig():Promise<TotalsTableConfig>;
2410
+ getTotalsTable(config?:object):Promise<TotalsTable>;
2411
+ getGrandTotalsTable(config?:object):Promise<TotalsTable>;
2414
2412
  /**
2415
- * Indicates that a new key has been added to the array of keys, which can now be fetched with getTable.
2413
+ * a new copy of this treetable, so it can be sorted and filtered separately, and maintain a different viewport.
2414
+ * Unlike Table, this will _not_ copy the filter or sort, since tree table viewport semantics differ, and without a
2415
+ * viewport set, the treetable doesn't evaluate these settings, and they aren't readable on the properties. Expanded
2416
+ * state is also not copied.
2417
+ * @return Promise of dh.TreeTable
2416
2418
  */
2417
- static readonly EVENT_RECONNECTFAILED:string;
2418
-
2419
- protected constructor();
2420
-
2419
+ copy():Promise<TreeTable>;
2421
2420
  /**
2422
- * Fetch the table with the given key. If the key does not exist, returns `null`.
2423
- * @param key - The key to fetch. An array of values for each key column, in the same order as the key columns are.
2424
- * @return Promise of dh.Table, or `null` if the key does not exist.
2421
+ * The current filter configuration of this Tree Table.
2422
+ * @return {@link dh.FilterCondition} array
2425
2423
  */
2426
- getTable(key:object):Promise<Table|undefined|null>;
2424
+ get filter():Array<FilterCondition>;
2427
2425
  /**
2428
- * Open a new table that is the result of merging all constituent tables. See
2429
- * {@link io.deephaven.engine.table.PartitionedTable.merge} for details.
2430
- * @return A merged representation of the constituent tables.
2426
+ * True if this is a roll-up and will provide the original rows that make up each grouping.
2427
+ * @return boolean
2431
2428
  */
2432
- getMergedTable():Promise<Table>;
2429
+ get includeConstituents():boolean;
2430
+ get groupedColumns():Array<Column>;
2433
2431
  /**
2434
- * The set of all currently known keys. This is kept up to date, so getting the list after adding an event listener
2435
- * for <b>keyadded</b> will ensure no keys are missed.
2436
- * @return Set of Object
2432
+ * True if this table has been closed.
2433
+ * @return boolean
2437
2434
  */
2438
- getKeys():Set<object>;
2435
+ get isClosed():boolean;
2439
2436
  /**
2440
- * Fetch a table containing all the valid keys of the partitioned table.
2441
- * @return Promise of a Table
2442
- * @deprecated
2437
+ * The current number of rows given the table's contents and the various expand/collapse states of each node. (No
2438
+ * totalSize is provided at this time; its definition becomes unclear between roll-up and tree tables, especially
2439
+ * when considering collapse/expand states).
2440
+ * @return double
2443
2441
  */
2444
- getKeyTable():Promise<Table>;
2442
+ get size():number;
2445
2443
  /**
2446
- * Fetch the underlying base table of the partitioned table.
2447
- * @return Promise of a Table
2444
+ * Returns the columns that are aggregated.
2445
+ * @return array of aggregated columns
2448
2446
  */
2449
- getBaseTable():Promise<Table>;
2447
+ get aggregatedColumns():Array<Column>;
2450
2448
  /**
2451
- * Indicates that this PartitionedTable will no longer be used, removing subcriptions to updated keys, etc. This
2452
- * will not affect tables in use.
2449
+ * The columns that can be shown in this Tree Table.
2450
+ * @return {@link dh.Column} array
2453
2451
  */
2454
- close():void;
2452
+ get columns():Array<Column>;
2455
2453
  /**
2456
- * The count of known keys.
2457
- * @return int
2454
+ * The current sort configuration of this Tree Table
2455
+ * @return {@link dh.Sort} array.
2458
2456
  */
2459
- get size():number;
2457
+ get sort():Array<Sort>;
2460
2458
  /**
2461
- * An array of the columns in the tables that can be retrieved from this partitioned table, including both key and
2462
- * non-key columns.
2463
- * @return Array of Column
2459
+ * The current list of custom columns added to this Tree Table.
2460
+ * @return {@link dh.CustomColumn} array
2464
2461
  */
2465
- get columns():Column[];
2462
+ get customColumns():Array<CustomColumn>;
2466
2463
  /**
2467
- * An array of all the key columns that the tables are partitioned by.
2468
- * @return Array of Column
2464
+ * True if this table may receive updates from the server, including size changed events, updated events after
2465
+ * initial snapshot.
2466
+ * @return boolean
2469
2467
  */
2470
- get keyColumns():Column[];
2468
+ get isRefreshing():boolean;
2471
2469
  /**
2472
2470
  * Listen for events on this object.
2473
2471
  * @param name - the name of the event to listen for
@@ -2489,273 +2487,301 @@ export namespace dh {
2489
2487
  }
2490
2488
 
2491
2489
  /**
2492
- * Event fired when a command is issued from the client.
2493
- */
2494
- export class CommandInfo {
2495
- constructor(code:string, result:Promise<dh.ide.CommandResult>);
2496
-
2497
- get result():Promise<dh.ide.CommandResult>;
2498
- get code():string;
2499
- }
2500
-
2501
- /**
2502
- * Deprecated for use in Deephaven Core.
2503
- * @deprecated
2504
- */
2505
- export class Client {
2506
- static readonly EVENT_REQUEST_FAILED:string;
2507
- static readonly EVENT_REQUEST_STARTED:string;
2508
- static readonly EVENT_REQUEST_SUCCEEDED:string;
2509
-
2510
- constructor();
2511
- }
2512
-
2513
- /**
2514
- * Describes a Sort present on the table. No visible constructor, created through the use of Column.sort(), will be tied
2515
- * to that particular column data. Sort instances are immutable, and use a builder pattern to make modifications. All
2516
- * methods return a new Sort instance.
2490
+ * Describes the structure of the column, and if desired can be used to get access to the data to be rendered in this
2491
+ * column.
2517
2492
  */
2518
- export class Sort {
2519
- static readonly ASCENDING:string;
2520
- static readonly DESCENDING:string;
2521
- static readonly REVERSE:string;
2493
+ export class Column {
2494
+ /**
2495
+ * If this column is part of a roll-up tree table, represents the type of the row data that can be found in this
2496
+ * column for leaf nodes if includeConstituents is enabled. Otherwise, it is <b>null</b>.
2497
+ * @return String
2498
+ */
2499
+ readonly constituentType?:string|null;
2500
+ readonly description?:string|null;
2522
2501
 
2523
2502
  protected constructor();
2524
2503
 
2525
2504
  /**
2526
- * Builds a Sort instance to sort values in ascending order.
2527
- * @return {@link dh.Sort}
2505
+ * the value for this column in the given row. Type will be consistent with the type of the Column.
2506
+ * @param row -
2507
+ * @return Any
2528
2508
  */
2529
- asc():Sort;
2509
+ get(row:Row):any;
2510
+ getFormat(row:Row):Format;
2530
2511
  /**
2531
- * Builds a Sort instance to sort values in descending order.
2512
+ * Creates a sort builder object, to be used when sorting by this column.
2532
2513
  * @return {@link dh.Sort}
2533
2514
  */
2534
- desc():Sort;
2515
+ sort():Sort;
2535
2516
  /**
2536
- * Builds a Sort instance which takes the absolute value before applying order.
2537
- * @return {@link dh.Sort}
2517
+ * Creates a new value for use in filters based on this column. Used either as a parameter to another filter
2518
+ * operation, or as a builder to create a filter operation.
2519
+ * @return {@link dh.FilterValue}
2538
2520
  */
2539
- abs():Sort;
2521
+ filter():FilterValue;
2522
+ /**
2523
+ * a <b>CustomColumn</b> object to apply using `applyCustomColumns` with the expression specified.
2524
+ * @param expression -
2525
+ * @return {@link dh.CustomColumn}
2526
+ */
2527
+ formatColor(expression:string, options?:CustomColumnOptions|undefined|null):CustomColumn;
2528
+ /**
2529
+ * a <b>CustomColumn</b> object to apply using <b>applyCustomColumns</b> with the expression specified.
2530
+ * @param expression -
2531
+ * @return {@link dh.CustomColumn}
2532
+ */
2533
+ formatNumber(expression:string, options?:CustomColumnOptions|undefined|null):CustomColumn;
2534
+ /**
2535
+ * a <b>CustomColumn</b> object to apply using <b>applyCustomColumns</b> with the expression specified.
2536
+ * @param expression -
2537
+ * @return {@link dh.CustomColumn}
2538
+ */
2539
+ formatDate(expression:string, options?:CustomColumnOptions|undefined|null):CustomColumn;
2540
2540
  toString():string;
2541
2541
  /**
2542
- * True if the absolute value of the column should be used when sorting; defaults to false.
2543
- * @return boolean
2542
+ * Label for this column.
2543
+ * @return String
2544
2544
  */
2545
- get isAbs():boolean;
2545
+ get name():string;
2546
2546
  /**
2547
- * The column which is sorted.
2548
- * @return {@link dh.Column}
2547
+ * True if this column is a partition column. Partition columns are used for filtering uncoalesced tables - see
2548
+ * {@link Table.uncoalesced}.
2549
+ * @return true if the column is a partition column
2549
2550
  */
2550
- get column():Column;
2551
+ get isPartitionColumn():boolean;
2551
2552
  /**
2552
- * The direction of this sort, either <b>ASC</b>, <b>DESC</b>, or <b>REVERSE</b>.
2553
+ *
2554
+ * @deprecated do not use. Internal index of the column in the table, to be used as a key on the Row.
2555
+ * @return int
2556
+ */
2557
+ get index():number;
2558
+ get isSortable():boolean;
2559
+ /**
2560
+ * Type of the row data that can be found in this column.
2553
2561
  * @return String
2554
2562
  */
2555
- get direction():string;
2563
+ get type():string;
2564
+ /**
2565
+ * Format entire rows colors using the expression specified. Returns a <b>CustomColumn</b> object to apply to a
2566
+ * table using <b>applyCustomColumns</b> with the parameters specified.
2567
+ * @param expression -
2568
+ * @param options -
2569
+ * @return {@link dh.CustomColumn}
2570
+ */
2571
+ static formatRowColor(expression:string, options?:CustomColumnOptions|undefined|null):CustomColumn;
2572
+ /**
2573
+ * a <b>CustomColumn</b> object to apply using <b>applyCustomColumns</b> with the expression specified.
2574
+ * @param name -
2575
+ * @param expression -
2576
+ * @param options -
2577
+ * @return {@link dh.CustomColumn}
2578
+ */
2579
+ static createCustomColumn(name:string, expression:string, options?:CustomColumnOptions|undefined|null):CustomColumn;
2556
2580
  }
2557
2581
 
2558
2582
  /**
2559
- * Describes how a Totals Table will be generated from its parent table. Each table has a default (which may be null)
2560
- * indicating how that table was configured when it was declared, and each Totals Table has a similar property
2561
- * describing how it was created. Both the <b>Table.getTotalsTable</b> and <b>Table.getGrandTotalsTable</b> methods take
2562
- * this config as an optional parameter - without it, the table's default will be used, or if null, a default instance
2563
- * of <b>TotalsTableConfig</b> will be supplied.
2564
- *
2565
- * This class has a no-arg constructor, allowing an instance to be made with the default values provided. However, any
2566
- * JS object can be passed in to the methods which accept instances of this type, provided their values adhere to the
2567
- * expected formats.
2583
+ * Describes data that can be filtered, either a column reference or a literal value. Used this way, the type of a value
2584
+ * can be specified so that values which are ambiguous or not well supported in JS will not be confused with Strings or
2585
+ * imprecise numbers (e.g., nanosecond-precision date values). Additionally, once wrapped in this way, methods can be
2586
+ * called on these value literal instances. These instances are immutable - any method called on them returns a new
2587
+ * instance.
2568
2588
  */
2569
- export class TotalsTableConfig {
2570
- /**
2571
- * @deprecated
2572
- */
2573
- static readonly COUNT:string;
2589
+ export class FilterValue {
2590
+ protected constructor();
2591
+
2574
2592
  /**
2575
- * @deprecated
2593
+ * Constructs a number for the filter API from the given parameter. Can also be used on the values returned from
2594
+ * {@link TableData.get} for DateTime values. To create
2595
+ * a filter with a date, use <b>dh.DateWrapper.ofJsDate</b> or
2596
+ * {@link i18n.DateTimeFormat.parse}. To create a filter with a
2597
+ * 64-bit long integer, use {@link LongWrapper.ofString}.
2598
+ * @param input - the number to wrap as a FilterValue
2599
+ * @return an immutable FilterValue that can be built into a filter
2576
2600
  */
2577
- static readonly MIN:string;
2601
+ static ofNumber(input:LongWrapper|number):FilterValue;
2578
2602
  /**
2579
- * @deprecated
2603
+ * a filter condition checking if the current value is equal to the given parameter
2604
+ * @param term -
2605
+ * @return {@link dh.FilterCondition}
2580
2606
  */
2581
- static readonly MAX:string;
2607
+ eq(term:FilterValue):FilterCondition;
2582
2608
  /**
2583
- * @deprecated
2609
+ * a filter condition checking if the current value is equal to the given parameter, ignoring differences of upper
2610
+ * vs lower case
2611
+ * @param term -
2612
+ * @return {@link dh.FilterCondition}
2584
2613
  */
2585
- static readonly SUM:string;
2614
+ eqIgnoreCase(term:FilterValue):FilterCondition;
2586
2615
  /**
2587
- * @deprecated
2616
+ * a filter condition checking if the current value is not equal to the given parameter
2617
+ * @param term -
2618
+ * @return {@link dh.FilterCondition}
2588
2619
  */
2589
- static readonly ABS_SUM:string;
2620
+ notEq(term:FilterValue):FilterCondition;
2590
2621
  /**
2591
- * @deprecated
2622
+ * a filter condition checking if the current value is not equal to the given parameter, ignoring differences of
2623
+ * upper vs lower case
2624
+ * @param term -
2625
+ * @return {@link dh.FilterCondition}
2592
2626
  */
2593
- static readonly VAR:string;
2627
+ notEqIgnoreCase(term:FilterValue):FilterCondition;
2594
2628
  /**
2595
- * @deprecated
2629
+ * a filter condition checking if the current value is greater than the given parameter
2630
+ * @param term -
2631
+ * @return {@link dh.FilterCondition}
2596
2632
  */
2597
- static readonly AVG:string;
2633
+ greaterThan(term:FilterValue):FilterCondition;
2598
2634
  /**
2599
- * @deprecated
2635
+ * a filter condition checking if the current value is less than the given parameter
2636
+ * @param term -
2637
+ * @return {@link dh.FilterCondition}
2600
2638
  */
2601
- static readonly STD:string;
2639
+ lessThan(term:FilterValue):FilterCondition;
2602
2640
  /**
2603
- * @deprecated
2641
+ * a filter condition checking if the current value is greater than or equal to the given parameter
2642
+ * @param term -
2643
+ * @return {@link dh.FilterCondition}
2604
2644
  */
2605
- static readonly FIRST:string;
2645
+ greaterThanOrEqualTo(term:FilterValue):FilterCondition;
2606
2646
  /**
2607
- * @deprecated
2647
+ * a filter condition checking if the current value is less than or equal to the given parameter
2648
+ * @param term -
2649
+ * @return {@link dh.FilterCondition}
2608
2650
  */
2609
- static readonly LAST:string;
2651
+ lessThanOrEqualTo(term:FilterValue):FilterCondition;
2610
2652
  /**
2611
- * @deprecated
2653
+ * a filter condition checking if the current value is in the given set of values
2654
+ * @param terms -
2655
+ * @return {@link dh.FilterCondition}
2612
2656
  */
2613
- static readonly SKIP:string;
2657
+ in(terms:FilterValue[]):FilterCondition;
2614
2658
  /**
2615
- * Specifies if a Totals Table should be expanded by default in the UI. Defaults to false.
2659
+ * a filter condition checking if the current value is in the given set of values, ignoring differences of upper vs
2660
+ * lower case
2661
+ * @param terms -
2662
+ * @return {@link dh.FilterCondition}
2616
2663
  */
2617
- showTotalsByDefault:boolean;
2664
+ inIgnoreCase(terms:FilterValue[]):FilterCondition;
2618
2665
  /**
2619
- * Specifies if a Grand Totals Table should be expanded by default in the UI. Defaults to false.
2666
+ * a filter condition checking that the current value is not in the given set of values
2667
+ * @param terms -
2668
+ * @return {@link dh.FilterCondition}
2620
2669
  */
2621
- showGrandTotalsByDefault:boolean;
2670
+ notIn(terms:FilterValue[]):FilterCondition;
2622
2671
  /**
2623
- * Specifies the default operation for columns that do not have a specific operation applied; defaults to "Sum".
2672
+ * a filter condition checking that the current value is not in the given set of values, ignoring differences of
2673
+ * upper vs lower case
2674
+ * @param terms -
2675
+ * @return {@link dh.FilterCondition}
2624
2676
  */
2625
- defaultOperation:AggregationOperationType;
2677
+ notInIgnoreCase(terms:FilterValue[]):FilterCondition;
2626
2678
  /**
2627
- * Mapping from each column name to the aggregation(s) that should be applied to that column in the resulting Totals
2628
- * Table. If a column is omitted, the defaultOperation is used.
2679
+ * a filter condition checking if the given value contains the given string value
2680
+ * @param term -
2681
+ * @return {@link dh.FilterCondition}
2629
2682
  */
2630
- operationMap:{ [key: string]: Array<AggregationOperationType>; };
2683
+ contains(term:FilterValue):FilterCondition;
2631
2684
  /**
2632
- * Groupings to use when generating the Totals Table. One row will exist for each unique set of values observed in
2633
- * these columns. See also `Table.selectDistinct`.
2685
+ * a filter condition checking if the given value contains the given string value, ignoring differences of upper vs
2686
+ * lower case
2687
+ * @param term -
2688
+ * @return {@link dh.FilterCondition}
2634
2689
  */
2635
- groupBy:Array<string>;
2636
-
2637
- constructor();
2638
-
2639
- toString():string;
2640
- }
2641
-
2642
- export class DateWrapper extends LongWrapper {
2643
- protected constructor();
2644
-
2645
- static ofJsDate(date:Date):DateWrapper;
2646
- asDate():Date;
2647
- }
2648
-
2649
- export class LongWrapper {
2650
- protected constructor();
2651
-
2652
- static ofString(str:string):LongWrapper;
2653
- asNumber():number;
2654
- valueOf():string;
2655
- toString():string;
2656
- }
2657
-
2658
- /**
2659
- * A js type for operating on input tables.
2660
- *
2661
- * Represents a User Input Table, which can have data added to it from other sources.
2662
- *
2663
- * You may add rows using dictionaries of key-value tuples (representing columns by name), add tables containing all the
2664
- * key/value columns to add, or delete tables containing the keys to delete. Each operation is atomic, and will either
2665
- * succeed completely or fail completely. To guarantee order of operations, apply an operation and wait for the response
2666
- * before sending the next operation.
2667
- *
2668
- * Each table has one or more key columns, where each unique combination of keys will appear at most once in the table.
2669
- *
2670
- * To view the results of the Input Table, you should use standard table operations on the InputTable's source Table
2671
- * object.
2672
- */
2673
- export class InputTable {
2674
- protected constructor();
2675
-
2690
+ containsIgnoreCase(term:FilterValue):FilterCondition;
2676
2691
  /**
2677
- * Adds a single row to the table. For each key or value column name in the Input Table, we retrieve that javascript
2678
- * property at that name and validate it can be put into the given column type.
2679
- * @param row -
2680
- * @param userTimeZone -
2681
- * @return Promise of dh.InputTable
2692
+ * a filter condition checking if the given value matches the provided regular expressions string. Regex patterns
2693
+ * use Java regex syntax
2694
+ * @param pattern -
2695
+ * @return {@link dh.FilterCondition}
2682
2696
  */
2683
- addRow(row:{ [key: string]: any; }, userTimeZone?:string):Promise<InputTable>;
2697
+ matches(pattern:FilterValue):FilterCondition;
2684
2698
  /**
2685
- * Add multiple rows to a table.
2686
- * @param rows -
2687
- * @param userTimeZone -
2688
- * @return Promise of dh.InputTable
2699
+ * a filter condition checking if the given value matches the provided regular expressions string, ignoring
2700
+ * differences of upper vs lower case. Regex patterns use Java regex syntax
2701
+ * @param pattern -
2702
+ * @return {@link dh.FilterCondition}
2689
2703
  */
2690
- addRows(rows:{ [key: string]: any; }[], userTimeZone?:string):Promise<InputTable>;
2704
+ matchesIgnoreCase(pattern:FilterValue):FilterCondition;
2691
2705
  /**
2692
- * Add an entire table to this Input Table. Only column names that match the definition of the input table will be
2693
- * copied, and all key columns must have values filled in. This only copies the current state of the source table;
2694
- * future updates to the source table will not be reflected in the Input Table. The returned promise will be
2695
- * resolved to the same InputTable instance this method was called upon once the server returns.
2696
- * @param tableToAdd -
2697
- * @return Promise of dh.InputTable
2706
+ * a filter condition checking if the current value is a true boolean
2707
+ * @return {@link dh.FilterCondition}
2698
2708
  */
2699
- addTable(tableToAdd:Table):Promise<InputTable>;
2709
+ isTrue():FilterCondition;
2700
2710
  /**
2701
- * Add multiple tables to this Input Table.
2702
- * @param tablesToAdd -
2703
- * @return Promise of dh.InputTable
2711
+ * a filter condition checking if the current value is a false boolean
2712
+ * @return {@link dh.FilterCondition}
2704
2713
  */
2705
- addTables(tablesToAdd:Table[]):Promise<InputTable>;
2714
+ isFalse():FilterCondition;
2706
2715
  /**
2707
- * Deletes an entire table from this Input Table. Key columns must match the Input Table.
2708
- * @param tableToDelete -
2709
- * @return Promise of dh.InputTable
2716
+ * a filter condition checking if the current value is a null value
2717
+ * @return {@link dh.FilterCondition}
2710
2718
  */
2711
- deleteTable(tableToDelete:Table):Promise<InputTable>;
2719
+ isNull():FilterCondition;
2712
2720
  /**
2713
- * Delete multiple tables from this Input Table.
2714
- * @param tablesToDelete -
2721
+ * a filter condition invoking the given method on the current value, with the given parameters. Currently supported
2722
+ * functions that can be invoked on a String:
2723
+ * <ul>
2724
+ * <li><b>startsWith</b>: Returns true if the current string value starts with the supplied string argument</li>
2725
+ * <li><b>endsWith</b>: Returns true if the current string value ends with the supplied string argument</li>
2726
+ * <li><b>matches</b>: Returns true if the current string value matches the supplied string argument used as a Java
2727
+ * regular expression</li>
2728
+ * <li><b>contains</b>: Returns true if the current string value contains the supplied string argument
2729
+ * <p>
2730
+ * When invoking against a constant, this should be avoided in favor of FilterValue.contains
2731
+ * </p>
2732
+ * </li>
2733
+ * </ul>
2734
+ * @param method -
2735
+ * @param args -
2715
2736
  * @return
2716
2737
  */
2717
- deleteTables(tablesToDelete:Table[]):Promise<InputTable>;
2718
- /**
2719
- * A list of the key columns, by name
2720
- * @return String array.
2721
- */
2722
- get keys():string[];
2723
- /**
2724
- * A list of the value columns, by name
2725
- * @return String array.
2726
- */
2727
- get values():string[];
2728
- /**
2729
- * A list of the key columns.
2730
- * @return Column array.
2731
- */
2732
- get keyColumns():Column[];
2738
+ invoke(method:string, ...args:FilterValue[]):FilterCondition;
2739
+ toString():string;
2733
2740
  /**
2734
- * A list of the value Column objects
2735
- * @return {@link dh.Column} array.
2741
+ * Constructs a string for the filter API from the given parameter.
2742
+ * @param input -
2743
+ * @return
2736
2744
  */
2737
- get valueColumns():Column[];
2745
+ static ofString(input:any):FilterValue;
2738
2746
  /**
2739
- * The source table for this Input Table
2740
- * @return dh.table
2747
+ * Constructs a boolean for the filter API from the given parameter.
2748
+ * @param b -
2749
+ * @return
2741
2750
  */
2742
- get table():Table;
2751
+ static ofBoolean(b:boolean):FilterValue;
2743
2752
  }
2744
2753
 
2745
- export class LoginCredentials {
2746
- type?:string|null;
2747
- username?:string|null;
2748
- token?:string|null;
2749
2754
 
2750
- constructor();
2755
+ type ValueTypeType = string;
2756
+ export class ValueType {
2757
+ static readonly STRING:ValueTypeType;
2758
+ static readonly NUMBER:ValueTypeType;
2759
+ static readonly DOUBLE:ValueTypeType;
2760
+ static readonly LONG:ValueTypeType;
2761
+ static readonly DATETIME:ValueTypeType;
2762
+ static readonly BOOLEAN:ValueTypeType;
2751
2763
  }
2752
2764
 
2753
-
2754
- type SearchDisplayModeType = string;
2755
- export class SearchDisplayMode {
2756
- static readonly SEARCH_DISPLAY_DEFAULT:SearchDisplayModeType;
2757
- static readonly SEARCH_DISPLAY_HIDE:SearchDisplayModeType;
2758
- static readonly SEARCH_DISPLAY_SHOW:SearchDisplayModeType;
2765
+ /**
2766
+ * This enum describes the name of each supported operation/aggregation type when creating a `TreeTable`.
2767
+ */
2768
+ type AggregationOperationType = string;
2769
+ export class AggregationOperation {
2770
+ static readonly COUNT:AggregationOperationType;
2771
+ static readonly COUNT_DISTINCT:AggregationOperationType;
2772
+ static readonly DISTINCT:AggregationOperationType;
2773
+ static readonly MIN:AggregationOperationType;
2774
+ static readonly MAX:AggregationOperationType;
2775
+ static readonly SUM:AggregationOperationType;
2776
+ static readonly ABS_SUM:AggregationOperationType;
2777
+ static readonly VAR:AggregationOperationType;
2778
+ static readonly AVG:AggregationOperationType;
2779
+ static readonly MEDIAN:AggregationOperationType;
2780
+ static readonly STD:AggregationOperationType;
2781
+ static readonly FIRST:AggregationOperationType;
2782
+ static readonly LAST:AggregationOperationType;
2783
+ static readonly UNIQUE:AggregationOperationType;
2784
+ static readonly SKIP:AggregationOperationType;
2759
2785
  }
2760
2786
 
2761
2787
  /**
@@ -2767,6 +2793,13 @@ export namespace dh {
2767
2793
  static readonly ROLLUP_NODE_TYPE_CONSTITUENT:RollupNodeTypeType;
2768
2794
  }
2769
2795
 
2796
+ type SearchDisplayModeType = string;
2797
+ export class SearchDisplayMode {
2798
+ static readonly SEARCH_DISPLAY_DEFAULT:SearchDisplayModeType;
2799
+ static readonly SEARCH_DISPLAY_HIDE:SearchDisplayModeType;
2800
+ static readonly SEARCH_DISPLAY_SHOW:SearchDisplayModeType;
2801
+ }
2802
+
2770
2803
  /**
2771
2804
  * A set of string constants that can be used to describe the different objects the JS API can export.
2772
2805
  */
@@ -2783,38 +2816,6 @@ export namespace dh {
2783
2816
  static readonly TREEMAP:VariableTypeType;
2784
2817
  }
2785
2818
 
2786
- /**
2787
- * This enum describes the name of each supported operation/aggregation type when creating a `TreeTable`.
2788
- */
2789
- type AggregationOperationType = string;
2790
- export class AggregationOperation {
2791
- static readonly COUNT:AggregationOperationType;
2792
- static readonly COUNT_DISTINCT:AggregationOperationType;
2793
- static readonly DISTINCT:AggregationOperationType;
2794
- static readonly MIN:AggregationOperationType;
2795
- static readonly MAX:AggregationOperationType;
2796
- static readonly SUM:AggregationOperationType;
2797
- static readonly ABS_SUM:AggregationOperationType;
2798
- static readonly VAR:AggregationOperationType;
2799
- static readonly AVG:AggregationOperationType;
2800
- static readonly MEDIAN:AggregationOperationType;
2801
- static readonly STD:AggregationOperationType;
2802
- static readonly FIRST:AggregationOperationType;
2803
- static readonly LAST:AggregationOperationType;
2804
- static readonly UNIQUE:AggregationOperationType;
2805
- static readonly SKIP:AggregationOperationType;
2806
- }
2807
-
2808
- type ValueTypeType = string;
2809
- export class ValueType {
2810
- static readonly STRING:ValueTypeType;
2811
- static readonly NUMBER:ValueTypeType;
2812
- static readonly DOUBLE:ValueTypeType;
2813
- static readonly LONG:ValueTypeType;
2814
- static readonly DATETIME:ValueTypeType;
2815
- static readonly BOOLEAN:ValueTypeType;
2816
- }
2817
-
2818
2819
  }
2819
2820
 
2820
2821
  export namespace dh.ide {
@@ -2882,38 +2883,6 @@ export namespace dh.ide {
2882
2883
  get message():string;
2883
2884
  }
2884
2885
  /**
2885
- * Describes changes in the current set of variables in the script session. Note that variables that changed value
2886
- * without changing type will be included as <b>updated</b>, but if a new value with one type replaces an old value with
2887
- * a different type, this will be included as an entry in both <b>removed</b> and <b>created</b> to indicate the old and
2888
- * new types.
2889
- */
2890
- export interface VariableChanges {
2891
- /**
2892
- *
2893
- * @return The variables that no longer exist after this operation, or were replaced by some variable with a
2894
- * different type.
2895
- */
2896
- get removed():Array<VariableDefinition>;
2897
- /**
2898
- *
2899
- * @return The variables that were created by this operation, or have a new type.
2900
- */
2901
- get created():Array<VariableDefinition>;
2902
- /**
2903
- *
2904
- * @return The variables that changed value during this operation.
2905
- */
2906
- get updated():Array<VariableDefinition>;
2907
- }
2908
- /**
2909
- * Specifies a type and either id or name (but not both).
2910
- */
2911
- export interface VariableDescriptor {
2912
- type:string;
2913
- id?:string|null;
2914
- name?:string|null;
2915
- }
2916
- /**
2917
2886
  * Indicates the result of code run on the server.
2918
2887
  */
2919
2888
  export interface CommandResult {
@@ -2938,63 +2907,41 @@ export namespace dh.ide {
2938
2907
  */
2939
2908
  get startTimestamp():dh.DateWrapper;
2940
2909
  }
2941
- }
2942
-
2943
- export namespace dh.i18n {
2944
-
2945
2910
  /**
2946
- * Exported wrapper of the GWT NumberFormat, plus LongWrapper support
2947
- *
2948
- * Utility class to parse and format numbers, using the same format patterns as are supported by the standard Java
2949
- * implementation used in the Deephaven server and swing client. Works for numeric types including BigInteger and
2950
- * BigDecimal.
2911
+ * Specifies a type and either id or name (but not both).
2951
2912
  */
2952
- export class NumberFormat {
2953
- /**
2954
- * Creates a new number format instance. This generally should be avoided in favor of the static `getFormat`
2955
- * function, which will create and cache an instance so that later calls share the same instance.
2956
- * @param pattern -
2957
- */
2958
- constructor(pattern:string);
2959
-
2960
- /**
2961
- * a number format instance matching the specified format. If this format has not been specified before, a new
2962
- * instance will be created and cached for later reuse. Prefer this method to calling the constructor directly to
2963
- * take advantage of caching
2964
- * @param pattern -
2965
- * @return dh.i18n.NumberFormat
2966
- */
2967
- static getFormat(pattern:string):NumberFormat;
2968
- /**
2969
- * Parses the given text using the cached format matching the given pattern.
2970
- * @param pattern -
2971
- * @param text -
2972
- * @return double
2973
- */
2974
- static parse(pattern:string, text:string):number;
2913
+ export interface VariableDescriptor {
2914
+ type:string;
2915
+ id?:string|null;
2916
+ name?:string|null;
2917
+ }
2918
+ /**
2919
+ * Describes changes in the current set of variables in the script session. Note that variables that changed value
2920
+ * without changing type will be included as <b>updated</b>, but if a new value with one type replaces an old value with
2921
+ * a different type, this will be included as an entry in both <b>removed</b> and <b>created</b> to indicate the old and
2922
+ * new types.
2923
+ */
2924
+ export interface VariableChanges {
2975
2925
  /**
2976
- * Formats the specified number (or Java <b>long</b>, <b>BigInteger</b> or <b>BigDecimal</b> value) using the cached
2977
- * format matching the given pattern string.
2978
- * @param pattern -
2979
- * @param number -
2980
- * @return String
2926
+ *
2927
+ * @return The variables that no longer exist after this operation, or were replaced by some variable with a
2928
+ * different type.
2981
2929
  */
2982
- static format(pattern:string, number:number|dh.BigIntegerWrapper|dh.BigDecimalWrapper|dh.LongWrapper):string;
2930
+ get removed():Array<VariableDefinition>;
2983
2931
  /**
2984
- * Parses the given text using this instance's pattern into a JS Number.
2985
- * @param text -
2986
- * @return double
2932
+ *
2933
+ * @return The variables that were created by this operation, or have a new type.
2987
2934
  */
2988
- parse(text:string):number;
2935
+ get created():Array<VariableDefinition>;
2989
2936
  /**
2990
- * Formats the specified number (or Java `long`, `BigInteger` or `BigDecimal` value) using this instance's pattern.
2991
- * @param number -
2992
- * @return String
2937
+ *
2938
+ * @return The variables that changed value during this operation.
2993
2939
  */
2994
- format(number:number|dh.BigIntegerWrapper|dh.BigDecimalWrapper|dh.LongWrapper):string;
2995
- toString():string;
2940
+ get updated():Array<VariableDefinition>;
2996
2941
  }
2942
+ }
2997
2943
 
2944
+ export namespace dh.i18n {
2998
2945
 
2999
2946
  /**
3000
2947
  * Largely an exported wrapper for the GWT DateFormat, but also includes support for formatting nanoseconds as an
@@ -3094,6 +3041,60 @@ export namespace dh.i18n {
3094
3041
  toString():string;
3095
3042
  }
3096
3043
 
3044
+ /**
3045
+ * Exported wrapper of the GWT NumberFormat, plus LongWrapper support
3046
+ *
3047
+ * Utility class to parse and format numbers, using the same format patterns as are supported by the standard Java
3048
+ * implementation used in the Deephaven server and swing client. Works for numeric types including BigInteger and
3049
+ * BigDecimal.
3050
+ */
3051
+ export class NumberFormat {
3052
+ /**
3053
+ * Creates a new number format instance. This generally should be avoided in favor of the static `getFormat`
3054
+ * function, which will create and cache an instance so that later calls share the same instance.
3055
+ * @param pattern -
3056
+ */
3057
+ constructor(pattern:string);
3058
+
3059
+ /**
3060
+ * a number format instance matching the specified format. If this format has not been specified before, a new
3061
+ * instance will be created and cached for later reuse. Prefer this method to calling the constructor directly to
3062
+ * take advantage of caching
3063
+ * @param pattern -
3064
+ * @return dh.i18n.NumberFormat
3065
+ */
3066
+ static getFormat(pattern:string):NumberFormat;
3067
+ /**
3068
+ * Parses the given text using the cached format matching the given pattern.
3069
+ * @param pattern -
3070
+ * @param text -
3071
+ * @return double
3072
+ */
3073
+ static parse(pattern:string, text:string):number;
3074
+ /**
3075
+ * Formats the specified number (or Java <b>long</b>, <b>BigInteger</b> or <b>BigDecimal</b> value) using the cached
3076
+ * format matching the given pattern string.
3077
+ * @param pattern -
3078
+ * @param number -
3079
+ * @return String
3080
+ */
3081
+ static format(pattern:string, number:number|dh.BigIntegerWrapper|dh.BigDecimalWrapper|dh.LongWrapper):string;
3082
+ /**
3083
+ * Parses the given text using this instance's pattern into a JS Number.
3084
+ * @param text -
3085
+ * @return double
3086
+ */
3087
+ parse(text:string):number;
3088
+ /**
3089
+ * Formats the specified number (or Java `long`, `BigInteger` or `BigDecimal` value) using this instance's pattern.
3090
+ * @param number -
3091
+ * @return String
3092
+ */
3093
+ format(number:number|dh.BigIntegerWrapper|dh.BigDecimalWrapper|dh.LongWrapper):string;
3094
+ toString():string;
3095
+ }
3096
+
3097
+
3097
3098
  /**
3098
3099
  * Represents the timezones supported by Deephaven. Can be used to format dates, taking into account the offset changing
3099
3100
  * throughout the year (potentially changing each year). These instances mostly are useful at this time to pass to the
@@ -3210,31 +3211,29 @@ export namespace dh.i18n {
3210
3211
  export namespace dh.grpc {
3211
3212
 
3212
3213
  /**
3213
- * Options for creating a gRPC stream transport instance.
3214
+ * gRPC transport implementation.
3214
3215
  */
3215
- export interface GrpcTransportOptions {
3216
- /**
3217
- * The gRPC method URL.
3218
- */
3219
- url:URL;
3216
+ export interface GrpcTransport {
3220
3217
  /**
3221
- * True to enable debug logging for this stream.
3218
+ * Starts the stream, sending metadata to the server.
3219
+ * @param metadata - the headers to send the server when opening the connection
3222
3220
  */
3223
- debug:boolean;
3221
+ start(metadata:{ [key: string]: string|Array<string>; }):void;
3224
3222
  /**
3225
- * Callback for when headers and status are received. The headers are a map of header names to values, and the
3226
- * status is the HTTP status code. If the connection could not be made, the status should be 0.
3223
+ * Sends a message to the server.
3224
+ * @param msgBytes - bytes to send to the server
3227
3225
  */
3228
- onHeaders:(headers:{ [key: string]: string|Array<string>; },status:number)=>void;
3226
+ sendMessage(msgBytes:Uint8Array):void;
3229
3227
  /**
3230
- * Callback for when a chunk of data is received.
3228
+ * "Half close" the stream, signaling to the server that no more messages will be sent, but that the client is still
3229
+ * open to receiving messages.
3231
3230
  */
3232
- onChunk:(chunk:Uint8Array)=>void;
3231
+ finishSend():void;
3233
3232
  /**
3234
- * Callback for when the stream ends, with an error instance if it can be provided. Note that the present
3235
- * implementation does not consume errors, even if provided.
3233
+ * End the stream, both notifying the server that no more messages will be sent nor received, and preventing the
3234
+ * client from receiving any more events.
3236
3235
  */
3237
- onEnd:(error?:Error|undefined|null)=>void;
3236
+ cancel():void;
3238
3237
  }
3239
3238
  /**
3240
3239
  * Factory for creating gRPC transports.
@@ -3255,29 +3254,31 @@ export namespace dh.grpc {
3255
3254
  get supportsClientStreaming():boolean;
3256
3255
  }
3257
3256
  /**
3258
- * gRPC transport implementation.
3257
+ * Options for creating a gRPC stream transport instance.
3259
3258
  */
3260
- export interface GrpcTransport {
3259
+ export interface GrpcTransportOptions {
3261
3260
  /**
3262
- * Starts the stream, sending metadata to the server.
3263
- * @param metadata - the headers to send the server when opening the connection
3261
+ * The gRPC method URL.
3264
3262
  */
3265
- start(metadata:{ [key: string]: string|Array<string>; }):void;
3263
+ url:URL;
3266
3264
  /**
3267
- * Sends a message to the server.
3268
- * @param msgBytes - bytes to send to the server
3265
+ * True to enable debug logging for this stream.
3269
3266
  */
3270
- sendMessage(msgBytes:Uint8Array):void;
3267
+ debug:boolean;
3271
3268
  /**
3272
- * "Half close" the stream, signaling to the server that no more messages will be sent, but that the client is still
3273
- * open to receiving messages.
3269
+ * Callback for when headers and status are received. The headers are a map of header names to values, and the
3270
+ * status is the HTTP status code. If the connection could not be made, the status should be 0.
3274
3271
  */
3275
- finishSend():void;
3272
+ onHeaders:(headers:{ [key: string]: string|Array<string>; },status:number)=>void;
3276
3273
  /**
3277
- * End the stream, both notifying the server that no more messages will be sent nor received, and preventing the
3278
- * client from receiving any more events.
3274
+ * Callback for when a chunk of data is received.
3279
3275
  */
3280
- cancel():void;
3276
+ onChunk:(chunk:Uint8Array)=>void;
3277
+ /**
3278
+ * Callback for when the stream ends, with an error instance if it can be provided. Note that the present
3279
+ * implementation does not consume errors, even if provided.
3280
+ */
3281
+ onEnd:(error?:Error|undefined|null)=>void;
3281
3282
  }
3282
3283
  }
3283
3284
 
@@ -3352,26 +3353,6 @@ export namespace dh.plot {
3352
3353
  get minRange():number;
3353
3354
  }
3354
3355
  /**
3355
- * Describes how to access and display data required within a series.
3356
- */
3357
- export interface SeriesDataSource {
3358
- /**
3359
- * the type of data stored in the underlying table's Column.
3360
- * @return String
3361
- */
3362
- get columnType():string;
3363
- /**
3364
- * the axis that this source should be drawn on.
3365
- * @return dh.plot.Axis
3366
- */
3367
- get axis():Axis;
3368
- /**
3369
- * the feature of this series represented by this source. See the <b>SourceType</b> enum for more details.
3370
- * @return int
3371
- */
3372
- get type():SourceTypeType;
3373
- }
3374
- /**
3375
3356
  * Provides access to the data for displaying in a figure.
3376
3357
  */
3377
3358
  export interface Series {
@@ -3415,6 +3396,12 @@ export namespace dh.plot {
3415
3396
  get multiSeries():MultiSeries;
3416
3397
  get shapeLabel():string;
3417
3398
  }
3399
+ export interface OneClick {
3400
+ setValueForColumn(columnName:string, value:any):void;
3401
+ getValueForColumn(columName:string):any;
3402
+ get requireAllFiltersToDisplay():boolean;
3403
+ get columns():dh.Column[];
3404
+ }
3418
3405
  /**
3419
3406
  * Describes a template that will be used to make new series instances when a new table added to a plotBy.
3420
3407
  */
@@ -3430,154 +3417,29 @@ export namespace dh.plot {
3430
3417
  */
3431
3418
  get plotStyle():SeriesPlotStyleType;
3432
3419
  }
3433
- export interface FigureDataUpdatedEvent {
3434
- getArray(series:Series, sourceType:number, mappingFunc?:(arg0:any)=>any):Array<any>;
3435
- get series():Series[];
3436
- }
3437
- export interface OneClick {
3438
- setValueForColumn(columnName:string, value:any):void;
3439
- getValueForColumn(columName:string):any;
3440
- get requireAllFiltersToDisplay():boolean;
3441
- get columns():dh.Column[];
3442
- }
3443
-
3444
- export class SeriesDescriptor {
3445
- plotStyle:string;
3446
- name?:string|null;
3447
- linesVisible?:boolean|null;
3448
- shapesVisible?:boolean|null;
3449
- gradientVisible?:boolean|null;
3450
- lineColor?:string|null;
3451
- pointLabelFormat?:string|null;
3452
- xToolTipPattern?:string|null;
3453
- yToolTipPattern?:string|null;
3454
- shapeLabel?:string|null;
3455
- shapeSize?:number|null;
3456
- shapeColor?:string|null;
3457
- shape?:string|null;
3458
- dataSources:Array<SourceDescriptor>;
3459
-
3460
- constructor();
3461
- }
3462
-
3463
3420
  /**
3464
- * Provides the details for a figure.
3465
- *
3466
- * The Deephaven JS API supports automatic lossless downsampling of time-series data, when that data is plotted in one
3467
- * or more line series. Using a scatter plot or a X-axis of some type other than DateTime will prevent this feature from
3468
- * being applied to a series. To enable this feature, invoke <b>Axis.range(...)</b> to specify the length in pixels of
3469
- * the axis on the screen, and the range of values that are visible, and the server will use that width (and range, if
3470
- * any) to reduce the number of points sent to the client.
3471
- *
3472
- * Downsampling can also be controlled when calling either <b>Figure.subscribe()</b> or <b>Series.subscribe()</b> - both
3473
- * can be given an optional <b>dh.plot.DownsampleOptions</b> argument. Presently only two valid values exist,
3474
- * <b>DEFAULT</b>, and <b>DISABLE</b>, and if no argument is specified, <b>DEFAULT</b> is assumed. If there are more
3475
- * than 30,000 rows in a table, downsampling will be encouraged - data will not load without calling
3476
- * <b>subscribe(DISABLE)</b> or enabling downsampling via <b>Axis.range(...)</b>. If there are more than 200,000 rows,
3477
- * data will refuse to load without downsampling and <b>subscribe(DISABLE)</b> would have no effect.
3478
- *
3479
- * Downsampled data looks like normal data, except that select items have been removed if they would be redundant in the
3480
- * UI given the current configuration. Individual rows are intact, so that a tooltip or some other UI item is sure to be
3481
- * accurate and consistent, and at least the highest and lowest value for each axis will be retained as well, to ensure
3482
- * that the "important" values are visible.
3483
- *
3484
- * Four events exist to help with interacting with downsampled data, all fired from the <b>Figure</b> instance itself.
3485
- * First, <b>downsampleneeded</b> indicates that more than 30,000 rows would be fetched, and so specifying downsampling
3486
- * is no longer optional - it must either be enabled (calling <b>axis.range(...)</b>), or disabled. If the figure is
3487
- * configured for downsampling, when a change takes place that requires that the server perform some downsampling work,
3488
- * the <b>downsamplestarted</b> event will first be fired, which can be used to present a brief loading message,
3489
- * indicating to the user why data is not ready yet - when the server side process is complete,
3490
- * <b>downsamplefinished</b> will be fired. These events will repeat when the range changes, such as when zooming,
3491
- * panning, or resizing the figure. Finally, <b>downsamplefailed</b> indicates that something when wrong when
3492
- * downsampling, or possibly that downsampling cannot be disabled due to the number of rows in the table.
3493
- *
3494
- * At this time, not marked as a ServerObject, due to internal implementation issues which leave the door open to
3495
- * client-created figures.
3421
+ * Describes how to access and display data required within a series.
3496
3422
  */
3497
- export class Figure implements dh.HasEventHandling {
3423
+ export interface SeriesDataSource {
3498
3424
  /**
3499
- * The title of the figure.
3425
+ * the type of data stored in the underlying table's Column.
3500
3426
  * @return String
3501
3427
  */
3502
- readonly title?:string|null;
3503
- /**
3504
- * The data within this figure was updated. <b>event.detail</b> is <b>FigureUpdateEventData</b>
3505
- */
3506
- static readonly EVENT_UPDATED:string;
3507
- /**
3508
- * The data within this figure was updated. <b>event.detail</b> is <b>FigureUpdateEventData</b>
3509
- */
3510
- static readonly EVENT_SERIES_ADDED:string;
3511
- /**
3512
- * The data within this figure was updated. <b>event.detail</b> is <b>FigureUpdateEventData</b>
3513
- */
3514
- static readonly EVENT_DISCONNECT:string;
3515
- /**
3516
- * The data within this figure was updated. <b>event.detail</b> is <b>FigureUpdateEventData</b>
3517
- */
3518
- static readonly EVENT_RECONNECT:string;
3519
- /**
3520
- * The data within this figure was updated. <b>event.detail</b> is <b>FigureUpdateEventData</b>
3521
- */
3522
- static readonly EVENT_RECONNECTFAILED:string;
3523
- /**
3524
- * The data within this figure was updated. <b>event.detail</b> is <b>FigureUpdateEventData</b>
3525
- */
3526
- static readonly EVENT_DOWNSAMPLESTARTED:string;
3527
- /**
3528
- * The data within this figure was updated. <b>event.detail</b> is <b>FigureUpdateEventData</b>
3529
- */
3530
- static readonly EVENT_DOWNSAMPLEFINISHED:string;
3531
- /**
3532
- * The data within this figure was updated. <b>event.detail</b> is <b>FigureUpdateEventData</b>
3533
- */
3534
- static readonly EVENT_DOWNSAMPLEFAILED:string;
3535
- /**
3536
- * The data within this figure was updated. <b>event.detail</b> is <b>FigureUpdateEventData</b>
3537
- */
3538
- static readonly EVENT_DOWNSAMPLENEEDED:string;
3539
-
3540
- protected constructor();
3541
-
3542
- subscribe(forceDisableDownsample?:DownsampleOptions):void;
3543
- /**
3544
- * Disable updates for all series in this figure.
3545
- */
3546
- unsubscribe():void;
3547
- /**
3548
- * Close the figure, and clean up subscriptions.
3549
- */
3550
- close():void;
3551
- /**
3552
- * The charts to draw.
3553
- * @return dh.plot.Chart
3554
- */
3555
- get charts():Chart[];
3556
- get updateInterval():number;
3557
- get titleColor():string;
3558
- get titleFont():string;
3559
- get rows():number;
3560
- get cols():number;
3561
- get errors():Array<string>;
3428
+ get columnType():string;
3562
3429
  /**
3563
- * Listen for events on this object.
3564
- * @param name - the name of the event to listen for
3565
- * @param callback - a function to call when the event occurs
3566
- * @return Returns a cleanup function.
3567
- * @typeParam T - the type of the data that the event will provide
3430
+ * the axis that this source should be drawn on.
3431
+ * @return dh.plot.Axis
3568
3432
  */
3569
- addEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):()=>void;
3570
- nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<dh.Event<T>>;
3571
- hasListeners(name:string):boolean;
3433
+ get axis():Axis;
3572
3434
  /**
3573
- * Removes an event listener added to this table.
3574
- * @param name -
3575
- * @param callback -
3576
- * @return
3577
- * @typeParam T -
3435
+ * the feature of this series represented by this source. See the <b>SourceType</b> enum for more details.
3436
+ * @return int
3578
3437
  */
3579
- removeEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):boolean;
3580
- static create(config:FigureDescriptor):Promise<Figure>;
3438
+ get type():SourceTypeType;
3439
+ }
3440
+ export interface FigureDataUpdatedEvent {
3441
+ getArray(series:Series, sourceType:number, mappingFunc?:(arg0:any)=>any):Array<any>;
3442
+ get series():Series[];
3581
3443
  }
3582
3444
 
3583
3445
  export class ChartDescriptor {
@@ -3597,23 +3459,23 @@ export namespace dh.plot {
3597
3459
  constructor();
3598
3460
  }
3599
3461
 
3600
- /**
3601
- * Helper class for plot downsampling methods.
3602
- */
3603
- export class Downsample {
3604
- protected constructor();
3462
+ export class SeriesDescriptor {
3463
+ plotStyle:string;
3464
+ name?:string|null;
3465
+ linesVisible?:boolean|null;
3466
+ shapesVisible?:boolean|null;
3467
+ gradientVisible?:boolean|null;
3468
+ lineColor?:string|null;
3469
+ pointLabelFormat?:string|null;
3470
+ xToolTipPattern?:string|null;
3471
+ yToolTipPattern?:string|null;
3472
+ shapeLabel?:string|null;
3473
+ shapeSize?:number|null;
3474
+ shapeColor?:string|null;
3475
+ shape?:string|null;
3476
+ dataSources:Array<SourceDescriptor>;
3605
3477
 
3606
- /**
3607
- * Downsamples a table so that the data can be used for a time-series line plot. The downsampled table should have
3608
- * the same visual fidelity as the original table, but with fewer rows.
3609
- * @param table - The table to downsample.
3610
- * @param xCol - The name of the X column to downsample. Must be an Instant or long.
3611
- * @param yCols - The names of the Y columns to downsample.
3612
- * @param width - The width of the visible area in pixels.
3613
- * @param xRange - The visible range as `[start, end]` or null to always use all data.
3614
- * @return A promise that resolves to the downsampled table.
3615
- */
3616
- static runChartDownsample(table:dh.Table, xCol:string, yCols:string[], width:number, xRange?:dh.LongWrapper[]|undefined|null):Promise<dh.Table>;
3478
+ constructor();
3617
3479
  }
3618
3480
 
3619
3481
  /**
@@ -3660,30 +3522,97 @@ export namespace dh.plot {
3660
3522
  get multiSeries():MultiSeries[];
3661
3523
  }
3662
3524
 
3663
- export class DownsampleOptions {
3525
+ export class Figure implements dh.HasEventHandling {
3526
+ /**
3527
+ * The title of the figure.
3528
+ * @return String
3529
+ */
3530
+ readonly title?:string|null;
3531
+ /**
3532
+ * The data within this figure was updated. <b>event.detail</b> is <b>FigureUpdateEventData</b>
3533
+ */
3534
+ static readonly EVENT_UPDATED:string;
3535
+ /**
3536
+ * The data within this figure was updated. <b>event.detail</b> is <b>FigureUpdateEventData</b>
3537
+ */
3538
+ static readonly EVENT_SERIES_ADDED:string;
3539
+ /**
3540
+ * The data within this figure was updated. <b>event.detail</b> is <b>FigureUpdateEventData</b>
3541
+ */
3542
+ static readonly EVENT_DISCONNECT:string;
3543
+ /**
3544
+ * The data within this figure was updated. <b>event.detail</b> is <b>FigureUpdateEventData</b>
3545
+ */
3546
+ static readonly EVENT_RECONNECT:string;
3547
+ /**
3548
+ * The data within this figure was updated. <b>event.detail</b> is <b>FigureUpdateEventData</b>
3549
+ */
3550
+ static readonly EVENT_RECONNECTFAILED:string;
3551
+ /**
3552
+ * The data within this figure was updated. <b>event.detail</b> is <b>FigureUpdateEventData</b>
3553
+ */
3554
+ static readonly EVENT_DOWNSAMPLESTARTED:string;
3555
+ /**
3556
+ * The data within this figure was updated. <b>event.detail</b> is <b>FigureUpdateEventData</b>
3557
+ */
3558
+ static readonly EVENT_DOWNSAMPLEFINISHED:string;
3559
+ /**
3560
+ * The data within this figure was updated. <b>event.detail</b> is <b>FigureUpdateEventData</b>
3561
+ */
3562
+ static readonly EVENT_DOWNSAMPLEFAILED:string;
3563
+ /**
3564
+ * The data within this figure was updated. <b>event.detail</b> is <b>FigureUpdateEventData</b>
3565
+ */
3566
+ static readonly EVENT_DOWNSAMPLENEEDED:string;
3567
+
3568
+ static create(config:FigureDescriptor):Promise<Figure>;
3569
+ subscribe(forceDisableDownsample?:DownsampleOptions):void;
3664
3570
  /**
3665
- * Max number of items in the series before DEFAULT will not attempt to load the series without downsampling. Above
3666
- * this size if downsample fails or is not applicable, the series won't be loaded unless DISABLE is passed to
3667
- * series.subscribe().
3571
+ * Disable updates for all series in this figure.
3668
3572
  */
3669
- static MAX_SERIES_SIZE:number;
3573
+ unsubscribe():void;
3670
3574
  /**
3671
- * Max number of items in the series where the subscription will be allowed at all. Above this limit, even with
3672
- * downsampling disabled, the series will not load data.
3575
+ * Close the figure, and clean up subscriptions.
3673
3576
  */
3674
- static MAX_SUBSCRIPTION_SIZE:number;
3577
+ close():void;
3675
3578
  /**
3676
- * Flag to let the API decide what data will be available, based on the nature of the data, the series, and how the
3677
- * axes are configured.
3579
+ * The charts to draw.
3580
+ * @return dh.plot.Chart
3678
3581
  */
3679
- static readonly DEFAULT:DownsampleOptions;
3582
+ get charts():Chart[];
3583
+ get updateInterval():number;
3584
+ get titleColor():string;
3585
+ get titleFont():string;
3586
+ get rows():number;
3587
+ get cols():number;
3588
+ get errors():Array<string>;
3680
3589
  /**
3681
- * Flat to entirely disable downsampling, and force all data to load, no matter how many items that would be, up to
3682
- * the limit of MAX_SUBSCRIPTION_SIZE.
3590
+ * Listen for events on this object.
3591
+ * @param name - the name of the event to listen for
3592
+ * @param callback - a function to call when the event occurs
3593
+ * @return Returns a cleanup function.
3594
+ * @typeParam T - the type of the data that the event will provide
3683
3595
  */
3684
- static readonly DISABLE:DownsampleOptions;
3596
+ addEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):()=>void;
3597
+ nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<dh.Event<T>>;
3598
+ hasListeners(name:string):boolean;
3599
+ /**
3600
+ * Removes an event listener added to this table.
3601
+ * @param name -
3602
+ * @param callback -
3603
+ * @return
3604
+ * @typeParam T -
3605
+ */
3606
+ removeEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):boolean;
3607
+ }
3685
3608
 
3686
- protected constructor();
3609
+ export class SourceDescriptor {
3610
+ axis:AxisDescriptor;
3611
+ table:dh.Table;
3612
+ columnName:string;
3613
+ type:string;
3614
+
3615
+ constructor();
3687
3616
  }
3688
3617
 
3689
3618
  /**
@@ -3710,15 +3639,6 @@ export namespace dh.plot {
3710
3639
  protected constructor();
3711
3640
  }
3712
3641
 
3713
- export class SourceDescriptor {
3714
- axis:AxisDescriptor;
3715
- table:dh.Table;
3716
- columnName:string;
3717
- type:string;
3718
-
3719
- constructor();
3720
- }
3721
-
3722
3642
  /**
3723
3643
  * A descriptor used with JsFigureFactory.create to create a figure from JS.
3724
3644
  */
@@ -3736,6 +3656,46 @@ export namespace dh.plot {
3736
3656
  constructor();
3737
3657
  }
3738
3658
 
3659
+ export class FigureFetchError {
3660
+ error:object;
3661
+ errors:Array<string>;
3662
+
3663
+ protected constructor();
3664
+ }
3665
+
3666
+ export class DownsampleOptions {
3667
+ /**
3668
+ * Max number of items in the series before DEFAULT will not attempt to load the series without downsampling. Above
3669
+ * this size if downsample fails or is not applicable, the series won't be loaded unless DISABLE is passed to
3670
+ * series.subscribe().
3671
+ */
3672
+ static MAX_SERIES_SIZE:number;
3673
+ /**
3674
+ * Max number of items in the series where the subscription will be allowed at all. Above this limit, even with
3675
+ * downsampling disabled, the series will not load data.
3676
+ */
3677
+ static MAX_SUBSCRIPTION_SIZE:number;
3678
+ /**
3679
+ * Flag to let the API decide what data will be available, based on the nature of the data, the series, and how the
3680
+ * axes are configured.
3681
+ */
3682
+ static readonly DEFAULT:DownsampleOptions;
3683
+ /**
3684
+ * Flat to entirely disable downsampling, and force all data to load, no matter how many items that would be, up to
3685
+ * the limit of MAX_SUBSCRIPTION_SIZE.
3686
+ */
3687
+ static readonly DISABLE:DownsampleOptions;
3688
+
3689
+ protected constructor();
3690
+ }
3691
+
3692
+ export class SeriesDataSourceException {
3693
+ protected constructor();
3694
+
3695
+ get source():SeriesDataSource;
3696
+ get message():string;
3697
+ }
3698
+
3739
3699
  export class AxisDescriptor {
3740
3700
  formatType:string;
3741
3701
  type:string;
@@ -3760,20 +3720,50 @@ export namespace dh.plot {
3760
3720
  constructor();
3761
3721
  }
3762
3722
 
3763
- export class SeriesDataSourceException {
3723
+ /**
3724
+ * Helper class for plot downsampling methods.
3725
+ */
3726
+ export class Downsample {
3764
3727
  protected constructor();
3765
3728
 
3766
- get source():SeriesDataSource;
3767
- get message():string;
3729
+ /**
3730
+ * Downsamples a table so that the data can be used for a time-series line plot. The downsampled table should have
3731
+ * the same visual fidelity as the original table, but with fewer rows.
3732
+ * @param table - The table to downsample.
3733
+ * @param xCol - The name of the X column to downsample. Must be an Instant or long.
3734
+ * @param yCols - The names of the Y columns to downsample.
3735
+ * @param width - The width of the visible area in pixels.
3736
+ * @param xRange - The visible range as `[start, end]` or null to always use all data.
3737
+ * @return A promise that resolves to the downsampled table.
3738
+ */
3739
+ static runChartDownsample(table:dh.Table, xCol:string, yCols:string[], width:number, xRange?:dh.LongWrapper[]|undefined|null):Promise<dh.Table>;
3768
3740
  }
3769
3741
 
3770
- export class FigureFetchError {
3771
- error:object;
3772
- errors:Array<string>;
3773
3742
 
3774
- protected constructor();
3743
+ type AxisPositionType = number;
3744
+ export class AxisPosition {
3745
+ static readonly TOP:AxisPositionType;
3746
+ static readonly BOTTOM:AxisPositionType;
3747
+ static readonly LEFT:AxisPositionType;
3748
+ static readonly RIGHT:AxisPositionType;
3749
+ static readonly NONE:AxisPositionType;
3750
+ }
3751
+
3752
+ type AxisTypeType = number;
3753
+ export class AxisType {
3754
+ static readonly X:AxisTypeType;
3755
+ static readonly Y:AxisTypeType;
3756
+ static readonly SHAPE:AxisTypeType;
3757
+ static readonly SIZE:AxisTypeType;
3758
+ static readonly LABEL:AxisTypeType;
3759
+ static readonly COLOR:AxisTypeType;
3775
3760
  }
3776
3761
 
3762
+ type AxisFormatTypeType = number;
3763
+ export class AxisFormatType {
3764
+ static readonly CATEGORY:AxisFormatTypeType;
3765
+ static readonly NUMBER:AxisFormatTypeType;
3766
+ }
3777
3767
 
3778
3768
  /**
3779
3769
  * This enum describes what kind of chart is being drawn. This may limit what kinds of series can be found on it, or how
@@ -3790,15 +3780,6 @@ export namespace dh.plot {
3790
3780
  static readonly TREEMAP:ChartTypeType;
3791
3781
  }
3792
3782
 
3793
- type AxisPositionType = number;
3794
- export class AxisPosition {
3795
- static readonly TOP:AxisPositionType;
3796
- static readonly BOTTOM:AxisPositionType;
3797
- static readonly LEFT:AxisPositionType;
3798
- static readonly RIGHT:AxisPositionType;
3799
- static readonly NONE:AxisPositionType;
3800
- }
3801
-
3802
3783
  type SeriesPlotStyleType = number;
3803
3784
  export class SeriesPlotStyle {
3804
3785
  static readonly BAR:SeriesPlotStyleType;
@@ -3815,22 +3796,6 @@ export namespace dh.plot {
3815
3796
  static readonly TREEMAP:SeriesPlotStyleType;
3816
3797
  }
3817
3798
 
3818
- type AxisTypeType = number;
3819
- export class AxisType {
3820
- static readonly X:AxisTypeType;
3821
- static readonly Y:AxisTypeType;
3822
- static readonly SHAPE:AxisTypeType;
3823
- static readonly SIZE:AxisTypeType;
3824
- static readonly LABEL:AxisTypeType;
3825
- static readonly COLOR:AxisTypeType;
3826
- }
3827
-
3828
- type AxisFormatTypeType = number;
3829
- export class AxisFormatType {
3830
- static readonly CATEGORY:AxisFormatTypeType;
3831
- static readonly NUMBER:AxisFormatTypeType;
3832
- }
3833
-
3834
3799
  /**
3835
3800
  * This enum describes the source it is in, and how this aspect of the data in the series should be used to render the
3836
3801
  * 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
@@ -3864,19 +3829,26 @@ export namespace dh.plot {
3864
3829
 
3865
3830
  export namespace dh.lsp {
3866
3831
 
3867
- export class TextDocumentContentChangeEvent {
3868
- range:Range;
3869
- rangeLength:number;
3870
- text:string;
3832
+ export class Position {
3833
+ line:number;
3834
+ character:number;
3871
3835
 
3872
3836
  constructor();
3837
+
3838
+ lessThan(start:Position):boolean;
3839
+ lessOrEqual(start:Position):boolean;
3840
+ greaterThan(end:Position):boolean;
3841
+ greaterOrEqual(end:Position):boolean;
3842
+ copy():Position;
3873
3843
  }
3874
3844
 
3875
- export class ParameterInformation {
3876
- label:string;
3877
- documentation:MarkupContent;
3845
+ export class Range {
3846
+ start:Position;
3847
+ end:Position;
3878
3848
 
3879
3849
  constructor();
3850
+
3851
+ isInside(innerStart:Position, innerEnd:Position):boolean;
3880
3852
  }
3881
3853
 
3882
3854
  export class SignatureInformation {
@@ -3895,33 +3867,26 @@ export namespace dh.lsp {
3895
3867
  constructor();
3896
3868
  }
3897
3869
 
3898
- export class Position {
3899
- line:number;
3900
- character:number;
3870
+ export class ParameterInformation {
3871
+ label:string;
3872
+ documentation:MarkupContent;
3901
3873
 
3902
3874
  constructor();
3903
-
3904
- lessThan(start:Position):boolean;
3905
- lessOrEqual(start:Position):boolean;
3906
- greaterThan(end:Position):boolean;
3907
- greaterOrEqual(end:Position):boolean;
3908
- copy():Position;
3909
3875
  }
3910
3876
 
3911
- export class MarkupContent {
3912
- kind:string;
3913
- value:string;
3877
+ export class TextEdit {
3878
+ range:Range;
3879
+ text:string;
3914
3880
 
3915
3881
  constructor();
3916
3882
  }
3917
3883
 
3918
- export class Range {
3919
- start:Position;
3920
- end:Position;
3884
+ export class TextDocumentContentChangeEvent {
3885
+ range:Range;
3886
+ rangeLength:number;
3887
+ text:string;
3921
3888
 
3922
3889
  constructor();
3923
-
3924
- isInside(innerStart:Position, innerEnd:Position):boolean;
3925
3890
  }
3926
3891
 
3927
3892
  export class CompletionItem {
@@ -3941,9 +3906,9 @@ export namespace dh.lsp {
3941
3906
  constructor();
3942
3907
  }
3943
3908
 
3944
- export class TextEdit {
3945
- range:Range;
3946
- text:string;
3909
+ export class MarkupContent {
3910
+ kind:string;
3911
+ value:string;
3947
3912
 
3948
3913
  constructor();
3949
3914
  }
@@ -3952,22 +3917,6 @@ export namespace dh.lsp {
3952
3917
 
3953
3918
  export namespace dh.calendar {
3954
3919
 
3955
- export interface Holiday {
3956
- /**
3957
- * The date of the Holiday.
3958
- * @return {@link dh.LocalDateWrapper}
3959
- */
3960
- get date():dh.LocalDateWrapper;
3961
- /**
3962
- * The business periods that are open on the holiday.
3963
- * @return dh.calendar.BusinessPeriod
3964
- */
3965
- get businessPeriods():Array<BusinessPeriod>;
3966
- }
3967
- export interface BusinessPeriod {
3968
- get close():string;
3969
- get open():string;
3970
- }
3971
3920
  /**
3972
3921
  * Defines a calendar with business hours and holidays.
3973
3922
  */
@@ -3998,6 +3947,22 @@ export namespace dh.calendar {
3998
3947
  */
3999
3948
  get businessPeriods():Array<BusinessPeriod>;
4000
3949
  }
3950
+ export interface Holiday {
3951
+ /**
3952
+ * The date of the Holiday.
3953
+ * @return {@link dh.LocalDateWrapper}
3954
+ */
3955
+ get date():dh.LocalDateWrapper;
3956
+ /**
3957
+ * The business periods that are open on the holiday.
3958
+ * @return dh.calendar.BusinessPeriod
3959
+ */
3960
+ get businessPeriods():Array<BusinessPeriod>;
3961
+ }
3962
+ export interface BusinessPeriod {
3963
+ get close():string;
3964
+ get open():string;
3965
+ }
4001
3966
 
4002
3967
  type DayOfWeekType = string;
4003
3968
  export class DayOfWeek {