TermUI.Runtime.NodeRenderer (TermUI v1.0.0)
View SourceConverts render trees to buffer cells for terminal output.
This module bridges the gap between the component's render tree output and the low-level buffer cell representation needed for terminal rendering.
Supports both tuple-based render nodes (from TermUI.Elm.Helpers) and struct-based RenderNodes (from TermUI.Component.RenderNode).
Summary
Functions
Renders a node tree to the buffer starting at the given position.
Renders a node tree directly to a Buffer struct (not via BufferManager).
Functions
@spec render_to_buffer( term(), TermUI.Renderer.BufferManager.t() | pid(), pos_integer(), pos_integer() ) :: {non_neg_integer(), non_neg_integer()}
Renders a node tree to the buffer starting at the given position.
Returns the bounds of the rendered content as {width, height}.
@spec render_to_buffer_direct( term(), TermUI.Renderer.Buffer.t(), pos_integer(), pos_integer() ) :: {non_neg_integer(), non_neg_integer()}
Renders a node tree directly to a Buffer struct (not via BufferManager).
This is used for TTY mode where we create temporary buffers per frame.
Returns the bounds of the rendered content as {width, height}.