import cacheManager from 'cache-manager'; import type { Defined } from './index.js'; export type MultiStoreOpt = Pick & { refreshThreshold?: number; }; export declare function createMultiLevelStore(cacheKey: string, opts: { default: MultiStoreOpt & cacheManager.CacheOptions; local?: MultiStoreOpt | false; /** * The global store will ignore the `max` anyway, so avoiding passing it in will help reduce confusion */ global?: Exclude; /** * Do not use the api version as part of the cache key, this disables automatic invalidation on * version updates and so anything that may change the result needs to be manually invalidated, * eg by changing the cacheKey */ useVersion: boolean; }): { get: (key: string) => Promise; set: (key: string, value: T) => Promise; delete: (key: string) => Promise; wrap: (key: string, fn: () => T | Promise) => Promise; };