import type { ElementEntry, StyleMap } from './capture.js'; import { type DiffStyleOptions, type Finding } from './diff.js'; /** * Report-only structural correspondence between base and head captures. * * The low-level differ can still inventory concrete structural paths for * settle and variant tooling. Certification excludes structure, while report * presentation may remap a one-sided before path onto a uniquely corresponding * after path so path churn collapses into real paired property deltas. * * Matching is intentionally conservative: * - candidates are only DOM-removed (before) vs DOM-added (after) paths * - signature is privacy-safe: tag + rect x/y/width + ownTextLength (height * omitted so pure size changes still pair) * - signature must be unique on both sides * - paths must share a meaningful structural prefix * - ambiguous or incomplete signatures stay unmatched */ /** Privacy-safe correspondence key, or null when the entry cannot be paired. */ export declare function correspondenceSignature(entry: ElementEntry | undefined): string | null; /** Longest exact leading path-segment prefix (`a > b` style). */ export declare function sharedPathPrefix(beforePath: string, afterPath: string): string; /** * Require a non-empty shared ancestor segment so unrelated subtrees that * happen to share geometry cannot pair across the whole document. */ export declare function hasMeaningfulSharedPrefix(beforePath: string, afterPath: string): boolean; /** * Conservative before→after path map among one-sided elements only. * Values are after (head) paths; keys are before (base) paths. */ export declare function correspondElementPaths(before: StyleMap, after: StyleMap): Map; /** Rewrite an element path, preserving a `::pseudo` suffix when present. */ export declare function remapPath(elementPath: string, beforeToAfter: Map): string; /** * Clone a before map with matched element (and safe forced-state) paths rewritten * onto their corresponding after paths. Unmatched paths stay put. */ export declare function remapBeforeStyleMap(before: StyleMap, beforeToAfter: Map): StyleMap; /** Before map rewritten for presentation lookup/diff against the real after map. */ export declare function presentationBeforeMap(before: StyleMap, after: StyleMap): StyleMap; /** * Presentation findings on a before map whose uniquely corresponded paths have * been rewritten to the head path. Callers choose whether low-level structural * inventory is included; production certification always passes false. */ export declare function presentationDiffStyleMaps(before: StyleMap, after: StyleMap, options?: DiffStyleOptions): Finding[];