structure-validation
Version:
A Node.js CLI tool for validating codebase folder and file structure using a clean declarative configuration. Part of the guardz ecosystem for comprehensive TypeScript development.
58 lines • 1.42 kB
TypeScript
/**
* Infrastructure service for caching validation results and configuration
*/
export declare class CacheService {
private readonly cacheDir;
private readonly cacheFile;
private cache;
private fileTimestamps;
constructor(cacheDir?: string);
/**
* Get cached value by key
*/
get<T>(key: string): T | null;
/**
* Set cached value with optional expiration
*/
set<T>(key: string, value: T, ttlMs?: number): void;
/**
* Check if a file has been modified since last cache
*/
isFileModified(filePath: string): boolean;
/**
* Invalidate cache for specific key
*/
invalidate(key: string): void;
/**
* Clear all cache
*/
clear(): void;
/**
* Get cache statistics
*/
getStats(): {
size: number;
keys: string[];
};
/**
* Load cache from disk
*/
private loadCache;
/**
* Save cache to disk
*/
private saveCache;
/**
* Generate cache key for configuration
*/
getConfigKey(configPath: string): string;
/**
* Generate cache key for file discovery
*/
getFileDiscoveryKey(basePath: string, patterns: string[], configRoot?: string): string;
/**
* Generate cache key for validation results
*/
getValidationKey(files: string[], rules: string[]): string;
}
//# sourceMappingURL=CacheService.d.ts.map