export type * from "../../dist/wasm/perspective-js.d.ts"; export type * from "./virtual_server.ts"; import { WebSocketServer as HttpWebSocketServer } from "ws"; import http from "node:http"; import * as perspective_client from "../../dist/wasm/perspective-js.js"; import * as engine from "./wasm/engine.ts"; import * as virtual_server from "./virtual_server.ts"; export { GenericSQLVirtualServerModel, VirtualDataSlice, VirtualServer, } from "../../dist/wasm/perspective-js.js"; export declare class PerspectiveServer extends engine.PerspectiveServer { constructor(options?: engine.PerspectiveServerOptions); } export declare const make_session: (send_response: (buffer: Uint8Array) => Promise) => Promise; export declare function make_client(send_request: (buffer: Uint8Array) => Promise, close?: Function): perspective_client.Client; /** * Host a Perspective server that hosts data, code files, etc. * Strip version numbers from the URL so we can handle CDN-like requests * of the form @[^~]major.minor.patch when testing local versions of * Perspective against Voila. */ export declare function cwd_static_file_handler(request: http.IncomingMessage, response: http.ServerResponse, assets?: string[], { debug }?: { debug?: boolean | undefined; }): Promise; /** * A simple Node `http`-based WebSocket adapter that exposes a * `PerspectiveServer` over the wire. * * @remarks * * **Security.** `WebSocketServer` is a reference integration with no * authentication, authorization, origin enforcement, or rate limiting, and * is not safe to expose to untrusted networks — see * [`SECURITY.md`](https://github.com/perspective-dev/perspective/blob/master/SECURITY.md) * for the full threat model. */ export declare class WebSocketServer { _server: http.Server | any; _wss: HttpWebSocketServer; constructor({ port, assets, server }?: { port?: number | undefined; assets?: string[] | undefined; server?: undefined; }); close(): Promise; } export declare function get_hosted_table_names(): Promise; export declare function on_hosted_tables_update(cb: () => void): Promise; export declare function remove_hosted_tables_update(id: number): Promise; export declare function system_info(): Promise; export declare function on_error(callback: Function): Promise; /** * Create a read-only table from a JOIN of two source tables. * @param left - The left source table (a Table instance or a table name string). * @param right - The right source table (a Table instance or a table name string). * @param on * @param options - Optional join configuration: { join_type?: "inner"|"left"|"outer", name?: string } * @returns */ export declare function join(left: perspective_client.Table | string, right: perspective_client.Table | string, on: string, options?: perspective_client.JoinOptions): Promise; /** * Create a table from the global Perspective instance. * @param init_data * @param options * @returns */ export declare function table(init_data: string | ArrayBuffer | Record | Record[], options?: perspective_client.TableInitOptions): Promise; /** * Create a new client connected via WebSocket to a server implemnting the * Perspective Protocol. * @param module * @param url * @returns */ export declare function websocket(url: string): Promise; export declare function worker(worker: Promise): Promise; export declare function createMessageHandler(handler: virtual_server.VirtualServerHandler): MessagePort; /** * The initialized WASM module. Use this when you need to pass the module * to components that require it, such as `DuckDBHandler`. */ export { perspective_client as wasmModule }; declare const _default: { table: typeof table; join: typeof join; websocket: typeof websocket; worker: typeof worker; get_hosted_table_names: typeof get_hosted_table_names; on_hosted_tables_update: typeof on_hosted_tables_update; remove_hosted_tables_update: typeof remove_hosted_tables_update; on_error: typeof on_error; system_info: typeof system_info; WebSocketServer: typeof WebSocketServer; GenericSQLVirtualServerModel: typeof perspective_client.GenericSQLVirtualServerModel; VirtualDataSlice: typeof perspective_client.VirtualDataSlice; VirtualServer: typeof perspective_client.VirtualServer; }; export default _default;