@perspective-dev/viewer 4.1.1 → 4.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cdn/perspective-viewer.js +2 -2
- package/dist/cdn/perspective-viewer.js.map +4 -4
- package/dist/css/botanical.css +1 -0
- package/dist/css/dracula.css +1 -1
- package/dist/css/gruvbox-dark.css +1 -1
- package/dist/css/gruvbox.css +1 -1
- package/dist/css/solarized.css +1 -1
- package/dist/css/themes.css +1 -1
- package/dist/css/vaporwave.css +1 -1
- package/dist/esm/extensions.d.ts +32 -1
- package/dist/esm/perspective-viewer.d.ts +1 -0
- package/dist/esm/perspective-viewer.inline.js +2 -2
- package/dist/esm/perspective-viewer.inline.js.map +4 -4
- package/dist/esm/perspective-viewer.js +2 -2
- package/dist/esm/perspective-viewer.js.map +4 -4
- package/dist/esm/ts-rs/GroupRollupMode.d.ts +1 -0
- package/dist/esm/ts-rs/ViewerConfigUpdate.d.ts +2 -0
- package/dist/wasm/perspective-viewer.d.ts +1403 -1319
- package/dist/wasm/perspective-viewer.js +3531 -3268
- package/dist/wasm/perspective-viewer.wasm +0 -0
- package/dist/wasm/perspective-viewer.wasm.d.ts +111 -99
- package/package.json +4 -3
- package/src/less/column-selector.less +2 -2
- package/src/less/config-selector.less +66 -4
- package/src/rust/components/column_dropdown.rs +8 -8
- package/src/rust/components/column_selector/config_selector.rs +102 -29
- package/src/rust/components/column_selector/filter_column.rs +12 -12
- package/src/rust/components/column_selector/pivot_column.rs +12 -7
- package/src/rust/components/column_selector.rs +27 -17
- package/src/rust/components/column_settings_sidebar/style_tab/symbol/row_selector.rs +5 -5
- package/src/rust/components/column_settings_sidebar.rs +2 -4
- package/src/rust/components/containers/dragdrop_list.rs +32 -10
- package/src/rust/components/containers/scroll_panel.rs +8 -1
- package/src/rust/components/containers/select.rs +9 -9
- package/src/rust/components/containers/split_panel.rs +2 -2
- package/src/rust/components/filter_dropdown.rs +8 -8
- package/src/rust/components/function_dropdown.rs +8 -8
- package/src/rust/components/modal.rs +4 -4
- package/src/rust/components/plugin_selector.rs +15 -5
- package/src/rust/components/status_indicator.rs +3 -0
- package/src/rust/custom_elements/filter_dropdown.rs +4 -4
- package/src/rust/custom_elements/viewer.rs +2 -7
- package/src/rust/js/plugin.rs +19 -0
- package/src/rust/model/copy_export.rs +2 -1
- package/src/rust/model/intersection_observer.rs +3 -1
- package/src/rust/presentation/sheets.rs +4 -1
- package/src/rust/presentation.rs +4 -4
- package/src/rust/renderer/registry.rs +8 -1
- package/src/rust/session/column_defaults_update.rs +18 -0
- package/src/rust/session/replace_expression_update.rs +1 -0
- package/src/themes/botanical.less +142 -0
- package/src/themes/themes.less +2 -1
- package/src/ts/extensions.ts +73 -2
- package/src/ts/perspective-viewer.ts +1 -0
- package/src/ts/ts-rs/GroupRollupMode.ts +3 -0
- package/src/ts/ts-rs/ViewerConfigUpdate.ts +2 -1
- package/tsconfig.json +1 -0
- /package/dist/wasm/snippets/{perspective-viewer-11a3c51b6310ee99 → perspective-viewer-d729f682ba5c19df}/inline0.js +0 -0
- /package/dist/wasm/snippets/{perspective-viewer-11a3c51b6310ee99/inline2.js → perspective-viewer-d729f682ba5c19df/inline1.js} +0 -0
- /package/dist/wasm/snippets/{perspective-viewer-11a3c51b6310ee99/inline1.js → perspective-viewer-d729f682ba5c19df/inline2.js} +0 -0
- /package/dist/wasm/snippets/{perspective-viewer-11a3c51b6310ee99 → perspective-viewer-d729f682ba5c19df}/inline3.js +0 -0
- /package/dist/wasm/snippets/{perspective-viewer-11a3c51b6310ee99 → perspective-viewer-d729f682ba5c19df}/inline4.js +0 -0
|
@@ -1,24 +1,11 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
|
-
/**
|
|
4
|
-
* Register a plugin globally.
|
|
5
|
-
*/
|
|
6
|
-
export function registerPlugin(name: string): void;
|
|
7
|
-
/**
|
|
8
|
-
* Register this crate's Custom Elements in the browser's current session.
|
|
9
|
-
*
|
|
10
|
-
* This must occur before calling any public API methods on these Custom
|
|
11
|
-
* Elements from JavaScript, as the methods themselves won't be defined yet.
|
|
12
|
-
* By default, this crate does not register `PerspectiveViewerElement` (as to
|
|
13
|
-
* preserve backwards-compatible synchronous API).
|
|
14
|
-
*/
|
|
15
|
-
export function init(): void;
|
|
16
3
|
|
|
17
4
|
import type {
|
|
18
5
|
ColumnType,
|
|
19
|
-
TableInitOptions,
|
|
6
|
+
TableInitOptions,
|
|
20
7
|
ColumnWindow,
|
|
21
|
-
ViewWindow,
|
|
8
|
+
ViewWindow,
|
|
22
9
|
OnUpdateOptions,
|
|
23
10
|
UpdateOptions,
|
|
24
11
|
DeleteOptions,
|
|
@@ -27,6 +14,7 @@ import type {
|
|
|
27
14
|
} from "@perspective-dev/client";
|
|
28
15
|
|
|
29
16
|
|
|
17
|
+
|
|
30
18
|
/**
|
|
31
19
|
* An instance of a [`Client`] is a connection to a single
|
|
32
20
|
* `perspective_server::Server`, whether locally in-memory or remote over some
|
|
@@ -66,213 +54,258 @@ import type {
|
|
|
66
54
|
* ```
|
|
67
55
|
*/
|
|
68
56
|
export class Client {
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
57
|
+
free(): void;
|
|
58
|
+
[Symbol.dispose](): void;
|
|
59
|
+
__getClassname(): string;
|
|
60
|
+
/**
|
|
61
|
+
* Retrieves the names of all tables that this client has access to.
|
|
62
|
+
*
|
|
63
|
+
* `name` is a string identifier unique to the [`Table`] (per [`Client`]),
|
|
64
|
+
* which can be used in conjunction with [`Client::open_table`] to get
|
|
65
|
+
* a [`Table`] instance without the use of [`Client::table`]
|
|
66
|
+
* constructor directly (e.g., one created by another [`Client`]).
|
|
67
|
+
*
|
|
68
|
+
* # JavaScript Examples
|
|
69
|
+
*
|
|
70
|
+
* ```javascript
|
|
71
|
+
* const tables = await client.get_hosted_table_names();
|
|
72
|
+
* ```
|
|
73
|
+
*/
|
|
74
|
+
get_hosted_table_names(): Promise<string[]>;
|
|
75
|
+
handle_error(error: string, reconnect?: Function | null): Promise<void>;
|
|
76
|
+
handle_response(value: any): Promise<void>;
|
|
77
|
+
constructor(send_request: Function, close?: Function | null);
|
|
78
|
+
new_proxy_session(on_response: Function): ProxySession;
|
|
79
|
+
on_error(callback: Function): Promise<number>;
|
|
80
|
+
/**
|
|
81
|
+
* Register a callback which is invoked whenever [`Client::table`] (on this
|
|
82
|
+
* [`Client`]) or [`Table::delete`] (on a [`Table`] belinging to this
|
|
83
|
+
* [`Client`]) are called.
|
|
84
|
+
*/
|
|
85
|
+
on_hosted_tables_update(on_update_js: Function): Promise<number>;
|
|
86
|
+
/**
|
|
87
|
+
* Opens a [`Table`] that is hosted on the `perspective_server::Server`
|
|
88
|
+
* that is connected to this [`Client`].
|
|
89
|
+
*
|
|
90
|
+
* The `name` property of [`TableInitOptions`] is used to identify each
|
|
91
|
+
* [`Table`]. [`Table`] `name`s can be looked up for each [`Client`]
|
|
92
|
+
* via [`Client::get_hosted_table_names`].
|
|
93
|
+
*
|
|
94
|
+
* # JavaScript Examples
|
|
95
|
+
*
|
|
96
|
+
* Get a virtual [`Table`] named "table_one" from this [`Client`]
|
|
97
|
+
*
|
|
98
|
+
* ```javascript
|
|
99
|
+
* const tables = await client.open_table("table_one");
|
|
100
|
+
* ```
|
|
101
|
+
*/
|
|
102
|
+
open_table(entity_id: string): Promise<Table>;
|
|
103
|
+
/**
|
|
104
|
+
* Remove a callback previously registered via
|
|
105
|
+
* `Client::on_hosted_tables_update`.
|
|
106
|
+
*/
|
|
107
|
+
remove_hosted_tables_update(update_id: number): Promise<void>;
|
|
108
|
+
/**
|
|
109
|
+
* Provides the [`SystemInfo`] struct, implementation-specific metadata
|
|
110
|
+
* about the [`perspective_server::Server`] runtime such as Memory and
|
|
111
|
+
* CPU usage.
|
|
112
|
+
*
|
|
113
|
+
* For WebAssembly servers, this method includes the WebAssembly heap size.
|
|
114
|
+
*
|
|
115
|
+
* # JavaScript Examples
|
|
116
|
+
*
|
|
117
|
+
* ```javascript
|
|
118
|
+
* const info = await client.system_info();
|
|
119
|
+
* ```
|
|
120
|
+
*/
|
|
121
|
+
system_info(): Promise<SystemInfo>;
|
|
122
|
+
/**
|
|
123
|
+
* Creates a new [`Table`] from either a _schema_ or _data_.
|
|
124
|
+
*
|
|
125
|
+
* The [`Client::table`] factory function can be initialized with either a
|
|
126
|
+
* _schema_ (see [`Table::schema`]), or data in one of these formats:
|
|
127
|
+
*
|
|
128
|
+
* - Apache Arrow
|
|
129
|
+
* - CSV
|
|
130
|
+
* - JSON row-oriented
|
|
131
|
+
* - JSON column-oriented
|
|
132
|
+
* - NDJSON
|
|
133
|
+
*
|
|
134
|
+
* When instantiated with _data_, the schema is inferred from this data.
|
|
135
|
+
* While this is convenient, inferrence is sometimes imperfect e.g.
|
|
136
|
+
* when the input is empty, null or ambiguous. For these cases,
|
|
137
|
+
* [`Client::table`] can first be instantiated with a explicit schema.
|
|
138
|
+
*
|
|
139
|
+
* When instantiated with a _schema_, the resulting [`Table`] is empty but
|
|
140
|
+
* with known column names and column types. When subsqeuently
|
|
141
|
+
* populated with [`Table::update`], these columns will be _coerced_ to
|
|
142
|
+
* the schema's type. This behavior can be useful when
|
|
143
|
+
* [`Client::table`]'s column type inferences doesn't work.
|
|
144
|
+
*
|
|
145
|
+
* The resulting [`Table`] is _virtual_, and invoking its methods
|
|
146
|
+
* dispatches events to the `perspective_server::Server` this
|
|
147
|
+
* [`Client`] connects to, where the data is stored and all calculation
|
|
148
|
+
* occurs.
|
|
149
|
+
*
|
|
150
|
+
* # Arguments
|
|
151
|
+
*
|
|
152
|
+
* - `arg` - Either _schema_ or initialization _data_.
|
|
153
|
+
* - `options` - Optional configuration which provides one of:
|
|
154
|
+
* - `limit` - The max number of rows the resulting [`Table`] can
|
|
155
|
+
* store.
|
|
156
|
+
* - `index` - The column name to use as an _index_ column. If this
|
|
157
|
+
* `Table` is being instantiated by _data_, this column name must be
|
|
158
|
+
* present in the data.
|
|
159
|
+
* - `name` - The name of the table. This will be generated if it is
|
|
160
|
+
* not provided.
|
|
161
|
+
* - `format` - The explicit format of the input data, can be one of
|
|
162
|
+
* `"json"`, `"columns"`, `"csv"` or `"arrow"`. This overrides
|
|
163
|
+
* language-specific type dispatch behavior, which allows stringified
|
|
164
|
+
* and byte array alternative inputs.
|
|
165
|
+
*
|
|
166
|
+
* # JavaScript Examples
|
|
167
|
+
*
|
|
168
|
+
* Load a CSV from a `string`:
|
|
169
|
+
*
|
|
170
|
+
* ```javascript
|
|
171
|
+
* const table = await client.table("x,y\n1,2\n3,4");
|
|
172
|
+
* ```
|
|
173
|
+
*
|
|
174
|
+
* Load an Arrow from an `ArrayBuffer`:
|
|
175
|
+
*
|
|
176
|
+
* ```javascript
|
|
177
|
+
* import * as fs from "node:fs/promises";
|
|
178
|
+
* const table2 = await client.table(await fs.readFile("superstore.arrow"));
|
|
179
|
+
* ```
|
|
180
|
+
*
|
|
181
|
+
* Load a CSV from a `UInt8Array` (the default for this type is Arrow)
|
|
182
|
+
* using a format override:
|
|
183
|
+
*
|
|
184
|
+
* ```javascript
|
|
185
|
+
* const enc = new TextEncoder();
|
|
186
|
+
* const table = await client.table(enc.encode("x,y\n1,2\n3,4"), {
|
|
187
|
+
* format: "csv",
|
|
188
|
+
* });
|
|
189
|
+
* ```
|
|
190
|
+
*
|
|
191
|
+
* Create a table with an `index`:
|
|
192
|
+
*
|
|
193
|
+
* ```javascript
|
|
194
|
+
* const table = await client.table(data, { index: "Row ID" });
|
|
195
|
+
* ```
|
|
196
|
+
*/
|
|
197
|
+
table(value: string | ArrayBuffer | Record<string, unknown[]> | Record<string, unknown>[] | Record<string, ColumnType>, options?: TableInitOptions | null): Promise<Table>;
|
|
198
|
+
/**
|
|
199
|
+
* Terminates this [`Client`], cleaning up any [`crate::View`] handles the
|
|
200
|
+
* [`Client`] has open as well as its callbacks.
|
|
201
|
+
*/
|
|
202
|
+
terminate(): any;
|
|
215
203
|
}
|
|
204
|
+
|
|
216
205
|
export class ColumnDropDownElement {
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
206
|
+
private constructor();
|
|
207
|
+
free(): void;
|
|
208
|
+
[Symbol.dispose](): void;
|
|
220
209
|
}
|
|
210
|
+
|
|
221
211
|
export class CopyDropDownMenuElement {
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
212
|
+
free(): void;
|
|
213
|
+
[Symbol.dispose](): void;
|
|
214
|
+
/**
|
|
215
|
+
* Internal Only.
|
|
216
|
+
*
|
|
217
|
+
* Set this custom element model's raw pointer.
|
|
218
|
+
*/
|
|
219
|
+
__set_model(parent: PerspectiveViewerElement): void;
|
|
220
|
+
connected_callback(): void;
|
|
221
|
+
hide(): void;
|
|
222
|
+
constructor(elem: HTMLElement);
|
|
223
|
+
open(target: HTMLElement): void;
|
|
234
224
|
}
|
|
225
|
+
|
|
235
226
|
export class ExportDropDownMenuElement {
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
227
|
+
free(): void;
|
|
228
|
+
[Symbol.dispose](): void;
|
|
229
|
+
/**
|
|
230
|
+
* Internal Only.
|
|
231
|
+
*
|
|
232
|
+
* Set this custom element model's raw pointer.
|
|
233
|
+
*/
|
|
234
|
+
__set_model(parent: PerspectiveViewerElement): void;
|
|
235
|
+
connected_callback(): void;
|
|
236
|
+
hide(): void;
|
|
237
|
+
constructor(elem: HTMLElement);
|
|
238
|
+
open(target: HTMLElement): void;
|
|
248
239
|
}
|
|
240
|
+
|
|
249
241
|
export class FilterDropDownElement {
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
242
|
+
private constructor();
|
|
243
|
+
free(): void;
|
|
244
|
+
[Symbol.dispose](): void;
|
|
253
245
|
}
|
|
246
|
+
|
|
254
247
|
export class FunctionDropDownElement {
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
}
|
|
259
|
-
export class JsVirtualDataSlice {
|
|
260
|
-
free(): void;
|
|
261
|
-
[Symbol.dispose](): void;
|
|
262
|
-
constructor();
|
|
263
|
-
setCol(dtype: string, name: string, index: number, val: any, group_by_index?: number | null): void;
|
|
264
|
-
setStringCol(name: string, index: number, val: any, group_by_index?: number | null): void;
|
|
265
|
-
setIntegerCol(name: string, index: number, val: any, group_by_index?: number | null): void;
|
|
266
|
-
setFloatCol(name: string, index: number, val: any, group_by_index?: number | null): void;
|
|
267
|
-
setBooleanCol(name: string, index: number, val: any, group_by_index?: number | null): void;
|
|
268
|
-
setDatetimeCol(name: string, index: number, val: any, group_by_index?: number | null): void;
|
|
248
|
+
private constructor();
|
|
249
|
+
free(): void;
|
|
250
|
+
[Symbol.dispose](): void;
|
|
269
251
|
}
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
252
|
+
|
|
253
|
+
/**
|
|
254
|
+
* JavaScript-facing DuckDB SQL query builder.
|
|
255
|
+
*
|
|
256
|
+
* This struct wraps the Rust `DuckDBSqlBuilder` and exposes it to JavaScript
|
|
257
|
+
* via wasm_bindgen.
|
|
258
|
+
*/
|
|
259
|
+
export class GenericSQLVirtualServerModel {
|
|
260
|
+
free(): void;
|
|
261
|
+
[Symbol.dispose](): void;
|
|
262
|
+
/**
|
|
263
|
+
* Returns the SQL query to list all hosted tables.
|
|
264
|
+
*/
|
|
265
|
+
getHostedTables(): string;
|
|
266
|
+
/**
|
|
267
|
+
* Creates a new `JsDuckDBSqlBuilder` instance.
|
|
268
|
+
*/
|
|
269
|
+
constructor(args?: any | null);
|
|
270
|
+
/**
|
|
271
|
+
* Returns the SQL query to create a view from a table with the given
|
|
272
|
+
* configuration.
|
|
273
|
+
*/
|
|
274
|
+
tableMakeView(table_id: string, view_id: string, config: any): string;
|
|
275
|
+
/**
|
|
276
|
+
* Returns the SQL query to describe a table's schema.
|
|
277
|
+
*/
|
|
278
|
+
tableSchema(table_id: string): string;
|
|
279
|
+
/**
|
|
280
|
+
* Returns the SQL query to get the row count of a table.
|
|
281
|
+
*/
|
|
282
|
+
tableSize(table_id: string): string;
|
|
283
|
+
/**
|
|
284
|
+
* Returns the SQL query to validate an expression against a table.
|
|
285
|
+
*/
|
|
286
|
+
tableValidateExpression(table_id: string, expression: string): string;
|
|
287
|
+
/**
|
|
288
|
+
* Returns the SQL query to get the column count of a view.
|
|
289
|
+
*/
|
|
290
|
+
viewColumnSize(view_id: string): string;
|
|
291
|
+
/**
|
|
292
|
+
* Returns the SQL query to delete a view.
|
|
293
|
+
*/
|
|
294
|
+
viewDelete(view_id: string): string;
|
|
295
|
+
/**
|
|
296
|
+
* Returns the SQL query to fetch data from a view with the given viewport.
|
|
297
|
+
*/
|
|
298
|
+
viewGetData(view_id: string, config: any, viewport: any, schema: any): string;
|
|
299
|
+
/**
|
|
300
|
+
* Returns the SQL query to describe a view's schema.
|
|
301
|
+
*/
|
|
302
|
+
viewSchema(view_id: string): string;
|
|
303
|
+
/**
|
|
304
|
+
* Returns the SQL query to get the row count of a view.
|
|
305
|
+
*/
|
|
306
|
+
viewSize(view_id: string): string;
|
|
275
307
|
}
|
|
308
|
+
|
|
276
309
|
/**
|
|
277
310
|
* The `<perspective-viewer-plugin>` element.
|
|
278
311
|
*
|
|
@@ -290,30 +323,31 @@ export class JsVirtualServer {
|
|
|
290
323
|
* ```
|
|
291
324
|
*/
|
|
292
325
|
export class PerspectiveDebugPluginElement {
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
326
|
+
free(): void;
|
|
327
|
+
[Symbol.dispose](): void;
|
|
328
|
+
clear(): Promise<any>;
|
|
329
|
+
connectedCallback(): void;
|
|
330
|
+
delete(): Promise<any>;
|
|
331
|
+
/**
|
|
332
|
+
* # Notes
|
|
333
|
+
*
|
|
334
|
+
* When you pass a `wasm_bindgen` wrapped type _into_ Rust, it acts like a
|
|
335
|
+
* move. Ergo, if you replace the `&` in the `view` argument, the JS copy
|
|
336
|
+
* of the `View` will be invalid
|
|
337
|
+
*/
|
|
338
|
+
draw(view: View): Promise<any>;
|
|
339
|
+
constructor(elem: HTMLElement);
|
|
340
|
+
resize(): Promise<any>;
|
|
341
|
+
restore(): Promise<any>;
|
|
342
|
+
restyle(): Promise<any>;
|
|
343
|
+
save(): Promise<any>;
|
|
344
|
+
update(view: View): Promise<any>;
|
|
345
|
+
readonly config_column_names: any;
|
|
346
|
+
readonly min_config_columns: any;
|
|
347
|
+
readonly name: string;
|
|
348
|
+
readonly select_mode: string;
|
|
316
349
|
}
|
|
350
|
+
|
|
317
351
|
/**
|
|
318
352
|
* The `<perspective-viewer>` custom element.
|
|
319
353
|
*
|
|
@@ -341,746 +375,749 @@ export class PerspectiveDebugPluginElement {
|
|
|
341
375
|
* ```
|
|
342
376
|
*/
|
|
343
377
|
export class PerspectiveViewerElement {
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
378
|
+
free(): void;
|
|
379
|
+
[Symbol.dispose](): void;
|
|
380
|
+
/**
|
|
381
|
+
* Create a new JavaScript Heap reference for this model instance.
|
|
382
|
+
*/
|
|
383
|
+
__get_model(): PerspectiveViewerElement;
|
|
384
|
+
connectedCallback(): void;
|
|
385
|
+
/**
|
|
386
|
+
* Copy this viewer's `View` or `Table` data as CSV to the system
|
|
387
|
+
* clipboard.
|
|
388
|
+
*
|
|
389
|
+
* # Arguments
|
|
390
|
+
*
|
|
391
|
+
* - `method` - The `ExportMethod` (serialized as a `String`) to use to
|
|
392
|
+
* render the data to the Clipboard.
|
|
393
|
+
*
|
|
394
|
+
* # JavaScript Examples
|
|
395
|
+
*
|
|
396
|
+
* ```javascript
|
|
397
|
+
* myDownloadButton.addEventListener("click", async () => {
|
|
398
|
+
* await viewer.copy();
|
|
399
|
+
* })
|
|
400
|
+
* ```
|
|
401
|
+
*/
|
|
402
|
+
copy(method?: string | null): Promise<any>;
|
|
403
|
+
/**
|
|
404
|
+
* Delete the internal [`View`] and all associated state, rendering this
|
|
405
|
+
* `<perspective-viewer>` unusable and freeing all associated resources.
|
|
406
|
+
* Does not delete the supplied [`Table`] (as this is constructed by the
|
|
407
|
+
* callee).
|
|
408
|
+
*
|
|
409
|
+
* Calling _any_ method on a `<perspective-viewer>` after [`Self::delete`]
|
|
410
|
+
* will throw.
|
|
411
|
+
*
|
|
412
|
+
* <div class="warning">
|
|
413
|
+
*
|
|
414
|
+
* Allowing a `<perspective-viewer>` to be garbage-collected
|
|
415
|
+
* without calling [`PerspectiveViewerElement::delete`] will leak WASM
|
|
416
|
+
* memory!
|
|
417
|
+
*
|
|
418
|
+
* </div>
|
|
419
|
+
*
|
|
420
|
+
* # JavaScript Examples
|
|
421
|
+
*
|
|
422
|
+
* ```javascript
|
|
423
|
+
* await viewer.delete();
|
|
424
|
+
* ```
|
|
425
|
+
*/
|
|
426
|
+
delete(): Promise<any>;
|
|
427
|
+
/**
|
|
428
|
+
* Download this viewer's internal [`View`] data via a browser download
|
|
429
|
+
* event.
|
|
430
|
+
*
|
|
431
|
+
* # Arguments
|
|
432
|
+
*
|
|
433
|
+
* - `method` - The `ExportMethod` to use to render the data to download.
|
|
434
|
+
*
|
|
435
|
+
* # JavaScript Examples
|
|
436
|
+
*
|
|
437
|
+
* ```javascript
|
|
438
|
+
* myDownloadButton.addEventListener("click", async () => {
|
|
439
|
+
* await viewer.download();
|
|
440
|
+
* })
|
|
441
|
+
* ```
|
|
442
|
+
*/
|
|
443
|
+
download(method?: string | null): Promise<any>;
|
|
444
|
+
/**
|
|
445
|
+
* Restart this `<perspective-viewer>` to its initial state, before
|
|
446
|
+
* `load()`.
|
|
447
|
+
*
|
|
448
|
+
* Use `Self::restart` if you plan to call `Self::load` on this viewer
|
|
449
|
+
* again, or alternatively `Self::delete` if this viewer is no longer
|
|
450
|
+
* needed.
|
|
451
|
+
*/
|
|
452
|
+
eject(): Promise<any>;
|
|
453
|
+
/**
|
|
454
|
+
* Exports this viewer's internal [`View`] as a JavaSript data, the
|
|
455
|
+
* exact type of which depends on the `method` but defaults to `String`
|
|
456
|
+
* in CSV format.
|
|
457
|
+
*
|
|
458
|
+
* This method is only really useful for the `"plugin"` method, which
|
|
459
|
+
* will use the configured plugin's export (e.g. PNG for
|
|
460
|
+
* `@perspective-dev/viewer-d3fc`). Otherwise, prefer to call the
|
|
461
|
+
* equivalent method on the underlying [`View`] directly.
|
|
462
|
+
*
|
|
463
|
+
* # Arguments
|
|
464
|
+
*
|
|
465
|
+
* - `method` - The `ExportMethod` to use to render the data to download.
|
|
466
|
+
*
|
|
467
|
+
* # JavaScript Examples
|
|
468
|
+
*
|
|
469
|
+
* ```javascript
|
|
470
|
+
* const data = await viewer.export("plugin");
|
|
471
|
+
* ```
|
|
472
|
+
*/
|
|
473
|
+
export(method?: string | null): Promise<any>;
|
|
474
|
+
/**
|
|
475
|
+
* Flush any pending modifications to this `<perspective-viewer>`. Since
|
|
476
|
+
* `<perspective-viewer>`'s API is almost entirely `async`, it may take
|
|
477
|
+
* some milliseconds before any user-initiated changes to the [`View`]
|
|
478
|
+
* affects the rendered element. If you want to make sure all pending
|
|
479
|
+
* actions have been rendered, call and await [`Self::flush`].
|
|
480
|
+
*
|
|
481
|
+
* [`Self::flush`] will resolve immediately if there is no [`Table`] set.
|
|
482
|
+
*
|
|
483
|
+
* # JavaScript Examples
|
|
484
|
+
*
|
|
485
|
+
* In this example, [`Self::restore`] is called without `await`, but the
|
|
486
|
+
* eventual render which results from this call can still be awaited by
|
|
487
|
+
* immediately awaiting [`Self::flush`] instead.
|
|
488
|
+
*
|
|
489
|
+
* ```javascript
|
|
490
|
+
* viewer.restore(config);
|
|
491
|
+
* await viewer.flush();
|
|
492
|
+
* ```
|
|
493
|
+
*/
|
|
494
|
+
flush(): Promise<any>;
|
|
495
|
+
/**
|
|
496
|
+
* Get an `Array` of all of the plugin custom elements registered for this
|
|
497
|
+
* element. This may not include plugins which called
|
|
498
|
+
* [`registerPlugin`] after the host has rendered for the first time.
|
|
499
|
+
*/
|
|
500
|
+
getAllPlugins(): Array<any>;
|
|
501
|
+
/**
|
|
502
|
+
* Get the underlying [`Client`] for this viewer (as passed to, or
|
|
503
|
+
* associated with the [`Table`] passed to,
|
|
504
|
+
* [`PerspectiveViewerElement::load`]).
|
|
505
|
+
*
|
|
506
|
+
* # Arguments
|
|
507
|
+
*
|
|
508
|
+
* - `wait_for_client` - whether to wait for
|
|
509
|
+
* [`PerspectiveViewerElement::load`] to be called, or fail immediately
|
|
510
|
+
* if [`PerspectiveViewerElement::load`] has not yet been called.
|
|
511
|
+
*
|
|
512
|
+
* # JavaScript Examples
|
|
513
|
+
*
|
|
514
|
+
* ```javascript
|
|
515
|
+
* const client = await viewer.getClient();
|
|
516
|
+
* ```
|
|
517
|
+
*/
|
|
518
|
+
getClient(wait_for_client?: boolean | null): Promise<any>;
|
|
519
|
+
/**
|
|
520
|
+
* Get this viewer's edit port for the currently loaded [`Table`] (see
|
|
521
|
+
* [`Table::update`] for details on ports).
|
|
522
|
+
*/
|
|
523
|
+
getEditPort(): number;
|
|
524
|
+
/**
|
|
525
|
+
* Gets a plugin Custom Element with the `name` field, or get the active
|
|
526
|
+
* plugin if no `name` is provided.
|
|
527
|
+
*
|
|
528
|
+
* # Arguments
|
|
529
|
+
*
|
|
530
|
+
* - `name` - The `name` property of a perspective plugin Custom Element,
|
|
531
|
+
* or `None` for the active plugin's Custom Element.
|
|
532
|
+
*/
|
|
533
|
+
getPlugin(name?: string | null): any;
|
|
534
|
+
/**
|
|
535
|
+
* Get render statistics. Some fields of the returned stats object are
|
|
536
|
+
* relative to the last time [`PerspectiveViewerElement::getRenderStats`]
|
|
537
|
+
* was called, ergo calling this method resets these fields.
|
|
538
|
+
*
|
|
539
|
+
* # JavaScript Examples
|
|
540
|
+
*
|
|
541
|
+
* ```javascript
|
|
542
|
+
* const {virtual_fps, actual_fps} = await viewer.getRenderStats();
|
|
543
|
+
* ```
|
|
544
|
+
*/
|
|
545
|
+
getRenderStats(): any;
|
|
546
|
+
/**
|
|
547
|
+
* Return a [`perspective_js::JsViewWindow`] for the currently selected
|
|
548
|
+
* region.
|
|
549
|
+
*/
|
|
550
|
+
getSelection(): ViewWindow | undefined;
|
|
551
|
+
/**
|
|
552
|
+
* Get the underlying [`Table`] for this viewer (as passed to
|
|
553
|
+
* [`PerspectiveViewerElement::load`] or as the `table` field to
|
|
554
|
+
* [`PerspectiveViewerElement::restore`]).
|
|
555
|
+
*
|
|
556
|
+
* # Arguments
|
|
557
|
+
*
|
|
558
|
+
* - `wait_for_table` - whether to wait for
|
|
559
|
+
* [`PerspectiveViewerElement::load`] to be called, or fail immediately
|
|
560
|
+
* if [`PerspectiveViewerElement::load`] has not yet been called.
|
|
561
|
+
*
|
|
562
|
+
* # JavaScript Examples
|
|
563
|
+
*
|
|
564
|
+
* ```javascript
|
|
565
|
+
* const table = await viewer.getTable();
|
|
566
|
+
* ```
|
|
567
|
+
*/
|
|
568
|
+
getTable(wait_for_table?: boolean | null): Promise<any>;
|
|
569
|
+
/**
|
|
570
|
+
* Get the underlying [`View`] for this viewer.
|
|
571
|
+
*
|
|
572
|
+
* Use this method to get promgrammatic access to the [`View`] as currently
|
|
573
|
+
* configured by the user, for e.g. serializing as an
|
|
574
|
+
* [Apache Arrow](https://arrow.apache.org/) before passing to another
|
|
575
|
+
* library.
|
|
576
|
+
*
|
|
577
|
+
* The [`View`] returned by this method is owned by the
|
|
578
|
+
* [`PerspectiveViewerElement`] and may be _invalidated_ by
|
|
579
|
+
* [`View::delete`] at any time. Plugins which rely on this [`View`] for
|
|
580
|
+
* their [`HTMLPerspectiveViewerPluginElement::draw`] implementations
|
|
581
|
+
* should treat this condition as a _cancellation_ by silently aborting on
|
|
582
|
+
* "View already deleted" errors from method calls.
|
|
583
|
+
*
|
|
584
|
+
* # JavaScript Examples
|
|
585
|
+
*
|
|
586
|
+
* ```javascript
|
|
587
|
+
* const view = await viewer.getView();
|
|
588
|
+
* ```
|
|
589
|
+
*/
|
|
590
|
+
getView(): Promise<any>;
|
|
591
|
+
/**
|
|
592
|
+
* Get a copy of the [`ViewConfig`] for the current [`View`]. This is
|
|
593
|
+
* non-blocking as it does not need to access the plugin (unlike
|
|
594
|
+
* [`PerspectiveViewerElement::save`]), and also makes no API calls to the
|
|
595
|
+
* server (unlike [`PerspectiveViewerElement::getView`] followed by
|
|
596
|
+
* [`View::get_config`])
|
|
597
|
+
*/
|
|
598
|
+
getViewConfig(): Promise<any>;
|
|
599
|
+
/**
|
|
600
|
+
* Loads a [`Client`], or optionally [`Table`], or optionally a Javascript
|
|
601
|
+
* `Promise` which returns a [`Client`] or [`Table`], in this viewer.
|
|
602
|
+
*
|
|
603
|
+
* Loading a [`Client`] does not render, but subsequent calls to
|
|
604
|
+
* [`PerspectiveViewerElement::restore`] will use this [`Client`] to look
|
|
605
|
+
* up the proviced `table` name field for the provided
|
|
606
|
+
* [`ViewerConfigUpdate`].
|
|
607
|
+
*
|
|
608
|
+
* Loading a [`Table`] is equivalent to subsequently calling
|
|
609
|
+
* [`Self::restore`] with the `table` field set to [`Table::get_name`], and
|
|
610
|
+
* will render the UI in its default state when [`Self::load`] resolves.
|
|
611
|
+
* If you plan to call [`Self::restore`] anyway, prefer passing a
|
|
612
|
+
* [`Client`] argument to [`Self::load`] as it will conserve one render.
|
|
613
|
+
*
|
|
614
|
+
* When [`PerspectiveViewerElement::load`] resolves, the first frame of the
|
|
615
|
+
* UI + visualization is guaranteed to have been drawn. Awaiting the result
|
|
616
|
+
* of this method in a `try`/`catch` block will capture any errors
|
|
617
|
+
* thrown during the loading process, or from the [`Client`] `Promise`
|
|
618
|
+
* itself.
|
|
619
|
+
*
|
|
620
|
+
* [`PerspectiveViewerElement::load`] may also be called with a [`Table`],
|
|
621
|
+
* which is equivalent to:
|
|
622
|
+
*
|
|
623
|
+
* ```javascript
|
|
624
|
+
* await viewer.load(await table.get_client());
|
|
625
|
+
* await viewer.restore({name: await table.get_name()})
|
|
626
|
+
* ```
|
|
627
|
+
*
|
|
628
|
+
* If you plan to call [`PerspectiveViewerElement::restore`] immediately
|
|
629
|
+
* after [`PerspectiveViewerElement::load`] yourself, as is commonly
|
|
630
|
+
* done when loading and configuring a new `<perspective-viewer>`, you
|
|
631
|
+
* should use a [`Client`] as an argument and set the `table` field in the
|
|
632
|
+
* restore call as
|
|
633
|
+
*
|
|
634
|
+
* A [`Table`] can be created using the
|
|
635
|
+
* [`@perspective-dev/client`](https://www.npmjs.com/package/@perspective-dev/client)
|
|
636
|
+
* library from NPM (see [`perspective_js`] documentation for details).
|
|
637
|
+
*
|
|
638
|
+
* # JavaScript Examples
|
|
639
|
+
*
|
|
640
|
+
* ```javascript
|
|
641
|
+
* import perspective from "@perspective-dev/client";
|
|
642
|
+
*
|
|
643
|
+
* const worker = await perspective.worker();
|
|
644
|
+
* viewer.load(worker);
|
|
645
|
+
* ```
|
|
646
|
+
*
|
|
647
|
+
* ... or
|
|
648
|
+
*
|
|
649
|
+
* ```javascript
|
|
650
|
+
* const table = await worker.table(data, {name: "superstore"});
|
|
651
|
+
* viewer.load(table);
|
|
652
|
+
* ```
|
|
653
|
+
*
|
|
654
|
+
* Complete example:
|
|
655
|
+
*
|
|
656
|
+
* ```javascript
|
|
657
|
+
* const viewer = document.createElement("perspective-viewer");
|
|
658
|
+
* const worker = await perspective.worker();
|
|
659
|
+
*
|
|
660
|
+
* await worker.table("x\n1", {name: "table_one"});
|
|
661
|
+
* await viewer.load(worker);
|
|
662
|
+
* await viewer.restore({table: "table_one", columns: ["x"]});
|
|
663
|
+
* ```
|
|
664
|
+
*
|
|
665
|
+
* ... or, if you don't want to pass your own arguments to `restore`:
|
|
666
|
+
*
|
|
667
|
+
* ```javascript
|
|
668
|
+
* const viewer = document.createElement("perspective-viewer");
|
|
669
|
+
* const worker = await perspective.worker();
|
|
670
|
+
*
|
|
671
|
+
* const table = await worker.table("x\n1", {name: "table_one"});
|
|
672
|
+
* await viewer.load(table);
|
|
673
|
+
* ```
|
|
674
|
+
*/
|
|
675
|
+
load(table: any): Promise<any>;
|
|
676
|
+
constructor(elem: HTMLElement);
|
|
677
|
+
/**
|
|
678
|
+
* Force open the settings for a particular column. Pass `null` to close
|
|
679
|
+
* the column settings panel. See [`Self::toggleColumnSettings`] for more.
|
|
680
|
+
*/
|
|
681
|
+
openColumnSettings(column_name?: string | null, toggle?: boolean | null): Promise<any>;
|
|
682
|
+
/**
|
|
683
|
+
* Reset the viewer's `ViewerConfig` to the default.
|
|
684
|
+
*
|
|
685
|
+
* # Arguments
|
|
686
|
+
*
|
|
687
|
+
* - `reset_all` - If set, will clear expressions and column settings as
|
|
688
|
+
* well.
|
|
689
|
+
*
|
|
690
|
+
* # JavaScript Examples
|
|
691
|
+
*
|
|
692
|
+
* ```javascript
|
|
693
|
+
* await viewer.reset();
|
|
694
|
+
* ```
|
|
695
|
+
*/
|
|
696
|
+
reset(reset_all?: boolean | null): Promise<any>;
|
|
697
|
+
/**
|
|
698
|
+
* If this element is in an _errored_ state, this method will clear it and
|
|
699
|
+
* re-render. Calling this method is equivalent to clicking the error reset
|
|
700
|
+
* button in the UI.
|
|
701
|
+
*/
|
|
702
|
+
resetError(): Promise<any>;
|
|
703
|
+
/**
|
|
704
|
+
* Set the available theme names available in the status bar UI.
|
|
705
|
+
*
|
|
706
|
+
* Calling [`Self::resetThemes`] may cause the current theme to switch,
|
|
707
|
+
* if e.g. the new theme set does not contain the current theme.
|
|
708
|
+
*
|
|
709
|
+
* # JavaScript Examples
|
|
710
|
+
*
|
|
711
|
+
* Restrict `<perspective-viewer>` theme options to _only_ default light
|
|
712
|
+
* and dark themes, regardless of what is auto-detected from the page's
|
|
713
|
+
* CSS:
|
|
714
|
+
*
|
|
715
|
+
* ```javascript
|
|
716
|
+
* viewer.resetThemes(["Pro Light", "Pro Dark"])
|
|
717
|
+
* ```
|
|
718
|
+
*/
|
|
719
|
+
resetThemes(themes?: any[] | null): Promise<any>;
|
|
720
|
+
/**
|
|
721
|
+
* Recalculate the viewer's dimensions and redraw.
|
|
722
|
+
*
|
|
723
|
+
* Use this method to tell `<perspective-viewer>` its dimensions have
|
|
724
|
+
* changed when auto-size mode has been disabled via [`Self::setAutoSize`].
|
|
725
|
+
* [`Self::resize`] resolves when the resize-initiated redraw of this
|
|
726
|
+
* element has completed.
|
|
727
|
+
*
|
|
728
|
+
* # Arguments
|
|
729
|
+
*
|
|
730
|
+
* - `force` - If [`Self::resize`] is called with `false` or without an
|
|
731
|
+
* argument, and _auto-size_ mode is enabled via [`Self::setAutoSize`],
|
|
732
|
+
* [`Self::resize`] will log a warning and auto-disable auto-size mode.
|
|
733
|
+
*
|
|
734
|
+
* # JavaScript Examples
|
|
735
|
+
*
|
|
736
|
+
* ```javascript
|
|
737
|
+
* await viewer.resize(true)
|
|
738
|
+
* ```
|
|
739
|
+
*/
|
|
740
|
+
resize(force?: boolean | null): Promise<any>;
|
|
741
|
+
/**
|
|
742
|
+
* Restores this element from a full/partial
|
|
743
|
+
* [`perspective_js::JsViewConfig`] (this element's user-configurable
|
|
744
|
+
* state, including the `Table` name).
|
|
745
|
+
*
|
|
746
|
+
* One of the best ways to use [`Self::restore`] is by first configuring
|
|
747
|
+
* a `<perspective-viewer>` as you wish, then using either the `Debug`
|
|
748
|
+
* panel or "Copy" -> "config.json" from the toolbar menu to snapshot
|
|
749
|
+
* the [`Self::restore`] argument as JSON.
|
|
750
|
+
*
|
|
751
|
+
* # Arguments
|
|
752
|
+
*
|
|
753
|
+
* - `update` - The config to restore to, as returned by [`Self::save`] in
|
|
754
|
+
* either "json", "string" or "arraybuffer" format.
|
|
755
|
+
*
|
|
756
|
+
* # JavaScript Examples
|
|
757
|
+
*
|
|
758
|
+
* Loads a default plugin for the table named `"superstore"`:
|
|
759
|
+
*
|
|
760
|
+
* ```javascript
|
|
761
|
+
* await viewer.restore({table: "superstore"});
|
|
762
|
+
* ```
|
|
763
|
+
*
|
|
764
|
+
* Apply a `group_by` to the same `viewer` element, without
|
|
765
|
+
* modifying/resetting other fields - you can omit the `table` field,
|
|
766
|
+
* this has already been set once and is not modified:
|
|
767
|
+
*
|
|
768
|
+
* ```javascript
|
|
769
|
+
* await viewer.restore({group_by: ["State"]});
|
|
770
|
+
* ```
|
|
771
|
+
*/
|
|
772
|
+
restore(update: any): Promise<any>;
|
|
773
|
+
/**
|
|
774
|
+
* Restyle all plugins from current document.
|
|
775
|
+
*
|
|
776
|
+
* <div class="warning">
|
|
777
|
+
*
|
|
778
|
+
* [`Self::restyleElement`] _must_ be called for many runtime changes to
|
|
779
|
+
* CSS properties to be reflected in an already-rendered
|
|
780
|
+
* `<perspective-viewer>`.
|
|
781
|
+
*
|
|
782
|
+
* </div>
|
|
783
|
+
*
|
|
784
|
+
* # JavaScript Examples
|
|
785
|
+
*
|
|
786
|
+
* ```javascript
|
|
787
|
+
* viewer.style = "--icon--color: red";
|
|
788
|
+
* await viewer.restyleElement();
|
|
789
|
+
* ```
|
|
790
|
+
*/
|
|
791
|
+
restyleElement(): Promise<any>;
|
|
792
|
+
/**
|
|
793
|
+
* Save this element's user-configurable state to a serialized state
|
|
794
|
+
* object, one which can be restored via the [`Self::restore`] method.
|
|
795
|
+
*
|
|
796
|
+
* # JavaScript Examples
|
|
797
|
+
*
|
|
798
|
+
* Get the current `group_by` setting:
|
|
799
|
+
*
|
|
800
|
+
* ```javascript
|
|
801
|
+
* const {group_by} = await viewer.restore();
|
|
802
|
+
* ```
|
|
803
|
+
*
|
|
804
|
+
* Reset workflow attached to an external button `myResetButton`:
|
|
805
|
+
*
|
|
806
|
+
* ```javascript
|
|
807
|
+
* const token = await viewer.save();
|
|
808
|
+
* myResetButton.addEventListener("clien", async () => {
|
|
809
|
+
* await viewer.restore(token);
|
|
810
|
+
* });
|
|
811
|
+
* ```
|
|
812
|
+
*/
|
|
813
|
+
save(): Promise<any>;
|
|
814
|
+
/**
|
|
815
|
+
* Sets the auto-pause behavior of this component.
|
|
816
|
+
*
|
|
817
|
+
* When `true`, this `<perspective-viewer>` will register an
|
|
818
|
+
* `IntersectionObserver` on itself and subsequently skip rendering
|
|
819
|
+
* whenever its viewport visibility changes. Auto-pause is enabled by
|
|
820
|
+
* default.
|
|
821
|
+
*
|
|
822
|
+
* # Arguments
|
|
823
|
+
*
|
|
824
|
+
* - `autopause` Whether to enable `auto-pause` behavior or not.
|
|
825
|
+
*
|
|
826
|
+
* # JavaScript Examples
|
|
827
|
+
*
|
|
828
|
+
* Disable auto-size behavior:
|
|
829
|
+
*
|
|
830
|
+
* ```javascript
|
|
831
|
+
* viewer.setAutoPause(false);
|
|
832
|
+
* ```
|
|
833
|
+
*/
|
|
834
|
+
setAutoPause(autopause: boolean): void;
|
|
835
|
+
/**
|
|
836
|
+
* Sets the auto-size behavior of this component.
|
|
837
|
+
*
|
|
838
|
+
* When `true`, this `<perspective-viewer>` will register a
|
|
839
|
+
* `ResizeObserver` on itself and call [`Self::resize`] whenever its own
|
|
840
|
+
* dimensions change. However, when embedded in a larger application
|
|
841
|
+
* context, you may want to call [`Self::resize`] manually to avoid
|
|
842
|
+
* over-rendering; in this case auto-sizing can be disabled via this
|
|
843
|
+
* method. Auto-size behavior is enabled by default.
|
|
844
|
+
*
|
|
845
|
+
* # Arguments
|
|
846
|
+
*
|
|
847
|
+
* - `autosize` - Whether to enable `auto-size` behavior or not.
|
|
848
|
+
*
|
|
849
|
+
* # JavaScript Examples
|
|
850
|
+
*
|
|
851
|
+
* Disable auto-size behavior:
|
|
852
|
+
*
|
|
853
|
+
* ```javascript
|
|
854
|
+
* viewer.setAutoSize(false);
|
|
855
|
+
* ```
|
|
856
|
+
*/
|
|
857
|
+
setAutoSize(autosize: boolean): void;
|
|
858
|
+
/**
|
|
859
|
+
* Set the selection [`perspective_js::JsViewWindow`] for this element.
|
|
860
|
+
*/
|
|
861
|
+
setSelection(window?: ViewWindow | null): void;
|
|
862
|
+
/**
|
|
863
|
+
* Determines the render throttling behavior. Can be an integer, for
|
|
864
|
+
* millisecond window to throttle render event; or, if `None`, adaptive
|
|
865
|
+
* throttling will be calculated from the measured render time of the
|
|
866
|
+
* last 5 frames.
|
|
867
|
+
*
|
|
868
|
+
* # Arguments
|
|
869
|
+
*
|
|
870
|
+
* - `throttle` - The throttle rate in milliseconds (f64), or `None` for
|
|
871
|
+
* adaptive throttling.
|
|
872
|
+
*
|
|
873
|
+
* # JavaScript Examples
|
|
874
|
+
*
|
|
875
|
+
* Only draws at most 1 frame/sec:
|
|
876
|
+
*
|
|
877
|
+
* ```rust
|
|
878
|
+
* viewer.setThrottle(1000);
|
|
879
|
+
* ```
|
|
880
|
+
*/
|
|
881
|
+
setThrottle(val?: number | null): void;
|
|
882
|
+
/**
|
|
883
|
+
* Asynchronously opens the column settings for a specific column.
|
|
884
|
+
* When finished, the `<perspective-viewer>` element will emit a
|
|
885
|
+
* "perspective-toggle-column-settings" CustomEvent.
|
|
886
|
+
* The event's details property has two fields: `{open: bool, column_name?:
|
|
887
|
+
* string}`. The CustomEvent is also fired whenever the user toggles the
|
|
888
|
+
* sidebar manually.
|
|
889
|
+
*/
|
|
890
|
+
toggleColumnSettings(column_name: string): Promise<any>;
|
|
891
|
+
/**
|
|
892
|
+
* Toggle (or force) the config panel open/closed.
|
|
893
|
+
*
|
|
894
|
+
* # Arguments
|
|
895
|
+
*
|
|
896
|
+
* - `force` - Force the state of the panel open or closed, or `None` to
|
|
897
|
+
* toggle.
|
|
898
|
+
*
|
|
899
|
+
* # JavaScript Examples
|
|
900
|
+
*
|
|
901
|
+
* ```javascript
|
|
902
|
+
* await viewer.toggleConfig();
|
|
903
|
+
* ```
|
|
904
|
+
*/
|
|
905
|
+
toggleConfig(force?: boolean | null): Promise<any>;
|
|
872
906
|
}
|
|
907
|
+
|
|
873
908
|
export class ProxySession {
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
909
|
+
free(): void;
|
|
910
|
+
[Symbol.dispose](): void;
|
|
911
|
+
close(): Promise<void>;
|
|
912
|
+
handle_request(value: any): Promise<void>;
|
|
913
|
+
constructor(client: Client, on_response: Function);
|
|
879
914
|
}
|
|
915
|
+
|
|
880
916
|
export class Table {
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
917
|
+
private constructor();
|
|
918
|
+
free(): void;
|
|
919
|
+
[Symbol.dispose](): void;
|
|
920
|
+
__getClassname(): string;
|
|
921
|
+
/**
|
|
922
|
+
* Removes all the rows in the [`Table`], but preserves everything else
|
|
923
|
+
* including the schema, index, and any callbacks or registered
|
|
924
|
+
* [`View`] instances.
|
|
925
|
+
*
|
|
926
|
+
* Calling [`Table::clear`], like [`Table::update`] and [`Table::remove`],
|
|
927
|
+
* will trigger an update event to any registered listeners via
|
|
928
|
+
* [`View::on_update`].
|
|
929
|
+
*/
|
|
930
|
+
clear(): Promise<void>;
|
|
931
|
+
/**
|
|
932
|
+
* Returns the column names of this [`Table`] in "natural" order (the
|
|
933
|
+
* ordering implied by the input format).
|
|
934
|
+
*
|
|
935
|
+
* # JavaScript Examples
|
|
936
|
+
*
|
|
937
|
+
* ```javascript
|
|
938
|
+
* const columns = await table.columns();
|
|
939
|
+
* ```
|
|
940
|
+
*/
|
|
941
|
+
columns(): Promise<any>;
|
|
942
|
+
/**
|
|
943
|
+
* Delete this [`Table`] and cleans up associated resources.
|
|
944
|
+
*
|
|
945
|
+
* [`Table`]s do not stop consuming resources or processing updates when
|
|
946
|
+
* they are garbage collected in their host language - you must call
|
|
947
|
+
* this method to reclaim these.
|
|
948
|
+
*
|
|
949
|
+
* # Arguments
|
|
950
|
+
*
|
|
951
|
+
* - `options` An options dictionary.
|
|
952
|
+
* - `lazy` Whether to delete this [`Table`] _lazily_. When false (the
|
|
953
|
+
* default), the delete will occur immediately, assuming it has no
|
|
954
|
+
* [`View`] instances registered to it (which must be deleted first,
|
|
955
|
+
* otherwise this method will throw an error). When true, the
|
|
956
|
+
* [`Table`] will only be marked for deltion once its [`View`]
|
|
957
|
+
* dependency count reaches 0.
|
|
958
|
+
*
|
|
959
|
+
* # JavaScript Examples
|
|
960
|
+
*
|
|
961
|
+
* ```javascript
|
|
962
|
+
* const table = await client.table("x,y\n1,2\n3,4");
|
|
963
|
+
*
|
|
964
|
+
* // ...
|
|
965
|
+
*
|
|
966
|
+
* await table.delete({ lazy: true });
|
|
967
|
+
* ```
|
|
968
|
+
*/
|
|
969
|
+
delete(options?: DeleteOptions | null): Promise<void>;
|
|
970
|
+
/**
|
|
971
|
+
* Get a copy of the [`Client`] this [`Table`] came from.
|
|
972
|
+
*/
|
|
973
|
+
get_client(): Promise<Client>;
|
|
974
|
+
/**
|
|
975
|
+
* Returns the name of the index column for the table.
|
|
976
|
+
*
|
|
977
|
+
* # JavaScript Examples
|
|
978
|
+
*
|
|
979
|
+
* ```javascript
|
|
980
|
+
* const table = await client.table("x,y\n1,2\n3,4", { index: "x" });
|
|
981
|
+
* const index = table.get_index(); // "x"
|
|
982
|
+
* ```
|
|
983
|
+
*/
|
|
984
|
+
get_index(): Promise<string>;
|
|
985
|
+
/**
|
|
986
|
+
* Returns the user-specified row limit for this table.
|
|
987
|
+
*/
|
|
988
|
+
get_limit(): Promise<number | undefined>;
|
|
989
|
+
/**
|
|
990
|
+
* Returns the user-specified name for this table, or the auto-generated
|
|
991
|
+
* name if a name was not specified when the table was created.
|
|
992
|
+
*/
|
|
993
|
+
get_name(): Promise<string>;
|
|
994
|
+
/**
|
|
995
|
+
* Create a unique channel ID on this [`Table`], which allows
|
|
996
|
+
* `View::on_update` callback calls to be associated with the
|
|
997
|
+
* `Table::update` which caused them.
|
|
998
|
+
*/
|
|
999
|
+
make_port(): Promise<number>;
|
|
1000
|
+
/**
|
|
1001
|
+
* Register a callback which is called exactly once, when this [`Table`] is
|
|
1002
|
+
* deleted with the [`Table::delete`] method.
|
|
1003
|
+
*
|
|
1004
|
+
* [`Table::on_delete`] resolves when the subscription message is sent, not
|
|
1005
|
+
* when the _delete_ event occurs.
|
|
1006
|
+
*/
|
|
1007
|
+
on_delete(on_delete: Function): Promise<any>;
|
|
1008
|
+
/**
|
|
1009
|
+
* Removes rows from this [`Table`] with the `index` column values
|
|
1010
|
+
* supplied.
|
|
1011
|
+
*
|
|
1012
|
+
* # Arguments
|
|
1013
|
+
*
|
|
1014
|
+
* - `indices` - A list of `index` column values for rows that should be
|
|
1015
|
+
* removed.
|
|
1016
|
+
*
|
|
1017
|
+
* # JavaScript Examples
|
|
1018
|
+
*
|
|
1019
|
+
* ```javascript
|
|
1020
|
+
* await table.remove([1, 2, 3]);
|
|
1021
|
+
* ```
|
|
1022
|
+
*/
|
|
1023
|
+
remove(value: any, options?: UpdateOptions | null): Promise<void>;
|
|
1024
|
+
/**
|
|
1025
|
+
* Removes a listener with a given ID, as returned by a previous call to
|
|
1026
|
+
* [`Table::on_delete`].
|
|
1027
|
+
*/
|
|
1028
|
+
remove_delete(callback_id: number): Promise<any>;
|
|
1029
|
+
/**
|
|
1030
|
+
* Replace all rows in this [`Table`] with the input data, coerced to this
|
|
1031
|
+
* [`Table`]'s existing [`perspective_client::Schema`], notifying any
|
|
1032
|
+
* derived [`View`] and [`View::on_update`] callbacks.
|
|
1033
|
+
*
|
|
1034
|
+
* Calling [`Table::replace`] is an easy way to replace _all_ the data in a
|
|
1035
|
+
* [`Table`] without losing any derived [`View`] instances or
|
|
1036
|
+
* [`View::on_update`] callbacks. [`Table::replace`] does _not_ infer
|
|
1037
|
+
* data types like [`Client::table`] does, rather it _coerces_ input
|
|
1038
|
+
* data to the `Schema` like [`Table::update`]. If you need a [`Table`]
|
|
1039
|
+
* with a different `Schema`, you must create a new one.
|
|
1040
|
+
*
|
|
1041
|
+
* # JavaScript Examples
|
|
1042
|
+
*
|
|
1043
|
+
* ```javascript
|
|
1044
|
+
* await table.replace("x,y\n1,2");
|
|
1045
|
+
* ```
|
|
1046
|
+
*/
|
|
1047
|
+
replace(input: any, options?: UpdateOptions | null): Promise<void>;
|
|
1048
|
+
/**
|
|
1049
|
+
* Returns a table's [`Schema`], a mapping of column names to column types.
|
|
1050
|
+
*
|
|
1051
|
+
* The mapping of a [`Table`]'s column names to data types is referred to
|
|
1052
|
+
* as a [`Schema`]. Each column has a unique name and a data type, one
|
|
1053
|
+
* of:
|
|
1054
|
+
*
|
|
1055
|
+
* - `"boolean"` - A boolean type
|
|
1056
|
+
* - `"date"` - A timesonze-agnostic date type (month/day/year)
|
|
1057
|
+
* - `"datetime"` - A millisecond-precision datetime type in the UTC
|
|
1058
|
+
* timezone
|
|
1059
|
+
* - `"float"` - A 64 bit float
|
|
1060
|
+
* - `"integer"` - A signed 32 bit integer (the integer type supported by
|
|
1061
|
+
* JavaScript)
|
|
1062
|
+
* - `"string"` - A [`String`] data type (encoded internally as a
|
|
1063
|
+
* _dictionary_)
|
|
1064
|
+
*
|
|
1065
|
+
* Note that all [`Table`] columns are _nullable_, regardless of the data
|
|
1066
|
+
* type.
|
|
1067
|
+
*/
|
|
1068
|
+
schema(): Promise<Record<string, ColumnType>>;
|
|
1069
|
+
/**
|
|
1070
|
+
* Returns the number of rows in a [`Table`].
|
|
1071
|
+
*/
|
|
1072
|
+
size(): Promise<number>;
|
|
1073
|
+
/**
|
|
1074
|
+
* Updates the rows of this table and any derived [`View`] instances.
|
|
1075
|
+
*
|
|
1076
|
+
* Calling [`Table::update`] will trigger the [`View::on_update`] callbacks
|
|
1077
|
+
* register to derived [`View`], and the call itself will not resolve until
|
|
1078
|
+
* _all_ derived [`View`]'s are notified.
|
|
1079
|
+
*
|
|
1080
|
+
* When updating a [`Table`] with an `index`, [`Table::update`] supports
|
|
1081
|
+
* partial updates, by omitting columns from the update data.
|
|
1082
|
+
*
|
|
1083
|
+
* # Arguments
|
|
1084
|
+
*
|
|
1085
|
+
* - `input` - The input data for this [`Table`]. The schema of a [`Table`]
|
|
1086
|
+
* is immutable after creation, so this method cannot be called with a
|
|
1087
|
+
* schema.
|
|
1088
|
+
* - `options` - Options for this update step - see [`UpdateOptions`].
|
|
1089
|
+
*
|
|
1090
|
+
* # JavaScript Examples
|
|
1091
|
+
*
|
|
1092
|
+
* ```javascript
|
|
1093
|
+
* await table.update("x,y\n1,2");
|
|
1094
|
+
* ```
|
|
1095
|
+
*/
|
|
1096
|
+
update(input: string | ArrayBuffer | Record<string, unknown[]> | Record<string, unknown>[] | Record<string, ColumnType>, options?: UpdateOptions | null): Promise<any>;
|
|
1097
|
+
/**
|
|
1098
|
+
* Validates the given expressions.
|
|
1099
|
+
*/
|
|
1100
|
+
validate_expressions(exprs: any): Promise<any>;
|
|
1101
|
+
/**
|
|
1102
|
+
* Create a new [`View`] from this table with a specified
|
|
1103
|
+
* [`ViewConfigUpdate`].
|
|
1104
|
+
*
|
|
1105
|
+
* See [`View`] struct.
|
|
1106
|
+
*
|
|
1107
|
+
* # JavaScript Examples
|
|
1108
|
+
*
|
|
1109
|
+
* ```javascript
|
|
1110
|
+
* const view = await table.view({
|
|
1111
|
+
* columns: ["Sales"],
|
|
1112
|
+
* aggregates: { Sales: "sum" },
|
|
1113
|
+
* group_by: ["Region", "Country"],
|
|
1114
|
+
* filter: [["Category", "in", ["Furniture", "Technology"]]],
|
|
1115
|
+
* });
|
|
1116
|
+
* ```
|
|
1117
|
+
*/
|
|
1118
|
+
view(config?: ViewConfigUpdate | null): Promise<View>;
|
|
1083
1119
|
}
|
|
1120
|
+
|
|
1084
1121
|
/**
|
|
1085
1122
|
* The [`View`] struct is Perspective's query and serialization interface. It
|
|
1086
1123
|
* represents a query on the `Table`'s dataset and is always created from an
|
|
@@ -1097,367 +1134,414 @@ export class Table {
|
|
|
1097
1134
|
* pivots, filters, etc. which can be applied.
|
|
1098
1135
|
*/
|
|
1099
1136
|
export class View {
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1137
|
+
private constructor();
|
|
1138
|
+
free(): void;
|
|
1139
|
+
[Symbol.dispose](): void;
|
|
1140
|
+
__get_model(): View;
|
|
1141
|
+
/**
|
|
1142
|
+
* Collapses the `group_by` row at `row_index`.
|
|
1143
|
+
*/
|
|
1144
|
+
collapse(row_index: number): Promise<number>;
|
|
1145
|
+
/**
|
|
1146
|
+
* Returns an array of strings containing the column paths of the [`View`]
|
|
1147
|
+
* without any of the source columns.
|
|
1148
|
+
*
|
|
1149
|
+
* A column path shows the columns that a given cell belongs to after
|
|
1150
|
+
* pivots are applied.
|
|
1151
|
+
*/
|
|
1152
|
+
column_paths(window?: ColumnWindow | null): Promise<any>;
|
|
1153
|
+
/**
|
|
1154
|
+
* Delete this [`View`] and clean up all resources associated with it.
|
|
1155
|
+
* [`View`] objects do not stop consuming resources or processing
|
|
1156
|
+
* updates when they are garbage collected - you must call this method
|
|
1157
|
+
* to reclaim these.
|
|
1158
|
+
*/
|
|
1159
|
+
delete(): Promise<void>;
|
|
1160
|
+
/**
|
|
1161
|
+
* Returns this [`View`]'s _dimensions_, row and column count, as well as
|
|
1162
|
+
* those of the [`crate::Table`] from which it was derived.
|
|
1163
|
+
*
|
|
1164
|
+
* - `num_table_rows` - The number of rows in the underlying
|
|
1165
|
+
* [`crate::Table`].
|
|
1166
|
+
* - `num_table_columns` - The number of columns in the underlying
|
|
1167
|
+
* [`crate::Table`] (including the `index` column if this
|
|
1168
|
+
* [`crate::Table`] was constructed with one).
|
|
1169
|
+
* - `num_view_rows` - The number of rows in this [`View`]. If this
|
|
1170
|
+
* [`View`] has a `group_by` clause, `num_view_rows` will also include
|
|
1171
|
+
* aggregated rows.
|
|
1172
|
+
* - `num_view_columns` - The number of columns in this [`View`]. If this
|
|
1173
|
+
* [`View`] has a `split_by` clause, `num_view_columns` will include all
|
|
1174
|
+
* _column paths_, e.g. the number of `columns` clause times the number
|
|
1175
|
+
* of `split_by` groups.
|
|
1176
|
+
*/
|
|
1177
|
+
dimensions(): Promise<any>;
|
|
1178
|
+
/**
|
|
1179
|
+
* Expand the `group_by` row at `row_index`.
|
|
1180
|
+
*/
|
|
1181
|
+
expand(row_index: number): Promise<number>;
|
|
1182
|
+
/**
|
|
1183
|
+
* The expression schema of this [`View`], which contains only the
|
|
1184
|
+
* expressions created on this [`View`]. See [`View::schema`] for
|
|
1185
|
+
* details.
|
|
1186
|
+
*/
|
|
1187
|
+
expression_schema(): Promise<any>;
|
|
1188
|
+
/**
|
|
1189
|
+
* A copy of the config object passed to the [`Table::view`] method which
|
|
1190
|
+
* created this [`View`].
|
|
1191
|
+
*/
|
|
1192
|
+
get_config(): Promise<any>;
|
|
1193
|
+
/**
|
|
1194
|
+
* Calculates the [min, max] of the leaf nodes of a column `column_name`.
|
|
1195
|
+
*
|
|
1196
|
+
* # Returns
|
|
1197
|
+
*
|
|
1198
|
+
* A tuple of [min, max], whose types are column and aggregate dependent.
|
|
1199
|
+
*/
|
|
1200
|
+
get_min_max(name: string): Promise<Array<any>>;
|
|
1201
|
+
/**
|
|
1202
|
+
* The number of aggregated columns in this [`View`]. This is affected by
|
|
1203
|
+
* the "split_by" configuration parameter supplied to this view's
|
|
1204
|
+
* contructor.
|
|
1205
|
+
*
|
|
1206
|
+
* # Returns
|
|
1207
|
+
*
|
|
1208
|
+
* The number of aggregated columns.
|
|
1209
|
+
*/
|
|
1210
|
+
num_columns(): Promise<number>;
|
|
1211
|
+
/**
|
|
1212
|
+
* The number of aggregated rows in this [`View`]. This is affected by the
|
|
1213
|
+
* "group_by" configuration parameter supplied to this view's contructor.
|
|
1214
|
+
*
|
|
1215
|
+
* # Returns
|
|
1216
|
+
*
|
|
1217
|
+
* The number of aggregated rows.
|
|
1218
|
+
*/
|
|
1219
|
+
num_rows(): Promise<number>;
|
|
1220
|
+
/**
|
|
1221
|
+
* Register a callback with this [`View`]. Whenever the [`View`] is
|
|
1222
|
+
* deleted, this callback will be invoked.
|
|
1223
|
+
*/
|
|
1224
|
+
on_delete(on_delete: Function): Promise<any>;
|
|
1225
|
+
/**
|
|
1226
|
+
* Register a callback with this [`View`]. Whenever the view's underlying
|
|
1227
|
+
* table emits an update, this callback will be invoked with an object
|
|
1228
|
+
* containing `port_id`, indicating which port the update fired on, and
|
|
1229
|
+
* optionally `delta`, which is the new data that was updated for each
|
|
1230
|
+
* cell or each row.
|
|
1231
|
+
*
|
|
1232
|
+
* # Arguments
|
|
1233
|
+
*
|
|
1234
|
+
* - `on_update` - A callback function invoked on update, which receives an
|
|
1235
|
+
* object with two keys: `port_id`, indicating which port the update was
|
|
1236
|
+
* triggered on, and `delta`, whose value is dependent on the mode
|
|
1237
|
+
* parameter.
|
|
1238
|
+
* - `options` - If this is provided as `OnUpdateOptions { mode:
|
|
1239
|
+
* Some(OnUpdateMode::Row) }`, then `delta` is an Arrow of the updated
|
|
1240
|
+
* rows. Otherwise `delta` will be [`Option::None`].
|
|
1241
|
+
*
|
|
1242
|
+
* # JavaScript Examples
|
|
1243
|
+
*
|
|
1244
|
+
* ```javascript
|
|
1245
|
+
* // Attach an `on_update` callback
|
|
1246
|
+
* view.on_update((updated) => console.log(updated.port_id));
|
|
1247
|
+
* ```
|
|
1248
|
+
*
|
|
1249
|
+
* ```javascript
|
|
1250
|
+
* // `on_update` with row deltas
|
|
1251
|
+
* view.on_update((updated) => console.log(updated.delta), { mode: "row" });
|
|
1252
|
+
* ```
|
|
1253
|
+
*/
|
|
1254
|
+
on_update(on_update_js: Function, options?: OnUpdateOptions | null): Promise<any>;
|
|
1255
|
+
/**
|
|
1256
|
+
* Unregister a previously registered [`View::on_delete`] callback.
|
|
1257
|
+
*/
|
|
1258
|
+
remove_delete(callback_id: number): Promise<any>;
|
|
1259
|
+
/**
|
|
1260
|
+
* Unregister a previously registered update callback with this [`View`].
|
|
1261
|
+
*
|
|
1262
|
+
* # Arguments
|
|
1263
|
+
*
|
|
1264
|
+
* - `id` - A callback `id` as returned by a recipricol call to
|
|
1265
|
+
* [`View::on_update`].
|
|
1266
|
+
*/
|
|
1267
|
+
remove_update(callback_id: number): Promise<void>;
|
|
1268
|
+
/**
|
|
1269
|
+
* The schema of this [`View`].
|
|
1270
|
+
*
|
|
1271
|
+
* The [`View`] schema differs from the `schema` returned by
|
|
1272
|
+
* [`Table::schema`]; it may have different column names due to
|
|
1273
|
+
* `expressions` or `columns` configs, or it maye have _different
|
|
1274
|
+
* column types_ due to the application og `group_by` and `aggregates`
|
|
1275
|
+
* config. You can think of [`Table::schema`] as the _input_ schema and
|
|
1276
|
+
* [`View::schema`] as the _output_ schema of a Perspective pipeline.
|
|
1277
|
+
*/
|
|
1278
|
+
schema(): Promise<any>;
|
|
1279
|
+
/**
|
|
1280
|
+
* Set expansion `depth` of the `group_by` tree.
|
|
1281
|
+
*/
|
|
1282
|
+
set_depth(depth: number): Promise<void>;
|
|
1283
|
+
/**
|
|
1284
|
+
* Serializes a [`View`] to the Apache Arrow data format.
|
|
1285
|
+
*/
|
|
1286
|
+
to_arrow(window?: ViewWindow | null): Promise<ArrayBuffer>;
|
|
1287
|
+
/**
|
|
1288
|
+
* Serializes this [`View`] to JavaScript objects in a column-oriented
|
|
1289
|
+
* format.
|
|
1290
|
+
*/
|
|
1291
|
+
to_columns(window?: ViewWindow | null): Promise<object>;
|
|
1292
|
+
/**
|
|
1293
|
+
* Serializes this [`View`] to a string of JSON data. Useful if you want to
|
|
1294
|
+
* save additional round trip serialize/deserialize cycles.
|
|
1295
|
+
*/
|
|
1296
|
+
to_columns_string(window?: ViewWindow | null): Promise<string>;
|
|
1297
|
+
/**
|
|
1298
|
+
* Serializes this [`View`] to CSV data in a standard format.
|
|
1299
|
+
*/
|
|
1300
|
+
to_csv(window?: ViewWindow | null): Promise<string>;
|
|
1301
|
+
/**
|
|
1302
|
+
* Serializes this [`View`] to JavaScript objects in a row-oriented
|
|
1303
|
+
* format.
|
|
1304
|
+
*/
|
|
1305
|
+
to_json(window?: ViewWindow | null): Promise<Array<any>>;
|
|
1306
|
+
/**
|
|
1307
|
+
* Render this `View` as a JSON string.
|
|
1308
|
+
*/
|
|
1309
|
+
to_json_string(window?: ViewWindow | null): Promise<string>;
|
|
1310
|
+
/**
|
|
1311
|
+
* Renders this [`View`] as an [NDJSON](https://github.com/ndjson/ndjson-spec)
|
|
1312
|
+
* formatted [`String`].
|
|
1313
|
+
*/
|
|
1314
|
+
to_ndjson(window?: ViewWindow | null): Promise<string>;
|
|
1315
|
+
}
|
|
1316
|
+
|
|
1317
|
+
export class VirtualDataSlice {
|
|
1318
|
+
free(): void;
|
|
1319
|
+
[Symbol.dispose](): void;
|
|
1320
|
+
constructor(config: ViewConfigUpdate);
|
|
1321
|
+
setBooleanCol(name: string, index: number, val: any, group_by_index?: number | null): void;
|
|
1322
|
+
setCol(dtype: string, name: string, index: number, val: any, group_by_index?: number | null): void;
|
|
1323
|
+
setDatetimeCol(name: string, index: number, val: any, group_by_index?: number | null): void;
|
|
1324
|
+
setFloatCol(name: string, index: number, val: any, group_by_index?: number | null): void;
|
|
1325
|
+
setIntegerCol(name: string, index: number, val: any, group_by_index?: number | null): void;
|
|
1326
|
+
setStringCol(name: string, index: number, val: any, group_by_index?: number | null): void;
|
|
1278
1327
|
}
|
|
1279
1328
|
|
|
1329
|
+
export class VirtualServer {
|
|
1330
|
+
free(): void;
|
|
1331
|
+
[Symbol.dispose](): void;
|
|
1332
|
+
handleRequest(bytes: Uint8Array): Promise<any>;
|
|
1333
|
+
constructor(handler: object);
|
|
1334
|
+
}
|
|
1335
|
+
|
|
1336
|
+
/**
|
|
1337
|
+
* Register this crate's Custom Elements in the browser's current session.
|
|
1338
|
+
*
|
|
1339
|
+
* This must occur before calling any public API methods on these Custom
|
|
1340
|
+
* Elements from JavaScript, as the methods themselves won't be defined yet.
|
|
1341
|
+
* By default, this crate does not register `PerspectiveViewerElement` (as to
|
|
1342
|
+
* preserve backwards-compatible synchronous API).
|
|
1343
|
+
*/
|
|
1344
|
+
export function init(): void;
|
|
1345
|
+
|
|
1346
|
+
/**
|
|
1347
|
+
* Register a plugin globally.
|
|
1348
|
+
*/
|
|
1349
|
+
export function registerPlugin(name: string): void;
|
|
1350
|
+
|
|
1280
1351
|
export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
|
|
1281
1352
|
|
|
1282
1353
|
export interface InitOutput {
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1354
|
+
readonly memory: WebAssembly.Memory;
|
|
1355
|
+
readonly __wbg_columndropdownelement_free: (a: number, b: number) => void;
|
|
1356
|
+
readonly __wbg_copydropdownmenuelement_free: (a: number, b: number) => void;
|
|
1357
|
+
readonly __wbg_filterdropdownelement_free: (a: number, b: number) => void;
|
|
1358
|
+
readonly __wbg_functiondropdownelement_free: (a: number, b: number) => void;
|
|
1359
|
+
readonly __wbg_perspectivedebugpluginelement_free: (a: number, b: number) => void;
|
|
1360
|
+
readonly __wbg_perspectiveviewerelement_free: (a: number, b: number) => void;
|
|
1361
|
+
readonly copydropdownmenuelement___set_model: (a: number, b: number) => void;
|
|
1362
|
+
readonly copydropdownmenuelement_connected_callback: (a: number) => void;
|
|
1363
|
+
readonly copydropdownmenuelement_hide: (a: number, b: number) => void;
|
|
1364
|
+
readonly copydropdownmenuelement_new: (a: number) => number;
|
|
1365
|
+
readonly copydropdownmenuelement_open: (a: number, b: number) => void;
|
|
1366
|
+
readonly exportdropdownmenuelement___set_model: (a: number, b: number) => void;
|
|
1367
|
+
readonly exportdropdownmenuelement_hide: (a: number, b: number) => void;
|
|
1368
|
+
readonly exportdropdownmenuelement_open: (a: number, b: number) => void;
|
|
1369
|
+
readonly init: () => void;
|
|
1370
|
+
readonly perspectivedebugpluginelement_clear: (a: number) => number;
|
|
1371
|
+
readonly perspectivedebugpluginelement_config_column_names: (a: number) => number;
|
|
1372
|
+
readonly perspectivedebugpluginelement_connectedCallback: (a: number) => void;
|
|
1373
|
+
readonly perspectivedebugpluginelement_draw: (a: number, b: number) => number;
|
|
1374
|
+
readonly perspectivedebugpluginelement_name: (a: number, b: number) => void;
|
|
1375
|
+
readonly perspectivedebugpluginelement_new: (a: number) => number;
|
|
1376
|
+
readonly perspectivedebugpluginelement_select_mode: (a: number, b: number) => void;
|
|
1377
|
+
readonly perspectiveviewerelement___get_model: (a: number) => number;
|
|
1378
|
+
readonly perspectiveviewerelement_connectedCallback: (a: number, b: number) => void;
|
|
1379
|
+
readonly perspectiveviewerelement_copy: (a: number, b: number) => number;
|
|
1380
|
+
readonly perspectiveviewerelement_delete: (a: number) => number;
|
|
1381
|
+
readonly perspectiveviewerelement_download: (a: number, b: number) => number;
|
|
1382
|
+
readonly perspectiveviewerelement_eject: (a: number) => number;
|
|
1383
|
+
readonly perspectiveviewerelement_export: (a: number, b: number) => number;
|
|
1384
|
+
readonly perspectiveviewerelement_flush: (a: number) => number;
|
|
1385
|
+
readonly perspectiveviewerelement_getAllPlugins: (a: number) => number;
|
|
1386
|
+
readonly perspectiveviewerelement_getClient: (a: number, b: number) => number;
|
|
1387
|
+
readonly perspectiveviewerelement_getEditPort: (a: number, b: number) => void;
|
|
1388
|
+
readonly perspectiveviewerelement_getPlugin: (a: number, b: number, c: number, d: number) => void;
|
|
1389
|
+
readonly perspectiveviewerelement_getRenderStats: (a: number, b: number) => void;
|
|
1390
|
+
readonly perspectiveviewerelement_getSelection: (a: number) => number;
|
|
1391
|
+
readonly perspectiveviewerelement_getTable: (a: number, b: number) => number;
|
|
1392
|
+
readonly perspectiveviewerelement_getView: (a: number) => number;
|
|
1393
|
+
readonly perspectiveviewerelement_getViewConfig: (a: number) => number;
|
|
1394
|
+
readonly perspectiveviewerelement_load: (a: number, b: number, c: number) => void;
|
|
1395
|
+
readonly perspectiveviewerelement_new: (a: number) => number;
|
|
1396
|
+
readonly perspectiveviewerelement_openColumnSettings: (a: number, b: number, c: number, d: number) => number;
|
|
1397
|
+
readonly perspectiveviewerelement_reset: (a: number, b: number) => number;
|
|
1398
|
+
readonly perspectiveviewerelement_resetError: (a: number) => number;
|
|
1399
|
+
readonly perspectiveviewerelement_resetThemes: (a: number, b: number, c: number) => number;
|
|
1400
|
+
readonly perspectiveviewerelement_resize: (a: number, b: number) => number;
|
|
1401
|
+
readonly perspectiveviewerelement_restore: (a: number, b: number) => number;
|
|
1402
|
+
readonly perspectiveviewerelement_restyleElement: (a: number) => number;
|
|
1403
|
+
readonly perspectiveviewerelement_save: (a: number) => number;
|
|
1404
|
+
readonly perspectiveviewerelement_setAutoPause: (a: number, b: number) => void;
|
|
1405
|
+
readonly perspectiveviewerelement_setAutoSize: (a: number, b: number) => void;
|
|
1406
|
+
readonly perspectiveviewerelement_setSelection: (a: number, b: number, c: number) => void;
|
|
1407
|
+
readonly perspectiveviewerelement_setThrottle: (a: number, b: number, c: number) => void;
|
|
1408
|
+
readonly perspectiveviewerelement_toggleColumnSettings: (a: number, b: number, c: number) => number;
|
|
1409
|
+
readonly perspectiveviewerelement_toggleConfig: (a: number, b: number) => number;
|
|
1410
|
+
readonly registerPlugin: (a: number, b: number) => void;
|
|
1411
|
+
readonly perspectivedebugpluginelement_update: (a: number, b: number) => number;
|
|
1412
|
+
readonly perspectivedebugpluginelement_min_config_columns: (a: number) => number;
|
|
1413
|
+
readonly perspectivedebugpluginelement_save: (a: number) => number;
|
|
1414
|
+
readonly perspectivedebugpluginelement_delete: (a: number) => number;
|
|
1415
|
+
readonly perspectivedebugpluginelement_resize: (a: number) => number;
|
|
1416
|
+
readonly perspectivedebugpluginelement_restore: (a: number) => number;
|
|
1417
|
+
readonly perspectivedebugpluginelement_restyle: (a: number) => number;
|
|
1418
|
+
readonly exportdropdownmenuelement_new: (a: number) => number;
|
|
1419
|
+
readonly __wbg_exportdropdownmenuelement_free: (a: number, b: number) => void;
|
|
1420
|
+
readonly exportdropdownmenuelement_connected_callback: (a: number) => void;
|
|
1421
|
+
readonly __wbg_client_free: (a: number, b: number) => void;
|
|
1422
|
+
readonly __wbg_genericsqlvirtualservermodel_free: (a: number, b: number) => void;
|
|
1423
|
+
readonly __wbg_proxysession_free: (a: number, b: number) => void;
|
|
1424
|
+
readonly __wbg_table_free: (a: number, b: number) => void;
|
|
1425
|
+
readonly __wbg_view_free: (a: number, b: number) => void;
|
|
1426
|
+
readonly __wbg_virtualdataslice_free: (a: number, b: number) => void;
|
|
1427
|
+
readonly __wbg_virtualserver_free: (a: number, b: number) => void;
|
|
1428
|
+
readonly client___getClassname: (a: number, b: number) => void;
|
|
1429
|
+
readonly client_get_hosted_table_names: (a: number) => number;
|
|
1430
|
+
readonly client_handle_error: (a: number, b: number, c: number, d: number) => number;
|
|
1431
|
+
readonly client_handle_response: (a: number, b: number) => number;
|
|
1432
|
+
readonly client_new: (a: number, b: number, c: number) => void;
|
|
1433
|
+
readonly client_new_proxy_session: (a: number, b: number) => number;
|
|
1434
|
+
readonly client_on_error: (a: number, b: number) => number;
|
|
1435
|
+
readonly client_on_hosted_tables_update: (a: number, b: number) => number;
|
|
1436
|
+
readonly client_open_table: (a: number, b: number, c: number) => number;
|
|
1437
|
+
readonly client_remove_hosted_tables_update: (a: number, b: number) => number;
|
|
1438
|
+
readonly client_system_info: (a: number) => number;
|
|
1439
|
+
readonly client_table: (a: number, b: number, c: number) => number;
|
|
1440
|
+
readonly client_terminate: (a: number, b: number) => void;
|
|
1441
|
+
readonly genericsqlvirtualservermodel_getHostedTables: (a: number, b: number) => void;
|
|
1442
|
+
readonly genericsqlvirtualservermodel_new: (a: number, b: number) => void;
|
|
1443
|
+
readonly genericsqlvirtualservermodel_tableMakeView: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
|
|
1444
|
+
readonly genericsqlvirtualservermodel_tableSchema: (a: number, b: number, c: number, d: number) => void;
|
|
1445
|
+
readonly genericsqlvirtualservermodel_tableSize: (a: number, b: number, c: number, d: number) => void;
|
|
1446
|
+
readonly genericsqlvirtualservermodel_tableValidateExpression: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
1447
|
+
readonly genericsqlvirtualservermodel_viewColumnSize: (a: number, b: number, c: number, d: number) => void;
|
|
1448
|
+
readonly genericsqlvirtualservermodel_viewDelete: (a: number, b: number, c: number, d: number) => void;
|
|
1449
|
+
readonly genericsqlvirtualservermodel_viewGetData: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
|
|
1450
|
+
readonly genericsqlvirtualservermodel_viewSchema: (a: number, b: number, c: number, d: number) => void;
|
|
1451
|
+
readonly genericsqlvirtualservermodel_viewSize: (a: number, b: number, c: number, d: number) => void;
|
|
1452
|
+
readonly proxysession_close: (a: number) => number;
|
|
1453
|
+
readonly proxysession_handle_request: (a: number, b: number) => number;
|
|
1454
|
+
readonly proxysession_new: (a: number, b: number) => number;
|
|
1455
|
+
readonly table___getClassname: (a: number, b: number) => void;
|
|
1456
|
+
readonly table_clear: (a: number) => number;
|
|
1457
|
+
readonly table_columns: (a: number) => number;
|
|
1458
|
+
readonly table_delete: (a: number, b: number) => number;
|
|
1459
|
+
readonly table_get_client: (a: number) => number;
|
|
1460
|
+
readonly table_get_index: (a: number) => number;
|
|
1461
|
+
readonly table_get_limit: (a: number) => number;
|
|
1462
|
+
readonly table_get_name: (a: number) => number;
|
|
1463
|
+
readonly table_make_port: (a: number) => number;
|
|
1464
|
+
readonly table_on_delete: (a: number, b: number) => number;
|
|
1465
|
+
readonly table_remove: (a: number, b: number, c: number) => number;
|
|
1466
|
+
readonly table_remove_delete: (a: number, b: number) => number;
|
|
1467
|
+
readonly table_replace: (a: number, b: number, c: number) => number;
|
|
1468
|
+
readonly table_schema: (a: number) => number;
|
|
1469
|
+
readonly table_size: (a: number) => number;
|
|
1470
|
+
readonly table_update: (a: number, b: number, c: number) => number;
|
|
1471
|
+
readonly table_validate_expressions: (a: number, b: number) => number;
|
|
1472
|
+
readonly table_view: (a: number, b: number) => number;
|
|
1473
|
+
readonly view___get_model: (a: number) => number;
|
|
1474
|
+
readonly view_collapse: (a: number, b: number) => number;
|
|
1475
|
+
readonly view_column_paths: (a: number, b: number) => number;
|
|
1476
|
+
readonly view_delete: (a: number) => number;
|
|
1477
|
+
readonly view_dimensions: (a: number) => number;
|
|
1478
|
+
readonly view_expand: (a: number, b: number) => number;
|
|
1479
|
+
readonly view_expression_schema: (a: number) => number;
|
|
1480
|
+
readonly view_get_config: (a: number) => number;
|
|
1481
|
+
readonly view_get_min_max: (a: number, b: number, c: number) => number;
|
|
1482
|
+
readonly view_num_columns: (a: number) => number;
|
|
1483
|
+
readonly view_num_rows: (a: number) => number;
|
|
1484
|
+
readonly view_on_delete: (a: number, b: number) => number;
|
|
1485
|
+
readonly view_on_update: (a: number, b: number, c: number) => number;
|
|
1486
|
+
readonly view_remove_delete: (a: number, b: number) => number;
|
|
1487
|
+
readonly view_remove_update: (a: number, b: number) => number;
|
|
1488
|
+
readonly view_schema: (a: number) => number;
|
|
1489
|
+
readonly view_set_depth: (a: number, b: number) => number;
|
|
1490
|
+
readonly view_to_arrow: (a: number, b: number) => number;
|
|
1491
|
+
readonly view_to_columns: (a: number, b: number) => number;
|
|
1492
|
+
readonly view_to_columns_string: (a: number, b: number) => number;
|
|
1493
|
+
readonly view_to_csv: (a: number, b: number) => number;
|
|
1494
|
+
readonly view_to_json: (a: number, b: number) => number;
|
|
1495
|
+
readonly view_to_json_string: (a: number, b: number) => number;
|
|
1496
|
+
readonly view_to_ndjson: (a: number, b: number) => number;
|
|
1497
|
+
readonly virtualdataslice_new: (a: number) => number;
|
|
1498
|
+
readonly virtualdataslice_setBooleanCol: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
|
|
1499
|
+
readonly virtualdataslice_setCol: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => void;
|
|
1500
|
+
readonly virtualdataslice_setDatetimeCol: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
|
|
1501
|
+
readonly virtualdataslice_setFloatCol: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
|
|
1502
|
+
readonly virtualdataslice_setIntegerCol: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
|
|
1503
|
+
readonly virtualdataslice_setStringCol: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
|
|
1504
|
+
readonly virtualserver_handleRequest: (a: number, b: number, c: number) => number;
|
|
1505
|
+
readonly virtualserver_new: (a: number, b: number) => void;
|
|
1506
|
+
readonly __wasm_bindgen_func_elem_13482: (a: number, b: number) => void;
|
|
1507
|
+
readonly __wasm_bindgen_func_elem_3123: (a: number, b: number) => void;
|
|
1508
|
+
readonly __wasm_bindgen_func_elem_3124: (a: number, b: number) => void;
|
|
1509
|
+
readonly __wasm_bindgen_func_elem_18167: (a: number, b: number) => void;
|
|
1510
|
+
readonly __wasm_bindgen_func_elem_18937: (a: number, b: number) => void;
|
|
1511
|
+
readonly __wasm_bindgen_func_elem_18961: (a: number, b: number) => void;
|
|
1512
|
+
readonly __wasm_bindgen_func_elem_20888: (a: number, b: number, c: number, d: number) => void;
|
|
1513
|
+
readonly __wasm_bindgen_func_elem_5237: (a: number, b: number, c: number) => void;
|
|
1514
|
+
readonly __wasm_bindgen_func_elem_5238: (a: number, b: number, c: number) => void;
|
|
1515
|
+
readonly __wasm_bindgen_func_elem_5235: (a: number, b: number, c: number) => void;
|
|
1516
|
+
readonly __wasm_bindgen_func_elem_18286: (a: number, b: number, c: number) => void;
|
|
1517
|
+
readonly __wasm_bindgen_func_elem_18978: (a: number, b: number, c: number) => void;
|
|
1518
|
+
readonly __wasm_bindgen_func_elem_14371: (a: number, b: number) => number;
|
|
1519
|
+
readonly __wasm_bindgen_func_elem_18940: (a: number, b: number) => void;
|
|
1520
|
+
readonly __wbindgen_export: (a: number, b: number) => number;
|
|
1521
|
+
readonly __wbindgen_export2: (a: number, b: number, c: number, d: number) => number;
|
|
1522
|
+
readonly __wbindgen_export3: (a: number) => void;
|
|
1523
|
+
readonly __wbindgen_export4: (a: number, b: number, c: number) => void;
|
|
1524
|
+
readonly __wbindgen_add_to_stack_pointer: (a: number) => number;
|
|
1442
1525
|
}
|
|
1443
1526
|
|
|
1444
1527
|
export type SyncInitInput = BufferSource | WebAssembly.Module;
|
|
1528
|
+
|
|
1445
1529
|
/**
|
|
1446
|
-
* Instantiates the given `module`, which can either be bytes or
|
|
1447
|
-
* a precompiled `WebAssembly.Module`.
|
|
1448
|
-
*
|
|
1449
|
-
* @param {{ module: SyncInitInput }} module - Passing `SyncInitInput` directly is deprecated.
|
|
1450
|
-
*
|
|
1451
|
-
* @returns {InitOutput}
|
|
1452
|
-
*/
|
|
1530
|
+
* Instantiates the given `module`, which can either be bytes or
|
|
1531
|
+
* a precompiled `WebAssembly.Module`.
|
|
1532
|
+
*
|
|
1533
|
+
* @param {{ module: SyncInitInput }} module - Passing `SyncInitInput` directly is deprecated.
|
|
1534
|
+
*
|
|
1535
|
+
* @returns {InitOutput}
|
|
1536
|
+
*/
|
|
1453
1537
|
export function initSync(module: { module: SyncInitInput } | SyncInitInput): InitOutput;
|
|
1454
1538
|
|
|
1455
1539
|
/**
|
|
1456
|
-
* If `module_or_path` is {RequestInfo} or {URL}, makes a request and
|
|
1457
|
-
* for everything else, calls `WebAssembly.instantiate` directly.
|
|
1458
|
-
*
|
|
1459
|
-
* @param {{ module_or_path: InitInput | Promise<InitInput> }} module_or_path - Passing `InitInput` directly is deprecated.
|
|
1460
|
-
*
|
|
1461
|
-
* @returns {Promise<InitOutput>}
|
|
1462
|
-
*/
|
|
1540
|
+
* If `module_or_path` is {RequestInfo} or {URL}, makes a request and
|
|
1541
|
+
* for everything else, calls `WebAssembly.instantiate` directly.
|
|
1542
|
+
*
|
|
1543
|
+
* @param {{ module_or_path: InitInput | Promise<InitInput> }} module_or_path - Passing `InitInput` directly is deprecated.
|
|
1544
|
+
*
|
|
1545
|
+
* @returns {Promise<InitOutput>}
|
|
1546
|
+
*/
|
|
1463
1547
|
export default function __wbg_init (module_or_path: { module_or_path: InitInput | Promise<InitInput> } | InitInput | Promise<InitInput>): Promise<InitOutput>;
|