diff --git a/.eslintrc.json b/.eslintrc.json
index 008a0948..d3c9ddca 100644
--- a/.eslintrc.json
+++ b/.eslintrc.json
@@ -13,6 +13,7 @@
"eqeqeq": ["warn", "always", { "null": "ignore" }],
"no-console": "warn",
"no-throw-literal": "warn",
+ "no-unused-vars": ["error", { "argsIgnorePattern": "^_" }],
"semi": "off"
},
"overrides": [
diff --git a/package-lock.json b/package-lock.json
index d119f773..887af962 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -11,6 +11,7 @@
"ws": "^8.18.0"
},
"devDependencies": {
+ "@deephaven/jsapi-types": "^1.0.0-dev0.35.3",
"@types/node": "20.14.10",
"@types/vscode": "^1.91.0",
"@types/ws": "^8.5.10",
@@ -426,6 +427,12 @@
"node": ">=12"
}
},
+ "node_modules/@deephaven/jsapi-types": {
+ "version": "1.0.0-dev0.35.3",
+ "resolved": "https://registry.npmjs.org/@deephaven/jsapi-types/-/jsapi-types-1.0.0-dev0.35.3.tgz",
+ "integrity": "sha512-0NMh2eRXT16ro4sE/wH0q5+fAdQMitqgKgQ7SwUEtEXq6mp0JWA0xr/x4msdyP3kJB+e6pveTYcgMcHwqrGO/A==",
+ "dev": true
+ },
"node_modules/@esbuild/aix-ppc64": {
"version": "0.21.5",
"resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.21.5.tgz",
@@ -12986,6 +12993,12 @@
"@jridgewell/trace-mapping": "0.3.9"
}
},
+ "@deephaven/jsapi-types": {
+ "version": "1.0.0-dev0.35.3",
+ "resolved": "https://registry.npmjs.org/@deephaven/jsapi-types/-/jsapi-types-1.0.0-dev0.35.3.tgz",
+ "integrity": "sha512-0NMh2eRXT16ro4sE/wH0q5+fAdQMitqgKgQ7SwUEtEXq6mp0JWA0xr/x4msdyP3kJB+e6pveTYcgMcHwqrGO/A==",
+ "dev": true
+ },
"@esbuild/aix-ppc64": {
"version": "0.21.5",
"resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.21.5.tgz",
diff --git a/package.json b/package.json
index e99d52a7..20722b71 100644
--- a/package.json
+++ b/package.json
@@ -147,6 +147,7 @@
}
},
"devDependencies": {
+ "@deephaven/jsapi-types": "^1.0.0-dev0.35.3",
"@types/node": "20.14.10",
"@types/vscode": "^1.91.0",
"@types/ws": "^8.5.10",
diff --git a/src/common/constants.ts b/src/common/constants.ts
index 98a29f2a..00f1819f 100644
--- a/src/common/constants.ts
+++ b/src/common/constants.ts
@@ -1,3 +1,5 @@
+import * as path from 'node:path';
+
export const CONFIG_KEY = 'vscode-deephaven';
export const CONFIG_CORE_SERVERS = 'core-servers';
@@ -17,3 +19,5 @@ export const DOWNLOAD_LOGS_TEXT = 'Download Logs';
export const SERVER_LANGUAGE_SET = new Set(['python', 'groovy']) as ReadonlySet<
'python' | 'groovy'
>;
+
+export const TMP_DIR_ROOT = path.join(__dirname, '..', 'tmp');
diff --git a/src/dh/dhc-types.d.ts b/src/dh/dhc-types.d.ts
deleted file mode 100644
index 2d7b6e85..00000000
--- a/src/dh/dhc-types.d.ts
+++ /dev/null
@@ -1,3746 +0,0 @@
-// @ts-nocheck
-// Minimum TypeScript Version: 4.3
-// Generated using com.vertispan.tsdefs.doclet.TsDoclet
-
-/**
- * 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 interface IIterableResult {
- value: T;
- done: boolean;
-}
-export namespace dh.storage {
- /**
- * Storage service metadata about files and folders.
- */
- export class ItemDetails {
- protected constructor();
-
- get filename(): string;
- get basename(): string;
- get size(): number;
- get etag(): string;
- get type(): ItemTypeType;
- get dirname(): string;
- }
-
- /**
- * 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;
- }
-
- /**
- * 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;
- }
-
- type ItemTypeType = string;
- export class ItemType {
- static readonly DIRECTORY: ItemTypeType;
- static readonly FILE: ItemTypeType;
- }
-}
-
-export namespace dh {
- /**
- * Common interface for various ways of accessing table data and formatting.
- *
- * Java note: this interface contains some extra overloads that aren't available in JS. Implementations are expected to
- * implement only abstract methods, and default methods present in this interface will dispatch accordingly.
- */
- export interface TableData {
- get(index: LongWrapper | number): Row;
- getData(index: LongWrapper | number, column: Column): any;
- getFormat(index: LongWrapper | number, column: Column): Format;
- get columns(): Array;
- get rows(): Array;
- }
- /**
- * Javascript wrapper for {@link io.deephaven.web.shared.data.ColumnStatistics} This class holds the results of a call to generate statistics on a
- * 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;
- }
- /**
- * 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;
- }
- /**
- * 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 ViewportRow {
- /**
- * 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;
- }
- 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 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;
- }
- /**
- * 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;
- }
- /**
- * Encapsulates event handling around table subscriptions by "cheating" and wrapping up a JsTable instance to do the
- * real dirty work. This allows a viewport to stay open on the old table if desired, while this one remains open.
- *
- * As this just wraps a JsTable (and thus a CTS), it holds its own flattened, pUT'd handle to get deltas from the
- * server. The setViewport method can be used to adjust this table instead of creating a new one.
- *
- * Existing methods on JsTable like setViewport and getViewportData are intended to proxy to this, which then will talk
- * to the underlying handle and accumulated data.
- *
- * As long as we keep the existing methods/events on JsTable, close() is not required if no other method is called, with
- * the idea then that the caller did not actually use this type. This means that for every exported method (which then
- * will mark the instance of "actually being used, please don't automatically close me"), there must be an internal
- * version called by those existing JsTable method, which will allow this instance to be cleaned up once the JsTable
- * deems it no longer in use.
- *
- * Note that if the caller does close an instance, this shuts down the JsTable's use of this (while the converse is not
- * true), providing a way to stop the server from streaming updates to the client.
- *
- * 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 interface TableViewportSubscription extends HasEventHandling {
- /**
- * 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 -
- */
- setViewport(
- firstRow: number,
- lastRow: number,
- columns?: Column[] | undefined | null,
- updateIntervalMs?: number | undefined | null
- ): 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;
- snapshot(rows: RangeSet, columns: Column[]): Promise;
- }
- /**
- * 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 -
- */
- setViewport(
- firstRow: number,
- lastRow: number,
- columns?: Array,
- updateIntervalMs?: number
- ): 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}
- */
- getViewportData(): 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: CustomEvent) => void
- ): () => void;
- removeEventListener(
- name: string,
- callback: (e: CustomEvent) => 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 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: CustomEvent) => 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: CustomEvent) => void
- ): boolean;
- }
- /**
- * 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 dh.RangeSet
- */
- get removed(): RangeSet;
- /**
- * The ordered set of row indexes added since the last update
- * @return dh.RangeSet
- */
- get added(): RangeSet;
- get columns(): Array;
- /**
- * The ordered set of row indexes updated since the last update
- * @return dh.RangeSet
- */
- get modified(): RangeSet;
- 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 index(): LongWrapper;
- }
- /**
- * 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[];
- }
- /**
- * 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;
- }
- export interface WorkerHeapInfo {
- /**
- * Total heap size available for this worker.
- */
- get totalHeapSize(): number;
- get freeMemory(): number;
- get maximumHeapSize(): number;
- }
- /**
- * Contains data in the current viewport. Also contains the offset to this data, so that the actual row number may be
- * determined. 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 {
- /**
- * The index of the first returned row
- * @return double
- */
- get offset(): number;
- /**
- * A list of columns describing the data types in each row
- * @return {@link dh.Column} array.
- */
- get columns(): Array;
- /**
- * An array of rows of data
- * @return {@link dh.ViewportRow} array.
- */
- get rows(): Array;
- }
- export interface RefreshToken {
- get bytes(): string;
- get expiry(): number;
- }
- export interface JoinableTable {
- freeze(): Promise
;
- }
- export interface ColumnGroup {
- get name(): string | null;
- get children(): string[] | null;
- get color(): string | null;
- }
- export interface TreeViewportData extends TableData {
- get offset(): number;
- get columns(): Array;
- get rows(): Array;
- }
-
- 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 -
- * @param applyPreviewColumns - optional boolean
- * @return {@link Promise} of {@link dh.Table}
- */
- 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;
- 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;
- 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: CustomEvent) => void
- ): () => void;
- nextEvent(
- eventName: string,
- timeoutInMillis?: number
- ): Promise>;
- hasListeners(name: string): boolean;
- removeEventListener(
- name: string,
- callback: (e: CustomEvent) => void
- ): boolean;
- }
-
- /**
- * 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;
- }
-
- /**
- * 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;
- }
-
- /**
- * 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<
- | Table
- | Widget
- | WidgetExportedObject
- | PartitionedTable
- | TotalsTable
- | TreeTable
- >
- ): void;
- addEventListener(
- name: string,
- callback: (e: CustomEvent) => void
- ): () => void;
- nextEvent(
- eventName: string,
- timeoutInMillis?: number
- ): Promise>;
- hasListeners(name: string): boolean;
- removeEventListener(
- name: string,
- callback: (e: CustomEvent) => 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;
- static readonly EVENT_SIZECHANGED: string;
- static readonly EVENT_UPDATED: string;
- static readonly EVENT_ROWADDED: string;
- static readonly EVENT_ROWREMOVED: string;
- static readonly EVENT_ROWUPDATED: string;
- static readonly EVENT_SORTCHANGED: string;
- static readonly EVENT_FILTERCHANGED: string;
- static readonly EVENT_CUSTOMCOLUMNSCHANGED: string;
- static readonly EVENT_DISCONNECT: string;
- static readonly EVENT_RECONNECT: string;
- static readonly EVENT_RECONNECTFAILED: string;
- static readonly EVENT_REQUEST_FAILED: string;
- static readonly EVENT_REQUEST_SUCCEEDED: string;
- 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}
- */
- setViewport(
- firstRow: number,
- lastRow: number,
- columns?: Array | undefined | null,
- updateIntervalMs?: number | 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}
- */
- 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}
- */
- subscribe(
- columns: Array,
- updateIntervalMs?: number
- ): TableSubscription;
- /**
- * 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
;
- /**
- *
- * @deprecated a promise that will be resolved with a newly created table holding the results of the join operation.
- * The last parameter is optional, and if not specified or empty, all columns from the right table will
- * be added to the output. Callers are responsible for ensuring that there are no duplicates - a match
- * pair can be passed instead of a name to specify the new name for the column. Supported `joinType`
- * values (consult Deephaven's "Joining Data from Multiple Tables for more detail): "Join" Joining_Data_from_Multiple_Tables
- * "Natural" "AJ" "ReverseAJ" "ExactJoin" "LeftJoin"
- * @param joinType -
- * @param rightTable -
- * @param columnsToMatch -
- * @param columnsToAdd -
- * @param asOfMatchRule -
- * @return Promise of dh.Table
- */
- join(
- joinType: object,
- rightTable: JoinableTable,
- columnsToMatch: Array,
- columnsToAdd?: Array | undefined | null,
- asOfMatchRule?: unknown | undefined | null
- ): Promise
;
- /**
- * a promise that will be resolved with the newly created table holding the results of the specified as-of 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 asOfMatchRule is optional, defaults to LESS_THAN_EQUAL
- *
- *
;
- /**
- * 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 -
- * @param columnsToMatch -
- * @param columnsToAdd -
- * @param reserve_bits -
- * @return Promise of dh.Table
- */
- crossJoin(
- rightTable: JoinableTable,
- columnsToMatch: Array,
- columnsToAdd?: Array,
- reserve_bits?: number
- ): 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 -
- * @param columnsToMatch -
- * @param columnsToAdd -
- * @return Promise of dh.Table
- */
- exactJoin(
- rightTable: JoinableTable,
- columnsToMatch: Array,
- columnsToAdd?: Array
- ): 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 -
- * @param columnsToMatch -
- * @param columnsToAdd -
- * @return Promise of dh.Table
- */
- 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 size, changes to this value will
- * not result in any event. Sort[] sort 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 double
- */
- get totalSize(): number;
- /**
- * 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 (e.g., the table is uncoalesced; see the isUncoalesced
- * property). for details).
- * @return double
- */
- get size(): number;
- /**
- * True if this table has been closed.
- * @return boolean
- */
- get isClosed(): boolean;
- /**
- * Read-only. True if this table is uncoalesced. Set a viewport or filter on the partition columns to coalesce the
- * table. Check the isPartitionColumn property on the table columns to retrieve the partition columns. Size
- * will be unavailable until table is coalesced.
- * @return boolean
- */
- 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: CustomEvent) => 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: CustomEvent) => 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;
- }
-
- export class Ide {
- constructor();
-
- /**
- * @deprecated
- */
- getExistingSession(
- websocketUrl: string,
- authToken: string,
- serviceId: string,
- language: string
- ): Promise;
- /**
- * @deprecated
- */
- static getExistingSession(
- websocketUrl: string,
- authToken: string,
- serviceId: string,
- language: string
- ): Promise;
- }
-
- /**
- * 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();
- }
-
- export class LongWrapper {
- protected constructor();
-
- static ofString(str: string): LongWrapper;
- asNumber(): number;
- valueOf(): string;
- toString(): string;
- }
-
- /**
- * 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();
- }
-
- /**
- * 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;
- }
-
- /**
- * 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;
- }
-
- /**
- * 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 {
- /**
- * Indicates that some new data is available on the client, either an initial snapshot or a delta update. The
- * detail field of the event will contain a TableSubscriptionEventData detailing what has changed, or
- * allowing access to the entire range of items currently in the subscribed columns.
- */
- static readonly EVENT_UPDATED: string;
-
- protected constructor();
-
- /**
- * Stops the subscription on the server.
- */
- close(): void;
- addEventListener(
- name: string,
- callback: (e: CustomEvent) => void
- ): () => void;
- nextEvent(
- eventName: string,
- timeoutInMillis?: number
- ): Promise>;
- hasListeners(name: string): boolean;
- removeEventListener(
- name: string,
- callback: (e: CustomEvent) => void
- ): boolean;
- /**
- * The columns that were subscribed to when this subscription was created
- * @return {@link dh.Column}
- */
- get columns(): Array;
- }
-
- /**
- * Event fired when a command is issued from the client.
- */
- export class CommandInfo {
- constructor(code: string, result: Promise);
-
- get result(): Promise;
- get code(): string;
- }
-
- /**
- * 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 DateWrapper extends LongWrapper {
- protected constructor();
-
- static ofJsDate(date: Date): DateWrapper;
- asDate(): Date;
- }
-
- 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();
- }
-
- export class LoginCredentials {
- type?: string | null;
- username?: string | null;
- token?: string | null;
-
- 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_REFRESH_TOKEN_UPDATED: string;
- static readonly EVENT_REQUEST_FAILED: string;
- static readonly EVENT_REQUEST_STARTED: string;
- static readonly EVENT_REQUEST_SUCCEEDED: 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: CustomEvent) => void
- ): () => void;
- nextEvent(
- eventName: string,
- timeoutInMillis?: number
- ): Promise>;
- hasListeners(name: string): boolean;
- removeEventListener(
- name: string,
- callback: (e: CustomEvent) => void
- ): boolean;
- }
-
- /**
- * 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;
- }
-
- /**
- * 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 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();
- }
-
- /**
- * Presently optional and not used by the server, this allows the client to specify some authentication details. String
- * authToken - base 64 encoded auth token. String serviceId - The service ID to use for the connection.
- */
- export class ConnectOptions {
- headers: { [key: string]: string };
-
- constructor();
- }
-
- 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;
- /**
- * The expression to evaluate this custom column.
- * @return String
- */
- get expression(): string;
- /**
- * The name of the column to use.
- * @return String
- */
- get name(): string;
- /**
- * Type of custom column. One of
- *
- *
- *
FORMAT_COLOR
- *
FORMAT_NUMBER
- *
FORMAT_DATE
- *
NEW
- *
- * @return String
- */
- get type(): string;
- }
-
- /**
- * 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;
-
- /**
- * creates a new instance, from which console sessions can be made. options are optional.
- * @param serverUrl - The url used when connecting to the server. Read-only.
- * @param connectOptions - Optional Object
- * @param fromJava - Optional boolean
- * @deprecated
- */
- constructor(
- serverUrl: string,
- connectOptions?: ConnectOptions,
- fromJava?: boolean
- );
-
- /**
- * closes the current connection, releasing any resources on the server or client.
- */
- close(): void;
- running(): Promise;
- getObject(definitionObject: dh.ide.VariableDescriptor): Promise;
- subscribeToFieldUpdates(
- callback: (arg0: dh.ide.VariableChanges) => void
- ): () => void;
- /**
- * 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: CustomEvent) => 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: CustomEvent) => 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 Column objects
- * @return {@link dh.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;
- }
-
- /**
- * 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;
- }
-
- /**
- * 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): CustomColumn;
- /**
- * a CustomColumn object to apply using applyCustomColumns with the expression specified.
- * @param expression -
- * @return {@link dh.CustomColumn}
- */
- formatNumber(expression: string): CustomColumn;
- /**
- * a CustomColumn object to apply using applyCustomColumns with the expression specified.
- * @param expression -
- * @return {@link dh.CustomColumn}
- */
- formatDate(expression: string): 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
- * isUncoalesced property on Table)
- * @return boolean
- */
- 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 -
- * @return {@link dh.CustomColumn}
- */
- static formatRowColor(expression: string): CustomColumn;
- /**
- * a CustomColumn object to apply using applyCustomColumns with the expression specified.
- * @param name -
- * @param expression -
- * @return {@link dh.CustomColumn}
- */
- static createCustomColumn(name: string, expression: string): CustomColumn;
- }
-
- /**
- * 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 not directly supported. 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 TreeRow.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;
-
- 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 -
- * @param isExpanded -
- * @param expandDescendants -
- */
- setExpanded(
- row: TreeRow | number,
- isExpanded: boolean,
- expandDescendants?: boolean
- ): void;
- expandAll(): void;
- collapseAll(): void;
- /**
- * true if the given row is expanded, false otherwise. Equivalent to `TreeRow.isExpanded`, if an instance of the row
- * is available
- * @param row -
- * @return boolean
- */
- 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;
- typedTicket(): dhinternal.io.deephaven.proto.ticket_pb.TypedTicket;
- /**
- * 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;
- /**
- * 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;
- /**
- * 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;
- /**
- * 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: CustomEvent) => 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: CustomEvent) => void
- ): boolean;
- }
-
- /**
- * 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();
-
- typedTicket(): dhinternal.io.deephaven.proto.ticket_pb.TypedTicket;
- /**
- * Fetch the table with the given key.
- * @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
- */
- 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