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
30 lines • 1.26 kB
TypeScript
/**
* Content Type Detection and Classification
* Analyzes content headers and first few bytes to determine the best rendering approach
*/
export interface ContentInfo {
mimeType: string;
detectedType: 'text' | 'image' | 'audio' | 'video' | 'html' | 'json' | 'svg' | '3d' | 'pdf' | 'archive' | 'document' | 'code' | 'font' | 'ebook' | 'executable' | 'data' | 'binary' | 'unknown';
renderStrategy: 'native' | 'iframe' | 'download' | 'unsupported';
fileExtension?: string;
encoding?: string;
isInlineable: boolean;
category?: 'media' | 'document' | 'code' | 'data' | 'executable' | 'font' | 'archive' | 'unknown';
displayName?: string;
description?: string;
}
export interface ContentAnalysis {
contentInfo: ContentInfo;
preview?: string;
error?: string;
}
/**
* Analyze content from response headers and initial bytes
*/
export declare function analyzeContent(url: string, originalInscriptionId?: string, knownContentType?: string): Promise<ContentAnalysis>;
/**
* Check if content should be lazy loaded based on type and size
*/
export declare function shouldLazyLoad(contentInfo: ContentInfo, contentLength?: number): boolean;
export default analyzeContent;
//# sourceMappingURL=contentAnalyzer.d.ts.map