Coverage for src / lexigram / ui / protocols.py: 100%
6 statements
« prev ^ index » next coverage.py v7.13.5, created at 2026-08-10 04:11 +0800
« prev ^ index » next coverage.py v7.13.5, created at 2026-08-10 04:11 +0800
1"""UI rendering protocols for lexigram-ui components."""
3from __future__ import annotations
5from typing import Protocol, runtime_checkable
8@runtime_checkable
9class RenderableProtocol(Protocol):
10 """Any object that can render to an HTML string.
12 Implemented by Component, Element, and any custom renderable
13 in lexigram-ui. Export this protocol from the UIModule so that
14 other packages can accept UI objects without importing from
15 lexigram-ui implementation modules.
16 """
18 def __str__(self) -> str:
19 """Return the rendered HTML string."""
20 ...
23__all__ = ["RenderableProtocol"]