MilanoView

The built, guaranteed-renderable view: bound to one document at a time. Runtime semantics per the state and actions spec; everything mutable runs through the view's serial dispatcher.

Properties

Link copied to clipboard
Link copied to clipboard

The document's metadata section, verbatim and untyped: producer annotations reach host code without a side channel.

Functions

Link copied to clipboard
fun appear()

The host's signal that the view has come on screen: accepted while not appeared, ignored otherwise and after teardown; an accepted signal runs the document's appear bindings. Content delivers it itself when composed; hosts driving the view without composing it (tests, tooling) call it directly.

Link copied to clipboard

The view's Compose content: bound to this document for its lifetime. Entering composition delivers the appear signal and leaving it the disappear signal, from Compose's own account of presentation (runtime API spec, MilanoHost).

Link copied to clipboard
fun disappear()

The mirror of appear: the view has left the screen.

Link copied to clipboard
fun emit(node: String, event: String, payload: MilanoValue? = null)

A renderer emission. Undeclared events and mis-typed payloads are dropped and reported before reaching dispatch; declared events with no binding are dropped and reported.

Link copied to clipboard
suspend fun replace(document: ByteArray)

As replace with text, from raw UTF-8 bytes: the document-size limit is checked against them exactly.

suspend fun replace(document: String)

Replaces the document the view is bound to (state and actions spec, Document replacement): the new document passes the gate under the surface's configuration, state whose declaration is unchanged (optionality included) carries over, the state data provider supplies the rest, and the swap lands on the dispatcher, serialized with dispatch. Throws what MilanoViewBuilder.build throws (the gate's typed errors, or the provider's own error, unchanged); on a throw the view is exactly as it was. Ignored silently after teardown.

Link copied to clipboard
fun teardown()

The view ceases to participate: completions arriving afterwards drop their follow-ups and report.