@osmandvc/react-upload-control-components
Version:
UI components for the react-upload-control library.
34 lines (33 loc) • 1.2 kB
TypeScript
export type WebcamOutputProps = {
imageUriBase64: string | undefined;
imageData: ImageData | undefined;
};
type WebcamProps = {
outputImageUriBase64: boolean;
outputImageData: boolean;
targetWidth: number;
targetHeight: number;
screenshotFormat: "image/jpeg" | "image/webp" | "image/png" | undefined;
screenshotQuality: number;
imageSmoothing: boolean;
mirrored: boolean;
videoConstraints: any;
onCapture(img: WebcamOutputProps): void;
onUserMediaError(error: string | DOMException): void;
onToggleDevice(): void;
};
export declare function useWebcam(props: Partial<WebcamProps>): {
WebcamComponent: () => import("react/jsx-runtime").JSX.Element;
userMediaStatus: string;
userMediaError: string | Error | undefined;
userMediaErrorString: string;
getDevices: () => Promise<MediaDeviceInfo[] | undefined>;
deviceCount: number | undefined;
selectedDeviceId: string | null;
setSelectedDeviceId: import("react").Dispatch<import("react").SetStateAction<string | null>>;
doCaptureImage: () => void;
doRotateDevice: () => void;
doMirrorDevice: () => void;
doNextDevice: () => Promise<void>;
};
export {};