DefinitelyTyped/types/react-webcam/index.d.ts
Ferdy Budhidharma bc0c933415 feat(react-dependents): update to TS 2.8 (part 2 of 2) (#27744)
* feat(react-dependents): update to ts 2.8

* fix version mismatches

* remove package.json

* post merge updates

* add package.json back again
2018-08-06 06:28:42 +01:00

39 lines
1.1 KiB
TypeScript

// Type definitions for react-webcam 0.3
// Project: https://github.com/mozmorris/react-webcam
// Definitions by: Lucas Servén Marín <https://github.com/squat>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.8
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;
muted?: boolean;
height?: number|string;
width?: number|string;
screenshotFormat?: 'image/jpeg' | 'image/png' | 'image/webp';
style?: React.CSSProperties;
className?: string;
audioSource?: string;
videoSource?: string;
onUserMedia?(): void;
}
interface WebcamState {
hasUserMedia: boolean;
src?: string;
}
}