@jsvision/ui / RenderRootOptions
Interface: RenderRootOptions
Defined in: ui/src/view/types.ts:76
Options for createRenderRoot. caps is required (it drives depth-aware color encoding); the scheduler and logger are injectable, mainly so tests can drive frames deterministically.
Properties
caps
caps:
CapabilityProfile
Defined in: ui/src/view/types.ts:78
REQUIRED — the terminal capability profile used to encode each frame's output.
healFocus?
optionalhealFocus?: (group) =>void
Defined in: ui/src/view/types.ts:99
Hook to re-home focus after a group removes its currently-focused child. The event loop wires this so focus lands on a sensible sibling; a standalone (non-interactive) render root leaves it unset.
Parameters
group
Returns
void
logger?
optionallogger?:Logger
Defined in: ui/src/view/types.ts:93
Where a widget's draw() errors are logged; defaults to a disabled logger (silent).
schedule?
optionalschedule?: (flush) =>void
Defined in: ui/src/view/types.ts:91
How a pending repaint is scheduled; defaults to queueMicrotask (one coalesced frame per tick).
A custom scheduler must defer the callback rather than invoking it inline. Coalescing is what makes invalidation cheap: many invalidations in one tick collapse into a single frame. A synchronous (flush) => flush() defeats that — every invalidation becomes its own frame: a full repaint pass for invalidate, and a reflow plus recompose for invalidateLayout. Building a tree then costs one frame per view. Tests that need a frame inline should call the render root's flush() instead.
Parameters
flush
() => void
Returns
void
theme?
optionaltheme?:Theme
Defined in: ui/src/view/types.ts:80
Active theme; defaults to the built-in default theme.