mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-05-18 04:24:30 +08:00
[grecaptcha] Added a missing size parameter; Added value constraints to theme, type, and size parameters
This commit is contained in:
@@ -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": () => { },
|
||||
|
||||
19
grecaptcha/grecaptcha.d.ts
vendored
19
grecaptcha/grecaptcha.d.ts
vendored
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user