type DataSourceCacheDefaultConfig = { /** * Time To Live for each cache entry in milliseconds. * After this time the cache entry will become stale and the next query will result in cache miss. * @default 300_000 (5 minutes) */ ttl?: number; }; export interface DataSourceCache { /** * Set the cache entry for the given key. * @param {string} key The key of type `string` * @param {T[]} value The value to be stored in the cache */ set: (key: string, value: T[]) => void; /** * Get the cache entry for the given key. * @param {string} key The key of type `string` * @returns {T[] | undefined | -1} The value stored in the cache, `undefined` if not found, or `-1` if the cache entry is stale. */ get: (key: string) => T[] | undefined | -1; /** * Clear the cache. */ clear: () => void; } export declare class DataSourceCacheDefault implements DataSourceCache { private cache; private ttl; constructor({ ttl }: DataSourceCacheDefaultConfig); set(key: string, value: T[]): void; get(key: string): T[] | undefined | -1; clear(): void; } export {};