WasmTTYInput
Defined in: packages/runtime/src/wasm/tty-bridge.ts:50
Byte source the WASM program reads from via its TTY get_char op.
Implemented by InputQueue for most callers, or supplied by a host that owns its own input channel (e.g. an xterm.js event stream).
Extended by
Section titled “Extended by”Properties
Section titled “Properties”closed?
Section titled “closed?”
optionalclosed?:boolean
Defined in: packages/runtime/src/wasm/tty-bridge.ts:62
Whether the input source has been closed (EOF).
Methods
Section titled “Methods”available()
Section titled “available()”available():
number
Defined in: packages/runtime/src/wasm/tty-bridge.ts:52
Number of bytes immediately available (no blocking).
Returns
Section titled “Returns”number
shift()
Section titled “shift()”shift():
number
Defined in: packages/runtime/src/wasm/tty-bridge.ts:54
Consume one byte. Only call when available() > 0.
Returns
Section titled “Returns”number
waitForAvailable()?
Section titled “waitForAvailable()?”
optionalwaitForAvailable():Promise<void>
Defined in: packages/runtime/src/wasm/tty-bridge.ts:60
Returns a promise that resolves when input becomes available, without
consuming any bytes. Used by poll() to wait for readiness.
Returns
Section titled “Returns”Promise<void>
waitForByte()
Section titled “waitForByte()”waitForByte():
Promise<number>
Defined in: packages/runtime/src/wasm/tty-bridge.ts:57
Returns a promise that resolves with the next byte when one arrives.
Resolves with -1 when the input is closed and the buffer is empty.
Returns
Section titled “Returns”Promise<number>