Renderer

interface Renderer<T, S>

Visitor over a fully resolved tree. A renderer translates each ResolvedNode and each ResolvedChild.TextRun into a platform value of type T.

Parameters

T

the platform output (e.g. Unit for a Compose binding, or a string/AST node for a headless test target).

S

a platform scope threaded through the walk (e.g. a Modifier chain or a composable scope). The engine never inspects it.

The walk is post-order: children are rendered first; the parent receives the already rendered List<T> in renderElement.

Functions

Link copied to clipboard
abstract fun renderElement(node: <Error class: unknown class>, scope: S, children: List<T>): T

Render one element node, post-order: children holds the already-rendered values of node's children (in document order). Returns this node's rendered value.

Link copied to clipboard
abstract fun renderText(run: <Error class: unknown class>, scope: S): T

Render one text run (the textual leaf of an element). Returns its rendered value.