export type CacheProvider = { /** * Get a cached value by key, or create it using the factory. */ get: (key: string, factory: () => T) => T; /** * Get a cached value by key, or create it using an async factory. * * The promise is cached, so concurrent calls with the same key * share the same in-flight promise. Rejected promises are evicted * so the next call retries. */ getAsync: (key: string, factory: () => Promise) => Promise; /** * Remove a cached entry so the next get/getAsync call recreates it. */ invalidate: (key: string) => void; /** * Remove all cached entries. */ invalidateAll: () => void; }; export default function (): CacheProvider;