// Minimum TypeScript Version: 4.3 // Generated using com.vertispan.tsdefs.doclet.TsDoclet export interface IIterableResult { value:T; done:boolean; } /** * This is part of EcmaScript 2015, documented here for completeness. It supports a single method, next(), which * returns an object with a boolean named done (true if there are no more items to return; false * otherwise), and optionally some T instance, value, if there was at least one remaining item. * @typeParam T - */ export interface Iterator { hasNext():boolean; next():IIterableResult; } export namespace dh.storage { /** * Storage service metadata about files and folders. */ export class ItemDetails { protected constructor(); toString():string; get filename():string; get basename():string; get size():number; get etag():string; get type():ItemTypeType; get dirname():string; } /** * Remote service to read and write files on the server. Paths use "/" as a separator, and should not start with "/". */ export class StorageService { protected constructor(); /** * Lists items in a given directory, with an optional filter glob to only list files that match. The empty or "root" * path should be specified as the empty string. * @param path - the path of the directory to list * @param glob - optional glob to filter the contents of the directory * @return a promise containing the any items that are present in the given directory that match the glob, or an * error. */ listItems(path:string, glob?:string):Promise>; /** * Downloads a file at the given path, unless an etag is provided that matches the file's current contents. * @param path - the path of the file to fetch * @param etag - an optional etag from the last time the client saw this file * @return a promise containing details about the file's contents, or an error. */ loadFile(path:string, etag?:string):Promise; /** * Deletes the item at the given path. Directories must be empty to be deleted. * @param path - the path of the item to delete * @return a promise with no value on success, or an error. */ deleteItem(path:string):Promise; /** * Saves the provided contents to the given path, creating a file or replacing an existing one. The optional newFile * parameter can be passed to indicate that an existing file must not be overwritten, only a new file created. * * Note that directories must be empty to be overwritten. * @param path - the path of the file to write * @param contents - the contents to write to that path * @param allowOverwrite - true to allow an existing file to be overwritten, false or skip to require a new file * @return a promise with a FileContents, holding only the new etag (if the server emitted one), or an error */ saveFile(path:string, contents:FileContents, allowOverwrite?:boolean):Promise; /** * Moves (and/or renames) an item from its old path to its new path. The optional newFile parameter can be passed to * enforce that an existing item must not be overwritten. * * Note that directories must be empty to be overwritten. * @param oldPath - the path of the existing item * @param newPath - the new path to move the item to * @param allowOverwrite - true to allow an existing file to be overwritten, false or skip to require a new file * @return a promise with no value on success, or an error. */ moveItem(oldPath:string, newPath:string, allowOverwrite?:boolean):Promise; /** * Creates a new directory at the specified path. * @param path - the path of the directory to create * @return a promise with no value on success, or an error. */ createDirectory(path:string):Promise; } /** * Represents a file's contents loaded from the server. If an etag was specified when loading, client should first test * if the etag of this instance matches - if so, the contents will be empty, and the client's existing contents should * be used. */ export class FileContents { protected constructor(); static blob(blob:Blob):FileContents; static text(...text:string[]):FileContents; static arrayBuffers(...buffers:ArrayBuffer[]):FileContents; text():Promise; arrayBuffer():Promise; get etag():string; } type ItemTypeType = string; export class ItemType { static readonly DIRECTORY:ItemTypeType; static readonly FILE:ItemTypeType; } } export namespace dh.ide { /** * Specifies a type and either id or name (but not both). */ export interface VariableDescriptor { type:string; id?:string|null; name?:string|null; } /** * Describes changes in the current set of variables in the script session. Note that variables that changed value * without changing type will be included as updated, but if a new value with one type replaces an old value with * a different type, this will be included as an entry in both removed and created to indicate the old and * new types. */ export interface VariableChanges { /** * * @return The variables that no longer exist after this operation, or were replaced by some variable with a * different type. */ get removed():Array; /** * * @return The variables that were created by this operation, or have a new type. */ get created():Array; /** * * @return The variables that changed value during this operation. */ get updated():Array; } /** * A format to describe a variable available to be read from the server. Application fields are optional, and only * populated when a variable is provided by application mode. *

* APIs which take a VariableDefinition must at least be provided an object with a type and id field. */ export interface VariableDefinition { get name():string; /** * Optional description for the variable's contents, typically used to provide more detail that wouldn't be * reasonable to put in the title * @return String */ get description():string; /** * An opaque identifier for this variable * @return String */ get id():string; /** * The type of the variable, one of dh.VariableType * @return dh.VariableType. */ get type():dh.VariableTypeType; /** * The name of the variable, to be used when rendering it to a user * @return String */ get title():string; /** * Optional description for the variable's contents, typically used to provide more detail that wouldn't be * reasonable to put in the title * @return String */ get applicationId():string; /** * The name of the application which provided this variable * @return String */ get applicationName():string; } /** * Represents a serialized fishlib LogRecord, suitable for display on javascript clients. A log entry sent from the * server. */ export interface LogItem { /** * The level of the log message, enabling the client to ignore messages. * @return String */ get logLevel():string; /** * Timestamp of the message in microseconds since Jan 1, 1970 UTC. * @return double */ get micros():number; /** * The log message written on the server. * @return String */ get message():string; } /** * Indicates the result of code run on the server. */ export interface CommandResult { /** * Describes changes made in the course of this command. * @return {@link dh.ide.VariableChanges}. */ get changes():VariableChanges; /** * If the command failed, the error message will be provided here. * @return String */ get error():string; /** * The timestamp when the command finished running. * @return DateWrapper */ get endTimestamp():dh.DateWrapper; /** * The timestamp when the command started running. * @return DateWrapper */ get startTimestamp():dh.DateWrapper; } } export namespace dh { /** * Options for requesting a preview of columns when requesting table data. The two properties * {@link dh.convertArrayToString} and {@link dh.array} are mutually exclusive. */ export interface PreviewOptions { /** * If true, any array columns will be converted to strings for preview purposes. This is the legacy behavior. */ convertArrayToString?:boolean|null; /** * Specifies the length of the array to serialize. If the array is longer than this length, one extra element * will be included - the client is expected to truncate the array and append "..." to indicate that there are * additional elements. Negative values indicate that the values should be counted from the end of the array * rather than the beginning. Zero or null indicate that the entire array should be serialized. The default is * null. */ array?:number|null; } /** * This object may be pooled internally or discarded and not updated. Do not retain references to it. */ export interface Format { /** * The format string to apply to the value of this cell. * @return String */ readonly formatString?:string|null; /** * Color to apply to the cell's background, in #rrggbb format. * @return String */ readonly backgroundColor?:string|null; /** * Color to apply to the text, in #rrggbb format. * @return String */ readonly color?:string|null; /** * * @deprecated Prefer formatString. Number format string to apply to the value in this cell. */ readonly numberFormat?:string|null; } /** * Options for requesting table data, either as a snapshot or a subscription. See subtypes for more specific options: *

    *
  • {@link dh.SnapshotOptions} for snapshot-specific options
  • *
  • {@link dh.SubscriptionOptions} for full-table subscription-specific options
  • *
  • {@link dh.ViewportSubscriptionOptions} for viewport subscription-specific options
  • *
*/ export interface DataOptions { /** * Optional preview instructions for columns in the table data. */ previewOptions?:PreviewOptions|null; /** * Required property to indicate which columns should be included in the table data. */ columns:Array; } /** * Common interface for various ways of accessing table data and formatting for viewport or non-viewport subscriptions * on tables, data in trees, and snapshots. *

* Generally speaking, it is more efficient to access data in column-major order, rather than iterating through each Row * and accessing all columns that it holds. The {@link rows} accessor can be useful to read row data, but may * incur other costs - it is likely faster to access data by columns using {@link getData}. */ export interface TableData { /** * Reads a row object from the table, from which any subscribed column can be read. * @param index - the position or key to access * @return the row at the given location */ get(index:LongWrapper|number):Row; /** * Reads a specific cell from the table, by row key and column. * @param index - the row in the table to get data from * @param column - the column to read * @return the value in the table */ getData(index:LongWrapper|number, column:Column):any; /** * The server-specified Format to use for the cell at the given position. * @param index - the row to read * @param column - the column to read * @return a Format instance with any server-specified details */ getFormat(index:LongWrapper|number, column:Column):Format; get columns():Array; /** * A lazily computed array of all rows available on the client. */ get rows():Array; } /** * Represents statistics for a given table column. */ export interface ColumnStatistics { /** * Gets the type of formatting that should be used for given statistic. *

* the format type for a statistic. A null return value means that the column formatting should be used. * @param name - the display name of the statistic * @return String */ getType(name:string):string; /** * 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 * name to the count of how many times it occurred in the column. This map will be empty for tables containing more * than 19 unique values. * @return Map of String double */ get uniqueValues():Map; /** * Gets a map with the display name of statistics as keys and the numeric stat as a value. *

* A map of each statistic's name to its value. * @return Map of String and Object */ get statisticsMap():Map; } export interface HasEventHandling { /** * Listen for events on this object. * @param name - the name of the event to listen for * @param callback - a function to call when the event occurs * @return Returns a cleanup function. * @typeParam T - the type of the data that the event will provide */ addEventListener(name:string, callback:(e:dh.Event)=>void):()=>void; nextEvent(eventName:string, timeoutInMillis?:number):Promise>; hasListeners(name:string):boolean; /** * Removes an event listener added to this table. * @param name - * @param callback - * @return * @typeParam T - */ removeEventListener(name:string, callback:(e:dh.Event)=>void):boolean; } /** * Represents a table which can be joined to another table. Current implementations are {@link dh.Table} and * {@link dh.TotalsTable}. */ export interface JoinableTable { freeze():Promise; snapshot(baseTable:Table, doInitialSnapshot?:boolean, stampColumns?:string[]):Promise
; /** * Joins this table to the provided table, using one of the specified join types: *
    *
  • AJ, ReverseAJ (or RAJ) - inexact timeseries joins, based on the * provided matching rule.
  • *
  • CROSS_JOIN (or Join) - cross join of all rows that have matching values in both * tables.
  • *
  • EXACT_JOIN (or ExactJoin - matches values in exactly one row in the right table, * with errors if there is not exactly one.
  • *
  • NATURAL_JOIN (or Natural - matches values in at most one row in the right table, * with nulls if there is no match or errors if there are multiple matches.
  • *
* * Note that Left join is not supported here, unlike DHE. *

* See the Choose a join method document for * more guidance on picking a join operation. * @deprecated Instead, call the specific method for the join type. * @param joinType - The type of join to perform, see the list above. * @param rightTable - The table to match to values in this table * @param columnsToMatch - Columns that should match * @param columnsToAdd - Columns from the right table to add to the result - empty/null/absent to add all columns * @param asOfMatchRule - If joinType is AJ/RAJ/ReverseAJ, the match rule to use * @return a promise that will resolve to the joined table */ join(joinType:string, rightTable:JoinableTable, columnsToMatch:Array, columnsToAdd?:Array|undefined|null, asOfMatchRule?:string|undefined|null):Promise

; /** * Performs an inexact timeseries join, where rows in this table will have columns added from the closest matching * row from the right table. *

* The `asOfMatchRule` value can be one of: *

    *
  • LESS_THAN_EQUAL
  • *
  • LESS_THAN
  • *
  • GREATER_THAN_EQUAL
  • *
  • GREATER_THAN
  • *
* @param rightTable - the table to match to values in this table * @param columnsToMatch - the columns that should match, according to the asOfMatchRole * @param columnsToAdd - columns from the right table to add to the resulting table, empty/null/absent to add all * columns * @param asOfMatchRule - the match rule to use, see above * @return a promise that will resolve to the joined table */ asOfJoin(rightTable:JoinableTable, columnsToMatch:Array, columnsToAdd?:Array|undefined|null, asOfMatchRule?:string|undefined|null):Promise
; /** * a promise that will be resolved with the newly created table holding the results of the specified cross join * operation. The columnsToAdd parameter is optional, not specifying it will result in all columns from the * right table being added to the output. The reserveBits optional parameter lets the client control how the * key space is distributed between the rows in the two tables, see the Java Table class for details. * @param rightTable - the table to match to values in this table * @param columnsToMatch - the columns that should match exactly * @param columnsToAdd - columns from the right table to add to the resulting table, empty/null/absent to add all * columns * @param reserveBits - the number of bits of key-space to initially reserve per group, null/absent will let the * server select a value * @return a promise that will resolve to the joined table */ crossJoin(rightTable:JoinableTable, columnsToMatch:Array, columnsToAdd?:Array|undefined|null, reserveBits?:number|undefined|null):Promise
; /** * a promise that will be resolved with the newly created table holding the results of the specified exact join * operation. The `columnsToAdd` parameter is optional, not specifying it will result in all columns from the right * table being added to the output. * @param rightTable - the table to match to values in this table * @param columnsToMatch - the columns that should match exactly * @param columnsToAdd - columns from the right table to add to the resulting table, empty/null/absent to add all * columns * @return a promise that will resolve to the joined table */ exactJoin(rightTable:JoinableTable, columnsToMatch:Array, columnsToAdd?:Array|undefined|null):Promise
; /** * a promise that will be resolved with the newly created table holding the results of the specified natural join * operation. The columnsToAdd parameter is optional, not specifying it will result in all columns from the * right table being added to the output. * @param rightTable - the table to match to values in this table * @param columnsToMatch - the columns that should match exactly * @param columnsToAdd - columns from the right table to add to the resulting table, empty/null/absent to add all * columns * @return a promise that will resolve to the joined table */ naturalJoin(rightTable:JoinableTable, columnsToMatch:Array, columnsToAdd?:Array|undefined|null):Promise
; } /** * Represents the contents of a single widget data message from the server, with a binary data paylod and exported * objects. Implemented both by Widget itself and by the `event.details` when data is received by the client. * * Terminology note: the name of this type should probably use "Data" instead of "Message", and the methods should use * "payload" rather than "data" to match other platforms and the protobuf itself. These names are instead used for * backwards compatibility and to better follow JS expectations. */ export interface WidgetMessageDetails { /** * Returns the data from this message as a base64-encoded string. */ getDataAsBase64():string; /** * Returns the data from this message as a Uint8Array. */ getDataAsU8():Uint8Array; /** * Returns the data from this message as a utf-8 string. */ getDataAsString():string; /** * Returns an array of exported objects sent from the server. The plugin implementation is now responsible for these * objects, and should close them when no longer needed. */ get exportedObjects():WidgetExportedObject[]; } /** * Similar to {@link dh.ViewportData}, but with additional properties to reflect * the tree structure. */ export interface TreeViewportData extends TableData { get(index:LongWrapper|number):TreeRow; getData(index:LongWrapper|number, column:Column):any; getFormat(index:LongWrapper|number, column:Column):Format; get treeSize():number; /** * The position of the first returned row within the tree. */ get offset():number; get columns():Array; get rows():Array; } /** * This object may be pooled internally or discarded and not updated. Do not retain references to it. Instead, * request the viewport again. */ export interface ViewportRow extends Row { get(column:Column):any; getFormat(column:Column):Format; get index():LongWrapper; } /** * Wrap LocalTime values for use in JS. Provides text formatting for display and access to the underlying value. */ export interface LocalTimeWrapper { valueOf():string; getHour():number; getMinute():number; getSecond():number; getNano():number; toString():string; } /** * Similar to the browser `CustomEvent` type, this class holds only the type of the event, and optionally some * details about the event. * @typeParam T - the type of the event detail */ export interface Event { get detail():T; get type():string; } export interface LayoutHints { readonly searchDisplayMode?:SearchDisplayModeType|null; get hiddenColumns():string[]|null; get frozenColumns():string[]|null; get columnGroups():ColumnGroup[]|null; get areSavedLayoutsAllowed():boolean; get frontColumns():string[]|null; get backColumns():string[]|null; } export interface WorkerHeapInfo { /** * Total heap size available for this worker. */ get totalHeapSize():number; get freeMemory():number; get maximumHeapSize():number; } /** * Behaves like a Table, but doesn't expose all of its API for changing the internal state. Instead, state is driven by * the upstream table - when it changes handle, this listens and updates its own handle accordingly. * * Additionally, this is automatically subscribed to its one and only row, across all columns. * * A new config is returned any time it is accessed, to prevent accidental mutation, and to allow it to be used as a * template when fetching a new totals table, or changing the totals table in use. * * A simplistic Table, providing access to aggregation of the table it is sourced from. This table is always * automatically subscribed to its parent, and adopts changes automatically from it. This class has limited methods * found on Table. Instances of this type always have a size of one when no groupBy is set on the config, but may * potentially contain as few as zero rows, or as many as the parent table if each row gets its own group. * * When using the `groupBy` feature, it may be desireable to also provide a row to the user with all values across all * rows. To achieve this, request the same Totals Table again, but remove the `groupBy` setting. */ export interface TotalsTable extends JoinableTable { /** * Specifies the range of items to pass to the client and update as they change. If the columns parameter is not * provided, all columns will be used. Until this is called, no data will be available. Invoking this will result in * events to be fired once data becomes available, starting with an updated event and one rowadded * event per row in that range. * @param firstRow - * @param lastRow - * @param columns - * @param updateIntervalMs - * @deprecated Use {@link #createViewportSubscription(Object)} instead. */ setViewport(firstRow:number, lastRow:number, columns?:Array, updateIntervalMs?:number, isReverseViewport?:boolean|undefined|null):void; /** * the currently visible viewport. If the current set of operations has not yet resulted in data, it will not * resolve until that data is ready. * @return Promise of {@link dh.TableData} * @deprecated use {@link TableViewportSubscription#getViewportData()} on the result from * {@link #createViewportSubscription(Object)} instead. */ getViewportData():Promise; /** * Creates a subscription to this table, with the given options. See {@link Table.createSubscription} for * more information. * @param options - options for the subscription; see {@link dh.SubscriptionOptions} for details * @return a new {@link dh.TableSubscription} */ createSubscription(options:object):TableSubscription; /** * Creates a viewport subscription to this table, with the given options. See * {@link Table.createViewportSubscription} for more information. * @param options - options for the viewport subscription; see {@link dh.ViewportSubscriptionOptions} for * details * @return a new {@link dh.TableViewportSubscription} */ createViewportSubscription(options:object):TableViewportSubscription; /** * Creates a snapshot of this table on the server, with the given options. See * {@link Table.createSnapshot} for more information. * @param options - options for the snapshot; see {@link dh.SnapshotOptions} for details * @return Promise of {@link dh.TableData} */ createSnapshot(options:object):Promise; /** * a column by the given name. You should prefer to always retrieve a new Column instance instead of caching a * returned value. * @param key - * @return {@link dh.Column} */ findColumn(key:string):Column; /** * multiple columns specified by the given names. * @param keys - * @return {@link dh.Column} array */ findColumns(keys:string[]):Column[]; /** * Indicates that the table will no longer be used, and resources used to provide it can be freed up on the server. */ close():void; addEventListener(name:string, callback:(e:dh.Event)=>void):()=>void; removeEventListener(name:string, callback:(e:dh.Event)=>void):boolean; nextEvent(eventName:string, timeoutInMillis:number):Promise>; hasListeners(name:string):boolean; /** * Replace the currently set sort on this table. Returns the previously set value. Note that the sort property will * immediately return the new value, but you may receive update events using the old sort before the new sort is * applied, and the sortchanged event fires. Reusing existing, applied sorts may enable this to perform * better on the server. The updated event will also fire, but rowadded and rowremoved will * not. * @param sort - * @return {@link dh.Sort} array */ applySort(sort:Sort[]):Array; /** * Replace the current custom columns with a new set. These columns can be used when adding new filter and sort * operations to the table, as long as they are present. * @param customColumns - * @return */ applyCustomColumns(customColumns:Array):Array; /** * Replace the currently set filters on the table. Returns the previously set value. Note that the filter property * will immediately return the new value, but you may receive update events using the old filter before the new one * is applied, and the filterchanged event fires. Reusing existing, applied filters may enable this to * perform better on the server. The updated event will also fire, but rowadded and rowremoved * will not. * @param filter - * @return {@link dh.FilterCondition} array */ applyFilter(filter:FilterCondition[]):Array; /** * An ordered list of Filters to apply to the table. To update, call applyFilter(). Note that this getter will * return the new value immediately, even though it may take a little time to update on the server. You may listen * for the filterchanged event to know when to update the UI. * @return {@link dh.FilterCondition} array */ get filter():Array; /** * True if this table has been closed. * @return boolean */ get isClosed():boolean; /** * The total number of rows in this table. This may change as the base table's configuration, filter, or contents * change. * @return double */ get size():number; /** * The columns present on this table. Note that this may not include all columns in the parent table, and in cases * where a given column has more than one aggregation applied, the column name will have a suffix indicating the * aggregation used. This suffixed name will be of the form columnName + '__' + aggregationName. * @return {@link dh.Column} array */ get columns():Array; get totalsTableConfig():TotalsTableConfig; /** * An ordered list of Sorts to apply to the table. To update, call applySort(). Note that this getter will return * the new value immediately, even though it may take a little time to update on the server. You may listen for the * sortchanged event to know when to update the UI. * @return {@link dh.Sort} array */ get sort():Array; /** * Read-only. An ordered list of custom column formulas to add to the table, either adding new columns or replacing * existing ones. To update, call applyCustomColumns(). * @return {@link dh.CustomColumn} array */ get customColumns():Array; /** * True if this table may receive updates from the server, including size changed events, updated events after * initial snapshot. * @return boolean */ get isRefreshing():boolean; } export interface ColumnGroup { get name():string|null; get children():string[]|null; get color():string|null; } /** * Represents a row available in a subscription/snapshot on the client. Do not retain references to rows - they will * not function properly when the event isn't actively going off (or promise resolving). Instead, wait for the next * event, or re-request the viewport data. */ export interface Row { get(column:Column):any; getFormat(column:Column):Format; get index():LongWrapper; } /** * Options for requesting a full-table subscription to a table. */ export interface SubscriptionOptions extends DataOptions { /** * Minimum interval between updates, in milliseconds. If not specified, the server default will be used, * typically 1000ms. *

* Note that setting this to smaller values will not necessarily result in more frequent updates - the server * may not propagate updates that frequently, or there may be no updates to propagate. */ updateIntervalMs?:number|null; } /** * Simple range consisting only of start and end numbers. Will be migrated to deephaven-core in the near future, and * subsequently removed from this the coreplus namespace. */ export interface SimpleRange { first:number; last:number; } /** * Event data, describing the indexes that were added/removed/updated, and providing access to Rows (and thus data in * columns) either by index, or scanning the complete present index. *

* This class supports two ways of reading the table - checking the changes made since the last update, and reading all * data currently in the table. While it is more expensive to always iterate over every single row in the table, it may * in some cases actually be cheaper than maintaining state separately and updating only the changes, though both * options should be considered. *

* The RangeSet objects allow iterating over the LongWrapper indexes in the table. Note that these "indexes" are not * necessarily contiguous and may be negative, and represent some internal state on the server, allowing it to keep * track of data efficiently. Those LongWrapper objects can be passed to the various methods on this instance to read * specific rows or cells out of the table. */ export interface SubscriptionTableData extends TableData { get fullIndex():RangeSet; /** * The ordered set of row indexes removed since the last update * @return the rangeset of removed rows */ get removed():RangeSet; /** * The ordered set of row indexes added since the last update. * @return the rangeset of rows added */ get added():RangeSet; get columns():Array; /** * The ordered set of row indexes updated since the last update * @return the rnageset of modified rows */ get modified():RangeSet; /** * A lazily computed array of all rows available on the client. */ get rows():Array; } /** * Wrap LocalDate values for use in JS. Provides text formatting for display and access to the underlying value. */ export interface LocalDateWrapper { valueOf():string; getYear():number; getMonthValue():number; getDayOfMonth():number; toString():string; } /** * Represents a server-side object that may not yet have been fetched by the client. When this object will no longer be * used, if {@link fetch} is not called on this object, then {@link close} must be to ensure server-side resources * are correctly freed. */ export interface WidgetExportedObject { /** * Returns the type of this export, typically one of {@link dh.VariableType}, but may also include plugin types. If * null, this object cannot be fetched, but can be passed to the server, such as via * {@link Widget.sendMessage}. * @return the string type of this server-side object, or null. */ readonly type?:string|null; /** * Exports another copy of this reference, allowing it to be fetched separately. Results in rejection if the ticket * was already closed (either by calling {@link WidgetExportedObject.close} or closing the object returned from {@link WidgetExportedObject.fetch}). * @return a promise returning a reexported copy of this object, still referencing the same server-side object. */ reexport():Promise; /** * Returns a promise that will fetch the object represented by this reference. Multiple calls to this will return * the same instance. * @return a promise that will resolve to a client side object that represents the reference on the server. */ fetch():Promise; /** * Releases the server-side resources associated with this object, regardless of whether other client-side objects * exist that also use that object. Should not be called after fetch() has been invoked. */ close():void; } /** * Options for requesting a snapshot of a table. */ export interface SnapshotOptions extends DataOptions { /** * If true, the snapshot will be filled starting from the end of the table, where 0 is the last row of the * table. Default is false. */ isReverseViewport?:boolean|null; /** * The rows to include in the snapshot. This can be either a {@link dh.RangeSet} or a single range with * `first` and `last` properties. */ rows:RangeSet|SimpleRange; } export interface RefreshToken { get bytes():string; get expiry():number; } /** * Options for requesting a viewport subscription to a table. */ export interface ViewportSubscriptionOptions extends SubscriptionOptions { /** * If true, the viewport will be filled starting from the end of the table, where 0 is the last row of the * table. Default is false. */ isReverseViewport?:boolean|null; /** * The rows to include in the viewport. This can be either a {@link dh.RangeSet} or a single range with * `first` and `last` properties. */ rows:RangeSet|SimpleRange; } /** * Row implementation that also provides additional read-only properties. represents visible rows in the table, but * with additional properties to reflect the tree structure. */ export interface TreeRow extends Row { get(column:Column):any; getFormat(column:Column):Format; /** * True if this node is currently expanded to show its children; false otherwise. Those children will be the * rows below this one with a greater depth than this one. * @return boolean */ get isExpanded():boolean; /** * The number of levels above this node; zero for top level nodes. Generally used by the UI to indent the row * and its expand/collapse icon. * @return int */ get depth():number; /** * True if this node has children and can be expanded; false otherwise. Note that this value may change when the * table updates, depending on the table's configuration. * @return boolean */ get hasChildren():boolean; get index():LongWrapper; } /** * Extends {@link dh.TableData}, but only contains data in the current viewport. The only API change from TableData is that * ViewportData also contains the offset to this data, so that the actual row number may be determined. *

* For viewport subscriptions, it is not necessary to read with the key, only with the position. *

* Do not assume that the first row in `rows` is the first visible row, because extra rows may be provided for easier * scrolling without going to the server. */ export interface ViewportData extends TableData { /** * Reads a row object from the viewport, based on its position in the table. */ get(index:LongWrapper|number):ViewportRow; getData(index:LongWrapper|number, column:Column):any; getFormat(index:LongWrapper|number, column:Column):Format; /** * The position of the first returned row within the table. */ get offset():number; get columns():Array; get rows():Array; } /** * Addition optional configuration that can be passed to the {@link dh.CoreClient} constructor. */ export class ConnectOptions { /** * Optional map of http header names and values to send to the server with each request. */ headers?:{ [key: string]: string; }|null; /** * True to enable debug logging. At this time, only enables logging for gRPC calls. */ debug?:boolean|null; /** * Set this to true to force the use of websockets when connecting to the deephaven instance, false to force the use * of `fetch`. Ignored if {@link dh.transportFactory} is set. *

* Defaults to null, indicating that the server URL should be checked to see if we connect with fetch or websockets. */ useWebsockets?:boolean|null; /** * The transport factory to use for creating gRPC streams. If specified, the JS API will ignore * {@link dh.useWebsockets} and its own internal logic for determining the appropriate transport to use. *

* Defaults to null, indicating that the JS API should determine the appropriate transport to use. If * `useWebsockets` is set to true, the JS API will use websockets, otherwise if the server url begins with * https, it will use fetch, otherwise it will use websockets. */ transportFactory?:dh.grpc.GrpcTransportFactory|null; constructor(); } /** * Describes how a Totals Table will be generated from its parent table. Each table has a default (which may be null) * indicating how that table was configured when it was declared, and each Totals Table has a similar property * describing how it was created. Both the Table.getTotalsTable and Table.getGrandTotalsTable methods take * this config as an optional parameter - without it, the table's default will be used, or if null, a default instance * of TotalsTableConfig will be supplied. * * This class has a no-arg constructor, allowing an instance to be made with the default values provided. However, any * JS object can be passed in to the methods which accept instances of this type, provided their values adhere to the * expected formats. */ export class TotalsTableConfig { /** * @deprecated */ static readonly COUNT:string; /** * @deprecated */ static readonly MIN:string; /** * @deprecated */ static readonly MAX:string; /** * @deprecated */ static readonly SUM:string; /** * @deprecated */ static readonly ABS_SUM:string; /** * @deprecated */ static readonly VAR:string; /** * @deprecated */ static readonly AVG:string; /** * @deprecated */ static readonly STD:string; /** * @deprecated */ static readonly FIRST:string; /** * @deprecated */ static readonly LAST:string; /** * @deprecated */ static readonly SKIP:string; /** * Specifies if a Totals Table should be expanded by default in the UI. Defaults to false. */ showTotalsByDefault:boolean; /** * Specifies if a Grand Totals Table should be expanded by default in the UI. Defaults to false. */ showGrandTotalsByDefault:boolean; /** * Specifies the default operation for columns that do not have a specific operation applied; defaults to "Sum". */ defaultOperation:AggregationOperationType; /** * Mapping from each column name to the aggregation(s) that should be applied to that column in the resulting Totals * Table. If a column is omitted, the defaultOperation is used. */ operationMap:{ [key: string]: Array; }; /** * Groupings to use when generating the Totals Table. One row will exist for each unique set of values observed in * these columns. See also `Table.selectDistinct`. */ groupBy:Array; constructor(); toString():string; } export class CustomColumn { static readonly TYPE_FORMAT_COLOR:string; static readonly TYPE_FORMAT_NUMBER:string; static readonly TYPE_FORMAT_DATE:string; static readonly TYPE_NEW:string; protected constructor(); valueOf():string; toString():string; static from(columnInfo:string):CustomColumn; /** * The expression to evaluate this custom column. * @return String */ get expression():string; /** * The name of the column to use. * @return String */ get name():string; /** * The options for this custom column. * @return CustomColumOptions */ get options():CustomColumnOptions; /** * Type of custom column. One of * *

    *
  • FORMAT_COLOR
  • *
  • FORMAT_NUMBER
  • *
  • FORMAT_DATE
  • *
  • NEW
  • *
* @return String */ get type():string; } /** * Describes data that can be filtered, either a column reference or a literal value. Used this way, the type of a value * can be specified so that values which are ambiguous or not well supported in JS will not be confused with Strings or * imprecise numbers (e.g., nanosecond-precision date values). Additionally, once wrapped in this way, methods can be * called on these value literal instances. These instances are immutable - any method called on them returns a new * instance. */ export class FilterValue { protected constructor(); /** * Constructs a number for the filter API from the given parameter. Can also be used on the values returned from * {@link TableData.get} for DateTime values. To create * a filter with a date, use dh.DateWrapper.ofJsDate or * {@link i18n.DateTimeFormat.parse}. To create a filter with a * 64-bit long integer, use {@link LongWrapper.ofString}. * @param input - the number to wrap as a FilterValue * @return an immutable FilterValue that can be built into a filter */ static ofNumber(input:LongWrapper|number):FilterValue; /** * a filter condition checking if the current value is equal to the given parameter * @param term - * @return {@link dh.FilterCondition} */ eq(term:FilterValue):FilterCondition; /** * a filter condition checking if the current value is equal to the given parameter, ignoring differences of upper * vs lower case * @param term - * @return {@link dh.FilterCondition} */ eqIgnoreCase(term:FilterValue):FilterCondition; /** * a filter condition checking if the current value is not equal to the given parameter * @param term - * @return {@link dh.FilterCondition} */ notEq(term:FilterValue):FilterCondition; /** * a filter condition checking if the current value is not equal to the given parameter, ignoring differences of * upper vs lower case * @param term - * @return {@link dh.FilterCondition} */ notEqIgnoreCase(term:FilterValue):FilterCondition; /** * a filter condition checking if the current value is greater than the given parameter * @param term - * @return {@link dh.FilterCondition} */ greaterThan(term:FilterValue):FilterCondition; /** * a filter condition checking if the current value is less than the given parameter * @param term - * @return {@link dh.FilterCondition} */ lessThan(term:FilterValue):FilterCondition; /** * a filter condition checking if the current value is greater than or equal to the given parameter * @param term - * @return {@link dh.FilterCondition} */ greaterThanOrEqualTo(term:FilterValue):FilterCondition; /** * a filter condition checking if the current value is less than or equal to the given parameter * @param term - * @return {@link dh.FilterCondition} */ lessThanOrEqualTo(term:FilterValue):FilterCondition; /** * a filter condition checking if the current value is in the given set of values * @param terms - * @return {@link dh.FilterCondition} */ in(terms:FilterValue[]):FilterCondition; /** * a filter condition checking if the current value is in the given set of values, ignoring differences of upper vs * lower case * @param terms - * @return {@link dh.FilterCondition} */ inIgnoreCase(terms:FilterValue[]):FilterCondition; /** * a filter condition checking that the current value is not in the given set of values * @param terms - * @return {@link dh.FilterCondition} */ notIn(terms:FilterValue[]):FilterCondition; /** * a filter condition checking that the current value is not in the given set of values, ignoring differences of * upper vs lower case * @param terms - * @return {@link dh.FilterCondition} */ notInIgnoreCase(terms:FilterValue[]):FilterCondition; /** * a filter condition checking if the given value contains the given string value * @param term - * @return {@link dh.FilterCondition} */ contains(term:FilterValue):FilterCondition; /** * a filter condition checking if the given value contains the given string value, ignoring differences of upper vs * lower case * @param term - * @return {@link dh.FilterCondition} */ containsIgnoreCase(term:FilterValue):FilterCondition; /** * a filter condition checking if the given value matches the provided regular expressions string. Regex patterns * use Java regex syntax * @param pattern - * @return {@link dh.FilterCondition} */ matches(pattern:FilterValue):FilterCondition; /** * a filter condition checking if the given value matches the provided regular expressions string, ignoring * differences of upper vs lower case. Regex patterns use Java regex syntax * @param pattern - * @return {@link dh.FilterCondition} */ matchesIgnoreCase(pattern:FilterValue):FilterCondition; /** * a filter condition checking if the current value is a true boolean * @return {@link dh.FilterCondition} */ isTrue():FilterCondition; /** * a filter condition checking if the current value is a false boolean * @return {@link dh.FilterCondition} */ isFalse():FilterCondition; /** * a filter condition checking if the current value is a null value * @return {@link dh.FilterCondition} */ isNull():FilterCondition; /** * a filter condition invoking the given method on the current value, with the given parameters. Currently supported * functions that can be invoked on a String: *
    *
  • startsWith: Returns true if the current string value starts with the supplied string argument
  • *
  • endsWith: Returns true if the current string value ends with the supplied string argument
  • *
  • matches: Returns true if the current string value matches the supplied string argument used as a Java * regular expression
  • *
  • contains: Returns true if the current string value contains the supplied string argument *

    * When invoking against a constant, this should be avoided in favor of FilterValue.contains *

    *
  • *
* @param method - * @param args - * @return */ invoke(method:string, ...args:FilterValue[]):FilterCondition; toString():string; /** * Constructs a string for the filter API from the given parameter. * @param input - * @return */ static ofString(input:any):FilterValue; /** * Constructs a boolean for the filter API from the given parameter. * @param b - * @return */ static ofBoolean(b:boolean):FilterValue; } /** * Exists to keep the dh.TableMap namespace so that the web UI can remain compatible with the DHE API, which still calls * this type TableMap. * @deprecated */ export class TableMap { static readonly EVENT_KEYADDED:string; static readonly EVENT_DISCONNECT:string; static readonly EVENT_RECONNECT:string; static readonly EVENT_RECONNECTFAILED:string; protected constructor(); } export class CoreClient implements HasEventHandling { static readonly EVENT_CONNECT:string; static readonly EVENT_DISCONNECT:string; static readonly EVENT_RECONNECT:string; static readonly EVENT_RECONNECT_AUTH_FAILED:string; static readonly EVENT_REQUEST_FAILED:string; static readonly EVENT_REQUEST_STARTED:string; static readonly EVENT_REQUEST_SUCCEEDED:string; /** * @deprecated */ static readonly EVENT_REFRESH_TOKEN_UPDATED:string; static readonly LOGIN_TYPE_PASSWORD:string; static readonly LOGIN_TYPE_ANONYMOUS:string; constructor(serverUrl:string, connectOptions?:ConnectOptions); running():Promise; getServerUrl():string; getAuthConfigValues():Promise; login(credentials:LoginCredentials):Promise; relogin(token:RefreshToken):Promise; onConnected(timeoutInMillis?:number):Promise; getServerConfigValues():Promise; getStorageService():dh.storage.StorageService; getAsIdeConnection():Promise; disconnect():void; addEventListener(name:string, callback:(e:dh.Event)=>void):()=>void; nextEvent(eventName:string, timeoutInMillis?:number):Promise>; hasListeners(name:string):boolean; removeEventListener(name:string, callback:(e:dh.Event)=>void):boolean; } /** * A js type for operating on input tables. * * Represents a User Input Table, which can have data added to it from other sources. * * You may add rows using dictionaries of key-value tuples (representing columns by name), add tables containing all the * key/value columns to add, or delete tables containing the keys to delete. Each operation is atomic, and will either * succeed completely or fail completely. To guarantee order of operations, apply an operation and wait for the response * before sending the next operation. * * Each table has one or more key columns, where each unique combination of keys will appear at most once in the table. * * To view the results of the Input Table, you should use standard table operations on the InputTable's source Table * object. */ export class InputTable { protected constructor(); /** * Adds a single row to the table. For each key or value column name in the Input Table, we retrieve that javascript * property at that name and validate it can be put into the given column type. * @param row - * @param userTimeZone - * @return Promise of dh.InputTable */ addRow(row:{ [key: string]: any; }, userTimeZone?:string):Promise; /** * Add multiple rows to a table. * @param rows - * @param userTimeZone - * @return Promise of dh.InputTable */ addRows(rows:{ [key: string]: any; }[], userTimeZone?:string):Promise; /** * Add an entire table to this Input Table. Only column names that match the definition of the input table will be * copied, and all key columns must have values filled in. This only copies the current state of the source table; * future updates to the source table will not be reflected in the Input Table. The returned promise will be * resolved to the same InputTable instance this method was called upon once the server returns. * @param tableToAdd - * @return Promise of dh.InputTable */ addTable(tableToAdd:Table):Promise; /** * Add multiple tables to this Input Table. * @param tablesToAdd - * @return Promise of dh.InputTable */ addTables(tablesToAdd:Table[]):Promise; /** * Deletes an entire table from this Input Table. Key columns must match the Input Table. * @param tableToDelete - * @return Promise of dh.InputTable */ deleteTable(tableToDelete:Table):Promise; /** * Delete multiple tables from this Input Table. * @param tablesToDelete - * @return */ deleteTables(tablesToDelete:Table[]):Promise; /** * A list of the key columns, by name * @return String array. */ get keys():string[]; /** * A list of the value columns, by name * @return String array. */ get values():string[]; /** * A list of the key columns. * @return Column array. */ get keyColumns():Column[]; /** * A list of the value Column objects * @return {@link dh.Column} array. */ get valueColumns():Column[]; /** * The source table for this Input Table * @return dh.table */ get table():Table; } /** * Behaves like a {@link dh.Table} externally, but data, state, and viewports are managed by an entirely different * mechanism, and so reimplemented here. *

* Any time a change is made, we build a new request and send it to the server, and wait for the updated state. *

* Semantics around getting updates from the server are slightly different - we don't "unset" the viewport here after * operations are performed, but encourage the client code to re-set them to the desired position. *

* The table size will be -1 until a viewport has been fetched. *

* Similar to a table, a Tree Table provides access to subscribed viewport data on the current hierarchy. A different * Row type is used within that viewport, showing the depth of that node within the tree and indicating details about * whether it has children or is expanded. The Tree Table itself then provides the ability to change if a row is * expanded or not. Methods used to control or check if a row should be expanded or not can be invoked on a TreeRow * instance, or on the number of the row (thus allowing for expanding/collapsing rows which are not currently visible in * the viewport). *

* Events and viewports are somewhat different from tables, due to the expense of computing the expanded/collapsed rows * and count of children at each level of the hierarchy, and differences in the data that is available. *

*

    *
  • There is no {@link Table.totalSize | totalSize} property.
  • *
  • The viewport is not un-set when changes are made to filter or sort, but changes will continue to be streamed in. * It is suggested that the viewport be changed to the desired position (usually the first N rows) after any filter/sort * change is made. Likewise, {@link getViewportData} will always return the most recent data, and will not wait if a * new operation is pending.
  • *
  • Custom columns are supported on Rollup tables, but not on Tree tables. If the TreeTable was created client-side, * the original Table can have custom columns applied, and the TreeTable can be recreated.
  • *
  • Whereas Table has a {@link Table.totalsTableConfig} property, it is defined here as a method, * {@link getTotalsTableConfig}. This returns a promise so the config can be fetched asynchronously.
  • *
  • Totals Tables for trees vary in behavior between tree tables and roll-up tables. This behavior is based on the * original flat table used to produce the Tree Table - for a hierarchical table (i.e. Table.treeTable in the query * config), the totals will include non-leaf nodes (since they are themselves actual rows in the table), but in a * roll-up table, the totals only include leaf nodes (as non-leaf nodes are generated through grouping the contents of * the original table). Roll-ups also have the {@link dh.includeConstituents} property, indicating that a * {@link dh.Column} in the tree may have a {@link Column.constituentType} property reflecting that the type of cells * where {@link TreeRowImpl.hasChildren} is false will be different from usual.
  • *
*/ export class TreeTable implements HasEventHandling { /** * event.detail is the currently visible viewport data based on the active viewport configuration. */ static readonly EVENT_UPDATED:string; /** * event.detail is the currently visible viewport data based on the active viewport configuration. */ static readonly EVENT_DISCONNECT:string; /** * event.detail is the currently visible viewport data based on the active viewport configuration. */ static readonly EVENT_RECONNECT:string; /** * event.detail is the currently visible viewport data based on the active viewport configuration. */ static readonly EVENT_RECONNECTFAILED:string; /** * event.detail is the currently visible viewport data based on the active viewport configuration. */ static readonly EVENT_REQUEST_FAILED:string; readonly description?:string|null; readonly layoutHints?:null|LayoutHints; protected constructor(); /** * Expands the given node, so that its children are visible when they are in the viewport. The parameter can be the * row index, or the row object itself. The second parameter is a boolean value, false by default, specifying if the * row and all descendants should be fully expanded. Equivalent to `setExpanded(row, true)` with an optional third * boolean parameter. * @param row - * @param expandDescendants - */ expand(row:TreeRow|number, expandDescendants?:boolean):void; /** * Collapses the given node, so that its children and descendants are not visible in the size or the viewport. The * parameter can be the row index, or the row object itself. Equivalent to setExpanded(row, false, false). * @param row - */ collapse(row:TreeRow|number):void; /** * Specifies if the given node should be expanded or collapsed. If this node has children, and the value is changed, * the size of the table will change. If node is to be expanded and the third parameter, expandDescendants, * is true, then its children will also be expanded. * @param row - the row to expand or collapse, either the absolute row index or the row object * @param isExpanded - true to expand the row, false to collapse * @param expandDescendants - true to expand the row and all descendants, false to expand only the row, defaults to * false */ setExpanded(row:TreeRow|number, isExpanded:boolean, expandDescendants?:boolean):void; expandAll():void; collapseAll():void; /** * Tests if the specified row is expanded. * @param row - the row to test, either the absolute row index or the row object * @return boolean true if the row is expanded, false otherwise */ isExpanded(row:TreeRow|number):boolean; setViewport(firstRow:number, lastRow:number, columns?:Array|undefined|null, updateInterval?:number|undefined|null):void; getViewportData():Promise; /** * Indicates that the table will no longer be used, and server resources can be freed. */ close():void; /** * Applies the given sort to all levels of the tree. Returns the previous sort in use. * @param sort - * @return {@link dh.Sort} array */ applySort(sort:Sort[]):Array; /** * Applies the given filter to the contents of the tree in such a way that if any node is visible, then any parent * node will be visible as well even if that parent node would not normally be visible due to the filter's * condition. Returns the previous sort in use. * @param filter - * @return {@link dh.FilterCondition} array */ applyFilter(filter:FilterCondition[]):Array; /** * Adding new columns to the table based on other columns using updateView() mechanics. Rollup tables are supported * but Tree tables will throw an {@link java.lang.UnsupportedOperationException} if this function is called. * @param customColumns - * @return {@link dh.CustomColumn} array */ applyCustomColumns(customColumns:Array):Array; /** * a column with the given name, or throws an exception if it cannot be found * @param key - * @return {@link dh.Column} */ findColumn(key:string):Column; /** * an array with all of the named columns in order, or throws an exception if one cannot be found. * @param keys - * @return {@link dh.Column} array */ findColumns(keys:string[]):Column[]; /** * Provides Table-like selectDistinct functionality, but with a few quirks, since it is only fetching the distinct * values for the given columns in the source table: *
    *
  • Rollups may make no sense, since values are aggregated.
  • *
  • Values found on orphaned (and removed) nodes will show up in the resulting table, even though they are not in * the tree.
  • *
  • Values found on parent nodes which are only present in the tree since a child is visible will not be present * in the resulting table.
  • *
*/ selectDistinct(columns:Column[]):Promise
; getTotalsTableConfig():Promise; getTotalsTable(config?:object):Promise; getGrandTotalsTable(config?:object):Promise; /** * a new copy of this treetable, so it can be sorted and filtered separately, and maintain a different viewport. * Unlike Table, this will _not_ copy the filter or sort, since tree table viewport semantics differ, and without a * viewport set, the treetable doesn't evaluate these settings, and they aren't readable on the properties. Expanded * state is also not copied. * @return Promise of dh.TreeTable */ copy():Promise; /** * The current filter configuration of this Tree Table. * @return {@link dh.FilterCondition} array */ get filter():Array; /** * True if this is a roll-up and will provide the original rows that make up each grouping. * @return boolean */ get includeConstituents():boolean; get groupedColumns():Array; /** * True if this table has been closed. * @return boolean */ get isClosed():boolean; /** * The current number of rows given the table's contents and the various expand/collapse states of each node. (No * totalSize is provided at this time; its definition becomes unclear between roll-up and tree tables, especially * when considering collapse/expand states). * @return double */ get size():number; /** * Returns the columns that are aggregated. * @return array of aggregated columns */ get aggregatedColumns():Array; /** * The columns that can be shown in this Tree Table. * @return {@link dh.Column} array */ get columns():Array; /** * The current sort configuration of this Tree Table * @return {@link dh.Sort} array. */ get sort():Array; /** * The current list of custom columns added to this Tree Table. * @return {@link dh.CustomColumn} array */ get customColumns():Array; /** * True if this table may receive updates from the server, including size changed events, updated events after * initial snapshot. * @return boolean */ get isRefreshing():boolean; /** * Listen for events on this object. * @param name - the name of the event to listen for * @param callback - a function to call when the event occurs * @return Returns a cleanup function. * @typeParam T - the type of the data that the event will provide */ addEventListener(name:string, callback:(e:dh.Event)=>void):()=>void; nextEvent(eventName:string, timeoutInMillis?:number):Promise>; hasListeners(name:string):boolean; /** * Removes an event listener added to this table. * @param name - * @param callback - * @return * @typeParam T - */ removeEventListener(name:string, callback:(e:dh.Event)=>void):boolean; } /** * Wrap BigDecimal values for use in JS. Provides text formatting for display and access to the underlying value. */ export class BigDecimalWrapper { protected constructor(); static ofString(value:string):BigDecimalWrapper; asNumber():number; valueOf():string; toString():string; equals(o:object):boolean; hashCode():number; } export class LongWrapper { protected constructor(); static ofString(str:string):LongWrapper; asNumber():number; valueOf():string; toString():string; } /** * A Widget represents a server side object that sends one or more responses to the client. The client can then * interpret these responses to see what to render, or how to respond. *

* Most custom object types result in a single response being sent to the client, often with other exported objects, but * some will have streamed responses, and allow the client to send follow-up requests of its own. This class's API is * backwards compatible, but as such does not offer a way to tell the difference between a streaming or non-streaming * object type, the client code that handles the payloads is expected to know what to expect. See * {@link dh.WidgetMessageDetails} for more information. *

* When the promise that returns this object resolves, it will have the first response assigned to its fields. Later * responses from the server will be emitted as "message" events. When the connection with the server ends, the "close" * event will be emitted. In this way, the connection will behave roughly in the same way as a WebSocket - either side * can close, and after close no more messages will be processed. There can be some latency in closing locally while * remote messages are still pending - it is up to implementations of plugins to handle this case. *

* Also like WebSockets, the plugin API doesn't define how to serialize messages, and just handles any binary payloads. * What it does handle however, is allowing those messages to include references to server-side objects with those * payloads. Those server side objects might be tables or other built-in types in the Deephaven JS API, or could be * objects usable through their own plugins. They also might have no plugin at all, allowing the client to hold a * reference to them and pass them back to the server, either to the current plugin instance, or through another API. * The `Widget` type does not specify how those objects should be used or their lifecycle, but leaves that * entirely to the plugin. Messages will arrive in the order they were sent. *

* This can suggest several patterns for how plugins operate: *

    *
  • The plugin merely exists to transport some other object to the client. This can be useful for objects which can * easily be translated to some other type (like a Table) when the user clicks on it. An example of this is * `pandas.DataFrame` will result in a widget that only contains a static * {@link dh.Table}. Presently, the widget is immediately closed, and only the Table is * provided to the JS API consumer.
  • *
  • The plugin provides references to Tables and other objects, and those objects can live longer than the object * which provided them. One concrete example of this could have been * {@link dh.PartitionedTable} when fetching constituent tables, but it was implemented * before bidirectional plugins were implemented. Another example of this is plugins that serve as a "factory", giving * the user access to table manipulation/creation methods not supported by gRPC or the JS API.
  • *
  • The plugin provides reference to Tables and other objects that only make sense within the context of the widget * instance, so when the widget goes away, those objects should be released as well. This is also an example of * {@link dh.PartitionedTable}, as the partitioned table tracks creation of new keys through * an internal table instance.
  • *
* * Handling server objects in messages also has more than one potential pattern that can be used: *
    *
  • One object per message - the message clearly is about that object, no other details required.
  • *
  • Objects indexed within their message - as each message comes with a list of objects, those objects can be * referenced within the payload by index. This is roughly how {@link dh.plot.Figure} * behaves, where the figure descriptor schema includes an index for each created series, describing which table should * be used, which columns should be mapped to each axis.
  • *
  • Objects indexed since widget creation - each message would append its objects to a list created when the widget * was first made, and any new exports that arrive in a new message would be appended to that list. Then, subsequent * messages can reference objects already sent. This imposes a limitation where the client cannot release any exports * without the server somehow signaling that it will never reference that export again.
  • *
*/ export class Widget implements WidgetMessageDetails, HasEventHandling { static readonly EVENT_MESSAGE:string; static readonly EVENT_CLOSE:string; protected constructor(); /** * Ends the client connection to the server. */ close():void; getDataAsBase64():string; getDataAsU8():Uint8Array; getDataAsString():string; /** * Sends a string/bytes payload to the server, along with references to objects that exist on the server. * @param msg - string/buffer/view instance that represents data to send * @param references - an array of objects that can be safely sent to the server */ sendMessage(msg:string|ArrayBuffer|ArrayBufferView, references?:Array):void; addEventListener(name:string, callback:(e:dh.Event)=>void):()=>void; nextEvent(eventName:string, timeoutInMillis?:number):Promise>; hasListeners(name:string):boolean; removeEventListener(name:string, callback:(e:dh.Event)=>void):boolean; /** * * @return the exported objects sent in the initial message from the server. The client is responsible for closing * them when finished using them. */ get exportedObjects():WidgetExportedObject[]; /** * * @return the type of this widget */ get type():string; } /** * Provides access to data in a table. Note that several methods present their response through Promises. This allows * the client to both avoid actually connecting to the server until necessary, and also will permit some changes not to * inform the UI right away that they have taken place. */ export class Table implements JoinableTable, HasEventHandling { readonly description?:string|null; readonly pluginName?:string|null; readonly layoutHints?:null|LayoutHints; /** * The table size has updated, so live scrollbars and the like can be updated accordingly. */ static readonly EVENT_SIZECHANGED:string; /** * The table size has updated, so live scrollbars and the like can be updated accordingly. */ static readonly EVENT_UPDATED:string; /** * The table size has updated, so live scrollbars and the like can be updated accordingly. */ static readonly EVENT_ROWADDED:string; /** * The table size has updated, so live scrollbars and the like can be updated accordingly. */ static readonly EVENT_ROWREMOVED:string; /** * The table size has updated, so live scrollbars and the like can be updated accordingly. */ static readonly EVENT_ROWUPDATED:string; /** * The table size has updated, so live scrollbars and the like can be updated accordingly. */ static readonly EVENT_SORTCHANGED:string; /** * The table size has updated, so live scrollbars and the like can be updated accordingly. */ static readonly EVENT_FILTERCHANGED:string; /** * The table size has updated, so live scrollbars and the like can be updated accordingly. */ static readonly EVENT_CUSTOMCOLUMNSCHANGED:string; /** * The table size has updated, so live scrollbars and the like can be updated accordingly. */ static readonly EVENT_DISCONNECT:string; /** * The table size has updated, so live scrollbars and the like can be updated accordingly. */ static readonly EVENT_RECONNECT:string; /** * The table size has updated, so live scrollbars and the like can be updated accordingly. */ static readonly EVENT_RECONNECTFAILED:string; /** * The table size has updated, so live scrollbars and the like can be updated accordingly. */ static readonly EVENT_REQUEST_FAILED:string; /** * The table size has updated, so live scrollbars and the like can be updated accordingly. */ static readonly EVENT_REQUEST_SUCCEEDED:string; /** * The size the table will have if it is uncoalesced. */ static readonly SIZE_UNCOALESCED:number; protected constructor(); batch(userCode:(arg0:unknown)=>void):Promise
; /** * Retrieve a column by the given name. You should prefer to always retrieve a new Column instance instead of * caching a returned value. * @param key - * @return {@link dh.Column} */ findColumn(key:string):Column; /** * Retrieve multiple columns specified by the given names. * @param keys - * @return {@link dh.Column} array */ findColumns(keys:string[]):Column[]; isBlinkTable():boolean; /** * If .hasInputTable is true, you may call this method to gain access to an InputTable object which can be used to * mutate the data within the table. If the table is not an Input Table, the promise will be immediately rejected. * @return Promise of dh.InputTable */ inputTable():Promise; /** * Indicates that this Table instance will no longer be used, and its connection to the server can be cleaned up. */ close():void; getAttributes():string[]; /** * null if no property exists, a string if it is an easily serializable property, or a ```Promise * <Table>``` that will either resolve with a table or error out if the object can't be passed to JS. * @param attributeName - * @return Object */ getAttribute(attributeName:string):unknown|undefined|null; /** * Replace the currently set sort on this table. Returns the previously set value. Note that the sort property will * immediately return the new value, but you may receive update events using the old sort before the new sort is * applied, and the sortchanged event fires. Reusing existing, applied sorts may enable this to perform * better on the server. The updated event will also fire, but rowadded and rowremoved will * not. * @param sort - * @return {@link dh.Sort} array */ applySort(sort:Sort[]):Array; /** * Replace the currently set filters on the table. Returns the previously set value. Note that the filter property * will immediately return the new value, but you may receive update events using the old filter before the new one * is applied, and the filterchanged event fires. Reusing existing, applied filters may enable this to * perform better on the server. The updated event will also fire, but rowadded and rowremoved * will not. * @param filter - * @return {@link dh.FilterCondition} array */ applyFilter(filter:FilterCondition[]):Array; /** * used when adding new filter and sort operations to the table, as long as they are present. * @param customColumns - * @return {@link dh.CustomColumn} array */ applyCustomColumns(customColumns:Array):Array; /** * If the columns parameter is not provided, all columns will be used. If the updateIntervalMs parameter is not * provided, a default of one second will be used. Until this is called, no data will be available. Invoking this * will result in events to be fired once data becomes available, starting with an `updated` event and a * rowadded event per row in that range. The returned object allows the viewport to be closed when no longer * needed. * @param firstRow - * @param lastRow - * @param columns - * @param updateIntervalMs - * @return {@link dh.TableViewportSubscription} * @deprecated Use {@link #createViewportSubscription(Object)} instead. */ setViewport(firstRow:number, lastRow:number, columns?:Array|undefined|null, updateIntervalMs?:number|undefined|null, isReverseViewport?:boolean|undefined|null):TableViewportSubscription; /** * Gets the currently visible viewport. If the current set of operations has not yet resulted in data, it will not * resolve until that data is ready. If this table is closed before the promise resolves, it will be rejected - to * separate the lifespan of this promise from the table itself, call * {@link TableViewportSubscription.getViewportData} on the result from {@link Table.setViewport}. * @return Promise of {@link dh.TableData} * @deprecated use {@link TableViewportSubscription#getViewportData()} on the result from * {@link #createViewportSubscription(Object)} instead. */ getViewportData():Promise; /** * Creates a subscription to the specified columns, across all rows in the table. The optional parameter * updateIntervalMs may be specified to indicate how often the server should send updates, defaulting to one second * if omitted. Useful for charts or taking a snapshot of the table atomically. The initial snapshot will arrive in a * single event, but later changes will be sent as updates. However, this may still be very expensive to run from a * browser for very large tables. Each call to subscribe creates a new subscription, which must have close() * called on it to stop it, and all events are fired from the TableSubscription instance. * @param columns - * @param updateIntervalMs - * @return {@link dh.TableSubscription} * @deprecated Use {@link #createSubscription(Object)} with a {@link DataOptions.SubscriptionOptions} instead. */ subscribe(columns:Array, updateIntervalMs?:number):TableSubscription; /** * Creates a subscription to the specified columns, across all rows in the table. Useful for charts or taking a * snapshot of the table atomically. The initial snapshot will arrive in a single event, but later changes will be * sent as updates. However, this may still be very expensive to run from a browser for very large tables. Each call * to `createSubscription` creates a new subscription, which must have {@link io.deephaven.web.client.api.subscription.AbstractTableSubscription.close} * called on it to stop it and release its resources, and all events are fired from the TableSubscription instance. * @param options - options for the subscription; see {@link dh.SubscriptionOptions} for details * @return a new {@link dh.TableSubscription} */ createSubscription(options:SubscriptionOptions):TableSubscription; /** * Creates a viewport subscription to the specified columns, across the specified rows in the table. The returned * TableViewportSubscription instance allows the viewport to be changed over time, and events are fired from it when * the data changes or when a viewport change has been applied. Each call to `createSubscription` creates a * new subscription, which must have {@link TableViewportSubscription.close} called on it to stop it and release * its resources * @param options - options for the viewport subscription; see {@link dh.ViewportSubscriptionOptions} for * details * @return a new {@link dh.TableViewportSubscription} */ createViewportSubscription(options:ViewportSubscriptionOptions):TableViewportSubscription; /** * Returns a promise that will resolve to a TableData containing a snapshot of the current state of the table, * within the bounds of the specified rows and columns. * @param options - options for the snapshot; see {@link dh.SnapshotOptions} for details * @return Promise of {@link dh.TableData} */ createSnapshot(options:SnapshotOptions):Promise; /** * a new table containing the distinct tuples of values from the given columns that are present in the original * table. This table can be manipulated as any other table. Sorting is often desired as the default sort is the * order of appearance of values from the original table. * @param columns - * @return Promise of dh.Table */ selectDistinct(columns:Column[]):Promise
; /** * Creates a new copy of this table, so it can be sorted and filtered separately, and maintain a different viewport. * @return Promise of dh.Table */ copy():Promise
; /** * a promise that will resolve to a Totals Table of this table. This table will obey the configurations provided as * a parameter, or will use the table's default if no parameter is provided, and be updated once per second as * necessary. Note that multiple calls to this method will each produce a new TotalsTable which must have close() * called on it when not in use. * @param config - * @return Promise of dh.TotalsTable */ getTotalsTable(config?:TotalsTableConfig|undefined|null):Promise; /** * a promise that will resolve to a Totals Table of this table, ignoring any filters. See getTotalsTable() * above for more specifics. * @param config - * @return promise of dh.TotalsTable */ getGrandTotalsTable(config?:TotalsTableConfig|undefined|null):Promise; /** * a promise that will resolve to a new roll-up TreeTable of this table. Multiple calls to this method will * each produce a new TreeTable which must have close() called on it when not in use. * @param configObject - * @return Promise of dh.TreeTable */ rollup(configObject:RollupConfig):Promise; /** * a promise that will resolve to a new `TreeTable` of this table. Multiple calls to this method will each produce a * new `TreeTable` which must have close() called on it when not in use. * @param configObject - * @return Promise dh.TreeTable */ treeTable(configObject:TreeTableConfig):Promise; /** * a "frozen" version of this table (a server-side snapshot of the entire source table). Viewports on the frozen * table will not update. This does not change the original table, and the new table will not have any of the client * side sorts/filters/columns. New client side sorts/filters/columns can be added to the frozen copy. * @return Promise of dh.Table */ freeze():Promise
; snapshot(baseTable:Table, doInitialSnapshot?:boolean, stampColumns?:string[]):Promise
; /** * * @inheritDoc * @deprecated */ join(joinType:string, rightTable:JoinableTable, columnsToMatch:Array, columnsToAdd?:Array|undefined|null, asOfMatchRule?:string|undefined|null):Promise
; asOfJoin(rightTable:JoinableTable, columnsToMatch:Array, columnsToAdd?:Array|undefined|null, asOfMatchRule?:string|undefined|null):Promise
; crossJoin(rightTable:JoinableTable, columnsToMatch:Array, columnsToAdd?:Array|undefined|null, reserveBits?:number|undefined|null):Promise
; exactJoin(rightTable:JoinableTable, columnsToMatch:Array, columnsToAdd?:Array):Promise
; naturalJoin(rightTable:JoinableTable, columnsToMatch:Array, columnsToAdd?:Array):Promise
; byExternal(keys:object, dropKeys?:boolean):Promise; /** * Creates a new PartitionedTable from the contents of the current table, partitioning data based on the specified * keys. * @param keys - * @param dropKeys - * @return Promise dh.PartitionedTable */ partitionBy(keys:object, dropKeys?:boolean):Promise; /** * a promise that will resolve to ColumnStatistics for the column of this table. * @param column - * @return Promise of dh.ColumnStatistics */ getColumnStatistics(column:Column):Promise; /** * Seek the row matching the data provided * @param startingRow - Row to start the seek from * @param column - Column to seek for value on * @param valueType - Type of value provided * @param seekValue - Value to seek * @param insensitive - Optional value to flag a search as case-insensitive. Defaults to `false`. * @param contains - Optional value to have the seek value do a contains search instead of exact equality. Defaults to * `false`. * @param isBackwards - Optional value to seek backwards through the table instead of forwards. Defaults to `false`. * @return A promise that resolves to the row value found. */ seekRow(startingRow:number, column:Column, valueType:ValueTypeType, seekValue:any, insensitive?:boolean|undefined|null, contains?:boolean|undefined|null, isBackwards?:boolean|undefined|null):Promise; toString():string; /** * True if this table represents a user Input Table (created by InputTable.newInputTable). When true, you may call * .inputTable() to add or remove data from the underlying table. * @return boolean */ get hasInputTable():boolean; /** * The columns that are present on this table. This is always all possible columns. If you specify fewer columns in * .setViewport(), you will get only those columns in your ViewportData. Number size The total count of rows * in the table. The size can and will change; see the sizechanged event for details. Size will be negative * in exceptional cases (eg. the table is uncoalesced, see the isUncoalesced property for details). * @return {@link dh.Column} array */ get columns():Array; /** * The default configuration to be used when building a TotalsTable for this table. * @return dh.TotalsTableConfig */ get totalsTableConfig():TotalsTableConfig; /** * An ordered list of Sorts to apply to the table. To update, call applySort(). Note that this getter will * return the new value immediately, even though it may take a little time to update on the server. You may listen * for the sortchanged event to know when to update the UI. * @return {@link dh.Sort} array */ get sort():Array; /** * An ordered list of custom column formulas to add to the table, either adding new columns or replacing existing * ones. To update, call applyCustomColumns(). * @return {@link dh.CustomColumn} array */ get customColumns():Array; /** * True if this table may receive updates from the server, including size changed events, updated events after * initial snapshot. * @return boolean */ get isRefreshing():boolean; /** * An ordered list of Filters to apply to the table. To update, call applyFilter(). Note that this getter will * return the new value immediately, even though it may take a little time to update on the server. You may listen * for the filterchanged event to know when to update the UI. * @return {@link dh.FilterCondition} array */ get filter():Array; /** * The total count of the rows in the table, excluding any filters. Unlike {@link Table.size}, changes to this value * will not result in any event. If the table is unfiltered, this will return the same size as {@link Table.size}. * If this table was uncoalesced before it was filtered, this will return {@link dh.Table.SIZE_UNCOALESCED}. * @return the size of the table before filters, or {@link dh.Table.SIZE_UNCOALESCED} */ get totalSize():number; /** * The total count of rows in the table. If there is a viewport subscription active, this size will be updated when * the subscription updates. If not, and {@link Table.uncoalesced} is true, the size will be * {@link dh.Table.SIZE_UNCOALESCED}. Otherwise, the size will be updated when the server's update graph processes changes. *

* When the size changes, the {@link dh.Table.EVENT_SIZECHANGED} event will be fired. * @return the size of the table, or {@link dh.Table.SIZE_UNCOALESCED} if there is no subscription and the table is * uncoalesced. */ get size():number; /** * True if this table has been closed. * @return boolean */ get isClosed():boolean; /** * Read-only. True if this table is uncoalesced, indicating that work must be done before the table can be used. *

* Uncoalesced tables are expensive to operate on - filter to a single partition or range of partitions before * subscribing to access only the desired data efficiently. A subscription can be specified without a filter, but * this can be very expensive. To see which partitions are available, check each column on the table to see which * have {@link Column.isPartitionColumn} as `true`, and filter those columns. To read the possible values * for those columns, use {@link Table.selectDistinct}. * @return True if the table is uncoaleced and should be filtered before operating on it, otherwise false. */ get isUncoalesced():boolean; /** * Listen for events on this object. * @param name - the name of the event to listen for * @param callback - a function to call when the event occurs * @return Returns a cleanup function. * @typeParam T - the type of the data that the event will provide */ addEventListener(name:string, callback:(e:dh.Event)=>void):()=>void; nextEvent(eventName:string, timeoutInMillis?:number):Promise>; hasListeners(name:string):boolean; /** * Removes an event listener added to this table. * @param name - * @param callback - * @return * @typeParam T - */ removeEventListener(name:string, callback:(e:dh.Event)=>void):boolean; /** * a Sort than can be used to reverse a table. This can be passed into n array in applySort. Note that Tree Tables * do not support reverse. * @return {@link dh.Sort} */ static reverse():Sort; } /** * This object serves as a "handle" to a subscription, allowing it to be acted on directly or canceled outright. If you * retain an instance of this, you have two choices - either only use it to call `close()` on it to stop the table's * viewport without creating a new one, or listen directly to this object instead of the table for data events, and * always call `close()` when finished. Calling any method on this object other than close() will result in it * continuing to live on after `setViewport` is called on the original table, or after the table is modified. */ export class TableViewportSubscription implements HasEventHandling { protected constructor(); /** * Changes the rows and columns set on this viewport. This cannot be used to change the update interval. * @param firstRow - * @param lastRow - * @param columns - * @param updateIntervalMs - * @deprecated use {@link #update(Object)} instead */ setViewport(firstRow:number, lastRow:number, columns?:Column[]|undefined|null, updateIntervalMs?:number|undefined|null, isReverseViewport?:boolean|undefined|null):void; /** * Update the options for this viewport subscription. This cannot alter the update interval or preview options. * @param options - the subscription options */ update(options:ViewportSubscriptionOptions):void; /** * Stops this viewport from running, stopping all events on itself and on the table that created it. */ close():void; /** * Gets the data currently visible in this viewport * @return Promise of {@link dh.TableData}. */ getViewportData():Promise; /** * * @deprecated Use {@link JsTable#createSnapshot(Object)} instead */ snapshot(rows:RangeSet, columns:Column[]):Promise; /** * Listen for events on this object. * @param name - the name of the event to listen for * @param callback - a function to call when the event occurs * @return Returns a cleanup function. * @typeParam T - the type of the data that the event will provide */ addEventListener(name:string, callback:(e:dh.Event)=>void):()=>void; nextEvent(eventName:string, timeoutInMillis?:number):Promise>; hasListeners(name:string):boolean; /** * Removes an event listener added to this table. * @param name - * @param callback - * @return * @typeParam T - */ removeEventListener(name:string, callback:(e:dh.Event)=>void):boolean; } export class DateWrapper extends LongWrapper { protected constructor(); static ofJsDate(date:Date):DateWrapper; asDate():Date; } /** * Configuration object for running Table.treeTable to produce a hierarchical view of a given "flat" table. * * Like TotalsTableConfig, `TreeTableConfig` supports an operation map indicating how to aggregate the data, as well as * an array of column names which will be the layers in the roll-up tree, grouped at each level. An additional optional * value can be provided describing the strategy the engine should use when grouping the rows. */ export class TreeTableConfig { /** * The column representing the unique ID for each item */ idColumn:string; /** * The column representing the parent ID for each item */ parentColumn:string; /** * Optional parameter indicating if items with an invalid parent ID should be promoted to root. Defaults to false. */ promoteOrphansToRoot:boolean; constructor(); } /** * Presently, this is the entrypoint into the Deephaven JS API. By creating an instance of this with the server URL and * some options, JS applications can run code on the server, and interact with available exportable objects. */ export class IdeConnection implements HasEventHandling { /** * @deprecated */ static readonly HACK_CONNECTION_FAILURE:string; static readonly EVENT_DISCONNECT:string; static readonly EVENT_RECONNECT:string; static readonly EVENT_SHUTDOWN:string; protected constructor(); /** * Closes the current connection, releasing any resources on the server or client. */ close():void; running():Promise; /** * Load the named table, with columns and size information already fully populated. * @param name - the name of the table to fetch * @param applyPreviewColumns - false to disable previews, defaults to true * @return a {@link Promise} that will resolve to the table, or reject with an error if it cannot be loaded. * @deprecated Added to resolve a specific issue, in the future preview will be applied as part of the subscription. */ getTable(name:string, applyPreviewColumns?:boolean):Promise

; getObject(definitionObject:dh.ide.VariableDescriptor):Promise; subscribeToFieldUpdates(callback:(arg0:dh.ide.VariableChanges)=>void):()=>void; /** * Makes an `object` available to another user or another client on this same server which knows the value of * the `sharedTicketBytes`. Use that sharedTicketBytes value like a one-time use password - any other client * which knows this value can read the same object. *

* Shared objects will remain available using the sharedTicketBytes until the client that first shared them * releases/closes their copy of the object. Whatever side-channel is used to share the bytes, be sure to wait until * the remote end has signaled that it has successfully fetched the object before releasing it from this client. *

* Be sure to use an unpredictable value for the shared ticket bytes, like a UUID or other large, random value to * prevent access by unauthorized clients. * @param object - the object to share with another client/user * @param sharedTicketBytes - the value which another client/user must know to obtain the object. It may be a unicode * string (will be encoded as utf8 bytes), or a {@link Uint8Array} value. * @return A promise that will resolve to the value passed as sharedTicketBytes when the object is ready to be read * by another client, or will reject if an error occurs. */ shareObject(object:Table|Widget|WidgetExportedObject|PartitionedTable|TotalsTable|TreeTable, sharedTicketBytes:string|Uint8Array):Promise; /** * Reads an object shared by another client to this server with the `sharedTicketBytes`. Until the other * client releases this object (or their session ends), the object will be available on the server. *

* The type of the object must be passed so that the object can be read from the server correct - the other client * should provide this information. * @param sharedTicketBytes - the value provided by another client/user to obtain the object. It may be a unicode * string (will be encoded as utf8 bytes), or a {@link Uint8Array} value. * @param type - The type of the object, so it can be correctly read from the server * @return A promise that will resolve to the shared object, or will reject with an error if it cannot be read. */ getSharedObject(sharedTicketBytes:string|Uint8Array, type:string):Promise; newTable(columnNames:string[], types:string[], data:string[][], userTimeZone:string):Promise

; /** * Merges the given tables into a single table. Assumes all tables have the same structure. * @param tables - * @return {@link Promise} of {@link dh.Table} */ mergeTables(tables:Table[]):Promise
; /** * Register a callback function to handle any log messages that are emitted on the server. Returns a function , * which can be invoked to remove this log handler. Any log handler registered in this way will receive as many old * log messages as are presently available. * @param callback - * @return {@link io.deephaven.web.shared.fu.JsRunnable} */ onLogMessage(callback:(arg0:dh.ide.LogItem)=>void):()=>void; startSession(type:string):Promise; getConsoleTypes():Promise>; getWorkerHeapInfo():Promise; /** * Listen for events on this object. * @param name - the name of the event to listen for * @param callback - a function to call when the event occurs * @return Returns a cleanup function. * @typeParam T - the type of the data that the event will provide */ addEventListener(name:string, callback:(e:dh.Event)=>void):()=>void; nextEvent(eventName:string, timeoutInMillis?:number):Promise>; hasListeners(name:string):boolean; /** * Removes an event listener added to this table. * @param name - * @param callback - * @return * @typeParam T - */ removeEventListener(name:string, callback:(e:dh.Event)=>void):boolean; } /** * Options for custom columns. */ export class CustomColumnOptions { /** * When specified for custom columns on a rollup table, specifies if the formula apply to rollup or constituent * nodes. */ rollupNodeType?:RollupNodeTypeType|null; constructor(); } /** * Represents a non-viewport subscription to a table, and all data currently known to be present in the subscribed * columns. This class handles incoming snapshots and deltas, and fires events to consumers to notify of data changes. *

* Unlike {@link dh.TableViewportSubscription}, the "original" table does not have a reference to this instance, only the * "private" table instance does, since the original cannot modify the subscription, and the private instance must * forward data to it. *

* Represents a subscription to the table on the server. Changes made to the table will not be reflected here - the * subscription must be closed and a new one optioned to see those changes. The event model is slightly different from * viewports to make it less expensive to compute for large tables. */ export class TableSubscription implements HasEventHandling { protected constructor(); static createTableSubscription(options:SubscriptionOptions, existingTable:Table):TableSubscription; /** * Updates the subscription to use the given columns and update interval. * @param columns - the new columns to subscribe to * @param updateIntervalMs - the new update interval, or null/omit to use the default of one second */ changeSubscription(columns:Array, updateIntervalMs:number|undefined|null):void; /** * Update the options for this viewport subscription. This cannot alter the update interval or preview options. * @param options - the subscription options */ update(options:SubscriptionOptions):void; get columns():Array; /** * Stops the subscription on the server. */ close():void; /** * Listen for events on this object. * @param name - the name of the event to listen for * @param callback - a function to call when the event occurs * @return Returns a cleanup function. * @typeParam T - the type of the data that the event will provide */ addEventListener(name:string, callback:(e:dh.Event)=>void):()=>void; nextEvent(eventName:string, timeoutInMillis?:number):Promise>; hasListeners(name:string):boolean; /** * Removes an event listener added to this table. * @param name - * @param callback - * @return * @typeParam T - */ removeEventListener(name:string, callback:(e:dh.Event)=>void):boolean; } /** * Deprecated for use in Deephaven Core. * @deprecated */ export class Client { static readonly EVENT_REQUEST_FAILED:string; static readonly EVENT_REQUEST_STARTED:string; static readonly EVENT_REQUEST_SUCCEEDED:string; constructor(); } /** * Describes the structure of the column, and if desired can be used to get access to the data to be rendered in this * column. */ export class Column { /** * If this column is part of a roll-up tree table, represents the type of the row data that can be found in this * column for leaf nodes if includeConstituents is enabled. Otherwise, it is null. * @return String */ readonly constituentType?:string|null; readonly description?:string|null; protected constructor(); /** * the value for this column in the given row. Type will be consistent with the type of the Column. * @param row - * @return Any */ get(row:Row):any; getFormat(row:Row):Format; /** * Creates a sort builder object, to be used when sorting by this column. * @return {@link dh.Sort} */ sort():Sort; /** * Creates a new value for use in filters based on this column. Used either as a parameter to another filter * operation, or as a builder to create a filter operation. * @return {@link dh.FilterValue} */ filter():FilterValue; /** * a CustomColumn object to apply using `applyCustomColumns` with the expression specified. * @param expression - * @return {@link dh.CustomColumn} */ formatColor(expression:string, options?:CustomColumnOptions|undefined|null):CustomColumn; /** * a CustomColumn object to apply using applyCustomColumns with the expression specified. * @param expression - * @return {@link dh.CustomColumn} */ formatNumber(expression:string, options?:CustomColumnOptions|undefined|null):CustomColumn; /** * a CustomColumn object to apply using applyCustomColumns with the expression specified. * @param expression - * @return {@link dh.CustomColumn} */ formatDate(expression:string, options?:CustomColumnOptions|undefined|null):CustomColumn; toString():string; /** * Label for this column. * @return String */ get name():string; /** * True if this column is a partition column. Partition columns are used for filtering uncoalesced tables - see * {@link Table.uncoalesced}. * @return true if the column is a partition column */ get isPartitionColumn():boolean; /** * * @deprecated do not use. Internal index of the column in the table, to be used as a key on the Row. * @return int */ get index():number; get isSortable():boolean; /** * Type of the row data that can be found in this column. * @return String */ get type():string; /** * Format entire rows colors using the expression specified. Returns a CustomColumn object to apply to a * table using applyCustomColumns with the parameters specified. * @param expression - * @param options - * @return {@link dh.CustomColumn} */ static formatRowColor(expression:string, options?:CustomColumnOptions|undefined|null):CustomColumn; /** * a CustomColumn object to apply using applyCustomColumns with the expression specified. * @param name - * @param expression - * @param options - * @return {@link dh.CustomColumn} */ static createCustomColumn(name:string, expression:string, options?:CustomColumnOptions|undefined|null):CustomColumn; } export class LoginCredentials { type?:string|null; username?:string|null; token?:string|null; constructor(); } export class QueryInfo { static readonly EVENT_TABLE_OPENED:string; static readonly EVENT_DISCONNECT:string; static readonly EVENT_RECONNECT:string; static readonly EVENT_CONNECT:string; protected constructor(); } /** * Represents a set of Tables each corresponding to some key. The keys are available locally, but a call must be made to * the server to get each Table. All tables will have the same structure. */ export class PartitionedTable implements HasEventHandling { /** * Indicates that a new key has been added to the array of keys, which can now be fetched with getTable. */ static readonly EVENT_KEYADDED:string; /** * Indicates that a new key has been added to the array of keys, which can now be fetched with getTable. */ static readonly EVENT_DISCONNECT:string; /** * Indicates that a new key has been added to the array of keys, which can now be fetched with getTable. */ static readonly EVENT_RECONNECT:string; /** * Indicates that a new key has been added to the array of keys, which can now be fetched with getTable. */ static readonly EVENT_RECONNECTFAILED:string; protected constructor(); /** * Fetch the table with the given key. If the key does not exist, returns `null`. * @param key - The key to fetch. An array of values for each key column, in the same order as the key columns are. * @return Promise of dh.Table, or `null` if the key does not exist. */ getTable(key:object):Promise; /** * Open a new table that is the result of merging all constituent tables. See * {@link io.deephaven.engine.table.PartitionedTable.merge} for details. * @return A merged representation of the constituent tables. */ getMergedTable():Promise

; /** * The set of all currently known keys. This is kept up to date, so getting the list after adding an event listener * for keyadded will ensure no keys are missed. * @return Set of Object */ getKeys():Set; /** * Fetch a table containing all the valid keys of the partitioned table. * @return Promise of a Table * @deprecated */ getKeyTable():Promise
; /** * Fetch the underlying base table of the partitioned table. * @return Promise of a Table */ getBaseTable():Promise
; /** * Indicates that this PartitionedTable will no longer be used, removing subcriptions to updated keys, etc. This * will not affect tables in use. */ close():void; /** * The count of known keys. * @return int */ get size():number; /** * An array of the columns in the tables that can be retrieved from this partitioned table, including both key and * non-key columns. * @return Array of Column */ get columns():Column[]; /** * An array of all the key columns that the tables are partitioned by. * @return Array of Column */ get keyColumns():Column[]; /** * Listen for events on this object. * @param name - the name of the event to listen for * @param callback - a function to call when the event occurs * @return Returns a cleanup function. * @typeParam T - the type of the data that the event will provide */ addEventListener(name:string, callback:(e:dh.Event)=>void):()=>void; nextEvent(eventName:string, timeoutInMillis?:number):Promise>; hasListeners(name:string):boolean; /** * Removes an event listener added to this table. * @param name - * @param callback - * @return * @typeParam T - */ removeEventListener(name:string, callback:(e:dh.Event)=>void):boolean; } /** * Describes a Sort present on the table. No visible constructor, created through the use of Column.sort(), will be tied * to that particular column data. Sort instances are immutable, and use a builder pattern to make modifications. All * methods return a new Sort instance. */ export class Sort { static readonly ASCENDING:string; static readonly DESCENDING:string; static readonly REVERSE:string; protected constructor(); /** * Builds a Sort instance to sort values in ascending order. * @return {@link dh.Sort} */ asc():Sort; /** * Builds a Sort instance to sort values in descending order. * @return {@link dh.Sort} */ desc():Sort; /** * Builds a Sort instance which takes the absolute value before applying order. * @return {@link dh.Sort} */ abs():Sort; toString():string; /** * True if the absolute value of the column should be used when sorting; defaults to false. * @return boolean */ get isAbs():boolean; /** * The column which is sorted. * @return {@link dh.Column} */ get column():Column; /** * The direction of this sort, either ASC, DESC, or REVERSE. * @return String */ get direction():string; } /** * Event fired when a command is issued from the client. */ export class CommandInfo { constructor(code:string, result:Promise); get result():Promise; get code():string; } /** * Wrap BigInteger values for use in JS. Provides text formatting for display and access to the underlying value. */ export class BigIntegerWrapper { protected constructor(); static ofString(str:string):BigIntegerWrapper; asNumber():number; valueOf():string; toString():string; equals(o:object):boolean; hashCode():number; } /** * This class allows iteration over non-contiguous indexes. In the future, this will support the EcmaScript 2015 * Iteration protocol, but for now has one method which returns an iterator, and also supports querying the size. * Additionally, we may add support for creating RangeSet objects to better serve some use cases. */ export class RangeSet { protected constructor(); static ofRange(first:number, last:number):RangeSet; static ofItems(rows:number[]):RangeSet; static ofRanges(ranges:RangeSet[]):RangeSet; static ofSortedRanges(ranges:RangeSet[]):RangeSet; /** * a new iterator over all indexes in this collection. * @return Iterator of {@link dh.LongWrapper} */ iterator():Iterator; /** * The total count of items contained in this collection. In some cases this can be expensive to compute, and * generally should not be needed except for debugging purposes, or preallocating space (i.e., do not call this * property each time through a loop). * @return double */ get size():number; } /** * Describes a filter which can be applied to a table. Replacing these instances may be more expensive than reusing * them. These instances are immutable - all operations that compose them to build bigger expressions return a new * instance. */ export class FilterCondition { protected constructor(); /** * the opposite of this condition * @return FilterCondition */ not():FilterCondition; /** * a condition representing the current condition logically ANDed with the other parameters * @param filters - * @return FilterCondition */ and(...filters:FilterCondition[]):FilterCondition; /** * a condition representing the current condition logically ORed with the other parameters * @param filters - * @return FilterCondition. */ or(...filters:FilterCondition[]):FilterCondition; /** * a string suitable for debugging showing the details of this condition. * @return String. */ toString():string; get columns():Array; /** * a filter condition invoking a static function with the given parameters. Currently supported Deephaven static * functions: *
    *
  • inRange: Given three comparable values, returns true if the first is less than the second but greater * than the third
  • *
  • isInf:Returns true if the given number is infinity
  • *
  • isNaN:Returns true if the given number is not a number
  • *
  • isNormal:Returns true if the given number is not null, is not infinity, and is not * "not a number"
  • *
  • startsWith:Returns true if the first string starts with the second string
  • *
  • endsWithReturns true if the first string ends with the second string
  • *
  • matches:Returns true if the first string argument matches the second string used as a Java regular * expression
  • *
  • contains:Returns true if the first string argument contains the second string as a substring
  • *
  • in:Returns true if the first string argument can be found in the second array argument. *

    * Note that the array can only be specified as a column reference at this time - typically the `FilterValue.in` * method should be used in other cases *

    *
  • *
* @param function - * @param args - * @return dh.FilterCondition */ static invoke(func:string, ...args:FilterValue[]):FilterCondition; /** * a filter condition which will check if the given value can be found in any supported column on whatever table * this FilterCondition is passed to. This FilterCondition is somewhat unique in that it need not be given a column * instance, but will adapt to any table. On numeric columns, with a value passed in which can be parsed as a * number, the column will be filtered to numbers which equal, or can be "rounded" effectively to this number. On * String columns, the given value will match any column which contains this string in a case-insensitive search. An * optional second argument can be passed, an array of `FilterValue` from the columns to limit this search to (see * {@link dh.Column.filter}). * @param value - * @param columns - * @return dh.FilterCondition */ static search(value:FilterValue, columns?:FilterValue[]):FilterCondition; } export class IdeSession implements HasEventHandling { static readonly EVENT_COMMANDSTARTED:string; static readonly EVENT_REQUEST_FAILED:string; protected constructor(); /** * Load the named table, with columns and size information already fully populated. * @param name - the name of the table to fetch * @param applyPreviewColumns - false to disable previews, defaults to true * @return a {@link Promise} that will resolve to the table, or reject with an error if it cannot be loaded. * @deprecated Added to resolve a specific issue, in the future preview will be applied as part of the subscription. */ getTable(name:string, applyPreviewColumns?:boolean):Promise
; /** * Load the named Figure, including its tables and tablemaps as needed. * @param name - * @return promise of dh.plot.Figure */ getFigure(name:string):Promise; /** * Loads the named tree table or roll-up table, with column data populated. All nodes are collapsed by default, and * size is presently not available until the viewport is first set. * @param name - * @return {@link Promise} of {@link dh.TreeTable} */ getTreeTable(name:string):Promise; getHierarchicalTable(name:string):Promise; getPartitionedTable(name:string):Promise; getObject(definitionObject:dh.ide.VariableDescriptor):Promise; newTable(columnNames:string[], types:string[], data:string[][], userTimeZone:string):Promise
; /** * Merges the given tables into a single table. Assumes all tables have the same structure. * @param tables - * @return {@link Promise} of {@link dh.Table} */ mergeTables(tables:Table[]):Promise
; bindTableToVariable(table:Table, name:string):Promise; /** * Makes the `object` available to another user or another client on this same server which knows the value of * the `sharedTicketBytes`. Use that sharedTicketBytes value like a one-time use password - any other client * which knows this value can read the same object. *

* Shared objects will remain available using the sharedTicketBytes until the client that first shared them * releases/closes their copy of the object. Whatever side-channel is used to share the bytes, be sure to wait until * the remote end has signaled that it has successfully fetched the object before releasing it from this client. *

* Be sure to use an unpredictable value for the shared ticket bytes, like a UUID or other large, random value to * prevent access by unauthorized clients. * @param object - the object to share with another client/user * @param sharedTicketBytes - the value which another client/user must know to obtain the object. It may be a unicode * string (will be encoded as utf8 bytes), or a {@link Uint8Array} value. * @return A promise that will resolve to the value passed as sharedTicketBytes when the object is ready to be read * by another client, or will reject if an error occurs. */ shareObject(object:Table|Widget|WidgetExportedObject|PartitionedTable|TotalsTable|TreeTable, sharedTicketBytes:string|Uint8Array):Promise; /** * Reads an object shared by another client to this server with the `sharedTicketBytes`. Until the other * client releases this object (or their session ends), the object will be available on the server. *

* The type of the object must be passed so that the object can be read from the server correct - the other client * should provide this information. * @param sharedTicketBytes - the value provided by another client/user to obtain the object. It may be a unicode * string (will be encoded as utf8 bytes), or a {@link Uint8Array} value. * @param type - The type of the object, so it can be correctly read from the server * @return A promise that will resolve to the shared object, or will reject with an error if it cannot be read. */ getSharedObject(sharedTicketBytes:string|Uint8Array, type:string):Promise; subscribeToFieldUpdates(callback:(arg0:dh.ide.VariableChanges)=>void):()=>void; close():void; runCode(code:string):Promise; onLogMessage(callback:(arg0:dh.ide.LogItem)=>void):()=>void; openDocument(params:object):void; changeDocument(params:object):void; getCompletionItems(params:object):Promise>; getSignatureHelp(params:object):Promise>; getHover(params:object):Promise; closeDocument(params:object):void; /** * Creates an empty table with the specified number of rows. Optionally columns and types may be specified, but all * values will be null. * @param size - * @return {@link Promise} of {@link dh.Table} */ emptyTable(size:number):Promise

; /** * Creates a new table that ticks automatically every "periodNanos" nanoseconds. A start time may be provided; if so * the table will be populated with the interval from the specified date until now. * @param periodNanos - * @param startTime - * @return {@link Promise} of {@link dh.Table} */ timeTable(periodNanos:number, startTime?:DateWrapper):Promise
; addEventListener(name:string, callback:(e:dh.Event)=>void):()=>void; nextEvent(eventName:string, timeoutInMillis?:number):Promise>; hasListeners(name:string):boolean; removeEventListener(name:string, callback:(e:dh.Event)=>void):boolean; } /** * Describes a grouping and aggregations for a roll-up table. Pass to the Table.rollup function to create a * roll-up table. */ export class RollupConfig { /** * Ordered list of columns to group by to form the hierarchy of the resulting roll-up table. */ groupingColumns:Array; /** * Mapping from each aggregation name to the ordered list of columns it should be applied to in the resulting * roll-up table. */ aggregations:{ [key: string]: Array; }; /** * Optional parameter indicating if an extra leaf node should be added at the bottom of the hierarchy, showing the * rows in the underlying table which make up that grouping. Since these values might be a different type from the * rest of the column, any client code must check if TreeRow.hasChildren = false, and if so, interpret those values * as if they were Column.constituentType instead of Column.type. Defaults to false. */ includeConstituents:boolean; includeOriginalColumns?:boolean|null; /** * Optional parameter indicating if original column descriptions should be included. Defaults to true. */ includeDescriptions:boolean; constructor(); } /** * A set of string constants that can be used to describe the different objects the JS API can export. */ type VariableTypeType = string; export class VariableType { static readonly TABLE:VariableTypeType; static readonly TREETABLE:VariableTypeType; static readonly HIERARCHICALTABLE:VariableTypeType; static readonly TABLEMAP:VariableTypeType; static readonly PARTITIONEDTABLE:VariableTypeType; static readonly FIGURE:VariableTypeType; static readonly OTHERWIDGET:VariableTypeType; static readonly PANDAS:VariableTypeType; static readonly TREEMAP:VariableTypeType; } type ValueTypeType = string; export class ValueType { static readonly STRING:ValueTypeType; static readonly NUMBER:ValueTypeType; static readonly DOUBLE:ValueTypeType; static readonly LONG:ValueTypeType; static readonly DATETIME:ValueTypeType; static readonly BOOLEAN:ValueTypeType; } /** * This enum describes the name of each supported operation/aggregation type when creating a `TreeTable`. */ type AggregationOperationType = string; export class AggregationOperation { static readonly COUNT:AggregationOperationType; static readonly COUNT_DISTINCT:AggregationOperationType; static readonly DISTINCT:AggregationOperationType; static readonly MIN:AggregationOperationType; static readonly MAX:AggregationOperationType; static readonly SUM:AggregationOperationType; static readonly ABS_SUM:AggregationOperationType; static readonly VAR:AggregationOperationType; static readonly AVG:AggregationOperationType; static readonly MEDIAN:AggregationOperationType; static readonly STD:AggregationOperationType; static readonly FIRST:AggregationOperationType; static readonly LAST:AggregationOperationType; static readonly UNIQUE:AggregationOperationType; static readonly SKIP:AggregationOperationType; } type SearchDisplayModeType = string; export class SearchDisplayMode { static readonly SEARCH_DISPLAY_DEFAULT:SearchDisplayModeType; static readonly SEARCH_DISPLAY_HIDE:SearchDisplayModeType; static readonly SEARCH_DISPLAY_SHOW:SearchDisplayModeType; } /** * Describes the type of node in a rollup table. */ type RollupNodeTypeType = string; export class RollupNodeType { static readonly ROLLUP_NODE_TYPE_AGGREGATED:RollupNodeTypeType; static readonly ROLLUP_NODE_TYPE_CONSTITUENT:RollupNodeTypeType; } } export namespace dh.grpc { /** * Factory for creating gRPC transports. */ export interface GrpcTransportFactory { /** * Create a new transport instance. * @param options - options for creating the transport * @return a transport instance to use for gRPC communication */ create(options:GrpcTransportOptions):GrpcTransport; /** * Return true to signal that created transports may have {@link GrpcTransport.sendMessage} called on it * more than once before {@link GrpcTransport.finishSend} should be called. * @return true to signal that the implementation can stream multiple messages, false otherwise indicating that * Open/Next gRPC calls should be used */ get supportsClientStreaming():boolean; } /** * Options for creating a gRPC stream transport instance. */ export interface GrpcTransportOptions { /** * The gRPC method URL. */ url:URL; /** * True to enable debug logging for this stream. */ debug:boolean; /** * Callback for when headers and status are received. The headers are a map of header names to values, and the * status is the HTTP status code. If the connection could not be made, the status should be 0. */ onHeaders:(headers:{ [key: string]: string|Array; },status:number)=>void; /** * Callback for when a chunk of data is received. */ onChunk:(chunk:Uint8Array)=>void; /** * Callback for when the stream ends, with an error instance if it can be provided. Note that the present * implementation does not consume errors, even if provided. */ onEnd:(error?:Error|undefined|null)=>void; } /** * gRPC transport implementation. */ export interface GrpcTransport { /** * Starts the stream, sending metadata to the server. * @param metadata - the headers to send the server when opening the connection */ start(metadata:{ [key: string]: string|Array; }):void; /** * Sends a message to the server. * @param msgBytes - bytes to send to the server */ sendMessage(msgBytes:Uint8Array):void; /** * "Half close" the stream, signaling to the server that no more messages will be sent, but that the client is still * open to receiving messages. */ finishSend():void; /** * End the stream, both notifying the server that no more messages will be sent nor received, and preventing the * client from receiving any more events. */ cancel():void; } } export namespace dh.i18n { /** * Exported wrapper of the GWT NumberFormat, plus LongWrapper support * * Utility class to parse and format numbers, using the same format patterns as are supported by the standard Java * implementation used in the Deephaven server and swing client. Works for numeric types including BigInteger and * BigDecimal. */ export class NumberFormat { /** * Creates a new number format instance. This generally should be avoided in favor of the static `getFormat` * function, which will create and cache an instance so that later calls share the same instance. * @param pattern - */ constructor(pattern:string); /** * a number format instance matching the specified format. If this format has not been specified before, a new * instance will be created and cached for later reuse. Prefer this method to calling the constructor directly to * take advantage of caching * @param pattern - * @return dh.i18n.NumberFormat */ static getFormat(pattern:string):NumberFormat; /** * Parses the given text using the cached format matching the given pattern. * @param pattern - * @param text - * @return double */ static parse(pattern:string, text:string):number; /** * Formats the specified number (or Java long, BigInteger or BigDecimal value) using the cached * format matching the given pattern string. * @param pattern - * @param number - * @return String */ static format(pattern:string, number:number|dh.BigIntegerWrapper|dh.BigDecimalWrapper|dh.LongWrapper):string; /** * Parses the given text using this instance's pattern into a JS Number. * @param text - * @return double */ parse(text:string):number; /** * Formats the specified number (or Java `long`, `BigInteger` or `BigDecimal` value) using this instance's pattern. * @param number - * @return String */ format(number:number|dh.BigIntegerWrapper|dh.BigDecimalWrapper|dh.LongWrapper):string; toString():string; } /** * Represents the timezones supported by Deephaven. Can be used to format dates, taking into account the offset changing * throughout the year (potentially changing each year). These instances mostly are useful at this time to pass to the * DateTimeFormat.format() methods, though also support a few properties at this time to see details about each * instance. * * * The following timezone codes are supported when getting a timezone object - instances appearing in the same line will * return the same details: * *
    *
  • GMT/UTC
  • *
  • Asia/Tokyo
  • *
  • Asia/Seoul
  • *
  • Asia/Hong_Kong
  • *
  • Asia/Singapore
  • *
  • Asia/Calcutta/Asia/Kolkata
  • *
  • Europe/Berlin
  • *
  • Europe/London
  • *
  • America/Sao_Paulo
  • *
  • America/St_Johns
  • *
  • America/Halifax
  • *
  • America/New_York
  • *
  • America/Chicago
  • *
  • America/Denver
  • *
  • America/Los_Angeles
  • *
  • America/Anchorage
  • *
  • Pacific/Honolulu
  • *
* * A Timezone object can also be created from an abbreviation. The following abbreviations are supported: * *
    *
  • UTC
  • *
  • GMT
  • *
  • Z
  • *
  • NY
  • *
  • ET
  • *
  • EST
  • *
  • EDT
  • *
  • MN
  • *
  • CT
  • *
  • CST
  • *
  • CDT
  • *
  • MT
  • *
  • MST
  • *
  • MDT
  • *
  • PT
  • *
  • PST
  • *
  • PDT
  • *
  • HI
  • *
  • HST
  • *
  • HDT
  • *
  • BT
  • *
  • BRST
  • *
  • BRT
  • *
  • KR
  • *
  • KST
  • *
  • HK
  • *
  • HKT
  • *
  • JP
  • *
  • JST
  • *
  • AT
  • *
  • AST
  • *
  • ADT
  • *
  • NF
  • *
  • NST
  • *
  • NDT
  • *
  • AL
  • *
  • AKST
  • *
  • AKDT
  • *
  • IN
  • *
  • IST
  • *
  • CE
  • *
  • CET
  • *
  • CEST
  • *
  • SG
  • *
  • SGT
  • *
  • LON
  • *
  • BST
  • *
  • MOS
  • *
  • SHG
  • *
  • CH
  • *
  • NL
  • *
  • TW
  • *
  • SYD
  • *
  • AEST
  • *
  • AEDT
  • *
*/ export class TimeZone { protected constructor(); /** * Factory method which creates timezone instances from one of the supported keys. * @param tzCode - * @return dh.i18n.TimeZone */ static getTimeZone(tzCode:string):TimeZone; /** * the standard offset of this timezone, in minutes * @return int */ get standardOffset():number; /** * the timezone code that represents this `TimeZone`, usually the same key as was use to create this instance * @return String */ get id():string; } /** * Largely an exported wrapper for the GWT DateFormat, but also includes support for formatting nanoseconds as an * additional 6 decimal places after the rest of the number. * * Other concerns that this handles includes accepting a js Date and ignoring the lack of nanos, accepting a js Number * and assuming it to be a lossy nano value, and parsing into a js Date. * * * Utility class to parse and format various date/time values, using the same format patterns as are supported by the * standard Java implementation used in the Deephaven server and swing client. * * As Deephaven internally uses nanosecond precision to record dates, this API expects nanoseconds in most use cases, * with the one exception of the JS `Date` type, which is not capable of more precision than milliseconds. Note, * however, that when passing nanoseconds as a JS `Number` there is likely to be some loss of precision, though this is * still supported for easier interoperability with other JS code. The values returned by `parse()` will be an opaque * object wrapping the full precision of the specified date, However, this object supports `toString()` and `valueOf()` * to return a string representation of that value, as well as a `asNumber()` to return a JS `Number` value and a * `asDate()` to return a JS `Date` value. * * * Caveats: * * * - The `D` format (for "day of year") is not supported by this implementation at this time. - The `%t` format for * short timezone code is not supported by this implementation at this time, though `z` will work as expected in the * browser to emit the user's own timezone. */ export class DateTimeFormat { static readonly NANOS_PER_MILLI:number; /** * Creates a new date/time format instance. This generally should be avoided in favor of the static `getFormat` * function, which will create and cache an instance so that later calls share the same instance. * @param pattern - */ constructor(pattern:string); /** * * @param pattern - * @return a date format instance matching the specified format. If this format has not been specified before, a new * instance will be created and stored for later reuse. */ static getFormat(pattern:string):DateTimeFormat; /** * Accepts a variety of input objects to interpret as a date, and formats them using the specified pattern. A * `TimeZone` object can optionally be provided to format this date as the current date/time in that timezone.See * the instance method for more details on input objects. * @param pattern - * @param date - * @param timeZone - * @return */ static format(pattern:string, date:any, timeZone?:TimeZone):string; /** * Parses the given input string using the provided pattern, and returns a JS `Date` object in milliseconds. * @param pattern - * @param text - * @return */ static parseAsDate(pattern:string, text:string):Date; /** * Parses the given input string using the provided pattern, and returns a wrapped Java `long` value in nanoseconds. * A `TimeZone` object can optionally be provided to parse to a desired timezone. * @param pattern - * @param text - * @param tz - * @return */ static parse(pattern:string, text:string, tz?:TimeZone):dh.DateWrapper; /** * Takes a variety of objects to interpret as a date, and formats them using this instance's pattern. Inputs can * include a String value of a number expressed in nanoseconds, a Number value expressed in * nanoseconds, a JS Date object (necessarily in milliseconds), or a wrapped Java long value, * expressed in nanoseconds. A TimeZone object can optionally be provided to format this date as the current * date/time in that timezone. * @param date - * @param timeZone - * @return String */ format(date:any, timeZone?:TimeZone):string; /** * Parses the given string using this instance's pattern, and returns a wrapped Java long value in * nanoseconds. A TimeZone object can optionally be provided to parse to a desired timezone. * @param text - * @param tz - * @return */ parse(text:string, tz?:TimeZone):dh.DateWrapper; /** * Parses the given string using this instance's pattern, and returns a JS Date object in milliseconds. * @param text - * @return */ parseAsDate(text:string):Date; toString():string; } } export namespace dh.plot { export interface FigureDataUpdatedEvent { getArray(series:Series, sourceType:number, mappingFunc?:(arg0:any)=>any):Array; get series():Series[]; } export interface OneClick { setValueForColumn(columnName:string, value:any):void; getValueForColumn(columName:string):any; get requireAllFiltersToDisplay():boolean; get columns():dh.Column[]; } /** * Describes how to access and display data required within a series. */ export interface SeriesDataSource { /** * the type of data stored in the underlying table's Column. * @return String */ get columnType():string; /** * the axis that this source should be drawn on. * @return dh.plot.Axis */ get axis():Axis; /** * the feature of this series represented by this source. See the SourceType enum for more details. * @return int */ get type():SourceTypeType; } /** * Describes a template that will be used to make new series instances when a new table added to a plotBy. */ export interface MultiSeries { /** * The name for this multi-series. * @return String */ get name():string; /** * The plotting style to use for the series that will be created. See SeriesPlotStyle enum for more details. * @return int */ get plotStyle():SeriesPlotStyleType; } /** * Defines one axis used with by series. These instances will be found both on the Chart and the Series instances, and * may be shared between Series instances. */ export interface Axis { /** * The format pattern to use with this axis. Use the type to determine which type of formatter to use. * @return String */ readonly formatPattern?:string|null; readonly gapBetweenMajorTicks?:number|null; /** * Indicates that this axis is only `widthInPixels` wide, so any extra data can be downsampled out, if this can be * done losslessly. The second two arguments represent the current zoom range of this axis, and if provided, most of * the data outside of this range will be filtered out automatically and the visible width mapped to that range. * When the UI zooms, pans, or resizes, this method should be called again to update these three values to ensure * that data is correct and current. * @param pixelCount - * @param min - * @param max - */ range(pixelCount?:number|undefined|null, min?:unknown|undefined|null, max?:unknown|undefined|null):void; get tickLabelAngle():number; get labelFont():string; get color():string; get invert():boolean; get log():boolean; get maxRange():number; /** * The label for this axis. * @return String */ get label():string; get timeAxis():boolean; /** * The type for this axis, indicating how it will be drawn. See AxisType enum for more details. * @return int */ get type():AxisTypeType; get minorTicksVisible():boolean; get minorTickCount():number; get majorTickLocations():number[]; get majorTicksVisible():boolean; get ticksFont():string; /** * The unique id for this axis. * @return String */ get id():string; /** * The position for this axis. See AxisPosition enum for more details. * @return int */ get position():AxisPositionType; /** * The calendar with the business hours and holidays to transform plot data against. Defaults to null, or no * transform. * @return dh.calendar.BusinessCalendar */ get businessCalendar():dh.calendar.BusinessCalendar; /** * The type for this axis. See AxisFormatType enum for more details. * @return int */ get formatType():AxisFormatTypeType; get minRange():number; } /** * Provides access to the data for displaying in a figure. */ export interface Series { readonly isLinesVisible?:boolean|null; readonly pointLabelFormat?:string|null; readonly yToolTipPattern?:string|null; readonly shapeSize?:number|null; readonly xToolTipPattern?:string|null; readonly isShapesVisible?:boolean|null; subscribe(forceDisableDownsample?:DownsampleOptions):void; /** * Disable updates for this Series. */ unsubscribe():void; get shape():string; /** * Contains details on how to access data within the chart for this series. keyed with the way that this series uses * the axis. * @return {@link dh.plot.SeriesDataSource} */ get sources():SeriesDataSource[]; get lineColor():string; /** * The plotting style to use for this series. See SeriesPlotStyle enum for more details. * @return int */ get plotStyle():SeriesPlotStyleType; get oneClick():OneClick; get gradientVisible():boolean; get shapeColor():string; /** * The name for this series. * @return String */ get name():string; /** * indicates that this series belongs to a MultiSeries, null otherwise * @return dh.plot.MultiSeries */ get multiSeries():MultiSeries; get shapeLabel():string; } /** * Helper class for plot downsampling methods. */ export class Downsample { protected constructor(); /** * Downsamples a table so that the data can be used for a time-series line plot. The downsampled table should have * the same visual fidelity as the original table, but with fewer rows. * @param table - The table to downsample. * @param xCol - The name of the X column to downsample. Must be an Instant or long. * @param yCols - The names of the Y columns to downsample. * @param width - The width of the visible area in pixels. * @param xRange - The visible range as `[start, end]` or null to always use all data. * @return A promise that resolves to the downsampled table. */ static runChartDownsample(table:dh.Table, xCol:string, yCols:string[], width:number, xRange?:dh.LongWrapper[]|undefined|null):Promise; } export class SourceDescriptor { axis:AxisDescriptor; table:dh.Table; columnName:string; type:string; constructor(); } export class SeriesDescriptor { plotStyle:string; name?:string|null; linesVisible?:boolean|null; shapesVisible?:boolean|null; gradientVisible?:boolean|null; lineColor?:string|null; pointLabelFormat?:string|null; xToolTipPattern?:string|null; yToolTipPattern?:string|null; shapeLabel?:string|null; shapeSize?:number|null; shapeColor?:string|null; shape?:string|null; dataSources:Array; constructor(); } export class DownsampleOptions { /** * Max number of items in the series before DEFAULT will not attempt to load the series without downsampling. Above * this size if downsample fails or is not applicable, the series won't be loaded unless DISABLE is passed to * series.subscribe(). */ static MAX_SERIES_SIZE:number; /** * Max number of items in the series where the subscription will be allowed at all. Above this limit, even with * downsampling disabled, the series will not load data. */ static MAX_SUBSCRIPTION_SIZE:number; /** * Flag to let the API decide what data will be available, based on the nature of the data, the series, and how the * axes are configured. */ static readonly DEFAULT:DownsampleOptions; /** * Flat to entirely disable downsampling, and force all data to load, no matter how many items that would be, up to * the limit of MAX_SUBSCRIPTION_SIZE. */ static readonly DISABLE:DownsampleOptions; protected constructor(); } export class FigureFetchError { error:object; errors:Array; protected constructor(); } export class ChartDescriptor { colspan?:number|null; rowspan?:number|null; series:Array; axes:Array; chartType:string; title?:string|null; titleFont?:string|null; titleColor?:string|null; showLegend?:boolean|null; legendFont?:string|null; legendColor?:string|null; is3d?:boolean|null; constructor(); } export class AxisDescriptor { formatType:string; type:string; position:string; log?:boolean|null; label?:string|null; labelFont?:string|null; ticksFont?:string|null; formatPattern?:string|null; color?:string|null; minRange?:number|null; maxRange?:number|null; minorTicksVisible?:boolean|null; majorTicksVisible?:boolean|null; minorTickCount?:number|null; gapBetweenMajorTicks?:number|null; majorTickLocations?:Array|null; tickLabelAngle?:number|null; invert?:boolean|null; isTimeAxis?:boolean|null; constructor(); } /** * Provide the details for a chart. */ export class Chart implements dh.HasEventHandling { /** * a new series was added to this chart as part of a multi-series. The series instance is the detail for this event. */ static readonly EVENT_SERIES_ADDED:string; /** * The title of the chart. * @return String */ readonly title?:string|null; protected constructor(); addEventListener(name:string, callback:(e:dh.Event)=>void):()=>void; nextEvent(eventName:string, timeoutInMillis?:number):Promise>; hasListeners(name:string):boolean; removeEventListener(name:string, callback:(e:dh.Event)=>void):boolean; get column():number; get showLegend():boolean; /** * The axes used in this chart. * @return dh.plot.Axis */ get axes():Axis[]; get is3d():boolean; get titleFont():string; get colspan():number; get titleColor():string; get series():Series[]; get rowspan():number; /** * The type of this chart, see ChartType enum for more details. * @return int */ get chartType():ChartTypeType; get row():number; get legendColor():string; get legendFont():string; get multiSeries():MultiSeries[]; } /** * Helper class to manage snapshots and deltas and keep not only a contiguous JS array of data per column in the * underlying table, but also support a mapping function to let client code translate data in some way for display and * keep that cached as well. */ export class ChartData { constructor(table:dh.Table); update(tableData:dh.SubscriptionTableData):void; getColumn(columnName:string, mappingFunc:(arg0:any)=>any, currentUpdate:dh.TableData):Array; /** * Removes some column from the cache, avoiding extra computation on incoming events, and possibly freeing some * memory. If this pair of column name and map function are requested again, it will be recomputed from scratch. */ removeColumn(columnName:string, mappingFunc:(arg0:any)=>any):void; } export class Figure implements dh.HasEventHandling { /** * The title of the figure. * @return String */ readonly title?:string|null; /** * The data within this figure was updated. event.detail is FigureUpdateEventData */ static readonly EVENT_UPDATED:string; /** * The data within this figure was updated. event.detail is FigureUpdateEventData */ static readonly EVENT_SERIES_ADDED:string; /** * The data within this figure was updated. event.detail is FigureUpdateEventData */ static readonly EVENT_DISCONNECT:string; /** * The data within this figure was updated. event.detail is FigureUpdateEventData */ static readonly EVENT_RECONNECT:string; /** * The data within this figure was updated. event.detail is FigureUpdateEventData */ static readonly EVENT_RECONNECTFAILED:string; /** * The data within this figure was updated. event.detail is FigureUpdateEventData */ static readonly EVENT_DOWNSAMPLESTARTED:string; /** * The data within this figure was updated. event.detail is FigureUpdateEventData */ static readonly EVENT_DOWNSAMPLEFINISHED:string; /** * The data within this figure was updated. event.detail is FigureUpdateEventData */ static readonly EVENT_DOWNSAMPLEFAILED:string; /** * The data within this figure was updated. event.detail is FigureUpdateEventData */ static readonly EVENT_DOWNSAMPLENEEDED:string; static create(config:FigureDescriptor):Promise
; subscribe(forceDisableDownsample?:DownsampleOptions):void; /** * Disable updates for all series in this figure. */ unsubscribe():void; /** * Close the figure, and clean up subscriptions. */ close():void; /** * The charts to draw. * @return dh.plot.Chart */ get charts():Chart[]; get updateInterval():number; get titleColor():string; get titleFont():string; get rows():number; get cols():number; get errors():Array; /** * Listen for events on this object. * @param name - the name of the event to listen for * @param callback - a function to call when the event occurs * @return Returns a cleanup function. * @typeParam T - the type of the data that the event will provide */ addEventListener(name:string, callback:(e:dh.Event)=>void):()=>void; nextEvent(eventName:string, timeoutInMillis?:number):Promise>; hasListeners(name:string):boolean; /** * Removes an event listener added to this table. * @param name - * @param callback - * @return * @typeParam T - */ removeEventListener(name:string, callback:(e:dh.Event)=>void):boolean; } export class FigureSourceException { table:dh.Table; source:SeriesDataSource; protected constructor(); } export class SeriesDataSourceException { protected constructor(); get source():SeriesDataSource; get message():string; } /** * A descriptor used with JsFigureFactory.create to create a figure from JS. */ export class FigureDescriptor { title?:string|null; titleFont?:string|null; titleColor?:string|null; isResizable?:boolean|null; isDefaultTheme?:boolean|null; updateInterval?:number|null; cols?:number|null; rows?:number|null; charts:Array; constructor(); } /** * This enum describes the source it is in, and how this aspect of the data in the series should be used to render the * 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 * COLOR per item - the three SeriesDataSources all would share the same Axis instance, but would have different * SourceType enums set. The exact meaning of each source type will depend on the series that they are in. */ type SourceTypeType = number; export class SourceType { static readonly X:SourceTypeType; static readonly Y:SourceTypeType; static readonly Z:SourceTypeType; static readonly X_LOW:SourceTypeType; static readonly X_HIGH:SourceTypeType; static readonly Y_LOW:SourceTypeType; static readonly Y_HIGH:SourceTypeType; static readonly TIME:SourceTypeType; static readonly OPEN:SourceTypeType; static readonly HIGH:SourceTypeType; static readonly LOW:SourceTypeType; static readonly CLOSE:SourceTypeType; static readonly SHAPE:SourceTypeType; static readonly SIZE:SourceTypeType; static readonly LABEL:SourceTypeType; static readonly COLOR:SourceTypeType; static readonly PARENT:SourceTypeType; static readonly TEXT:SourceTypeType; static readonly HOVER_TEXT:SourceTypeType; } type AxisTypeType = number; export class AxisType { static readonly X:AxisTypeType; static readonly Y:AxisTypeType; static readonly SHAPE:AxisTypeType; static readonly SIZE:AxisTypeType; static readonly LABEL:AxisTypeType; static readonly COLOR:AxisTypeType; } type AxisPositionType = number; export class AxisPosition { static readonly TOP:AxisPositionType; static readonly BOTTOM:AxisPositionType; static readonly LEFT:AxisPositionType; static readonly RIGHT:AxisPositionType; static readonly NONE:AxisPositionType; } /** * This enum describes what kind of chart is being drawn. This may limit what kinds of series can be found on it, or how * those series should be rendered. */ type ChartTypeType = number; export class ChartType { static readonly XY:ChartTypeType; static readonly PIE:ChartTypeType; static readonly OHLC:ChartTypeType; static readonly CATEGORY:ChartTypeType; static readonly XYZ:ChartTypeType; static readonly CATEGORY_3D:ChartTypeType; static readonly TREEMAP:ChartTypeType; } type SeriesPlotStyleType = number; export class SeriesPlotStyle { static readonly BAR:SeriesPlotStyleType; static readonly STACKED_BAR:SeriesPlotStyleType; static readonly LINE:SeriesPlotStyleType; static readonly AREA:SeriesPlotStyleType; static readonly STACKED_AREA:SeriesPlotStyleType; static readonly PIE:SeriesPlotStyleType; static readonly HISTOGRAM:SeriesPlotStyleType; static readonly OHLC:SeriesPlotStyleType; static readonly SCATTER:SeriesPlotStyleType; static readonly STEP:SeriesPlotStyleType; static readonly ERROR_BAR:SeriesPlotStyleType; static readonly TREEMAP:SeriesPlotStyleType; } type AxisFormatTypeType = number; export class AxisFormatType { static readonly CATEGORY:AxisFormatTypeType; static readonly NUMBER:AxisFormatTypeType; } } export namespace dh.lsp { export class TextEdit { range:Range; text:string; constructor(); } export class SignatureInformation { label:string; documentation:MarkupContent; parameters:Array; activeParameter:number; constructor(); } export class MarkupContent { kind:string; value:string; constructor(); } export class Range { start:Position; end:Position; constructor(); isInside(innerStart:Position, innerEnd:Position):boolean; } export class CompletionItem { label:string; kind:number; detail:string; documentation:MarkupContent; deprecated:boolean; preselect:boolean; textEdit:TextEdit; sortText:string; filterText:string; insertTextFormat:number; additionalTextEdits:Array; commitCharacters:Array; constructor(); } export class TextDocumentContentChangeEvent { range:Range; rangeLength:number; text:string; constructor(); } export class ParameterInformation { label:string; documentation:MarkupContent; constructor(); } export class Hover { contents:MarkupContent; range:Range; constructor(); } export class Position { line:number; character:number; constructor(); lessThan(start:Position):boolean; lessOrEqual(start:Position):boolean; greaterThan(end:Position):boolean; greaterOrEqual(end:Position):boolean; copy():Position; } } export namespace dh.calendar { /** * Defines a calendar with business hours and holidays. */ export interface BusinessCalendar { /** * All holidays defined for this calendar. * @return dh.calendar.Holiday */ get holidays():Array; /** * The name of the calendar. * @return String */ get name():string; /** * The days of the week that are business days. * @return String array */ get businessDays():Array; /** * The time zone of this calendar. * @return dh.i18n.TimeZone */ get timeZone():dh.i18n.TimeZone; /** * The business periods that are open on a business day. * @return dh.calendar.BusinessPeriod */ get businessPeriods():Array; } export interface BusinessPeriod { get close():string; get open():string; } export interface Holiday { /** * The date of the Holiday. * @return {@link dh.LocalDateWrapper} */ get date():dh.LocalDateWrapper; /** * The business periods that are open on the holiday. * @return dh.calendar.BusinessPeriod */ get businessPeriods():Array; } type DayOfWeekType = string; export class DayOfWeek { static readonly SUNDAY:DayOfWeekType; static readonly MONDAY:DayOfWeekType; static readonly TUESDAY:DayOfWeekType; static readonly WEDNESDAY:DayOfWeekType; static readonly THURSDAY:DayOfWeekType; static readonly FRIDAY:DayOfWeekType; static readonly SATURDAY:DayOfWeekType; static values():string[]; } }