import * as LRUCache from 'lru-cache'; export type MultiCache = Omit & Pick; export type Config = { ttl?: Milliseconds; refreshThreshold?: Milliseconds; isCacheable?: (val: unknown) => boolean; }; export type Milliseconds = number; export type Store = { get(key: string): Promise; set(key: string, data: T, ttl?: Milliseconds): Promise; del(key: string): Promise; reset(): Promise; mset(args: [string, unknown][], ttl?: Milliseconds): Promise; mget(...args: string[]): Promise; mdel(...args: string[]): Promise; keys(pattern?: string): Promise; ttl(key: string): Promise; }; export type StoreConfig = Config; export type FactoryConfig = T & Config; export type FactoryStore = (config?: FactoryConfig) => S | Promise; export type Stores = 'memory' | Store | FactoryStore; export type CachingConfig = MemoryConfig | StoreConfig | FactoryConfig; export type WrapTTL = Milliseconds | ((v: T) => Milliseconds); export type Cache = { set: (key: string, value: unknown, ttl?: Milliseconds) => Promise; get: (key: string) => Promise; del: (key: string) => Promise; reset: () => Promise; wrap(key: string, fn: () => Promise, ttl?: WrapTTL): Promise; methodWrap(key: string, fn: (...args: any[]) => Promise, fnArgs: any[], ttl?: WrapTTL): Promise; store: S; }; export type LRU = LRUCache; type Pre = LRUCache.LimitedByTTL; type Options = Omit & Partial>; export type MemoryConfig = { max?: number; sizeCalculation?: (value: unknown, key: string) => number; shouldCloneBeforeSet?: boolean; } & Options & Config; export type MemoryStore = Store & { get size(): number; dump: LRU['dump']; load: LRU['load']; calculatedSize: LRU['calculatedSize']; }; export type MemoryCache = Cache; export {}; //# sourceMappingURL=types.d.ts.map