import { CamOrientation } from './webcam.types'; /** * Manage webcam functions */ export declare class Webcam { private mWebcamElement; private mFacingMode; private mWebcamList; private mStreamList; private mSelectedDeviceId; private mCanvasElement; private mSnapSoundElement; static instance: Webcam; private constructor(); /** * Get the Webcam instance */ static getInstance(): Webcam; /** * Initialize the Webcam instace * @param webcamElement * @param facingMode * @param canvasElement * @param snapSoundElement */ static init(webcamElement: HTMLVideoElement, facingMode?: CamOrientation, canvasElement?: HTMLCanvasElement, snapSoundElement?: HTMLAudioElement): Webcam; get facingMode(): CamOrientation; set facingMode(value: CamOrientation); get webcamList(): MediaDeviceInfo[]; get webcamCount(): number; get selectedDeviceId(): string; /** * Get all video input devices info * @param mediaDevices */ getVideoInputs(mediaDevices: MediaDeviceInfo[]): MediaDeviceInfo[]; /** * Get media constraints */ getMediaConstraints(): MediaStreamConstraints; /** * Select camera based on facingMode */ selectCamera(isFlip?: boolean): void; /** * Change Facing mode and selected camera */ flip(): void; /** * Invert the webcam video vertically */ transform(): void; /** * 1. Get permission from user * 2. Get all video input devices info * 3. Select camera based on facingMode * 4. Start stream * @param startStream */ start(startStream?: boolean): Promise; /** * Restart the Webcam * 1. Stop the webcam * 2. Start stream * @param startStream */ restart(startStream?: boolean): Promise; /** * Get all video input devices info */ info(): Promise; /** * Start streaming webcam to video element */ stream(): Promise; /** * Stop streaming webcam */ stop(): void; /** * Take the picture */ snap(): string; }