mastercache
Version:
Multi-tier cache module for Node.js. Redis, Upstash, CloudfareKV, File, in-memory and others drivers
20 lines (18 loc) • 527 B
TypeScript
/**
* Represents a cache entry stored inside a cache driver.
*/
declare class CacheEntry {
#private;
constructor(key: string, item: Record<string, any>);
getValue(): any;
getKey(): string;
getLogicalExpiration(): number;
getEarlyExpiration(): number;
isLogicallyExpired(): boolean;
isEarlyExpired(): boolean;
static fromDriver(key: string, item: string): CacheEntry;
applyFallbackDuration(duration: number): this;
expire(): this;
serialize(): string;
}
export { CacheEntry };