glink/use_stdin

Types

pub type EventEmitter
pub type ReadStream
pub type Stdin {
  Stdin(
    stdin: ReadStream,
    set_raw_mode: fn(Bool) -> Nil,
    is_raw_mode_supported: Bool,
    internal_exit_on_ctrl_c: Bool,
    internal_event_emitter: EventEmitter,
  )
}

Constructors

  • Stdin(
      stdin: ReadStream,
      set_raw_mode: fn(Bool) -> Nil,
      is_raw_mode_supported: Bool,
      internal_exit_on_ctrl_c: Bool,
      internal_event_emitter: EventEmitter,
    )

    Arguments

    stdin

    Stdin stream passed to render() in options.stdin or process.stdin by default. Useful if your app needs to handle user input. NOTE: Not yet useable.

    set_raw_mode

    Ink exposes this function via own <StdinContext> to be able to handle Ctrl+C, that’s why you should use Ink’s set_raw_mode. If the stdin stream passed to Ink does not support set_raw_mode, this function does nothing.

    is_raw_mode_supported

    A boolean flag determining if the current stdin supports set_raw_mode. A component using set_raw_mode might want to use is_raw_mode_supported to nicely fall back in environments where raw mode is not supported.

Search Document