UNPKG

bitcoin-inscription-viewer

Version:

🔍 A robust, production-ready React/TypeScript library for viewing Bitcoin Ordinals inscriptions with advanced optimization features including LRU caching, LaserEyes wallet integration, virtual scrolling, and performance monitoring

35 lines 1.09 kB
/** * Enhanced Inscription Cache Hook * Provides intelligent caching with LRU strategy and performance metrics */ export interface CacheConfig { maxSize?: number; ttl?: number; strategy?: 'lru' | 'fifo'; enabled?: boolean; } export interface CacheStats { hits: number; misses: number; size: number; hitRate: number; memoryUsage: number; } export interface CachedContent { content: any; contentType: string; timestamp: number; size: number; accessCount: number; lastAccessed: number; } export interface UseInscriptionCacheResult { getContent: (inscriptionId: string, fetcher: (id: string) => Promise<any>) => Promise<any>; preloadContent: (inscriptionIds: string[], fetcher: (id: string) => Promise<any>) => Promise<void>; clearCache: () => void; deleteFromCache: (inscriptionId: string) => void; stats: CacheStats; isInCache: (inscriptionId: string) => boolean; } export declare const useInscriptionCache: (config?: CacheConfig) => UseInscriptionCacheResult; //# sourceMappingURL=useInscriptionCache.d.ts.map