ProjectionScope

Callback-lifetime capability for projecting one retained declaration. Implementations scope registered actions to the current session, node, and generation. Projection callbacks must not retain this scope or mutate authoritative state.

Functions

Link copied to clipboard
abstract fun action(action: ProjectionAction<*>, key: ProjectionValue = ProjectionValue.Absent): Long

Binds an event endpoint and returns its opaque positive session-local identity. Changing key retires the previous endpoint at this declaration position, so queued events for an obsolete subscription are acknowledged without invoking its replacement handler.

Link copied to clipboard
abstract fun <T : Any> binding(binding: ProjectionBinding<T>): ProjectionValue

Projects a typed value with stable source identity, replacement generation, acknowledged edit, and endpoint. Runtime bindings preserve the latest local edit until it is acknowledged or explicitly replaced by a newer generation.

Link copied to clipboard
abstract fun image(image: DrawImage): ProjectionValue

Encodes immutable CPU pixels under the current negotiated resource limit. The result owns detached data and retains no source subscription or graphics handle.

Link copied to clipboard
abstract fun requireType(type: ProjectionType)

Rejects a declaration when a nested typed behavior is absent from the negotiated client capabilities.

Link copied to clipboard
abstract fun text(text: UiText): ProjectionValue

Encodes unresolved portable text, preserving translation arguments and resource-font identifiers.