@typecad/kicad-symbols
Version:
Intelligent fuzzy search for KiCad symbols with CLI interface
46 lines • 1.96 kB
TypeScript
import { TimestampManager } from './TimestampManager.js';
/**
* Manages cache validation based on remote "Last updated" dates
* Extends TimestampManager to add date-based cache validation
*/
export declare class DateBasedCacheManager extends TimestampManager {
private readonly lastUpdatedFile;
private readonly useSharedCacheForDates;
constructor(cacheDir?: string, cacheExpirationHours?: number, useSharedCache?: boolean);
/**
* Gets the last updated file path, creating shared cache directory if needed
*/
private getLastUpdatedFile;
/**
* Gets the stored "Last updated" date from the cache
* @returns The last updated date as a Date object, or null if not found or invalid
*/
getLastUpdatedDate(): Promise<Date | null>;
/**
* Stores the "Last updated" date to the cache
* @param date The last updated date to store
*/
setLastUpdatedDate(date: Date): Promise<void>;
/**
* Checks if the cache is stale based on comparing stored date with remote date
* @param remoteDate The current "Last updated" date from the remote source
* @returns true if cache is stale (dates don't match or no stored date exists)
*/
isCacheStaleByDate(remoteDate: Date): Promise<boolean>;
/**
* Comprehensive cache validation that combines date-based and time-based checks
* @param remoteDate The current "Last updated" date from the remote source (optional)
* @returns true if cache is stale and needs to be refreshed
*/
isCacheStale(remoteDate?: Date): Promise<boolean>;
/**
* Checks if we should validate against the remote date based on 24-hour interval
* @returns true if more than 24 hours have passed since last check
*/
private shouldCheckRemoteDate;
/**
* Deletes both timestamp and last updated date files
*/
deleteTimestamp(): Promise<void>;
}
//# sourceMappingURL=DateBasedCacheManager.d.ts.map