package symphony-orchestrator-tui

  1. Overview
  2. Docs

Module Tui.Node

type input_state = {
  1. mutable value : string;
  2. placeholder : string;
  3. max_length : int;
  4. mutable cursor : int;
  5. on_input : (string -> unit) option;
  6. on_enter : (string -> unit) option;
}
type select_option = {
  1. name : string;
  2. description : string;
  3. value : string option;
}
type select_state = {
  1. options : select_option list;
  2. mutable selected : int;
  3. mutable scroll : int;
  4. wrap : bool;
  5. show_description : bool;
  6. fast_scroll_step : int;
  7. on_change : (int -> select_option -> unit) option;
  8. on_select : (int -> select_option -> unit) option;
}
type scroll_state = {
  1. mutable scroll_x : int;
  2. mutable scroll_y : int;
  3. sticky_bottom : bool;
}
type progress_state = {
  1. fraction : float;
  2. label : string option;
}
type kind =
  1. | Text of Span.t list
  2. | Vertical_rule of string
  3. | Box
  4. | Input of input_state
  5. | Select of select_state
  6. | Scroll_box of scroll_state
  7. | Progress_bar of progress_state
  8. | Sparkline of float list
  9. | Spacer
type t = {
  1. id : string;
  2. kind : kind;
  3. style : Style.t;
  4. children : t list;
  5. focusable : bool;
  6. mutable focused : bool;
}
val next_id : string -> string
val make : ?id:??? -> ?style:??? -> ?children:??? -> ?focusable:??? -> kind -> t
val text : ?id:??? -> ?style:??? -> string -> t
val rich_text : ?id:??? -> ?style:??? -> Span.t list -> t
val vertical_rule : ?id:??? -> ?style:??? -> ?char:??? -> unit -> t
val box : ?id:??? -> ?style:??? -> t list -> t
val spacer : ?id:??? -> ?style:??? -> unit -> t
val input : ?id:??? -> ?style:??? -> ?value:??? -> ?placeholder:??? -> ?max_length:??? -> ?on_input:??? -> ?on_enter:??? -> unit -> t
val option : ?value:??? -> ?description:??? -> string -> select_option
val select : ?id:??? -> ?style:??? -> ?selected:??? -> ?wrap:??? -> ?show_description:??? -> ?fast_scroll_step:??? -> ?on_change:??? -> ?on_select:??? -> select_option list -> t
val scroll_box : ?id:??? -> ?style:??? -> ?scroll_x:??? -> ?scroll_y:??? -> ?sticky_bottom:??? -> t list -> t
val progress_bar : ?id:??? -> ?style:??? -> ?label:??? -> float -> t
val sparkline : ?id:??? -> ?style:??? -> float list -> t
val plain_text : kind -> string
val find_by_id : string -> t -> t option
val focusables : t -> t list
val set_focus : t -> string -> bool
val focus_first : t -> string option
val focus_next : t -> string option -> string option
val selected_option : select_state -> select_option option
val clamp_select : select_state -> unit
val move_select : select_state -> int -> unit
val insert_at : string -> int -> string -> string
val remove_before : string -> int -> string
val remove_at : string -> int -> string
val handle_key : t -> Key.event -> bool