Skip to content
docsv0.3.0

TuiNodeRendererRegistryInterface

Resolves a {@see TuiNodeRendererInterface} by node via a register + supports-based lookup — the retained-tree counterpart of {@see \Milpa\Live\Contracts\Rendering\ComponentRendererRegistryInterface} on the component-renderer side of the render seam.

TuiNodeRendererRegistryInterface::register()

abstract public function register(Milpa\Live\Contracts\Tui\TuiNodeRendererInterface $renderer): void

Registers a node renderer. Implementations that keep an ordered list and resolve by first match SHOULD prefer the most recently registered renderer when more than one claims to {@see TuiNodeRendererInterface::supports()} the same node.

Parameters

Parameters of register()
NameTypeDescription
$rendererMilpa\Live\Contracts\Tui\TuiNodeRendererInterface

TuiNodeRendererRegistryInterface::resolve()

abstract public function resolve(Milpa\Live\ValueObjects\Tui\TuiNode $node): ?Milpa\Live\Contracts\Tui\TuiNodeRendererInterface

Looks up the renderer that {@see TuiNodeRendererInterface::supports()} the given node.

Parameters

Parameters of resolve()
NameTypeDescription
$nodeMilpa\Live\ValueObjects\Tui\TuiNode

Returns

`null` if no registered renderer supports this node — callers decide whether that is fatal (e.g. an unknown node type in the tree).