a2ui_core library
Core A2UI protocol implementation for Dart.
Classes
- A2uiClientAction
- Reports a user-initiated action from a component.
- A2uiClientError
- Reports a client-side error.
- A2uiMessage
- Base class for all A2UI messages.
- Action
- Triggers a server-side event or a local client-side function.
- BehaviorNode
- CancellationSignal
- A signal that can be used to cancel an operation.
- CapitalizeFunction
-
Catalog<
T extends ComponentApi> - A collection of available components and functions.
- ChildListTemplate
- A template for generating a dynamic list of children.
- ChildNode
- CommonSchemas
- ComponentApi
- A definition of a UI component's API.
- ComponentContext
- Context provided to components during rendering.
- ComponentModel
- Represents the state model for an individual UI component.
-
Computed<
T> - Create a new signal that is computed based on the values of other signals.
- CreateSurfaceMessage
- Signals the client to create a new surface.
- DataBinding
- A JSON Pointer path to a value in the data model.
- DataContext
- Provides data access relative to a specific path in the DataModel.
- DataModel
- A standalone, observable data store representing the client-side state. It handles JSON Pointer path resolution and reactive signal management.
- DataPath
- A class for handling JSON Pointer (RFC 6901) paths.
- DeleteSurfaceMessage
- Signals the client to delete a surface.
- Effect
- Create an effect to run arbitrary code in response to signal changes.
-
EventListenable<
T> - Read-only interface for subscribing to discrete events.
-
EventNotifier<
T> - A synchronous, typed event emitter for discrete events.
- ExpressionParser
- A parser for A2UI expressions, supporting string interpolation and function calls.
- FormatStringFunction
- FunctionApi
- A definition of a UI function's API.
- FunctionCall
- Invokes a named function on the client.
- FunctionImplementation
- A function implementation that can be registered with a catalog.
- GenericBinder
- Takes a component's raw JSON properties (which may contain data bindings, function calls, and action definitions) and resolves them into concrete values (strings, callbacks, child lists, etc). The resolved output updates automatically when underlying data changes.
-
MessageProcessor<
T extends ComponentApi> - The central processor for A2UI messages.
- MinimalButtonApi
- MinimalCatalog
- MinimalColumnApi
- MinimalRowApi
- MinimalTextApi
- MinimalTextFieldApi
-
ReadonlySignal<
T> - An interface for read-only signals.
-
Signal<
T> - Instance of a new plain signal
- SurfaceComponentsModel
- Manages the collection of components for a specific surface.
-
SurfaceGroupModel<
T extends ComponentApi> - The root state model for the A2UI system.
-
SurfaceModel<
T extends ComponentApi> - The state model for a single UI surface.
- UpdateComponentsMessage
- Updates a surface with a new set of components.
- UpdateDataModelMessage
- Updates the data model for an existing surface.
Enums
- A2uiReturnType
- The type of value a function returns.
- Behavior
- Represents the intended runtime behavior of a property parsed from its schema.
Extensions
-
CatalogInvokerExtension
on Catalog<
ComponentApi> - SchemaExtension on Schema
Constants
- maxAutoVivifyIndex → const int
- The maximum list index that auto-vivification will expand to.
Functions
-
batch<
T> (T fn()) → T - Combine multiple value updates into one "commit" at the end of the provided callback.
-
computed<
T> (T fn()) → ReadonlySignal< T> - Create a new signal that is computed based on the values of other signals.
-
effect(
dynamic fn()) → void Function() - Create an effect to run arbitrary code in response to signal changes.
-
signal<
T> (T value) → Signal< T> - Create a new plain signal
Typedefs
-
FunctionInvoker
= Object? Function(String name, Map<
String, dynamic> args, DataContext context) - A function that invokes a catalog function by name.
Exceptions / Errors
- A2uiDataError
- Thrown during DataModel mutations (invalid paths, type mismatches).
- A2uiError
- Base class for all A2UI specific errors.
- A2uiExpressionError
- Thrown during string interpolation and function evaluation.
- A2uiStateError
- Thrown for structural issues in the UI tree (missing surfaces, duplicate components).
- A2uiValidationError
- Thrown when JSON validation fails or schemas are mismatched.
- CancellationException
- An exception thrown when an operation is cancelled.