@perspective-dev/client 4.5.1 → 5.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cdn/perspective-server.worker.js +1 -1
- package/dist/cdn/perspective-server.worker.js.map +3 -3
- package/dist/cdn/perspective.js +2 -2
- package/dist/cdn/perspective.js.map +4 -4
- package/dist/esm/perspective.browser.d.ts +50 -1
- package/dist/esm/perspective.inline.js +2 -2
- package/dist/esm/perspective.inline.js.map +4 -4
- package/dist/esm/perspective.js +2 -2
- package/dist/esm/perspective.js.map +4 -4
- package/dist/esm/perspective.node.d.ts +3 -0
- package/dist/esm/perspective.node.js +328 -25
- package/dist/esm/perspective.node.js.map +4 -4
- package/dist/esm/ts-rs/TableInitOptions.d.ts +6 -0
- package/dist/esm/virtual_servers/clickhouse.js +1 -1
- package/dist/esm/virtual_servers/clickhouse.js.map +2 -2
- package/dist/esm/virtual_servers/duckdb.js +1 -1
- package/dist/esm/virtual_servers/duckdb.js.map +2 -2
- package/dist/esm/wasm/emscripten_api.d.ts +14 -1
- package/dist/esm/wasm/engine.d.ts +11 -1
- package/dist/esm/wasm/features.d.ts +4 -0
- package/dist/wasm/perspective-js.d.ts +5 -5
- package/dist/wasm/perspective-js.js +9 -9
- package/dist/wasm/perspective-js.wasm +0 -0
- package/dist/wasm/perspective-js.wasm.d.ts +5 -5
- package/package.json +1 -1
- package/src/rust/typed_array.rs +88 -54
- package/src/ts/perspective.browser.ts +176 -20
- package/src/ts/perspective.cdn.ts +11 -5
- package/src/ts/perspective.node.ts +157 -5
- package/src/ts/ts-rs/TableInitOptions.ts +7 -1
- package/src/ts/virtual_servers/clickhouse.ts +1 -0
- package/src/ts/virtual_servers/duckdb.ts +3 -1
- package/src/ts/wasm/cdn.ts +32 -0
- package/src/ts/wasm/emscripten_api.ts +25 -0
- package/src/ts/wasm/engine.ts +59 -12
- package/src/ts/wasm/features.ts +31 -0
- package/src/ts/wasm/perspective-server.poly.ts +173 -3
|
@@ -2,9 +2,57 @@ export type * from "../../dist/wasm/perspective-js.d.ts";
|
|
|
2
2
|
import type * as psp from "../../dist/wasm/perspective-js.d.ts";
|
|
3
3
|
export type * from "./virtual_server.ts";
|
|
4
4
|
import * as psp_virtual from "./virtual_server.ts";
|
|
5
|
+
import { host_supports_memory64 } from "./wasm/features.ts";
|
|
6
|
+
export { host_supports_memory64 } from "./wasm/features.ts";
|
|
5
7
|
export { GenericSQLVirtualServerModel, VirtualDataSlice, VirtualServer, } from "../../dist/wasm/perspective-js.js";
|
|
8
|
+
/**
|
|
9
|
+
* A single Perspective engine binary, in any form `init_server` accepts.
|
|
10
|
+
* Thunk sources are only invoked if selected — register both bitnesses as
|
|
11
|
+
* `() => fetch(...)` and only the winning binary is ever downloaded.
|
|
12
|
+
*/
|
|
13
|
+
export type ServerWasmSource = Uint8Array | ArrayBuffer | Response | WebAssembly.Module | Promise<ArrayBuffer | Response | WebAssembly.Module> | (() => Promise<ArrayBuffer | Response | WebAssembly.Module>);
|
|
14
|
+
/**
|
|
15
|
+
* Engine binaries by bitness. Registering `wasm64` is the opt-in for the
|
|
16
|
+
* Memory64 engine (4GB heap ceiling raised to 16GB, at some engine
|
|
17
|
+
* performance cost) — it is selected whenever the host supports Memory64.
|
|
18
|
+
*/
|
|
19
|
+
export interface ServerWasmRegistration {
|
|
20
|
+
wasm32?: ServerWasmSource;
|
|
21
|
+
wasm64?: ServerWasmSource;
|
|
22
|
+
}
|
|
23
|
+
export interface InitServerOptions {
|
|
24
|
+
disable_stage_0?: boolean;
|
|
25
|
+
}
|
|
6
26
|
export declare function createMessageHandler(handler: psp_virtual.VirtualServerHandler): Promise<MessagePort>;
|
|
7
|
-
|
|
27
|
+
/**
|
|
28
|
+
* Register the Perspective engine ("server") WebAssembly binary that backs
|
|
29
|
+
* `worker()`.
|
|
30
|
+
*
|
|
31
|
+
* The single-argument form registers one binary of either bitness. The
|
|
32
|
+
* object form registers a wasm32 and/or wasm64 (Memory64) binary; the wasm64
|
|
33
|
+
* binary is preferred whenever the host supports Memory64, raising the
|
|
34
|
+
* engine's heap ceiling from 4GB to 16GB (at some engine performance cost —
|
|
35
|
+
* register only `wasm32` to opt out). Sources registered as thunks are only
|
|
36
|
+
* invoked if selected, so the losing binary is never downloaded; if the
|
|
37
|
+
* selected wasm64 source fails to load and a wasm32 source is also
|
|
38
|
+
* registered, selection falls back to wasm32 with a console warning.
|
|
39
|
+
*
|
|
40
|
+
* Selection and download are deferred to the first `worker()` call.
|
|
41
|
+
*
|
|
42
|
+
* # Examples
|
|
43
|
+
*
|
|
44
|
+
* ```javascript
|
|
45
|
+
* perspective.init_server(
|
|
46
|
+
* fetch("perspective-server.wasm"),
|
|
47
|
+
* );
|
|
48
|
+
*
|
|
49
|
+
* perspective.init_server({
|
|
50
|
+
* wasm32: () => fetch("perspective-server.wasm"),
|
|
51
|
+
* wasm64: () => fetch("perspective-server.memory64.wasm"),
|
|
52
|
+
* });
|
|
53
|
+
* ```
|
|
54
|
+
*/
|
|
55
|
+
export declare function init_server(wasm: ServerWasmSource | ServerWasmRegistration, options?: boolean | InitServerOptions): void;
|
|
8
56
|
export type PerspectiveWasm = ArrayBuffer | Response | typeof psp | Promise<ArrayBuffer | Response | Object>;
|
|
9
57
|
export declare function init_client(wasm: PerspectiveWasm, disable_stage_0?: boolean): void;
|
|
10
58
|
/**
|
|
@@ -32,6 +80,7 @@ declare const _default: {
|
|
|
32
80
|
worker: typeof worker;
|
|
33
81
|
init_client: typeof init_client;
|
|
34
82
|
init_server: typeof init_server;
|
|
83
|
+
host_supports_memory64: typeof host_supports_memory64;
|
|
35
84
|
createMessageHandler: typeof createMessageHandler;
|
|
36
85
|
getCompiledClientWasm: typeof getCompiledClientWasm;
|
|
37
86
|
GenericSQLVirtualServerModel: typeof psp.GenericSQLVirtualServerModel;
|