/** * WASM module loader. Wraps Emscripten's createAstroskModule factory so * callers don't need to know about Emscripten internals. * * Works in: * - Browser via fetch * - Node via fs.readFile (mapped through Emscripten's instantiateWasm hook) * - Any environment where the user supplies pre-fetched WASM bytes */ import type { AstroskInitOptions } from './types.js'; export interface WasmModule { _malloc(size: number): number; _free(ptr: number): void; ccall(name: string, returnType: string | null, argTypes: string[], args: unknown[]): unknown; cwrap(name: string, returnType: string | null, argTypes: string[]): (...args: unknown[]) => unknown; HEAPF64: Float64Array; HEAP32: Int32Array; HEAPU8: Uint8Array; stringToUTF8(str: string, ptr: number, maxBytes: number): void; UTF8ToString(ptr: number, maxBytes?: number): string; lengthBytesUTF8(str: string): number; getValue(ptr: number, type: string): number; setValue(ptr: number, value: number, type: string): void; FS: { mkdir(path: string): void; writeFile(path: string, data: Uint8Array | string): void; readFile(path: string, opts?: { encoding?: string; }): Uint8Array | string; unlink(path: string): void; analyzePath(path: string): { exists: boolean; }; }; } /** * Load the WASM module. Resolves with an initialized Emscripten module. * * The Emscripten factory `createAstroskModule` is imported from the * generated `../wasm/astrosk.js`. That file is an ES module that * exports the factory as default. */ export declare function loadAstroskModule(options?: AstroskInitOptions): Promise; //# sourceMappingURL=loader.d.ts.map