mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
Updated types for newest version of react-webcam Updated tests Updated types for newest version of react-webcam Updated types for newest version of react-webcam Updated types for newest version of react-webcam Updated tests Added newline to the end of file
44 lines
1.4 KiB
TypeScript
44 lines
1.4 KiB
TypeScript
// Type definitions for react-webcam 1.1
|
|
// Project: https://github.com/mozmorris/react-webcam
|
|
// Definitions by: Lucas Servén Marín <https://github.com/squat>
|
|
// Søren Englund <https://github.com/englund92>
|
|
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
|
// TypeScript Version: 3.4
|
|
|
|
import * as React from 'react';
|
|
|
|
export = Webcam;
|
|
|
|
declare class Webcam extends React.Component<Webcam.WebcamProps, Webcam.WebcamState> {
|
|
private static mountedInstances: Webcam[];
|
|
private static userMediaRequested: boolean;
|
|
getScreenshot(): string|null;
|
|
getCanvas(): HTMLCanvasElement|null;
|
|
requestUserMedia(): void;
|
|
handleUserMedia(error: Error, stream: MediaStream): void;
|
|
}
|
|
|
|
declare namespace Webcam {
|
|
interface WebcamProps {
|
|
audio?: boolean;
|
|
onUserMedia?(): void;
|
|
onUserMediaError?(): void;
|
|
height?: number|string;
|
|
width?: number|string;
|
|
screenshotFormat?: 'image/jpeg' | 'image/png' | 'image/webp';
|
|
style?: React.CSSProperties;
|
|
className?: string;
|
|
screenshotQuality?: number;
|
|
minScreenshotWidth?: number;
|
|
minScreenshotHeight?: number;
|
|
audioConstraints?: MediaStreamConstraints["audio"];
|
|
videoConstraints?: MediaStreamConstraints["video"];
|
|
imageSmoothing?: boolean;
|
|
}
|
|
|
|
interface WebcamState {
|
|
hasUserMedia: boolean;
|
|
src?: string;
|
|
}
|
|
}
|