/**
 * A2UI Manager
 *
 * Manages A2UI surfaces, components, and data binding.
 * Processes A2UI protocol messages and renders to terminal or HTML.
 *
 * A2UI Protocol v0.8 - Agent-to-UI communication for visual workspaces.
 */
import { EventEmitter } from 'events';
import type { A2UIMessage, Surface, RenderedComponent, UserActionMessage } from './a2ui-types.js';
export interface A2UIManagerEvents {
    'surface:created': (surfaceId: string) => void;
    'surface:updated': (surfaceId: string) => void;
    'surface:deleted': (surfaceId: string) => void;
    'surface:rendered': (surfaceId: string, root: string) => void;
    'component:added': (surfaceId: string, componentId: string) => void;
    'component:updated': (surfaceId: string, componentId: string) => void;
    'data:updated': (surfaceId: string, path: string | undefined) => void;
    'user:action': (action: {
        surfaceId: string;
        componentId?: string;
        name: string;
        context?: Record<string, unknown>;
    }) => void;
    'error': (error: Error) => void;
}
export declare class A2UIManager extends EventEmitter {
    private surfaces;
    constructor();
    /**
     * Process an A2UI message
     */
    processMessage(message: A2UIMessage): void;
    /**
     * Process multiple A2UI messages
     */
    processMessages(messages: A2UIMessage[]): void;
    /**
     * Process surfaceUpdate message
     */
    private processSurfaceUpdate;
    /**
     * Process dataModelUpdate message
     */
    private processDataModelUpdate;
    /**
     * Process beginRendering message
     */
    private processBeginRendering;
    /**
     * Process deleteSurface message
     */
    private processDeleteSurface;
    /**
     * Create a new surface
     */
    private createSurface;
    /**
     * Get a surface by ID
     */
    getSurface(surfaceId: string): Surface | undefined;
    /**
     * Get all surfaces
     */
    getAllSurfaces(): Surface[];
    /**
     * Get visible surfaces
     */
    getVisibleSurfaces(): Surface[];
    /**
     * Check if surface exists
     */
    hasSurface(surfaceId: string): boolean;
    /**
     * Build rendered component tree from adjacency list
     */
    buildComponentTree(surfaceId: string): RenderedComponent | null;
    /**
     * Build a single component node with children
     */
    private buildComponentNode;
    /**
     * Extract component type and props from ComponentProps union
     */
    private extractComponentInfo;
    /**
     * Get children IDs from component props
     */
    private getChildrenIds;
    /**
     * Resolve data bindings in props
     */
    private resolveDataBindings;
    /**
     * Get nested value from object using dot notation path
     */
    private getNestedValue;
    /**
     * Set nested value in object using dot notation path
     */
    private setNestedValue;
    /**
     * Handle user action from client
     */
    handleUserAction(action: UserActionMessage): void;
    /**
     * Create a user action message
     */
    createUserAction(surfaceId: string, name: string, componentId?: string, context?: Record<string, unknown>): UserActionMessage;
    /**
     * Render surface to terminal (text format)
     */
    renderToTerminal(surfaceId: string): string;
    /**
     * Render a component node to terminal lines
     */
    private renderNodeToTerminal;
    /**
     * Wrap text to fit within width
     */
    private wrapText;
    /**
     * Render surface to HTML
     */
    renderToHTML(surfaceId: string): string;
    /**
     * Render a component node to HTML
     */
    private renderNodeToHTML;
    /**
     * Convert A2UIStyles to CSS string
     */
    private stylesToCSS;
    /**
     * Convert value to CSS value string
     */
    private toCSSValue;
    /**
     * Escape HTML special characters
     */
    private escapeHTML;
    /**
     * Get default CSS styles
     */
    private getDefaultCSS;
    /**
     * Get client-side JavaScript for user actions
     */
    private getClientScript;
    /**
     * Clear all surfaces
     */
    clear(): void;
    /**
     * Get surface count
     */
    getSurfaceCount(): number;
    /**
     * Shutdown manager
     */
    shutdown(): void;
}
/**
 * Get singleton A2UI Manager instance
 */
export declare function getA2UIManager(): A2UIManager;
/**
 * Reset A2UI Manager (for testing)
 */
export declare function resetA2UIManager(): void;
export default A2UIManager;
