import type { ComponentPublicInstance, TeleportProps } from 'vue'; import type { QrScannerProps } from './QrScanner'; export declare type QrScannerFormat = 'QRCode' | 'Code128' | 'Code39' | 'EAN13' | 'EAN8' | 'DataMatrix' | 'PDF417' | 'Aztec'; export declare type QrScannerResult = { text: string; format: string; source: 'camera' | 'image' | 'native'; }; export declare type QrScannerStartupStage = 'camera' | 'preview' | 'decoder' | 'ready'; export declare type QrScannerStartupTexts = Partial, string>>; export declare type QrScannerStageChange = { stage: QrScannerStartupStage; /** Milliseconds since this H5 startup attempt began. */ elapsedMs: number; }; export declare type QrScannerErrorCode = 'INSECURE_CONTEXT' | 'CAMERA_UNSUPPORTED' | 'CAMERA_PERMISSION_DENIED' | 'CAMERA_NOT_FOUND' | 'CAMERA_UNAVAILABLE' | 'PREVIEW_FAILED' | 'STARTUP_TIMEOUT' | 'DECODER_LOAD_FAILED' | 'DECODE_FAILED' | 'IMAGE_TOO_LARGE' | 'IMAGE_NOT_FOUND' | 'CONFIRM_FAILED' | 'NATIVE_SCAN_FAILED' | 'TORCH_UNAVAILABLE'; export declare type QrScannerError = { code: QrScannerErrorCode; message: string; cause?: unknown; stage?: QrScannerStartupStage; elapsedMs?: number; }; export declare type QrScannerBeforeConfirm = (result: QrScannerResult) => boolean | void | Promise; export declare type QrScannerNativeScan = (options: { formats: QrScannerFormat[]; signal: AbortSignal; }) => Promise<{ text: string; format?: string; } | null>; export declare type QrScannerOptions = { title?: string; tip?: string; processingText?: string; startupTimeout?: number | string; startupTexts?: QrScannerStartupTexts; formats?: QrScannerFormat[]; facingMode?: 'environment' | 'user'; showAlbum?: boolean; showTorch?: boolean; showSwitchCamera?: boolean; closeAfterScan?: boolean; scanInterval?: number | string; duplicateInterval?: number | string; maxImageSize?: number | string; paused?: boolean; wasmUrl?: string; beforeConfirm?: QrScannerBeforeConfirm; nativeScan?: QrScannerNativeScan; teleport?: TeleportProps['to']; zIndex?: number | string; closeOnPopstate?: boolean; onScan?: (result: QrScannerResult) => void; onError?: (error: QrScannerError) => void; onStageChange?: (info: QrScannerStageChange) => void; onReady?: (info: { torch: boolean; }) => void; onCancel?: () => void; onClose?: () => void; }; export declare type QrScannerExpose = { start: () => Promise; stop: () => void; close: () => void; scanImage: (file: File) => Promise; }; export declare type QrScannerInstance = ComponentPublicInstance;