@anilkumarthakur/vue3-recaptcha
Version:
A Vue 3 plugin for Google reCAPTCHA v2 (checkbox & invisible) and v3 integration
34 lines • 1.08 kB
TypeScript
import { RecaptchaVersion } from '../types';
export interface ScriptLoaderOptions {
siteKey: string;
version: RecaptchaVersion;
language?: string;
scriptUrl?: string;
onLoad?: () => void;
onError?: (error: Error) => void;
}
/**
* Check if reCAPTCHA script is already loaded and ready
*/
export declare function isRecaptchaLoaded(): boolean;
/**
* Get existing script element by id
*/
export declare function getExistingScript(): HTMLScriptElement | null;
/**
* Remove existing script and reset load state
*/
export declare function removeScript(): void;
/**
* Build the reCAPTCHA script URL from options
*/
export declare function buildScriptUrl(options: ScriptLoaderOptions): string;
/**
* Load the reCAPTCHA script. Returns a shared promise if loading is already in progress.
*/
export declare function loadRecaptchaScript(options: ScriptLoaderOptions): Promise<void>;
/**
* Wait for grecaptcha to become available, with a 10-second timeout.
*/
export declare function waitForRecaptcha(): Promise<void>;
//# sourceMappingURL=script-loader.d.ts.map