{ // Function that is called whenever a command is entered and returns a Promise, // It takes in the name of the command being run, and expects a Uint8Array of a Wasm Binary, or a // CallbackCommand (see the api below) to be returned.fetchCommand:(options:{args:string,env?:{[key:string]:string}})=>Promise<Uint8Array|CallbackCommand> // Only for Optimized Bundles: URL to the /node_modules/wasm-terminal/workers/process.worker.js . This is used by the shell to // to spawn web workers in Comlink, for features such as piping, /dev/stdin reading, and general performance enhancements.processWorkerUrl?:string;}
callbackCommands are functions that can be returned in the fetchCommand config property. They are simply Javascript callbacks that take in the command name, command arguments, environment variables, and return a Promise that resolves stdout.
Since these callback commands handle stdin and stdout, they can be used as normal commands that can be piped!
Runs the supplied string as if it had been entered as a command, typed into the Wasm terminal.
fetchCommandFromWAPM
Exported function from the @wasmer/wasm-terminal package. This function is meant to be returned in the fetchCommand config property of the WasmTerminal Class. This takes in the name of command, the command arguments, and the environment variables, and returns a Promise that resolves a Uint8Array of binary Wasm bytes from WAPM.