import { type Frame } from "../issues/frames.js"; import { type RulingBaseline } from "../fix/state.js"; import type { BacklogFinding } from "../backlog/lib.js"; import { type FixCluster } from "../fix/cluster.js"; import type { ResolvedConfig, ShotRecord } from "../types.js"; export interface BaselineDescription { kind: "ruling" | "frozen" | "report"; runId?: string; at?: string; } export interface IssueBaseline { hashes: Map; /** * Where the baseline pixels still are, for the shots lookout can find a file * for whose bytes hash to the baseline hash. A shot missing from this map is * one the ruling can only say "changed" about, never by how much: the * previous ruling recorded hashes but the workspace has moved on since. */ pixels: Map; described: BaselineDescription; } /** * A frozen frame that knows which shot it is a copy of, what its pixels hashed * to, and where the file is. */ export type HashedFrame = Pick & { abs?: string; }; /** * A shot from the capture report. The axes are optional because callers that * only remember hashes (and the tests that stand in for them) have nothing to * scope by, and get no workspace pixels rather than the wrong ones. */ export type WorkspaceShot = Pick & Partial>; /** A shot the workspace still holds, as the baseline reads it. */ export interface PriorShot { id: string; hash: string; /** Absolute path, when this shot's file is still on disk. */ abs?: string; } /** * The per-shot precedence, pure: the last ruling's hash, then the frozen * frame's, then whatever the workspace and the backlog remember. */ export declare function issueBaseline(input: { ruling?: RulingBaseline; frozen: HashedFrame[]; priorShots: readonly PriorShot[]; findings: readonly BacklogFinding[]; }): IssueBaseline; /** * The baseline for one issue, read off its own folder before the workspace is * asked. * * Workspace shots are narrowed to the routes this ruling will re-capture: the * report holds every shot of the project, and the only reason to name a file * here is so its pixels can be read before the capture writes over them. */ export declare function loadIssueBaseline(resolved: ResolvedConfig, cluster: FixCluster, priorShots: readonly WorkspaceShot[], findings: readonly BacklogFinding[], configuredRoutes?: readonly string[]): Promise; /** What the next ruling compares against: every shot this ruling captured, by hash. */ export declare function rulingBaselineOf(shotsById: ReadonlyMap): RulingBaseline | undefined;