如何在 typescript 中使用 javascript 中定义的 class

比如腾讯人机验证的 js 文件 https://ssl.captcha.qq.com/TCaptcha.js 中定义了 TencentCaptcha 类

new TencentCaptcha(CaptchaAppId, callback, options);

请问在 typescript 中如何才能使用这个类?

回答

问题补充:

TCaptcha.js 中是这样定义 TencentCaptcha 的

Captcha = function Captcha($btn,appid,_tcallback_,opts) {
    // ...
}
window.TencentCaptcha = Captcha;

以上是如何在 typescript 中使用 javascript 中定义的 class的全部内容。
THE END
分享
二维码
< <上一篇
下一篇>>