验证码调试页面
This commit is contained in:
Vendored
+39
@@ -0,0 +1,39 @@
|
||||
import { CaptchaConfig, TianAiCaptcha } from "./captcha/captcha.js"
|
||||
|
||||
export type TianAiCaptchaBindTarget = string | HTMLElement
|
||||
|
||||
export interface TianAiCaptchaStyle {
|
||||
btnUrl?: string
|
||||
logoUrl?: string | null
|
||||
bgUrl?: string
|
||||
moveTrackMaskBgColor?: string
|
||||
moveTrackMaskBorderColor?: string
|
||||
i18n?: Record<string, string>
|
||||
}
|
||||
|
||||
export interface TianAiCaptchaConfig {
|
||||
bindEl: TianAiCaptchaBindTarget
|
||||
requestCaptchaDataUrl: string
|
||||
validCaptchaUrl: string
|
||||
requestHeaders?: Record<string, string>
|
||||
timeToTimestamp?: boolean
|
||||
validSuccess?: (res: any, captcha: any, tac: TianAiCaptchaInstance) => void
|
||||
validFail?: (res: any, captcha: any, tac: TianAiCaptchaInstance) => void
|
||||
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 }
|
||||
Reference in New Issue
Block a user