/** Configuration for the generated Worker. */ export interface WorkerConfig { /** Worker name — used in wrangler.toml and the deployment URL. */ name: string; /** Wrangler compatibility date (default: "2024-01-01"). */ compatibilityDate?: string; /** Optional KV namespace bindings. */ kvNamespaces?: { binding: string; id: string; }[]; } /** A single file in the generated Worker bundle. */ export interface WorkerBundleFile { /** Relative path within the bundle (e.g., "worker.js"). */ path: string; /** File content — string for text files, Uint8Array for binary. */ content: string | Uint8Array; } /** A deployable Worker bundle — a set of files ready for `wrangler deploy`. */ export interface WorkerBundle { files: WorkerBundleFile[]; } /** Result of scaffold generation. */ export type ScaffoldResult = { ok: true; bundle: WorkerBundle; } | { ok: false; error: string; }; /** * Generate a deployable Cloudflare Worker bundle from compiled WASM. * * The bundle contains: * - `worker.js` — ES Module Worker entry point with all host imports inline * - `program.wasm` — the compiled WASM binary * - `wrangler.toml` — Wrangler v3 configuration * * Host functions in worker.js are derived from the ALL_BUILTINS registry at * generation time, matching CloudflareHostAdapter's behavior: * - Crypto: returns empty strings (async Workers crypto.subtle unusable in sync) * - HTTP: returns structured Result Err values * - IO: returns structured errors (KV is async) * - env: reads from Workers environment bindings * * @param wasm - Compiled WASM binary (Uint8Array from codegen) * @param config - Worker configuration * @returns ScaffoldResult with the bundle or an error */ export declare function generateWorkerScaffold(wasm: Uint8Array, config: WorkerConfig): ScaffoldResult; /** * Get the list of host builtin names included in the generated Worker script. * Useful for testing and verification. */ export declare function getHostBuiltinNames(): readonly string[]; //# sourceMappingURL=scaffold.d.ts.map