[@types/react-recaptcha-v3] Add react-recaptcha-v3 definitions (#41585)

* Add react-recaptcha-v3 definitions

* Fix react-recaptcha-v3 type definition comment in index.d.ts

* Fix react-recaptcha-v3 type definition comment in index.d.ts

* Fix import ReCaptcha for tests
This commit is contained in:
Alessandro Rabitti
2020-01-17 11:38:46 -05:00
committed by Eli Barzilay
parent ee86da53a7
commit 3a13a0d024
4 changed files with 62 additions and 0 deletions
+25
View File
@@ -0,0 +1,25 @@
// Type definitions for react-recaptcha-v3 1.1
// Project: https://github.com/codeep/react-recaptcha-v3
// Definitions by: Alessandro Rabitti <https://github.com/silversonicaxel>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.8
import { Component } from "react";
export = ReCaptcha;
declare namespace ReCaptcha {
interface ReCaptchaProps {
elementID?: string;
sitekey: string;
action: string;
verifyCallback?(response: string): any;
verifyCallbackName?: string;
}
}
declare class ReCaptcha extends Component<ReCaptcha.ReCaptchaProps> {
static propTypes: any;
static defaultProps: ReCaptcha.ReCaptchaProps;
execute(): void;
}
@@ -0,0 +1,11 @@
import * as ReCaptcha from "react-recaptcha-v3";
import * as ReactDOM from "react-dom";
import * as React from "react";
ReactDOM.render(
<ReCaptcha
sitekey="xxxxxx"
action="action"
/>,
document.getElementById('form-recaptcha')
);
+25
View File
@@ -0,0 +1,25 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6",
"dom"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"jsx": "react",
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"react-recaptcha-v3-tests.tsx"
]
}
+1
View File
@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }