import { Component } from "react"; export declare const ERROR_NOT_ALLOWED = "Error:NotAllowed"; export declare enum DOMCameraErrorTypes { streamError = 2, mediaDevicesAccessFail = 3, noVideoInputs = 4, enumerateDevicesFail = 5, notAllowed = 6, browserIncapable = 7, other = 8 } export declare enum DOMCameraStateEnum { isLoading = 2, isError = 3, isVideoing = 4 } export interface DOMCameraState { curStep: DOMCameraStateEnum; vidDeviceList: MediaDeviceInfo[] | null; curId: string | null; } export interface DOMCameraUserInteraction { onImageSrcReady?: (imgURL: string) => void; onVideoSrcReady?: (videoURL: string) => void; onVideoRecordingStarted?: () => void; onVideoRecordingStopped?: () => void; /** * not yet implemented */ onVideoRecordingPaused?: () => void; onReadyToStream?: () => void; } export interface DOMCameraCallbacks { onVideoDisplayReady?: (video: HTMLVideoElement) => void; onVideoDisplayRemoved?: () => void; onError?: (errorType: DOMCameraErrorTypes) => void; } /** * inspired by: * https://webrtc.github.io/samples/ * https://github.com/webrtc/samples/blob/gh-pages/src/content/getusermedia/record/js/main.js */ export interface DOMCameraProps extends DOMCameraUserInteraction, DOMCameraCallbacks { /** * flag to display renderControls() or not */ showControls: boolean; isRecordingAudio?: boolean; /** * by default, the DOMCamera will stream directly. Set this to prohibit that */ isNoStream?: boolean; } /** * inspired by: * https://webrtc.github.io/samples/ * https://github.com/webrtc/samples/blob/gh-pages/src/content/getusermedia/record/js/main.js * * this class only concerns getting a video stream from the devices camera, or failing to do so. * It can also handle getting individual images, and will by default render the video stream * in a