resolvo-cms
Version:
Headless CMS for Resolvo websites with real-time content management
41 lines • 1.19 kB
TypeScript
export interface CacheItem<T = any> {
data: T;
timestamp: number;
ttl: number;
}
export declare class ContentCache {
private readonly cleanupIntervalMs;
private cache;
private cleanupInterval;
private readonly defaultTTL;
private readonly maxSize;
constructor(cleanupIntervalMs?: number);
get<T>(key: string): T | null;
set<T>(key: string, data: T, ttl?: number): void;
delete(key: string): boolean;
clear(): void;
has(key: string): boolean;
size(): number;
private isExpired;
private evictOldest;
private startCleanupInterval;
private cleanup;
destroy(): void;
}
export declare class SchemaCache extends ContentCache {
private fieldCache;
getField(schemaId: string, fieldName: string): any;
setField(schemaId: string, fieldName: string, data: any): void;
clearSchema(schemaId: string): void;
}
export declare class LRUCache<T = any> {
private capacity;
private cache;
constructor(capacity?: number);
get(key: string): T | null;
set(key: string, value: T): void;
delete(key: string): boolean;
clear(): void;
size(): number;
}
//# sourceMappingURL=cache.d.ts.map