import { Mongoose } from 'mongoose'; import { RedisOptions } from 'ioredis'; declare const UNITS: { readonly milliseconds: 1; readonly millisecond: 1; readonly msecs: 1; readonly msec: 1; readonly ms: 1; readonly seconds: 1000; readonly second: 1000; readonly secs: 1000; readonly sec: 1000; readonly s: 1000; readonly minutes: number; readonly minute: number; readonly mins: number; readonly min: number; readonly m: number; readonly hours: number; readonly hour: number; readonly hrs: number; readonly hr: number; readonly h: number; readonly days: number; readonly day: number; readonly d: number; readonly weeks: number; readonly week: number; readonly w: number; readonly months: number; readonly month: number; readonly mo: number; readonly years: number; readonly year: number; readonly yrs: number; readonly yr: number; readonly y: number; }; type Unit = keyof typeof UNITS; type Duration = number | `${number}` | `${number}${Unit}` | `${number} ${Unit}`; type CacheData = Record | Record[] | unknown[] | number | undefined; type CacheOptions = { engine: 'memory' | 'redis'; engineOptions?: RedisOptions; defaultTTL?: Duration; debug?: boolean; onError?: (error: Error) => void; maxEntries?: number; maxBytes?: number; sizeCalculation?: (value: CacheData) => number; }; interface CacheEngine { get: (key: string) => Promise | CacheData; set: (key: string, value: CacheData, ttl?: Duration) => Promise | void; del: (key: string) => Promise | void; clear: () => Promise | void; close: () => Promise | void; } declare module 'mongoose' { interface Query { cache: (this: Query, ttl?: Duration, customKey?: string) => this; _key: string | null; getCacheKey: (this: Query) => string; _ttl: Duration | null; getDuration: (this: Query) => Duration | null; op?: string; _path?: unknown; _fields?: unknown; _distinct?: unknown; _conditions?: unknown; } interface Aggregate { cache: (this: Aggregate, ttl?: Duration, customKey?: string) => this; _key: string | null; getCacheKey: (this: Aggregate) => string; _ttl: Duration | null; getDuration: (this: Aggregate) => Duration | null; } } declare class CacheMongoose { #private; private cache; private constructor(); static init(mongoose: Mongoose, cacheOptions: CacheOptions): CacheMongoose; clear(customKey?: string): Promise; close(): Promise; } export { CacheMongoose as default }; export type { CacheData, CacheEngine, CacheOptions, Duration }; //# sourceMappingURL=index.d.mts.map