Sign in

    mizchi/tui/io does not have a README file

    InputResult

    pub(all) enum InputResult {
    Confirmed(String)
    Cancelled
    TabNext(String)
    TabPrev(String)
    ForceQuit
    }

    Result of an input session

    abort_input_session

    fn abort_input_session() -> Unit

    Abort the current input session

    cleanup_stdin

    fn cleanup_stdin() -> Unit

    Cleanup stdin state

    debug_stderr

    fn debug_stderr(s : String) -> Unit

    Debug print to stderr (public)

    debug_stdin_state

    fn debug_stdin_state(label : String) -> Unit

    Debug stdin state (public)

    enable_raw_mode

    fn enable_raw_mode() -> Unit

    Enable raw mode

    get_args

    fn get_args() -> Array[String]

    Get command line arguments

    get_env

    fn get_env(name : String) -> String

    Get environment variable value (empty string if not set)

    get_terminal_size

    fn get_terminal_size() -> (Int, Int)

    Get terminal size (columns, rows)

    get_time_ms

    fn get_time_ms() -> Int

    Get current time in milliseconds (monotonic)

    is_headless

    fn is_headless() -> Bool

    Check if running in headless mode (TUI_HEADLESS=1 or --headless argument)

    is_raw_mode

    fn is_raw_mode() -> Bool

    is_tty

    fn is_tty() -> Bool

    Check if a TTY is available for input (stdin or /dev/tty)

    keep_alive_nonblocking

    fn keep_alive_nonblocking(ms : Int) -> Unit

    Keep process alive without blocking the event loop

    poll_keypress

    fn poll_keypress() -> Bool

    Poll for keypress (not applicable in JS - use start_keypress_listener instead) Returns false as JS uses event-driven model
    fn print_raw(s : String) -> Unit

    Print string to stdout (no newline)

    read_key

    async fn read_key() -> String

    Read a key asynchronously

    set_idle_handler

    fn set_idle_handler(handler : () -> Unit) -> Unit

    Set idle handler (uses setInterval for JS)

    sleep

    async fn sleep(ms : Int) -> Unit

    Sleep for milliseconds

    start_inline_input

    fn start_inline_input(label : String, initial : String, row : Int, col : Int, max_width : Int, max_height : Int, on_result : (InputResult) -> Unit) -> Unit

    Start an inline input session (for editing in place) row/col are 1-indexed ANSI coordinates max_width/max_height define the input area for text wrapping

    start_inline_input_cooked

    fn start_inline_input_cooked(field_name : String, initial : String, on_result : (InputResult) -> Unit, confirm_on_shift_enter? : Bool, esc_cancels? : Bool) -> Unit

    Start an inline input session with cooked mode (for IME support) Temporarily exits alternate screen for proper IME input field_name: Display name for the field being edited initial: Current value to pre-fill

    start_inplace_input

    fn start_inplace_input(row : Int, col : Int, width : Int, height : Int, multiline : Bool, initial : String, on_result : (InputResult) -> Unit, confirm_on_shift_enter? : Bool, esc_cancels? : Bool, on_lines_change? : (Int) -> Int?, on_completion? : (String, Int) -> String??) -> Unit

    Start an inplace input session with cooked mode (IME enabled) Stays in alternate screen, edits at specified position row/col are 1-indexed ANSI coordinates width is the max display width for the input

    start_input_session

    async fn start_input_session(x : Int, y : Int, initial : String) -> InputResult

    Start an input session (async version - may not work with raw mode) WARNING: This uses Promise::wait which can block the Node.js event loop Use start_input_session_cb instead for reliable operation

    start_input_session_cb

    fn start_input_session_cb(initial : String, on_result : (InputResult) -> Unit) -> Unit

    Start an input session (callback-based, non-blocking) This is the recommended way to read input - it doesn't block the event loop

    start_input_session_promise

    fn start_input_session_promise(initial : String) ->
    Promise
    [InputResult]

    Start an input session that returns a Promise (for async/await) Use with @js_async.Promise::wait() in async functions

    start_keypress_listener

    fn start_keypress_listener(callback : (String) -> Unit) -> Unit

    Start listening for keypresses (event-driven)

    start_render_ticker

    fn start_render_ticker(ms : Int, callback : () -> Unit) -> Int

    Start a render ticker that calls the callback every ms milliseconds

    start_resize_listener

    fn start_resize_listener(callback : (Int, Int) -> Unit) -> Unit

    Start listening for terminal resize events Callback receives (width, height) when terminal is resized

    stop_keypress_listener

    fn stop_keypress_listener() -> Unit

    Stop listening for keypresses

    stop_render_ticker

    fn stop_render_ticker(ticker_id : Int) -> Unit

    Stop a render ticker

    stop_resize_listener

    fn stop_resize_listener() -> Unit

    Stop listening for resize events

    Powered by MoonBit

    Site sourceReport issuePackagesBuild queueSkillsStatistics

    © 2026 mooncakes.io