import { type Finding } from './diff.js'; /** * Shared-chrome tier (#193): group surfaces that changed identically and promote * persistent frame elements (nav, header, footer) that moved on every hosting view. */ /** A surface's diff distilled to just what grouping needs: its key and the * findings kept after noise-cleaning. */ export type SurfaceFindings = { surface: string; findings: Finding[]; }; /** Surfaces that changed the SAME way, collapsed to one group + a representative. */ export type SignatureGroup = { surfaces: string[]; rep: SurfaceFindings; findings: Finding[]; }; /** * Group surfaces that changed identically (same signature) into one group each, * keeping the widest surface as the representative. The rects differ per width; * the change itself does not. Callers pass the already-prepared per-surface * findings (missing/one-sided surfaces excluded upstream). */ export declare function groupBySignature(prepared: SurfaceFindings[]): SignatureGroup[]; /** * The set of element paths that changed as SHARED CHROME — a persistent frame * element (nav rail, header, footer) that every view renders and that moved on * every view that renders it. * * The rule is STRUCTURAL, deliberately NOT a tunable percentage. For each changed * path we compare two base-key sets: * - `hosting` — the surface bases whose style map contains the path at all; * - `changed` — the surface bases where the path appears in a finding. * The path is chrome iff it is hosted on MORE THAN ONE base and it changed on * EVERY base that hosts it (`changed ⊇ hosting`). "Every surface that has this * element changed it" is exactly what shared chrome means; it needs no threshold * to tune or defend. A content element (hosted on one base) fails the >1 guard; a * partial change (some hosting bases unchanged) fails the coverage guard. * * Widths of one base collapse to the base key, so a nav present at @1280 and @390 * counts once. `surfacePaths` maps each captured surface key → the element paths * it renders (union of both sides from the caller). */ export declare function chromePaths(changedOnSurfaces: Array<{ path: string; surfaces: string[]; }>, surfacePaths: Map>, surfaceKeyOf?: (captureKey: string) => string | undefined): Set; /** * Split signature groups into the shared-chrome tier and the rest. A group is * promoted only when EVERY one of its affected element paths is a chrome path * (see `chromePaths`) — a group that entangles a frame change with a view's own * content change stays in `rest` and renders in place, so we never hide a * content change under a chrome banner. */ export declare function classifyChrome(groups: G[], surfacePaths: Map>, surfaceKeyOf?: (captureKey: string) => string | undefined): { chrome: G[]; rest: G[]; chromePaths: Set; };