在我第一次尝试使用TypeScript编程时,我一直在使用全局变量文档和窗口,而没有声明它们的类型.有没有推荐的做法?例如,建议声明如下内容:
var document:Document; var窗口:窗口;
有没有推荐的做法?例如,建议声明如下内容:
var document : Document; var window : Window;
没有.它们由编译器使用名为的文件包含在您的编译上下文中lib.d.ts.
https://basarat.gitbooks.io/typescript/content/docs/types/lib.d.ts.html
| 归档时间: |
|
| 查看次数: |
1732 次 |
| 最近记录: |