import type { TargetOutput } from "../config/types.js"; /** Options for the fixture store controlling storage location, TTL, and behavior. */ export interface FixtureStoreOptions { /** Absolute path to the fixture storage directory. */ readonly baseDir: string; /** Strip the `raw` field from target output when recording. */ readonly stripRaw: boolean; /** Number of days before a fixture is considered stale. */ readonly ttlDays: number; /** If true, the runner treats missing or stale fixtures as errors instead of falling back to live mode. */ readonly strictFixtures: boolean; } /** * Discriminated union result from reading a fixture. * - `"hit"`: fixture found and valid, includes the cached output * - `"miss"` with `"not-found"`: no fixture file exists for this case * - `"miss"` with `"config-hash-mismatch"`: fixture exists but was recorded with a different config * - `"stale"`: fixture exists but has exceeded the TTL, includes the output and age for reporting */ export type FixtureReadResult = { readonly status: "hit"; readonly output: TargetOutput; } | { readonly status: "miss"; readonly reason: "not-found"; } | { readonly status: "miss"; readonly reason: "config-hash-mismatch"; readonly recordedHash: string; } | { readonly status: "stale"; readonly output: TargetOutput; readonly ageDays: number; }; /** Metadata about a single fixture file. */ export interface FixtureInfo { readonly suiteId: string; readonly caseId: string; /** Age of the fixture in days since last modification. */ readonly ageDays: number; /** Size of the fixture file on disk in bytes. */ readonly sizeBytes: number; } /** Aggregate statistics across all fixtures in the store. */ export interface FixtureStatsResult { readonly totalFixtures: number; /** Total size of all fixture files in bytes. */ readonly totalBytes: number; /** Number of distinct suites with recorded fixtures. */ readonly suiteCount: number; /** Age of the oldest fixture in days. 0 if no fixtures exist. */ readonly oldestAgeDays: number; /** Age of the newest fixture in days. 0 if no fixtures exist. */ readonly newestAgeDays: number; } /** Write a fixture entry for a case. Creates file if not exists, replaces if exists. */ export declare function writeFixture(suiteId: string, caseId: string, output: TargetOutput, configHash: string, options: FixtureStoreOptions): Promise; /** Read a fixture entry for a case. Returns a discriminated union result. */ export declare function readFixture(suiteId: string, caseId: string, configHash: string, options: FixtureStoreOptions): Promise; /** List all fixtures for a suite with staleness info. */ export declare function listFixtures(suiteId: string, options: Pick): Promise; /** Delete all fixtures for a suite. Returns count of deleted files. */ export declare function clearFixtures(suiteId: string, options: Pick): Promise; /** Get aggregate stats across all fixtures. */ export declare function fixtureStats(options: Pick): Promise; /** Deep sort all object keys for deterministic JSON output. */ export declare function sortKeysDeep(obj: unknown): unknown; /** Sanitize a name for use as a directory/file name. Appends a short hash to prevent collisions from lossy character replacement. */ export declare function sanitizeName(name: string): string; //# sourceMappingURL=fixture-store.d.ts.map