import type { Uint8Array_ } from '../../types/index.js'; /** A full URL string, including protocol (e.g. `https://example.com`) */ export type MDSServerURL = string; /** A lowercase AAGUID string (e.g. `3add0b21-6513-4323-81a2-74c78f3ea651`) */ export type AAGUID = string; export type CachedMDSServer = { url: MDSServerURL; no: number; nextUpdate: Date; }; export declare const NonRefreshingURL = ""; /** * An MDS-aware metadata cache that tracks MDS servers and the data downloaded from them. This * includes tracking when an MDS server needs to be refreshed, but does not actually perform the * refresh. */ export declare class MDSCache { private serverCache; private metadataCache; /** * Set up a Metadata Service API for periodic refreshes */ registerMDSServer(url: MDSServerURL, no: number, nextUpdate: Date): void; /** * Add the provided metadata to the cache, keyed by its corresponding AAGUID */ cacheMetadata(aaguid: AAGUID, metadata: MetadataType, url: MDSServerURL): void; /** * Retrieve cached metadata by AAGUID */ getMetadata(aaguid: AAGUID | Uint8Array_): MetadataType | undefined; /** * Return how many metadata entries have been cached */ get count(): number; /** * Clear out caches */ reset(): void; /** * Remove cached Metadata Service data for a specific API server. If the URL indicates data that * should not be refreshed, then simply exit. */ clearMetadataByURL(url: MDSServerURL): void; /** * Whether an MDS server has been registered for periodic refreshes */ mdsServerIsRegistered(url: MDSServerURL): boolean; /** * Set the MDS server's nextUpdate */ setMDSServerNextUpdate(url: MDSServerURL, newNextUpdate: Date): void; /** * Retrieve the version number of the MDS server's latest known data */ getMDSServerDataVersion(url: MDSServerURL): CachedMDSServer['no']; /** * Return a list of MDS server URLs with nextUpdates earlier than the provided date */ getStaleMDSServerURLs(date: Date): MDSServerURL[]; /** * Ensure that AAGUIDs are all lowercase before using them as cache keys */ private normalizeAAGUID; } //# sourceMappingURL=mdsCache.d.ts.map