import { CaptchaAction } from '@gecogvidanto/shared'; interface GoogleReCaptchaExecuteOptions { action: string; } interface GoogleReCaptchaRenderOptions { sitekey: string; size: 'invisible'; } interface GoogleReCaptcha { ready: (cb: () => void) => void; execute: (options: GoogleReCaptchaExecuteOptions) => Promise; render: (id: string, options: GoogleReCaptchaRenderOptions) => void; } declare global { interface Window { grecaptcha: GoogleReCaptcha; } } /** * Hook managing Google Re-Captcha v3. * * @param siteKey - The key of the site, or undefined to *not* use the captcha. * @param widgetId - The identifier of the widget element. * @param action - The captcha action. * @returns The getToken function or undefined while not ready. */ declare function useReCaptcha(siteKey: string | undefined, widgetId: string, action: CaptchaAction): (() => Promise) | undefined; export default useReCaptcha;