import { TeMongoDBUnit } from "./mongodb/TeMongodb"; interface ifCacheKeepOption { type: 'unknow' | 'file' | 'mongo'; path?: string | TeMongoDBUnit; } export declare class CacheMoudle { private static thread; private static handle; /**5s 检查一次 */ static init(): Promise; /** * 创建cache * @param name 模块名字 如果没有名字将不支持自动update功能 * @param ttl 数据有效期 等于0的时候不更新 小于0的时候不计算ttl */ static createCache(name?: string, ttl?: number, keep?: ifCacheKeepOption): CacheMoudle; static removeCache(name: string): void; static update(): Promise; static cacheMap: { [key: string]: CacheMoudle; }; valueCache: { [roleId: string]: { time: number; value: T; }; }; private loader; private getfresh; ttl: number; name: string; private constructor(); init(): Promise; change: boolean; /** * * @param key * @param value 内容 * @param time 当 ttl 大于等于0时设置的当前时间或者不设置,ttl小于0时设置过期的时间 */ set(key: string, value: T, time?: number): Promise; has(key: string): boolean; hasOwnProperty(key: string): boolean; get(key: string): T | undefined; del(key: string): Promise; /** * 遍历内容 * @param cb 当方法返回 true时 结束遍历(break) */ forEach(cb: (value: T, key: string) => boolean | void): T | undefined; clear(): void; private _update; } export {};