Remove react-webcam (#38149)

This commit is contained in:
Moz Morris
2019-09-06 18:01:18 -07:00
committed by Andrew Casey
parent 816d53f890
commit 156a7ab7e1
5 changed files with 6 additions and 105 deletions
+6
View File
@@ -2958,6 +2958,12 @@
"sourceRepoURL": "https://github.com/tanem/react-svg",
"asOfVersion": "5.0.0"
},
{
"libraryName": "react-webcam",
"typingsPackageName": "react-webcam",
"sourceRepoURL": "https://github.com/mozmorris/react-webcam",
"asOfVersion": "3.0.0"
},
{
"libraryName": "read-chunk",
"typingsPackageName": "read-chunk",
-43
View File
@@ -1,43 +0,0 @@
// 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;
}
}
-36
View File
@@ -1,36 +0,0 @@
import * as React from "react";
import Webcam = require("react-webcam");
export class ReactWebcamTest extends React.Component {
private webcam: Webcam;
setRef = (webcam: Webcam) => {
this.webcam = webcam;
}
capture = () => {
const imageSrc = this.webcam.getScreenshot();
}
render() {
const videoConstraints = {
width: 1280,
height: 720,
facingMode: "user"
};
return (
<div>
<Webcam
audio={false}
height={350}
ref={this.setRef}
screenshotFormat="image/jpeg"
width={350}
videoConstraints={videoConstraints}
/>
<button onClick={this.capture}>Capture photo</button>
</div>
);
}
}
-25
View File
@@ -1,25 +0,0 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6",
"dom"
],
"jsx": "react",
"noImplicitAny": true,
"noImplicitThis": true,
"strictFunctionTypes": true,
"strictNullChecks": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"react-webcam-tests.tsx"
]
}
-1
View File
@@ -1 +0,0 @@
{ "extends": "dtslint/dt.json" }