import type { Observation } from '@variance-authority/observe'; import { type Raster } from '@variance-authority/core/format'; import type { BaselineKey, RasterStore } from '@variance-authority/raster'; import type { SnapshotCase } from './arranged.js'; /** * Where the three images a person looks at were written. * * A verdict sentence names the components and counts the pixels, and a reviewer * still asks to see it. Every incumbent answers that with a picture; a suite * driving this library from its own runner got the sentence and nothing else, * so the only way to look at a disagreement was to write a differ. That is the * gap this closes, and it is bytes on disk rather than bytes on `Observation` * because a 700-subject suite holding two PNGs per subject in memory is the * shape that makes the tool unusable on a real suite. */ export interface Evidence { /** The stored baseline. Absent when there was none to subtract from. */ readonly before?: string; /** * What this run painted. Absent only when the subject occupies no pixels, in * which case there was nothing to paint and `before` is a picture of what it * used to occupy. */ readonly after?: string; /** `before` subtracted from `after`. Absent exactly when either of them is. */ readonly diff?: string; } /** * Write what this observation compared, and say where it went. * * The candidate is handed in rather than looked up: both capture paths already * hold it at the point they decide, and re-reading it would be a second lookup * for the few subjects that need one. The baseline is looked up here, after the * verdict check, because for a subject nobody will look at the read is waste. * * Returns nothing when the verdict is not one a person stops on, so a caller can * report the absence as "there was nothing to show" rather than as a failure to * write. */ export declare function writeEvidence(directory: string, key: BaselineKey, observation: Observation, candidate: Raster, store: RasterStore): Promise; /** * An observation, and where its images were written when evidence was asked for. * Taken through the runner's fixture, it names the case it was taken in. */ export interface Observed extends Observation { readonly evidence?: Evidence; readonly case?: SnapshotCase; } /** * Attach the evidence to an observation, when the caller asked for any. * * The candidate arrives as a thunk because the two capture paths reach it * differently -- in place it is already in hand, deferred it is a render-cache * lookup -- and neither should pay for it on the great majority of subjects that * agree with their baseline. A path with no candidate at all (a settled verdict, * which paints nothing) answers `null`, and the observation passes through * unchanged: there is no image to show because none was made. */ export declare function withEvidence(runtime: { readonly evidence?: string; readonly store: RasterStore; }, key: BaselineKey, observation: Observation, candidate: () => Promise): Promise; //# sourceMappingURL=evidence.d.ts.map