我正在尝试将一些 js 代码迁移到打字稿。具体来说,我在使用 AlertifyJs 时遇到了麻烦。现在 Alertify 似乎有很多东西。
- fabien-d已停止的项目
- 拿起并继续 alertifyjs dot org
- 由 MohammadYounes alertifyjs dot com 获取
现在我可以在 DefinedlyTyped 上找到 (1) 的 d.ts,但其他的都找不到。我想使用(3)!
我想以某种方式包装或直接调用alertify.confirm("you go", "girl"); 来自 ts。
我怎样才能做到这一点?
谢谢
PS:在vs2015中编码
编辑:我想我会为你漂亮的书呆子提供一段我得到的代码片段
///<reference path="../typings/jquery/jquery.d.ts"/>
///<reference path="../typings/toastr/toastr.d.ts"/>
module mymodule.Web {
export class CommonTools {
constructor() {
toastr.options.closeButton = false;
}
showInfo(title: string, message: string) {
toastr.info(message, title);
}
showConfirm(title: string, message: string) {
//**code goes here**
}
}
}