import React, { Component, ReactNode } from 'react'; declare global { interface Window { grecaptcha?: Grecaptcha; } } export declare type Grecaptcha = { ready: (callback: () => void) => void; render: (container?: HTMLElement, config?: RecaptchaConfig) => number; reset: (id?: number) => void; execute: (id?: number) => void; getResponse: (id?: number) => string; }; declare type RecaptchaBaseConfig = { sitekey: string; theme?: 'light' | 'dark'; size?: 'compact' | 'normal' | 'invisible'; badge?: 'bottomright' | 'bottomleft' | 'inline'; tabindex?: number; hl?: string; isolated?: boolean; }; declare type RecaptchaConfig = RecaptchaBaseConfig & { callback?: (response: string) => void; 'expired-callback'?: () => void; 'error-callback'?: () => void; }; export declare type RenderProps = { renderExplicitly: () => Promise; reset: () => Promise; execute: () => Promise; getResponse: () => Promise; recaptchaComponent: ReactNode; }; export declare type Props = RecaptchaBaseConfig & { id?: string; className?: string; explicit?: boolean; onLoad?: () => void; onRender?: () => void; onVerify: (response: string) => void; onExpire?: () => void; onError?: () => void; inject?: boolean; children?: (renderProps: RenderProps) => ReactNode; }; declare type State = { instanceKey: number; instanceId?: number; ready: boolean; rendered: boolean; invisible: boolean; }; declare class Reaptcha extends Component { container?: HTMLDivElement | null; timer?: number | undefined; state: State; static defaultProps: Partial; static getDerivedStateFromProps(props: Props, state: State): { invisible: boolean; } | null; _isAvailable: () => boolean; _inject: () => void; _prepare: () => void; _renderRecaptcha: (container: HTMLDivElement, config: RecaptchaConfig) => number; _resetRecaptcha: () => void; _executeRecaptcha: () => void; _getResponseRecaptcha: () => string; _onVerify: (response: string) => void; _onExpire: () => void | undefined; _onError: () => void | undefined; _stopTimer: () => void; componentDidMount: () => void; componentDidUpdate(prevProps: Readonly): void; componentWillUnmount: () => void; renderExplicitly: () => Promise; reset: () => Promise; execute: () => Promise; getResponse: () => Promise; render: () => string | number | boolean | React.ReactFragment | JSX.Element | null | undefined; } export default Reaptcha;