hypershield
Version:
Middleware suite for high-performance and resilient APIs
25 lines • 931 B
TypeScript
import { ICacheProvider } from '../../domains/cache/domain/ICacheProvider';
import { MemoryCacheOptions } from '../../core/types/cacheTypes';
export declare class MemoryCache implements ICacheProvider {
private cache;
private compression;
private options;
private currentSize;
private pruneIntervalId?;
constructor(options?: MemoryCacheOptions);
private startPruneInterval;
cleanup(): void;
private prune;
private pruneLRU;
private isExpired;
private calculateSize;
get<T>(key: string): Promise<T | null>;
set<T>(key: string, value: T, ttl?: number): Promise<void>;
delete(key: string): Promise<void>;
clear(): Promise<void>;
mget<T>(keys: string[]): Promise<(T | null)[]>;
exists(key: string): Promise<boolean>;
updateTTL(key: string, ttl: number): Promise<boolean>;
getTTL(key: string): Promise<number | null>;
}
//# sourceMappingURL=memory.d.ts.map