/** * Accessibility Tree Types * * Provides AI-friendly structured representation of page elements based on * accessibility semantics. Inspired by agent-browser's approach but using * Playwright's native accessibility API. */ /** * Bounding box coordinates for an element */ export interface ElementBounds { x: number; y: number; width: number; height: number; } /** * A node in the accessibility tree with stable reference */ export interface AccessibilityNode { /** Stable element reference (e.g., @e1, @e2) for use in AI prompts */ ref: string; /** ARIA role (button, link, textbox, etc.) */ role: string; /** Accessible name (visible text or aria-label) */ name: string; /** Current value (for inputs, textareas, etc.) */ value?: string; /** Help text or description */ description?: string; /** Element bounding box (if visible) */ bounds?: ElementBounds; /** Whether element is currently focused */ focused?: boolean; /** Whether element is disabled */ disabled?: boolean; /** Whether element is checked (checkboxes, radio buttons) */ checked?: boolean | 'mixed'; /** Whether element is expanded (dropdowns, accordions) */ expanded?: boolean; /** Nesting level in tree (0 = root) */ level?: number; /** Child nodes */ children?: AccessibilityNode[]; } /** * Full accessibility tree extraction result */ export interface AccessibilityTree { /** Root nodes of the accessibility tree */ nodes: AccessibilityNode[]; /** Total number of interactive elements */ interactiveCount: number; /** Extraction metadata */ metadata: { /** Time taken to extract tree (ms) */ extractionTime: number; /** Whether bounding boxes were included */ includedBounds: boolean; /** Playwright accessibility snapshot available */ snapshotAvailable: boolean; }; } /** * Options for accessibility tree extraction */ export interface AccessibilityExtractionOptions { /** Include element bounding boxes (slower but more informative) */ includeBounds?: boolean; /** Filter to only interactive elements (buttons, links, inputs) */ interactiveOnly?: boolean; /** Maximum depth to traverse (default: unlimited) */ maxDepth?: number; /** Root element selector (default: entire page) */ root?: string; } //# sourceMappingURL=accessibility.d.ts.map