xypriss-security
Version:
Advanced High-Performance Security Framework. Military-grade encryption, post-quantum resilience, and fortified data structures.
93 lines • 2.27 kB
TypeScript
import { CachedData, FileCacheOptions, FileCacheStats, FileCacheCleanupOptions } from "./types/cache.type";
/**
* Comprehensive File Cache System
*/
export declare class FileCache {
private config;
private stats;
constructor(options?: Partial<FileCacheOptions>);
/**
* Initialize cache statistics by scanning existing files
*/
private initializeStats;
/**
* Ensure base cache directory exists
*/
private ensureBaseDirectory;
/**
* Update cache statistics
*/
private updateStats;
/**
* Update disk usage statistics
*/
private updateDiskUsage;
/**
* Calculate directory size recursively
*/
private getDirectorySize;
/**
* Update age distribution statistics
*/
private updateAgeDistribution;
/**
* Write data to file cache
*/
set(key: string, value: CachedData, options?: Partial<FileCacheOptions>): Promise<boolean>;
/**
* Read data from file cache
*/
get(key: string, updatedContent?: boolean): Promise<CachedData | null>;
/**
* Delete cache entry
*/
delete(key: string): Promise<boolean>;
/**
* Check if key exists and is not expired
*/
has(key: string): Promise<boolean>;
/**
* Clear all cache files
*/
clear(): Promise<void>;
/**
* Recursively delete directory
*/
private deleteDirectory;
/**
* Cleanup expired entries
*/
cleanup(_options?: Partial<FileCacheCleanupOptions>): Promise<{
cleaned: number;
errors: number;
totalSize: number;
}>;
/**
* Get all cache files recursively
*/
private getAllCacheFiles;
/**
* Get cache statistics with real-time updates
*/
getStats(): Promise<FileCacheStats>;
/**
* Get cache size information
*/
get size(): {
files: number;
bytes: number;
};
/**
* Get detailed cache information
*/
getCacheInfo(): Promise<{
config: Required<FileCacheOptions>;
stats: FileCacheStats;
health: {
healthy: boolean;
issues: string[];
recommendations: string[];
};
}>;
}
//# sourceMappingURL=cacheSys.d.ts.map