import Camera from "./Camera"; import MediaConstraints from "./MediaConstraints"; export default class CameraBuilder { canvas: HTMLCanvasElement; mediaConstraints: MediaConstraints; video: HTMLVideoElement; get isIOSPriorTo17(): boolean; cameraStreamListener: (MediaStream: any) => void | null; constructor(mediaConstraints: MediaConstraints); /** * If the front camera is available it will try to start with the front camera */ static initWithUserCamera(): CameraBuilder; /** * If the environment camera is available it will try to start with env camera */ static initWithBackCamera(): CameraBuilder; /** * By passing this the function will be called every time the stream changes for any reason. */ withCameraStreamListener(cameraStreamListener: (MediaStream: any) => void): CameraBuilder; /** * It will try to stream the UltraHD resolution from the camera. */ pick4KResolution(): CameraBuilder; /** * It will try to stream the FullHD resolution from the camera. */ pickFullHDResolution(): CameraBuilder; clearCachedStream(): CameraBuilder; /** * * @param video The HtmlVideoElement which streams the camera * @returns {CameraBuilder} */ streamFrom(video: HTMLVideoElement): CameraBuilder; /** * * @param canvas The HtmlCanvasElement which the Camera object will draw the snapped picture on. * @returns */ drawInto(canvas: HTMLCanvasElement): CameraBuilder; /** * Invoke the camera permission and return a Camera object */ getCameraAsync(): Promise; }