Package-level declarations

Types

Link copied to clipboard
class A2uiStateException(message: String, val surfaceId: String? = null) : RuntimeException

Thrown when a message is well-formed but cannot be applied to the renderer's current state.

Link copied to clipboard
sealed interface ChildReference

A reference from one component to another, as the catalog declares it.

Link copied to clipboard
fun interface ChildResolver

Finds the child references a component carries.

Link copied to clipboard
sealed interface EvaluationScope

Where a relative data binding resolves from, and what @index returns.

Link copied to clipboard

A JSON Pointer (RFC 6901) into a surface's data model.

Link copied to clipboard

Folds agent-to-renderer messages into RendererState.

Link copied to clipboard
data class ProcessResult(val state: RendererState, val effects: List<RendererEffect>)

A new state, plus what the caller has to do about the message that produced it.

Link copied to clipboard
sealed interface RenderCost

What drawing a surface would cost, as far as its components alone can say.

Link copied to clipboard
sealed interface RendererEffect

Something the renderer must act on that applying a message did not, and could not, do itself.

Link copied to clipboard
data class RendererState(val surfaces: Map<String, SurfaceModel> = emptyMap())

Every surface the renderer currently holds.

Link copied to clipboard
data class RenderLimits(val maxInstances: Int, val maxDepth: Int = 24, val templateFanout: Int = 2)

The bounds a renderer draws within.

Link copied to clipboard
data class SurfaceModel(val surfaceId: String, val catalogId: String? = null, val sendDataModel: Boolean = false, val metadata: SurfaceMetadata? = null, val components: Map<ComponentId, Component> = emptyMap(), val dataModel: JsonObject = JsonObject(emptyMap()))

The renderer's state for one surface: its components, its data model, and the settings the createSurface message fixed.

Properties

Link copied to clipboard
const val DEFAULT_MAX_DEPTH: Int = 256

How deeply walk will nest before giving up.

Link copied to clipboard

The number of component instances walk will produce before giving up.

Functions

Link copied to clipboard

Reads ChildList out of an already-decoded property value.

Link copied to clipboard

The index @index reads here, or null when this scope is not inside a list template.

Link copied to clipboard

The scope for item index of a template bound to path, nested inside this scope.

Link copied to clipboard

pointer rebased on this scope: absolute pointers unchanged, relative ones measured from EvaluationScope.base.

Link copied to clipboard
fun SurfaceModel.renderCost(resolver: ChildResolver, limits: RenderLimits = RenderLimits.DEFAULT, from: ComponentId = Surface.ROOT_ID): RenderCost

What drawing this surface from from would cost, without drawing any of it.

Link copied to clipboard
fun JsonElement.resolve(pointer: JsonPointer): JsonElement?

The value pointer addresses, or null when nothing is there.

fun EvaluationScope.resolve(dataModel: JsonElement, pointer: JsonPointer): JsonElement?

The value pointer addresses in dataModel once rebased on this scope, or null when absent.

Link copied to clipboard
fun SurfaceModel.walk(resolver: ChildResolver, limit: Int = DEFAULT_WALK_LIMIT, maxDepth: Int = DEFAULT_MAX_DEPTH): List<Pair<Component, EvaluationScope>>

Every component instance reachable from SurfaceModel.root, depth first, each paired with the scope it renders in.

Link copied to clipboard
fun JsonObject.write(pointer: JsonPointer, value: JsonElement): JsonObject

value written at pointer, returning a new data model.