import { LRUCache } from 'lru-cache'; import { type SerializableLruOptions, type Stats } from './messages.js'; import { type L1Stats } from './l1.js'; type NonNullish = {}; export interface WriteOptions { ttl?: number; size?: number; updateL1?: boolean; } export interface ReadOptions { bypassL1?: boolean; } export type MSetEntry = [K, V] | [K, V, WriteOptions]; export interface FetchOptions extends WriteOptions { forceRefresh?: boolean; bypassL1?: boolean; } export type LocalL1Options = { enabled?: boolean; max?: number; maxSize?: number; ttl?: number; updateAgeOnGet?: boolean; allowStale?: boolean; cacheUndefined?: boolean; invalidation?: 'broadcast' | 'ttl-only'; methods?: { get?: boolean; has?: boolean; fetch?: boolean; }; experimental?: boolean; }; export interface LRUCacheClusterOptions extends SerializableLruOptions { namespace?: string; timeout?: number; failsafe?: 'resolve' | 'reject'; localL1?: false | LocalL1Options; } interface InternalOptions { noInit?: boolean; } export declare class LRUCacheClustered { #private; readonly namespace: string; readonly timeout: number; readonly failsafe: 'resolve' | 'reject'; readonly ready: Promise; constructor(options?: LRUCacheClusterOptions & InternalOptions); static getInstance(options?: LRUCacheClusterOptions): Promise>; static bootstrap(): void; static getAllCaches(): Map>; getCache(): LRUCache | undefined; get(key: K, opts?: ReadOptions): Promise; set(key: K, value: V, opts?: WriteOptions): Promise; delete(key: K): Promise; has(key: K, opts?: ReadOptions): Promise; peek(key: K, opts?: ReadOptions): Promise; clear(): Promise; purgeStale(): Promise; mGet(keys: K[], opts?: ReadOptions): Promise>; mSet(entries: Iterable>, opts?: WriteOptions): Promise; mDelete(keys: K[]): Promise; keys(): Promise; values(): Promise; entries(): Promise<[K, V][]>; dump(): Promise<[K, LRUCache.Entry][]>; size(): Promise; incr(key: K, amount?: number, opts?: WriteOptions): Promise; decr(key: K, amount?: number, opts?: WriteOptions): Promise; allowStale(value?: boolean): Promise; max(value?: number): Promise; ttl(value?: number): Promise; getRemainingTTL(key: K): Promise; setIfAbsent(key: K, value: V, opts?: WriteOptions): Promise; load(entries: Array<[K, LRUCache.Entry]>): Promise; destroy(): Promise; healthCheck(): Promise; stats(): Promise; localStats(): L1Stats | undefined; on(event: string, listener: (...args: unknown[]) => void): this; off(event: string, listener: (...args: unknown[]) => void): this; once(event: string, listener: (...args: unknown[]) => void): this; clearLocal(): void; invalidateLocal(key: K): void; withoutLocal(): LRUCacheClustered; [Symbol.asyncIterator](): AsyncIterableIterator<[K, V]>; fetch(key: K, fetcher: (key: K) => Promise | V, opts?: FetchOptions): Promise; } export { LRUCacheClustered as LRUCacheForClustersAsPromised }; export { memoize, type MemoizeOptions } from './memoize.js'; export { wrap, type Codec, type WrappedCache } from './codec.js'; export default LRUCacheClustered; //# sourceMappingURL=index.d.ts.map