/** * UI Verifier - CDP-based deterministic UI verification * * Uses Chrome DevTools Protocol directly for accurate, deterministic checks: * - DOMDebugger.getEventListeners: Detect buttons/elements without click handlers * - DOM.getBoxModel: Get exact element positions and dimensions * - Page.getLayoutMetrics: Get viewport and content size * - CSS.getComputedStyleForNode: Get computed styles for overflow detection * - DOM.getNodeForLocation: Check what's actually clickable at a point */ import type { Page } from 'puppeteer-core'; export interface UIIssue { type: UIIssueType; severity: 'error' | 'warning' | 'info'; selector: string; text?: string; details: Record; recommendation: string; } export type UIIssueType = 'no-click-handler' | 'outside-viewport' | 'partially-outside-viewport' | 'small-touch-target' | 'overflow-clipping' | 'not-clickable' | 'dead-link' | 'horizontal-scroll'; export interface ViewportMetrics { width: number; height: number; scrollX: number; scrollY: number; contentWidth: number; contentHeight: number; } export interface VerifyOptions { checks?: UICheckType[]; minTouchTargetSize?: number; } export type UICheckType = 'handlers' | 'viewport' | 'touch' | 'overflow' | 'clickability' | 'links' | 'scroll'; export interface VerifyResult { issues: UIIssue[]; viewport: ViewportMetrics; scannedElements: number; timestamp: number; checksPerformed: UICheckType[]; } export declare class UIVerifier { private page; private cdpSession; constructor(page: Page); /** * Run UI verification with specified checks */ verify(options?: VerifyOptions): Promise; /** * Get viewport and content metrics using Page.getLayoutMetrics */ private getViewportMetrics; /** * Find all interactive elements and get their properties */ private findInteractiveElements; /** * Check if an element has click/touch event handlers using DOMDebugger.getEventListeners */ private checkEventListeners; /** * Determine if an element should have a click handler based on its type */ private shouldHaveHandler; /** * Check if a link href is "dead" (empty, #, javascript:void) */ private isDeadLink; /** * Check element position relative to viewport */ private checkViewportPosition; /** * Check if an element is actually clickable at its center point * Uses DOM.getNodeForLocation to see what's at that position */ private checkClickability; /** * Check if nodeId is an ancestor of childNodeId */ private isAncestor; /** * Check for overflow on all elements * Reports ALL overflow with context about how it's handled */ private checkOverflowClipping; } //# sourceMappingURL=ui-verifier.d.ts.map