/** * Central cache manager for performance optimization * Provides TTL-based caching with invalidation hooks */ export declare class CacheManager { private static instance; private availabilityCache; private sizeCache; private constructor(); static getInstance(): CacheManager; /** * Get cached availability with TTL (default: 5 minutes) */ getCachedAvailability(tool: string, checkFn: () => Promise, ttl?: number): Promise; /** * Get cached directory size with TTL (default: 2 minutes) */ getCachedSize(path: string, sizeFn: () => Promise, ttl?: number): Promise; /** * Invalidate size cache for path (call after clear operations) */ invalidateSize(path: string): void; /** * Invalidate all size caches matching a prefix */ invalidateSizePrefix(prefix: string): void; /** * Clear all caches (use with --refresh flag) */ clearAll(): void; /** * Get cache statistics for debugging */ getStats(): { availabilityCacheSize: number; sizeCacheSize: number; }; } export declare const cacheManager: CacheManager; /** * Check tool availability with caching (5-minute TTL by default) * Use this in cleaner isAvailable() methods to avoid repeated command executions * * @param toolName - Unique identifier for the tool (e.g., 'npm', 'docker') * @param checkFn - Async function that returns true if tool is available * @param ttl - Time-to-live in milliseconds (default: 5 minutes) * @returns Promise - Whether the tool is available * * @example * async isAvailable(): Promise { * return checkToolAvailability('npm', async () => { * await execa('npm', ['--version']); * return true; * }); * } */ export declare function checkToolAvailability(toolName: string, checkFn: () => Promise, ttl?: number): Promise; //# sourceMappingURL=cache.d.ts.map