@wapython/wasi
Version:
Javascript library for interacting with WASI Modules in Node.js and the Browser.
26 lines (25 loc) • 853 B
TypeScript
/// <reference types="node" />
import type { WASIBindings, WASIConfig, File } from "./types";
declare type Exports = {
[key: string]: any;
};
export default class WASI {
memory: WebAssembly.Memory;
view: DataView;
FD_MAP: Map<number, File>;
wasiImport: Exports;
bindings: WASIBindings;
spinLock?: (time: number) => void;
waitForStdin?: () => Buffer;
stdinBuffer?: Buffer;
sendStdout?: (Buffer: any) => void;
sendStderr?: (Buffer: any) => void;
constructor(wasiConfig: WASIConfig);
getUnusedFileDescriptor(): number;
refreshMemory(): void;
setMemory(memory: WebAssembly.Memory): void;
start(instance: WebAssembly.Instance, memory?: WebAssembly.Memory): void;
private getImportNamespace;
getImports(module: WebAssembly.Module): Record<string, Record<string, Function>>;
}
export {};