import { CaptchaConfig, TianAiCaptcha } from "./captcha/captcha.js" export type TianAiCaptchaBindTarget = string | HTMLElement export interface TianAiCaptchaResult { id: string data: Record } export interface TianAiCaptchaStyle { btnUrl?: string moveTrackMaskBgColor?: string moveTrackMaskBorderColor?: string i18n?: Record } export interface TianAiCaptchaConfig { bindEl: TianAiCaptchaBindTarget requestCaptchaDataUrl: string types?: string[] validCaptchaUrl?: string timeToTimestamp?: boolean validSuccess?: (res: any, captcha: any, tac: TianAiCaptchaInstance) => void validFail?: (res: any, captcha: any, tac: TianAiCaptchaInstance) => void onDataReady?: (result: TianAiCaptchaResult, captcha: any, tac: TianAiCaptchaInstance) => void | Promise btnRefreshFun?: (el: Event, tac: TianAiCaptchaInstance) => void btnCloseFun?: (el: Event, tac: TianAiCaptchaInstance) => void } export interface TianAiCaptchaInstance { init: () => TianAiCaptchaInstance reloadCaptcha: () => void destroyWindow: () => void } export function createTianAiCaptcha( config: TianAiCaptchaConfig, style?: TianAiCaptchaStyle, ): TianAiCaptchaInstance { return new TianAiCaptcha(config, style) as TianAiCaptchaInstance } export { CaptchaConfig, TianAiCaptcha }