/** * Pattern compilation caching for performance optimization * * This module provides LRU caching for compiled glob and ignore patterns * to optimize repeated pattern operations in file discovery. */ import ignore from 'ignore'; /** * Cache statistics for monitoring performance */ export interface CacheStats { readonly hits: number; readonly misses: number; readonly size: number; readonly hitRate: number; } /** * LRU Cache configuration options */ export interface CacheOptions { readonly maxSize: number; readonly ttlMs: number; readonly enableStats: boolean; } /** * Compiled glob pattern with normalization */ export interface CompiledGlobPattern { readonly patterns: string[]; readonly options: object; readonly normalized: string; } /** * Pattern cache implementation for glob and ignore patterns */ export declare class PatternCache { private readonly globCache; private readonly ignoreCache; private readonly cleanupInterval; constructor(options?: Partial); /** * Get or create compiled glob pattern */ getGlobPattern(patterns: string[], options?: object): CompiledGlobPattern; /** * Get or create ignore pattern instance */ getIgnorePattern(patterns: string[]): ReturnType; /** * Create cache key for glob patterns */ private createGlobKey; /** * Create cache key for ignore patterns */ private createIgnoreKey; /** * Normalize patterns for consistent caching */ private normalizePatterns; /** * Get combined cache statistics */ getStats(): { glob: CacheStats; ignore: CacheStats; combined: CacheStats; }; /** * Clear all caches */ clear(): void; /** * Get total cache size */ get size(): number; /** * Destroy cache and cleanup resources */ destroy(): void; } /** * Get the global pattern cache instance */ export declare function getGlobalPatternCache(): PatternCache; /** * Reset the global pattern cache */ export declare function resetGlobalPatternCache(): void; /** * Configure the global pattern cache */ export declare function configureGlobalPatternCache(options: Partial): PatternCache; //# sourceMappingURL=pattern-cache.d.ts.map