UserInputA terminal input event containing an optional raw character and the parsed key that was pressed.
When to use
Use when consuming low-level terminal input events from Terminal.readInput
and you need both raw character input and parsed key metadata.
modelsKey
Source effect/Terminal.ts:9710 lines
export interface UserInput {
/**
* The character read from the user (if any).
*/
readonly UserInput.input: Option.Option<string>The character read from the user (if any).
input: import OptionOption.type Option<A> = Option.None<A> | Option.Some<A>The Option data type represents optional values. An Option<A> is either
Some<A>, containing a value of type A, or None, representing absence.
When to use
Use to represent initial values that may not yet exist
- Returning from partial functions (not defined for all inputs)
- Managing optional fields in data structures
Namespace containing utility types for Option.
When to use
Use to access type-level helpers associated with Option.
Option<string>
/**
* The key that the user pressed.
*/
readonly UserInput.key: Key(property) UserInput.key: {
name: string;
ctrl: boolean;
meta: boolean;
shift: boolean;
}
The key that the user pressed.
key: Key
}Referenced by 2 symbols