mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-11 20:40:20 +00:00
[@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:
committed by
Eli Barzilay
parent
ee86da53a7
commit
3a13a0d024
Vendored
+25
@@ -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')
|
||||
);
|
||||
@@ -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"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user