interface CacheExpirationConfig { /** * The maximum number of entries to cache. Entries used least recently will * be removed as the maximum is reached. */ maxEntries?: number; /** * The maximum age of an entry before it's treated as stale and removed. */ maxAgeSeconds?: number; /** * The [`CacheQueryOptions`](https://developer.mozilla.org/en-US/docs/Web/API/Cache/delete#Parameters) * that will be used when calling `delete()` on the cache. */ matchOptions?: CacheQueryOptions; } /** * Allows you to expires cached responses based on age or maximum number of entries. * @see https://serwist.pages.dev/docs/serwist/core/cache-expiration */ export declare class CacheExpiration { private _isRunning; private _rerunRequested; private readonly _maxEntries?; private readonly _maxAgeSeconds?; private readonly _matchOptions?; private readonly _cacheName; private readonly _timestampModel; /** * To construct a new `CacheExpiration` instance you must provide at least * one of the `config` properties. * * @param cacheName Name of the cache to apply restrictions to. * @param config */ constructor(cacheName: string, config?: CacheExpirationConfig); /** * Expires entries for the given cache and given criteria. */ expireEntries(): Promise; /** * Updates the timestamp for the given URL, allowing it to be correctly * tracked by the class. * * @param url */ updateTimestamp(url: string): Promise; /** * Checks if a URL has expired or not before it's used. * * This looks the timestamp up in IndexedDB and can be slow. * * Note: This method does not remove an expired entry, call * `expireEntries()` to remove such entries instead. * * @param url * @returns */ isURLExpired(url: string): Promise; /** * Removes the IndexedDB used to keep track of cache expiration metadata. */ delete(): Promise; } export {}; //# sourceMappingURL=CacheExpiration.d.ts.map