import { WebVisualContainer } from "./web-visual-container.js"; import { CameraFacingMode, CameraFrame, ICamera } from "../../interfaces/verification-system-interfaces.js"; /** * Camera device info with facing mode detection */ export interface CameraDeviceInfo { /** * Device ID */ deviceId: string; /** * Device label */ label: string; /** * Detected facing mode ('user' or 'environment') */ facingMode: CameraFacingMode; /** * Resolution width */ width?: number; /** * Resolution height */ height?: number; /** * Computed score for camera selection */ score?: number; } /** * Web platform implementation of the camera */ export declare class WebCamera implements ICamera { private static readonly DEFAULT_RESOLUTION; facingMode: CameraFacingMode; private videoElement; private containerElement; private roiContainer; private canvas; private mediaStream; private actualStreamWidth; private actualStreamHeight; private active; private cameraIndex; private currentCamera; private hasLoggedCapture; private frameProcessingResolution; private cachedFrame; private frameRequested; private videoFrameCallbackHandle; private frameProcessorWorker; private isProcessing; private orientationChangeHandler; /** * Create a new web camera instance * @param container * @param roiContainer */ constructor(container: WebVisualContainer, roiContainer?: WebVisualContainer | null); /** * Switch to the next camera */ canSwitchCamera(): Promise; /** * Clean up resources */ dispose(): void; /** * Capture and return the current frame * Pattern: null (request frame) -> frame (request frame) -> frame -> frame... * The actual capture happens in the video frame callback */ getFrame(): Promise; /** * Video frame callback - called once when frame is requested * Creates ImageBitmap and sends to worker, does NOT re-schedule itself */ private onVideoFrame; /** * Capture and return the current frame as a JPEG-encoded Blob at sensor resolution * Tries ImageCapture API first (Android), falls back to video element capture */ getHighResolutionFrameAsEncodedBlob(resolution?: number): Promise; /** * Get the video element (if available) */ getVideoElement(): HTMLVideoElement | null; init(): Promise; /** * Check if camera is currently active */ isActive(): boolean; /** * Start the camera */ start(facingMode?: CameraFacingMode, resolution?: number): Promise; /** * Stop the camera */ stop(): Promise; /** * Switch to the next camera */ switchCamera(): Promise; setTorch(on: boolean): Promise; private static getMediaStream; private isMirrored; private buildVideoConstraints; private setupOrientationListener; private removeOrientationListener; /** * Calculate the crop region (insets) based on container and ROI */ private calculateCropRegion; /** * Prepare crop and scale parameters for frame capture * Calculates both the crop region and the target dimensions after scaling */ private prepareCropAndScaleParams; /** * Draw cropped and optionally mirrored frame from video/image to canvas */ private drawCroppedAndMirroredFrame; } //# sourceMappingURL=web-camera.d.ts.map