wasmrs-js
Version:
A JavaScript implementation of the RSocket protocol over WebAssembly.
27 lines (26 loc) • 958 B
TypeScript
import { ClientTransport, Closeable, Demultiplexer, DuplexConnection, FrameHandler, Multiplexer, Outbound } from 'rsocket-core';
import { OperationList, Options, WasmRsModule } from './wasmrs';
import { WasiOptions } from './wasi';
export interface SetupResponse {
success: boolean;
operations: OperationList;
}
export interface SetupRequest {
module: WasmRsModule;
wasi?: WasiOptions;
}
export type ClientOptions = {
options?: Options;
module: WasmRsModule;
wasi?: WasiOptions;
workerUrl: string | URL;
workerFactory?: () => Promise<Worker>;
debug?: boolean;
};
export declare class WorkerClientTransport implements ClientTransport {
private readonly factory;
module: WasmRsModule;
wasiOptions?: WasiOptions;
constructor(options: ClientOptions);
connect(multiplexerDemultiplexerFactory: (outbound: Outbound & Closeable) => Multiplexer & Demultiplexer & FrameHandler): Promise<DuplexConnection>;
}