import { QuickMongoClient } from '../QuickMongoClient'; /** * Cache manager class. * * Type parameters: * * - `K` (`any`) - The cache map key type. * - `V` (`any`) - The cache map value type. * * @template K The cache map key type. * @template V The cache map value type. */ export declare class CacheManager { private _client; /** * Database cache. * @type {Map} * @private */ private _cache; /** * Cache manager constructor. * @param {QuickMongoClient} client Quick Mongo client to get attached to. */ constructor(client: QuickMongoClient); /** * Gets the cache map as an object. * * Type parameters: * * - `V` (`any`) - The type of cache object to return. * * @returns {any} Object representation of the cache map. * @template V The type of cache object to return. */ getCacheObject = any>(): V; /** * Parses the key and fetches the value from cache map. * * Type parameters: * * - `V` (`any`) - The type of data being returned. * * @param {K} key The key in cache map. * @returns {V} The data from cache map. * * @template V The type of data being returned. */ get(key: K): TValue; /** * Determines if the data is stored in database. * @param {K} key The key to access the target in database by. * @returns {boolean} Whether the data is stored in database. */ has(key: K): boolean; /** * Parses the key and sets the value in cache map. * * Type parameters: * * - `TValue` (`any`) - The type of data being set. * - `R` (`any`) - The type of data being returned. * * @param {K} key The key in cache map. * @returns {R} The data from cache map. * * @template TValue The type of data being set. * @template TReturnType The type of data being returned. */ set(key: K, value: TValue): TReturnType; /** * Parses the key and deletes it from cache map. * @param {K} key The key in cache map. * @returns {boolean} `true` if deleted successfully. */ delete(key: K): boolean; /** * Clears the cache. * @returns {boolean} `true` if cleared successfully. */ clear(): boolean; }