declare namespace JSX { interface IntrinsicElements { 'youverse-document-scan': React.DetailedHTMLProps, HTMLElement> & { cancelVerification?: boolean; changeCamera?: boolean; documentPositionCheck?: boolean; titleText?: string; infoText?: string; license?: string; color?: string; locale?: string; scanTimeout?: number; captureOnTimeout?: boolean; }; } } declare global { interface HTMLElementTagNameMap { 'youverse-document-scan': YouverseDocumentScan; } interface Window { YouverseDocumentScanner: YouverseDocumentScannerAPI; } } /** * API for preloading and caching document scanner models */ interface YouverseDocumentScannerAPI { /** * Preload all document scanner models for faster component initialization. * Call this early (e.g., on page load) to warm up the cache. * @param onProgress - Progress callback (modelPath, index, total) */ preloadModels(onProgress?: (modelPath: string, index: number, total: number) => void): Promise; /** * Preload specific models by path. * @param modelPaths - Array of model paths to preload * @param options - Preload options */ preloadCustomModels(modelPaths: string[], options?: PreloadOptions): Promise; /** * Check if a model is cached (in memory or encrypted in IndexedDB). * @param modelPath - Model path to check */ isModelCached(modelPath: string): Promise; /** * Configure whether to preserve model cache when component is destroyed. * Default is true (models stay in memory for faster reload on next mount). * @param preserve - Whether to preserve cache */ setPreserveModelCache(preserve: boolean): void; /** * Clear the encrypted model cache from IndexedDB. * Use to free storage or force re-download of models. */ clearCache(): Promise; } interface PreloadResult { success: string[]; failed: string[]; } interface PreloadOptions { onProgress?: (modelPath: string, index: number, total: number) => void; parallel?: boolean; } interface YouverseDocumentScan extends HTMLElement { cancelVerification?: boolean; changeCamera?: boolean; documentPositionCheck?: boolean; titleText?: string; infoText?: string; license?: string; color?: string; locale?: string; scanTimeout?: number; captureOnTimeout?: boolean; } export default YouverseDocumentScan;