import * as instance from './local-instance.js'; export interface ConnectConfig { wasmModule: Promise; forbidTcp: boolean; forbidWs: boolean; forbidNonLocalWs: boolean; forbidWss: boolean; forbidWebRtc: boolean; maxLogLevel: number; cpuRateLimit: number; portToServer: MessagePort; eventCallback: (event: instance.Event) => void; } export declare function connectToInstanceServer(config: ConnectConfig): Promise; /** * Configuration for {@link startInstanceServer}. */ export interface ServerConfig { /** * Environment variables that the instance can pull. */ envVars: string[]; /** * Returns the number of milliseconds since an arbitrary epoch. */ performanceNow: () => number; /** * Fills the given buffer with randomly-generated bytes. */ getRandomValues: (buffer: Uint8Array) => void; } /** * Returns a `Promise` that resolves when the instance shuts down. Since the function is also * an asynchronous function, the actual return type is `Promise>`. That is, the * outer `Promise` yields once the instance starts, and the inner `Promise` yields once the * instance shuts down. */ export declare function startInstanceServer(config: ServerConfig, initPortToClient: MessagePort): Promise>;