import { ServerToClientMessage, AnyComponentNode, DataValue, Surface, MessageProcessor } from '../types/types.js'; /** * Processes and consolidates A2UIProtocolMessage objects into a structured, * hierarchical model of UI surfaces. */ export declare class A2uiMessageProcessor implements MessageProcessor { readonly opts: { mapCtor: MapConstructor; arrayCtor: ArrayConstructor; setCtor: SetConstructor; objCtor: ObjectConstructor; }; static readonly DEFAULT_SURFACE_ID = "@default"; private mapCtor; private arrayCtor; private setCtor; private objCtor; private surfaces; constructor(opts?: { mapCtor: MapConstructor; arrayCtor: ArrayConstructor; setCtor: SetConstructor; objCtor: ObjectConstructor; }); getSurfaces(): ReadonlyMap; clearSurfaces(): void; processMessages(messages: ServerToClientMessage[]): void; /** * Retrieves the data for a given component node and a relative path string. * This correctly handles the special `.` path, which refers to the node's * own data context. */ getData(node: AnyComponentNode, relativePath: string, surfaceId?: string): DataValue | null; setData(node: AnyComponentNode | null, relativePath: string, value: DataValue, surfaceId?: string): void; resolvePath(path: string, dataContextPath?: string): string; private parseIfJsonString; /** * Converts a specific array format [{key: "...", value_string: "..."}, ...] * into a standard Map. It also attempts to parse any string values that * appear to be stringified JSON. */ private convertKeyValueArrayToMap; private setDataByPath; /** * Normalizes a path string into a consistent, slash-delimited format. * Converts bracket notation and dot notation in a two-pass. * e.g., "bookRecommendations[0].title" -> "/bookRecommendations/0/title" * e.g., "book.0.title" -> "/book/0/title" */ private normalizePath; private getDataByPath; private getOrCreateSurface; private handleBeginRendering; private handleSurfaceUpdate; private handleDataModelUpdate; private handleDeleteSurface; /** * Starts at the root component of the surface and builds out the tree * recursively. This process involves resolving all properties of the child * components, and expanding on any explicit children lists or templates * found in the structure. * * @param surface The surface to be built. */ private rebuildComponentTree; /** Finds a value key in a map. */ private findValueKey; /** * Builds out the nodes recursively. */ private buildNodeRecursive; /** * Recursively resolves an individual property value. If a property indicates * a child node (a string that matches a component ID), an explicitList of * children, or a template, these will be built out here. */ private resolvePropertyValue; } //# sourceMappingURL=model-processor.d.ts.map