UNPKG

@typecad/jlcpcb-parts

Version:

Intelligent fuzzy search for JLCPCB electrical components with CLI interface

57 lines 2.31 kB
/** * Utility class for managing shared cache directories across the application. * Provides OS-appropriate temporary directory handling and cache path resolution. */ export declare class CacheUtils { private static readonly APP_CACHE_DIR_NAME; private static _sharedCacheDir; /** * Gets the shared cache directory path, creating it if it doesn't exist. * Uses OS-appropriate temporary directory locations: * - Windows: %TEMP%\typecad-jlcpcb-parts-cache\ * - macOS/Linux: /tmp/typecad-jlcpcb-parts-cache/ * * @returns Promise that resolves to the shared cache directory path */ static getSharedCacheDir(): Promise<string>; /** * Resolves a cache file path, either in the shared cache directory or a custom directory. * * @param fileName - Name of the cache file * @param useSharedCache - Whether to use shared cache directory (default: true) * @param customCacheDir - Custom cache directory to use when useSharedCache is false (default: current directory) * @returns Promise that resolves to the full file path */ static resolveCacheFilePath(fileName: string, useSharedCache?: boolean, customCacheDir?: string): Promise<string>; /** * Clears the shared cache directory by removing all files within it. * The directory itself is kept for future use. * * @returns Promise that resolves when cache is cleared */ static clearSharedCache(): Promise<void>; /** * Gets information about the shared cache directory. * * @returns Promise that resolves to cache directory info, or null if directory doesn't exist */ static getCacheInfo(): Promise<{ path: string; exists: boolean; size: number; fileCount: number; } | null>; /** * Validates that a cache directory is writable. * * @param cacheDir - Directory path to validate * @returns Promise that resolves to true if directory is writable */ static validateCacheDirectory(cacheDir: string): Promise<boolean>; /** * Resets the cached shared cache directory path. * Useful for testing or when the cache directory needs to be recalculated. */ static resetCachedPath(): void; } //# sourceMappingURL=CacheUtils.d.ts.map