vue-recaptcha
Version:
ReCAPTCHA vue component
29 lines (28 loc) • 1.13 kB
TypeScript
import type { InjectionKey, Ref } from 'vue-demi';
import type { RecaptchaParams, ScriptLoaderOptionsInput } from '../script-manager/common';
import type { RecaptchaProxy } from './proxy';
export interface RecaptchaOptionsInput {
v2SiteKey?: string | undefined;
v3SiteKey?: string | undefined;
loaderOptions?: ScriptLoaderOptionsInput & {
params?: RecaptchaParams;
};
}
export interface RecaptchaOptions {
v2SiteKey?: string | undefined;
v3SiteKey?: string | undefined;
loaderOptions: ScriptLoaderOptionsInput;
}
export interface RecaptchaContext {
isReady: Ref<boolean>;
proxy: RecaptchaProxy;
scriptInjected: boolean;
useScriptProvider: () => void;
options: RecaptchaOptions;
}
export declare const RecaptchaContextKey: InjectionKey<RecaptchaContext>;
export declare function useRecaptchaContext(): RecaptchaContext;
export declare function useRecaptchaProxy(): RecaptchaProxy;
export declare function useAssertV2SiteKey(): string;
export declare function useAssertV3SiteKey(): string;
export declare function normalizeOptions(input: RecaptchaOptionsInput): RecaptchaOptions;