import { type DiffCounts, type Finding } from './diff.js'; /** * Path grouping, change signatures, titles, reflow-noise cleaning, and the * canonical comparison-truth assessment shared by the certification differ and * the visual report. */ /** Group findings by their element path (one group per changed element). */ export declare function groupByPath(findings: Finding[]): Finding[][]; /** Canonical signature of a surface's findings: surfaces that changed in the * same way collapse into one section + one image (the rects differ per width; * the change itself does not). */ export declare function signatureOf(findings: Finding[]): string; /** A one-line heading for a change group: "1 element added", "2 elements restyled". */ export declare function groupTitle(findings: Finding[]): string; /** How many of a surface's summarised props are derived/box longhands — the count * the CLI folds behind `(+N derived longhands)`. Counts on the RAW finding props * (before cleaning) so the CLI can advertise exactly what it suppressed. */ export declare function derivedLonghandCount(findings: Finding[]): number; /** * Strip the noise the visual report shouldn't carry, cross-referencing each * element's layers so the forced-state layer stops echoing the base: * - base/pseudo styles: drop size/position-derived longhands (reflow casualties); * - forced states: drop derived + grid-track props, drop a delta the BASE * already changed (a `:hover color` that just follows a recoloured base is an * echo, not a dropped variant), and drop non-value↔non-value rows; * - any finding left with no props is removed entirely. */ export declare function cleanFindings(findings: Finding[]): Finding[]; /** * {@link cleanFindings}, but a surface is never cleaned into silence while it * still gates. The derived-longhand strip assumes those props are reflow * CASUALTIES of a driving change shown elsewhere — when a surface's only changes * ARE derived longhands (a content-length drift widening a text span, or a pure * `width:`/`inset:` rule change), stripping them hid the entire change: the diff * exited 1 and the Action demanded approval while the report said "identical". * If cleaning leaves no findings but base/pseudo style findings existed, keep * those originals so the verdict and the evidence describe the same run — and so * `assessComparisonTruth` counts them as reviewable, keeping the raw-only * CERTIFICATION_FAILED backstop for shapes that truly cannot render (e.g. a * surface whose only raw deltas were suppressed state echoes). */ export declare function cleanFindingsForDisplay(findings: Finding[]): Finding[]; /** True when every shown prop across the group's findings is a size/position * longhand — the "geometry only, no driving property" shape that usually means * content-length drift rather than a stylesheet change. Lets renderers label * it so reviewers chase the content, not a phantom CSS edit. */ export declare function isGeometryOnlyGroup(findings: Finding[]): boolean; /** * Canonical comparison truth shared by styleproof-diff, generateStyleMapReport, * and the composite action trust verdict. * * The certification differ records every computed longhand (including reflow * casualties). The visual report strips derived size/position longhands so crops * stay on styling intent. Those two views must never independently invent a * trust state: STYLE_REVIEW_REQUIRED requires reviewable evidence (cleaned * findings, crops, or one-sided surfaces); raw-only derived noise fails closed * as a certification/consistency failure rather than a blind approval gate. */ export type ComparisonTruth = { rawCounts: DiffCounts; reviewableCounts: DiffCounts; newSurfaces: number; removedSurfaces: number; rawChangedSurfaces: number; reviewableChangedSurfaces: number; /** Cleaned findings, new surfaces, or removed surfaces a human can act on. */ hasReviewableEvidence: boolean; /** * Raw certification deltas that cleanFindings strips entirely — the report * would show no change sections/crops. Never map this to STYLE_REVIEW_REQUIRED. */ rawOnlyNoReviewable: boolean; /** Geometry drift paired with a changed own-text length existed somewhere — * informational: renderers use it to point reviewers at the content change. * It is reviewable evidence (approval clears it), never a certification * failure on its own. */ contentGeometryUncertain: boolean; }; /** Surface shape both the differ and the report already produce. */ export type ComparisonSurface = { surface: string; missing?: 'before' | 'after'; findings: Finding[]; }; /** * Assess one map-pair comparison for report/verdict coherence. * * When `rawCounts` is provided (from `diffStyleMapDirs`), it is used as-is so * JSON `counts` and the assessment share one tally. Otherwise counts are * recomputed from the surface findings. */ export declare function assessComparisonTruth(surfaces: ComparisonSurface[], rawCounts?: DiffCounts): ComparisonTruth;