InputQueue
Defined in: packages/runtime/src/wasm/tty-bridge.ts:113
A byte queue that implements WasmTTYInput.
Wire up your input source by calling push / pushString / pushBytes as
bytes arrive, and call close() to signal EOF.
Extends
Section titled “Extends”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).
Inherited from
Section titled “Inherited from”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
Inherited from
Section titled “Inherited from”close()
Section titled “close()”close():
void
Defined in: packages/runtime/src/wasm/tty-bridge.ts:121
Signal that no more input will arrive (EOF). Pending waitForByte() resolves with -1.
Returns
Section titled “Returns”void
push()
Section titled “push()”push(
byte):void
Defined in: packages/runtime/src/wasm/tty-bridge.ts:115
Push a single byte.
Parameters
Section titled “Parameters”number
Returns
Section titled “Returns”void
pushBytes()
Section titled “pushBytes()”pushBytes(
data):void
Defined in: packages/runtime/src/wasm/tty-bridge.ts:119
Push raw bytes from a Uint8Array (e.g., Node.js stdin chunks).
Parameters
Section titled “Parameters”Uint8Array
Returns
Section titled “Returns”void
pushString()
Section titled “pushString()”pushString(
data):void
Defined in: packages/runtime/src/wasm/tty-bridge.ts:117
Push each char of a string as a byte (charCodeAt). Handles multi-char xterm.js onData.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”void
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
Inherited from
Section titled “Inherited from”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>
Inherited from
Section titled “Inherited from”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>