vegafusion-wasm
Version:
VegaFusion WASM package for embedding Vega charts in the browser with a connection to a VegaFusion Runtime
163 lines (162 loc) • 3.98 kB
TypeScript
/* tslint:disable */
/* eslint-disable */
/**
* Embed a Vega chart and accelerate with VegaFusion
* @param element - The DOM element to embed the visualization into
* @param spec - The Vega specification (as string or object)
* @param config - Optional configuration options
* @param query_fn - Function to handle server-side query requests.
* If not provided, an embedded wasm VegaFusion runtime is created.
* @returns A ChartHandle instance for the embedded visualization
* @param {Element} element
* @param {any} spec
* @param {any} config
* @param {any} query_fn
* @returns {Promise<ChartHandle>}
*/
export function vegaFusionEmbed(element: Element, spec: any, config: any, query_fn: any): Promise<ChartHandle>;
/**
* @param {any} spec
* @returns {any}
*/
export function getColumnUsage(spec: any): any;
/**
* Create a function for sending VegaFusion queries to VegaFusion server over gRPC-Web
* @param client - The gRPC client instance
* @param hostname - The hostname to connect to
* @returns A function that can be used to send gRPC messages
* @param {any} client
* @param {string} hostname
* @returns {Function}
*/
export function makeGrpcSendMessageFn(client: any, hostname: string): Function;
/**
* Handle to an embedded VegaFusion chart
*/
export class ChartHandle {
free(): void;
/**
* Get the Vega-Embed view
* @returns The Vega-Embed view
* @returns {any}
*/
view(): any;
/**
* Finalize the chart
*/
finalize(): void;
/**
* Get the client specification
* @returns The client specification
* @returns {any}
*/
clientSpec(): any;
/**
* Get the server specification
* @returns The server specification
* @returns {any}
*/
serverSpec(): any;
/**
* Get the communication plan
* @returns The communication plan
* @returns {any}
*/
commPlan(): any;
}
export class IntoUnderlyingByteSource {
free(): void;
/**
* @param {ReadableByteStreamController} controller
*/
start(controller: ReadableByteStreamController): void;
/**
* @param {ReadableByteStreamController} controller
* @returns {Promise<any>}
*/
pull(controller: ReadableByteStreamController): Promise<any>;
cancel(): void;
readonly autoAllocateChunkSize: number;
readonly type: any;
}
export class IntoUnderlyingSink {
free(): void;
/**
* @param {any} chunk
* @returns {Promise<any>}
*/
write(chunk: any): Promise<any>;
/**
* @returns {Promise<any>}
*/
close(): Promise<any>;
/**
* @param {any} reason
* @returns {Promise<any>}
*/
abort(reason: any): Promise<any>;
}
export class IntoUnderlyingSource {
free(): void;
/**
* @param {ReadableStreamDefaultController} controller
* @returns {Promise<any>}
*/
pull(controller: ReadableStreamDefaultController): Promise<any>;
cancel(): void;
}
export class WasmGetOptions {
free(): void;
}
export class WasmObjectMeta {
/**
** Return copy of self without private attributes.
*/
toJSON(): Object;
/**
* Return stringified version of self.
*/
toString(): string;
free(): void;
/**
* The unique identifier for the object
*
* <https://datatracker.ietf.org/doc/html/rfc9110#name-etag>
*/
e_tag?: string;
/**
* The last modified time
*/
last_modified: Date;
/**
* The full path to the object
*/
location: string;
/**
* The size in bytes of the object
*/
size: number;
/**
* A version indicator for this object
*/
version?: string;
}
export class WasmObjectStore {
free(): void;
/**
* @param {string} url
* @param {object | undefined} [options]
*/
constructor(url: string, options?: object);
/**
* @param {string} location
* @param {WasmGetOptions | undefined} [options]
* @returns {Promise<ReadableStream>}
*/
get(location: string, options?: WasmGetOptions): Promise<ReadableStream>;
/**
* @param {string | undefined} [prefix]
* @returns {Promise<ReadableStream>}
*/
list(prefix?: string): Promise<ReadableStream>;
}