import { type VariantProps } from 'class-variance-authority'; export type DocumentScannerSource = 'camera' | 'upload'; export interface DocumentCapture { /** Data URL of the captured / uploaded image (encoded to `mimeType`). */ dataUrl: string; /** Encoded bytes as a Blob — the consumer persists this. */ blob: Blob; /** Where the image came from. */ source: DocumentScannerSource; /** Intrinsic pixel width of the encoded image. */ width: number; /** Intrinsic pixel height of the encoded image. */ height: number; /** MIME of the encoded image. */ mimeType: string; /** Encoded byte size. */ byteSize: number; /** ISO-8601 UTC timestamp for when the capture was confirmed. */ capturedAt: string; /** Hex-encoded SHA-256 digest of the encoded bytes. */ sha256: string; } export type DocumentScannerErrorKind = 'permission-denied' | 'no-camera' | 'not-readable' | 'insecure-context' | 'capture-failed' | 'file-invalid-type' | 'file-too-large'; export interface DocumentScannerError { kind: DocumentScannerErrorKind; } export type DocumentType = 'tessera-sanitaria' | 'cie' | 'id-card' | 'generic'; export type DocumentScannerPhase = 'idle' | 'requesting' | 'streaming' | 'captured' | 'error'; /** Curated imperative handle for agent / external automation. */ export interface DocumentScannerHandle { /** True when a captured or uploaded image is held. */ hasCapture: () => boolean; /** Current lifecycle phase. */ getPhase: () => DocumentScannerPhase; /** Request the camera and begin the viewfinder. */ startCamera: () => Promise | void; /** Freeze the current viewfinder frame. */ capture: () => Promise | void; /** Confirm the current capture, firing `onConfirm`. */ confirm: () => void; /** Discard the current capture and return to the capture path. */ retake: () => void; } export interface DocumentScannerProps { /** Opaque instance id — emitted as `data-component-id` for the agent registry. */ id?: string; /** Controlled captured-image value. When defined the component is controlled. */ value?: DocumentCapture | null; /** Initial captured image for uncontrolled use; seeds the `captured` preview. */ defaultValue?: DocumentCapture | null; /** Fired when the user confirms a captured or uploaded image. */ onConfirm?: (capture: DocumentCapture) => void; /** Fired when the user discards the current capture to retake / re-upload. */ onRetake?: () => void; /** Fired on a permission / hardware / decode failure (telemetry). */ onError?: (error: DocumentScannerError) => void; /** Drives the overlay frame aspect ratio + the translated hint copy. */ documentType?: DocumentType; /** Camera-vs-upload strategy. `auto` falls back to upload on camera failure. */ captureMode?: 'auto' | 'camera-only' | 'upload-only'; /** react-dropzone accept map for the upload fallback. */ accept?: Record; /** Max upload byte size. Defaults to 10MB. */ maxSize?: number; /** Camera to request. Defaults to the rear (`environment`) camera. */ facingMode?: 'environment' | 'user'; /** MIME of the encoded capture. */ outputType?: 'image/jpeg' | 'image/webp' | 'image/png'; /** 0..1 quality for lossy `outputType`. Ignored for image/png. */ outputQuality?: number; /** Crop the confirmed image to the overlay frame rect. */ cropToFrame?: boolean; /** Disable all controls and skip the camera request. */ disabled?: boolean; /** Accessible label for the component's group region. */ ariaLabel?: string; /** Extra classes merged onto the outermost wrapper. */ className?: string; } declare const rootVariants: (props?: ({ size?: "sm" | "md" | "lg" | null | undefined; } & import("class-variance-authority/types").ClassProp) | undefined) => string; declare const viewportVariants: (props?: ({ frame?: "generic" | "tessera-sanitaria" | "cie" | "id-card" | null | undefined; } & import("class-variance-authority/types").ClassProp) | undefined) => string; type SizeVariant = NonNullable['size']>; interface DocumentScannerInternalProps extends DocumentScannerProps { /** Visual size variant (exposed via Controls). */ size?: SizeVariant; } export declare const DocumentScanner: import("react").ForwardRefExoticComponent>; export { rootVariants as documentScannerRootVariants, viewportVariants as documentScannerViewportVariants, }; //# sourceMappingURL=document-scanner.d.ts.map