import type { Page } from 'playwright'; import type { LayoutBoundsCache, NodeBounds, NodeMeta } from './bounds-cache.js'; export interface MeasuredBounds { x: number; y: number; width: number; height: number; } export interface DiffEntry { nodeId: string; name: string; type: string; target: NodeBounds; actual: MeasuredBounds; diff: { dx: number; dy: number; dw: number; dh: number; }; totalError: number; } export type DiagnosticPattern = 'SIBLING_SHIFT' | 'WIDTH_OVERFLOW' | 'ALIGNMENT_OFF' | 'CUMULATIVE_DRIFT' | 'UNKNOWN'; export interface Diagnosis { pattern: DiagnosticPattern; message: string; suggestedFix: string; suspectNode?: string; } export interface MismatchEntry extends DiffEntry { diagnosis: Diagnosis; context: { parentId: string | null; parentName: string | null; siblingsBefore: string[]; siblingsAfter: string[]; }; } export interface MissingEntry { nodeId: string; name: string; type: string; expectedBounds: NodeBounds; } export interface VerificationSummary { totalNodes: number; measuredNodes: number; matchedNodes: number; mismatchedNodes: number; missingNodes: number; matchRate: number; threshold: number; } export interface VerificationResult { summary: VerificationSummary; mismatches: MismatchEntry[]; missing: MissingEntry[]; } export interface VerifyOptions { threshold?: number; viewportWidth?: number; viewportHeight?: number; } /** * Use Puppeteer to measure all [data-node-id] elements in a page, * returning normalized coordinates relative to the root container. */ export declare function measureActualBounds(page: Page, rootNodeId: string): Promise>; /** * Compare target bounds (from Figma) against actual bounds (from Puppeteer). */ export declare function compareBounds(targetMap: Map, actualMap: Map, nodeInfo: Map, threshold: number): { matched: string[]; mismatched: DiffEntry[]; missing: MissingEntry[]; }; /** * Analyze mismatch patterns and produce diagnostic hints. */ export declare function diagnoseDiffs(diffs: DiffEntry[], cache: LayoutBoundsCache): MismatchEntry[]; export declare function formatReport(result: VerificationResult): string; /** * Full verification pipeline: * 1. Launch Puppeteer, navigate to URL * 2. Measure all [data-node-id] elements * 3. Compare against cached Figma bounds * 4. Diagnose discrepancies * 5. Return structured report */ export declare function verifyLayoutBounds(url: string, cache: LayoutBoundsCache, options?: VerifyOptions): Promise; //# sourceMappingURL=layout-verifier.d.ts.map