@types/grecaptcha
Advanced tools
Comparing version 2.0.32 to 2.0.33
// Type definitions for Google Recaptcha 2.0 | ||
// Project: https://www.google.com/recaptcha | ||
// Definitions by: Kristof Mattei <http://kristofmattei.be>, Martin Costello <https://martincostello.com/> | ||
// Definitions by: Kristof Mattei <http://kristofmattei.be>, Martin Costello <https://martincostello.com/>, Ruslan Arkhipau <https://github.com/DethAriel> | ||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped | ||
@@ -8,28 +8,26 @@ | ||
declare namespace ReCaptchaV2 | ||
{ | ||
class ReCaptcha | ||
{ | ||
declare namespace ReCaptchaV2 { | ||
class ReCaptcha { | ||
/** | ||
* Renders the container as a reCAPTCHA widget and returns the ID of the newly created widget. | ||
* @param container The HTML element to render the reCAPTCHA widget. Specify either the ID of the container (string) or the DOM element itself. | ||
* @param parameters An object containing parameters as key=value pairs, for example, {"sitekey": "your_site_key", "theme": "light"}. See @see render parameters. | ||
* @return the ID of the newly created widget. | ||
**/ | ||
* Renders the container as a reCAPTCHA widget and returns the ID of the newly created widget. | ||
* @param container The HTML element to render the reCAPTCHA widget. Specify either the ID of the container (string) or the DOM element itself. | ||
* @param parameters An object containing parameters as key=value pairs, for example, {"sitekey": "your_site_key", "theme": "light"}. See @see render parameters. | ||
* @return the ID of the newly created widget. | ||
*/ | ||
render(container: (string | HTMLElement), parameters?: Parameters): number; | ||
/** | ||
* Resets the reCAPTCHA widget. | ||
* @param opt_widget_id Optional widget ID, defaults to the first widget created if unspecified. | ||
**/ | ||
* Resets the reCAPTCHA widget. | ||
* @param opt_widget_id Optional widget ID, defaults to the first widget created if unspecified. | ||
*/ | ||
reset(opt_widget_id?: number): void; | ||
/** | ||
* Gets the response for the reCAPTCHA widget. | ||
* @param opt_widget_id Optional widget ID, defaults to the first widget created if unspecified. | ||
* @return the response of the reCAPTCHA widget. | ||
**/ | ||
* Gets the response for the reCAPTCHA widget. | ||
* @param opt_widget_id Optional widget ID, defaults to the first widget created if unspecified. | ||
* @return the response of the reCAPTCHA widget. | ||
*/ | ||
getResponse(opt_widget_id?: number): string; | ||
/** | ||
* Programatically invoke the reCAPTCHA check. Used if the invisible reCAPTCHA is on a div instead of a button. | ||
* @param opt_widget_id Optional widget ID, defaults to the first widget created if unspecified. | ||
**/ | ||
* Programatically invoke the reCAPTCHA check. Used if the invisible reCAPTCHA is on a div instead of a button. | ||
* @param opt_widget_id Optional widget ID, defaults to the first widget created if unspecified. | ||
*/ | ||
execute(opt_widget_id?: number): void; | ||
@@ -40,48 +38,55 @@ } | ||
type Type = "image" | "audio"; | ||
type Size = "normal" | "compact"; | ||
type Size = "normal" | "compact" | "invisible"; | ||
type Badge = "bottomright" | "bottomleft" | "inline"; | ||
interface Parameters | ||
{ | ||
interface Parameters { | ||
/** | ||
* Your sitekey. | ||
**/ | ||
* Your sitekey. | ||
*/ | ||
sitekey: string; | ||
/** | ||
* Optional. The color theme of the widget. | ||
* Accepted values: "light", "dark" | ||
* @default "light" | ||
* @type {Theme} | ||
**/ | ||
* Optional. The color theme of the widget. | ||
* Accepted values: "light", "dark" | ||
* @default "light" | ||
* @type {Theme} | ||
*/ | ||
theme?: Theme; | ||
/** | ||
* Optional. The type of CAPTCHA to serve. | ||
* Accepted values: "audio", "image" | ||
* @default "image" | ||
* @type {Type} | ||
**/ | ||
* Optional. The type of CAPTCHA to serve. | ||
* Accepted values: "audio", "image" | ||
* @default "image" | ||
* @type {Type} | ||
*/ | ||
type?: Type; | ||
/** | ||
* Optional. The size of the widget. | ||
* Accepted values: "compact", "normal" | ||
* @default "compact" | ||
* @type {Size} | ||
*/ | ||
* Optional. The size of the widget. | ||
* Accepted values: "compact", "normal", "invisible". | ||
* @default "compact" | ||
* @type {Size} | ||
*/ | ||
size?: Size; | ||
/** | ||
* Optional. The tabindex of the widget and challenge. | ||
* If other elements in your page use tabindex, it should be set to make user navigation easier. | ||
**/ | ||
* Optional. The tabindex of the widget and challenge. | ||
* If other elements in your page use tabindex, it should be set to make user navigation easier. | ||
*/ | ||
tabindex?: number; | ||
/** | ||
* Optional. Your callback function that's executed when the user submits a successful CAPTCHA response. | ||
* The user's response, g-recaptcha-response, will be the input for your callback function. | ||
**/ | ||
callback?: (response: string) => void; | ||
* Optional. Your callback function that's executed when the user submits a successful CAPTCHA response. | ||
* The user's response, g-recaptcha-response, will be the input for your callback function. | ||
*/ | ||
callback?(response: string): void; | ||
/** | ||
* Optional. Your callback function that's executed when the recaptcha response expires and the user needs to solve a new CAPTCHA. | ||
**/ | ||
* Optional. The badge location for g-recaptcha with size of "invisible". | ||
* | ||
* @default "bottomright" | ||
* @type {Badge} | ||
*/ | ||
badge?: Badge; | ||
/** | ||
* Optional. Your callback function that's executed when the recaptcha response expires and the user needs to solve a new CAPTCHA. | ||
*/ | ||
// Notice to the reader | ||
// I need to surround this object with quotes, this will however break intellisense in VS 2013. | ||
"expired-callback"?: () => void; | ||
"expired-callback"?(): void; | ||
} | ||
} |
{ | ||
"name": "@types/grecaptcha", | ||
"version": "2.0.32", | ||
"version": "2.0.33", | ||
"description": "TypeScript definitions for Google Recaptcha", | ||
@@ -14,2 +14,6 @@ "license": "MIT", | ||
"url": "https://martincostello.com/" | ||
}, | ||
{ | ||
"name": "Ruslan Arkhipau", | ||
"url": "https://github.com/DethAriel" | ||
} | ||
@@ -25,4 +29,4 @@ ], | ||
"peerDependencies": {}, | ||
"typesPublisherContentHash": "d1f855ccfb3b30d73c87b4e06ce491e6ee6bb5c5d77ca97194668f235bf028c0", | ||
"typesPublisherContentHash": "faeaebca9a8591857b36e70913a5f88eea2f28f5978f2c86a9c5797c21f414a4", | ||
"typeScriptVersion": "2.0" | ||
} |
@@ -11,3 +11,3 @@ # Installation | ||
Additional Details | ||
* Last updated: Wed, 19 Apr 2017 16:17:53 GMT | ||
* Last updated: Tue, 02 May 2017 16:31:38 GMT | ||
* Dependencies: none | ||
@@ -17,2 +17,2 @@ * Global values: ReCaptchaV2, grecaptcha | ||
# Credits | ||
These definitions were written by Kristof Mattei <http://kristofmattei.be>, Martin Costello <https://martincostello.com/>. | ||
These definitions were written by Kristof Mattei <http://kristofmattei.be>, Martin Costello <https://martincostello.com/>, Ruslan Arkhipau <https://github.com/DethAriel>. |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
6163
86