# lsdtools.runtimeui reference
URL: https://lsd.tools/docs/sdk-lsdtools-runtimeui
Updated: 2026-10-16

SDK distribution **1.0.0**; API contract **1.0**; generator **1.0.0**.

Product source digest: `13800cef04184609594a0b15f310d52e8ece337faa4be2176039a5286946127b`.

Generated from declared public exports and source syntax. Signatures and annotations are declaration spellings; decorators, factories and annotations are never executed. Class members below are declared members; base classes remain explicit. Source docstrings describe their owning implementation; they do not grant app permissions.

```text
Runtime UI documents, native contexts, and the project UI editor, loaded on demand.

Importing this facade loads neither GTK nor a native library. Documents are data-only RML/RCSS
resource closures. The existing Timeline/tween service owns animation and runtime time.
```


## `lsdtools.runtimeui.BuildUI`

Kind: class. Source: `services/runtimeui/src/lsd_runtimeui/steps.py:22`.

Source docstring:

```text
Build a contained UI resource bundle without native initialization or code execution.
```


Implementation alias: `lsd_runtimeui.steps.BuildUI`.

Declared bases: `LoadStep`.

### `lsdtools.runtimeui.BuildUI.output_ports`

Kind: attribute. Source: `services/runtimeui/src/lsd_runtimeui/steps.py:24`.

```python
output_ports = ['ui']
```


### `lsdtools.runtimeui.BuildUI.cache_pin`

Kind: attribute. Source: `services/runtimeui/src/lsd_runtimeui/steps.py:25`.

```python
cache_pin = 'lsd-runtimeui-document-v1'
```


### `lsdtools.runtimeui.BuildUI.document`

Kind: attribute. Source: `services/runtimeui/src/lsd_runtimeui/steps.py:26`.

```python
document = param(dict, default_factory=lambda: dict(EMPTY_DOCUMENT), required=True, label='UI document', validators=[_validate_document], description='RML, RCSS, fonts and images included with this project.')
```


### `lsdtools.runtimeui.BuildUI.run`

Kind: method. Source: `services/runtimeui/src/lsd_runtimeui/steps.py:30`.

```python
run(self)
```


```python
self: (unannotated)
```


## `lsdtools.runtimeui.DocumentBundle`

Kind: class. Source: `services/runtimeui/src/lsd_runtimeui/document.py:243`.

Source docstring:

```text
One immutable, self-contained document and its explicit resource closure.
```


Implementation alias: `lsd_runtimeui.document.DocumentBundle`.

### `lsdtools.runtimeui.DocumentBundle.id`

Kind: attribute. Source: `services/runtimeui/src/lsd_runtimeui/document.py:245`.

```python
id: str
```


### `lsdtools.runtimeui.DocumentBundle.entry`

Kind: attribute. Source: `services/runtimeui/src/lsd_runtimeui/document.py:246`.

```python
entry: str
```


### `lsdtools.runtimeui.DocumentBundle.resources`

Kind: attribute. Source: `services/runtimeui/src/lsd_runtimeui/document.py:247`.

```python
resources: tuple[Resource, ...]
```


### `lsdtools.runtimeui.DocumentBundle.fonts`

Kind: attribute. Source: `services/runtimeui/src/lsd_runtimeui/document.py:248`.

```python
fonts: tuple[str, ...]
```


```python
fonts = ()
```


### `lsdtools.runtimeui.DocumentBundle.properties`

Kind: attribute. Source: `services/runtimeui/src/lsd_runtimeui/document.py:249`.

```python
properties: Mapping[str, Mapping]
```


```python
properties = field(default_factory=dict)
```


### `lsdtools.runtimeui.DocumentBundle.models`

Kind: attribute. Source: `services/runtimeui/src/lsd_runtimeui/document.py:250`.

```python
models: Mapping[str, Mapping]
```


```python
models = field(default_factory=dict)
```


### `lsdtools.runtimeui.DocumentBundle.event_bindings`

Kind: attribute. Source: `services/runtimeui/src/lsd_runtimeui/document.py:251`.

```python
event_bindings: tuple[Mapping, ...]
```


```python
event_bindings = ()
```


### `lsdtools.runtimeui.DocumentBundle.from_sources`

Kind: method. Source: `services/runtimeui/src/lsd_runtimeui/document.py:327`.

```python
from_sources(cls, source: str, *, id='ui', entry='main.rml', resources=None, fonts=(), properties=None, models=None, event_bindings=())
```


```python
cls: (unannotated)
entry: (unannotated)
event_bindings: (unannotated)
fonts: (unannotated)
id: (unannotated)
models: (unannotated)
properties: (unannotated)
resources: (unannotated)
source: str
```


### `lsdtools.runtimeui.DocumentBundle.source`

Kind: method. Source: `services/runtimeui/src/lsd_runtimeui/document.py:335`.

```python
source(self, path=None)
```


```python
path: (unannotated)
self: (unannotated)
```


### `lsdtools.runtimeui.DocumentBundle.resource_bytes`

Kind: method. Source: `services/runtimeui/src/lsd_runtimeui/document.py:339`.

```python
resource_bytes(self)
```


```python
self: (unannotated)
```


### `lsdtools.runtimeui.DocumentBundle.replace_source`

Kind: method. Source: `services/runtimeui/src/lsd_runtimeui/document.py:342`.

```python
replace_source(self, path, source)
```


```python
path: (unannotated)
self: (unannotated)
source: (unannotated)
```


### `lsdtools.runtimeui.DocumentBundle.with_resource`

Kind: method. Source: `services/runtimeui/src/lsd_runtimeui/document.py:348`.

```python
with_resource(self, path, data, *, font=False)
```


```python
data: (unannotated)
font: (unannotated)
path: (unannotated)
self: (unannotated)
```


Source docstring:

```text
Include explicit asset bytes in a new generation, refusing accidental replacement.
```


### `lsdtools.runtimeui.DocumentBundle.without_resource`

Kind: method. Source: `services/runtimeui/src/lsd_runtimeui/document.py:358`.

```python
without_resource(self, path)
```


```python
path: (unannotated)
self: (unannotated)
```


Source docstring:

```text
Remove an unreferenced asset; normal closure validation protects live references.
```


### `lsdtools.runtimeui.DocumentBundle.with_property`

Kind: method. Source: `services/runtimeui/src/lsd_runtimeui/document.py:365`.

```python
with_property(self, element, name, value)
```


```python
element: (unannotated)
name: (unannotated)
self: (unannotated)
value: (unannotated)
```


Source docstring:

```text
Set a definite typed authored value above RCSS through a new document generation.
```


### `lsdtools.runtimeui.DocumentBundle.without_property`

Kind: method. Source: `services/runtimeui/src/lsd_runtimeui/document.py:371`.

```python
without_property(self, element, name)
```


```python
element: (unannotated)
name: (unannotated)
self: (unannotated)
```


Source docstring:

```text
Release one authored override back to RCSS in a new document generation.
```


### `lsdtools.runtimeui.DocumentBundle.to_authoring_tables`

Kind: method. Source: `services/runtimeui/src/lsd_runtimeui/document.py:381`.

```python
to_authoring_tables(self)
```


```python
self: (unannotated)
```


### `lsdtools.runtimeui.DocumentBundle.to_dict`

Kind: method. Source: `services/runtimeui/src/lsd_runtimeui/document.py:385`.

```python
to_dict(self)
```


```python
self: (unannotated)
```


### `lsdtools.runtimeui.DocumentBundle.from_dict`

Kind: method. Source: `services/runtimeui/src/lsd_runtimeui/document.py:395`.

```python
from_dict(cls, value)
```


```python
cls: (unannotated)
value: (unannotated)
```


### `lsdtools.runtimeui.DocumentBundle.canonical_bytes`

Kind: method. Source: `services/runtimeui/src/lsd_runtimeui/document.py:420`.

```python
canonical_bytes(self)
```


```python
self: (unannotated)
```


### `lsdtools.runtimeui.DocumentBundle.digest`

Kind: method. Source: `services/runtimeui/src/lsd_runtimeui/document.py:424`.

```python
digest(self)
```


```python
self: (unannotated)
```


## `lsdtools.runtimeui.DocumentError`

Kind: class. Source: `services/runtimeui/src/lsd_runtimeui/document.py:29`.

Source docstring:

```text
Invalid, incomplete, or unsupported runtime UI document data.
```


Implementation alias: `lsd_runtimeui.document.DocumentError`.

Declared bases: `ValueError`.

## `lsdtools.runtimeui.NativeDocument`

Kind: class. Source: `services/runtimeui/src/lsd_runtimeui/native.py:175`.

```python
NativeDocument(self, width: int=800, height: int=600, dpi: float=1.0, *, resources: Mapping[str, bytes] | None=None, fonts: Iterable[str]=(), models: Mapping[str, Mapping] | None=None, event_bindings: Iterable[Mapping]=(), renderer: int=0, library: NativeLibrary | None=None)
```


Implementation alias: `lsd_runtimeui.native.NativeDocument`.

### `lsdtools.runtimeui.NativeDocument.__init__`

Kind: method. Source: `services/runtimeui/src/lsd_runtimeui/native.py:176`.

```python
__init__(self, width: int=800, height: int=600, dpi: float=1.0, *, resources: Mapping[str, bytes] | None=None, fonts: Iterable[str]=(), models: Mapping[str, Mapping] | None=None, event_bindings: Iterable[Mapping]=(), renderer: int=0, library: NativeLibrary | None=None)
```


```python
dpi: float
event_bindings: Iterable[Mapping]
fonts: Iterable[str]
height: int
library: NativeLibrary | None
models: Mapping[str, Mapping] | None
renderer: int
resources: Mapping[str, bytes] | None
self: (unannotated)
width: int
```


### `lsdtools.runtimeui.NativeDocument.add_resource`

Kind: method. Source: `services/runtimeui/src/lsd_runtimeui/native.py:218`.

```python
add_resource(self, path: str, data: bytes)
```


```python
data: bytes
path: str
self: (unannotated)
```


### `lsdtools.runtimeui.NativeDocument.load`

Kind: method. Source: `services/runtimeui/src/lsd_runtimeui/native.py:223`.

```python
load(self, rml: str, source: str='main.rml')
```


```python
rml: str
self: (unannotated)
source: str
```


### `lsdtools.runtimeui.NativeDocument.update`

Kind: method. Source: `services/runtimeui/src/lsd_runtimeui/native.py:226`.

```python
update(self)
```


```python
self: (unannotated)
```


### `lsdtools.runtimeui.NativeDocument.next_update_delay`

Kind: method. Source: `services/runtimeui/src/lsd_runtimeui/native.py:229`.

```python
next_update_delay(self) -> float
```


```python
self: (unannotated)
```


### `lsdtools.runtimeui.NativeDocument.resize`

Kind: method. Source: `services/runtimeui/src/lsd_runtimeui/native.py:234`.

```python
resize(self, width: int, height: int, dpi: float=1.0)
```


```python
dpi: float
height: int
self: (unannotated)
width: int
```


### `lsdtools.runtimeui.NativeDocument.query`

Kind: method. Source: `services/runtimeui/src/lsd_runtimeui/native.py:237`.

```python
query(self, element_id: str) -> dict
```


```python
element_id: str
self: (unannotated)
```


### `lsdtools.runtimeui.NativeDocument.elements`

Kind: method. Source: `services/runtimeui/src/lsd_runtimeui/native.py:240`.

```python
elements(self) -> list[dict]
```


```python
self: (unannotated)
```


### `lsdtools.runtimeui.NativeDocument.query_all`

Kind: attribute. Source: `services/runtimeui/src/lsd_runtimeui/native.py:243`.

```python
query_all = elements
```


### `lsdtools.runtimeui.NativeDocument.set_property`

Kind: method. Source: `services/runtimeui/src/lsd_runtimeui/native.py:245`.

```python
set_property(self, element_id: str, name: str, value: str)
```


```python
element_id: str
name: str
self: (unannotated)
value: str
```


### `lsdtools.runtimeui.NativeDocument.set_properties`

Kind: method. Source: `services/runtimeui/src/lsd_runtimeui/native.py:248`.

```python
set_properties(self, changes: Iterable[tuple[str, str, str]])
```


```python
changes: Iterable[tuple[str, str, str]]
self: (unannotated)
```


### `lsdtools.runtimeui.NativeDocument.set_text`

Kind: method. Source: `services/runtimeui/src/lsd_runtimeui/native.py:255`.

```python
set_text(self, element_id: str, text: str)
```


```python
element_id: str
self: (unannotated)
text: str
```


### `lsdtools.runtimeui.NativeDocument.set_model`

Kind: method. Source: `services/runtimeui/src/lsd_runtimeui/native.py:258`.

```python
set_model(self, name: str, mapping: Mapping)
```


```python
mapping: Mapping
name: str
self: (unannotated)
```


### `lsdtools.runtimeui.NativeDocument.patch_model`

Kind: attribute. Source: `services/runtimeui/src/lsd_runtimeui/native.py:296`.

```python
patch_model = set_model
```


### `lsdtools.runtimeui.NativeDocument.get_model`

Kind: method. Source: `services/runtimeui/src/lsd_runtimeui/native.py:298`.

```python
get_model(self, name: str) -> dict
```


```python
name: str
self: (unannotated)
```


### `lsdtools.runtimeui.NativeDocument.query_selector`

Kind: method. Source: `services/runtimeui/src/lsd_runtimeui/native.py:301`.

```python
query_selector(self, selector: str)
```


```python
selector: str
self: (unannotated)
```


### `lsdtools.runtimeui.NativeDocument.query_selector_all`

Kind: method. Source: `services/runtimeui/src/lsd_runtimeui/native.py:304`.

```python
query_selector_all(self, selector: str) -> list[dict]
```


```python
selector: str
self: (unannotated)
```


### `lsdtools.runtimeui.NativeDocument.hit_test`

Kind: method. Source: `services/runtimeui/src/lsd_runtimeui/native.py:307`.

```python
hit_test(self, x: float, y: float)
```


```python
self: (unannotated)
x: float
y: float
```


### `lsdtools.runtimeui.NativeDocument.set_attribute`

Kind: method. Source: `services/runtimeui/src/lsd_runtimeui/native.py:310`.

```python
set_attribute(self, identity: str, name: str, value: str)
```


```python
identity: str
name: str
self: (unannotated)
value: str
```


### `lsdtools.runtimeui.NativeDocument.remove_attribute`

Kind: method. Source: `services/runtimeui/src/lsd_runtimeui/native.py:313`.

```python
remove_attribute(self, identity: str, name: str)
```


```python
identity: str
name: str
self: (unannotated)
```


### `lsdtools.runtimeui.NativeDocument.set_class`

Kind: method. Source: `services/runtimeui/src/lsd_runtimeui/native.py:316`.

```python
set_class(self, identity: str, name: str, enabled: bool=True)
```


```python
enabled: bool
identity: str
name: str
self: (unannotated)
```


### `lsdtools.runtimeui.NativeDocument.set_pseudo_class`

Kind: method. Source: `services/runtimeui/src/lsd_runtimeui/native.py:321`.

```python
set_pseudo_class(self, identity: str, name: str, enabled: bool=True)
```


```python
enabled: bool
identity: str
name: str
self: (unannotated)
```


### `lsdtools.runtimeui.NativeDocument.append_rml`

Kind: method. Source: `services/runtimeui/src/lsd_runtimeui/native.py:326`.

```python
append_rml(self, identity: str, source: str)
```


```python
identity: str
self: (unannotated)
source: str
```


### `lsdtools.runtimeui.NativeDocument.set_inner_rml`

Kind: method. Source: `services/runtimeui/src/lsd_runtimeui/native.py:329`.

```python
set_inner_rml(self, identity: str, source: str)
```


```python
identity: str
self: (unannotated)
source: str
```


### `lsdtools.runtimeui.NativeDocument.remove_element`

Kind: method. Source: `services/runtimeui/src/lsd_runtimeui/native.py:332`.

```python
remove_element(self, identity: str)
```


```python
identity: str
self: (unannotated)
```


### `lsdtools.runtimeui.NativeDocument.bind_event`

Kind: method. Source: `services/runtimeui/src/lsd_runtimeui/native.py:335`.

```python
bind_event(self, model: str, callback: str)
```


```python
callback: str
model: str
self: (unannotated)
```


### `lsdtools.runtimeui.NativeDocument.input`

Kind: method. Source: `services/runtimeui/src/lsd_runtimeui/native.py:338`.

```python
input(self, kind: str, **values) -> bool
```


```python
kind: str
self: (unannotated)
values: (unannotated)
```


### `lsdtools.runtimeui.NativeDocument.input_state`

Kind: method. Source: `services/runtimeui/src/lsd_runtimeui/native.py:363`.

```python
input_state(self) -> dict
```


```python
self: (unannotated)
```


### `lsdtools.runtimeui.NativeDocument.activate`

Kind: method. Source: `services/runtimeui/src/lsd_runtimeui/native.py:366`.

```python
activate(self, identity: str)
```


```python
identity: str
self: (unannotated)
```


Source docstring:

```text
Activate an identified visible native control without pointer coordinates.
```


### `lsdtools.runtimeui.NativeDocument.drain_events`

Kind: method. Source: `services/runtimeui/src/lsd_runtimeui/native.py:370`.

```python
drain_events(self) -> list[dict]
```


```python
self: (unannotated)
```


### `lsdtools.runtimeui.NativeDocument.poll_form_event`

Kind: method. Source: `services/runtimeui/src/lsd_runtimeui/native.py:373`.

```python
poll_form_event(self) -> dict | None
```


```python
self: (unannotated)
```


Source docstring:

```text
Consume one bounded native submission; copy all borrowed values now.
```


### `lsdtools.runtimeui.NativeDocument.render_native`

Kind: method. Source: `services/runtimeui/src/lsd_runtimeui/native.py:386`.

```python
render_native(self)
```


```python
self: (unannotated)
```


### `lsdtools.runtimeui.NativeDocument.close`

Kind: method. Source: `services/runtimeui/src/lsd_runtimeui/native.py:389`.

```python
close(self)
```


```python
self: (unannotated)
```


### `lsdtools.runtimeui.NativeDocument.__enter__`

Kind: method. Source: `services/runtimeui/src/lsd_runtimeui/native.py:395`.

```python
__enter__(self)
```


```python
self: (unannotated)
```


### `lsdtools.runtimeui.NativeDocument.__exit__`

Kind: method. Source: `services/runtimeui/src/lsd_runtimeui/native.py:399`.

```python
__exit__(self, *exc)
```


```python
exc: (unannotated)
self: (unannotated)
```


### `lsdtools.runtimeui.NativeDocument.native_library`

Kind: attribute. Source: `services/runtimeui/src/lsd_runtimeui/native.py:180`.

```python
native_library: (unannotated)
```


```python
native_library = library or load_native()
```


### `lsdtools.runtimeui.NativeDocument.handle`

Kind: attribute. Source: `services/runtimeui/src/lsd_runtimeui/native.py:182`.

```python
handle: (unannotated)
```


```python
handle = 0
```


## `lsdtools.runtimeui.Resource`

Kind: class. Source: `services/runtimeui/src/lsd_runtimeui/document.py:226`.

Implementation alias: `lsd_runtimeui.document.Resource`.

### `lsdtools.runtimeui.Resource.path`

Kind: attribute. Source: `services/runtimeui/src/lsd_runtimeui/document.py:227`.

```python
path: str
```


### `lsdtools.runtimeui.Resource.data`

Kind: attribute. Source: `services/runtimeui/src/lsd_runtimeui/document.py:228`.

```python
data: bytes
```


### `lsdtools.runtimeui.Resource.digest`

Kind: method. Source: `services/runtimeui/src/lsd_runtimeui/document.py:238`.

```python
digest(self)
```


```python
self: (unannotated)
```


## `lsdtools.runtimeui.builtin_font_resources`

Kind: function. Source: `sdk/src/lsdtools/runtimeui.py:12`.

```python
builtin_font_resources() -> dict[str, bytes]
```


Source docstring:

```text
Return authenticated LatoLatin Regular font/license bytes for an included UI resource bundle.
```


## `lsdtools.runtimeui.can_play_ui`

Kind: function. Source: `sdk/src/lsdtools/runtimeui.py:24`.

```python
can_play_ui(entity) -> bool
```


```python
entity: (unannotated)
```


Source docstring:

```text
Whether an entity declares one UI output and a complete or genuinely empty scene.
```


## `lsdtools.runtimeui.create_runtime_ui_surface`

Kind: function. Source: `sdk/src/lsdtools/runtimeui.py:52`.

```python
create_runtime_ui_surface(surface, *, input_port=None)
```


```python
input_port: (unannotated)
surface: (unannotated)
```


Source docstring:

```text
Compose the retained runtime overlay on an existing graphical surface and its clock.

The caller passes immutable UI component tables and borrowed published UI numeric state;
the adapter retains only copied property changes. Input authority stays in its existing
runtime channel or admitted human seat.
```


## `lsdtools.runtimeui.create_ui_editor`

Kind: function. Source: `sdk/src/lsdtools/runtimeui.py:101`.

```python
create_ui_editor(host, *, entity=None, view_id)
```


```python
entity: (unannotated)
host: (unannotated)
view_id: (unannotated)
```


Source docstring:

```text
Compose an editor over attached Build UI steps and this host's admitted action port.
```


## `lsdtools.runtimeui.create_ui_player`

Kind: function. Source: `sdk/src/lsdtools/runtimeui.py:34`.

```python
create_ui_player(host, *, entity=None, view_id)
```


```python
entity: (unannotated)
host: (unannotated)
view_id: (unannotated)
```


Source docstring:

```text
Present UI through the existing shared runtime viewport, input channel and Timeline clock.

The ordinary main-view binding delivers its entity after creation. A UI-only document has
zero objects, cameras and actors; this factory creates no spatial authoring or second player.
Its visible transport uses the existing entity-keyed runtime actions. The Timeline button
opens the ordinary Timeline editor on that same entity.
```


## `lsdtools.runtimeui.timeline_spec`

Kind: function. Source: `sdk/src/lsdtools/runtimeui.py:18`.

```python
timeline_spec()
```


Source docstring:

```text
Return Runtime UI's exact property/state contribution for the existing Scene Timeline.
```
