diff --git a/README.md b/README.md
index c159cee1..ef570f58 100755
--- a/README.md
+++ b/README.md
@@ -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语言规范**
diff --git a/SUMMARY.md b/SUMMARY.md
index 8279a5ca..f05e6e14 100644
--- a/SUMMARY.md
+++ b/SUMMARY.md
@@ -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)
diff --git a/breaking-changes/README.md b/breaking-changes/README.md
index 9d230957..93ad2432 100644
--- a/breaking-changes/README.md
+++ b/breaking-changes/README.md
@@ -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)
diff --git a/breaking-changes/typescript-1.1.md b/breaking-changes/typescript-1.1.md
new file mode 100644
index 00000000..a46c0d8e
--- /dev/null
+++ b/breaking-changes/typescript-1.1.md
@@ -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();
+```
\ No newline at end of file
diff --git a/handbook/basic-types.md b/handbook/basic-types.md
index d5b79657..761d0eb5 100644
--- a/handbook/basic-types.md
+++ b/handbook/basic-types.md
@@ -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`类型也是有用的。 比如,你有一个数组,它包含了不同的类型的数据:
diff --git a/handbook/namespaces-and-modules.md b/handbook/namespaces-and-modules.md
index 0a7b5a63..786d436b 100644
--- a/handbook/namespaces-and-modules.md
+++ b/handbook/namespaces-and-modules.md
@@ -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`。
diff --git a/introduction/README.md b/introduction/README.md
index 1b13d0fa..fab504e3 100644
--- a/introduction/README.md
+++ b/introduction/README.md
@@ -2,7 +2,7 @@
这篇指南的目的是教你如何书写高质量的TypeScript声明文件。
-在这篇指南里,我们假设你对TypeScript已经有了基本的了解。 如果没有,请先阅读[TypeScript手册](https://www.typescriptlang.org/docs/handbook/basic-types.html) 来了解一些基本知识,尤其是类型和命名空间部分。
+在这篇指南里,我们假设你对TypeScript已经有了基本的了解。 如果没有,请先阅读[TypeScript手册](../handbook/basic-types.md) 来了解一些基本知识,尤其是类型和命名空间部分。
## 章节
@@ -18,7 +18,7 @@
### 规范
-声明文件里有很多常见的错误是很容易避免的。 \[规范\]\(./Do's%20and%20Don'ts.md\)一节指出了常见的错误, 描述了如何发现它们, 与怎样去修复。 每个人都要阅读这个章节以了解如何避免常见错误。
+声明文件里有很多常见的错误是很容易避免的。 [规范](../doc/handbook/declaration%20files/Do's%20and%20Don'ts.md)一节指出了常见的错误, 描述了如何发现它们, 与怎样去修复。 每个人都要阅读这个章节以了解如何避免常见错误。
### 深入
@@ -26,7 +26,7 @@
### 模版
-在[模版](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
diff --git a/introduction/gui-fan-.dochandbookdeclaration-filesdos-and-donts.md.md b/introduction/do-s-and-don-ts.md
similarity index 100%
rename from introduction/gui-fan-.dochandbookdeclaration-filesdos-and-donts.md.md
rename to introduction/do-s-and-don-ts.md
diff --git a/introduction/jie-shao.md b/introduction/introduction.md
similarity index 100%
rename from introduction/jie-shao.md
rename to introduction/introduction.md
diff --git a/introduction/library-structures.md b/introduction/library-structures.md
index 677ab977..b30d9f56 100644
--- a/introduction/library-structures.md
+++ b/introduction/library-structures.md
@@ -4,7 +4,7 @@
一般来讲,你_组织_声明文件的方式取决于库是如何被使用的。 在JavaScript中一个库有很多使用方式,这就需要你书写声明文件去匹配它们。 这篇指南涵盖了如何识别常见库的模式,和怎样书写符合相应模式的声明文件。
-针对每种主要的库的组织模式,在[模版](https://github.com/whinc/TypeScript/tree/427e94f074f7b5159f9b8e43c7148643db392263/doc/handbook/declaration%20files/Templates.md)一节都有对应的文件。 你可以利用它们帮助你快速上手。
+针对每种主要的库的组织模式,在[模版](../doc/handbook/declaration%20files/Templates.md)一节都有对应的文件。 你可以利用它们帮助你快速上手。
## 识别库的类型
@@ -65,7 +65,7 @@ window.createGreeting = function(s) {
#### 全局库模版
-模版文件[`global.d.ts`](https://github.com/whinc/TypeScript/tree/427e94f074f7b5159f9b8e43c7148643db392263/doc/handbook/declaration%20files/templates/global.d.ts.md)定义了`myLib`库作为例子。 一定要阅读["防止命名冲突"补充说明](library-structures.md#preventing-name-conflicts)。
+模版文件[`global.d.ts`](../doc/handbook/declaration%20files/templates/global.d.ts.md)定义了`myLib`库作为例子。 一定要阅读["防止命名冲突"补充说明](library-structures.md#preventing-name-conflicts)。
### 模块化库
@@ -156,9 +156,9 @@ UMD库的文档里经常会包含通过`require`“在Node.js里使用”例子
#### 模版
-针对模块有三种可用的模块, [`module.d.ts`](https://github.com/whinc/TypeScript/tree/427e94f074f7b5159f9b8e43c7148643db392263/doc/handbook/declaration%20files/templates/module.d.ts.md), [`module-class.d.ts`](https://github.com/whinc/TypeScript/tree/427e94f074f7b5159f9b8e43c7148643db392263/doc/handbook/declaration%20files/templates/module-class.d.ts.md) and [`module-function.d.ts`](https://github.com/whinc/TypeScript/tree/427e94f074f7b5159f9b8e43c7148643db392263/doc/handbook/declaration%20files/templates/module-function.d.ts.md).
+针对模块有三种可用的模块, [`module.d.ts`](../doc/handbook/declaration%20files/templates/module.d.ts.md), [`module-class.d.ts`](../doc/handbook/declaration%20files/templates/module-class.d.ts.md) and [`module-function.d.ts`](../doc/handbook/declaration%20files/templates/module-function.d.ts.md).
-使用[`module-function.d.ts`](https://github.com/whinc/TypeScript/tree/427e94f074f7b5159f9b8e43c7148643db392263/doc/handbook/declaration%20files/templates/module-function.d.ts.md),如果模块能够作为函数_调用_。
+使用[`module-function.d.ts`](../doc/handbook/declaration%20files/templates/module-function.d.ts.md),如果模块能够作为函数_调用_。
```javascript
var x = require("foo");
@@ -168,7 +168,7 @@ var y = x(42);
一定要阅读[补充说明: “ES6模块调用签名的影响”](library-structures.md#the-impact-of-es6-on-module-call-signatures)
-使用[`module-class.d.ts`](https://github.com/whinc/TypeScript/tree/427e94f074f7b5159f9b8e43c7148643db392263/doc/handbook/declaration%20files/templates/module-class.d.ts.md)如果模块能够使用`new`来_构造_:
+使用[`module-class.d.ts`](../doc/handbook/declaration%20files/templates/module-class.d.ts.md)如果模块能够使用`new`来_构造_:
```javascript
var x = require("bar");
@@ -178,7 +178,7 @@ var y = new x("hello");
相同的[补充说明](library-structures.md#the-impact-of-es6-on-module-plugins)作用于这些模块。
-如果模块不能被调用或构造,使用[`module.d.ts`](https://github.com/whinc/TypeScript/tree/427e94f074f7b5159f9b8e43c7148643db392263/doc/handbook/declaration%20files/templates/module.d.ts.md)文件。
+如果模块不能被调用或构造,使用[`module.d.ts`](../doc/handbook/declaration%20files/templates/module.d.ts.md)文件。
### _模块插件_或_UMD插件_
@@ -188,7 +188,7 @@ var y = new x("hello");
#### 模版
-使用[`module-plugin.d.ts`](https://github.com/whinc/TypeScript/tree/427e94f074f7b5159f9b8e43c7148643db392263/doc/handbook/declaration%20files/templates/module-plugin.d.ts.md)模版。
+使用[`module-plugin.d.ts`](../doc/handbook/declaration%20files/templates/module-plugin.d.ts.md)模版。
### _全局插件_
@@ -214,7 +214,7 @@ console.log(y.reverseAndSort());
#### 模版
-使用[`global-plugin.d.ts`](https://github.com/whinc/TypeScript/tree/427e94f074f7b5159f9b8e43c7148643db392263/doc/handbook/declaration%20files/templates/global-plugin.d.ts.md)模版。
+使用[`global-plugin.d.ts`](../doc/handbook/declaration%20files/templates/global-plugin.d.ts.md)模版。
### _全局修改的模块_
@@ -243,7 +243,7 @@ console.log(y.reverseAndSort());
#### 模版
-使用[`global-modifying-module.d.ts`](https://github.com/whinc/TypeScript/tree/427e94f074f7b5159f9b8e43c7148643db392263/doc/handbook/declaration%20files/templates/global-modifying-module.d.ts.md)模版。
+使用[`global-modifying-module.d.ts`](../doc/handbook/declaration%20files/templates/global-modifying-module.d.ts.md)模版。
## 使用依赖
diff --git a/introduction/publishing.md b/introduction/publishing.md
index 945b6907..36e12eca 100644
--- a/introduction/publishing.md
+++ b/introduction/publishing.md
@@ -76,10 +76,6 @@ _应该_使用`/// `代替
* _不要_将声明拷贝到你的包里。
* _应该_依赖于npm类型声明包,如果依赖包没包含它自己的声明的话。
-### 公布你的声明文件
-
-在发布声明文件包之后,确保在[DefinitelyTyped外部包列表](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/types-2.0/notNeededPackages.json)里面添加一条引用。 这可以让查找工具知道你的包提供了自己的声明文件。
-
## 发布到[@types](https://www.npmjs.com/~types)
[@types](https://www.npmjs.com/~types)下面的包是从[DefinitelyTyped](https://github.com/DefinitelyTyped/DefinitelyTyped)里自动发布的,通过[types-publisher工具](https://github.com/Microsoft/types-publisher)。 如果想让你的包发布为@types包,提交一个pull request到[https://github.com/DefinitelyTyped/DefinitelyTyped](https://github.com/DefinitelyTyped/DefinitelyTyped)。 在这里查看详细信息[contribution guidelines page](http://definitelytyped.org/guides/contributing.html)。
diff --git a/introduction/mo-ban.md b/introduction/templates.md
similarity index 100%
rename from introduction/mo-ban.md
rename to introduction/templates.md
diff --git a/introduction/templates/global-modifying-module.d.ts.md b/introduction/templates/global-modifying-module.d.ts.md
new file mode 100644
index 00000000..a2eb99d0
--- /dev/null
+++ b/introduction/templates/global-modifying-module.d.ts.md
@@ -0,0 +1,35 @@
+```ts
+// Type definitions for [~THE LIBRARY NAME~] [~OPTIONAL VERSION NUMBER~]
+// Project: [~THE PROJECT NAME~]
+// Definitions by: [~YOUR NAME~] <[~A URL FOR YOU~]>
+
+/*~ This is the global-modifying module template file. You should rename it to index.d.ts
+ *~ and place it in a folder with the same name as the module.
+ *~ For example, if you were writing a file for "super-greeter", this
+ *~ file should be 'super-greeter/index.d.ts'
+ */
+
+/*~ Note: If your global-modifying module is callable or constructable, you'll
+ *~ need to combine the patterns here with those in the module-class or module-function
+ *~ template files
+ */
+declare global {
+ /*~ Here, declare things that go in the global namespace, or augment
+ *~ existing declarations in the global namespace
+ */
+ interface String {
+ fancyFormat(opts: StringFormatOptions): string;
+ }
+}
+
+/*~ If your module exports types or values, write them as usual */
+export interface StringFormatOptions {
+ fancinessLevel: number;
+}
+
+/*~ For example, declaring a method on the module (in addition to its global side effects) */
+export function doSomething(): void;
+
+/*~ If your module exports nothing, you'll need this line. Otherwise, delete it */
+export { };
+```
\ No newline at end of file
diff --git a/introduction/templates/global-plugin.d.ts.md b/introduction/templates/global-plugin.d.ts.md
new file mode 100644
index 00000000..7e2b8e6b
--- /dev/null
+++ b/introduction/templates/global-plugin.d.ts.md
@@ -0,0 +1,27 @@
+```ts
+// Type definitions for [~THE LIBRARY NAME~] [~OPTIONAL VERSION NUMBER~]
+// Project: [~THE PROJECT NAME~]
+// Definitions by: [~YOUR NAME~] <[~A URL FOR YOU~]>
+
+/*~ This template shows how to write a global plugin. */
+
+/*~ Write a declaration for the original type and add new members.
+ *~ For example, this adds a 'toBinaryString' method with overloads to
+ *~ the built-in number type.
+ */
+interface Number {
+ toBinaryString(opts?: MyLibrary.BinaryFormatOptions): string;
+ toBinaryString(callback: MyLibrary.BinaryFormatCallback, opts?: MyLibrary.BinaryFormatOptions): string;
+}
+
+/*~ If you need to declare several types, place them inside a namespace
+ *~ to avoid adding too many things to the global namespace.
+ */
+declare namespace MyLibrary {
+ type BinaryFormatCallback = (n: number) => string;
+ interface BinaryFormatOptions {
+ prefix?: string;
+ padding: number;
+ }
+}
+```
\ No newline at end of file
diff --git a/introduction/templates/global.d.ts.md b/introduction/templates/global.d.ts.md
new file mode 100644
index 00000000..ca38dda7
--- /dev/null
+++ b/introduction/templates/global.d.ts.md
@@ -0,0 +1,64 @@
+```ts
+// Type definitions for [~THE LIBRARY NAME~] [~OPTIONAL VERSION NUMBER~]
+// Project: [~THE PROJECT NAME~]
+// Definitions by: [~YOUR NAME~] <[~A URL FOR YOU~]>
+
+/*~ If this library is callable (e.g. can be invoked as myLib(3)),
+ *~ include those call signatures here.
+ *~ Otherwise, delete this section.
+ */
+declare function myLib(a: string): string;
+declare function myLib(a: number): number;
+
+/*~ If you want the name of this library to be a valid type name,
+ *~ you can do so here.
+ *~
+ *~ For example, this allows us to write 'var x: myLib';
+ *~ Be sure this actually makes sense! If it doesn't, just
+ *~ delete this declaration and add types inside the namespace below.
+ */
+interface myLib {
+ name: string;
+ length: number;
+ extras?: string[];
+}
+
+/*~ If your library has properties exposed on a global variable,
+ *~ place them here.
+ *~ You should also place types (interfaces and type alias) here.
+ */
+declare namespace myLib {
+ //~ We can write 'myLib.timeout = 50;'
+ let timeout: number;
+
+ //~ We can access 'myLib.version', but not change it
+ const version: string;
+
+ //~ There's some class we can create via 'let c = new myLib.Cat(42)'
+ //~ Or reference e.g. 'function f(c: myLib.Cat) { ... }
+ class Cat {
+ constructor(n: number);
+
+ //~ We can read 'c.age' from a 'Cat' instance
+ readonly age: number;
+
+ //~ We can invoke 'c.purr()' from a 'Cat' instance
+ purr(): void;
+ }
+
+ //~ We can declare a variable as
+ //~ 'var s: myLib.CatSettings = { weight: 5, name: "Maru" };'
+ interface CatSettings {
+ weight: number;
+ name: string;
+ tailLength?: number;
+ }
+
+ //~ We can write 'const v: myLib.VetID = 42;'
+ //~ or 'const v: myLib.VetID = "bob";'
+ type VetID = string | number;
+
+ //~ We can invoke 'myLib.checkCat(c)' or 'myLib.checkCat(c, v);'
+ function checkCat(c: Cat, s?: VetID);
+}
+```
\ No newline at end of file
diff --git a/introduction/templates/module-class.d.ts.md b/introduction/templates/module-class.d.ts.md
new file mode 100644
index 00000000..cf746c38
--- /dev/null
+++ b/introduction/templates/module-class.d.ts.md
@@ -0,0 +1,59 @@
+```ts
+// Type definitions for [~THE LIBRARY NAME~] [~OPTIONAL VERSION NUMBER~]
+// Project: [~THE PROJECT NAME~]
+// Definitions by: [~YOUR NAME~] <[~A URL FOR YOU~]>
+
+/*~ This is the module template file for class modules.
+ *~ You should rename it to index.d.ts and place it in a folder with the same name as the module.
+ *~ For example, if you were writing a file for "super-greeter", this
+ *~ file should be 'super-greeter/index.d.ts'
+ */
+
+// Note that ES6 modules cannot directly export class objects.
+// This file should be imported using the CommonJS-style:
+// import x = require('[~THE MODULE~]');
+//
+// Alternatively, if --allowSyntheticDefaultImports or
+// --esModuleInterop is turned on, this file can also be
+// imported as a default import:
+// import x from '[~THE MODULE~]';
+//
+// Refer to the TypeScript documentation at
+// https://www.typescriptlang.org/docs/handbook/modules.html#export--and-import--require
+// to understand common workarounds for this limitation of ES6 modules.
+
+/*~ If this module is a UMD module that exposes a global variable 'myClassLib' when
+ *~ loaded outside a module loader environment, declare that global here.
+ *~ Otherwise, delete this declaration.
+ */
+export as namespace myClassLib;
+
+/*~ This declaration specifies that the class constructor function
+ *~ is the exported object from the file
+ */
+export = MyClass;
+
+/*~ Write your module's methods and properties in this class */
+declare class MyClass {
+ constructor(someParam?: string);
+
+ someProperty: string[];
+
+ myMethod(opts: MyClass.MyClassMethodOptions): number;
+}
+
+/*~ If you want to expose types from your module as well, you can
+ *~ place them in this block.
+ *~
+ *~ Note that if you decide to include this namespace, the module can be
+ *~ incorrectly imported as a namespace object, unless
+ *~ --esModuleInterop is turned on:
+ *~ import * as x from '[~THE MODULE~]'; // WRONG! DO NOT DO THIS!
+ */
+declare namespace MyClass {
+ export interface MyClassMethodOptions {
+ width?: number;
+ height?: number;
+ }
+}
+```
diff --git a/introduction/templates/module-function.d.ts.md b/introduction/templates/module-function.d.ts.md
new file mode 100644
index 00000000..6fc05983
--- /dev/null
+++ b/introduction/templates/module-function.d.ts.md
@@ -0,0 +1,68 @@
+```ts
+// Type definitions for [~THE LIBRARY NAME~] [~OPTIONAL VERSION NUMBER~]
+// Project: [~THE PROJECT NAME~]
+// Definitions by: [~YOUR NAME~] <[~A URL FOR YOU~]>
+
+/*~ This is the module template file for function modules.
+ *~ You should rename it to index.d.ts and place it in a folder with the same name as the module.
+ *~ For example, if you were writing a file for "super-greeter", this
+ *~ file should be 'super-greeter/index.d.ts'
+ */
+
+// Note that ES6 modules cannot directly export class objects.
+// This file should be imported using the CommonJS-style:
+// import x = require('[~THE MODULE~]');
+//
+// Alternatively, if --allowSyntheticDefaultImports or
+// --esModuleInterop is turned on, this file can also be
+// imported as a default import:
+// import x from '[~THE MODULE~]';
+//
+// Refer to the TypeScript documentation at
+// https://www.typescriptlang.org/docs/handbook/modules.html#export--and-import--require
+// to understand common workarounds for this limitation of ES6 modules.
+
+/*~ If this module is a UMD module that exposes a global variable 'myFuncLib' when
+ *~ loaded outside a module loader environment, declare that global here.
+ *~ Otherwise, delete this declaration.
+ */
+export as namespace myFuncLib;
+
+/*~ This declaration specifies that the function
+ *~ is the exported object from the file
+ */
+export = MyFunction;
+
+/*~ This example shows how to have multiple overloads for your function */
+declare function MyFunction(name: string): MyFunction.NamedReturnType;
+declare function MyFunction(length: number): MyFunction.LengthReturnType;
+
+/*~ If you want to expose types from your module as well, you can
+ *~ place them in this block. Often you will want to describe the
+ *~ shape of the return type of the function; that type should
+ *~ be declared in here, as this example shows.
+ *~
+ *~ Note that if you decide to include this namespace, the module can be
+ *~ incorrectly imported as a namespace object, unless
+ *~ --esModuleInterop is turned on:
+ *~ import * as x from '[~THE MODULE~]'; // WRONG! DO NOT DO THIS!
+ */
+declare namespace MyFunction {
+ export interface LengthReturnType {
+ width: number;
+ height: number;
+ }
+ export interface NamedReturnType {
+ firstName: string;
+ lastName: string;
+ }
+
+ /*~ If the module also has properties, declare them here. For example,
+ *~ this declaration says that this code is legal:
+ *~ import f = require('myFuncLibrary');
+ *~ console.log(f.defaultName);
+ */
+ export const defaultName: string;
+ export let defaultLength: number;
+}
+```
diff --git a/introduction/templates/module-plugin.d.ts.md b/introduction/templates/module-plugin.d.ts.md
new file mode 100644
index 00000000..008c79b6
--- /dev/null
+++ b/introduction/templates/module-plugin.d.ts.md
@@ -0,0 +1,36 @@
+```ts
+// Type definitions for [~THE LIBRARY NAME~] [~OPTIONAL VERSION NUMBER~]
+// Project: [~THE PROJECT NAME~]
+// Definitions by: [~YOUR NAME~] <[~A URL FOR YOU~]>
+
+/*~ This is the module plugin template file. You should rename it to index.d.ts
+ *~ and place it in a folder with the same name as the module.
+ *~ For example, if you were writing a file for "super-greeter", this
+ *~ file should be 'super-greeter/index.d.ts'
+ */
+
+/*~ On this line, import the module which this module adds to */
+import * as m from 'someModule';
+
+/*~ You can also import other modules if needed */
+import * as other from 'anotherModule';
+
+/*~ Here, declare the same module as the one you imported above */
+declare module 'someModule' {
+ /*~ Inside, add new function, classes, or variables. You can use
+ *~ unexported types from the original module if needed. */
+ export function theNewMethod(x: m.foo): other.bar;
+
+ /*~ You can also add new properties to existing interfaces from
+ *~ the original module by writing interface augmentations */
+ export interface SomeModuleOptions {
+ someModuleSetting?: string;
+ }
+
+ /*~ New types can also be declared and will appear as if they
+ *~ are in the original module */
+ export interface MyModulePluginOptions {
+ size: number;
+ }
+}
+```
\ No newline at end of file
diff --git a/introduction/templates/module.d.ts.md b/introduction/templates/module.d.ts.md
new file mode 100644
index 00000000..9e6805d2
--- /dev/null
+++ b/introduction/templates/module.d.ts.md
@@ -0,0 +1,46 @@
+```ts
+// Type definitions for [~THE LIBRARY NAME~] [~OPTIONAL VERSION NUMBER~]
+// Project: [~THE PROJECT NAME~]
+// Definitions by: [~YOUR NAME~] <[~A URL FOR YOU~]>
+
+/*~ This is the module template file. You should rename it to index.d.ts
+ *~ and place it in a folder with the same name as the module.
+ *~ For example, if you were writing a file for "super-greeter", this
+ *~ file should be 'super-greeter/index.d.ts'
+ */
+
+/*~ If this module is a UMD module that exposes a global variable 'myLib' when
+ *~ loaded outside a module loader environment, declare that global here.
+ *~ Otherwise, delete this declaration.
+ */
+export as namespace myLib;
+
+/*~ If this module has methods, declare them as functions like so.
+ */
+export function myMethod(a: string): string;
+export function myOtherMethod(a: number): number;
+
+/*~ You can declare types that are available via importing the module */
+export interface someType {
+ name: string;
+ length: number;
+ extras?: string[];
+}
+
+/*~ You can declare properties of the module using const, let, or var */
+export const myField: number;
+
+/*~ If there are types, properties, or methods inside dotted names
+ *~ of the module, declare them inside a 'namespace'.
+ */
+export namespace subProp {
+ /*~ For example, given this definition, someone could write:
+ *~ import { subProp } from 'yourModule';
+ *~ subProp.foo();
+ *~ or
+ *~ import * as yourMod from 'yourModule';
+ *~ yourMod.subProp.foo();
+ */
+ export function foo(): void;
+}
+```
\ No newline at end of file
diff --git a/preface.md b/preface.md
index 9ceb0253..270b6d34 100644
--- a/preface.md
+++ b/preface.md
@@ -1,4 +1,4 @@
-# Introduction
+# 介绍
> 从前打心眼儿里讨厌编译成JavaScript的这类语言,像Coffee,Dart等。 但是在15年春节前后却爱上了TypeScript。 同时非常喜欢的框架Dojo,Angularjs也宣布使用TypeScript做新版本的开发。 那么TypeScript究竟为何物?又有什么魅力呢?
@@ -12,111 +12,111 @@ TypeScript目前还在积极的开发完善之中,不断地会有新的特性
## 目录
-* [快速上手](https://github.com/whinc/TypeScript/tree/427e94f074f7b5159f9b8e43c7148643db392263/doc/handbook/tutorials/README.html)
- * [5分钟了解TypeScript](https://github.com/whinc/TypeScript/tree/427e94f074f7b5159f9b8e43c7148643db392263/doc/handbook/tutorials/TypeScript%20in%205%20minutes.html)
- * [ASP.NET Core](https://github.com/whinc/TypeScript/tree/427e94f074f7b5159f9b8e43c7148643db392263/doc/handbook/tutorials/ASP.NET%20Core.html)
- * [ASP.NET 4](https://github.com/whinc/TypeScript/tree/427e94f074f7b5159f9b8e43c7148643db392263/doc/handbook/tutorials/ASP.NET%204.html)
- * [Gulp](https://github.com/whinc/TypeScript/tree/427e94f074f7b5159f9b8e43c7148643db392263/doc/handbook/tutorials/Gulp.html)
- * [Knockout.js](https://github.com/whinc/TypeScript/tree/427e94f074f7b5159f9b8e43c7148643db392263/doc/handbook/tutorials/Knockout.html)
- * [React与webpack](https://github.com/whinc/TypeScript/tree/427e94f074f7b5159f9b8e43c7148643db392263/doc/handbook/tutorials/React%20&%20Webpack.html)
- * [React](https://github.com/whinc/TypeScript/tree/427e94f074f7b5159f9b8e43c7148643db392263/doc/handbook/tutorials/React.html)
- * [Angular 2](https://github.com/whinc/TypeScript/tree/427e94f074f7b5159f9b8e43c7148643db392263/doc/handbook/tutorials/Angular%202.html)
- * [从JavaScript迁移到TypeScript](https://github.com/whinc/TypeScript/tree/427e94f074f7b5159f9b8e43c7148643db392263/doc/handbook/tutorials/Migrating%20from%20JavaScript.html)
-* [手册](https://github.com/whinc/TypeScript/tree/427e94f074f7b5159f9b8e43c7148643db392263/doc/handbook/README.html)
- * [基础类型](https://github.com/whinc/TypeScript/tree/427e94f074f7b5159f9b8e43c7148643db392263/doc/handbook/Basic%20Types.html)
- * [变量声明](https://github.com/whinc/TypeScript/tree/427e94f074f7b5159f9b8e43c7148643db392263/doc/handbook/Variable%20Declarations.html)
- * [接口](https://github.com/whinc/TypeScript/tree/427e94f074f7b5159f9b8e43c7148643db392263/doc/handbook/Interfaces.html)
- * [类](https://github.com/whinc/TypeScript/tree/427e94f074f7b5159f9b8e43c7148643db392263/doc/handbook/Classes.html)
- * [函数](https://github.com/whinc/TypeScript/tree/427e94f074f7b5159f9b8e43c7148643db392263/doc/handbook/Functions.html)
- * [泛型](https://github.com/whinc/TypeScript/tree/427e94f074f7b5159f9b8e43c7148643db392263/doc/handbook/Generics.html)
- * [枚举](https://github.com/whinc/TypeScript/tree/427e94f074f7b5159f9b8e43c7148643db392263/doc/handbook/Enums.html)
- * [类型推论](https://github.com/whinc/TypeScript/tree/427e94f074f7b5159f9b8e43c7148643db392263/doc/handbook/Type%20Inference.html)
- * [类型兼容性](https://github.com/whinc/TypeScript/tree/427e94f074f7b5159f9b8e43c7148643db392263/doc/handbook/Type%20Compatibility.html)
- * [高级类型](https://github.com/whinc/TypeScript/tree/427e94f074f7b5159f9b8e43c7148643db392263/doc/handbook/Advanced%20Types.html)
- * [实用工具类型](https://github.com/whinc/TypeScript/tree/427e94f074f7b5159f9b8e43c7148643db392263/doc/handbook/Utilit%20Types.html)
- * [Symbols](https://github.com/whinc/TypeScript/tree/427e94f074f7b5159f9b8e43c7148643db392263/doc/handbook/Symbols.html)
- * [Iterators 和 Generators](https://github.com/whinc/TypeScript/tree/427e94f074f7b5159f9b8e43c7148643db392263/doc/handbook/Iterators%20and%20Generators.html)
- * [模块](https://github.com/whinc/TypeScript/tree/427e94f074f7b5159f9b8e43c7148643db392263/doc/handbook/Modules.html)
- * [命名空间](https://github.com/whinc/TypeScript/tree/427e94f074f7b5159f9b8e43c7148643db392263/doc/handbook/Namespaces.html)
- * [命名空间和模块](https://github.com/whinc/TypeScript/tree/427e94f074f7b5159f9b8e43c7148643db392263/doc/handbook/Namespaces%20and%20Modules.html)
- * [模块解析](https://github.com/whinc/TypeScript/tree/427e94f074f7b5159f9b8e43c7148643db392263/doc/handbook/Module%20Resolution.html)
- * [声明合并](https://github.com/whinc/TypeScript/tree/427e94f074f7b5159f9b8e43c7148643db392263/doc/handbook/Declaration%20Merging.html)
- * [书写.d.ts文件](https://github.com/whinc/TypeScript/tree/427e94f074f7b5159f9b8e43c7148643db392263/doc/handbook/Writing%20Definition%20Files.html)
- * [JSX](https://github.com/whinc/TypeScript/tree/427e94f074f7b5159f9b8e43c7148643db392263/doc/handbook/JSX.html)
- * [Decorators](https://github.com/whinc/TypeScript/tree/427e94f074f7b5159f9b8e43c7148643db392263/doc/handbook/Decorators.html)
- * [混入](https://github.com/whinc/TypeScript/tree/427e94f074f7b5159f9b8e43c7148643db392263/doc/handbook/Mixins.html)
- * [三斜线指令](https://github.com/whinc/TypeScript/tree/427e94f074f7b5159f9b8e43c7148643db392263/doc/handbook/Triple-Slash%20Directives.html)
- * [JavaScript文件里的类型检查](https://github.com/whinc/TypeScript/tree/427e94f074f7b5159f9b8e43c7148643db392263/doc/handbook/Type%20Checking%20JavaScript%20Files.html)
-* [如何书写声明文件](https://github.com/whinc/TypeScript/tree/427e94f074f7b5159f9b8e43c7148643db392263/doc/handbook/declaration%20files/Introduction.html)
- * [结构](https://github.com/whinc/TypeScript/tree/427e94f074f7b5159f9b8e43c7148643db392263/doc/handbook/declaration%20files/Library%20Structures.html)
+* [快速上手](doc/handbook/tutorials/README.html)
+ * [5分钟了解TypeScript](doc/handbook/tutorials/TypeScript%20in%205%20minutes.html)
+ * [ASP.NET Core](doc/handbook/tutorials/ASP.NET%20Core.html)
+ * [ASP.NET 4](doc/handbook/tutorials/ASP.NET%204.html)
+ * [Gulp](doc/handbook/tutorials/Gulp.html)
+ * [Knockout.js](doc/handbook/tutorials/Knockout.html)
+ * [React与webpack](doc/handbook/tutorials/React%20&%20Webpack.html)
+ * [React](doc/handbook/tutorials/React.html)
+ * [Angular 2](doc/handbook/tutorials/Angular%202.html)
+ * [从JavaScript迁移到TypeScript](doc/handbook/tutorials/Migrating%20from%20JavaScript.html)
+* [手册](doc/handbook/README.html)
+ * [基础类型](doc/handbook/Basic%20Types.html)
+ * [变量声明](doc/handbook/Variable%20Declarations.html)
+ * [接口](doc/handbook/Interfaces.html)
+ * [类](doc/handbook/Classes.html)
+ * [函数](doc/handbook/Functions.html)
+ * [泛型](doc/handbook/Generics.html)
+ * [枚举](doc/handbook/Enums.html)
+ * [类型推论](doc/handbook/Type%20Inference.html)
+ * [类型兼容性](doc/handbook/Type%20Compatibility.html)
+ * [高级类型](doc/handbook/Advanced%20Types.html)
+ * [实用工具类型](doc/handbook/Utilit%20Types.html)
+ * [Symbols](doc/handbook/Symbols.html)
+ * [Iterators 和 Generators](doc/handbook/Iterators%20and%20Generators.html)
+ * [模块](doc/handbook/Modules.html)
+ * [命名空间](doc/handbook/Namespaces.html)
+ * [命名空间和模块](doc/handbook/Namespaces%20and%20Modules.html)
+ * [模块解析](doc/handbook/Module%20Resolution.html)
+ * [声明合并](doc/handbook/Declaration%20Merging.html)
+ * [书写.d.ts文件](doc/handbook/Writing%20Definition%20Files.html)
+ * [JSX](doc/handbook/JSX.html)
+ * [Decorators](doc/handbook/Decorators.html)
+ * [混入](doc/handbook/Mixins.html)
+ * [三斜线指令](doc/handbook/Triple-Slash%20Directives.html)
+ * [JavaScript文件里的类型检查](doc/handbook/Type%20Checking%20JavaScript%20Files.html)
+* [如何书写声明文件](doc/handbook/declaration%20files/Introduction.html)
+ * [结构](doc/handbook/declaration%20files/Library%20Structures.html)
* \[规范\]\(./doc/handbook/declaration files/Do's and Don'ts.html\)
- * [举例](https://github.com/whinc/TypeScript/tree/427e94f074f7b5159f9b8e43c7148643db392263/doc/handbook/declaration%20files/By%20Example.html)
- * [深入](https://github.com/whinc/TypeScript/tree/427e94f074f7b5159f9b8e43c7148643db392263/doc/handbook/declaration%20files/Deep%20Dive.html)
- * [发布](https://github.com/whinc/TypeScript/tree/427e94f074f7b5159f9b8e43c7148643db392263/doc/handbook/declaration%20files/Publishing.html)
- * [使用](https://github.com/whinc/TypeScript/tree/427e94f074f7b5159f9b8e43c7148643db392263/doc/handbook/declaration%20files/Consumption.html)
-* [工程配置](https://github.com/whinc/TypeScript/tree/427e94f074f7b5159f9b8e43c7148643db392263/doc/handbook/tsconfig.json.html)
- * [tsconfig.json](https://github.com/whinc/TypeScript/tree/427e94f074f7b5159f9b8e43c7148643db392263/doc/handbook/tsconfig.json.html)
- * [工程引用](https://github.com/whinc/TypeScript/tree/427e94f074f7b5159f9b8e43c7148643db392263/doc/handbook/Project%20References.html)
- * [NPM包的类型](https://github.com/whinc/TypeScript/tree/427e94f074f7b5159f9b8e43c7148643db392263/doc/handbook/Typings%20for%20NPM%20Packages.html)
- * [编译选项](https://github.com/whinc/TypeScript/tree/427e94f074f7b5159f9b8e43c7148643db392263/doc/handbook/Compiler%20Options.html)
- * [配置 Watch](https://github.com/whinc/TypeScript/tree/427e94f074f7b5159f9b8e43c7148643db392263/doc/handbook/Configuring%20Watch.html)
- * [在MSBuild里使用编译选项](https://github.com/whinc/TypeScript/tree/427e94f074f7b5159f9b8e43c7148643db392263/doc/handbook/Compiler%20Options%20in%20MSBuild.html)
- * [与其它构建工具整合](https://github.com/whinc/TypeScript/tree/427e94f074f7b5159f9b8e43c7148643db392263/doc/handbook/Integrating%20with%20Build%20Tools.html)
- * [使用TypeScript的每日构建版本](https://github.com/whinc/TypeScript/tree/427e94f074f7b5159f9b8e43c7148643db392263/doc/handbook/Nightly%20Builds.html)
-* [Wiki](https://github.com/whinc/TypeScript/tree/427e94f074f7b5159f9b8e43c7148643db392263/doc/wiki/README.html)
- * [TypeScript里的this](https://github.com/whinc/TypeScript/tree/427e94f074f7b5159f9b8e43c7148643db392263/doc/wiki/this-in-TypeScript.html)
- * [编码规范](https://github.com/whinc/TypeScript/tree/427e94f074f7b5159f9b8e43c7148643db392263/doc/wiki/coding_guidelines.html)
- * [常见编译错误](https://github.com/whinc/TypeScript/tree/427e94f074f7b5159f9b8e43c7148643db392263/doc/wiki/Common%20Errors.html)
- * [支持TypeScript的编辑器](https://github.com/whinc/TypeScript/tree/427e94f074f7b5159f9b8e43c7148643db392263/doc/wiki/TypeScript-Editor-Support.html)
- * [结合ASP.NET v5使用TypeScript](https://github.com/whinc/TypeScript/tree/427e94f074f7b5159f9b8e43c7148643db392263/doc/wiki/Using-TypeScript-With-ASP.NET-5.html)
- * [架构概述](https://github.com/whinc/TypeScript/tree/427e94f074f7b5159f9b8e43c7148643db392263/doc/wiki/Architectural-Overview.html)
- * [发展路线图](https://github.com/whinc/TypeScript/tree/427e94f074f7b5159f9b8e43c7148643db392263/doc/wiki/Roadmap.html)
-* [新增功能](https://github.com/whinc/TypeScript/tree/427e94f074f7b5159f9b8e43c7148643db392263/doc/release-notes/README.html)
- * [TypeScript 3.7](https://github.com/whinc/TypeScript/tree/427e94f074f7b5159f9b8e43c7148643db392263/doc/release-notes/TypeScript%203.7.html)
- * [TypeScript 3.6](https://github.com/whinc/TypeScript/tree/427e94f074f7b5159f9b8e43c7148643db392263/doc/release-notes/TypeScript%203.6.html)
- * [TypeScript 3.5](https://github.com/whinc/TypeScript/tree/427e94f074f7b5159f9b8e43c7148643db392263/doc/release-notes/TypeScript%203.5.html)
- * [TypeScript 3.3](https://github.com/whinc/TypeScript/tree/427e94f074f7b5159f9b8e43c7148643db392263/doc/release-notes/TypeScript%203.3.html)
- * [TypeScript 3.2](https://github.com/whinc/TypeScript/tree/427e94f074f7b5159f9b8e43c7148643db392263/doc/release-notes/TypeScript%203.2.html)
- * [TypeScript 3.1](https://github.com/whinc/TypeScript/tree/427e94f074f7b5159f9b8e43c7148643db392263/doc/release-notes/TypeScript%203.1.html)
- * [TypeScript 3.0](https://github.com/whinc/TypeScript/tree/427e94f074f7b5159f9b8e43c7148643db392263/doc/release-notes/TypeScript%203.0.html)
- * [TypeScript 2.9](https://github.com/whinc/TypeScript/tree/427e94f074f7b5159f9b8e43c7148643db392263/doc/release-notes/TypeScript%202.9.html)
- * [TypeScript 2.8](https://github.com/whinc/TypeScript/tree/427e94f074f7b5159f9b8e43c7148643db392263/doc/release-notes/TypeScript%202.8.html)
- * [TypeScript 2.7](https://github.com/whinc/TypeScript/tree/427e94f074f7b5159f9b8e43c7148643db392263/doc/release-notes/TypeScript%202.7.html)
- * [TypeScript 2.6](https://github.com/whinc/TypeScript/tree/427e94f074f7b5159f9b8e43c7148643db392263/doc/release-notes/TypeScript%202.6.html)
- * [TypeScript 2.5](https://github.com/whinc/TypeScript/tree/427e94f074f7b5159f9b8e43c7148643db392263/doc/release-notes/TypeScript%202.5.html)
- * [TypeScript 2.4](https://github.com/whinc/TypeScript/tree/427e94f074f7b5159f9b8e43c7148643db392263/doc/release-notes/TypeScript%202.4.html)
- * [TypeScript 2.3](https://github.com/whinc/TypeScript/tree/427e94f074f7b5159f9b8e43c7148643db392263/doc/release-notes/TypeScript%202.3.html)
- * [TypeScript 2.2](https://github.com/whinc/TypeScript/tree/427e94f074f7b5159f9b8e43c7148643db392263/doc/release-notes/TypeScript%202.2.html)
- * [TypeScript 2.1](https://github.com/whinc/TypeScript/tree/427e94f074f7b5159f9b8e43c7148643db392263/doc/release-notes/TypeScript%202.1.html)
- * [TypeScript 2.0](https://github.com/whinc/TypeScript/tree/427e94f074f7b5159f9b8e43c7148643db392263/doc/release-notes/TypeScript%202.0.html)
- * [TypeScript 1.8](https://github.com/whinc/TypeScript/tree/427e94f074f7b5159f9b8e43c7148643db392263/doc/release-notes/TypeScript%201.8.html)
- * [TypeScript 1.7](https://github.com/whinc/TypeScript/tree/427e94f074f7b5159f9b8e43c7148643db392263/doc/release-notes/TypeScript%201.7.html)
- * [TypeScript 1.6](https://github.com/whinc/TypeScript/tree/427e94f074f7b5159f9b8e43c7148643db392263/doc/release-notes/TypeScript%201.6.html)
- * [TypeScript 1.5](https://github.com/whinc/TypeScript/tree/427e94f074f7b5159f9b8e43c7148643db392263/doc/release-notes/TypeScript%201.5.html)
- * [TypeScript 1.4](https://github.com/whinc/TypeScript/tree/427e94f074f7b5159f9b8e43c7148643db392263/doc/release-notes/TypeScript%201.4.html)
- * [TypeScript 1.3](https://github.com/whinc/TypeScript/tree/427e94f074f7b5159f9b8e43c7148643db392263/doc/release-notes/TypeScript%201.3.html)
- * [TypeScript 1.1](https://github.com/whinc/TypeScript/tree/427e94f074f7b5159f9b8e43c7148643db392263/doc/release-notes/TypeScript%201.1.html)
-* [Breaking Changes](https://github.com/whinc/TypeScript/tree/427e94f074f7b5159f9b8e43c7148643db392263/doc/breaking-changes/breaking-changes.html)
- * [TypeScript 3.6](https://github.com/whinc/TypeScript/tree/427e94f074f7b5159f9b8e43c7148643db392263/doc/breaking-changes/TypeScript%203.6.html)
- * [TypeScript 3.1](https://github.com/whinc/TypeScript/tree/427e94f074f7b5159f9b8e43c7148643db392263/doc/breaking-changes/TypeScript%203.1.html)
- * [TypeScript 2.8](https://github.com/whinc/TypeScript/tree/427e94f074f7b5159f9b8e43c7148643db392263/doc/breaking-changes/TypeScript%202.8.html)
- * [TypeScript 2.7](https://github.com/whinc/TypeScript/tree/427e94f074f7b5159f9b8e43c7148643db392263/doc/breaking-changes/TypeScript%202.7.html)
- * [TypeScript 2.6](https://github.com/whinc/TypeScript/tree/427e94f074f7b5159f9b8e43c7148643db392263/doc/breaking-changes/TypeScript%202.6.html)
- * [TypeScript 2.4](https://github.com/whinc/TypeScript/tree/427e94f074f7b5159f9b8e43c7148643db392263/doc/breaking-changes/TypeScript%202.4.html)
- * [TypeScript 2.3](https://github.com/whinc/TypeScript/tree/427e94f074f7b5159f9b8e43c7148643db392263/doc/breaking-changes/TypeScript%202.3.html)
- * [TypeScript 2.2](https://github.com/whinc/TypeScript/tree/427e94f074f7b5159f9b8e43c7148643db392263/doc/breaking-changes/TypeScript%202.2.html)
- * [TypeScript 2.1](https://github.com/whinc/TypeScript/tree/427e94f074f7b5159f9b8e43c7148643db392263/doc/breaking-changes/TypeScript%202.1.html)
- * [TypeScript 2.0](https://github.com/whinc/TypeScript/tree/427e94f074f7b5159f9b8e43c7148643db392263/doc/breaking-changes/TypeScript%202.0.html)
- * [TypeScript 1.8](https://github.com/whinc/TypeScript/tree/427e94f074f7b5159f9b8e43c7148643db392263/doc/breaking-changes/TypeScript%201.8.html)
- * [TypeScript 1.7](https://github.com/whinc/TypeScript/tree/427e94f074f7b5159f9b8e43c7148643db392263/doc/breaking-changes/TypeScript%201.7.html)
- * [TypeScript 1.6](https://github.com/whinc/TypeScript/tree/427e94f074f7b5159f9b8e43c7148643db392263/doc/breaking-changes/TypeScript%201.6.html)
- * [TypeScript 1.5](https://github.com/whinc/TypeScript/tree/427e94f074f7b5159f9b8e43c7148643db392263/doc/breaking-changes/TypeScript%201.5.html)
- * [TypeScript 1.4](https://github.com/whinc/TypeScript/tree/427e94f074f7b5159f9b8e43c7148643db392263/doc/breaking-changes/TypeScript%201.4.html)
+ * [举例](doc/handbook/declaration%20files/By%20Example.html)
+ * [深入](doc/handbook/declaration%20files/Deep%20Dive.html)
+ * [发布](doc/handbook/declaration%20files/Publishing.html)
+ * [使用](doc/handbook/declaration%20files/Consumption.html)
+* [工程配置](doc/handbook/tsconfig.json.html)
+ * [tsconfig.json](doc/handbook/tsconfig.json.html)
+ * [工程引用](doc/handbook/Project%20References.html)
+ * [NPM包的类型](doc/handbook/Typings%20for%20NPM%20Packages.html)
+ * [编译选项](doc/handbook/Compiler%20Options.html)
+ * [配置 Watch](doc/handbook/Configuring%20Watch.html)
+ * [在MSBuild里使用编译选项](doc/handbook/Compiler%20Options%20in%20MSBuild.html)
+ * [与其它构建工具整合](doc/handbook/Integrating%20with%20Build%20Tools.html)
+ * [使用TypeScript的每日构建版本](doc/handbook/Nightly%20Builds.html)
+* [Wiki](doc/wiki/README.html)
+ * [TypeScript里的this](doc/wiki/this-in-TypeScript.html)
+ * [编码规范](doc/wiki/coding_guidelines.html)
+ * [常见编译错误](doc/wiki/Common%20Errors.html)
+ * [支持TypeScript的编辑器](doc/wiki/TypeScript-Editor-Support.html)
+ * [结合ASP.NET v5使用TypeScript](doc/wiki/Using-TypeScript-With-ASP.NET-5.html)
+ * [架构概述](doc/wiki/Architectural-Overview.html)
+ * [发展路线图](doc/wiki/Roadmap.html)
+* [新增功能](doc/release-notes/README.html)
+ * [TypeScript 3.7](doc/release-notes/TypeScript%203.7.html)
+ * [TypeScript 3.6](doc/release-notes/TypeScript%203.6.html)
+ * [TypeScript 3.5](doc/release-notes/TypeScript%203.5.html)
+ * [TypeScript 3.3](doc/release-notes/TypeScript%203.3.html)
+ * [TypeScript 3.2](doc/release-notes/TypeScript%203.2.html)
+ * [TypeScript 3.1](doc/release-notes/TypeScript%203.1.html)
+ * [TypeScript 3.0](doc/release-notes/TypeScript%203.0.html)
+ * [TypeScript 2.9](doc/release-notes/TypeScript%202.9.html)
+ * [TypeScript 2.8](doc/release-notes/TypeScript%202.8.html)
+ * [TypeScript 2.7](doc/release-notes/TypeScript%202.7.html)
+ * [TypeScript 2.6](doc/release-notes/TypeScript%202.6.html)
+ * [TypeScript 2.5](doc/release-notes/TypeScript%202.5.html)
+ * [TypeScript 2.4](doc/release-notes/TypeScript%202.4.html)
+ * [TypeScript 2.3](doc/release-notes/TypeScript%202.3.html)
+ * [TypeScript 2.2](doc/release-notes/TypeScript%202.2.html)
+ * [TypeScript 2.1](doc/release-notes/TypeScript%202.1.html)
+ * [TypeScript 2.0](doc/release-notes/TypeScript%202.0.html)
+ * [TypeScript 1.8](doc/release-notes/TypeScript%201.8.html)
+ * [TypeScript 1.7](doc/release-notes/TypeScript%201.7.html)
+ * [TypeScript 1.6](doc/release-notes/TypeScript%201.6.html)
+ * [TypeScript 1.5](doc/release-notes/TypeScript%201.5.html)
+ * [TypeScript 1.4](doc/release-notes/TypeScript%201.4.html)
+ * [TypeScript 1.3](doc/release-notes/TypeScript%201.3.html)
+ * [TypeScript 1.1](doc/release-notes/TypeScript%201.1.html)
+* [Breaking Changes](doc/breaking-changes/breaking-changes.html)
+ * [TypeScript 3.6](doc/breaking-changes/TypeScript%203.6.html)
+ * [TypeScript 3.1](doc/breaking-changes/TypeScript%203.1.html)
+ * [TypeScript 2.8](doc/breaking-changes/TypeScript%202.8.html)
+ * [TypeScript 2.7](doc/breaking-changes/TypeScript%202.7.html)
+ * [TypeScript 2.6](doc/breaking-changes/TypeScript%202.6.html)
+ * [TypeScript 2.4](doc/breaking-changes/TypeScript%202.4.html)
+ * [TypeScript 2.3](doc/breaking-changes/TypeScript%202.3.html)
+ * [TypeScript 2.2](doc/breaking-changes/TypeScript%202.2.html)
+ * [TypeScript 2.1](doc/breaking-changes/TypeScript%202.1.html)
+ * [TypeScript 2.0](doc/breaking-changes/TypeScript%202.0.html)
+ * [TypeScript 1.8](doc/breaking-changes/TypeScript%201.8.html)
+ * [TypeScript 1.7](doc/breaking-changes/TypeScript%201.7.html)
+ * [TypeScript 1.6](doc/breaking-changes/TypeScript%201.6.html)
+ * [TypeScript 1.5](doc/breaking-changes/TypeScript%201.5.html)
+ * [TypeScript 1.4](doc/breaking-changes/TypeScript%201.4.html)
## 最新修改
-* 2018-08-15 新增章节:[工程引用](https://github.com/whinc/TypeScript/tree/427e94f074f7b5159f9b8e43c7148643db392263/doc/handbook/Project%20References.html)
-* [TypeScript 3.0](https://github.com/whinc/TypeScript/tree/427e94f074f7b5159f9b8e43c7148643db392263/doc/release-notes/TypeScript%203.0.html)
+* 2018-08-15 新增章节:[工程引用](doc/handbook/Project%20References.html)
+* [TypeScript 3.0](doc/release-notes/TypeScript%203.0.html)
## 相关链接
diff --git a/release-notes/README.md b/release-notes/README.md
index 53d284ed..5630562b 100644
--- a/release-notes/README.md
+++ b/release-notes/README.md
@@ -1,5 +1,7 @@
# 新增功能
+* [TypeScript 3.8](typescript-3.8.md)
+* [TypeScript 3.7](typescript-3.7.md)
* [TypeScript 3.6](typescript-3.6.md)
* [TypeScript 3.5](typescript-3.5.md)
* [TypeScript 3.4](typescript-3.4.md)
diff --git a/release-notes/typescript-3.8.md b/release-notes/typescript-3.8.md
new file mode 100644
index 00000000..3fb6c4c6
--- /dev/null
+++ b/release-notes/typescript-3.8.md
@@ -0,0 +1,457 @@
+# TypeScript 3.8
+
+* [Type-Only Imports and Exports](#type-only-imports-exports)
+* [ECMAScript Private Fields](#ecmascript-private-fields)
+* [`export * as ns` Syntax](#export-star-as-namespace-syntax)
+* [Top-Level `await`](#top-level-await)
+* [JSDoc Property Modifiers](#jsdoc-modifiers)
+* [Better Directory Watching on Linux and `watchOptions`](#better-directory-watching)
+* ["Fast and Loose" Incremental Checking](#assume-direct-dependencies)
+
+## 类型导入和导出(Type-Only Imports and Exports)
+
+This feature is something most users may never have to think about; however, if you've hit issues under `--isolatedModules`, TypeScript's `transpileModule` API, or Babel, this feature might be relevant.
+
+TypeScript 3.8 adds a new syntax for type-only imports and exports.
+
+```ts
+import type { SomeThing } from "./some-module.js";
+
+export type { SomeThing };
+```
+
+`import type` only imports declarations to be used for type annotations and declarations.
+It *always* gets fully erased, so there's no remnant of it at runtime.
+Similarly, `export type` only provides an export that can be used for type contexts, and is also erased from TypeScript's output.
+
+It's important to note that classes have a value at runtime and a type at design-time, and the use is context-sensitive.
+When using `import type` to import a class, you can't do things like extend from it.
+
+```ts
+import type { Component } from "react";
+
+interface ButtonProps {
+ // ...
+}
+
+class Button extends Component {
+ // ~~~~~~~~~
+ // error! 'Component' only refers to a type, but is being used as a value here.
+
+ // ...
+}
+```
+
+If you've used Flow before, the syntax is fairly similar.
+One difference is that we've added a few restrictions to avoid code that might appear ambiguous.
+
+```ts
+// Is only 'Foo' a type? Or every declaration in the import?
+// We just give an error because it's not clear.
+
+import type Foo, { Bar, Baz } from "some-module";
+// ~~~~~~~~~~~~~~~~~~~~~~
+// error! A type-only import can specify a default import or named bindings, but not both.
+```
+
+In conjunction with `import type`, TypeScript 3.8 also adds a new compiler flag to control what happens with imports that won't be utilized at runtime: `importsNotUsedAsValues`.
+This flag takes 3 different values:
+
+* `remove`: this is today's behavior of dropping these imports. It's going to continue to be the default, and is a non-breaking change.
+* `preserve`: this *preserves* all imports whose values are never used. This can cause imports/side-effects to be preserved.
+* `error`: this preserves all imports (the same as the `preserve` option), but will error when a value import is only used as a type. This might be useful if you want to ensure no values are being accidentally imported, but still make side-effect imports explicit.
+
+For more information about the feature, you can [take a look at the pull request](https://github.com/microsoft/TypeScript/pull/35200), and [relevant changes](https://github.com/microsoft/TypeScript/pull/36092/) around broadening where imports from an `import type` declaration can be used.
+
+## ECMAScript 私有变量(ECMAScript Private Fields
+
+TypeScript 3.8 brings support for ECMAScript's private fields, part of the [stage-3 class fields proposal](https://github.com/tc39/proposal-class-fields/).
+
+```ts
+class Person {
+ #name: string
+
+ constructor(name: string) {
+ this.#name = name;
+ }
+
+ greet() {
+ console.log(`Hello, my name is ${this.#name}!`);
+ }
+}
+
+let jeremy = new Person("Jeremy Bearimy");
+
+jeremy.#name
+// ~~~~~
+// Property '#name' is not accessible outside class 'Person'
+// because it has a private identifier.
+```
+
+Unlike regular properties (even ones declared with the `private` modifier), private fields have a few rules to keep in mind.
+Some of them are:
+
+* Private fields start with a `#` character. Sometimes we call these *private names*.
+* Every private field name is uniquely scoped to its containing class.
+* TypeScript accessibility modifiers like `public` or `private` can't be used on private fields.
+* Private fields can't be accessed or even detected outside of the containing class - even by JS users! Sometimes we call this *hard privacy*.
+
+Apart from "hard" privacy, another benefit of private fields is that uniqueness we just mentioned.
+For example, regular property declarations are prone to being overwritten in subclasses.
+
+```ts
+class C {
+ foo = 10;
+
+ cHelper() {
+ return this.foo;
+ }
+}
+
+class D extends C {
+ foo = 20;
+
+ dHelper() {
+ return this.foo;
+ }
+}
+
+let instance = new D();
+// 'this.foo' refers to the same property on each instance.
+console.log(instance.cHelper()); // prints '20'
+console.log(instance.dHelper()); // prints '20'
+```
+
+With private fields, you'll never have to worry about this, since each field name is unique to the containing class.
+
+```ts
+class C {
+ #foo = 10;
+
+ cHelper() {
+ return this.#foo;
+ }
+}
+
+class D extends C {
+ #foo = 20;
+
+ dHelper() {
+ return this.#foo;
+ }
+}
+
+let instance = new D();
+// 'this.#foo' refers to a different field within each class.
+console.log(instance.cHelper()); // prints '10'
+console.log(instance.dHelper()); // prints '20'
+```
+
+Another thing worth noting is that accessing a private field on any other type will result in a `TypeError`!
+
+```ts
+class Square {
+ #sideLength: number;
+
+ constructor(sideLength: number) {
+ this.#sideLength = sideLength;
+ }
+
+ equals(other: any) {
+ return this.#sideLength === other.#sideLength;
+ }
+}
+
+const a = new Square(100);
+const b = { sideLength: 100 };
+
+// Boom!
+// TypeError: attempted to get private field on non-instance
+// This fails because 'b' is not an instance of 'Square'.
+console.log(a.equals(b));
+```
+
+Finally, for any plain `.js` file users, private fields *always* have to be declared before they're assigned to.
+
+```js
+class C {
+ // No declaration for '#foo'
+ // :(
+
+ constructor(foo: number) {
+ // SyntaxError!
+ // '#foo' needs to be declared before writing to it.
+ this.#foo = foo;
+ }
+}
+```
+
+JavaScript has always allowed users to access undeclared properties, whereas TypeScript has always required declarations for class properties.
+With private fields, declarations are always needed regardless of whether we're working in `.js` or `.ts` files.
+
+```js
+class C {
+ /** @type {number} */
+ #foo;
+
+ constructor(foo: number) {
+ // This works.
+ this.#foo = foo;
+ }
+}
+```
+
+For more information about the implementation, you can [check out the original pull request](https://github.com/Microsoft/TypeScript/pull/30829)
+
+### Which should I use?
+
+We've already received many questions on which type of privates you should use as a TypeScript user: most commonly, "should I use the `private` keyword, or ECMAScript's hash/pound (`#`) private fields?"
+It depends!
+
+When it comes to properties, TypeScript's `private` modifiers are fully erased - that means that at runtime, it acts entirely like a normal property and there's no way to tell that it was declared with a `private modifier.
+When using the `private` keyword, privacy is only enforced at compile-time/design-time, and for JavaScript consumers it's entirely intent-based.
+
+```ts
+class C {
+ private foo = 10;
+}
+
+// This is an error at compile time,
+// but when TypeScript outputs .js files,
+// it'll run fine and print '10'.
+console.log(new C().foo); // prints '10'
+// ~~~
+// error! Property 'foo' is private and only accessible within class 'C'.
+
+// TypeScript allows this at compile-time
+// as a "work-around" to avoid the error.
+console.log(new C()["foo"]); // prints '10'
+```
+
+The upside is that this sort of "soft privacy" can help your consumers temporarily work around not having access to some API, and also works in any runtime.
+
+On the other hand, ECMAScript's `#` privates are completely inaccessible outside of the class.
+
+```ts
+class C {
+ #foo = 10;
+}
+
+console.log(new C().#foo); // SyntaxError
+// ~~~~
+// TypeScript reports an error *and*
+// this won't work at runtime!
+
+console.log(new C()["#foo"]); // prints undefined
+// ~~~~~~~~~~~~~~~
+// TypeScript reports an error under 'noImplicitAny',
+// and this prints 'undefined'.
+```
+
+This hard privacy is really useful for strictly ensuring that nobody can take use of any of your internals.
+If you're a library author, removing or renaming a private field should never cause a breaking change.
+
+As we mentioned, another benefit is that subclassing can be easier with ECMAScript's `#` privates because they *really* are private.
+When using ECMAScript `#` private fields, no subclass ever has to worry about collisions in field naming.
+When it comes to TypeScript's `private` property declarations, users still have to be careful not to trample over properties declared in superclasses.
+
+One more thing to think about is where you intend for your code to run.
+TypeScript currently can't support this feature unless targeting ECMAScript 2015 (ES6) targets or higher.
+This is because our downleveled implementation uses `WeakMap`s to enforce privacy, and `WeakMap`s can't be polyfilled in a way that doesn't cause memory leaks.
+In contrast, TypeScript's `private`-declared properties work with all targets - even ECMAScript 3!
+
+A final consideration might be speed: `private` properties are no different from any other property, so accessing them is as fast as any other property access no matter which runtime you target.
+In contrast, because `#` private fields are downleveled using `WeakMap`s, they may be slower to use.
+While some runtimes might optimize their actual implementations of `#` private fields, and even have speedy `WeakMap` implementations, that might not be the case in all runtimes.
+
+## `export * as ns` Syntax
+
+It's often common to have a single entry-point that exposes all the members of another module as a single member.
+
+```ts
+import * as utilities from "./utilities.js";
+export { utilities };
+```
+
+This is so common that ECMAScript 2020 recently added a new syntax to support this pattern!
+
+```ts
+export * as utilities from "./utilities.js";
+```
+
+This is a nice quality-of-life improvement to JavaScript, and TypeScript 3.8 implements this syntax.
+When your module target is earlier than `es2020`, TypeScript will output something along the lines of the first code snippet.
+
+## 顶层await(Top-Level await)
+
+TypeScript 3.8 provides support for a handy upcoming ECMAScript feature called "top-level `await`".
+
+JavaScript users often introduce an `async` function in order to use `await`, and then immediately called the function after defining it.
+
+```js
+async function main() {
+ const response = await fetch("...");
+ const greeting = await response.text();
+ console.log(greeting);
+}
+
+main()
+ .catch(e => console.error(e))
+```
+
+This is because previously in JavaScript (along with most other languages with a similar feature), `await` was only allowed within the body of an `async` function.
+However, with top-level `await`, we can use `await` at the top level of a module.
+
+```ts
+const response = await fetch("...");
+const greeting = await response.text();
+console.log(greeting);
+
+// Make sure we're a module
+export {};
+```
+
+Note there's a subtlety: top-level `await` only works at the top level of a *module*, and files are only considered modules when TypeScript finds an `import` or an `export`.
+In some basic cases, you might need to write out `export {}` as some boilerplate to make sure of this.
+
+Top level `await` may not work in all environments where you might expect at this point.
+Currently, you can only use top level `await` when the `target` compiler option is `es2017` or above, and `module` is `esnext` or `system`.
+Support within several environments and bundlers may be limited or may require enabling experimental support.
+
+For more information on our implementation, you can [check out the original pull request](https://github.com/microsoft/TypeScript/pull/35813).
+
+## `es2020` for `target` and `module`
+
+TypeScript 3.8 supports `es2020` as an option for `module` and `target`.
+This will preserve newer ECMAScript 2020 features like optional chaining, nullish coalescing, `export * as ns`, and dynamic `import(...)` syntax.
+It also means `bigint` literals now have a stable `target` below `esnext`.
+
+## JSDoc 属性修饰词(JSDoc Property Modifiers)
+
+TypeScript 3.8 supports JavaScript files by turning on the `allowJs` flag, and also supports *type-checking* those JavaScript files via the `checkJs` option or by adding a `// @ts-check` comment to the top of your `.js` files.
+
+Because JavaScript files don't have dedicated syntax for type-checking, TypeScript leverages JSDoc.
+TypeScript 3.8 understands a few new JSDoc tags for properties.
+
+First are the accessibility modifiers: `@public`, `@private`, and `@protected`.
+These tags work exactly like `public`, `private`, and `protected` respectively work in TypeScript.
+
+```js
+// @ts-check
+
+class Foo {
+ constructor() {
+ /** @private */
+ this.stuff = 100;
+ }
+
+ printStuff() {
+ console.log(this.stuff);
+ }
+}
+
+new Foo().stuff;
+// ~~~~~
+// error! Property 'stuff' is private and only accessible within class 'Foo'.
+```
+
+* `@public` 是默认的,可以省略,它代表了一个属性可以从任何地方访问它
+* `@private` 表示一个属性只能在包含的类中访问
+* `@protected` 表示该属性只能在所包含的类及子类中访问,但不能在类的实例中访问
+
+下一步,我们计划添加 `@readonly` 修饰符,来确保一个属性只能在初始化时被修改:
+
+```js
+// @ts-check
+
+class Foo {
+ constructor() {
+ /** @readonly */
+ this.stuff = 100;
+ }
+
+ writeToStuff() {
+ this.stuff = 200;
+ // ~~~~~
+ // Cannot assign to 'stuff' because it is a read-only property.
+ }
+}
+
+new Foo().stuff++;
+// ~~~~~
+// Cannot assign to 'stuff' because it is a read-only property.
+```
+
+## Better Directory Watching on Linux and `watchOptions`
+
+TypeScript 3.8 ships a new strategy for watching directories, which is crucial for efficiently picking up changes to `node_modules`.
+
+For some context, on operating systems like Linux, TypeScript installs directory watchers (as opposed to file watchers) on `node_modules` and many of its subdirectories to detect changes in dependencies.
+This is because the number of available file watchers is often eclipsed by the of files in `node_modules`, whereas there are way fewer directories to track.
+
+Older versions of TypeScript would *immediately* install directory watchers on folders, and at startup that would be fine; however, during an npm install, a lot of activity will take place within `node_modules` and that can overwhelm TypeScript, often slowing editor sessions to a crawl.
+To prevent this, TypeScript 3.8 waits slightly before installing directory watchers to give these highly volatile directories some time to stabilize.
+
+Because every project might work better under different strategies, and this new approach might not work well for your workflows, TypeScript 3.8 introduces a new `watchOptions` field in `tsconfig.json` and `jsconfig.json` which allows users to tell the compiler/language service which watching strategies should be used to keep track of files and directories.
+
+```json5
+{
+ // Some typical compiler options
+ "compilerOptions": {
+ "target": "es2020",
+ "moduleResolution": "node",
+ // ...
+ },
+
+ // NEW: Options for file/directory watching
+ "watchOptions": {
+ // Use native file system events for files and directories
+ "watchFile": "useFsEvents",
+ "watchDirectory": "useFsEvents",
+
+ // Poll files for updates more frequently
+ // when they're updated a lot.
+ "fallbackPolling": "dynamicPriority"
+ }
+}
+```
+
+`watchOptions` 包含四种新的选项:
+
+* `watchFile`: 监听单个文件的策略,它可以有以下值
+ * `fixedPollingInterval`: 以固定的时间间隔,检查文件的更改
+ * `priorityPollingInterval`: 以固定的时间间隔,检查文件的更改,但是使用「heuristics」检查某些类型的文件的频率比其他文件低(heuristics 怎么翻?)
+ * `dynamicPriorityPolling`: 使用动态队列,在该队列中,较少检查不经常修改的文件
+ * `useFsEvents` (默认): 尝试使用操作系统/文件系统原生事件来监听文件更改
+ * `useFsEventsOnParentDirectory`: 尝试使用操作系统/文件系统原生事件来监听文件、目录的更改,这样可以使用较小的文件监听程序,但是准确性可能较低
+* `watchDirectory`: 在缺少递归文件监听功能的系统中,使用哪种策略监听整个目录树,它可以有以下值 :
+ * `fixedPollingInterval`: 以固定的时间间隔,检查目录树的更改
+ * `dynamicPriorityPolling`: 使用动态队列,在该队列中,较少检查不经常修改的目录
+ * `useFsEvents` (默认): 尝试使用操作系统/文件系统原生事件来监听目录更改
+* `fallbackPolling`: 当使用文件系统的事件,该选项用来指定使用特定策略,它可以有以下值
+ * `fixedPollingInterval`: *(同上)*
+ * `priorityPollingInterval`: *(同上)*
+ * `dynamicPriorityPolling`: *(同上)*
+* `synchronousWatchDirectory`: 在目录上禁用延迟监听功能。在可能一次发生大量文件(如 `node_modules`)更改时,它非常有用,但是你可能需要一些不太常见的设置时,禁用它。
+
+
+For more information on these changes, [head over to GitHub to see the pull request](https://github.com/microsoft/TypeScript/pull/35615) to read more.
+
+## "Fast and Loose" Incremental Checking
+
+TypeScript 3.8 introduces a new compiler option called `assumeChangesOnlyAffectDirectDependencies`.
+When this option is enabled, TypeScript will avoid rechecking/rebuilding all truly possibly-affected files, and only recheck/rebuild files that have changed as well as files that directly import them.
+
+For example, consider a file `fileD.ts` that imports `fileC.ts` that imports `fileB.ts` that imports `fileA.ts` as follows:
+
+```
+fileA.ts <- fileB.ts <- fileC.ts <- fileD.ts
+```
+
+In `--watch` mode, a change in `fileA.ts` would typically mean that TypeScript would need to at least re-check `fileB.ts`, `fileC.ts`, and `fileD.ts`.
+Under `assumeChangesOnlyAffectDirectDependencies`, a change in `fileA.ts` means that only `fileA.ts` and `fileB.ts` need to be re-checked.
+
+In a codebase like Visual Studio Code, this reduced rebuild times for changes in certain files from about 14 seconds to about 1 second.
+While we don't necessarily recommend this option for all codebases, you might be interested if you have an extremely large codebase and are willing to defer full project errors until later (e.g. a dedicated build via a `tsconfig.fullbuild.json` or in CI).
+
+For more details, you can [see the original pull request](https://github.com/microsoft/TypeScript/pull/35711).
\ No newline at end of file
diff --git a/tsconfig.json/README.md b/tsconfig.json/README.md
index 3509240c..ec98c2ad 100644
--- a/tsconfig.json/README.md
+++ b/tsconfig.json/README.md
@@ -1,191 +1,10 @@
# 工程配置
-## 概述
-
-如果一个目录下存在一个`tsconfig.json`文件,那么它意味着这个目录是TypeScript项目的根目录。 `tsconfig.json`文件中指定了用来编译这个项目的根文件和编译选项。 一个项目可以通过以下方式之一来编译:
-
-## 使用tsconfig.json
-
-* 不带任何输入文件的情况下调用`tsc`,编译器会从当前目录开始去查找`tsconfig.json`文件,逐级向上搜索父目录。
-* 不带任何输入文件的情况下调用`tsc`,且使用命令行参数`--project`(或`-p`)指定一个包含`tsconfig.json`文件的目录。
-
-当命令行上指定了输入文件时,`tsconfig.json`文件会被忽略。
-
-## 示例
-
-`tsconfig.json`示例文件:
-
-* 使用`"files"`属性
-
-```javascript
-{
- "compilerOptions": {
- "module": "commonjs",
- "noImplicitAny": true,
- "removeComments": true,
- "preserveConstEnums": true,
- "sourceMap": true
- },
- "files": [
- "core.ts",
- "sys.ts",
- "types.ts",
- "scanner.ts",
- "parser.ts",
- "utilities.ts",
- "binder.ts",
- "checker.ts",
- "emitter.ts",
- "program.ts",
- "commandLineParser.ts",
- "tsc.ts",
- "diagnosticInformationMap.generated.ts"
- ]
-}
-```
-
-* 使用`"include"`和`"exclude"`属性
-
- ```javascript
- {
- "compilerOptions": {
- "module": "system",
- "noImplicitAny": true,
- "removeComments": true,
- "preserveConstEnums": true,
- "outFile": "../../built/local/tsc.js",
- "sourceMap": true
- },
- "include": [
- "src/**/*"
- ],
- "exclude": [
- "node_modules",
- "**/*.spec.ts"
- ]
- }
- ```
-
-## 细节
-
-`"compilerOptions"`可以被忽略,这时编译器会使用默认值。在这里查看完整的[编译器选项](compiler-options.md)列表。
-
-`"files"`指定一个包含相对或绝对文件路径的列表。 `"include"`和`"exclude"`属性指定一个文件glob匹配模式列表。 支持的glob通配符有:
-
-* `*` 匹配0或多个字符(不包括目录分隔符)
-* `?` 匹配一个任意字符(不包括目录分隔符)
-* `**/` 递归匹配任意子目录
-
-如果一个glob模式里的某部分只包含`*`或`.*`,那么仅有支持的文件扩展名类型被包含在内(比如默认`.ts`,`.tsx`,和`.d.ts`, 如果`allowJs`设置能`true`还包含`.js`和`.jsx`)。
-
-如果`"files"`和`"include"`都没有被指定,编译器默认包含当前目录和子目录下所有的TypeScript文件(`.ts`, `.d.ts` 和 `.tsx`),排除在`"exclude"`里指定的文件。JS文件(`.js`和`.jsx`)也被包含进来如果`allowJs`被设置成`true`。 如果指定了`"files"`或`"include"`,编译器会将它们结合一并包含进来。 使用`"outDir"`指定的目录下的文件永远会被编译器排除,除非你明确地使用`"files"`将其包含进来(这时就算用`exclude`指定也没用)。
-
-使用`"include"`引入的文件可以使用`"exclude"`属性过滤。 然而,通过`"files"`属性明确指定的文件却总是会被包含在内,不管`"exclude"`如何设置。 如果没有特殊指定,`"exclude"`默认情况下会排除`node_modules`,`bower_components`,`jspm_packages`和``目录。
-
-任何被`"files"`或`"include"`指定的文件所引用的文件也会被包含进来。 `A.ts`引用了`B.ts`,因此`B.ts`不能被排除,除非引用它的`A.ts`在`"exclude"`列表中。
-
-需要注意编译器不会去引入那些可能做为输出的文件;比如,假设我们包含了`index.ts`,那么`index.d.ts`和`index.js`会被排除在外。 通常来讲,不推荐只有扩展名的不同来区分同目录下的文件。
-
-`tsconfig.json`文件可以是个空文件,那么所有默认的文件(如上面所述)都会以默认配置选项编译。
-
-在命令行上指定的编译选项会覆盖在`tsconfig.json`文件里的相应选项。
-
-## `@types`,`typeRoots`和`types`
-
-默认所有_可见的_"`@types`"包会在编译过程中被包含进来。 `node_modules/@types`文件夹下以及它们子文件夹下的所有包都是_可见的_; 也就是说,`./node_modules/@types/`,`../node_modules/@types/`和`../../node_modules/@types/`等等。
-
-如果指定了`typeRoots`,_只有_`typeRoots`下面的包才会被包含进来。 比如:
-
-```javascript
-{
- "compilerOptions": {
- "typeRoots" : ["./typings"]
- }
-}
-```
-
-这个配置文件会包含_所有_`./typings`下面的包,而不包含`./node_modules/@types`里面的包。
-
-如果指定了`types`,只有被列出来的包才会被包含进来。 比如:
-
-```javascript
-{
- "compilerOptions": {
- "types" : ["node", "lodash", "express"]
- }
-}
-```
-
-这个`tsconfig.json`文件将_仅会_包含 `./node_modules/@types/node`,`./node_modules/@types/lodash`和`./node_modules/@types/express`。/@types/。 `node_modules/@types/*`里面的其它包不会被引入进来。
-
-指定`"types": []`来禁用自动引入`@types`包。
-
-注意,自动引入只在你使用了全局的声明(相反于模块)时是重要的。 如果你使用`import "foo"`语句,TypeScript仍然会查找`node_modules`和`node_modules/@types`文件夹来获取`foo`包。
-
-## 使用`extends`继承配置
-
-`tsconfig.json`文件可以利用`extends`属性从另一个配置文件里继承配置。
-
-`extends`是`tsconfig.json`文件里的顶级属性(与`compilerOptions`,`files`,`include`,和`exclude`一样)。 `extends`的值是一个字符串,包含指向另一个要继承文件的路径。
-
-在原文件里的配置先被加载,然后被来至继承文件里的配置重写。 如果发现循环引用,则会报错。
-
-来至所继承配置文件的`files`,`include`和`exclude`_覆盖_源配置文件的属性。
-
-配置文件里的相对路径在解析时相对于它所在的文件。
-
-比如:
-
-`configs/base.json`:
-
-```javascript
-{
- "compilerOptions": {
- "noImplicitAny": true,
- "strictNullChecks": true
- }
-}
-```
-
-`tsconfig.json`:
-
-```javascript
-{
- "extends": "./configs/base",
- "files": [
- "main.ts",
- "supplemental.ts"
- ]
-}
-```
-
-`tsconfig.nostrictnull.json`:
-
-```javascript
-{
- "extends": "./tsconfig",
- "compilerOptions": {
- "strictNullChecks": false
- }
-}
-```
-
-## `compileOnSave`
-
-在最顶层设置`compileOnSave`标记,可以让IDE在保存文件的时候根据`tsconfig.json`重新生成文件。
-
-```javascript
-{
- "compileOnSave": true,
- "compilerOptions": {
- "noImplicitAny" : true
- }
-}
-```
-
-要想支持这个特性需要Visual Studio 2015, TypeScript1.8.4以上并且安装[atom-typescript](https://github.com/TypeStrong/atom-typescript#compile-on-save)插件。
-
-## 模式
-
-到这里查看模式: [http://json.schemastore.org/tsconfig](http://json.schemastore.org/tsconfig).
-
+ * [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)
\ No newline at end of file
diff --git a/tutorials/typescript-in-5-minutes.md b/tutorials/typescript-in-5-minutes.md
index 52d022b3..48c63e5a 100644
--- a/tutorials/typescript-in-5-minutes.md
+++ b/tutorials/typescript-in-5-minutes.md
@@ -9,7 +9,7 @@
* 通过npm(Node.js包管理器)
* 安装Visual Studio的TypeScript插件
-Visual Studio 2017和Visual Studio 2015 Update 3默认包含了TypeScript。 如果你的Visual Studio还没有安装TypeScript,你可以[下载](https://github.com/whinc/TypeScript/tree/427e94f074f7b5159f9b8e43c7148643db392263/README.md#download-links)它。
+Visual Studio 2017和Visual Studio 2015 Update 3默认包含了TypeScript。 如果你的Visual Studio还没有安装TypeScript,你可以下载它。
针对使用npm的用户: