@memberjunction/react-runtime
Version:
Platform-agnostic React component runtime for MemberJunction. Provides core compilation, registry, and execution capabilities for React components in any JavaScript environment.
38 lines • 962 B
TypeScript
export interface CacheEntry<T> {
value: T;
timestamp: number;
size?: number;
}
export interface CacheOptions {
maxSize?: number;
maxMemory?: number;
defaultTTL?: number;
cleanupInterval?: number;
}
export declare class CacheManager<T = any> {
private cache;
private memoryUsage;
private cleanupTimer?;
private readonly options;
constructor(options?: CacheOptions);
set(key: string, value: T, ttl?: number): void;
get(key: string): T | undefined;
has(key: string): boolean;
delete(key: string): boolean;
clear(): void;
getStats(): {
size: number;
memoryUsage: number;
maxSize: number;
maxMemory: number;
};
cleanup(): number;
destroy(): void;
private isExpired;
private evictLRU;
private evictByMemory;
private estimateSize;
private startCleanupTimer;
private stopCleanupTimer;
}
//# sourceMappingURL=cache-manager.d.ts.map