@deephaven/jsapi-types 1.0.0-dev0.39.6 → 1.0.0-dev0.39.7

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