import type { EdictHostAdapter } from "./host-adapter.js"; import type { RunResult, RunLimits } from "./runner.js"; export type { RunResult, RunLimits }; /** Options for browser-specific execution. */ export interface BrowserRunLimits { /** Max execution time in ms (default: 15_000, min: 100). */ timeoutMs?: number; /** Max WASM memory in MB (compile-time, default: 1). */ maxMemoryMb?: number; /** Optional host adapter. Defaults to BrowserHostAdapter. */ adapter?: EdictHostAdapter; /** External WASM modules keyed by import namespace (base64-encoded). */ externalModules?: Record; } /** * Direct (in-process) browser WASM execution — no Web Worker, no timeout. * * Uses the browser's native WebAssembly API. All host imports are provided * via `BrowserHostAdapter` (or a custom adapter). * * @param wasm - WASM binary (Uint8Array from codegen) * @param entryFn - Function to call (default: "main") * @param limits - Optional execution limits */ export declare function runBrowserDirect(wasm: Uint8Array, entryFn?: string, limits?: BrowserRunLimits): Promise; /** * Execute WASM in a Web Worker with timeout enforcement. * * Creates an inline Web Worker via Blob URL that runs a minimal WASM executor. * If execution exceeds the timeout, the worker is terminated. * * **Limitation**: The Worker sandbox includes only basic host functions: * print, string ops, int/float_to_string, panic, exit, random_int, time_now. * Programs using crypto, HTTP, file IO, or other domain builtins should use * `runBrowserDirect()` instead, which has the full host import set via * `createHostImports()`. * * **Note**: Requires a browser environment with Web Worker support. * In environments without `Worker` (e.g., Node.js vitest), falls back to * `runBrowserDirect()`. * * @param wasm - WASM binary (Uint8Array from codegen) * @param entryFn - Function to call (default: "main") * @param limits - Execution limits (timeout, adapter) */ export declare function runBrowser(wasm: Uint8Array, entryFn?: string, limits?: BrowserRunLimits): Promise; //# sourceMappingURL=browser-runner.d.ts.map