class InputParser
source · line 12public class InputParser public constructor(internal val escapeDelay: Duration = Duration.milliseconds(50L))
A pure incremental terminal byte parser. Feed monotonically nondecreasing times so Escape ambiguity can expire deterministically; parser methods perform no terminal I/O.
function feed
source · line 35public fun feed(bytes: List<Byte>, now: Duration, rawMode: Boolean = true): Unit
Consumes a byte chunk at the supplied monotonic elapsed time and raw-mode interpretation.
parameter rawMode
source · line 35rawMode: Boolean = true
parameter bytes
source · line 35bytes: List<Byte>
parameter now
source · line 35now: Duration
function feedResize
source · line 49public fun feedResize(columns: Long, rows: Long): Unit
Queues a resize event with nonnegative terminal dimensions.
parameter columns
source · line 49columns: Long
parameter rows
source · line 49rows: Long
function next
source · line 75public fun next(): InputItem?
Removes the next queued item, or None when the queue is empty.
function advance
source · line 44public fun advance(now: Duration): Unit
Advances parser time without new bytes and expires pending Escape ambiguity when due.
parameter now
source · line 44now: Duration
property hasPending
source · line 30public val hasPending: Boolean
get: public read-only
Whether a parsed item is ready to remove.
getter get
source · line 30get(): Boolean
function finish
source · line 81public fun finish(): Unit
Marks input ended, emitting a lone Escape key or an invalid incomplete sequence as needed. Repeated finish is harmless.
property escapeRemaining
source · line 66public val escapeRemaining: Duration?
get: public read-only
The remaining Escape ambiguity delay, or None when no Escape sequence is pending.
getter get
source · line 66get(): Option<Duration>
constructor constructor
source · line 12constructor(internal val escapeDelay: Duration = Duration.milliseconds(50L))
parameter escapeDelay
source · line 12internal val escapeDelay: Duration = Duration.milliseconds(50L)