Document not found (404)
This URL is invalid, sorry. Please use the navigation bar or search to continue.
Repository: zhongsp/TypeScript
Branch: dev
Commit: 65b372052b82
Files: 321
Total size: 15.0 MB
Directory structure:
gitextract_3yrxwzv5/
├── .gitattributes
├── .github/
│ ├── CONTRIBUTING.md
│ └── workflows/
│ └── nodejs.yml
├── .gitignore
├── .travis.yml
├── .yarnrc.yml
├── CONTRIBUTING.md
├── LICENSE
├── PREFACE.md
├── README.md
├── SUMMARY.md
├── book.toml
├── docs/
│ ├── .nojekyll
│ ├── .travis.yml
│ ├── 404.html
│ ├── FontAwesome/
│ │ └── css/
│ │ └── font-awesome.css
│ ├── LICENSE
│ ├── PREFACE.html
│ ├── ayu-highlight.css
│ ├── book.js
│ ├── book.toml
│ ├── css/
│ │ ├── chrome.css
│ │ ├── general.css
│ │ ├── print.css
│ │ └── variables.css
│ ├── fonts/
│ │ ├── OPEN-SANS-LICENSE.txt
│ │ ├── SOURCE-CODE-PRO-LICENSE.txt
│ │ └── fonts.css
│ ├── gulpfile.js
│ ├── highlight.css
│ ├── highlight.js
│ ├── index.html
│ ├── lint.js
│ ├── package.json
│ ├── print.html
│ ├── searcher.js
│ ├── searchindex.js
│ ├── searchindex.json
│ ├── tomorrow-night.css
│ └── zh/
│ ├── breaking-changes/
│ │ ├── index.html
│ │ ├── typescript-1.4.html
│ │ ├── typescript-1.5.html
│ │ ├── typescript-1.6.html
│ │ ├── typescript-1.7.html
│ │ ├── typescript-1.8.html
│ │ ├── typescript-2.0.html
│ │ ├── typescript-2.1.html
│ │ ├── typescript-2.2.html
│ │ ├── typescript-2.3.html
│ │ ├── typescript-2.4.html
│ │ ├── typescript-2.6.html
│ │ ├── typescript-2.7.html
│ │ ├── typescript-2.8.html
│ │ ├── typescript-2.9.html
│ │ ├── typescript-3.0.html
│ │ ├── typescript-3.1.html
│ │ ├── typescript-3.2.html
│ │ ├── typescript-3.4.html
│ │ ├── typescript-3.5.html
│ │ └── typescript-3.6.html
│ ├── declaration-files/
│ │ ├── by-example.html
│ │ ├── consumption.html
│ │ ├── deep-dive.html
│ │ ├── do-s-and-don-ts.html
│ │ ├── index.html
│ │ ├── introduction.html
│ │ ├── library-structures.html
│ │ ├── publishing.html
│ │ └── templates.html
│ ├── handbook/
│ │ ├── basic-types.html
│ │ ├── classes.html
│ │ ├── enums.html
│ │ ├── functions.html
│ │ ├── generics.html
│ │ ├── index.html
│ │ ├── interfaces.html
│ │ ├── literal-types.html
│ │ └── unions-and-intersections.html
│ ├── handbook-v2/
│ │ ├── index.html
│ │ └── type-manipulation/
│ │ └── template-literal-types.html
│ ├── javascript/
│ │ └── type-checking-javascript-files.html
│ ├── project-config/
│ │ ├── compiler-options-in-msbuild.html
│ │ ├── compiler-options.html
│ │ ├── configuring-watch.html
│ │ ├── index.html
│ │ ├── integrating-with-build-tools.html
│ │ ├── nightly-builds.html
│ │ ├── project-references.html
│ │ ├── tsconfig.json.html
│ │ └── typings-for-npm-packages.html
│ ├── reference/
│ │ ├── advanced-types.html
│ │ ├── declaration-merging.html
│ │ ├── decorators.html
│ │ ├── index.html
│ │ ├── iterators-and-generators.html
│ │ ├── jsx.html
│ │ ├── mixins.html
│ │ ├── module-resolution.html
│ │ ├── modules.html
│ │ ├── namespaces-and-modules.html
│ │ ├── namespaces.html
│ │ ├── symbols.html
│ │ ├── triple-slash-directives.html
│ │ ├── type-compatibility.html
│ │ ├── type-inference.html
│ │ ├── utility-types.html
│ │ └── variable-declarations.html
│ ├── release-notes/
│ │ ├── index.html
│ │ ├── typescript-1.1.html
│ │ ├── typescript-1.3.html
│ │ ├── typescript-1.4.html
│ │ ├── typescript-1.5.html
│ │ ├── typescript-1.6.html
│ │ ├── typescript-1.7.html
│ │ ├── typescript-1.8.html
│ │ ├── typescript-2.0.html
│ │ ├── typescript-2.1.html
│ │ ├── typescript-2.2.html
│ │ ├── typescript-2.3.html
│ │ ├── typescript-2.4.html
│ │ ├── typescript-2.5.html
│ │ ├── typescript-2.6.html
│ │ ├── typescript-2.7.html
│ │ ├── typescript-2.8.html
│ │ ├── typescript-2.9.html
│ │ ├── typescript-3.0.html
│ │ ├── typescript-3.1.html
│ │ ├── typescript-3.2.html
│ │ ├── typescript-3.3.html
│ │ ├── typescript-3.4.html
│ │ ├── typescript-3.5.html
│ │ ├── typescript-3.6.html
│ │ ├── typescript-3.7.html
│ │ ├── typescript-3.8.html
│ │ ├── typescript-3.9.html
│ │ ├── typescript-4.0.html
│ │ ├── typescript-4.1.html
│ │ ├── typescript-4.2.html
│ │ ├── typescript-4.3.html
│ │ ├── typescript-4.4.html
│ │ ├── typescript-4.5.html
│ │ ├── typescript-4.6.html
│ │ ├── typescript-4.7.html
│ │ ├── typescript-4.8.html
│ │ ├── typescript-4.9.html
│ │ ├── typescript-5.0.html
│ │ ├── typescript-5.1.html
│ │ ├── typescript-5.2.html
│ │ ├── typescript-5.3.html
│ │ └── typescript-5.4.html
│ └── tutorials/
│ ├── angular-2.html
│ ├── asp.net-4.html
│ ├── asp.net-core.html
│ ├── gulp.html
│ ├── index.html
│ ├── knockout.html
│ ├── migrating-from-javascript.html
│ ├── react-and-webpack.html
│ ├── react.html
│ └── typescript-in-5-minutes.html
├── gulpfile.js
├── lint.js
├── package.json
└── zh/
├── breaking-changes/
│ ├── README.md
│ ├── typescript-1.1.md
│ ├── typescript-1.4.md
│ ├── typescript-1.5.md
│ ├── typescript-1.6.md
│ ├── typescript-1.7.md
│ ├── typescript-1.8.md
│ ├── typescript-2.0.md
│ ├── typescript-2.1.md
│ ├── typescript-2.2.md
│ ├── typescript-2.3.md
│ ├── typescript-2.4.md
│ ├── typescript-2.6.md
│ ├── typescript-2.7.md
│ ├── typescript-2.8.md
│ ├── typescript-2.9.md
│ ├── typescript-3.0.md
│ ├── typescript-3.1.md
│ ├── typescript-3.2.md
│ ├── typescript-3.4.md
│ ├── typescript-3.5.md
│ └── typescript-3.6.md
├── declaration-files/
│ ├── README.md
│ ├── by-example.md
│ ├── consumption.md
│ ├── deep-dive.md
│ ├── do-s-and-don-ts.md
│ ├── introduction.md
│ ├── library-structures.md
│ ├── publishing.md
│ ├── templates/
│ │ ├── global-modifying-module.d.ts.md
│ │ ├── global-plugin.d.ts.md
│ │ ├── global.d.ts.md
│ │ ├── module-class.d.ts.md
│ │ ├── module-function.d.ts.md
│ │ ├── module-plugin.d.ts.md
│ │ └── module.d.ts.md
│ └── templates.md
├── handbook/
│ ├── README.md
│ ├── basic-types.md
│ ├── classes.md
│ ├── enums.md
│ ├── functions.md
│ ├── generics.md
│ ├── interfaces.md
│ ├── literal-types.md
│ └── unions-and-intersections.md
├── handbook-v2/
│ ├── README.md
│ ├── basics.md
│ ├── classes.md
│ ├── everyday-types.md
│ ├── modules.md
│ ├── more-on-functions.md
│ ├── narrowing.md
│ ├── object-types.md
│ ├── the-handbook.md
│ └── type-manipulation/
│ ├── _creating-types-from-types.md
│ ├── conditional-types.md
│ ├── generics.md
│ ├── indexed-access-types.md
│ ├── keyof-type-operator.md
│ ├── mapped-types.md
│ ├── template-literal-types.md
│ └── typeof-type-operator.md
├── javascript/
│ ├── README.md
│ └── type-checking-javascript-files.md
├── project-config/
│ ├── README.md
│ ├── compiler-options-in-msbuild.md
│ ├── compiler-options.md
│ ├── configuring-watch.md
│ ├── integrating-with-build-tools.md
│ ├── nightly-builds.md
│ ├── project-references.md
│ ├── tsconfig.json.md
│ └── typings-for-npm-packages.md
├── reference/
│ ├── README.md
│ ├── advanced-types.md
│ ├── declaration-merging.md
│ ├── decorators.md
│ ├── iterators-and-generators.md
│ ├── jsx.md
│ ├── mixins.md
│ ├── module-resolution.md
│ ├── modules.md
│ ├── namespaces-and-modules.md
│ ├── namespaces.md
│ ├── symbols.md
│ ├── triple-slash-directives.md
│ ├── type-compatibility.md
│ ├── type-inference.md
│ ├── utility-types.md
│ └── variable-declarations.md
├── release-notes/
│ ├── README.md
│ ├── typescript-1.1.md
│ ├── typescript-1.3.md
│ ├── typescript-1.4.md
│ ├── typescript-1.5.md
│ ├── typescript-1.6.md
│ ├── typescript-1.7.md
│ ├── typescript-1.8.md
│ ├── typescript-2.0.md
│ ├── typescript-2.1.md
│ ├── typescript-2.2.md
│ ├── typescript-2.3.md
│ ├── typescript-2.4.md
│ ├── typescript-2.5.md
│ ├── typescript-2.6.md
│ ├── typescript-2.7.md
│ ├── typescript-2.8.md
│ ├── typescript-2.9.md
│ ├── typescript-3.0.md
│ ├── typescript-3.1.md
│ ├── typescript-3.2.md
│ ├── typescript-3.3.md
│ ├── typescript-3.4.md
│ ├── typescript-3.5.md
│ ├── typescript-3.6.md
│ ├── typescript-3.7.md
│ ├── typescript-3.8.md
│ ├── typescript-3.9.md
│ ├── typescript-4.0.md
│ ├── typescript-4.1.md
│ ├── typescript-4.2.md
│ ├── typescript-4.3.md
│ ├── typescript-4.4.md
│ ├── typescript-4.5.md
│ ├── typescript-4.6.md
│ ├── typescript-4.7.md
│ ├── typescript-4.8.md
│ ├── typescript-4.9.md
│ ├── typescript-5.0.md
│ ├── typescript-5.1.md
│ ├── typescript-5.2.md
│ ├── typescript-5.3.md
│ ├── typescript-5.4.md
│ ├── typescript-5.5.md
│ ├── typescript-5.6.md
│ ├── typescript-5.7.md
│ ├── typescript-5.8.md
│ └── typescript-5.9.md
├── tutorials/
│ ├── README.md
│ ├── angular-2.md
│ ├── asp.net-4.md
│ ├── asp.net-core.md
│ ├── gulp.md
│ ├── knockout.md
│ ├── migrating-from-javascript.md
│ ├── react-and-webpack.md
│ ├── react.md
│ └── typescript-in-5-minutes.md
└── wiki/
├── README.md
├── architectural-overview.md
├── coding_guidelines.md
├── common-errors.md
├── roadmap.md
├── this-in-typescript.md
├── typescript-editor-support.md
└── using-typescript-with-asp.net-5.md
================================================
FILE CONTENTS
================================================
================================================
FILE: .gitattributes
================================================
# Set language
*.js linguist-language=TypeScript
# Normalize line endings for all text files.
* text=auto
================================================
FILE: .github/CONTRIBUTING.md
================================================
# 贡献代码
**Working on your first Pull Request?** You can learn how from this *free* series [How to Contribute to an Open Source Project on GitHub](https://egghead.io/series/how-to-contribute-to-an-open-source-project-on-github)
如果您愿意的话,就可以参与到本项目里。
这里接受大家贡献翻译,修改或其它任何形式。
您可以审察已有的翻译,并提出保贵的修改意见或直接提交PR。
如果你想翻译新的主题,需要在issue里新增一条,说明您正在翻译哪个主题。
以防大家同时翻译一个,浪费了工作成果。
# Markdown书写规范检验
我们使用Markdownlint来对手册内容进行书写规范检察。
在新的提交前请本地测试是否符合书写规范。
```js
node lint.js
```
很少时候会出现无法满足markdownlint,这时可以考虑使用``来禁用某些检查。
详细信息请参考markdownlint官网。
## 新增章节翻译
需要同时更改`SUMMARY.md`,`preface.md`和`README.md`。
Gitbook会自动解析。
# 小建议
你的提交最好满足:
* 详细的友好的提交信息,能够直观地说明改动内容。
* 考虑使用`rebase`,`reset`等工具将你**本地**的提交合并成意义更明确的提交记录。这样历史会更漂亮 :)
================================================
FILE: .github/workflows/nodejs.yml
================================================
name: test
on: [push]
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v2
- uses: actions/setup-node@v4
with:
node-version: 20
- run: corepack enable
- uses: actions/setup-node@v4
with:
node-version: 20
cache: yarn
- run: yarn install --immutable
- name: Lint TypeScript
run: yarn run test
================================================
FILE: .gitignore
================================================
node_modules/
.DS_Store
_book
.yarn/*
================================================
FILE: .travis.yml
================================================
language: node_js
node_js:
- "node"
================================================
FILE: .yarnrc.yml
================================================
nodeLinker: node-modules
================================================
FILE: CONTRIBUTING.md
================================================
# 如何贡献代码
首先,感谢你的奉献精神!步骤如下:
* 从队列中选择一项待翻译的条目。
[翻译列表](https://github.com/zhongsp/TypeScript/issues?q=is%3Aissue+is%3Aopen+label%3A%22help+wanted%22)
* Fork仓库,添加译文,最后检查Markdown风格
```sh
npm install
npm run lint
```
* 提交 Pull Request
================================================
FILE: LICENSE
================================================
The MIT License (MIT)
Copyright (c) 2015 Shengping Zhong
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
================================================
FILE: PREFACE.md
================================================
# 前言
> Repo: [https://github.com/zhongsp/TypeScript](https://github.com/zhongsp/TypeScript)
该工程是对 TypeScript 官方及开源社区书写的编程手册、版本发布说明等综合内容的中文翻译。
感谢 Microsoft 和开源社区的工程师们的工作,为 JavaScript 开发带来了全新的体验!
这个项目是我在 2015 年创建的,没想到已经维护快 7 年了,它已然是我参与过的时间最长的项目。
在 2015 年之前,我都是在使用 JavaScript 语言,主要参与的项目也大都是采用 AngularJS 框架的项目,没有接触过 TypeScript。
那时候,TypeScript 在国内项目里用的好像不多,但是在国外已经有不少项目开始采用这个新技术。
2015 年,我正好参与了一个和国外一起合作的项目,决定使用 TypeScript 1.x。
也正因为这个机会,我开始了 TypeScript 的学习。
学习没多久,我就喜欢上了这个语言,并且确信这个东西一定能火。
因为作为一个多年的 JavaScript 程序员来讲,我很清楚它解决了多少痛点(必须得把 VS Code 一起代上)。
早些时候,TypeScript 的文档也不多。
原因之一,TypeScript 是 JavaScript 的超集,JavaScript 的知识点已经有足够的资料了,TypeScript 一笔代过。
原因之二,早期的 TypeScript 里特性不多,知识点不多。原因之三,它的文档相较于做的好的语言来讲确实较弱,可能没什么专门的团队负责,或者没有专职的 technical writer 去写作。
于是,我决定边学边翻译,一方面为了自己,另一方面为了其它小伙伴。
## 哪些内容会继续更新?
我会继续翻译 TypeScript 新版本的 Release Notes。
## 哪些内容可能不会继续更新?
这个项目中的 Handbook 是翻译老版本的 Handbook。
TypeScript 官网大约从 2020 年开始要打造新版的官网,其中包括官网的样式,以及要重写大部分的文档。
目前,我不打算再翻译一遍新版的 Handbook。
我看了下新版的手册,确实优化了不少,但也不代表老版本是无用的或错误的。
现在,TypeScript 官网也开始支持国际化了,已经有部分文档翻译成了中文,我之前还翻译了一篇。
本着开源和为社区服务的精神,推荐学有余力的同学直接给官网提交翻译的 Pull Reuqest,造福开发者。
## 关于《TypeScript入门与实战》一书
因为长期维护 TypeScript 更新的内容再加上在项目中一直使用 TypeScript,
所以有机会将知识进行梳理总结成书。
我出版了《TypeScript入门与实战》一书。
在该书中,尝试着尽可能完整地介绍TypeScript语言的基础知识,并结合了一些本人的使用经验和体会。
它主要面向的是TypeScript语言的初级和中级使用者。
本人还处于TypeScript语言的学习阶段,可能存在理解错误的地方,还请大家指正,一起进步。
但需要强调的是,本书不是对 Handbook 的翻译。
## 感谢
在过去的七年中,有很多素不相识、极富开源精神的小伙伴们曾参与到本工程的翻译与校对工作中。
对你们表示感谢!同时也欢迎其它任何想参与到该工程中的朋友们,贡献你们的力量!
================================================
FILE: README.md
================================================
# TypeScript
[](https://travis-ci.org/zhongsp/TypeScript) [](http://makeapullrequest.com)
## 上新!
之前有许多小伙伴提出希望能将该手册发布为**Book**,
近来该项目又持续不断地有新的朋友关注,
因此现将所有文档整理发布为**图书**样式。希望大家能够喜欢!
线上阅读地址:[https://zhongsp.github.io/TypeScript](https://zhongsp.github.io/TypeScript)
---
[TypeScript 5.9 (2025 年 8 月 1 日)](https://devblogs.microsoft.com/typescript/announcing-typescript-5-9)
|
[版本发布说明](zh/release-notes/typescript-5.9.md)
:heavy_check_mark: TypeScript 语言用于大规模应用的 JavaScript 开发。 :heavy_check_mark: TypeScript 支持类型,是 JavaScript 的超集且可以编译成纯 JavaScript 代码。 :heavy_check_mark: TypeScript 兼容所有浏览器,所有宿主环境,所有操作系统。 :heavy_check_mark: TypeScript 是开源的。
:new::new::new:
`ISBN 9787111669722`
各位朋友们,本人近期出版了[《TypeScript 入门与实战》](https://github.com/zhongsp/TypeScript/issues/310)一书。在该书中,尝试着尽可能完整地介绍 TypeScript 语言的基础知识,并结合了一些本人的使用经验和体会。它主要面向的是 TypeScript 语言的初级和中级使用者。
本人还处于 TypeScript 语言的学习阶段,可能存在理解错误的地方,还请大家指正,一起进步。此外,由于这是本人人生中出版的第一本书,难免会有纰漏,请大家多多包涵!
如果觉得不错可以微信打赏哟 <3
## 目录
- [快速上手](zh/tutorials/README.md)
- [5 分钟了解 TypeScript](zh/tutorials/typescript-in-5-minutes.md)
- [ASP.NET Core](zh/tutorials/asp.net-core.md)
- [ASP.NET 4](zh/tutorials/asp.net-4.md)
- [Gulp](zh/tutorials/gulp.md)
- [Knockout.js](zh/tutorials/knockout.md)
- [React 与 webpack](zh/tutorials/react-and-webpack.md)
- [React](zh/tutorials/react.md)
- [Angular 2](zh/tutorials/angular-2.md)
- [从 JavaScript 迁移到 TypeScript](zh/tutorials/migrating-from-javascript.md)
- [手册](zh/handbook/README.md)
- [基础类型](zh/handbook/basic-types.md)
- [接口](zh/handbook/interfaces.md)
- [函数](zh/handbook/functions.md)
- [字面量类型](zh/handbook/literal-types.md)
- [联合类型和交叉类型](zh/handbook/unions-and-intersections.md)
- [类](zh/handbook/classes.md)
- [枚举](zh/handbook/enums.md)
- [泛型](zh/handbook/generics.md)
- [手册(进阶)](zh/reference/README.md)
- [高级类型](zh/reference/advanced-types.md)
- [实用工具类型](zh/reference/utility-types.md)
- [Decorators](zh/reference/decorators.md)
- [声明合并](zh/reference/declaration-merging.md)
- [Iterators 和 Generators](zh/reference/iterators-and-generators.md)
- [JSX](zh/reference/jsx.md)
- [混入](zh/reference/mixins.md)
- [模块](zh/reference/modules.md)
- [模块解析](zh/reference/module-resolution.md)
- [命名空间](zh/reference/namespaces.md)
- [命名空间和模块](zh/reference/namespaces-and-modules.md)
- [Symbols](zh/reference/symbols.md)
- [三斜线指令](zh/reference/triple-slash-directives.md)
- [类型兼容性](zh/reference/type-compatibility.md)
- [类型推论](zh/reference/type-inference.md)
- [变量声明](zh/reference/variable-declarations.md)
- 手册(v2)
- [模版字面量类型](zh/handbook-v2/type-manipulation/template-literal-types.md)
- [如何书写声明文件](zh/declaration-files/README.md)
- [介绍](zh/declaration-files/introduction.md)
- [举例](zh/declaration-files/by-example.md)
- [库结构](zh/declaration-files/library-structures.md)
- [模板](zh/declaration-files/templates.md)
- [最佳实践](zh/declaration-files/do-s-and-don-ts.md)
- [深入](zh/declaration-files/deep-dive.md)
- [发布](zh/declaration-files/publishing.md)
- [使用](zh/declaration-files/consumption.md)
- JavaScript
- [JavaScript 文件里的类型检查](zh/javascript/type-checking-javascript-files.md)
- [工程配置](zh/project-config/README.md)
- [tsconfig.json](zh/project-config/tsconfig.json.md)
- [工程引用](zh/project-config/project-references.md)
- [NPM 包的类型](zh/project-config/typings-for-npm-packages.md)
- [编译选项](zh/project-config/compiler-options.md)
- [配置 Watch](zh/project-config/configuring-watch.md)
- [在 MSBuild 里使用编译选项](zh/project-config/compiler-options-in-msbuild.md)
- [与其它构建工具整合](zh/project-config/integrating-with-build-tools.md)
- [使用 TypeScript 的每日构建版本](zh/project-config/nightly-builds.md)
- [Wiki](zh/wiki/README.md)
- [TypeScript 里的 this](zh/wiki/this-in-typescript.md)
- [编码规范](zh/wiki/coding_guidelines.md)
- [常见编译错误](zh/wiki/common-errors.md)
- [支持 TypeScript 的编辑器](zh/wiki/typescript-editor-support.md)
- [结合 ASP.NET v5 使用 TypeScript](zh/wiki/using-typescript-with-asp.net-5.md)
- [架构概述](zh/wiki/architectural-overview.md)
- [发展路线图](zh/wiki/roadmap.md)
- [新增功能](zh/release-notes/README.md)
- [TypeScript 5.7](zh/release-notes/typescript-5.9.md)
- [TypeScript 5.7](zh/release-notes/typescript-5.8.md)
- [TypeScript 5.7](zh/release-notes/typescript-5.7.md)
- [TypeScript 5.6](zh/release-notes/typescript-5.6.md)
- [TypeScript 5.5](zh/release-notes/typescript-5.5.md)
- [TypeScript 5.4](zh/release-notes/typescript-5.4.md)
- [TypeScript 5.3](zh/release-notes/typescript-5.3.md)
- [TypeScript 5.2](zh/release-notes/typescript-5.2.md)
- [TypeScript 5.1](zh/release-notes/typescript-5.1.md)
- [TypeScript 5.0](zh/release-notes/typescript-5.0.md)
- [TypeScript 4.9](zh/release-notes/typescript-4.9.md)
- [TypeScript 4.8](zh/release-notes/typescript-4.8.md)
- [TypeScript 4.7](zh/release-notes/typescript-4.7.md)
- [TypeScript 4.6](zh/release-notes/typescript-4.6.md)
- [TypeScript 4.5](zh/release-notes/typescript-4.5.md)
- [TypeScript 4.4](zh/release-notes/typescript-4.4.md)
- [TypeScript 4.3](zh/release-notes/typescript-4.3.md)
- [TypeScript 4.2](zh/release-notes/typescript-4.2.md)
- [TypeScript 4.1](zh/release-notes/typescript-4.1.md)
- [TypeScript 4.0](zh/release-notes/typescript-4.0.md)
- [TypeScript 3.9](zh/release-notes/typescript-3.9.md)
- [TypeScript 3.8](zh/release-notes/typescript-3.8.md)
- [TypeScript 3.7](zh/release-notes/typescript-3.7.md)
- [TypeScript 3.6](zh/release-notes/typescript-3.6.md)
- [TypeScript 3.5](zh/release-notes/typescript-3.5.md)
- [TypeScript 3.4](zh/release-notes/typescript-3.4.md)
- [TypeScript 3.3](zh/release-notes/typescript-3.3.md)
- [TypeScript 3.2](zh/release-notes/typescript-3.2.md)
- [TypeScript 3.1](zh/release-notes/typescript-3.1.md)
- [TypeScript 3.0](zh/release-notes/typescript-3.0.md)
- [TypeScript 2.9](zh/release-notes/typescript-2.9.md)
- [TypeScript 2.8](zh/release-notes/typescript-2.8.md)
- [TypeScript 2.7](zh/release-notes/typescript-2.7.md)
- [TypeScript 2.6](zh/release-notes/typescript-2.6.md)
- [TypeScript 2.5](zh/release-notes/typescript-2.5.md)
- [TypeScript 2.4](zh/release-notes/typescript-2.4.md)
- [TypeScript 2.3](zh/release-notes/typescript-2.3.md)
- [TypeScript 2.2](zh/release-notes/typescript-2.2.md)
- [TypeScript 2.1](zh/release-notes/typescript-2.1.md)
- [TypeScript 2.0](zh/release-notes/typescript-2.0.md)
- [TypeScript 1.8](zh/release-notes/typescript-1.8.md)
- [TypeScript 1.7](zh/release-notes/typescript-1.7.md)
- [TypeScript 1.6](zh/release-notes/typescript-1.6.md)
- [TypeScript 1.5](zh/release-notes/typescript-1.5.md)
- [TypeScript 1.4](zh/release-notes/typescript-1.4.md)
- [TypeScript 1.3](zh/release-notes/typescript-1.3.md)
- [TypeScript 1.1](zh/release-notes/typescript-1.1.md)
- [Breaking Changes](zh/breaking-changes/README.md)
- [TypeScript 3.6](zh/breaking-changes/typescript-3.6.md)
- [TypeScript 3.5](zh/breaking-changes/typescript-3.5.md)
- [TypeScript 3.4](zh/breaking-changes/typescript-3.4.md)
- [TypeScript 3.2](zh/breaking-changes/typescript-3.2.md)
- [TypeScript 3.1](zh/breaking-changes/typescript-3.1.md)
- [TypeScript 3.0](zh/breaking-changes/typescript-3.0.md)
- [TypeScript 2.9](zh/breaking-changes/typescript-2.9.md)
- [TypeScript 2.8](zh/breaking-changes/typescript-2.8.md)
- [TypeScript 2.7](zh/breaking-changes/typescript-2.7.md)
- [TypeScript 2.6](zh/breaking-changes/typescript-2.6.md)
- [TypeScript 2.4](zh/breaking-changes/typescript-2.4.md)
- [TypeScript 2.3](zh/breaking-changes/typescript-2.3.md)
- [TypeScript 2.2](zh/breaking-changes/typescript-2.2.md)
- [TypeScript 2.1](zh/breaking-changes/typescript-2.1.md)
- [TypeScript 2.0](zh/breaking-changes/typescript-2.0.md)
- [TypeScript 1.8](zh/breaking-changes/typescript-1.8.md)
- [TypeScript 1.7](zh/breaking-changes/typescript-1.7.md)
- [TypeScript 1.6](zh/breaking-changes/typescript-1.6.md)
- [TypeScript 1.5](zh/breaking-changes/typescript-1.5.md)
- [TypeScript 1.4](zh/breaking-changes/typescript-1.4.md)
**TypeScript 手册官方英文版**
- [TypeScript 手册(英文版)](http://www.typescriptlang.org/docs/home.html)
**TypeScript 语言规范**
- [TypeScript 语言规范](https://github.com/microsoft/TypeScript/blob/master/doc/spec-ARCHIVED.md)
期待你为翻译做出贡献:)
================================================
FILE: SUMMARY.md
================================================
# TypeScript 使用指南手册
[前言](PREFACE.md)
# 快速上手
- [快速上手](zh/tutorials/README.md)
- [5 分钟了解 TypeScript](zh/tutorials/typescript-in-5-minutes.md)
- [ASP.NET Core](zh/tutorials/asp.net-core.md)
- [ASP.NET 4](zh/tutorials/asp.net-4.md)
- [Gulp](zh/tutorials/gulp.md)
- [Knockout.js](zh/tutorials/knockout.md)
- [React 与 webpack](zh/tutorials/react-and-webpack.md)
- [React](zh/tutorials/react.md)
- [Angular 2](zh/tutorials/angular-2.md)
- [从 JavaScript 迁移到 TypeScript](zh/tutorials/migrating-from-javascript.md)
# 手册
- [手册](zh/handbook/README.md)
- [基础类型](zh/handbook/basic-types.md)
- [接口](zh/handbook/interfaces.md)
- [函数](zh/handbook/functions.md)
- [字面量类型](zh/handbook/literal-types.md)
- [联合类型和交叉类型](zh/handbook/unions-and-intersections.md)
- [类](zh/handbook/classes.md)
- [枚举](zh/handbook/enums.md)
- [泛型](zh/handbook/generics.md)
# 手册(进阶)
- [手册(进阶)](zh/reference/README.md)
- [高级类型](zh/reference/advanced-types.md)
- [实用工具类型](zh/reference/utility-types.md)
- [Decorators](zh/reference/decorators.md)
- [声明合并](zh/reference/declaration-merging.md)
- [Iterators 和 Generators](zh/reference/iterators-and-generators.md)
- [JSX](zh/reference/jsx.md)
- [混入](zh/reference/mixins.md)
- [模块](zh/reference/modules.md)
- [模块解析](zh/reference/module-resolution.md)
- [命名空间](zh/reference/namespaces.md)
- [命名空间和模块](zh/reference/namespaces-and-modules.md)
- [Symbols](zh/reference/symbols.md)
- [三斜线指令](zh/reference/triple-slash-directives.md)
- [类型兼容性](zh/reference/type-compatibility.md)
- [类型推论](zh/reference/type-inference.md)
- [变量声明](zh/reference/variable-declarations.md)
# 手册(v2)
- [手册(v2)](zh/handbook-v2/README.md)
- [模版字面量类型](zh/handbook-v2/type-manipulation/template-literal-types.md)
# TypeScript 声明文件(.d.ts)
- [如何书写声明文件](zh/declaration-files/README.md)
- [介绍](zh/declaration-files/introduction.md)
- [举例](zh/declaration-files/by-example.md)
- [库结构](zh/declaration-files/library-structures.md)
- [模板](zh/declaration-files/templates.md)
- [最佳实践](zh/declaration-files/do-s-and-don-ts.md)
- [深入](zh/declaration-files/deep-dive.md)
- [发布](zh/declaration-files/publishing.md)
- [使用](zh/declaration-files/consumption.md)
# TypeScript for JavaScript
- [JavaScript 文件里的类型检查](zh/javascript/type-checking-javascript-files.md)
# 工程配置
- [工程配置](zh/project-config/README.md)
- [tsconfig.json](zh/project-config/tsconfig.json.md)
- [工程引用](zh/project-config/project-references.md)
- [NPM 包的类型](zh/project-config/typings-for-npm-packages.md)
- [编译选项](zh/project-config/compiler-options.md)
- [配置 Watch](zh/project-config/configuring-watch.md)
- [在 MSBuild 里使用编译选项](zh/project-config/compiler-options-in-msbuild.md)
- [与其它构建工具整合](zh/project-config/integrating-with-build-tools.md)
- [使用 TypeScript 的每日构建版本](zh/project-config/nightly-builds.md)
# 版本发布说明(Release Notes)
- [新增功能](zh/release-notes/README.md)
- [TypeScript 5.7](zh/release-notes/typescript-5.9.md)
- [TypeScript 5.7](zh/release-notes/typescript-5.8.md)
- [TypeScript 5.7](zh/release-notes/typescript-5.7.md)
- [TypeScript 5.6](zh/release-notes/typescript-5.6.md)
- [TypeScript 5.5](zh/release-notes/typescript-5.5.md)
- [TypeScript 5.4](zh/release-notes/typescript-5.4.md)
- [TypeScript 5.3](zh/release-notes/typescript-5.3.md)
- [TypeScript 5.2](zh/release-notes/typescript-5.2.md)
- [TypeScript 5.1](zh/release-notes/typescript-5.1.md)
- [TypeScript 5.0](zh/release-notes/typescript-5.0.md)
- [TypeScript 4.9](zh/release-notes/typescript-4.9.md)
- [TypeScript 4.8](zh/release-notes/typescript-4.8.md)
- [TypeScript 4.7](zh/release-notes/typescript-4.7.md)
- [TypeScript 4.6](zh/release-notes/typescript-4.6.md)
- [TypeScript 4.5](zh/release-notes/typescript-4.5.md)
- [TypeScript 4.4](zh/release-notes/typescript-4.4.md)
- [TypeScript 4.3](zh/release-notes/typescript-4.3.md)
- [TypeScript 4.2](zh/release-notes/typescript-4.2.md)
- [TypeScript 4.1](zh/release-notes/typescript-4.1.md)
- [TypeScript 4.0](zh/release-notes/typescript-4.0.md)
- [TypeScript 3.9](zh/release-notes/typescript-3.9.md)
- [TypeScript 3.8](zh/release-notes/typescript-3.8.md)
- [TypeScript 3.7](zh/release-notes/typescript-3.7.md)
- [TypeScript 3.6](zh/release-notes/typescript-3.6.md)
- [TypeScript 3.5](zh/release-notes/typescript-3.5.md)
- [TypeScript 3.4](zh/release-notes/typescript-3.4.md)
- [TypeScript 3.3](zh/release-notes/typescript-3.3.md)
- [TypeScript 3.2](zh/release-notes/typescript-3.2.md)
- [TypeScript 3.1](zh/release-notes/typescript-3.1.md)
- [TypeScript 3.0](zh/release-notes/typescript-3.0.md)
- [TypeScript 2.9](zh/release-notes/typescript-2.9.md)
- [TypeScript 2.8](zh/release-notes/typescript-2.8.md)
- [TypeScript 2.7](zh/release-notes/typescript-2.7.md)
- [TypeScript 2.6](zh/release-notes/typescript-2.6.md)
- [TypeScript 2.5](zh/release-notes/typescript-2.5.md)
- [TypeScript 2.4](zh/release-notes/typescript-2.4.md)
- [TypeScript 2.3](zh/release-notes/typescript-2.3.md)
- [TypeScript 2.2](zh/release-notes/typescript-2.2.md)
- [TypeScript 2.1](zh/release-notes/typescript-2.1.md)
- [TypeScript 2.0](zh/release-notes/typescript-2.0.md)
- [TypeScript 1.8](zh/release-notes/typescript-1.8.md)
- [TypeScript 1.7](zh/release-notes/typescript-1.7.md)
- [TypeScript 1.6](zh/release-notes/typescript-1.6.md)
- [TypeScript 1.5](zh/release-notes/typescript-1.5.md)
- [TypeScript 1.4](zh/release-notes/typescript-1.4.md)
- [TypeScript 1.3](zh/release-notes/typescript-1.3.md)
- [TypeScript 1.1](zh/release-notes/typescript-1.1.md)
# 破坏性改动(Breaking Changes)
- [Breaking Changes](zh/breaking-changes/README.md)
- [TypeScript 3.6](zh/breaking-changes/typescript-3.6.md)
- [TypeScript 3.5](zh/breaking-changes/typescript-3.5.md)
- [TypeScript 3.4](zh/breaking-changes/typescript-3.4.md)
- [TypeScript 3.2](zh/breaking-changes/typescript-3.2.md)
- [TypeScript 3.1](zh/breaking-changes/typescript-3.1.md)
- [TypeScript 3.0](zh/breaking-changes/typescript-3.0.md)
- [TypeScript 2.9](zh/breaking-changes/typescript-2.9.md)
- [TypeScript 2.8](zh/breaking-changes/typescript-2.8.md)
- [TypeScript 2.7](zh/breaking-changes/typescript-2.7.md)
- [TypeScript 2.6](zh/breaking-changes/typescript-2.6.md)
- [TypeScript 2.4](zh/breaking-changes/typescript-2.4.md)
- [TypeScript 2.3](zh/breaking-changes/typescript-2.3.md)
- [TypeScript 2.2](zh/breaking-changes/typescript-2.2.md)
- [TypeScript 2.1](zh/breaking-changes/typescript-2.1.md)
- [TypeScript 2.0](zh/breaking-changes/typescript-2.0.md)
- [TypeScript 1.8](zh/breaking-changes/typescript-1.8.md)
- [TypeScript 1.7](zh/breaking-changes/typescript-1.7.md)
- [TypeScript 1.6](zh/breaking-changes/typescript-1.6.md)
- [TypeScript 1.5](zh/breaking-changes/typescript-1.5.md)
- [TypeScript 1.4](zh/breaking-changes/typescript-1.4.md)
================================================
FILE: book.toml
================================================
[book]
authors = ["钟胜平", "zhongsp"]
language = "zh-Hans"
multilingual = false
src = "./"
title = "TypeScript 使用指南手册"
description = "TypeScript Handbook 中文翻译。"
[build]
build-dir = "docs" # the directory where the output is placed
create-missing = true # whether or not to create missing pages
use-default-preprocessors = true # use the default preprocessors
================================================
FILE: docs/.nojekyll
================================================
This file makes sure that Github Pages doesn't process mdBook's output.
================================================
FILE: docs/.travis.yml
================================================
language: node_js
node_js:
- "node"
================================================
FILE: docs/404.html
================================================
This URL is invalid, sorry. Please use the navigation bar or search to continue.
Repo: https://github.com/zhongsp/TypeScript
该工程是对 TypeScript 官方及开源社区书写的编程手册、版本发布说明等综合内容的中文翻译。 感谢 Microsoft 和开源社区的工程师们的工作,为 JavaScript 开发带来了全新的体验!
这个项目是我在 2015 年创建的,没想到已经维护快 7 年了,它已然是我参与过的时间最长的项目。 在 2015 年之前,我都是在使用 JavaScript 语言,主要参与的项目也大都是采用 AngularJS 框架的项目,没有接触过 TypeScript。 那时候,TypeScript 在国内项目里用的好像不多,但是在国外已经有不少项目开始采用这个新技术。 2015 年,我正好参与了一个和国外一起合作的项目,决定使用 TypeScript 1.x。 也正因为这个机会,我开始了 TypeScript 的学习。 学习没多久,我就喜欢上了这个语言,并且确信这个东西一定能火。 因为作为一个多年的 JavaScript 程序员来讲,我很清楚它解决了多少痛点(必须得把 VS Code 一起代上)。
早些时候,TypeScript 的文档也不多。 原因之一,TypeScript 是 JavaScript 的超集,JavaScript 的知识点已经有足够的资料了,TypeScript 一笔代过。 原因之二,早期的 TypeScript 里特性不多,知识点不多。原因之三,它的文档相较于做的好的语言来讲确实较弱,可能没什么专门的团队负责,或者没有专职的 technical writer 去写作。 于是,我决定边学边翻译,一方面为了自己,另一方面为了其它小伙伴。
我会继续翻译 TypeScript 新版本的 Release Notes。
这个项目中的 Handbook 是翻译老版本的 Handbook。 TypeScript 官网大约从 2020 年开始要打造新版的官网,其中包括官网的样式,以及要重写大部分的文档。 目前,我不打算再翻译一遍新版的 Handbook。 我看了下新版的手册,确实优化了不少,但也不代表老版本是无用的或错误的。
现在,TypeScript 官网也开始支持国际化了,已经有部分文档翻译成了中文,我之前还翻译了一篇。 本着开源和为社区服务的精神,推荐学有余力的同学直接给官网提交翻译的 Pull Reuqest,造福开发者。
因为长期维护 TypeScript 更新的内容再加上在项目中一直使用 TypeScript, 所以有机会将知识进行梳理总结成书。
我出版了《TypeScript入门与实战》一书。
在该书中,尝试着尽可能完整地介绍TypeScript语言的基础知识,并结合了一些本人的使用经验和体会。 它主要面向的是TypeScript语言的初级和中级使用者。 本人还处于TypeScript语言的学习阶段,可能存在理解错误的地方,还请大家指正,一起进步。 但需要强调的是,本书不是对 Handbook 的翻译。
在过去的七年中,有很多素不相识、极富开源精神的小伙伴们曾参与到本工程的翻译与校对工作中。 对你们表示感谢!同时也欢迎其它任何想参与到该工程中的朋友们,贡献你们的力量!
Repo: https://github.com/zhongsp/TypeScript
该工程是对 TypeScript 官方及开源社区书写的编程手册、版本发布说明等综合内容的中文翻译。 感谢 Microsoft 和开源社区的工程师们的工作,为 JavaScript 开发带来了全新的体验!
这个项目是我在 2015 年创建的,没想到已经维护快 7 年了,它已然是我参与过的时间最长的项目。 在 2015 年之前,我都是在使用 JavaScript 语言,主要参与的项目也大都是采用 AngularJS 框架的项目,没有接触过 TypeScript。 那时候,TypeScript 在国内项目里用的好像不多,但是在国外已经有不少项目开始采用这个新技术。 2015 年,我正好参与了一个和国外一起合作的项目,决定使用 TypeScript 1.x。 也正因为这个机会,我开始了 TypeScript 的学习。 学习没多久,我就喜欢上了这个语言,并且确信这个东西一定能火。 因为作为一个多年的 JavaScript 程序员来讲,我很清楚它解决了多少痛点(必须得把 VS Code 一起代上)。
早些时候,TypeScript 的文档也不多。 原因之一,TypeScript 是 JavaScript 的超集,JavaScript 的知识点已经有足够的资料了,TypeScript 一笔代过。 原因之二,早期的 TypeScript 里特性不多,知识点不多。原因之三,它的文档相较于做的好的语言来讲确实较弱,可能没什么专门的团队负责,或者没有专职的 technical writer 去写作。 于是,我决定边学边翻译,一方面为了自己,另一方面为了其它小伙伴。
我会继续翻译 TypeScript 新版本的 Release Notes。
这个项目中的 Handbook 是翻译老版本的 Handbook。 TypeScript 官网大约从 2020 年开始要打造新版的官网,其中包括官网的样式,以及要重写大部分的文档。 目前,我不打算再翻译一遍新版的 Handbook。 我看了下新版的手册,确实优化了不少,但也不代表老版本是无用的或错误的。
现在,TypeScript 官网也开始支持国际化了,已经有部分文档翻译成了中文,我之前还翻译了一篇。 本着开源和为社区服务的精神,推荐学有余力的同学直接给官网提交翻译的 Pull Reuqest,造福开发者。
因为长期维护 TypeScript 更新的内容再加上在项目中一直使用 TypeScript, 所以有机会将知识进行梳理总结成书。
我出版了《TypeScript入门与实战》一书。
在该书中,尝试着尽可能完整地介绍TypeScript语言的基础知识,并结合了一些本人的使用经验和体会。 它主要面向的是TypeScript语言的初级和中级使用者。 本人还处于TypeScript语言的学习阶段,可能存在理解错误的地方,还请大家指正,一起进步。 但需要强调的是,本书不是对 Handbook 的翻译。
在过去的七年中,有很多素不相识、极富开源精神的小伙伴们曾参与到本工程的翻译与校对工作中。 对你们表示感谢!同时也欢迎其它任何想参与到该工程中的朋友们,贡献你们的力量!