Skip to content
Merged
218 changes: 109 additions & 109 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,118 +16,118 @@

## 目录

* [快速上手](./tutorials/README.md)
* [5分钟了解TypeScript](./tutorials/typescript-in-5-minutes.md)
* [ASP.NET Core](./tutorials/asp.net-core.md)
* [ASP.NET 4](./tutorials/asp.net-4.md)
* [Gulp](./tutorials/gulp.md)
* [Knockout.js](./tutorials/knockout.md)
* [React与webpack](./tutorials/react-and-webpack.md)
* [React](./tutorials/react.md)
* [Angular 2](./tutorials/angular-2.md)
* [从JavaScript迁移到TypeScript](./tutorials/migrating-from-javascript.md)
* [手册](./handbook/readme.md)
* [基础类型](./handbook/basic-types.md)
* [变量声明](./handbook/variable-declarations.md)
* [接口](./handbook/interfaces.md)
* [类](./handbook/classes.md)
* [函数](./handbook/functions.md)
* [泛型](./handbook/generics.md)
* [枚举](./handbook/enums.md)
* [类型推论](./handbook/type-inference.md)
* [类型兼容性](./handbook/type-compatibility.md)
* [高级类型](./handbook/advanced-types.md)
* [实用工具类型](./handbook/utility-types.md)
* [Symbols](./handbook/symbols.md)
* [Iterators 和 Generators](./handbook/iterators-and-generators.md)
* [模块](./handbook/modules.md)
* [命名空间](./handbook/namespaces.md)
* [命名空间和模块](./handbook/namespaces-and-modules.md)
* [模块解析](./handbook/module-resolution.md)
* [声明合并](./handbook/declaration-merging.md)
* [书写.d.ts文件](./handbook/writing-definition-files.md)
* [JSX](./handbook/jsx.md)
* [Decorators](./handbook/decorators.md)
* [混入](./handbook/mixins.md)
* [三斜线指令](./handbook/triple-slash-directives.md)
* [JavaScript文件里的类型检查](./handbook/type-checking-javascript-files.md)
* [如何书写声明文件](./introduction/README.md)
* [介绍](./introduction/jie-shao.md)
* [库结构](./introduction/library-structures.md)
* [举例](./introduction/by-example.md)
* [最佳实践](./introduction/ui-fan-.dochandbookdeclaration-filesdos-and-donts.md.md)
* [深入](./introduction/deep-dive.md)
* [模板](./introduction/mo-ban.md)
* [发布](./introduction/publishing.md)
* [使用](./introduction/consumption.md)
* [工程配置](./handbook/tsconfig.json.md)
* [tsconfig.json](./handbook/tsconfig.json.md)
* [工程引用](./handbook/Project%20References.md)
* [NPM包的类型](./handbook/Typings%20for%20NPM%20Packages.md)
* [编译选项](./handbook/Compiler%20Options.md)
* [配置 Watch](./handbook/Configuring%20Watch.md)
* [在MSBuild里使用编译选项](./handbook/Compiler%20Options%20in%20MSBuild.md)
* [与其它构建工具整合](./handbook/Integrating%20with%20Build%20Tools.md)
* [使用TypeScript的每日构建版本](./handbook/Nightly%20Builds.md)
* [Wiki](./wiki/README.md)
* [TypeScript里的this](./wiki/this-in-typescript.md)
* [编码规范](./wiki/coding_guidelines.md)
* [常见编译错误](./wiki/common-errors.md)
* [支持TypeScript的编辑器](./wiki/typescript-editor-support.md)
* [结合ASP.NET v5使用TypeScript](./wiki/using-typescript-with-asp.net-5.md)
* [架构概述](./wiki/architectural-overview.md)
* [发展路线图](./wiki/roadmap.md)
* [新增功能](./release-notes/README.md)
* [TypeScript 3.7](./release-notes/typescript-3.7.md)
* [TypeScript 3.6](./release-notes/typescript-3.6.md)
* [TypeScript 3.5](./release-notes/typescript-3.5.md)
* [TypeScript 3.4](./release-notes/typescript-3.4.md)
* [TypeScript 3.3](./release-notes/typescript-3.3.md)
* [TypeScript 3.2](./release-notes/typescript-3.2.md)
* [TypeScript 3.1](./release-notes/typescript-3.1.md)
* [TypeScript 3.0](./release-notes/typescript-3.0.md)
* [TypeScript 2.9](./release-notes/typescript-2.9.md)
* [TypeScript 2.8](./release-notes/typescript-2.8.md)
* [TypeScript 2.7](./release-notes/typescript-2.7.md)
* [TypeScript 2.6](./release-notes/typescript-2.6.md)
* [TypeScript 2.5](./release-notes/typescript-2.5.md)
* [TypeScript 2.4](./release-notes/typescript-2.4.md)
* [TypeScript 2.3](./release-notes/typescript-2.3.md)
* [TypeScript 2.2](./release-notes/typescript-2.2.md)
* [TypeScript 2.1](./release-notes/typescript-2.1.md)
* [TypeScript 2.0](./release-notes/typescript-2.0.md)
* [TypeScript 1.8](./release-notes/typescript-1.8.md)
* [TypeScript 1.7](./release-notes/typescript-1.7.md)
* [TypeScript 1.6](./release-notes/typescript-1.6.md)
* [TypeScript 1.5](./release-notes/typescript-1.5.md)
* [TypeScript 1.4](./release-notes/typescript-1.4.md)
* [TypeScript 1.3](./release-notes/typescript-1.3.md)
* [TypeScript 1.1](./release-notes/typescript-1.1.md)
* [Breaking Changes](./breaking-changes/breaking-changes.md)
* [TypeScript 3.6](./breaking-changes/typescript-3.6.md)
* [TypeScript 3.5](./breaking-changes/typescript-3.5.md)
* [TypeScript 3.4](./breaking-changes/typescript-3.4.md)
* [TypeScript 3.2](./breaking-changes/typescript-3.2.md)
* [TypeScript 3.1](./breaking-changes/typescript-3.1.md)
* [TypeScript 3.0](./breaking-changes/typescript-3.0.md)
* [TypeScript 2.9](./breaking-changes/typescript-2.9.md)
* [TypeScript 2.8](./breaking-changes/typescript-2.8.md)
* [TypeScript 2.7](./breaking-changes/typescript-2.7.md)
* [TypeScript 2.6](./breaking-changes/typescript-2.6.md)
* [TypeScript 2.4](./breaking-changes/typescript-2.4.md)
* [TypeScript 2.3](./breaking-changes/typescript-2.3.md)
* [TypeScript 2.2](./breaking-changes/typescript-2.2.md)
* [TypeScript 2.1](./breaking-changes/typescript-2.1.md)
* [TypeScript 2.0](./breaking-changes/typescript-2.0.md)
* [TypeScript 1.8](./breaking-changes/typescript-1.8.md)
* [TypeScript 1.7](./breaking-changes/typescript-1.7.md)
* [TypeScript 1.6](./breaking-changes/typescript-1.6.md)
* [TypeScript 1.5](./breaking-changes/typescript-1.5.md)
* [TypeScript 1.4](./breaking-changes/typescript-1.4.md)
* [快速上手](tutorials/README.md)
* [5分钟了解TypeScript](tutorials/typescript-in-5-minutes.md)
* [ASP.NET Core](tutorials/asp.net-core.md)
* [ASP.NET 4](tutorials/asp.net-4.md)
* [Gulp](tutorials/gulp.md)
* [Knockout.js](tutorials/knockout.md)
* [React与webpack](tutorials/react-and-webpack.md)
* [React](tutorials/react.md)
* [Angular 2](tutorials/angular-2.md)
* [从JavaScript迁移到TypeScript](tutorials/migrating-from-javascript.md)
* [手册](handbook/README.md)
* [基础类型](handbook/basic-types.md)
* [变量声明](handbook/variable-declarations.md)
* [接口](handbook/interfaces.md)
* [类](handbook/classes.md)
* [函数](handbook/functions.md)
* [泛型](handbook/generics.md)
* [枚举](handbook/enums.md)
* [类型推论](handbook/type-inference.md)
* [类型兼容性](handbook/type-compatibility.md)
* [高级类型](handbook/advanced-types.md)
* [Symbols](handbook/symbols.md)
* [Iterators 和 Generators](handbook/iterators-and-generators.md)
* [模块](handbook/modules.md)
* [命名空间](handbook/namespaces.md)
* [命名空间和模块](handbook/namespaces-and-modules.md)
* [模块解析](handbook/module-resolution.md)
* [声明合并](handbook/declaration-merging.md)
* [JSX](handbook/jsx.md)
* [Decorators](handbook/decorators.md)
* [混入](handbook/mixins.md)
* [三斜线指令](handbook/triple-slash-directives.md)
* [JavaScript文件里的类型检查](handbook/type-checking-javascript-files.md)
* [实用工具类型](handbook/utility-types.md)
* [如何书写声明文件](introduction/README.md)
* [介绍](introduction/introduction.md)
* [库结构](introduction/library-structures.md)
* [举例](introduction/by-example.md)
* [最佳实践](introduction/do-s-and-don-ts.md)
* [深入](introduction/deep-dive.md)
* [模板](introduction/templates.md)
* [发布](introduction/publishing.md)
* [使用](introduction/consumption.md)
* [工程配置](tsconfig.json/README.md)
* [tsconfig.json](tsconfig.json/tsconfig.json.md)
* [工程引用](tsconfig.json/project-references.md)
* [NPM包的类型](tsconfig.json/typings-for-npm-packages.md)
* [编译选项](tsconfig.json/compiler-options.md)
* [配置 Watch](tsconfig.json/configuring-watch.md)
* [在MSBuild里使用编译选项](tsconfig.json/compiler-options-in-msbuild.md)
* [与其它构建工具整合](tsconfig.json/integrating-with-build-tools.md)
* [使用TypeScript的每日构建版本](tsconfig.json/nightly-builds.md)
* [Wiki](wiki/README.md)
* [TypeScript里的this](wiki/this-in-typescript.md)
* [编码规范](wiki/coding_guidelines.md)
* [常见编译错误](wiki/common-errors.md)
* [支持TypeScript的编辑器](wiki/typescript-editor-support.md)
* [结合ASP.NET v5使用TypeScript](wiki/using-typescript-with-asp.net-5.md)
* [架构概述](wiki/architectural-overview.md)
* [发展路线图](wiki/roadmap.md)
* [新增功能](release-notes/README.md)
* [TypeScript 3.8](release-notes/typescript-3.8.md)
* [TypeScript 3.7](release-notes/typescript-3.7.md)
* [TypeScript 3.6](release-notes/typescript-3.6.md)
* [TypeScript 3.5](release-notes/typescript-3.5.md)
* [TypeScript 3.4](release-notes/typescript-3.4.md)
* [TypeScript 3.3](release-notes/typescript-3.3.md)
* [TypeScript 3.2](release-notes/typescript-3.2.md)
* [TypeScript 3.1](release-notes/typescript-3.1.md)
* [TypeScript 3.0](release-notes/typescript-3.0.md)
* [TypeScript 2.9](release-notes/typescript-2.9.md)
* [TypeScript 2.8](release-notes/typescript-2.8.md)
* [TypeScript 2.7](release-notes/typescript-2.7.md)
* [TypeScript 2.6](release-notes/typescript-2.6.md)
* [TypeScript 2.5](release-notes/typescript-2.5.md)
* [TypeScript 2.4](release-notes/typescript-2.4.md)
* [TypeScript 2.3](release-notes/typescript-2.3.md)
* [TypeScript 2.2](release-notes/typescript-2.2.md)
* [TypeScript 2.1](release-notes/typescript-2.1.md)
* [TypeScript 2.0](release-notes/typescript-2.0.md)
* [TypeScript 1.8](release-notes/typescript-1.8.md)
* [TypeScript 1.7](release-notes/typescript-1.7.md)
* [TypeScript 1.6](release-notes/typescript-1.6.md)
* [TypeScript 1.5](release-notes/typescript-1.5.md)
* [TypeScript 1.4](release-notes/typescript-1.4.md)
* [TypeScript 1.3](release-notes/typescript-1.3.md)
* [TypeScript 1.1](release-notes/typescript-1.1.md)
* [Breaking Changes](breaking-changes/README.md)
* [TypeScript 3.6](breaking-changes/typescript-3.6.md)
* [TypeScript 3.5](breaking-changes/typescript-3.5.md)
* [TypeScript 3.4](breaking-changes/typescript-3.4.md)
* [TypeScript 3.2](breaking-changes/typescript-3.2.md)
* [TypeScript 3.1](breaking-changes/typescript-3.1.md)
* [TypeScript 3.0](breaking-changes/typescript-3.0.md)
* [TypeScript 2.9](breaking-changes/typescript-2.9.md)
* [TypeScript 2.8](breaking-changes/typescript-2.8.md)
* [TypeScript 2.7](breaking-changes/typescript-2.7.md)
* [TypeScript 2.6](breaking-changes/typescript-2.6.md)
* [TypeScript 2.4](breaking-changes/typescript-2.4.md)
* [TypeScript 2.3](breaking-changes/typescript-2.3.md)
* [TypeScript 2.2](breaking-changes/typescript-2.2.md)
* [TypeScript 2.1](breaking-changes/typescript-2.1.md)
* [TypeScript 2.0](breaking-changes/typescript-2.0.md)
* [TypeScript 1.8](breaking-changes/typescript-1.8.md)
* [TypeScript 1.7](breaking-changes/typescript-1.7.md)
* [TypeScript 1.6](breaking-changes/typescript-1.6.md)
* [TypeScript 1.5](breaking-changes/typescript-1.5.md)
* [TypeScript 1.4](breaking-changes/typescript-1.4.md)

**TypeScript手册官方英文版**

* [TypeScript手册(英文版)](http://www.typescriptlang.org/Handbook)
* [TypeScript手册(英文版)](http://www.typescriptlang.org/docs/home.html)

**TypeScript语言规范**

Expand Down
6 changes: 3 additions & 3 deletions SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@
* [JavaScript文件里的类型检查](handbook/type-checking-javascript-files.md)
* [实用工具类型](handbook/utility-types.md)
* [如何书写声明文件](introduction/README.md)
* [介绍](introduction/jie-shao.md)
* [介绍](introduction/introduction.md)
* [库结构](introduction/library-structures.md)
* [举例](introduction/by-example.md)
* [最佳实践](introduction/gui-fan-.dochandbookdeclaration-filesdos-and-donts.md.md)
* [最佳实践](introduction/do-s-and-don-ts.md)
* [深入](introduction/deep-dive.md)
* [模板](introduction/mo-ban.md)
* [模板](introduction/templates.md)
* [发布](introduction/publishing.md)
* [使用](introduction/consumption.md)
* [工程配置](tsconfig.json/README.md)
Expand Down
2 changes: 1 addition & 1 deletion breaking-changes/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@
* [TypeScript 1.6](typescript-1.6.md)
* [TypeScript 1.5](typescript-1.5.md)
* [TypeScript 1.4](typescript-1.4.md)
* [TypeScript 1.1](https://github.com/whinc/TypeScript/tree/427e94f074f7b5159f9b8e43c7148643db392263/doc/breaking-changes/TypeScript%201.1.md)
* [TypeScript 1.1](typescript-1.1.md)

28 changes: 28 additions & 0 deletions breaking-changes/typescript-1.1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# TypeScript 1.1

完整的破坏性改动列表请到这里查看:[breaking change issues](https://github.com/Microsoft/TypeScript/issues?q=is%3Aissue+milestone%3A%22TypeScript+1.1%22+label%3A%22breaking+change%22+)。

## null和undefined明显的错误使用方式现在会报错

例子:

```TypeScript
var ResultIsNumber17 = +(null + undefined);
// Operator '+' cannot be applied to types 'undefined' and 'undefined'.

var ResultIsNumber18 = +(null + null);
// Operator '+' cannot be applied to types 'null' and 'null'.

var ResultIsNumber19 = +(undefined + undefined);
// Operator '+' cannot be applied to types 'undefined' and 'undefined'.
```

相似地,把null和undefined当做具有方法的对象使用时会报错。

例子:

```TypeScript
null.toBAZ();

undefined.toBAZ();
```
2 changes: 1 addition & 1 deletion handbook/basic-types.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ let prettySure: Object = 4;
prettySure.toFixed(); // Error: Property 'toFixed' doesn't exist on type 'Object'.
```

> 注意:应避免使用`Object`,而是使用非原始`object`类型,正如[Do's and Don'ts](https://github.com/whinc/TypeScript/tree/427e94f074f7b5159f9b8e43c7148643db392263/doc/handbook/declaration-files/do-s-and-don-ts.html#general-types)里所讲的那样。
> 注意:应避免使用`Object`,而是使用非原始`object`类型,正如[Do's and Don'ts](../doc/handbook/declaration%20files/Do's%20and%20Don'ts.md)里所讲的那样。

当你只知道一部分数据的类型时,`any`类型也是有用的。 比如,你有一个数组,它包含了不同的类型的数据:

Expand Down
2 changes: 1 addition & 1 deletion handbook/namespaces-and-modules.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,5 +96,5 @@ let t = new shapes.Triangle();

### 模块的取舍

就像每个JS文件对应一个模块一样,TypeScript里模块文件与生成的JS文件也是一一对应的。 这会产生一种影响,根据你指定的目标模块系统的不同,你可能无法连接多个模块源文件。 例如当目标模块系统为`commonjs`或`umd`时,无法使用`outFile`选项,但是在TypeScript 1.8以上的版本[能够](https://github.com/whinc/TypeScript/tree/427e94f074f7b5159f9b8e43c7148643db392263/doc/handbook/release%20notes/TypeScript%201.8.md#concatenate-amd-and-system-modules-with---outfile)使用`outFile`当目标为`amd`或`system`。
就像每个JS文件对应一个模块一样,TypeScript里模块文件与生成的JS文件也是一一对应的。 这会产生一种影响,根据你指定的目标模块系统的不同,你可能无法连接多个模块源文件。 例如当目标模块系统为`commonjs`或`umd`时,无法使用`outFile`选项,但是在TypeScript 1.8以上的版本[能够](../doc/handbook/release%20notes/TypeScript%201.8.md#concatenate-amd-and-system-modules-with---outfile)使用`outFile`当目标为`amd`或`system`。

6 changes: 3 additions & 3 deletions introduction/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

这篇指南的目的是教你如何书写高质量的TypeScript声明文件。

在这篇指南里,我们假设你对TypeScript已经有了基本的了解。 如果没有,请先阅读[TypeScript手册](https://www.typescriptlang.org/docs/handbook/basic-types.html) 来了解一些基本知识,尤其是类型和命名空间部分。
在这篇指南里,我们假设你对TypeScript已经有了基本的了解。 如果没有,请先阅读[TypeScript手册](../handbook/basic-types.md) 来了解一些基本知识,尤其是类型和命名空间部分。

## 章节

Expand All @@ -18,15 +18,15 @@

### 规范

声明文件里有很多常见的错误是很容易避免的。 \[规范\]\(./Do's%20and%20Don'ts.md\)一节指出了常见的错误, 描述了如何发现它们, 与怎样去修复。 每个人都要阅读这个章节以了解如何避免常见错误。
声明文件里有很多常见的错误是很容易避免的。 [规范](../doc/handbook/declaration%20files/Do's%20and%20Don'ts.md)一节指出了常见的错误, 描述了如何发现它们, 与怎样去修复。 每个人都要阅读这个章节以了解如何避免常见错误。

### 深入

对于那些对声明文件底层工作机制感兴趣的老手们, [深入](deep-dive.md)一节解释了很多高级书写声明文件的高级概念, 以及展示了如何利用这些概念来创建整洁和直观的声明文件。

### 模版

在[模版](https://github.com/whinc/TypeScript/tree/427e94f074f7b5159f9b8e43c7148643db392263/doc/handbook/declaration%20files/Templates.md)一节里,你能找到一些声明文件,它们可以帮助你快速开始 当你在书写一个新声明文件的时候。 参考[结构](library-structures.md)这篇文档来找到应该使用哪个模版文件。
在[模版](../doc/handbook/declaration%20files/Templates.md)一节里,你能找到一些声明文件,它们可以帮助你快速开始 当你在书写一个新声明文件的时候。 参考[结构](library-structures.md)这篇文档来找到应该使用哪个模版文件。

### 发布到npm

Expand Down
File renamed without changes.
Loading