Class Wasm
Implements
- Wasm
Index
Constructors
Accessors
Methods
Methods
detectAsyncify
- detectAsyncify(
wasmBytes: Uint8Array,
): Promise<
{
exportNames: string[];
hasAsyncify: boolean;
hasExports: boolean;
hasImports: boolean;
importNames: string[];
},
> Parameters
- wasmBytes: Uint8Array
Returns Promise<
{
exportNames: string[];
hasAsyncify: boolean;
hasExports: boolean;
hasImports: boolean;
importNames: string[];
},
>
detectMemoryImport
- detectMemoryImport(
wasmBytes: Uint8Array,
moduleName: string,
): Promise<null | { initial: number; maximum?: number }> Parameters
- wasmBytes: Uint8Array
- moduleName: string
Returns Promise<null | { initial: number; maximum?: number }>
detectWasiRequirements
- detectWasiRequirements(wasmBytes: Uint8Array): Promise<boolean>
Detect if a WASM module requires WASI bindings Checks for WASI-related imports in the module
Parameters
- wasmBytes: Uint8Array
Returns Promise<boolean>
detectWasiVersion
- detectWasiVersion(
wasmBytes: Uint8Array,
): Promise<null | "preview1" | "preview2"> Detect WASI version and requirements Returns 'preview1', 'preview2', or null
Parameters
- wasmBytes: Uint8Array
Returns Promise<null | "preview1" | "preview2">
loadEmscripten
loadWasiComponent
- loadWasiComponent(
path: string,
streams: WasiStreamOptions,
args?: string[],
shell?: Shell,
pid?: number,
): Promise<WasiComponentResult> Load a WASI component with stream integration Supports both WASI Preview 1 and Preview 2
Parameters
- path: string
- streams: WasiStreamOptions
- args: string[] = []
Optionalshell: ShellOptionalpid: number
Returns Promise<WasiComponentResult>
Detect if a WASM module imports memory from a specific module Returns the initial and maximum pages required, or null if not imported