export type CacheLoader = (key: K) => Promise; export interface CacheProvider { /** * Gets the cached value for the given key. * * If there is no cached value, a fresh value is retrieved from the given `loader` function. * * @param {K} key The key associated with the value to retrieve from the cache. * @param {CacheLoader} loader A function to load a fresh value. * @returns {Promise} A promise that resolves to the latest cached value. */ get(key: K, loader: CacheLoader): Promise; /** * Removes the value for the given key from the cache. * * @param {K} key The key associated with the value to remove from the cache. * @returns {Promise} */ delete(key: K): Promise; /** * Sets the value for the given key. * * @param {K} key The key associated with the value to remove from the cache. * @param {V} value * @returns {Promise} */ set(key: K, value: V): Promise; }