【发布时间】:2016-07-26 06:52:56
【问题描述】:
我正在尝试将一些 js 代码迁移到 typescript。 具体来说,我在使用 AlertifyJs 时遇到了麻烦。现在 Alertify 似乎有很多东西。
- discontinued project by fabien-d
- 拿起并继续 alertifyjs dot org
- MohammadYounes alertifyjs dot com 收录
现在我可以在 distinctlyTyped 上找到 (1) 的 d.ts,但其他的则找不到。 我想用(3)!
我想以某种方式包装或直接从 ts 调用 alertify.confirm("you go", "girl");。
我怎样才能做到这一点?
谢谢
PS:在 vs2015 中编码
编辑: 以为我会为你漂亮的书呆子提供一个我得到的东西的代码 sn-p
///<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**
}
}
}
【问题讨论】:
标签: typescript alertifyjs