export interface ICache { get(key: string): Promise; set(key: string, value: any, expire: number | undefined, setnx?: boolean): Promise; delete(key: string): Promise; exists(key: string): Promise; expire(key: string, time: number, callBack?: Function): Promise; incrBy(key: string, number: number): Promise; incrByFloat(key: string, number: number): Promise; arrayPush(key: string, ...values: any[]): Promise; arraySlice(key: string, start: number, end: number): Promise>; arrayItem(key: string, index: number): Promise; arrayLength(key: string): Promise; setMapValue(key: string, id: string, value: any, expire: number | undefined, setnx?: boolean): Promise; setMapValues(key: string, values: Record, expire: number | undefined, setnx?: boolean): Promise; getMapValue(key: string, id: string): Promise; getMapValues(key: string, ids: Array): Promise>; deleteMapValue(key: string, id: string): Promise; getMapKeys(key: string): Promise; hasMapKey(key: string, id: string): Promise; clearMap(key: string): Promise; setHashValue(key: string, id: string, value: any, setnx?: boolean): Promise; getHashValue(key: string, id: string): Promise; deleteHashValue(key: string, id: string): Promise; getHashAll(key: string): Promise>; getHashKeys(key: string): Promise; hasHashKey(key: string, id: string): Promise; incrHashBy(key: string, id: string, number: number): Promise; incrHashByFloat(key: string, id: string, number: number): Promise; clearHash(key: string): Promise; } export declare class MemoryCache implements ICache { incrBy(key: string, number: number): Promise; incrByFloat(key: string, number: number): Promise; expire(key: string, time: number, callBack?: Function): Promise; exists(key: string): Promise; get(key: string): Promise; set(key: string, value: any, expire: number | undefined, setnx?: boolean): Promise; delete(key: string): Promise; arrayPush(key: string, ...values: any[]): Promise; arrayShift(key: string): Promise; arrayPop(key: string): Promise; arraySlice(key: string, start: number, end: number): Promise; arrayItem(key: string, index: number): Promise; arrayLength(key: string): Promise; setMapValue(key: string, id: string, value: any, expire: number | undefined, setnx?: boolean): Promise; getMapValue(key: string, id: string): Promise; setMapValues(keyName: string, values: Record, expire: number | undefined, setnx?: boolean): Promise; deleteMapValue(key: string, id: string): Promise; getMapKeys(key: string): Promise; getMapValues(key: string, ids: string[]): Promise; objectValues(key: string): Promise; hasMapKey(key: string, id: string): Promise; clearMap(key: string): Promise; setHashValue(key: string, id: string, value: any, setnx?: boolean): Promise; getHashValue(key: string, id: string): Promise; deleteHashValue(key: string, id: string): Promise; getHashKeys(key: string): Promise; hasHashKey(key: string, id: string): Promise; incrHashBy(key: string, field: string, number: number): Promise; incrHashByFloat(key: string, id: string, number: number): Promise; clearHash(key: string): Promise; getHashAll(key: string): Promise>; } /** 设置缓存 */ export declare function initCacheOption(cache: ICache, cachePrefix?: string): void; export declare abstract class ValueCache { abstract name: string; expire?: number; loadItem?(): Promise; get cacheName(): string; get(): Promise; set(value: T, setnx?: boolean): Promise; incrBy(key: string, number: number): Promise; incrByFloat(key: string, number: number): Promise; delete(): Promise; exist(): Promise; } export declare abstract class ArrayCache { abstract name: string; get cacheName(): string; expire(number: number): Promise; list(): Promise; push(...items: T[]): Promise; slice(start: number, end: number): Promise; item(index: number): Promise; length(): Promise; clear(): Promise; } /** * 对象缓存,支持属性独立管理和时效配置 */ export declare abstract class MapCache { abstract name: string; loadItem?(id: string): Promise; expire?: number; clear(): Promise; get cacheName(): string; updateItem(id: string): Promise; get(id: string): Promise; gets(ids: string[]): Promise>; set(id: string, value: T, setnx?: boolean): Promise; sets(values: Record | Array<{ key: string; value: T; }>, setnx?: boolean): Promise; has(id: string): Promise; delete(id: string): Promise; keys(): Promise; } export declare abstract class HashCache { abstract name: string; loadItem?(id: string): Promise; expire(number: number): Promise; exist(): Promise; clear(): Promise; get cacheName(): string; updateItem(id: string): Promise; get(id: string): Promise; set(id: string, value: T, setnx?: boolean): Promise; getAll(): Promise>; has(id: string): Promise; delete(id: string): Promise; keys(): Promise; incrHashBy(id: string, number: number): Promise; incrHashByFloat(id: string, number: number): Promise; }