export interface Constraints { /** * @hidden */ audio?: boolean; /** * Default facing mode settings * default as user facing mode */ facingMode?: string; /** * To switch available cameras * default on inbuilt camera. * Can change the device by getting available media devices list */ deviceId?: string; } export declare class Camera { private gui; private mediaStream; private mediaDevices; private mediaTrack; private constraints; private user; static loading_class: string; private panID; private preset; constructor(); /** * This method is used to set the constraints for the Capture Device * @param constraintsData - This parameter is a Object type with constraints for media if not provided "facingMode will be user" * @returns - The constraints data */ setConstraints: (constraintsData: Constraints) => Promise<{ audio: boolean; video: { facingMode: string; noiseSuppression: boolean; deviceId: string; }; }>; /** * This method start the camera based on the constraints * @param constraintsData - This parameter is a Object type with constraints for media if not provided "facingMode will be user" * @returns - Boolean data based on the user allowed or denied camera access */ startCamera(constraintsData?: any): Promise<{ cameraInitialized: boolean; stream: MediaStream; }>; /** * This function is used to apply style settings to the camera */ applyCameraSettings: (style: any) => void; /** * This method is used to capture Image on camera * @param dimensions - The dimensions data if need to change */ captureImage: (dimensions?: any) => Promise; /** * This method is used to capture Image on camera * @param dimensions - The dimensions data if need to change */ getImageDataCanvas: (dimensions?: any) => Promise; /** * This method captures the front Side of the Card *@param dataURI - The data obtained by drawing Image On canvas * @param dimensions - Dimensions Data */ captureFrontSide: (dataURI: string, dimensions?: any) => Promise; /** * This method is used to capture Image on camera * @param dimensions - The dimensions data if need to change */ captureBackImage: (dimensions?: any) => any; /** *This method is used to capture BackSide image * @param dataURI - result obtained from canvas * @param dimensions - Dimensions Data */ captureBackSide: (dataURI: string, dimensions?: any) => any; /** * This method displays the data for the user. * @param dimensions - Dimensions data * @returns - Emitter with the data */ displayData: (dimensions?: any) => Promise<{ image: string; name: string; sex: string; uniqueId: string; dob: string; address: string; fatherName?: string; yob?: string; pincode?: string; country?: string; state?: string; district?: string; /** * To switch available cameras * default on inbuilt camera. * Can change the device by getting available media devices list */ city?: string; relation?: string; place?: string; doorNo?: string; relationName?: string; age?: string; }>; /** * To setup the camera element and started streaming * @param rootElement - The HTML ELement to render camera view * @param stream - The stream object once the Camera is started up * @param dimensions - The dimensions of the capture element to be specified by the user */ setUpCameraStream: (rootElement: HTMLElement, stream: any, dimensions?: any) => void; /** * This method returns the currently active video element * @returns VideoElement */ getVideoElement: () => HTMLVideoElement; /** * This method returns the media devices * @returns Media Devices */ getMediaDevices: () => Promise; /** * This method pauses the camera view */ pauseCameraView: () => Promise; /** * This method resumes the camera view */ resumeCameraView: () => Promise; /** * This method resets the capture camera frame. */ resetCapture: () => void; }