/** * Manifest WASM Runtime - TypeScript Loader * * Loads the compiled AssemblyScript WASM module and provides a * TypeScript-friendly wrapper that maintains identical semantics * to the TypeScript runtime engine. * * Internal prototype only. The published package currently falls back to the * TypeScript evaluator because it does not ship a supported default WASM * artifact. */ import type { IRExpression, IRValue } from '../ir.js'; /** * The shape of the AssemblyScript module exports we use. */ export interface WasmModule { memory: WebAssembly.Memory; __pin: (ptr: number) => number; __unpin: (ptr: number) => void; __newString: (str: string) => number; __newArray: (id: number, len: number) => number; __getString: (ptr: number) => string; __getArrayLength: (ptr: number) => number; __getArrayElement: (ptr: number, idx: number) => number; evalExpr: (exprPtr: number, ctxPtr: number) => number; evalConstraint: (exprPtr: number, ctxPtr: number, namePtr: number) => number; setNowProvider: (fn: () => number) => void; setUuidProvider: (fn: () => string) => void; version: () => number; } /** * Load the compiled WASM module from a buffer. * Works in both browser and Node.js environments. */ export declare function loadWasmModule(wasmBytes: BufferSource): Promise; /** * Try to load the embedded WASM bytes. * In a build, the bytes are inlined via a Vite import. * In Node.js, they're loaded from the filesystem. */ export declare function loadDefaultWasmBytes(): Promise; /** * Serialize an IRExpression to a JSON string suitable for the WASM module. */ export declare function serializeExpression(expr: IRExpression): string; /** * Serialize a context object to a JSON string suitable for the WASM module. */ export declare function serializeContext(context: Record): string; /** * Serialize an IRValue to a JSON string. */ export declare function serializeIRValue(value: IRValue): string; /** * Deserialize a JSON string returned by the WASM module into a JavaScript value. */ export declare function deserializeResult(jsonResult: string): unknown; //# sourceMappingURL=wasm-loader.d.ts.map