/** * The screen VM, on a WebAssembly module the host compiled at deploy time. * * The default engine is the SINGLE-FILE build, where the WebAssembly rides * inside the JavaScript as a base64 string and is compiled from those bytes at * runtime (contract/genui/component/boot.ts:73-88). workerd does not allow that: * a Worker may only instantiate a `WebAssembly.Module` that its own deployment * imported. So the edge leg takes the module as an ARGUMENT and wraps the * wasmfile variant around it — the platform's import stays the platform's, and * this package never touches a `.wasm` file. * * ONE VARIANT PER ISOLATE, held right here at module scope. `warmScreenEngine` * memoizes an engine per variant in an unbounded `Map` with no eviction * (boot.ts:68), so a host that built a fresh variant per request would leak a * whole QuickJS module every time. A module-level slot makes that unreachable: * a deployment has one `.wasm`, so it gets one variant and one engine, whatever * a caller does with `edgeToolchain`. */ import { type CustomizeVariantOptions } from "quickjs-emscripten-core"; import { type ScreenBudget, type ScreenEngineVariant } from "../../contract/genui/component/index.js"; import type { ScreenPaintInput, ScreenPaintResult } from "../checking/toolchain.js"; /** The deploy-time module, typed off the dependency: this package compiles * against ES2022 with no DOM, so it has no `WebAssembly` namespace to name. */ export type EdgeWasmModule = NonNullable; /** A PROMISE, and one per module rather than one per call: `warmScreenEngine` * keys its engine memo on this object, so a stable key is what makes the engine * stable too. */ export declare const edgeVariant: (wasmModule: EdgeWasmModule) => ScreenEngineVariant; /** A copy of the Node leg's paint (checking/toolchain.ts) down to the sentence, * differing only in which engine is warmed and which budget stops a runaway. */ export declare const edgePaint: (wasmModule: EdgeWasmModule, budget: ScreenBudget, input: ScreenPaintInput) => Promise; //# sourceMappingURL=paint.d.ts.map