import type { ViteDevServer } from 'vite'; export interface CachedTestFileResult { hash: string; status: 'pass' | 'fail'; events: { eventName: string; data: any; }[]; } /** * Caches test file outcomes and dependency tree hashes for instant feedback in watch mode. */ export declare class TestCache { #private; /** * Computes a combined SHA-256 hash of a test file and its imported dependency graph. * * @param filePath - Absolute path to the test file. * @param viteServer - Optional Vite development server to inspect the module dependency graph. */ computeFileHash(filePath: string, viteServer?: ViteDevServer): string; /** * Checks if a test file has a valid, passing cached result matching the current hash. * * @param filePath - Absolute path to the test file. * @param currentHash - Current computed hash of the test file and its dependencies. */ hasValidPass(filePath: string, currentHash: string): boolean; /** * Retrieves the cached entry for a test file. * * @param filePath - Absolute path to the test file. */ get(filePath: string): CachedTestFileResult | undefined; /** * Records or updates the test result cache for a file. * * @param filePath - Absolute path to the test file. * @param hash - Computed hash for the test file and dependencies. * @param status - Overall status ('pass' or 'fail'). * @param events - Stream of events captured for this test file. */ recordResult(filePath: string, hash: string, status: 'pass' | 'fail', events: { eventName: string; data: any; }[]): void; /** * Invalidates cache entry for a specific test file. * * @param filePath - Absolute path to the test file. */ invalidate(filePath: string): void; /** * Clears all cached test results. */ clear(): void; }