mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-11 20:40:20 +00:00
Remove react-webcam (#38149)
This commit is contained in:
@@ -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",
|
||||
|
||||
Vendored
-43
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -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>
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -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 +0,0 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user