TypeScript 1.1
性能改进
1.1 编译器的速度通常比任何以前的版本快 4 倍左右。请参阅这篇博客文章中的一些令人印象深刻的图表。
更好的模块可见性规则
现在,只有在提供了 declaration 标志时,TypeScript 才严格执行模块中类型的可见性。这对于 Angular 场景非常有用,例如:
ts
module MyControllers {
interface ZooScope extends ng.IScope {
animals: Animal[];
}
export class ZooController {
// 以前是错误(无法暴露 ZooScope),但现在仅在尝试生成 .d.ts 文件时才报错
constructor(public $scope: ZooScope) {}
/* 更多代码 */
}
}