@drozdik.m/recaptcha
Version:
Intuitive and easy way to use Recaptcha
31 lines (30 loc) • 898 B
TypeScript
import { Event } from "@drozdik.m/event";
import { RecaptchaV2Args } from "../args/RecaptchaV2Args";
export declare class RecaptchaV2 {
private id;
private siteKey;
OnValidate: Event<RecaptchaV2, RecaptchaV2Args>;
OnUnvalidate: Event<RecaptchaV2, RecaptchaV2Args>;
OnStateChange: Event<RecaptchaV2, RecaptchaV2Args>;
private validated;
private widgetId;
/**
* Creates recaptcha object
* @param id Id of target
* @param siteKey Site key of the recaptcha
*/
constructor(id: string, siteKey: string);
/**
* Initiates Captcha using grecaptcha
* */
private InitCaptcha;
/**
* Returns the recaptcha response (send in form posts)
* */
GetResponse(): string;
/**
* Returns true if the captcha is validated, else false
* */
Validated(): boolean;
Reset(): void;
}