UNPKG

jagran-react-doc-viewer

Version:

A highly customizable React document viewer with support for PDF, DOCX, PPTX, images, and more

36 lines 1.03 kB
interface CacheOptions { maxSize?: number; maxEntries?: number; ttl?: number; } export declare class OptimizedCache<T> { private cache; private readonly maxSize; private readonly maxEntries; private readonly ttl; private currentSize; constructor(options?: CacheOptions); set(key: string, data: T, size?: number): void; get(key: string): T | undefined; has(key: string): boolean; delete(key: string): boolean; clear(): void; getStats(): { size: number; currentSize: number; maxSize: number; maxEntries: number; utilization: number; }; private evictIfNeeded; private evictExpired; private evictLFU; private estimateSize; } export declare class OptimizedPdfCache extends OptimizedCache<ArrayBuffer> { constructor(); prefetch(uri: string, signal?: AbortSignal): Promise<ArrayBuffer | null>; } export declare const optimizedPdfCache: OptimizedPdfCache; export {}; //# sourceMappingURL=optimizedCache.d.ts.map