[grecaptcha] Added a missing size parameter; Added value constraints to theme, type, and size parameters

This commit is contained in:
Ruslan Arkhipau
2016-08-08 14:06:19 -07:00
parent d7dfa08dd4
commit f27002e290
2 changed files with 18 additions and 4 deletions

View File

@@ -2,8 +2,9 @@
var params: ReCaptchaV2.Parameters = {
"sitekey": "mySuperSecretKey",
"theme": "black", // no type-checking here.
"theme": "light",
"type": "image",
"size": "normal",
"tabindex": 5,
"callback": (response: string) => { },
"expired-callback": () => { },

View File

@@ -29,6 +29,10 @@ declare namespace ReCaptchaV2
getResponse(opt_widget_id?: number): string;
}
type Theme = "light" | "dark";
type Type = "image" | "audio";
type Size = "normal" | "compact";
interface Parameters
{
/**
@@ -39,14 +43,23 @@ declare namespace ReCaptchaV2
* Optional. The color theme of the widget.
* Accepted values: "light", "dark"
* @default "light"
* @type {Theme}
**/
theme?: string;
theme?: Theme;
/**
* Optional. The type of CAPTCHA to serve.
* Accepted values: "audio ", "image"
* Accepted values: "audio", "image"
* @default "image"
* @type {Type}
**/
type?: string;
type?: Type;
/**
* Optional. The size of the widget.
* Accepted values: "compact", "normal"
* @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.