export interface CaptchaI18nConfig { required_bind_el?: string; required_request_captcha_data_url?: string; required_valid_captcha_url?: string; invalid_captcha_data?: string; unknown_captcha_type?: string; default_valid_success_log?: string; tips_success?: string; tips_error?: string; tips_4001?: string; tips_network_error?: string; modal_title?: string; modal_subtitle?: string; close_button_aria_label?: string; slider_title?: string; slider_action_hint?: string; concat_title?: string; concat_action_hint?: string; image_click_title?: string; image_click_confirm_text?: string; rotate_title?: string; rotate_action_hint?: string; disable_title?: string; disable_default_message?: string; slider_title_size?: string; concat_title_size?: string; image_click_title_size?: string; rotate_title_size?: string; disable_title_size?: string; close_text?: string; refresh_text?: string; [key: string]: unknown; } export interface CaptchaStyleOptions { btnUrl?: string | null; bgUrl?: string | null; logoUrl?: string | null; moveTrackMaskBgColor?: string; moveTrackMaskBorderColor?: string; i18n?: CaptchaI18nConfig; [key: string]: unknown; } export interface CaptchaRequestParams { url: string; method?: string; headers?: Record; data?: unknown; } export interface CaptchaRequestChain { preRequest?: ( type: string, requestParam: CaptchaRequestParams, config: CaptchaConfig, captcha?: unknown, tac?: CaptchaWebSdk ) => boolean | void; postRequest?: ( type: string, requestParam: CaptchaRequestParams, response: unknown, config: CaptchaConfig, captcha?: unknown, tac?: CaptchaWebSdk ) => boolean | void; } export interface CaptchaConfigOptions { bindEl: string; requestCaptchaDataUrl: string; validCaptchaUrl: string; i18n?: CaptchaI18nConfig; requestHeaders?: Record; timeToTimestamp?: boolean; validSuccess?: (response: any, captcha: any, tac: CaptchaWebSdk) => void; validFail?: (response: any, captcha: any, tac: CaptchaWebSdk) => void; btnRefreshFun?: (event: any, tac: CaptchaWebSdk) => void; btnCloseFun?: (event: any, tac: CaptchaWebSdk) => void; } export class CaptchaConfig { constructor(args: CaptchaConfigOptions); bindEl: string; requestCaptchaDataUrl: string; validCaptchaUrl: string; requestHeaders: Record; addRequestChain(chain: CaptchaRequestChain): void; insertRequestChain(index: number, chain: CaptchaRequestChain): void; removeRequestChain(index: number): void; requestCaptchaData(): Promise; validCaptcha(currentCaptchaId: string, data: any, captcha?: any, tac?: CaptchaWebSdk): Promise; } export class CaptchaWebSdk { constructor(config: CaptchaConfig | CaptchaConfigOptions, style?: CaptchaStyleOptions | null); config: CaptchaConfig; style: CaptchaStyleOptions; init(): CaptchaWebSdk; reloadCaptcha(): void; destroyWindow(): void; openCaptcha(): void; createCaptcha(): void; destroyCaptcha(callback?: () => void): void; } declare global { interface Window { TAC: typeof CaptchaWebSdk; CaptchaConfig: typeof CaptchaConfig; } } declare const TAC: typeof CaptchaWebSdk; export default TAC;