ailock
Version:
AI-Proof File Guard - Protect sensitive files from accidental AI modifications
51 lines • 1.27 kB
TypeScript
/**
* Git Repository Detection Cache
*
* Provides caching for expensive Git repository detection operations
* to improve performance when working with many files.
*/
export declare class GitRepoCache {
private static instance;
private cache;
private readonly TTL_MS;
private readonly MAX_ENTRIES;
private constructor();
static getInstance(): GitRepoCache;
/**
* Get cached repository root for a path
*/
get(path: string): string | null | undefined;
/**
* Set cached repository root for a path
*/
set(path: string, repoRoot: string | null): void;
/**
* Clear the entire cache
*/
clear(): void;
/**
* Clear expired entries
*/
clearExpired(): void;
/**
* Get cache statistics
*/
getStats(): {
size: number;
maxSize: number;
ttlMs: number;
};
/**
* Invalidate cache entries for a specific repository
*/
invalidateRepo(repoRoot: string): void;
/**
* Invalidate cache entries under a specific path
*/
invalidatePath(basePath: string): void;
}
/**
* Export singleton instance methods for convenience
*/
export declare const gitRepoCache: GitRepoCache;
//# sourceMappingURL=git-cache.d.ts.map