import { WASIFS } from "../types.js"; import { DebugFn } from "./wasi.js"; export type WASIContextOptions = { fs: WASIFS; args: string[]; env: Record; stdin: (maxByteLength: number) => string | null; stdout: (out: string) => void; stderr: (err: string) => void; debug: DebugFn; isTTY: boolean; }; /** * WASIContext * * The context in which a WASI binary is executed. * This is used for syscalls that get args, environment, use IO and read/write * to files. This gives you programmattic access to the environment that the * WASI binary is executing in. * * Notes: * * stdin - string is passed as JavaScript string but encoded to UTF-8, if this * ends up longer than maxByteLength it will be truncated. * * debug - function injected between wasi and return for debugging * */ export declare class WASIContext { fs: WASIFS; args: string[]; env: Record; stdin: WASIContextOptions["stdin"]; stdout: WASIContextOptions["stdout"]; stderr: WASIContextOptions["stderr"]; debug?: WASIContextOptions["debug"]; isTTY: WASIContextOptions["isTTY"]; constructor(options?: Partial); }