Copy disabled (too large)
Download .txt
Showing preview only (15,739K chars total). Download the full file to get everything.
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-disable MD029 -->`来禁用某些检查。
详细信息请参考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入门与实战》一书。
<a href="https://github.com/zhongsp/TypeScript/issues/310"><img src="./zh/misc/ts-intro.png" alt="TypeScript入门与实战" width="200px" height="200px" style="vertical-align: bottom;"></a>
在该书中,尝试着尽可能完整地介绍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)
---
<!-- 🏮 祝所有开发者:牛年大吉!🏮 -->
<img src="./zh/misc/ts_logo.jpg" alt="TypeScript" width="24px" height="24px" style="vertical-align: bottom;"> [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:
<a href="https://github.com/zhongsp/TypeScript/issues/310"><img src="./zh/misc/ts-intro.png" alt="TypeScript入门与实战" width="200px" height="200px" style="vertical-align: bottom;"></a> `ISBN 9787111669722`
各位朋友们,本人近期出版了[《TypeScript 入门与实战》](https://github.com/zhongsp/TypeScript/issues/310)一书。在该书中,尝试着尽可能完整地介绍 TypeScript 语言的基础知识,并结合了一些本人的使用经验和体会。它主要面向的是 TypeScript 语言的初级和中级使用者。
本人还处于 TypeScript 语言的学习阶段,可能存在理解错误的地方,还请大家指正,一起进步。此外,由于这是本人人生中出版的第一本书,难免会有纰漏,请大家多多包涵!
<img src="./zh/misc/reward.jpg" alt="Reward the Author" width="200px" height="200px" style="vertical-align: bottom;">
如果觉得不错可以微信打赏哟 <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
================================================
<!DOCTYPE HTML>
<html lang="zh-Hans" class="light" dir="ltr">
<head>
<!-- Book generated using mdBook -->
<meta charset="UTF-8">
<title>Page not found - TypeScript 使用指南手册</title>
<base href="/">
<!-- Custom HTML head -->
<meta name="description" content="TypeScript Handbook 中文翻译。">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="theme-color" content="#ffffff">
<link rel="icon" href="favicon.svg">
<link rel="shortcut icon" href="favicon.png">
<link rel="stylesheet" href="css/variables.css">
<link rel="stylesheet" href="css/general.css">
<link rel="stylesheet" href="css/chrome.css">
<link rel="stylesheet" href="css/print.css" media="print">
<!-- Fonts -->
<link rel="stylesheet" href="FontAwesome/css/font-awesome.css">
<link rel="stylesheet" href="fonts/fonts.css">
<!-- Highlight.js Stylesheets -->
<link rel="stylesheet" href="highlight.css">
<link rel="stylesheet" href="tomorrow-night.css">
<link rel="stylesheet" href="ayu-highlight.css">
<!-- Custom theme stylesheets -->
</head>
<body class="sidebar-visible no-js">
<div id="body-container">
<!-- Provide site root to javascript -->
<script>
var path_to_root = "";
var default_theme = window.matchMedia("(prefers-color-scheme: dark)").matches ? "navy" : "light";
</script>
<!-- Work around some values being stored in localStorage wrapped in quotes -->
<script>
try {
var theme = localStorage.getItem('mdbook-theme');
var sidebar = localStorage.getItem('mdbook-sidebar');
if (theme.startsWith('"') && theme.endsWith('"')) {
localStorage.setItem('mdbook-theme', theme.slice(1, theme.length - 1));
}
if (sidebar.startsWith('"') && sidebar.endsWith('"')) {
localStorage.setItem('mdbook-sidebar', sidebar.slice(1, sidebar.length - 1));
}
} catch (e) { }
</script>
<!-- Set the theme before any content is loaded, prevents flash -->
<script>
var theme;
try { theme = localStorage.getItem('mdbook-theme'); } catch(e) { }
if (theme === null || theme === undefined) { theme = default_theme; }
var html = document.querySelector('html');
html.classList.remove('light')
html.classList.add(theme);
var body = document.querySelector('body');
body.classList.remove('no-js')
body.classList.add('js');
</script>
<input type="checkbox" id="sidebar-toggle-anchor" class="hidden">
<!-- Hide / unhide sidebar before it is displayed -->
<script>
var body = document.querySelector('body');
var sidebar = null;
var sidebar_toggle = document.getElementById("sidebar-toggle-anchor");
if (document.body.clientWidth >= 1080) {
try { sidebar = localStorage.getItem('mdbook-sidebar'); } catch(e) { }
sidebar = sidebar || 'visible';
} else {
sidebar = 'hidden';
}
sidebar_toggle.checked = sidebar === 'visible';
body.classList.remove('sidebar-visible');
body.classList.add("sidebar-" + sidebar);
</script>
<nav id="sidebar" class="sidebar" aria-label="Table of contents">
<div class="sidebar-scrollbox">
<ol class="chapter"><li class="chapter-item expanded affix "><a href="PREFACE.html">前言</a></li><li class="chapter-item expanded affix "><li class="part-title">快速上手</li><li class="chapter-item expanded "><a href="zh/tutorials/index.html"><strong aria-hidden="true">1.</strong> 快速上手</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="zh/tutorials/typescript-in-5-minutes.html"><strong aria-hidden="true">1.1.</strong> 5 分钟了解 TypeScript</a></li><li class="chapter-item expanded "><a href="zh/tutorials/asp.net-core.html"><strong aria-hidden="true">1.2.</strong> ASP.NET Core</a></li><li class="chapter-item expanded "><a href="zh/tutorials/asp.net-4.html"><strong aria-hidden="true">1.3.</strong> ASP.NET 4</a></li><li class="chapter-item expanded "><a href="zh/tutorials/gulp.html"><strong aria-hidden="true">1.4.</strong> Gulp</a></li><li class="chapter-item expanded "><a href="zh/tutorials/knockout.html"><strong aria-hidden="true">1.5.</strong> Knockout.js</a></li><li class="chapter-item expanded "><a href="zh/tutorials/react-and-webpack.html"><strong aria-hidden="true">1.6.</strong> React 与 webpack</a></li><li class="chapter-item expanded "><a href="zh/tutorials/react.html"><strong aria-hidden="true">1.7.</strong> React</a></li><li class="chapter-item expanded "><a href="zh/tutorials/angular-2.html"><strong aria-hidden="true">1.8.</strong> Angular 2</a></li><li class="chapter-item expanded "><a href="zh/tutorials/migrating-from-javascript.html"><strong aria-hidden="true">1.9.</strong> 从 JavaScript 迁移到 TypeScript</a></li></ol></li><li class="chapter-item expanded "><li class="part-title">手册</li><li class="chapter-item expanded "><a href="zh/handbook/index.html"><strong aria-hidden="true">2.</strong> 手册</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="zh/handbook/basic-types.html"><strong aria-hidden="true">2.1.</strong> 基础类型</a></li><li class="chapter-item expanded "><a href="zh/handbook/interfaces.html"><strong aria-hidden="true">2.2.</strong> 接口</a></li><li class="chapter-item expanded "><a href="zh/handbook/functions.html"><strong aria-hidden="true">2.3.</strong> 函数</a></li><li class="chapter-item expanded "><a href="zh/handbook/literal-types.html"><strong aria-hidden="true">2.4.</strong> 字面量类型</a></li><li class="chapter-item expanded "><a href="zh/handbook/unions-and-intersections.html"><strong aria-hidden="true">2.5.</strong> 联合类型和交叉类型</a></li><li class="chapter-item expanded "><a href="zh/handbook/classes.html"><strong aria-hidden="true">2.6.</strong> 类</a></li><li class="chapter-item expanded "><a href="zh/handbook/enums.html"><strong aria-hidden="true">2.7.</strong> 枚举</a></li><li class="chapter-item expanded "><a href="zh/handbook/generics.html"><strong aria-hidden="true">2.8.</strong> 泛型</a></li></ol></li><li class="chapter-item expanded "><li class="part-title">手册(进阶)</li><li class="chapter-item expanded "><a href="zh/reference/index.html"><strong aria-hidden="true">3.</strong> 手册(进阶)</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="zh/reference/advanced-types.html"><strong aria-hidden="true">3.1.</strong> 高级类型</a></li><li class="chapter-item expanded "><a href="zh/reference/utility-types.html"><strong aria-hidden="true">3.2.</strong> 实用工具类型</a></li><li class="chapter-item expanded "><a href="zh/reference/decorators.html"><strong aria-hidden="true">3.3.</strong> Decorators</a></li><li class="chapter-item expanded "><a href="zh/reference/declaration-merging.html"><strong aria-hidden="true">3.4.</strong> 声明合并</a></li><li class="chapter-item expanded "><a href="zh/reference/iterators-and-generators.html"><strong aria-hidden="true">3.5.</strong> Iterators 和 Generators</a></li><li class="chapter-item expanded "><a href="zh/reference/jsx.html"><strong aria-hidden="true">3.6.</strong> JSX</a></li><li class="chapter-item expanded "><a href="zh/reference/mixins.html"><strong aria-hidden="true">3.7.</strong> 混入</a></li><li class="chapter-item expanded "><a href="zh/reference/modules.html"><strong aria-hidden="true">3.8.</strong> 模块</a></li><li class="chapter-item expanded "><a href="zh/reference/module-resolution.html"><strong aria-hidden="true">3.9.</strong> 模块解析</a></li><li class="chapter-item expanded "><a href="zh/reference/namespaces.html"><strong aria-hidden="true">3.10.</strong> 命名空间</a></li><li class="chapter-item expanded "><a href="zh/reference/namespaces-and-modules.html"><strong aria-hidden="true">3.11.</strong> 命名空间和模块</a></li><li class="chapter-item expanded "><a href="zh/reference/symbols.html"><strong aria-hidden="true">3.12.</strong> Symbols</a></li><li class="chapter-item expanded "><a href="zh/reference/triple-slash-directives.html"><strong aria-hidden="true">3.13.</strong> 三斜线指令</a></li><li class="chapter-item expanded "><a href="zh/reference/type-compatibility.html"><strong aria-hidden="true">3.14.</strong> 类型兼容性</a></li><li class="chapter-item expanded "><a href="zh/reference/type-inference.html"><strong aria-hidden="true">3.15.</strong> 类型推论</a></li><li class="chapter-item expanded "><a href="zh/reference/variable-declarations.html"><strong aria-hidden="true">3.16.</strong> 变量声明</a></li></ol></li><li class="chapter-item expanded "><li class="part-title">手册(v2)</li><li class="chapter-item expanded "><a href="zh/handbook-v2/index.html"><strong aria-hidden="true">4.</strong> 手册(v2)</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="zh/handbook-v2/type-manipulation/template-literal-types.html"><strong aria-hidden="true">4.1.</strong> 模版字面量类型</a></li></ol></li><li class="chapter-item expanded "><li class="part-title">TypeScript 声明文件(.d.ts)</li><li class="chapter-item expanded "><a href="zh/declaration-files/index.html"><strong aria-hidden="true">5.</strong> 如何书写声明文件</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="zh/declaration-files/introduction.html"><strong aria-hidden="true">5.1.</strong> 介绍</a></li><li class="chapter-item expanded "><a href="zh/declaration-files/by-example.html"><strong aria-hidden="true">5.2.</strong> 举例</a></li><li class="chapter-item expanded "><a href="zh/declaration-files/library-structures.html"><strong aria-hidden="true">5.3.</strong> 库结构</a></li><li class="chapter-item expanded "><a href="zh/declaration-files/templates.html"><strong aria-hidden="true">5.4.</strong> 模板</a></li><li class="chapter-item expanded "><a href="zh/declaration-files/do-s-and-don-ts.html"><strong aria-hidden="true">5.5.</strong> 最佳实践</a></li><li class="chapter-item expanded "><a href="zh/declaration-files/deep-dive.html"><strong aria-hidden="true">5.6.</strong> 深入</a></li><li class="chapter-item expanded "><a href="zh/declaration-files/publishing.html"><strong aria-hidden="true">5.7.</strong> 发布</a></li><li class="chapter-item expanded "><a href="zh/declaration-files/consumption.html"><strong aria-hidden="true">5.8.</strong> 使用</a></li></ol></li><li class="chapter-item expanded "><li class="part-title">TypeScript for JavaScript</li><li class="chapter-item expanded "><a href="zh/javascript/type-checking-javascript-files.html"><strong aria-hidden="true">6.</strong> JavaScript 文件里的类型检查</a></li><li class="chapter-item expanded affix "><li class="part-title">工程配置</li><li class="chapter-item expanded "><a href="zh/project-config/index.html"><strong aria-hidden="true">7.</strong> 工程配置</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="zh/project-config/tsconfig.json.html"><strong aria-hidden="true">7.1.</strong> tsconfig.json</a></li><li class="chapter-item expanded "><a href="zh/project-config/project-references.html"><strong aria-hidden="true">7.2.</strong> 工程引用</a></li><li class="chapter-item expanded "><a href="zh/project-config/typings-for-npm-packages.html"><strong aria-hidden="true">7.3.</strong> NPM 包的类型</a></li><li class="chapter-item expanded "><a href="zh/project-config/compiler-options.html"><strong aria-hidden="true">7.4.</strong> 编译选项</a></li><li class="chapter-item expanded "><a href="zh/project-config/configuring-watch.html"><strong aria-hidden="true">7.5.</strong> 配置 Watch</a></li><li class="chapter-item expanded "><a href="zh/project-config/compiler-options-in-msbuild.html"><strong aria-hidden="true">7.6.</strong> 在 MSBuild 里使用编译选项</a></li><li class="chapter-item expanded "><a href="zh/project-config/integrating-with-build-tools.html"><strong aria-hidden="true">7.7.</strong> 与其它构建工具整合</a></li><li class="chapter-item expanded "><a href="zh/project-config/nightly-builds.html"><strong aria-hidden="true">7.8.</strong> 使用 TypeScript 的每日构建版本</a></li></ol></li><li class="chapter-item expanded "><li class="part-title">版本发布说明(Release Notes)</li><li class="chapter-item expanded "><a href="zh/release-notes/index.html"><strong aria-hidden="true">8.</strong> 新增功能</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="zh/release-notes/typescript-5.4.html"><strong aria-hidden="true">8.1.</strong> TypeScript 5.4</a></li><li class="chapter-item expanded "><a href="zh/release-notes/typescript-5.3.html"><strong aria-hidden="true">8.2.</strong> TypeScript 5.3</a></li><li class="chapter-item expanded "><a href="zh/release-notes/typescript-5.2.html"><strong aria-hidden="true">8.3.</strong> TypeScript 5.2</a></li><li class="chapter-item expanded "><a href="zh/release-notes/typescript-5.1.html"><strong aria-hidden="true">8.4.</strong> TypeScript 5.1</a></li><li class="chapter-item expanded "><a href="zh/release-notes/typescript-5.0.html"><strong aria-hidden="true">8.5.</strong> TypeScript 5.0</a></li><li class="chapter-item expanded "><a href="zh/release-notes/typescript-4.9.html"><strong aria-hidden="true">8.6.</strong> TypeScript 4.9</a></li><li class="chapter-item expanded "><a href="zh/release-notes/typescript-4.8.html"><strong aria-hidden="true">8.7.</strong> TypeScript 4.8</a></li><li class="chapter-item expanded "><a href="zh/release-notes/typescript-4.7.html"><strong aria-hidden="true">8.8.</strong> TypeScript 4.7</a></li><li class="chapter-item expanded "><a href="zh/release-notes/typescript-4.6.html"><strong aria-hidden="true">8.9.</strong> TypeScript 4.6</a></li><li class="chapter-item expanded "><a href="zh/release-notes/typescript-4.5.html"><strong aria-hidden="true">8.10.</strong> TypeScript 4.5</a></li><li class="chapter-item expanded "><a href="zh/release-notes/typescript-4.4.html"><strong aria-hidden="true">8.11.</strong> TypeScript 4.4</a></li><li class="chapter-item expanded "><a href="zh/release-notes/typescript-4.3.html"><strong aria-hidden="true">8.12.</strong> TypeScript 4.3</a></li><li class="chapter-item expanded "><a href="zh/release-notes/typescript-4.2.html"><strong aria-hidden="true">8.13.</strong> TypeScript 4.2</a></li><li class="chapter-item expanded "><a href="zh/release-notes/typescript-4.1.html"><strong aria-hidden="true">8.14.</strong> TypeScript 4.1</a></li><li class="chapter-item expanded "><a href="zh/release-notes/typescript-4.0.html"><strong aria-hidden="true">8.15.</strong> TypeScript 4.0</a></li><li class="chapter-item expanded "><a href="zh/release-notes/typescript-3.9.html"><strong aria-hidden="true">8.16.</strong> TypeScript 3.9</a></li><li class="chapter-item expanded "><a href="zh/release-notes/typescript-3.8.html"><strong aria-hidden="true">8.17.</strong> TypeScript 3.8</a></li><li class="chapter-item expanded "><a href="zh/release-notes/typescript-3.7.html"><strong aria-hidden="true">8.18.</strong> TypeScript 3.7</a></li><li class="chapter-item expanded "><a href="zh/release-notes/typescript-3.6.html"><strong aria-hidden="true">8.19.</strong> TypeScript 3.6</a></li><li class="chapter-item expanded "><a href="zh/release-notes/typescript-3.5.html"><strong aria-hidden="true">8.20.</strong> TypeScript 3.5</a></li><li class="chapter-item expanded "><a href="zh/release-notes/typescript-3.4.html"><strong aria-hidden="true">8.21.</strong> TypeScript 3.4</a></li><li class="chapter-item expanded "><a href="zh/release-notes/typescript-3.3.html"><strong aria-hidden="true">8.22.</strong> TypeScript 3.3</a></li><li class="chapter-item expanded "><a href="zh/release-notes/typescript-3.2.html"><strong aria-hidden="true">8.23.</strong> TypeScript 3.2</a></li><li class="chapter-item expanded "><a href="zh/release-notes/typescript-3.1.html"><strong aria-hidden="true">8.24.</strong> TypeScript 3.1</a></li><li class="chapter-item expanded "><a href="zh/release-notes/typescript-3.0.html"><strong aria-hidden="true">8.25.</strong> TypeScript 3.0</a></li><li class="chapter-item expanded "><a href="zh/release-notes/typescript-2.9.html"><strong aria-hidden="true">8.26.</strong> TypeScript 2.9</a></li><li class="chapter-item expanded "><a href="zh/release-notes/typescript-2.8.html"><strong aria-hidden="true">8.27.</strong> TypeScript 2.8</a></li><li class="chapter-item expanded "><a href="zh/release-notes/typescript-2.7.html"><strong aria-hidden="true">8.28.</strong> TypeScript 2.7</a></li><li class="chapter-item expanded "><a href="zh/release-notes/typescript-2.6.html"><strong aria-hidden="true">8.29.</strong> TypeScript 2.6</a></li><li class="chapter-item expanded "><a href="zh/release-notes/typescript-2.5.html"><strong aria-hidden="true">8.30.</strong> TypeScript 2.5</a></li><li class="chapter-item expanded "><a href="zh/release-notes/typescript-2.4.html"><strong aria-hidden="true">8.31.</strong> TypeScript 2.4</a></li><li class="chapter-item expanded "><a href="zh/release-notes/typescript-2.3.html"><strong aria-hidden="true">8.32.</strong> TypeScript 2.3</a></li><li class="chapter-item expanded "><a href="zh/release-notes/typescript-2.2.html"><strong aria-hidden="true">8.33.</strong> TypeScript 2.2</a></li><li class="chapter-item expanded "><a href="zh/release-notes/typescript-2.1.html"><strong aria-hidden="true">8.34.</strong> TypeScript 2.1</a></li><li class="chapter-item expanded "><a href="zh/release-notes/typescript-2.0.html"><strong aria-hidden="true">8.35.</strong> TypeScript 2.0</a></li><li class="chapter-item expanded "><a href="zh/release-notes/typescript-1.8.html"><strong aria-hidden="true">8.36.</strong> TypeScript 1.8</a></li><li class="chapter-item expanded "><a href="zh/release-notes/typescript-1.7.html"><strong aria-hidden="true">8.37.</strong> TypeScript 1.7</a></li><li class="chapter-item expanded "><a href="zh/release-notes/typescript-1.6.html"><strong aria-hidden="true">8.38.</strong> TypeScript 1.6</a></li><li class="chapter-item expanded "><a href="zh/release-notes/typescript-1.5.html"><strong aria-hidden="true">8.39.</strong> TypeScript 1.5</a></li><li class="chapter-item expanded "><a href="zh/release-notes/typescript-1.4.html"><strong aria-hidden="true">8.40.</strong> TypeScript 1.4</a></li><li class="chapter-item expanded "><a href="zh/release-notes/typescript-1.3.html"><strong aria-hidden="true">8.41.</strong> TypeScript 1.3</a></li><li class="chapter-item expanded "><a href="zh/release-notes/typescript-1.1.html"><strong aria-hidden="true">8.42.</strong> TypeScript 1.1</a></li></ol></li><li class="chapter-item expanded "><li class="part-title">破坏性改动(Breaking Changes)</li><li class="chapter-item expanded "><a href="zh/breaking-changes/index.html"><strong aria-hidden="true">9.</strong> Breaking Changes</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="zh/breaking-changes/typescript-3.6.html"><strong aria-hidden="true">9.1.</strong> TypeScript 3.6</a></li><li class="chapter-item expanded "><a href="zh/breaking-changes/typescript-3.5.html"><strong aria-hidden="true">9.2.</strong> TypeScript 3.5</a></li><li class="chapter-item expanded "><a href="zh/breaking-changes/typescript-3.4.html"><strong aria-hidden="true">9.3.</strong> TypeScript 3.4</a></li><li class="chapter-item expanded "><a href="zh/breaking-changes/typescript-3.2.html"><strong aria-hidden="true">9.4.</strong> TypeScript 3.2</a></li><li class="chapter-item expanded "><a href="zh/breaking-changes/typescript-3.1.html"><strong aria-hidden="true">9.5.</strong> TypeScript 3.1</a></li><li class="chapter-item expanded "><a href="zh/breaking-changes/typescript-3.0.html"><strong aria-hidden="true">9.6.</strong> TypeScript 3.0</a></li><li class="chapter-item expanded "><a href="zh/breaking-changes/typescript-2.9.html"><strong aria-hidden="true">9.7.</strong> TypeScript 2.9</a></li><li class="chapter-item expanded "><a href="zh/breaking-changes/typescript-2.8.html"><strong aria-hidden="true">9.8.</strong> TypeScript 2.8</a></li><li class="chapter-item expanded "><a href="zh/breaking-changes/typescript-2.7.html"><strong aria-hidden="true">9.9.</strong> TypeScript 2.7</a></li><li class="chapter-item expanded "><a href="zh/breaking-changes/typescript-2.6.html"><strong aria-hidden="true">9.10.</strong> TypeScript 2.6</a></li><li class="chapter-item expanded "><a href="zh/breaking-changes/typescript-2.4.html"><strong aria-hidden="true">9.11.</strong> TypeScript 2.4</a></li><li class="chapter-item expanded "><a href="zh/breaking-changes/typescript-2.3.html"><strong aria-hidden="true">9.12.</strong> TypeScript 2.3</a></li><li class="chapter-item expanded "><a href="zh/breaking-changes/typescript-2.2.html"><strong aria-hidden="true">9.13.</strong> TypeScript 2.2</a></li><li class="chapter-item expanded "><a href="zh/breaking-changes/typescript-2.1.html"><strong aria-hidden="true">9.14.</strong> TypeScript 2.1</a></li><li class="chapter-item expanded "><a href="zh/breaking-changes/typescript-2.0.html"><strong aria-hidden="true">9.15.</strong> TypeScript 2.0</a></li><li class="chapter-item expanded "><a href="zh/breaking-changes/typescript-1.8.html"><strong aria-hidden="true">9.16.</strong> TypeScript 1.8</a></li><li class="chapter-item expanded "><a href="zh/breaking-changes/typescript-1.7.html"><strong aria-hidden="true">9.17.</strong> TypeScript 1.7</a></li><li class="chapter-item expanded "><a href="zh/breaking-changes/typescript-1.6.html"><strong aria-hidden="true">9.18.</strong> TypeScript 1.6</a></li><li class="chapter-item expanded "><a href="zh/breaking-changes/typescript-1.5.html"><strong aria-hidden="true">9.19.</strong> TypeScript 1.5</a></li><li class="chapter-item expanded "><a href="zh/breaking-changes/typescript-1.4.html"><strong aria-hidden="true">9.20.</strong> TypeScript 1.4</a></li></ol></li></ol>
</div>
<div id="sidebar-resize-handle" class="sidebar-resize-handle">
<div class="sidebar-resize-indicator"></div>
</div>
</nav>
<!-- Track and set sidebar scroll position -->
<script>
var sidebarScrollbox = document.querySelector('#sidebar .sidebar-scrollbox');
sidebarScrollbox.addEventListener('click', function(e) {
if (e.target.tagName === 'A') {
sessionStorage.setItem('sidebar-scroll', sidebarScrollbox.scrollTop);
}
}, { passive: true });
var sidebarScrollTop = sessionStorage.getItem('sidebar-scroll');
sessionStorage.removeItem('sidebar-scroll');
if (sidebarScrollTop) {
// preserve sidebar scroll position when navigating via links within sidebar
sidebarScrollbox.scrollTop = sidebarScrollTop;
} else {
// scroll sidebar to current active section when navigating via "next/previous chapter" buttons
var activeSection = document.querySelector('#sidebar .active');
if (activeSection) {
activeSection.scrollIntoView({ block: 'center' });
}
}
</script>
<div id="page-wrapper" class="page-wrapper">
<div class="page">
<div id="menu-bar-hover-placeholder"></div>
<div id="menu-bar" class="menu-bar sticky">
<div class="left-buttons">
<label id="sidebar-toggle" class="icon-button" for="sidebar-toggle-anchor" title="Toggle Table of Contents" aria-label="Toggle Table of Contents" aria-controls="sidebar">
<i class="fa fa-bars"></i>
</label>
<button id="theme-toggle" class="icon-button" type="button" title="Change theme" aria-label="Change theme" aria-haspopup="true" aria-expanded="false" aria-controls="theme-list">
<i class="fa fa-paint-brush"></i>
</button>
<ul id="theme-list" class="theme-popup" aria-label="Themes" role="menu">
<li role="none"><button role="menuitem" class="theme" id="light">Light</button></li>
<li role="none"><button role="menuitem" class="theme" id="rust">Rust</button></li>
<li role="none"><button role="menuitem" class="theme" id="coal">Coal</button></li>
<li role="none"><button role="menuitem" class="theme" id="navy">Navy</button></li>
<li role="none"><button role="menuitem" class="theme" id="ayu">Ayu</button></li>
</ul>
<button id="search-toggle" class="icon-button" type="button" title="Search. (Shortkey: s)" aria-label="Toggle Searchbar" aria-expanded="false" aria-keyshortcuts="S" aria-controls="searchbar">
<i class="fa fa-search"></i>
</button>
</div>
<h1 class="menu-title">TypeScript 使用指南手册</h1>
<div class="right-buttons">
<a href="print.html" title="Print this book" aria-label="Print this book">
<i id="print-button" class="fa fa-print"></i>
</a>
</div>
</div>
<div id="search-wrapper" class="hidden">
<form id="searchbar-outer" class="searchbar-outer">
<input type="search" id="searchbar" name="searchbar" placeholder="Search this book ..." aria-controls="searchresults-outer" aria-describedby="searchresults-header">
</form>
<div id="searchresults-outer" class="searchresults-outer hidden">
<div id="searchresults-header" class="searchresults-header"></div>
<ul id="searchresults">
</ul>
</div>
</div>
<!-- Apply ARIA attributes after the sidebar and the sidebar toggle button are added to the DOM -->
<script>
document.getElementById('sidebar-toggle').setAttribute('aria-expanded', sidebar === 'visible');
document.getElementById('sidebar').setAttribute('aria-hidden', sidebar !== 'visible');
Array.from(document.querySelectorAll('#sidebar a')).forEach(function(link) {
link.setAttribute('tabIndex', sidebar === 'visible' ? 0 : -1);
});
</script>
<div id="content" class="content">
<main>
<h1 id="document-not-found-404"><a class="header" href="#document-not-found-404">Document not found (404)</a></h1>
<p>This URL is invalid, sorry. Please use the navigation bar or search to continue.</p>
</main>
<nav class="nav-wrapper" aria-label="Page navigation">
<!-- Mobile navigation buttons -->
<div style="clear: both"></div>
</nav>
</div>
</div>
<nav class="nav-wide-wrapper" aria-label="Page navigation">
</nav>
</div>
<script>
window.playground_copyable = true;
</script>
<script src="elasticlunr.min.js"></script>
<script src="mark.min.js"></script>
<script src="searcher.js"></script>
<script src="clipboard.min.js"></script>
<script src="highlight.js"></script>
<script src="book.js"></script>
<!-- Custom JS scripts -->
</div>
</body>
</html>
================================================
FILE: docs/FontAwesome/css/font-awesome.css
================================================
/*!
* Font Awesome 4.7.0 by @davegandy - http://fontawesome.io - @fontawesome
* License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License)
*/@font-face{font-family:'FontAwesome';src:url('../fonts/fontawesome-webfont.eot?v=4.7.0');src:url('../fonts/fontawesome-webfont.eot?#iefix&v=4.7.0') format('embedded-opentype'),url('../fonts/fontawesome-webfont.woff2?v=4.7.0') format('woff2'),url('../fonts/fontawesome-webfont.woff?v=4.7.0') format('woff'),url('../fonts/fontawesome-webfont.ttf?v=4.7.0') format('truetype'),url('../fonts/fontawesome-webfont.svg?v=4.7.0#fontawesomeregular') format('svg');font-weight:normal;font-style:normal}.fa{display:inline-block;font:normal normal normal 14px/1 FontAwesome;font-size:inherit;text-rendering:auto;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.fa-lg{font-size:1.33333333em;line-height:.75em;vertical-align:-15%}.fa-2x{font-size:2em}.fa-3x{font-size:3em}.fa-4x{font-size:4em}.fa-5x{font-size:5em}.fa-fw{width:1.28571429em;text-align:center}.fa-ul{padding-left:0;margin-left:2.14285714em;list-style-type:none}.fa-ul>li{position:relative}.fa-li{position:absolute;left:-2.14285714em;width:2.14285714em;top:.14285714em;text-align:center}.fa-li.fa-lg{left:-1.85714286em}.fa-border{padding:.2em .25em .15em;border:solid .08em #eee;border-radius:.1em}.fa-pull-left{float:left}.fa-pull-right{float:right}.fa.fa-pull-left{margin-right:.3em}.fa.fa-pull-right{margin-left:.3em}.pull-right{float:right}.pull-left{float:left}.fa.pull-left{margin-right:.3em}.fa.pull-right{margin-left:.3em}.fa-spin{-webkit-animation:fa-spin 2s infinite linear;animation:fa-spin 2s infinite linear}.fa-pulse{-webkit-animation:fa-spin 1s infinite steps(8);animation:fa-spin 1s infinite steps(8)}@-webkit-keyframes fa-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}@keyframes fa-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}.fa-rotate-90{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=1)";-webkit-transform:rotate(90deg);-ms-transform:rotate(90deg);transform:rotate(90deg)}.fa-rotate-180{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=2)";-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg)}.fa-rotate-270{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=3)";-webkit-transform:rotate(270deg);-ms-transform:rotate(270deg);transform:rotate(270deg)}.fa-flip-horizontal{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=0, mirror=1)";-webkit-transform:scale(-1, 1);-ms-transform:scale(-1, 1);transform:scale(-1, 1)}.fa-flip-vertical{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)";-webkit-transform:scale(1, -1);-ms-transform:scale(1, -1);transform:scale(1, -1)}:root .fa-rotate-90,:root .fa-rotate-180,:root .fa-rotate-270,:root .fa-flip-horizontal,:root .fa-flip-vertical{filter:none}.fa-stack{position:relative;display:inline-block;width:2em;height:2em;line-height:2em;vertical-align:middle}.fa-stack-1x,.fa-stack-2x{position:absolute;left:0;width:100%;text-align:center}.fa-stack-1x{line-height:inherit}.fa-stack-2x{font-size:2em}.fa-inverse{color:#fff}.fa-glass:before{content:"\f000"}.fa-music:before{content:"\f001"}.fa-search:before{content:"\f002"}.fa-envelope-o:before{content:"\f003"}.fa-heart:before{content:"\f004"}.fa-star:before{content:"\f005"}.fa-star-o:before{content:"\f006"}.fa-user:before{content:"\f007"}.fa-film:before{content:"\f008"}.fa-th-large:before{content:"\f009"}.fa-th:before{content:"\f00a"}.fa-th-list:before{content:"\f00b"}.fa-check:before{content:"\f00c"}.fa-remove:before,.fa-close:before,.fa-times:before{content:"\f00d"}.fa-search-plus:before{content:"\f00e"}.fa-search-minus:before{content:"\f010"}.fa-power-off:before{content:"\f011"}.fa-signal:before{content:"\f012"}.fa-gear:before,.fa-cog:before{content:"\f013"}.fa-trash-o:before{content:"\f014"}.fa-home:before{content:"\f015"}.fa-file-o:before{content:"\f016"}.fa-clock-o:before{content:"\f017"}.fa-road:before{content:"\f018"}.fa-download:before{content:"\f019"}.fa-arrow-circle-o-down:before{content:"\f01a"}.fa-arrow-circle-o-up:before{content:"\f01b"}.fa-inbox:before{content:"\f01c"}.fa-play-circle-o:before{content:"\f01d"}.fa-rotate-right:before,.fa-repeat:before{content:"\f01e"}.fa-refresh:before{content:"\f021"}.fa-list-alt:before{content:"\f022"}.fa-lock:before{content:"\f023"}.fa-flag:before{content:"\f024"}.fa-headphones:before{content:"\f025"}.fa-volume-off:before{content:"\f026"}.fa-volume-down:before{content:"\f027"}.fa-volume-up:before{content:"\f028"}.fa-qrcode:before{content:"\f029"}.fa-barcode:before{content:"\f02a"}.fa-tag:before{content:"\f02b"}.fa-tags:before{content:"\f02c"}.fa-book:before{content:"\f02d"}.fa-bookmark:before{content:"\f02e"}.fa-print:before{content:"\f02f"}.fa-camera:before{content:"\f030"}.fa-font:before{content:"\f031"}.fa-bold:before{content:"\f032"}.fa-italic:before{content:"\f033"}.fa-text-height:before{content:"\f034"}.fa-text-width:before{content:"\f035"}.fa-align-left:before{content:"\f036"}.fa-align-center:before{content:"\f037"}.fa-align-right:before{content:"\f038"}.fa-align-justify:before{content:"\f039"}.fa-list:before{content:"\f03a"}.fa-dedent:before,.fa-outdent:before{content:"\f03b"}.fa-indent:before{content:"\f03c"}.fa-video-camera:before{content:"\f03d"}.fa-photo:before,.fa-image:before,.fa-picture-o:before{content:"\f03e"}.fa-pencil:before{content:"\f040"}.fa-map-marker:before{content:"\f041"}.fa-adjust:before{content:"\f042"}.fa-tint:before{content:"\f043"}.fa-edit:before,.fa-pencil-square-o:before{content:"\f044"}.fa-share-square-o:before{content:"\f045"}.fa-check-square-o:before{content:"\f046"}.fa-arrows:before{content:"\f047"}.fa-step-backward:before{content:"\f048"}.fa-fast-backward:before{content:"\f049"}.fa-backward:before{content:"\f04a"}.fa-play:before{content:"\f04b"}.fa-pause:before{content:"\f04c"}.fa-stop:before{content:"\f04d"}.fa-forward:before{content:"\f04e"}.fa-fast-forward:before{content:"\f050"}.fa-step-forward:before{content:"\f051"}.fa-eject:before{content:"\f052"}.fa-chevron-left:before{content:"\f053"}.fa-chevron-right:before{content:"\f054"}.fa-plus-circle:before{content:"\f055"}.fa-minus-circle:before{content:"\f056"}.fa-times-circle:before{content:"\f057"}.fa-check-circle:before{content:"\f058"}.fa-question-circle:before{content:"\f059"}.fa-info-circle:before{content:"\f05a"}.fa-crosshairs:before{content:"\f05b"}.fa-times-circle-o:before{content:"\f05c"}.fa-check-circle-o:before{content:"\f05d"}.fa-ban:before{content:"\f05e"}.fa-arrow-left:before{content:"\f060"}.fa-arrow-right:before{content:"\f061"}.fa-arrow-up:before{content:"\f062"}.fa-arrow-down:before{content:"\f063"}.fa-mail-forward:before,.fa-share:before{content:"\f064"}.fa-expand:before{content:"\f065"}.fa-compress:before{content:"\f066"}.fa-plus:before{content:"\f067"}.fa-minus:before{content:"\f068"}.fa-asterisk:before{content:"\f069"}.fa-exclamation-circle:before{content:"\f06a"}.fa-gift:before{content:"\f06b"}.fa-leaf:before{content:"\f06c"}.fa-fire:before{content:"\f06d"}.fa-eye:before{content:"\f06e"}.fa-eye-slash:before{content:"\f070"}.fa-warning:before,.fa-exclamation-triangle:before{content:"\f071"}.fa-plane:before{content:"\f072"}.fa-calendar:before{content:"\f073"}.fa-random:before{content:"\f074"}.fa-comment:before{content:"\f075"}.fa-magnet:before{content:"\f076"}.fa-chevron-up:before{content:"\f077"}.fa-chevron-down:before{content:"\f078"}.fa-retweet:before{content:"\f079"}.fa-shopping-cart:before{content:"\f07a"}.fa-folder:before{content:"\f07b"}.fa-folder-open:before{content:"\f07c"}.fa-arrows-v:before{content:"\f07d"}.fa-arrows-h:before{content:"\f07e"}.fa-bar-chart-o:before,.fa-bar-chart:before{content:"\f080"}.fa-twitter-square:before{content:"\f081"}.fa-facebook-square:before{content:"\f082"}.fa-camera-retro:before{content:"\f083"}.fa-key:before{content:"\f084"}.fa-gears:before,.fa-cogs:before{content:"\f085"}.fa-comments:before{content:"\f086"}.fa-thumbs-o-up:before{content:"\f087"}.fa-thumbs-o-down:before{content:"\f088"}.fa-star-half:before{content:"\f089"}.fa-heart-o:before{content:"\f08a"}.fa-sign-out:before{content:"\f08b"}.fa-linkedin-square:before{content:"\f08c"}.fa-thumb-tack:before{content:"\f08d"}.fa-external-link:before{content:"\f08e"}.fa-sign-in:before{content:"\f090"}.fa-trophy:before{content:"\f091"}.fa-github-square:before{content:"\f092"}.fa-upload:before{content:"\f093"}.fa-lemon-o:before{content:"\f094"}.fa-phone:before{content:"\f095"}.fa-square-o:before{content:"\f096"}.fa-bookmark-o:before{content:"\f097"}.fa-phone-square:before{content:"\f098"}.fa-twitter:before{content:"\f099"}.fa-facebook-f:before,.fa-facebook:before{content:"\f09a"}.fa-github:before{content:"\f09b"}.fa-unlock:before{content:"\f09c"}.fa-credit-card:before{content:"\f09d"}.fa-feed:before,.fa-rss:before{content:"\f09e"}.fa-hdd-o:before{content:"\f0a0"}.fa-bullhorn:before{content:"\f0a1"}.fa-bell:before{content:"\f0f3"}.fa-certificate:before{content:"\f0a3"}.fa-hand-o-right:before{content:"\f0a4"}.fa-hand-o-left:before{content:"\f0a5"}.fa-hand-o-up:before{content:"\f0a6"}.fa-hand-o-down:before{content:"\f0a7"}.fa-arrow-circle-left:before{content:"\f0a8"}.fa-arrow-circle-right:before{content:"\f0a9"}.fa-arrow-circle-up:before{content:"\f0aa"}.fa-arrow-circle-down:before{content:"\f0ab"}.fa-globe:before{content:"\f0ac"}.fa-wrench:before{content:"\f0ad"}.fa-tasks:before{content:"\f0ae"}.fa-filter:before{content:"\f0b0"}.fa-briefcase:before{content:"\f0b1"}.fa-arrows-alt:before{content:"\f0b2"}.fa-group:before,.fa-users:before{content:"\f0c0"}.fa-chain:before,.fa-link:before{content:"\f0c1"}.fa-cloud:before{content:"\f0c2"}.fa-flask:before{content:"\f0c3"}.fa-cut:before,.fa-scissors:before{content:"\f0c4"}.fa-copy:before,.fa-files-o:before{content:"\f0c5"}.fa-paperclip:before{content:"\f0c6"}.fa-save:before,.fa-floppy-o:before{content:"\f0c7"}.fa-square:before{content:"\f0c8"}.fa-navicon:before,.fa-reorder:before,.fa-bars:before{content:"\f0c9"}.fa-list-ul:before{content:"\f0ca"}.fa-list-ol:before{content:"\f0cb"}.fa-strikethrough:before{content:"\f0cc"}.fa-underline:before{content:"\f0cd"}.fa-table:before{content:"\f0ce"}.fa-magic:before{content:"\f0d0"}.fa-truck:before{content:"\f0d1"}.fa-pinterest:before{content:"\f0d2"}.fa-pinterest-square:before{content:"\f0d3"}.fa-google-plus-square:before{content:"\f0d4"}.fa-google-plus:before{content:"\f0d5"}.fa-money:before{content:"\f0d6"}.fa-caret-down:before{content:"\f0d7"}.fa-caret-up:before{content:"\f0d8"}.fa-caret-left:before{content:"\f0d9"}.fa-caret-right:before{content:"\f0da"}.fa-columns:before{content:"\f0db"}.fa-unsorted:before,.fa-sort:before{content:"\f0dc"}.fa-sort-down:before,.fa-sort-desc:before{content:"\f0dd"}.fa-sort-up:before,.fa-sort-asc:before{content:"\f0de"}.fa-envelope:before{content:"\f0e0"}.fa-linkedin:before{content:"\f0e1"}.fa-rotate-left:before,.fa-undo:before{content:"\f0e2"}.fa-legal:before,.fa-gavel:before{content:"\f0e3"}.fa-dashboard:before,.fa-tachometer:before{content:"\f0e4"}.fa-comment-o:before{content:"\f0e5"}.fa-comments-o:before{content:"\f0e6"}.fa-flash:before,.fa-bolt:before{content:"\f0e7"}.fa-sitemap:before{content:"\f0e8"}.fa-umbrella:before{content:"\f0e9"}.fa-paste:before,.fa-clipboard:before{content:"\f0ea"}.fa-lightbulb-o:before{content:"\f0eb"}.fa-exchange:before{content:"\f0ec"}.fa-cloud-download:before{content:"\f0ed"}.fa-cloud-upload:before{content:"\f0ee"}.fa-user-md:before{content:"\f0f0"}.fa-stethoscope:before{content:"\f0f1"}.fa-suitcase:before{content:"\f0f2"}.fa-bell-o:before{content:"\f0a2"}.fa-coffee:before{content:"\f0f4"}.fa-cutlery:before{content:"\f0f5"}.fa-file-text-o:before{content:"\f0f6"}.fa-building-o:before{content:"\f0f7"}.fa-hospital-o:before{content:"\f0f8"}.fa-ambulance:before{content:"\f0f9"}.fa-medkit:before{content:"\f0fa"}.fa-fighter-jet:before{content:"\f0fb"}.fa-beer:before{content:"\f0fc"}.fa-h-square:before{content:"\f0fd"}.fa-plus-square:before{content:"\f0fe"}.fa-angle-double-left:before{content:"\f100"}.fa-angle-double-right:before{content:"\f101"}.fa-angle-double-up:before{content:"\f102"}.fa-angle-double-down:before{content:"\f103"}.fa-angle-left:before{content:"\f104"}.fa-angle-right:before{content:"\f105"}.fa-angle-up:before{content:"\f106"}.fa-angle-down:before{content:"\f107"}.fa-desktop:before{content:"\f108"}.fa-laptop:before{content:"\f109"}.fa-tablet:before{content:"\f10a"}.fa-mobile-phone:before,.fa-mobile:before{content:"\f10b"}.fa-circle-o:before{content:"\f10c"}.fa-quote-left:before{content:"\f10d"}.fa-quote-right:before{content:"\f10e"}.fa-spinner:before{content:"\f110"}.fa-circle:before{content:"\f111"}.fa-mail-reply:before,.fa-reply:before{content:"\f112"}.fa-github-alt:before{content:"\f113"}.fa-folder-o:before{content:"\f114"}.fa-folder-open-o:before{content:"\f115"}.fa-smile-o:before{content:"\f118"}.fa-frown-o:before{content:"\f119"}.fa-meh-o:before{content:"\f11a"}.fa-gamepad:before{content:"\f11b"}.fa-keyboard-o:before{content:"\f11c"}.fa-flag-o:before{content:"\f11d"}.fa-flag-checkered:before{content:"\f11e"}.fa-terminal:before{content:"\f120"}.fa-code:before{content:"\f121"}.fa-mail-reply-all:before,.fa-reply-all:before{content:"\f122"}.fa-star-half-empty:before,.fa-star-half-full:before,.fa-star-half-o:before{content:"\f123"}.fa-location-arrow:before{content:"\f124"}.fa-crop:before{content:"\f125"}.fa-code-fork:before{content:"\f126"}.fa-unlink:before,.fa-chain-broken:before{content:"\f127"}.fa-question:before{content:"\f128"}.fa-info:before{content:"\f129"}.fa-exclamation:before{content:"\f12a"}.fa-superscript:before{content:"\f12b"}.fa-subscript:before{content:"\f12c"}.fa-eraser:before{content:"\f12d"}.fa-puzzle-piece:before{content:"\f12e"}.fa-microphone:before{content:"\f130"}.fa-microphone-slash:before{content:"\f131"}.fa-shield:before{content:"\f132"}.fa-calendar-o:before{content:"\f133"}.fa-fire-extinguisher:before{content:"\f134"}.fa-rocket:before{content:"\f135"}.fa-maxcdn:before{content:"\f136"}.fa-chevron-circle-left:before{content:"\f137"}.fa-chevron-circle-right:before{content:"\f138"}.fa-chevron-circle-up:before{content:"\f139"}.fa-chevron-circle-down:before{content:"\f13a"}.fa-html5:before{content:"\f13b"}.fa-css3:before{content:"\f13c"}.fa-anchor:before{content:"\f13d"}.fa-unlock-alt:before{content:"\f13e"}.fa-bullseye:before{content:"\f140"}.fa-ellipsis-h:before{content:"\f141"}.fa-ellipsis-v:before{content:"\f142"}.fa-rss-square:before{content:"\f143"}.fa-play-circle:before{content:"\f144"}.fa-ticket:before{content:"\f145"}.fa-minus-square:before{content:"\f146"}.fa-minus-square-o:before{content:"\f147"}.fa-level-up:before{content:"\f148"}.fa-level-down:before{content:"\f149"}.fa-check-square:before{content:"\f14a"}.fa-pencil-square:before{content:"\f14b"}.fa-external-link-square:before{content:"\f14c"}.fa-share-square:before{content:"\f14d"}.fa-compass:before{content:"\f14e"}.fa-toggle-down:before,.fa-caret-square-o-down:before{content:"\f150"}.fa-toggle-up:before,.fa-caret-square-o-up:before{content:"\f151"}.fa-toggle-right:before,.fa-caret-square-o-right:before{content:"\f152"}.fa-euro:before,.fa-eur:before{content:"\f153"}.fa-gbp:before{content:"\f154"}.fa-dollar:before,.fa-usd:before{content:"\f155"}.fa-rupee:before,.fa-inr:before{content:"\f156"}.fa-cny:before,.fa-rmb:before,.fa-yen:before,.fa-jpy:before{content:"\f157"}.fa-ruble:before,.fa-rouble:before,.fa-rub:before{content:"\f158"}.fa-won:before,.fa-krw:before{content:"\f159"}.fa-bitcoin:before,.fa-btc:before{content:"\f15a"}.fa-file:before{content:"\f15b"}.fa-file-text:before{content:"\f15c"}.fa-sort-alpha-asc:before{content:"\f15d"}.fa-sort-alpha-desc:before{content:"\f15e"}.fa-sort-amount-asc:before{content:"\f160"}.fa-sort-amount-desc:before{content:"\f161"}.fa-sort-numeric-asc:before{content:"\f162"}.fa-sort-numeric-desc:before{content:"\f163"}.fa-thumbs-up:before{content:"\f164"}.fa-thumbs-down:before{content:"\f165"}.fa-youtube-square:before{content:"\f166"}.fa-youtube:before{content:"\f167"}.fa-xing:before{content:"\f168"}.fa-xing-square:before{content:"\f169"}.fa-youtube-play:before{content:"\f16a"}.fa-dropbox:before{content:"\f16b"}.fa-stack-overflow:before{content:"\f16c"}.fa-instagram:before{content:"\f16d"}.fa-flickr:before{content:"\f16e"}.fa-adn:before{content:"\f170"}.fa-bitbucket:before{content:"\f171"}.fa-bitbucket-square:before{content:"\f172"}.fa-tumblr:before{content:"\f173"}.fa-tumblr-square:before{content:"\f174"}.fa-long-arrow-down:before{content:"\f175"}.fa-long-arrow-up:before{content:"\f176"}.fa-long-arrow-left:before{content:"\f177"}.fa-long-arrow-right:before{content:"\f178"}.fa-apple:before{content:"\f179"}.fa-windows:before{content:"\f17a"}.fa-android:before{content:"\f17b"}.fa-linux:before{content:"\f17c"}.fa-dribbble:before{content:"\f17d"}.fa-skype:before{content:"\f17e"}.fa-foursquare:before{content:"\f180"}.fa-trello:before{content:"\f181"}.fa-female:before{content:"\f182"}.fa-male:before{content:"\f183"}.fa-gittip:before,.fa-gratipay:before{content:"\f184"}.fa-sun-o:before{content:"\f185"}.fa-moon-o:before{content:"\f186"}.fa-archive:before{content:"\f187"}.fa-bug:before{content:"\f188"}.fa-vk:before{content:"\f189"}.fa-weibo:before{content:"\f18a"}.fa-renren:before{content:"\f18b"}.fa-pagelines:before{content:"\f18c"}.fa-stack-exchange:before{content:"\f18d"}.fa-arrow-circle-o-right:before{content:"\f18e"}.fa-arrow-circle-o-left:before{content:"\f190"}.fa-toggle-left:before,.fa-caret-square-o-left:before{content:"\f191"}.fa-dot-circle-o:before{content:"\f192"}.fa-wheelchair:before{content:"\f193"}.fa-vimeo-square:before{content:"\f194"}.fa-turkish-lira:before,.fa-try:before{content:"\f195"}.fa-plus-square-o:before{content:"\f196"}.fa-space-shuttle:before{content:"\f197"}.fa-slack:before{content:"\f198"}.fa-envelope-square:before{content:"\f199"}.fa-wordpress:before{content:"\f19a"}.fa-openid:before{content:"\f19b"}.fa-institution:before,.fa-bank:before,.fa-university:before{content:"\f19c"}.fa-mortar-board:before,.fa-graduation-cap:before{content:"\f19d"}.fa-yahoo:before{content:"\f19e"}.fa-google:before{content:"\f1a0"}.fa-reddit:before{content:"\f1a1"}.fa-reddit-square:before{content:"\f1a2"}.fa-stumbleupon-circle:before{content:"\f1a3"}.fa-stumbleupon:before{content:"\f1a4"}.fa-delicious:before{content:"\f1a5"}.fa-digg:before{content:"\f1a6"}.fa-pied-piper-pp:before{content:"\f1a7"}.fa-pied-piper-alt:before{content:"\f1a8"}.fa-drupal:before{content:"\f1a9"}.fa-joomla:before{content:"\f1aa"}.fa-language:before{content:"\f1ab"}.fa-fax:before{content:"\f1ac"}.fa-building:before{content:"\f1ad"}.fa-child:before{content:"\f1ae"}.fa-paw:before{content:"\f1b0"}.fa-spoon:before{content:"\f1b1"}.fa-cube:before{content:"\f1b2"}.fa-cubes:before{content:"\f1b3"}.fa-behance:before{content:"\f1b4"}.fa-behance-square:before{content:"\f1b5"}.fa-steam:before{content:"\f1b6"}.fa-steam-square:before{content:"\f1b7"}.fa-recycle:before{content:"\f1b8"}.fa-automobile:before,.fa-car:before{content:"\f1b9"}.fa-cab:before,.fa-taxi:before{content:"\f1ba"}.fa-tree:before{content:"\f1bb"}.fa-spotify:before{content:"\f1bc"}.fa-deviantart:before{content:"\f1bd"}.fa-soundcloud:before{content:"\f1be"}.fa-database:before{content:"\f1c0"}.fa-file-pdf-o:before{content:"\f1c1"}.fa-file-word-o:before{content:"\f1c2"}.fa-file-excel-o:before{content:"\f1c3"}.fa-file-powerpoint-o:before{content:"\f1c4"}.fa-file-photo-o:before,.fa-file-picture-o:before,.fa-file-image-o:before{content:"\f1c5"}.fa-file-zip-o:before,.fa-file-archive-o:before{content:"\f1c6"}.fa-file-sound-o:before,.fa-file-audio-o:before{content:"\f1c7"}.fa-file-movie-o:before,.fa-file-video-o:before{content:"\f1c8"}.fa-file-code-o:before{content:"\f1c9"}.fa-vine:before{content:"\f1ca"}.fa-codepen:before{content:"\f1cb"}.fa-jsfiddle:before{content:"\f1cc"}.fa-life-bouy:before,.fa-life-buoy:before,.fa-life-saver:before,.fa-support:before,.fa-life-ring:before{content:"\f1cd"}.fa-circle-o-notch:before{content:"\f1ce"}.fa-ra:before,.fa-resistance:before,.fa-rebel:before{content:"\f1d0"}.fa-ge:before,.fa-empire:before{content:"\f1d1"}.fa-git-square:before{content:"\f1d2"}.fa-git:before{content:"\f1d3"}.fa-y-combinator-square:before,.fa-yc-square:before,.fa-hacker-news:before{content:"\f1d4"}.fa-tencent-weibo:before{content:"\f1d5"}.fa-qq:before{content:"\f1d6"}.fa-wechat:before,.fa-weixin:before{content:"\f1d7"}.fa-send:before,.fa-paper-plane:before{content:"\f1d8"}.fa-send-o:before,.fa-paper-plane-o:before{content:"\f1d9"}.fa-history:before{content:"\f1da"}.fa-circle-thin:before{content:"\f1db"}.fa-header:before{content:"\f1dc"}.fa-paragraph:before{content:"\f1dd"}.fa-sliders:before{content:"\f1de"}.fa-share-alt:before{content:"\f1e0"}.fa-share-alt-square:before{content:"\f1e1"}.fa-bomb:before{content:"\f1e2"}.fa-soccer-ball-o:before,.fa-futbol-o:before{content:"\f1e3"}.fa-tty:before{content:"\f1e4"}.fa-binoculars:before{content:"\f1e5"}.fa-plug:before{content:"\f1e6"}.fa-slideshare:before{content:"\f1e7"}.fa-twitch:before{content:"\f1e8"}.fa-yelp:before{content:"\f1e9"}.fa-newspaper-o:before{content:"\f1ea"}.fa-wifi:before{content:"\f1eb"}.fa-calculator:before{content:"\f1ec"}.fa-paypal:before{content:"\f1ed"}.fa-google-wallet:before{content:"\f1ee"}.fa-cc-visa:before{content:"\f1f0"}.fa-cc-mastercard:before{content:"\f1f1"}.fa-cc-discover:before{content:"\f1f2"}.fa-cc-amex:before{content:"\f1f3"}.fa-cc-paypal:before{content:"\f1f4"}.fa-cc-stripe:before{content:"\f1f5"}.fa-bell-slash:before{content:"\f1f6"}.fa-bell-slash-o:before{content:"\f1f7"}.fa-trash:before{content:"\f1f8"}.fa-copyright:before{content:"\f1f9"}.fa-at:before{content:"\f1fa"}.fa-eyedropper:before{content:"\f1fb"}.fa-paint-brush:before{content:"\f1fc"}.fa-birthday-cake:before{content:"\f1fd"}.fa-area-chart:before{content:"\f1fe"}.fa-pie-chart:before{content:"\f200"}.fa-line-chart:before{content:"\f201"}.fa-lastfm:before{content:"\f202"}.fa-lastfm-square:before{content:"\f203"}.fa-toggle-off:before{content:"\f204"}.fa-toggle-on:before{content:"\f205"}.fa-bicycle:before{content:"\f206"}.fa-bus:before{content:"\f207"}.fa-ioxhost:before{content:"\f208"}.fa-angellist:before{content:"\f209"}.fa-cc:before{content:"\f20a"}.fa-shekel:before,.fa-sheqel:before,.fa-ils:before{content:"\f20b"}.fa-meanpath:before{content:"\f20c"}.fa-buysellads:before{content:"\f20d"}.fa-connectdevelop:before{content:"\f20e"}.fa-dashcube:before{content:"\f210"}.fa-forumbee:before{content:"\f211"}.fa-leanpub:before{content:"\f212"}.fa-sellsy:before{content:"\f213"}.fa-shirtsinbulk:before{content:"\f214"}.fa-simplybuilt:before{content:"\f215"}.fa-skyatlas:before{content:"\f216"}.fa-cart-plus:before{content:"\f217"}.fa-cart-arrow-down:before{content:"\f218"}.fa-diamond:before{content:"\f219"}.fa-ship:before{content:"\f21a"}.fa-user-secret:before{content:"\f21b"}.fa-motorcycle:before{content:"\f21c"}.fa-street-view:before{content:"\f21d"}.fa-heartbeat:before{content:"\f21e"}.fa-venus:before{content:"\f221"}.fa-mars:before{content:"\f222"}.fa-mercury:before{content:"\f223"}.fa-intersex:before,.fa-transgender:before{content:"\f224"}.fa-transgender-alt:before{content:"\f225"}.fa-venus-double:before{content:"\f226"}.fa-mars-double:before{content:"\f227"}.fa-venus-mars:before{content:"\f228"}.fa-mars-stroke:before{content:"\f229"}.fa-mars-stroke-v:before{content:"\f22a"}.fa-mars-stroke-h:before{content:"\f22b"}.fa-neuter:before{content:"\f22c"}.fa-genderless:before{content:"\f22d"}.fa-facebook-official:before{content:"\f230"}.fa-pinterest-p:before{content:"\f231"}.fa-whatsapp:before{content:"\f232"}.fa-server:before{content:"\f233"}.fa-user-plus:before{content:"\f234"}.fa-user-times:before{content:"\f235"}.fa-hotel:before,.fa-bed:before{content:"\f236"}.fa-viacoin:before{content:"\f237"}.fa-train:before{content:"\f238"}.fa-subway:before{content:"\f239"}.fa-medium:before{content:"\f23a"}.fa-yc:before,.fa-y-combinator:before{content:"\f23b"}.fa-optin-monster:before{content:"\f23c"}.fa-opencart:before{content:"\f23d"}.fa-expeditedssl:before{content:"\f23e"}.fa-battery-4:before,.fa-battery:before,.fa-battery-full:before{content:"\f240"}.fa-battery-3:before,.fa-battery-three-quarters:before{content:"\f241"}.fa-battery-2:before,.fa-battery-half:before{content:"\f242"}.fa-battery-1:before,.fa-battery-quarter:before{content:"\f243"}.fa-battery-0:before,.fa-battery-empty:before{content:"\f244"}.fa-mouse-pointer:before{content:"\f245"}.fa-i-cursor:before{content:"\f246"}.fa-object-group:before{content:"\f247"}.fa-object-ungroup:before{content:"\f248"}.fa-sticky-note:before{content:"\f249"}.fa-sticky-note-o:before{content:"\f24a"}.fa-cc-jcb:before{content:"\f24b"}.fa-cc-diners-club:before{content:"\f24c"}.fa-clone:before{content:"\f24d"}.fa-balance-scale:before{content:"\f24e"}.fa-hourglass-o:before{content:"\f250"}.fa-hourglass-1:before,.fa-hourglass-start:before{content:"\f251"}.fa-hourglass-2:before,.fa-hourglass-half:before{content:"\f252"}.fa-hourglass-3:before,.fa-hourglass-end:before{content:"\f253"}.fa-hourglass:before{content:"\f254"}.fa-hand-grab-o:before,.fa-hand-rock-o:before{content:"\f255"}.fa-hand-stop-o:before,.fa-hand-paper-o:before{content:"\f256"}.fa-hand-scissors-o:before{content:"\f257"}.fa-hand-lizard-o:before{content:"\f258"}.fa-hand-spock-o:before{content:"\f259"}.fa-hand-pointer-o:before{content:"\f25a"}.fa-hand-peace-o:before{content:"\f25b"}.fa-trademark:before{content:"\f25c"}.fa-registered:before{content:"\f25d"}.fa-creative-commons:before{content:"\f25e"}.fa-gg:before{content:"\f260"}.fa-gg-circle:before{content:"\f261"}.fa-tripadvisor:before{content:"\f262"}.fa-odnoklassniki:before{content:"\f263"}.fa-odnoklassniki-square:before{content:"\f264"}.fa-get-pocket:before{content:"\f265"}.fa-wikipedia-w:before{content:"\f266"}.fa-safari:before{content:"\f267"}.fa-chrome:before{content:"\f268"}.fa-firefox:before{content:"\f269"}.fa-opera:before{content:"\f26a"}.fa-internet-explorer:before{content:"\f26b"}.fa-tv:before,.fa-television:before{content:"\f26c"}.fa-contao:before{content:"\f26d"}.fa-500px:before{content:"\f26e"}.fa-amazon:before{content:"\f270"}.fa-calendar-plus-o:before{content:"\f271"}.fa-calendar-minus-o:before{content:"\f272"}.fa-calendar-times-o:before{content:"\f273"}.fa-calendar-check-o:before{content:"\f274"}.fa-industry:before{content:"\f275"}.fa-map-pin:before{content:"\f276"}.fa-map-signs:before{content:"\f277"}.fa-map-o:before{content:"\f278"}.fa-map:before{content:"\f279"}.fa-commenting:before{content:"\f27a"}.fa-commenting-o:before{content:"\f27b"}.fa-houzz:before{content:"\f27c"}.fa-vimeo:before{content:"\f27d"}.fa-black-tie:before{content:"\f27e"}.fa-fonticons:before{content:"\f280"}.fa-reddit-alien:before{content:"\f281"}.fa-edge:before{content:"\f282"}.fa-credit-card-alt:before{content:"\f283"}.fa-codiepie:before{content:"\f284"}.fa-modx:before{content:"\f285"}.fa-fort-awesome:before{content:"\f286"}.fa-usb:before{content:"\f287"}.fa-product-hunt:before{content:"\f288"}.fa-mixcloud:before{content:"\f289"}.fa-scribd:before{content:"\f28a"}.fa-pause-circle:before{content:"\f28b"}.fa-pause-circle-o:before{content:"\f28c"}.fa-stop-circle:before{content:"\f28d"}.fa-stop-circle-o:before{content:"\f28e"}.fa-shopping-bag:before{content:"\f290"}.fa-shopping-basket:before{content:"\f291"}.fa-hashtag:before{content:"\f292"}.fa-bluetooth:before{content:"\f293"}.fa-bluetooth-b:before{content:"\f294"}.fa-percent:before{content:"\f295"}.fa-gitlab:before{content:"\f296"}.fa-wpbeginner:before{content:"\f297"}.fa-wpforms:before{content:"\f298"}.fa-envira:before{content:"\f299"}.fa-universal-access:before{content:"\f29a"}.fa-wheelchair-alt:before{content:"\f29b"}.fa-question-circle-o:before{content:"\f29c"}.fa-blind:before{content:"\f29d"}.fa-audio-description:before{content:"\f29e"}.fa-volume-control-phone:before{content:"\f2a0"}.fa-braille:before{content:"\f2a1"}.fa-assistive-listening-systems:before{content:"\f2a2"}.fa-asl-interpreting:before,.fa-american-sign-language-interpreting:before{content:"\f2a3"}.fa-deafness:before,.fa-hard-of-hearing:before,.fa-deaf:before{content:"\f2a4"}.fa-glide:before{content:"\f2a5"}.fa-glide-g:before{content:"\f2a6"}.fa-signing:before,.fa-sign-language:before{content:"\f2a7"}.fa-low-vision:before{content:"\f2a8"}.fa-viadeo:before{content:"\f2a9"}.fa-viadeo-square:before{content:"\f2aa"}.fa-snapchat:before{content:"\f2ab"}.fa-snapchat-ghost:before{content:"\f2ac"}.fa-snapchat-square:before{content:"\f2ad"}.fa-pied-piper:before{content:"\f2ae"}.fa-first-order:before{content:"\f2b0"}.fa-yoast:before{content:"\f2b1"}.fa-themeisle:before{content:"\f2b2"}.fa-google-plus-circle:before,.fa-google-plus-official:before{content:"\f2b3"}.fa-fa:before,.fa-font-awesome:before{content:"\f2b4"}.fa-handshake-o:before{content:"\f2b5"}.fa-envelope-open:before{content:"\f2b6"}.fa-envelope-open-o:before{content:"\f2b7"}.fa-linode:before{content:"\f2b8"}.fa-address-book:before{content:"\f2b9"}.fa-address-book-o:before{content:"\f2ba"}.fa-vcard:before,.fa-address-card:before{content:"\f2bb"}.fa-vcard-o:before,.fa-address-card-o:before{content:"\f2bc"}.fa-user-circle:before{content:"\f2bd"}.fa-user-circle-o:before{content:"\f2be"}.fa-user-o:before{content:"\f2c0"}.fa-id-badge:before{content:"\f2c1"}.fa-drivers-license:before,.fa-id-card:before{content:"\f2c2"}.fa-drivers-license-o:before,.fa-id-card-o:before{content:"\f2c3"}.fa-quora:before{content:"\f2c4"}.fa-free-code-camp:before{content:"\f2c5"}.fa-telegram:before{content:"\f2c6"}.fa-thermometer-4:before,.fa-thermometer:before,.fa-thermometer-full:before{content:"\f2c7"}.fa-thermometer-3:before,.fa-thermometer-three-quarters:before{content:"\f2c8"}.fa-thermometer-2:before,.fa-thermometer-half:before{content:"\f2c9"}.fa-thermometer-1:before,.fa-thermometer-quarter:before{content:"\f2ca"}.fa-thermometer-0:before,.fa-thermometer-empty:before{content:"\f2cb"}.fa-shower:before{content:"\f2cc"}.fa-bathtub:before,.fa-s15:before,.fa-bath:before{content:"\f2cd"}.fa-podcast:before{content:"\f2ce"}.fa-window-maximize:before{content:"\f2d0"}.fa-window-minimize:before{content:"\f2d1"}.fa-window-restore:before{content:"\f2d2"}.fa-times-rectangle:before,.fa-window-close:before{content:"\f2d3"}.fa-times-rectangle-o:before,.fa-window-close-o:before{content:"\f2d4"}.fa-bandcamp:before{content:"\f2d5"}.fa-grav:before{content:"\f2d6"}.fa-etsy:before{content:"\f2d7"}.fa-imdb:before{content:"\f2d8"}.fa-ravelry:before{content:"\f2d9"}.fa-eercast:before{content:"\f2da"}.fa-microchip:before{content:"\f2db"}.fa-snowflake-o:before{content:"\f2dc"}.fa-superpowers:before{content:"\f2dd"}.fa-wpexplorer:before{content:"\f2de"}.fa-meetup:before{content:"\f2e0"}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);border:0}.sr-only-focusable:active,.sr-only-focusable:focus{position:static;width:auto;height:auto;margin:0;overflow:visible;clip:auto}
================================================
FILE: docs/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: docs/PREFACE.html
================================================
<!DOCTYPE HTML>
<html lang="zh-Hans" class="light" dir="ltr">
<head>
<!-- Book generated using mdBook -->
<meta charset="UTF-8">
<title>前言 - TypeScript 使用指南手册</title>
<!-- Custom HTML head -->
<meta name="description" content="TypeScript Handbook 中文翻译。">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="theme-color" content="#ffffff">
<link rel="icon" href="favicon.svg">
<link rel="shortcut icon" href="favicon.png">
<link rel="stylesheet" href="css/variables.css">
<link rel="stylesheet" href="css/general.css">
<link rel="stylesheet" href="css/chrome.css">
<link rel="stylesheet" href="css/print.css" media="print">
<!-- Fonts -->
<link rel="stylesheet" href="FontAwesome/css/font-awesome.css">
<link rel="stylesheet" href="fonts/fonts.css">
<!-- Highlight.js Stylesheets -->
<link rel="stylesheet" href="highlight.css">
<link rel="stylesheet" href="tomorrow-night.css">
<link rel="stylesheet" href="ayu-highlight.css">
<!-- Custom theme stylesheets -->
</head>
<body class="sidebar-visible no-js">
<div id="body-container">
<!-- Provide site root to javascript -->
<script>
var path_to_root = "";
var default_theme = window.matchMedia("(prefers-color-scheme: dark)").matches ? "navy" : "light";
</script>
<!-- Work around some values being stored in localStorage wrapped in quotes -->
<script>
try {
var theme = localStorage.getItem('mdbook-theme');
var sidebar = localStorage.getItem('mdbook-sidebar');
if (theme.startsWith('"') && theme.endsWith('"')) {
localStorage.setItem('mdbook-theme', theme.slice(1, theme.length - 1));
}
if (sidebar.startsWith('"') && sidebar.endsWith('"')) {
localStorage.setItem('mdbook-sidebar', sidebar.slice(1, sidebar.length - 1));
}
} catch (e) { }
</script>
<!-- Set the theme before any content is loaded, prevents flash -->
<script>
var theme;
try { theme = localStorage.getItem('mdbook-theme'); } catch(e) { }
if (theme === null || theme === undefined) { theme = default_theme; }
var html = document.querySelector('html');
html.classList.remove('light')
html.classList.add(theme);
var body = document.querySelector('body');
body.classList.remove('no-js')
body.classList.add('js');
</script>
<input type="checkbox" id="sidebar-toggle-anchor" class="hidden">
<!-- Hide / unhide sidebar before it is displayed -->
<script>
var body = document.querySelector('body');
var sidebar = null;
var sidebar_toggle = document.getElementById("sidebar-toggle-anchor");
if (document.body.clientWidth >= 1080) {
try { sidebar = localStorage.getItem('mdbook-sidebar'); } catch(e) { }
sidebar = sidebar || 'visible';
} else {
sidebar = 'hidden';
}
sidebar_toggle.checked = sidebar === 'visible';
body.classList.remove('sidebar-visible');
body.classList.add("sidebar-" + sidebar);
</script>
<nav id="sidebar" class="sidebar" aria-label="Table of contents">
<div class="sidebar-scrollbox">
<ol class="chapter"><li class="chapter-item expanded affix "><a href="PREFACE.html" class="active">前言</a></li><li class="chapter-item expanded affix "><li class="part-title">快速上手</li><li class="chapter-item expanded "><a href="zh/tutorials/index.html"><strong aria-hidden="true">1.</strong> 快速上手</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="zh/tutorials/typescript-in-5-minutes.html"><strong aria-hidden="true">1.1.</strong> 5 分钟了解 TypeScript</a></li><li class="chapter-item expanded "><a href="zh/tutorials/asp.net-core.html"><strong aria-hidden="true">1.2.</strong> ASP.NET Core</a></li><li class="chapter-item expanded "><a href="zh/tutorials/asp.net-4.html"><strong aria-hidden="true">1.3.</strong> ASP.NET 4</a></li><li class="chapter-item expanded "><a href="zh/tutorials/gulp.html"><strong aria-hidden="true">1.4.</strong> Gulp</a></li><li class="chapter-item expanded "><a href="zh/tutorials/knockout.html"><strong aria-hidden="true">1.5.</strong> Knockout.js</a></li><li class="chapter-item expanded "><a href="zh/tutorials/react-and-webpack.html"><strong aria-hidden="true">1.6.</strong> React 与 webpack</a></li><li class="chapter-item expanded "><a href="zh/tutorials/react.html"><strong aria-hidden="true">1.7.</strong> React</a></li><li class="chapter-item expanded "><a href="zh/tutorials/angular-2.html"><strong aria-hidden="true">1.8.</strong> Angular 2</a></li><li class="chapter-item expanded "><a href="zh/tutorials/migrating-from-javascript.html"><strong aria-hidden="true">1.9.</strong> 从 JavaScript 迁移到 TypeScript</a></li></ol></li><li class="chapter-item expanded "><li class="part-title">手册</li><li class="chapter-item expanded "><a href="zh/handbook/index.html"><strong aria-hidden="true">2.</strong> 手册</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="zh/handbook/basic-types.html"><strong aria-hidden="true">2.1.</strong> 基础类型</a></li><li class="chapter-item expanded "><a href="zh/handbook/interfaces.html"><strong aria-hidden="true">2.2.</strong> 接口</a></li><li class="chapter-item expanded "><a href="zh/handbook/functions.html"><strong aria-hidden="true">2.3.</strong> 函数</a></li><li class="chapter-item expanded "><a href="zh/handbook/literal-types.html"><strong aria-hidden="true">2.4.</strong> 字面量类型</a></li><li class="chapter-item expanded "><a href="zh/handbook/unions-and-intersections.html"><strong aria-hidden="true">2.5.</strong> 联合类型和交叉类型</a></li><li class="chapter-item expanded "><a href="zh/handbook/classes.html"><strong aria-hidden="true">2.6.</strong> 类</a></li><li class="chapter-item expanded "><a href="zh/handbook/enums.html"><strong aria-hidden="true">2.7.</strong> 枚举</a></li><li class="chapter-item expanded "><a href="zh/handbook/generics.html"><strong aria-hidden="true">2.8.</strong> 泛型</a></li></ol></li><li class="chapter-item expanded "><li class="part-title">手册(进阶)</li><li class="chapter-item expanded "><a href="zh/reference/index.html"><strong aria-hidden="true">3.</strong> 手册(进阶)</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="zh/reference/advanced-types.html"><strong aria-hidden="true">3.1.</strong> 高级类型</a></li><li class="chapter-item expanded "><a href="zh/reference/utility-types.html"><strong aria-hidden="true">3.2.</strong> 实用工具类型</a></li><li class="chapter-item expanded "><a href="zh/reference/decorators.html"><strong aria-hidden="true">3.3.</strong> Decorators</a></li><li class="chapter-item expanded "><a href="zh/reference/declaration-merging.html"><strong aria-hidden="true">3.4.</strong> 声明合并</a></li><li class="chapter-item expanded "><a href="zh/reference/iterators-and-generators.html"><strong aria-hidden="true">3.5.</strong> Iterators 和 Generators</a></li><li class="chapter-item expanded "><a href="zh/reference/jsx.html"><strong aria-hidden="true">3.6.</strong> JSX</a></li><li class="chapter-item expanded "><a href="zh/reference/mixins.html"><strong aria-hidden="true">3.7.</strong> 混入</a></li><li class="chapter-item expanded "><a href="zh/reference/modules.html"><strong aria-hidden="true">3.8.</strong> 模块</a></li><li class="chapter-item expanded "><a href="zh/reference/module-resolution.html"><strong aria-hidden="true">3.9.</strong> 模块解析</a></li><li class="chapter-item expanded "><a href="zh/reference/namespaces.html"><strong aria-hidden="true">3.10.</strong> 命名空间</a></li><li class="chapter-item expanded "><a href="zh/reference/namespaces-and-modules.html"><strong aria-hidden="true">3.11.</strong> 命名空间和模块</a></li><li class="chapter-item expanded "><a href="zh/reference/symbols.html"><strong aria-hidden="true">3.12.</strong> Symbols</a></li><li class="chapter-item expanded "><a href="zh/reference/triple-slash-directives.html"><strong aria-hidden="true">3.13.</strong> 三斜线指令</a></li><li class="chapter-item expanded "><a href="zh/reference/type-compatibility.html"><strong aria-hidden="true">3.14.</strong> 类型兼容性</a></li><li class="chapter-item expanded "><a href="zh/reference/type-inference.html"><strong aria-hidden="true">3.15.</strong> 类型推论</a></li><li class="chapter-item expanded "><a href="zh/reference/variable-declarations.html"><strong aria-hidden="true">3.16.</strong> 变量声明</a></li></ol></li><li class="chapter-item expanded "><li class="part-title">手册(v2)</li><li class="chapter-item expanded "><a href="zh/handbook-v2/index.html"><strong aria-hidden="true">4.</strong> 手册(v2)</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="zh/handbook-v2/type-manipulation/template-literal-types.html"><strong aria-hidden="true">4.1.</strong> 模版字面量类型</a></li></ol></li><li class="chapter-item expanded "><li class="part-title">TypeScript 声明文件(.d.ts)</li><li class="chapter-item expanded "><a href="zh/declaration-files/index.html"><strong aria-hidden="true">5.</strong> 如何书写声明文件</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="zh/declaration-files/introduction.html"><strong aria-hidden="true">5.1.</strong> 介绍</a></li><li class="chapter-item expanded "><a href="zh/declaration-files/by-example.html"><strong aria-hidden="true">5.2.</strong> 举例</a></li><li class="chapter-item expanded "><a href="zh/declaration-files/library-structures.html"><strong aria-hidden="true">5.3.</strong> 库结构</a></li><li class="chapter-item expanded "><a href="zh/declaration-files/templates.html"><strong aria-hidden="true">5.4.</strong> 模板</a></li><li class="chapter-item expanded "><a href="zh/declaration-files/do-s-and-don-ts.html"><strong aria-hidden="true">5.5.</strong> 最佳实践</a></li><li class="chapter-item expanded "><a href="zh/declaration-files/deep-dive.html"><strong aria-hidden="true">5.6.</strong> 深入</a></li><li class="chapter-item expanded "><a href="zh/declaration-files/publishing.html"><strong aria-hidden="true">5.7.</strong> 发布</a></li><li class="chapter-item expanded "><a href="zh/declaration-files/consumption.html"><strong aria-hidden="true">5.8.</strong> 使用</a></li></ol></li><li class="chapter-item expanded "><li class="part-title">TypeScript for JavaScript</li><li class="chapter-item expanded "><a href="zh/javascript/type-checking-javascript-files.html"><strong aria-hidden="true">6.</strong> JavaScript 文件里的类型检查</a></li><li class="chapter-item expanded affix "><li class="part-title">工程配置</li><li class="chapter-item expanded "><a href="zh/project-config/index.html"><strong aria-hidden="true">7.</strong> 工程配置</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="zh/project-config/tsconfig.json.html"><strong aria-hidden="true">7.1.</strong> tsconfig.json</a></li><li class="chapter-item expanded "><a href="zh/project-config/project-references.html"><strong aria-hidden="true">7.2.</strong> 工程引用</a></li><li class="chapter-item expanded "><a href="zh/project-config/typings-for-npm-packages.html"><strong aria-hidden="true">7.3.</strong> NPM 包的类型</a></li><li class="chapter-item expanded "><a href="zh/project-config/compiler-options.html"><strong aria-hidden="true">7.4.</strong> 编译选项</a></li><li class="chapter-item expanded "><a href="zh/project-config/configuring-watch.html"><strong aria-hidden="true">7.5.</strong> 配置 Watch</a></li><li class="chapter-item expanded "><a href="zh/project-config/compiler-options-in-msbuild.html"><strong aria-hidden="true">7.6.</strong> 在 MSBuild 里使用编译选项</a></li><li class="chapter-item expanded "><a href="zh/project-config/integrating-with-build-tools.html"><strong aria-hidden="true">7.7.</strong> 与其它构建工具整合</a></li><li class="chapter-item expanded "><a href="zh/project-config/nightly-builds.html"><strong aria-hidden="true">7.8.</strong> 使用 TypeScript 的每日构建版本</a></li></ol></li><li class="chapter-item expanded "><li class="part-title">版本发布说明(Release Notes)</li><li class="chapter-item expanded "><a href="zh/release-notes/index.html"><strong aria-hidden="true">8.</strong> 新增功能</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="zh/release-notes/typescript-5.4.html"><strong aria-hidden="true">8.1.</strong> TypeScript 5.4</a></li><li class="chapter-item expanded "><a href="zh/release-notes/typescript-5.3.html"><strong aria-hidden="true">8.2.</strong> TypeScript 5.3</a></li><li class="chapter-item expanded "><a href="zh/release-notes/typescript-5.2.html"><strong aria-hidden="true">8.3.</strong> TypeScript 5.2</a></li><li class="chapter-item expanded "><a href="zh/release-notes/typescript-5.1.html"><strong aria-hidden="true">8.4.</strong> TypeScript 5.1</a></li><li class="chapter-item expanded "><a href="zh/release-notes/typescript-5.0.html"><strong aria-hidden="true">8.5.</strong> TypeScript 5.0</a></li><li class="chapter-item expanded "><a href="zh/release-notes/typescript-4.9.html"><strong aria-hidden="true">8.6.</strong> TypeScript 4.9</a></li><li class="chapter-item expanded "><a href="zh/release-notes/typescript-4.8.html"><strong aria-hidden="true">8.7.</strong> TypeScript 4.8</a></li><li class="chapter-item expanded "><a href="zh/release-notes/typescript-4.7.html"><strong aria-hidden="true">8.8.</strong> TypeScript 4.7</a></li><li class="chapter-item expanded "><a href="zh/release-notes/typescript-4.6.html"><strong aria-hidden="true">8.9.</strong> TypeScript 4.6</a></li><li class="chapter-item expanded "><a href="zh/release-notes/typescript-4.5.html"><strong aria-hidden="true">8.10.</strong> TypeScript 4.5</a></li><li class="chapter-item expanded "><a href="zh/release-notes/typescript-4.4.html"><strong aria-hidden="true">8.11.</strong> TypeScript 4.4</a></li><li class="chapter-item expanded "><a href="zh/release-notes/typescript-4.3.html"><strong aria-hidden="true">8.12.</strong> TypeScript 4.3</a></li><li class="chapter-item expanded "><a href="zh/release-notes/typescript-4.2.html"><strong aria-hidden="true">8.13.</strong> TypeScript 4.2</a></li><li class="chapter-item expanded "><a href="zh/release-notes/typescript-4.1.html"><strong aria-hidden="true">8.14.</strong> TypeScript 4.1</a></li><li class="chapter-item expanded "><a href="zh/release-notes/typescript-4.0.html"><strong aria-hidden="true">8.15.</strong> TypeScript 4.0</a></li><li class="chapter-item expanded "><a href="zh/release-notes/typescript-3.9.html"><strong aria-hidden="true">8.16.</strong> TypeScript 3.9</a></li><li class="chapter-item expanded "><a href="zh/release-notes/typescript-3.8.html"><strong aria-hidden="true">8.17.</strong> TypeScript 3.8</a></li><li class="chapter-item expanded "><a href="zh/release-notes/typescript-3.7.html"><strong aria-hidden="true">8.18.</strong> TypeScript 3.7</a></li><li class="chapter-item expanded "><a href="zh/release-notes/typescript-3.6.html"><strong aria-hidden="true">8.19.</strong> TypeScript 3.6</a></li><li class="chapter-item expanded "><a href="zh/release-notes/typescript-3.5.html"><strong aria-hidden="true">8.20.</strong> TypeScript 3.5</a></li><li class="chapter-item expanded "><a href="zh/release-notes/typescript-3.4.html"><strong aria-hidden="true">8.21.</strong> TypeScript 3.4</a></li><li class="chapter-item expanded "><a href="zh/release-notes/typescript-3.3.html"><strong aria-hidden="true">8.22.</strong> TypeScript 3.3</a></li><li class="chapter-item expanded "><a href="zh/release-notes/typescript-3.2.html"><strong aria-hidden="true">8.23.</strong> TypeScript 3.2</a></li><li class="chapter-item expanded "><a href="zh/release-notes/typescript-3.1.html"><strong aria-hidden="true">8.24.</strong> TypeScript 3.1</a></li><li class="chapter-item expanded "><a href="zh/release-notes/typescript-3.0.html"><strong aria-hidden="true">8.25.</strong> TypeScript 3.0</a></li><li class="chapter-item expanded "><a href="zh/release-notes/typescript-2.9.html"><strong aria-hidden="true">8.26.</strong> TypeScript 2.9</a></li><li class="chapter-item expanded "><a href="zh/release-notes/typescript-2.8.html"><strong aria-hidden="true">8.27.</strong> TypeScript 2.8</a></li><li class="chapter-item expanded "><a href="zh/release-notes/typescript-2.7.html"><strong aria-hidden="true">8.28.</strong> TypeScript 2.7</a></li><li class="chapter-item expanded "><a href="zh/release-notes/typescript-2.6.html"><strong aria-hidden="true">8.29.</strong> TypeScript 2.6</a></li><li class="chapter-item expanded "><a href="zh/release-notes/typescript-2.5.html"><strong aria-hidden="true">8.30.</strong> TypeScript 2.5</a></li><li class="chapter-item expanded "><a href="zh/release-notes/typescript-2.4.html"><strong aria-hidden="true">8.31.</strong> TypeScript 2.4</a></li><li class="chapter-item expanded "><a href="zh/release-notes/typescript-2.3.html"><strong aria-hidden="true">8.32.</strong> TypeScript 2.3</a></li><li class="chapter-item expanded "><a href="zh/release-notes/typescript-2.2.html"><strong aria-hidden="true">8.33.</strong> TypeScript 2.2</a></li><li class="chapter-item expanded "><a href="zh/release-notes/typescript-2.1.html"><strong aria-hidden="true">8.34.</strong> TypeScript 2.1</a></li><li class="chapter-item expanded "><a href="zh/release-notes/typescript-2.0.html"><strong aria-hidden="true">8.35.</strong> TypeScript 2.0</a></li><li class="chapter-item expanded "><a href="zh/release-notes/typescript-1.8.html"><strong aria-hidden="true">8.36.</strong> TypeScript 1.8</a></li><li class="chapter-item expanded "><a href="zh/release-notes/typescript-1.7.html"><strong aria-hidden="true">8.37.</strong> TypeScript 1.7</a></li><li class="chapter-item expanded "><a href="zh/release-notes/typescript-1.6.html"><strong aria-hidden="true">8.38.</strong> TypeScript 1.6</a></li><li class="chapter-item expanded "><a href="zh/release-notes/typescript-1.5.html"><strong aria-hidden="true">8.39.</strong> TypeScript 1.5</a></li><li class="chapter-item expanded "><a href="zh/release-notes/typescript-1.4.html"><strong aria-hidden="true">8.40.</strong> TypeScript 1.4</a></li><li class="chapter-item expanded "><a href="zh/release-notes/typescript-1.3.html"><strong aria-hidden="true">8.41.</strong> TypeScript 1.3</a></li><li class="chapter-item expanded "><a href="zh/release-notes/typescript-1.1.html"><strong aria-hidden="true">8.42.</strong> TypeScript 1.1</a></li></ol></li><li class="chapter-item expanded "><li class="part-title">破坏性改动(Breaking Changes)</li><li class="chapter-item expanded "><a href="zh/breaking-changes/index.html"><strong aria-hidden="true">9.</strong> Breaking Changes</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="zh/breaking-changes/typescript-3.6.html"><strong aria-hidden="true">9.1.</strong> TypeScript 3.6</a></li><li class="chapter-item expanded "><a href="zh/breaking-changes/typescript-3.5.html"><strong aria-hidden="true">9.2.</strong> TypeScript 3.5</a></li><li class="chapter-item expanded "><a href="zh/breaking-changes/typescript-3.4.html"><strong aria-hidden="true">9.3.</strong> TypeScript 3.4</a></li><li class="chapter-item expanded "><a href="zh/breaking-changes/typescript-3.2.html"><strong aria-hidden="true">9.4.</strong> TypeScript 3.2</a></li><li class="chapter-item expanded "><a href="zh/breaking-changes/typescript-3.1.html"><strong aria-hidden="true">9.5.</strong> TypeScript 3.1</a></li><li class="chapter-item expanded "><a href="zh/breaking-changes/typescript-3.0.html"><strong aria-hidden="true">9.6.</strong> TypeScript 3.0</a></li><li class="chapter-item expanded "><a href="zh/breaking-changes/typescript-2.9.html"><strong aria-hidden="true">9.7.</strong> TypeScript 2.9</a></li><li class="chapter-item expanded "><a href="zh/breaking-changes/typescript-2.8.html"><strong aria-hidden="true">9.8.</strong> TypeScript 2.8</a></li><li class="chapter-item expanded "><a href="zh/breaking-changes/typescript-2.7.html"><strong aria-hidden="true">9.9.</strong> TypeScript 2.7</a></li><li class="chapter-item expanded "><a href="zh/breaking-changes/typescript-2.6.html"><strong aria-hidden="true">9.10.</strong> TypeScript 2.6</a></li><li class="chapter-item expanded "><a href="zh/breaking-changes/typescript-2.4.html"><strong aria-hidden="true">9.11.</strong> TypeScript 2.4</a></li><li class="chapter-item expanded "><a href="zh/breaking-changes/typescript-2.3.html"><strong aria-hidden="true">9.12.</strong> TypeScript 2.3</a></li><li class="chapter-item expanded "><a href="zh/breaking-changes/typescript-2.2.html"><strong aria-hidden="true">9.13.</strong> TypeScript 2.2</a></li><li class="chapter-item expanded "><a href="zh/breaking-changes/typescript-2.1.html"><strong aria-hidden="true">9.14.</strong> TypeScript 2.1</a></li><li class="chapter-item expanded "><a href="zh/breaking-changes/typescript-2.0.html"><strong aria-hidden="true">9.15.</strong> TypeScript 2.0</a></li><li class="chapter-item expanded "><a href="zh/breaking-changes/typescript-1.8.html"><strong aria-hidden="true">9.16.</strong> TypeScript 1.8</a></li><li class="chapter-item expanded "><a href="zh/breaking-changes/typescript-1.7.html"><strong aria-hidden="true">9.17.</strong> TypeScript 1.7</a></li><li class="chapter-item expanded "><a href="zh/breaking-changes/typescript-1.6.html"><strong aria-hidden="true">9.18.</strong> TypeScript 1.6</a></li><li class="chapter-item expanded "><a href="zh/breaking-changes/typescript-1.5.html"><strong aria-hidden="true">9.19.</strong> TypeScript 1.5</a></li><li class="chapter-item expanded "><a href="zh/breaking-changes/typescript-1.4.html"><strong aria-hidden="true">9.20.</strong> TypeScript 1.4</a></li></ol></li></ol>
</div>
<div id="sidebar-resize-handle" class="sidebar-resize-handle">
<div class="sidebar-resize-indicator"></div>
</div>
</nav>
<!-- Track and set sidebar scroll position -->
<script>
var sidebarScrollbox = document.querySelector('#sidebar .sidebar-scrollbox');
sidebarScrollbox.addEventListener('click', function(e) {
if (e.target.tagName === 'A') {
sessionStorage.setItem('sidebar-scroll', sidebarScrollbox.scrollTop);
}
}, { passive: true });
var sidebarScrollTop = sessionStorage.getItem('sidebar-scroll');
sessionStorage.removeItem('sidebar-scroll');
if (sidebarScrollTop) {
// preserve sidebar scroll position when navigating via links within sidebar
sidebarScrollbox.scrollTop = sidebarScrollTop;
} else {
// scroll sidebar to current active section when navigating via "next/previous chapter" buttons
var activeSection = document.querySelector('#sidebar .active');
if (activeSection) {
activeSection.scrollIntoView({ block: 'center' });
}
}
</script>
<div id="page-wrapper" class="page-wrapper">
<div class="page">
<div id="menu-bar-hover-placeholder"></div>
<div id="menu-bar" class="menu-bar sticky">
<div class="left-buttons">
<label id="sidebar-toggle" class="icon-button" for="sidebar-toggle-anchor" title="Toggle Table of Contents" aria-label="Toggle Table of Contents" aria-controls="sidebar">
<i class="fa fa-bars"></i>
</label>
<button id="theme-toggle" class="icon-button" type="button" title="Change theme" aria-label="Change theme" aria-haspopup="true" aria-expanded="false" aria-controls="theme-list">
<i class="fa fa-paint-brush"></i>
</button>
<ul id="theme-list" class="theme-popup" aria-label="Themes" role="menu">
<li role="none"><button role="menuitem" class="theme" id="light">Light</button></li>
<li role="none"><button role="menuitem" class="theme" id="rust">Rust</button></li>
<li role="none"><button role="menuitem" class="theme" id="coal">Coal</button></li>
<li role="none"><button role="menuitem" class="theme" id="navy">Navy</button></li>
<li role="none"><button role="menuitem" class="theme" id="ayu">Ayu</button></li>
</ul>
<button id="search-toggle" class="icon-button" type="button" title="Search. (Shortkey: s)" aria-label="Toggle Searchbar" aria-expanded="false" aria-keyshortcuts="S" aria-controls="searchbar">
<i class="fa fa-search"></i>
</button>
</div>
<h1 class="menu-title">TypeScript 使用指南手册</h1>
<div class="right-buttons">
<a href="print.html" title="Print this book" aria-label="Print this book">
<i id="print-button" class="fa fa-print"></i>
</a>
</div>
</div>
<div id="search-wrapper" class="hidden">
<form id="searchbar-outer" class="searchbar-outer">
<input type="search" id="searchbar" name="searchbar" placeholder="Search this book ..." aria-controls="searchresults-outer" aria-describedby="searchresults-header">
</form>
<div id="searchresults-outer" class="searchresults-outer hidden">
<div id="searchresults-header" class="searchresults-header"></div>
<ul id="searchresults">
</ul>
</div>
</div>
<!-- Apply ARIA attributes after the sidebar and the sidebar toggle button are added to the DOM -->
<script>
document.getElementById('sidebar-toggle').setAttribute('aria-expanded', sidebar === 'visible');
document.getElementById('sidebar').setAttribute('aria-hidden', sidebar !== 'visible');
Array.from(document.querySelectorAll('#sidebar a')).forEach(function(link) {
link.setAttribute('tabIndex', sidebar === 'visible' ? 0 : -1);
});
</script>
<div id="content" class="content">
<main>
<h1 id="前言"><a class="header" href="#前言">前言</a></h1>
<blockquote>
<p>Repo: https://github.com/zhongsp/TypeScript</p>
</blockquote>
<p>该工程是对 TypeScript 官方及开源社区书写的编程手册、版本发布说明等综合内容的中文翻译。
感谢 Microsoft 和开源社区的工程师们的工作,为 JavaScript 开发带来了全新的体验!</p>
<p>这个项目是我在 2015 年创建的,没想到已经维护快 7 年了,它已然是我参与过的时间最长的项目。
在 2015 年之前,我都是在使用 JavaScript 语言,主要参与的项目也大都是采用 AngularJS 框架的项目,没有接触过 TypeScript。
那时候,TypeScript 在国内项目里用的好像不多,但是在国外已经有不少项目开始采用这个新技术。
2015 年,我正好参与了一个和国外一起合作的项目,决定使用 TypeScript 1.x。
也正因为这个机会,我开始了 TypeScript 的学习。
学习没多久,我就喜欢上了这个语言,并且确信这个东西一定能火。
因为作为一个多年的 JavaScript 程序员来讲,我很清楚它解决了多少痛点(必须得把 VS Code 一起代上)。</p>
<p>早些时候,TypeScript 的文档也不多。
原因之一,TypeScript 是 JavaScript 的超集,JavaScript 的知识点已经有足够的资料了,TypeScript 一笔代过。
原因之二,早期的 TypeScript 里特性不多,知识点不多。原因之三,它的文档相较于做的好的语言来讲确实较弱,可能没什么专门的团队负责,或者没有专职的 technical writer 去写作。
于是,我决定边学边翻译,一方面为了自己,另一方面为了其它小伙伴。</p>
<h2 id="哪些内容会继续更新"><a class="header" href="#哪些内容会继续更新">哪些内容会继续更新?</a></h2>
<p>我会继续翻译 TypeScript 新版本的 Release Notes。</p>
<h2 id="哪些内容可能不会继续更新"><a class="header" href="#哪些内容可能不会继续更新">哪些内容可能不会继续更新?</a></h2>
<p>这个项目中的 Handbook 是翻译老版本的 Handbook。
TypeScript 官网大约从 2020 年开始要打造新版的官网,其中包括官网的样式,以及要重写大部分的文档。
目前,我不打算再翻译一遍新版的 Handbook。
我看了下新版的手册,确实优化了不少,但也不代表老版本是无用的或错误的。</p>
<p>现在,TypeScript 官网也开始支持国际化了,已经有部分文档翻译成了中文,我之前还翻译了一篇。
本着开源和为社区服务的精神,推荐学有余力的同学直接给官网提交翻译的 Pull Reuqest,造福开发者。</p>
<h2 id="关于typescript入门与实战一书"><a class="header" href="#关于typescript入门与实战一书">关于《TypeScript入门与实战》一书</a></h2>
<p>因为长期维护 TypeScript 更新的内容再加上在项目中一直使用 TypeScript,
所以有机会将知识进行梳理总结成书。</p>
<p>我出版了《TypeScript入门与实战》一书。</p>
<p><a href="https://github.com/zhongsp/TypeScript/issues/310"><img src="./zh/misc/ts-intro.png" alt="TypeScript入门与实战" width="200px" height="200px" style="vertical-align: bottom;"></a></p>
<p>在该书中,尝试着尽可能完整地介绍TypeScript语言的基础知识,并结合了一些本人的使用经验和体会。
它主要面向的是TypeScript语言的初级和中级使用者。
本人还处于TypeScript语言的学习阶段,可能存在理解错误的地方,还请大家指正,一起进步。
但需要强调的是,本书不是对 Handbook 的翻译。</p>
<h2 id="感谢"><a class="header" href="#感谢">感谢</a></h2>
<p>在过去的七年中,有很多素不相识、极富开源精神的小伙伴们曾参与到本工程的翻译与校对工作中。
对你们表示感谢!同时也欢迎其它任何想参与到该工程中的朋友们,贡献你们的力量!</p>
</main>
<nav class="nav-wrapper" aria-label="Page navigation">
<!-- Mobile navigation buttons -->
<a rel="next prefetch" href="zh/tutorials/index.html" class="mobile-nav-chapters next" title="Next chapter" aria-label="Next chapter" aria-keyshortcuts="Right">
<i class="fa fa-angle-right"></i>
</a>
<div style="clear: both"></div>
</nav>
</div>
</div>
<nav class="nav-wide-wrapper" aria-label="Page navigation">
<a rel="next prefetch" href="zh/tutorials/index.html" class="nav-chapters next" title="Next chapter" aria-label="Next chapter" aria-keyshortcuts="Right">
<i class="fa fa-angle-right"></i>
</a>
</nav>
</div>
<script>
window.playground_copyable = true;
</script>
<script src="elasticlunr.min.js"></script>
<script src="mark.min.js"></script>
<script src="searcher.js"></script>
<script src="clipboard.min.js"></script>
<script src="highlight.js"></script>
<script src="book.js"></script>
<!-- Custom JS scripts -->
</div>
</body>
</html>
================================================
FILE: docs/ayu-highlight.css
================================================
/*
Based off of the Ayu theme
Original by Dempfi (https://github.com/dempfi/ayu)
*/
.hljs {
display: block;
overflow-x: auto;
background: #191f26;
color: #e6e1cf;
}
.hljs-comment,
.hljs-quote {
color: #5c6773;
font-style: italic;
}
.hljs-variable,
.hljs-template-variable,
.hljs-attribute,
.hljs-attr,
.hljs-regexp,
.hljs-link,
.hljs-selector-id,
.hljs-selector-class {
color: #ff7733;
}
.hljs-number,
.hljs-meta,
.hljs-builtin-name,
.hljs-literal,
.hljs-type,
.hljs-params {
color: #ffee99;
}
.hljs-string,
.hljs-bullet {
color: #b8cc52;
}
.hljs-title,
.hljs-built_in,
.hljs-section {
color: #ffb454;
}
.hljs-keyword,
.hljs-selector-tag,
.hljs-symbol {
color: #ff7733;
}
.hljs-name {
color: #36a3d9;
}
.hljs-tag {
color: #00568d;
}
.hljs-emphasis {
font-style: italic;
}
.hljs-strong {
font-weight: bold;
}
.hljs-addition {
color: #91b362;
}
.hljs-deletion {
color: #d96c75;
}
================================================
FILE: docs/book.js
================================================
"use strict";
// Fix back button cache problem
window.onunload = function () { };
// Global variable, shared between modules
function playground_text(playground, hidden = true) {
let code_block = playground.querySelector("code");
if (window.ace && code_block.classList.contains("editable")) {
let editor = window.ace.edit(code_block);
return editor.getValue();
} else if (hidden) {
return code_block.textContent;
} else {
return code_block.innerText;
}
}
(function codeSnippets() {
function fetch_with_timeout(url, options, timeout = 6000) {
return Promise.race([
fetch(url, options),
new Promise((_, reject) => setTimeout(() => reject(new Error('timeout')), timeout))
]);
}
var playgrounds = Array.from(document.querySelectorAll(".playground"));
if (playgrounds.length > 0) {
fetch_with_timeout("https://play.rust-lang.org/meta/crates", {
headers: {
'Content-Type': "application/json",
},
method: 'POST',
mode: 'cors',
})
.then(response => response.json())
.then(response => {
// get list of crates available in the rust playground
let playground_crates = response.crates.map(item => item["id"]);
playgrounds.forEach(block => handle_crate_list_update(block, playground_crates));
});
}
function handle_crate_list_update(playground_block, playground_crates) {
// update the play buttons after receiving the response
update_play_button(playground_block, playground_crates);
// and install on change listener to dynamically update ACE editors
if (window.ace) {
let code_block = playground_block.querySelector("code");
if (code_block.classList.contains("editable")) {
let editor = window.ace.edit(code_block);
editor.addEventListener("change", function (e) {
update_play_button(playground_block, playground_crates);
});
// add Ctrl-Enter command to execute rust code
editor.commands.addCommand({
name: "run",
bindKey: {
win: "Ctrl-Enter",
mac: "Ctrl-Enter"
},
exec: _editor => run_rust_code(playground_block)
});
}
}
}
// updates the visibility of play button based on `no_run` class and
// used crates vs ones available on https://play.rust-lang.org
function update_play_button(pre_block, playground_crates) {
var play_button = pre_block.querySelector(".play-button");
// skip if code is `no_run`
if (pre_block.querySelector('code').classList.contains("no_run")) {
play_button.classList.add("hidden");
return;
}
// get list of `extern crate`'s from snippet
var txt = playground_text(pre_block);
var re = /extern\s+crate\s+([a-zA-Z_0-9]+)\s*;/g;
var snippet_crates = [];
var item;
while (item = re.exec(txt)) {
snippet_crates.push(item[1]);
}
// check if all used crates are available on play.rust-lang.org
var all_available = snippet_crates.every(function (elem) {
return playground_crates.indexOf(elem) > -1;
});
if (all_available) {
play_button.classList.remove("hidden");
} else {
play_button.classList.add("hidden");
}
}
function run_rust_code(code_block) {
var result_block = code_block.querySelector(".result");
if (!result_block) {
result_block = document.createElement('code');
result_block.className = 'result hljs language-bash';
code_block.append(result_block);
}
let text = playground_text(code_block);
let classes = code_block.querySelector('code').classList;
let edition = "2015";
if(classes.contains("edition2018")) {
edition = "2018";
} else if(classes.contains("edition2021")) {
edition = "2021";
}
var params = {
version: "stable",
optimize: "0",
code: text,
edition: edition
};
if (text.indexOf("#![feature") !== -1) {
params.version = "nightly";
}
result_block.innerText = "Running...";
fetch_with_timeout("https://play.rust-lang.org/evaluate.json", {
headers: {
'Content-Type': "application/json",
},
method: 'POST',
mode: 'cors',
body: JSON.stringify(params)
})
.then(response => response.json())
.then(response => {
if (response.result.trim() === '') {
result_block.innerText = "No output";
result_block.classList.add("result-no-output");
} else {
result_block.innerText = response.result;
result_block.classList.remove("result-no-output");
}
})
.catch(error => result_block.innerText = "Playground Communication: " + error.message);
}
// Syntax highlighting Configuration
hljs.configure({
tabReplace: ' ', // 4 spaces
languages: [], // Languages used for auto-detection
});
let code_nodes = Array
.from(document.querySelectorAll('code'))
// Don't highlight `inline code` blocks in headers.
.filter(function (node) {return !node.parentElement.classList.contains("header"); });
if (window.ace) {
// language-rust class needs to be removed for editable
// blocks or highlightjs will capture events
code_nodes
.filter(function (node) {return node.classList.contains("editable"); })
.forEach(function (block) { block.classList.remove('language-rust'); });
code_nodes
.filter(function (node) {return !node.classList.contains("editable"); })
.forEach(function (block) { hljs.highlightBlock(block); });
} else {
code_nodes.forEach(function (block) { hljs.highlightBlock(block); });
}
// Adding the hljs class gives code blocks the color css
// even if highlighting doesn't apply
code_nodes.forEach(function (block) { block.classList.add('hljs'); });
Array.from(document.querySelectorAll("code.hljs")).forEach(function (block) {
var lines = Array.from(block.querySelectorAll('.boring'));
// If no lines were hidden, return
if (!lines.length) { return; }
block.classList.add("hide-boring");
var buttons = document.createElement('div');
buttons.className = 'buttons';
buttons.innerHTML = "<button class=\"fa fa-eye\" title=\"Show hidden lines\" aria-label=\"Show hidden lines\"></button>";
// add expand button
var pre_block = block.parentNode;
pre_block.insertBefore(buttons, pre_block.firstChild);
pre_block.querySelector('.buttons').addEventListener('click', function (e) {
if (e.target.classList.contains('fa-eye')) {
e.target.classList.remove('fa-eye');
e.target.classList.add('fa-eye-slash');
e.target.title = 'Hide lines';
e.target.setAttribute('aria-label', e.target.title);
block.classList.remove('hide-boring');
} else if (e.target.classList.contains('fa-eye-slash')) {
e.target.classList.remove('fa-eye-slash');
e.target.classList.add('fa-eye');
e.target.title = 'Show hidden lines';
e.target.setAttribute('aria-label', e.target.title);
block.classList.add('hide-boring');
}
});
});
if (window.playground_copyable) {
Array.from(document.querySelectorAll('pre code')).forEach(function (block) {
var pre_block = block.parentNode;
if (!pre_block.classList.contains('playground')) {
var buttons = pre_block.querySelector(".buttons");
if (!buttons) {
buttons = document.createElement('div');
buttons.className = 'buttons';
pre_block.insertBefore(buttons, pre_block.firstChild);
}
var clipButton = document.createElement('button');
clipButton.className = 'fa fa-copy clip-button';
clipButton.title = 'Copy to clipboard';
clipButton.setAttribute('aria-label', clipButton.title);
clipButton.innerHTML = '<i class=\"tooltiptext\"></i>';
buttons.insertBefore(clipButton, buttons.firstChild);
}
});
}
// Process playground code blocks
Array.from(document.querySelectorAll(".playground")).forEach(function (pre_block) {
// Add play button
var buttons = pre_block.querySelector(".buttons");
if (!buttons) {
buttons = document.createElement('div');
buttons.className = 'buttons';
pre_block.insertBefore(buttons, pre_block.firstChild);
}
var runCodeButton = document.createElement('button');
runCodeButton.className = 'fa fa-play play-button';
runCodeButton.hidden = true;
runCodeButton.title = 'Run this code';
runCodeButton.setAttribute('aria-label', runCodeButton.title);
buttons.insertBefore(runCodeButton, buttons.firstChild);
runCodeButton.addEventListener('click', function (e) {
run_rust_code(pre_block);
});
if (window.playground_copyable) {
var copyCodeClipboardButton = document.createElement('button');
copyCodeClipboardButton.className = 'fa fa-copy clip-button';
copyCodeClipboardButton.innerHTML = '<i class="tooltiptext"></i>';
copyCodeClipboardButton.title = 'Copy to clipboard';
copyCodeClipboardButton.setAttribute('aria-label', copyCodeClipboardButton.title);
buttons.insertBefore(copyCodeClipboardButton, buttons.firstChild);
}
let code_block = pre_block.querySelector("code");
if (window.ace && code_block.classList.contains("editable")) {
var undoChangesButton = document.createElement('button');
undoChangesButton.className = 'fa fa-history reset-button';
undoChangesButton.title = 'Undo changes';
undoChangesButton.setAttribute('aria-label', undoChangesButton.title);
buttons.insertBefore(undoChangesButton, buttons.firstChild);
undoChangesButton.addEventListener('click', function () {
let editor = window.ace.edit(code_block);
editor.setValue(editor.originalCode);
editor.clearSelection();
});
}
});
})();
(function themes() {
var html = document.querySelector('html');
var themeToggleButton = document.getElementById('theme-toggle');
var themePopup = document.getElementById('theme-list');
var themeColorMetaTag = document.querySelector('meta[name="theme-color"]');
var stylesheets = {
ayuHighlight: document.querySelector("[href$='ayu-highlight.css']"),
tomorrowNight: document.querySelector("[href$='tomorrow-night.css']"),
highlight: document.querySelector("[href$='highlight.css']"),
};
function showThemes() {
themePopup.style.display = 'block';
themeToggleButton.setAttribute('aria-expanded', true);
themePopup.querySelector("button#" + get_theme()).focus();
}
function updateThemeSelected() {
themePopup.querySelectorAll('.theme-selected').forEach(function (el) {
el.classList.remove('theme-selected');
});
themePopup.querySelector("button#" + get_theme()).classList.add('theme-selected');
}
function hideThemes() {
themePopup.style.display = 'none';
themeToggleButton.setAttribute('aria-expanded', false);
themeToggleButton.focus();
}
function get_theme() {
var theme;
try { theme = localStorage.getItem('mdbook-theme'); } catch (e) { }
if (theme === null || theme === undefined) {
return default_theme;
} else {
return theme;
}
}
function set_theme(theme, store = true) {
let ace_theme;
if (theme == 'coal' || theme == 'navy') {
stylesheets.ayuHighlight.disabled = true;
stylesheets.tomorrowNight.disabled = false;
stylesheets.highlight.disabled = true;
ace_theme = "ace/theme/tomorrow_night";
} else if (theme == 'ayu') {
stylesheets.ayuHighlight.disabled = false;
stylesheets.tomorrowNight.disabled = true;
stylesheets.highlight.disabled = true;
ace_theme = "ace/theme/tomorrow_night";
} else {
stylesheets.ayuHighlight.disabled = true;
stylesheets.tomorrowNight.disabled = true;
stylesheets.highlight.disabled = false;
ace_theme = "ace/theme/dawn";
}
setTimeout(function () {
themeColorMetaTag.content = getComputedStyle(document.documentElement).backgroundColor;
}, 1);
if (window.ace && window.editors) {
window.editors.forEach(function (editor) {
editor.setTheme(ace_theme);
});
}
var previousTheme = get_theme();
if (store) {
try { localStorage.setItem('mdbook-theme', theme); } catch (e) { }
}
html.classList.remove(previousTheme);
html.classList.add(theme);
updateThemeSelected();
}
// Set theme
var theme = get_theme();
set_theme(theme, false);
themeToggleButton.addEventListener('click', function () {
if (themePopup.style.display === 'block') {
hideThemes();
} else {
showThemes();
}
});
themePopup.addEventListener('click', function (e) {
var theme;
if (e.target.className === "theme") {
theme = e.target.id;
} else if (e.target.parentElement.className === "theme") {
theme = e.target.parentElement.id;
} else {
return;
}
set_theme(theme);
});
themePopup.addEventListener('focusout', function(e) {
// e.relatedTarget is null in Safari and Firefox on macOS (see workaround below)
if (!!e.relatedTarget && !themeToggleButton.contains(e.relatedTarget) && !themePopup.contains(e.relatedTarget)) {
hideThemes();
}
});
// Should not be needed, but it works around an issue on macOS & iOS: https://github.com/rust-lang/mdBook/issues/628
document.addEventListener('click', function(e) {
if (themePopup.style.display === 'block' && !themeToggleButton.contains(e.target) && !themePopup.contains(e.target)) {
hideThemes();
}
});
document.addEventListener('keydown', function (e) {
if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { return; }
if (!themePopup.contains(e.target)) { return; }
switch (e.key) {
case 'Escape':
e.preventDefault();
hideThemes();
break;
case 'ArrowUp':
e.preventDefault();
var li = document.activeElement.parentElement;
if (li && li.previousElementSibling) {
li.previousElementSibling.querySelector('button').focus();
}
break;
case 'ArrowDown':
e.preventDefault();
var li = document.activeElement.parentElement;
if (li && li.nextElementSibling) {
li.nextElementSibling.querySelector('button').focus();
}
break;
case 'Home':
e.preventDefault();
themePopup.querySelector('li:first-child button').focus();
break;
case 'End':
e.preventDefault();
themePopup.querySelector('li:last-child button').focus();
break;
}
});
})();
(function sidebar() {
var body = document.querySelector("body");
var sidebar = document.getElementById("sidebar");
var sidebarLinks = document.querySelectorAll('#sidebar a');
var sidebarToggleButton = document.getElementById("sidebar-toggle");
var sidebarResizeHandle = document.getElementById("sidebar-resize-handle");
var firstContact = null;
function showSidebar() {
body.classList.remove('sidebar-hidden')
body.classList.add('sidebar-visible');
Array.from(sidebarLinks).forEach(function (link) {
link.setAttribute('tabIndex', 0);
});
sidebarToggleButton.setAttribute('aria-expanded', true);
sidebar.setAttribute('aria-hidden', false);
try { localStorage.setItem('mdbook-sidebar', 'visible'); } catch (e) { }
}
var sidebarAnchorToggles = document.querySelectorAll('#sidebar a.toggle');
function toggleSection(ev) {
ev.currentTarget.parentElement.classList.toggle('expanded');
}
Array.from(sidebarAnchorToggles).forEach(function (el) {
el.addEventListener('click', toggleSection);
});
function hideSidebar() {
body.classList.remove('sidebar-visible')
body.classList.add('sidebar-hidden');
Array.from(sidebarLinks).forEach(function (link) {
link.setAttribute('tabIndex', -1);
});
sidebarToggleButton.setAttribute('aria-expanded', false);
sidebar.setAttribute('aria-hidden', true);
try { localStorage.setItem('mdbook-sidebar', 'hidden'); } catch (e) { }
}
// Toggle sidebar
sidebarToggleButton.addEventListener('click', function sidebarToggle() {
if (body.classList.contains("sidebar-hidden")) {
var current_width = parseInt(
document.documentElement.style.getPropertyValue('--sidebar-width'), 10);
if (current_width < 150) {
document.documentElement.style.setProperty('--sidebar-width', '150px');
}
showSidebar();
} else if (body.classList.contains("sidebar-visible")) {
hideSidebar();
} else {
if (getComputedStyle(sidebar)['transform'] === 'none') {
hideSidebar();
} else {
showSidebar();
}
}
});
sidebarResizeHandle.addEventListener('mousedown', initResize, false);
function initResize(e) {
window.addEventListener('mousemove', resize, false);
window.addEventListener('mouseup', stopResize, false);
body.classList.add('sidebar-resizing');
}
function resize(e) {
var pos = (e.clientX - sidebar.offsetLeft);
if (pos < 20) {
hideSidebar();
} else {
if (body.classList.contains("sidebar-hidden")) {
showSidebar();
}
pos = Math.min(pos, window.innerWidth - 100);
document.documentElement.style.setProperty('--sidebar-width', pos + 'px');
}
}
//on mouseup remove windows functions mousemove & mouseup
function stopResize(e) {
body.classList.remove('sidebar-resizing');
window.removeEventListener('mousemove', resize, false);
window.removeEventListener('mouseup', stopResize, false);
}
document.addEventListener('touchstart', function (e) {
firstContact = {
x: e.touches[0].clientX,
time: Date.now()
};
}, { passive: true });
document.addEventListener('touchmove', function (e) {
if (!firstContact)
return;
var curX = e.touches[0].clientX;
var xDiff = curX - firstContact.x,
tDiff = Date.now() - firstContact.time;
if (tDiff < 250 && Math.abs(xDiff) >= 150) {
if (xDiff >= 0 && firstContact.x < Math.min(document.body.clientWidth * 0.25, 300))
showSidebar();
else if (xDiff < 0 && curX < 300)
hideSidebar();
firstContact = null;
}
}, { passive: true });
})();
(function chapterNavigation() {
document.addEventListener('keydown', function (e) {
if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { return; }
if (window.search && window.search.hasFocus()) { return; }
var html = document.querySelector('html');
function next() {
var nextButton = document.querySelector('.nav-chapters.next');
if (nextButton) {
window.location.href = nextButton.href;
}
}
function prev() {
var previousButton = document.querySelector('.nav-chapters.previous');
if (previousButton) {
window.location.href = previousButton.href;
}
}
switch (e.key) {
case 'ArrowRight':
e.preventDefault();
if (html.dir == 'rtl') {
prev();
} else {
next();
}
break;
case 'ArrowLeft':
e.preventDefault();
if (html.dir == 'rtl') {
next();
} else {
prev();
}
break;
}
});
})();
(function clipboard() {
var clipButtons = document.querySelectorAll('.clip-button');
function hideTooltip(elem) {
elem.firstChild.innerText = "";
elem.className = 'fa fa-copy clip-button';
}
function showTooltip(elem, msg) {
elem.firstChild.innerText = msg;
elem.className = 'fa fa-copy tooltipped';
}
var clipboardSnippets = new ClipboardJS('.clip-button', {
text: function (trigger) {
hideTooltip(trigger);
let playground = trigger.closest("pre");
return playground_text(playground, false);
}
});
Array.from(clipButtons).forEach(function (clipButton) {
clipButton.addEventListener('mouseout', function (e) {
hideTooltip(e.currentTarget);
});
});
clipboardSnippets.on('success', function (e) {
e.clearSelection();
showTooltip(e.trigger, "Copied!");
});
clipboardSnippets.on('error', function (e) {
showTooltip(e.trigger, "Clipboard error!");
});
})();
(function scrollToTop () {
var menuTitle = document.querySelector('.menu-title');
menuTitle.addEventListener('click', function () {
document.scrollingElement.scrollTo({ top: 0, behavior: 'smooth' });
});
})();
(function controllMenu() {
var menu = document.getElementById('menu-bar');
(function controllPosition() {
var scrollTop = document.scrollingElement.scrollTop;
var prevScrollTop = scrollTop;
var minMenuY = -menu.clientHeight - 50;
// When the script loads, the page can be at any scroll (e.g. if you reforesh it).
menu.style.top = scrollTop + 'px';
// Same as parseInt(menu.style.top.slice(0, -2), but faster
var topCache = menu.style.top.slice(0, -2);
menu.classList.remove('sticky');
var stickyCache = false; // Same as menu.classList.contains('sticky'), but faster
document.addEventListener('scroll', function () {
scrollTop = Math.max(document.scrollingElement.scrollTop, 0);
// `null` means that it doesn't need to be updated
var nextSticky = null;
var nextTop = null;
var scrollDown = scrollTop > prevScrollTop;
var menuPosAbsoluteY = topCache - scrollTop;
if (scrollDown) {
nextSticky = false;
if (menuPosAbsoluteY > 0) {
nextTop = prevScrollTop;
}
} else {
if (menuPosAbsoluteY > 0) {
nextSticky = true;
} else if (menuPosAbsoluteY < minMenuY) {
nextTop = prevScrollTop + minMenuY;
}
}
if (nextSticky === true && stickyCache === false) {
menu.classList.add('sticky');
stickyCache = true;
} else if (nextSticky === false && stickyCache === true) {
menu.classList.remove('sticky');
stickyCache = false;
}
if (nextTop !== null) {
menu.style.top = nextTop + 'px';
topCache = nextTop;
}
prevScrollTop = scrollTop;
}, { passive: true });
})();
(function controllBorder() {
function updateBorder() {
if (menu.offsetTop === 0) {
menu.classList.remove('bordered');
} else {
menu.classList.add('bordered');
}
}
updateBorder();
document.addEventListener('scroll', updateBorder, { passive: true });
})();
})();
================================================
FILE: docs/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/css/chrome.css
================================================
/* CSS for UI elements (a.k.a. chrome) */
@import 'variables.css';
html {
scrollbar-color: var(--scrollbar) var(--bg);
}
#searchresults a,
.content a:link,
a:visited,
a > .hljs {
color: var(--links);
}
/*
body-container is necessary because mobile browsers don't seem to like
overflow-x on the body tag when there is a <meta name="viewport"> tag.
*/
#body-container {
/*
This is used when the sidebar pushes the body content off the side of
the screen on small screens. Without it, dragging on mobile Safari
will want to reposition the viewport in a weird way.
*/
overflow-x: clip;
}
/* Menu Bar */
#menu-bar,
#menu-bar-hover-placeholder {
z-index: 101;
margin: auto calc(0px - var(--page-padding));
}
#menu-bar {
position: relative;
display: flex;
flex-wrap: wrap;
background-color: var(--bg);
border-block-end-color: var(--bg);
border-block-end-width: 1px;
border-block-end-style: solid;
}
#menu-bar.sticky,
.js #menu-bar-hover-placeholder:hover + #menu-bar,
.js #menu-bar:hover,
.js.sidebar-visible #menu-bar {
position: -webkit-sticky;
position: sticky;
top: 0 !important;
}
#menu-bar-hover-placeholder {
position: sticky;
position: -webkit-sticky;
top: 0;
height: var(--menu-bar-height);
}
#menu-bar.bordered {
border-block-end-color: var(--table-border-color);
}
#menu-bar i, #menu-bar .icon-button {
position: relative;
padding: 0 8px;
z-index: 10;
line-height: var(--menu-bar-height);
cursor: pointer;
transition: color 0.5s;
}
@media only screen and (max-width: 420px) {
#menu-bar i, #menu-bar .icon-button {
padding: 0 5px;
}
}
.icon-button {
border: none;
background: none;
padding: 0;
color: inherit;
}
.icon-button i {
margin: 0;
}
.right-buttons {
margin: 0 15px;
}
.right-buttons a {
text-decoration: none;
}
.left-buttons {
display: flex;
margin: 0 5px;
}
.no-js .left-buttons button {
display: none;
}
.menu-title {
display: inline-block;
font-weight: 200;
font-size: 2.4rem;
line-height: var(--menu-bar-height);
text-align: center;
margin: 0;
flex: 1;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.js .menu-title {
cursor: pointer;
}
.menu-bar,
.menu-bar:visited,
.nav-chapters,
.nav-chapters:visited,
.mobile-nav-chapters,
.mobile-nav-chapters:visited,
.menu-bar .icon-button,
.menu-bar a i {
color: var(--icons);
}
.menu-bar i:hover,
.menu-bar .icon-button:hover,
.nav-chapters:hover,
.mobile-nav-chapters i:hover {
color: var(--icons-hover);
}
/* Nav Icons */
.nav-chapters {
font-size: 2.5em;
text-align: center;
text-decoration: none;
position: fixed;
top: 0;
bottom: 0;
margin: 0;
max-width: 150px;
min-width: 90px;
display: flex;
justify-content: center;
align-content: center;
flex-direction: column;
transition: color 0.5s, background-color 0.5s;
}
.nav-chapters:hover {
text-decoration: none;
background-color: var(--theme-hover);
transition: background-color 0.15s, color 0.15s;
}
.nav-wrapper {
margin-block-start: 50px;
display: none;
}
.mobile-nav-chapters {
font-size: 2.5em;
text-align: center;
text-decoration: none;
width: 90px;
border-radius: 5px;
background-color: var(--sidebar-bg);
}
/* Only Firefox supports flow-relative values */
.previous { float: left; }
[dir=rtl] .previous { float: right; }
/* Only Firefox supports flow-relative values */
.next {
float: right;
right: var(--page-padding);
}
[dir=rtl] .next {
float: left;
right: unset;
left: var(--page-padding);
}
/* Use the correct buttons for RTL layouts*/
[dir=rtl] .previous i.fa-angle-left:before {content:"\f105";}
[dir=rtl] .next i.fa-angle-right:before { content:"\f104"; }
@media only screen and (max-width: 1080px) {
.nav-wide-wrapper { display: none; }
.nav-wrapper { display: block; }
}
/* sidebar-visible */
@media only screen and (max-width: 1380px) {
#sidebar-toggle-anchor:checked ~ .page-wrapper .nav-wide-wrapper { display: none; }
#sidebar-toggle-anchor:checked ~ .page-wrapper .nav-wrapper { display: block; }
}
/* Inline code */
:not(pre) > .hljs {
display: inline;
padding: 0.1em 0.3em;
border-radius: 3px;
}
:not(pre):not(a) > .hljs {
color: var(--inline-code-color);
overflow-x: initial;
}
a:hover > .hljs {
text-decoration: underline;
}
pre {
position: relative;
}
pre > .buttons {
position: absolute;
z-index: 100;
right: 0px;
top: 2px;
margin: 0px;
padding: 2px 0px;
color: var(--sidebar-fg);
cursor: pointer;
visibility: hidden;
opacity: 0;
transition: visibility 0.1s linear, opacity 0.1s linear;
}
pre:hover > .buttons {
visibility: visible;
opacity: 1
}
pre > .buttons :hover {
color: var(--sidebar-active);
border-color: var(--icons-hover);
background-color: var(--theme-hover);
}
pre > .buttons i {
margin-inline-start: 8px;
}
pre > .buttons button {
cursor: inherit;
margin: 0px 5px;
padding: 3px 5px;
font-size: 14px;
border-style: solid;
border-width: 1px;
border-radius: 4px;
border-color: var(--icons);
background-color: var(--theme-popup-bg);
transition: 100ms;
transition-property: color,border-color,background-color;
color: var(--icons);
}
@media (pointer: coarse) {
pre > .buttons button {
/* On mobile, make it easier to tap buttons. */
padding: 0.3rem 1rem;
}
.sidebar-resize-indicator {
/* Hide resize indicator on devices with limited accuracy */
display: none;
}
}
pre > code {
display: block;
padding: 1rem;
}
/* FIXME: ACE editors overlap their buttons because ACE does absolute
positioning within the code block which breaks padding. The only solution I
can think of is to move the padding to the outer pre tag (or insert a div
wrapper), but that would require fixing a whole bunch of CSS rules.
*/
.hljs.ace_editor {
padding: 0rem 0rem;
}
pre > .result {
margin-block-start: 10px;
}
/* Search */
#searchresults a {
text-decoration: none;
}
mark {
border-radius: 2px;
padding-block-start: 0;
padding-block-end: 1px;
padding-inline-start: 3px;
padding-inline-end: 3px;
margin-block-start: 0;
margin-block-end: -1px;
margin-inline-start: -3px;
margin-inline-end: -3px;
background-color: var(--search-mark-bg);
transition: background-color 300ms linear;
cursor: pointer;
}
mark.fade-out {
background-color: rgba(0,0,0,0) !important;
cursor: auto;
}
.searchbar-outer {
margin-inline-start: auto;
margin-inline-end: auto;
max-width: var(--content-max-width);
}
#searchbar {
width: 100%;
margin-block-start: 5px;
margin-block-end: 0;
margin-inline-start: auto;
margin-inline-end: auto;
padding: 10px 16px;
transition: box-shadow 300ms ease-in-out;
border: 1px solid var(--searchbar-border-color);
border-radius: 3px;
background-color: var(--searchbar-bg);
color: var(--searchbar-fg);
}
#searchbar:focus,
#searchbar.active {
box-shadow: 0 0 3px var(--searchbar-shadow-color);
}
.searchresults-header {
font-weight: bold;
font-size: 1em;
padding-block-start: 18px;
padding-block-end: 0;
padding-inline-start: 5px;
padding-inline-end: 0;
color: var(--searchresults-header-fg);
}
.searchresults-outer {
margin-inline-start: auto;
margin-inline-end: auto;
max-width: var(--content-max-width);
border-block-end: 1px dashed var(--searchresults-border-color);
}
ul#searchresults {
list-style: none;
padding-inline-start: 20px;
}
ul#searchresults li {
margin: 10px 0px;
padding: 2px;
border-radius: 2px;
}
ul#searchresults li.focus {
background-color: var(--searchresults-li-bg);
}
ul#searchresults span.teaser {
display: block;
clear: both;
margin-block-start: 5px;
margin-block-end: 0;
margin-inline-start: 20px;
margin-inline-end: 0;
font-size: 0.8em;
}
ul#searchresults span.teaser em {
font-weight: bold;
font-style: normal;
}
/* Sidebar */
.sidebar {
position: fixed;
left: 0;
top: 0;
bottom: 0;
width: var(--sidebar-width);
font-size: 0.875em;
box-sizing: border-box;
-webkit-overflow-scrolling: touch;
overscroll-behavior-y: contain;
background-color: var(--sidebar-bg);
color: var(--sidebar-fg);
}
[dir=rtl] .sidebar { left: unset; right: 0; }
.sidebar-resizing {
-moz-user-select: none;
-webkit-user-select: none;
-ms-user-select: none;
user-select: none;
}
.no-js .sidebar,
.js:not(.sidebar-resizing) .sidebar {
transition: transform 0.3s; /* Animation: slide away */
}
.sidebar code {
line-height: 2em;
}
.sidebar .sidebar-scrollbox {
overflow-y: auto;
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
padding: 10px 10px;
}
.sidebar .sidebar-resize-handle {
position: absolute;
cursor: col-resize;
width: 0;
right: calc(var(--sidebar-resize-indicator-width) * -1);
top: 0;
bottom: 0;
display: flex;
align-items: center;
}
.sidebar-resize-handle .sidebar-resize-indicator {
width: 100%;
height: 12px;
background-color: var(--icons);
margin-inline-start: var(--sidebar-resize-indicator-space);
}
[dir=rtl] .sidebar .sidebar-resize-handle {
left: calc(var(--sidebar-resize-indicator-width) * -1);
right: unset;
}
.js .sidebar .sidebar-resize-handle {
cursor: col-resize;
width: calc(var(--sidebar-resize-indicator-width) - var(--sidebar-resize-indicator-space));
}
/* sidebar-hidden */
#sidebar-toggle-anchor:not(:checked) ~ .sidebar {
transform: translateX(calc(0px - var(--sidebar-width) - var(--sidebar-resize-indicator-width)));
z-index: -1;
}
[dir=rtl] #sidebar-toggle-anchor:not(:checked) ~ .sidebar {
transform: translateX(calc(var(--sidebar-width) + var(--sidebar-resize-indicator-width)));
}
.sidebar::-webkit-scrollbar {
background: var(--sidebar-bg);
}
.sidebar::-webkit-scrollbar-thumb {
background: var(--scrollbar);
}
/* sidebar-visible */
#sidebar-toggle-anchor:checked ~ .page-wrapper {
transform: translateX(calc(var(--sidebar-width) + var(--sidebar-resize-indicator-width)));
}
[dir=rtl] #sidebar-toggle-anchor:checked ~ .page-wrapper {
transform: translateX(calc(0px - var(--sidebar-width) - var(--sidebar-resize-indicator-width)));
}
@media only screen and (min-width: 620px) {
#sidebar-toggle-anchor:checked ~ .page-wrapper {
transform: none;
margin-inline-start: calc(var(--sidebar-width) + var(--sidebar-resize-indicator-width));
}
[dir=rtl] #sidebar-toggle-anchor:checked ~ .page-wrapper {
transform: none;
}
}
.chapter {
list-style: none outside none;
padding-inline-start: 0;
line-height: 2.2em;
}
.chapter ol {
width: 100%;
}
.chapter li {
display: flex;
color: var(--sidebar-non-existant);
}
.chapter li a {
display: block;
padding: 0;
text-decoration: none;
color: var(--sidebar-fg);
}
.chapter li a:hover {
color: var(--sidebar-active);
}
.chapter li a.active {
color: var(--sidebar-active);
}
.chapter li > a.toggle {
cursor: pointer;
display: block;
margin-inline-start: auto;
padding: 0 10px;
user-select: none;
opacity: 0.68;
}
.chapter li > a.toggle div {
transition: transform 0.5s;
}
/* collapse the section */
.chapter li:not(.expanded) + li > ol {
display: none;
}
.chapter li.chapter-item {
line-height: 1.5em;
margin-block-start: 0.6em;
}
.chapter li.expanded > a.toggle div {
transform: rotate(90deg);
}
.spacer {
width: 100%;
height: 3px;
margin: 5px 0px;
}
.chapter .spacer {
background-color: var(--sidebar-spacer);
}
@media (-moz-touch-enabled: 1), (pointer: coarse) {
.chapter li a { padding: 5px 0; }
.spacer { margin: 10px 0; }
}
.section {
list-style: none outside none;
padding-inline-start: 20px;
line-height: 1.9em;
}
/* Theme Menu Popup */
.theme-popup {
position: absolute;
left: 10px;
top: var(--menu-bar-height);
z-index: 1000;
border-radius: 4px;
font-size: 0.7em;
color: var(--fg);
background: var(--theme-popup-bg);
border: 1px solid var(--theme-popup-border);
margin: 0;
padding: 0;
list-style: none;
display: none;
/* Don't let the children's background extend past the rounded corners. */
overflow: hidden;
}
[dir=rtl] .theme-popup { left: unset; right: 10px; }
.theme-popup .default {
color: var(--icons);
}
.theme-popup .theme {
width: 100%;
border: 0;
margin: 0;
padding: 2px 20px;
line-height: 25px;
white-space: nowrap;
text-align: start;
cursor: pointer;
color: inherit;
background: inherit;
font-size: inherit;
}
.theme-popup .theme:hover {
background-color: var(--theme-hover);
}
.theme-selected::before {
display: inline-block;
content: "✓";
margin-inline-start: -14px;
width: 14px;
}
================================================
FILE: docs/css/general.css
================================================
/* Base styles and content styles */
@import 'variables.css';
:root {
/* Browser default font-size is 16px, this way 1 rem = 10px */
font-size: 62.5%;
color-scheme: var(--color-scheme);
}
html {
font-family: "Open Sans", sans-serif;
color: var(--fg);
background-color: var(--bg);
text-size-adjust: none;
-webkit-text-size-adjust: none;
}
body {
margin: 0;
font-size: 1.6rem;
overflow-x: hidden;
}
code {
font-family: var(--mono-font) !important;
font-size: var(--code-font-size);
direction: ltr !important;
}
/* make long words/inline code not x overflow */
main {
overflow-wrap: break-word;
}
/* make wide tables scroll if they overflow */
.table-wrapper {
overflow-x: auto;
}
/* Don't change font size in headers. */
h1 code, h2 code, h3 code, h4 code, h5 code, h6 code {
font-size: unset;
}
.left { float: left; }
.right { float: right; }
.boring { opacity: 0.6; }
.hide-boring .boring { display: none; }
.hidden { display: none !important; }
h2, h3 { margin-block-start: 2.5em; }
h4, h5 { margin-block-start: 2em; }
.header + .header h3,
.header + .header h4,
.header + .header h5 {
margin-block-start: 1em;
}
h1:target::before,
h2:target::before,
h3:target::before,
h4:target::before,
h5:target::before,
h6:target::before {
display: inline-block;
content: "»";
margin-inline-start: -30px;
width: 30px;
}
/* This is broken on Safari as of version 14, but is fixed
in Safari Technology Preview 117 which I think will be Safari 14.2.
https://bugs.webkit.org/show_bug.cgi?id=218076
*/
:target {
/* Safari does not support logical properties */
scroll-margin-top: calc(var(--menu-bar-height) + 0.5em);
}
.page {
outline: 0;
padding: 0 var(--page-padding);
margin-block-start: calc(0px - var(--menu-bar-height)); /* Compensate for the #menu-bar-hover-placeholder */
}
.page-wrapper {
box-sizing: border-box;
background-color: var(--bg);
}
.no-js .page-wrapper,
.js:not(.sidebar-resizing) .page-wrapper {
transition: margin-left 0.3s ease, transform 0.3s ease; /* Animation: slide away */
}
[dir=rtl] .js:not(.sidebar-resizing) .page-wrapper {
transition: margin-right 0.3s ease, transform 0.3s ease; /* Animation: slide away */
}
.content {
overflow-y: auto;
padding: 0 5px 50px 5px;
}
.content main {
margin-inline-start: auto;
margin-inline-end: auto;
max-width: var(--content-max-width);
}
.content p { line-height: 1.45em; }
.content ol { line-height: 1.45em; }
.content ul { line-height: 1.45em; }
.content a { text-decoration: none; }
.content a:hover { text-decoration: underline; }
.content img, .content video { max-width: 100%; }
.content .header:link,
.content .header:visited {
color: var(--fg);
}
.content .header:link,
.content .header:visited:hover {
text-decoration: none;
}
table {
margin: 0 auto;
border-collapse: collapse;
}
table td {
padding: 3px 20px;
border: 1px var(--table-border-color) solid;
}
table thead {
background: var(--table-header-bg);
}
table thead td {
font-weight: 700;
border: none;
}
table thead th {
padding: 3px 20px;
}
table thead tr {
border: 1px var(--table-header-bg) solid;
}
/* Alternate background colors for rows */
table tbody tr:nth-child(2n) {
background: var(--table-alternate-bg);
}
blockquote {
margin: 20px 0;
padding: 0 20px;
color: var(--fg);
background-color: var(--quote-bg);
border-block-start: .1em solid var(--quote-border);
border-block-end: .1em solid var(--quote-border);
}
.warning {
margin: 20px;
padding: 0 20px;
border-inline-start: 2px solid var(--warning-border);
}
.warning:before {
position: absolute;
width: 3rem;
height: 3rem;
margin-inline-start: calc(-1.5rem - 21px);
content: "ⓘ";
text-align: center;
background-color: var(--bg);
color: var(--warning-border);
font-weight: bold;
font-size: 2rem;
}
blockquote .warning:before {
background-color: var(--quote-bg);
}
kbd {
background-color: var(--table-border-color);
border-radius: 4px;
border: solid 1px var(--theme-popup-border);
box-shadow: inset 0 -1px 0 var(--theme-hover);
display: inline-block;
font-size: var(--code-font-size);
font-family: var(--mono-font);
line-height: 10px;
padding: 4px 5px;
vertical-align: middle;
}
:not(.footnote-definition) + .footnote-definition,
.footnote-definition + :not(.footnote-definition) {
margin-block-start: 2em;
}
.footnote-definition {
font-size: 0.9em;
margin: 0.5em 0;
}
.footnote-definition p {
display: inline;
}
.tooltiptext {
position: absolute;
visibility: hidden;
color: #fff;
background-color: #333;
transform: translateX(-50%); /* Center by moving tooltip 50% of its width left */
left: -8px; /* Half of the width of the icon */
top: -35px;
font-size: 0.8em;
text-align: center;
border-radius: 6px;
padding: 5px 8px;
margin: 5px;
z-index: 1000;
}
.tooltipped .tooltiptext {
visibility: visible;
}
.chapter li.part-title {
color: var(--sidebar-fg);
margin: 5px 0px;
font-weight: bold;
}
.result-no-output {
font-style: italic;
}
================================================
FILE: docs/css/print.css
================================================
#sidebar,
#menu-bar,
.nav-chapters,
.mobile-nav-chapters {
display: none;
}
#page-wrapper.page-wrapper {
transform: none !important;
margin-inline-start: 0px;
overflow-y: initial;
}
#content {
max-width: none;
margin: 0;
padding: 0;
}
.page {
overflow-y: initial;
}
code {
direction: ltr !important;
}
pre > .buttons {
z-index: 2;
}
a, a:visited, a:active, a:hover {
color: #4183c4;
text-decoration: none;
}
h1, h2, h3, h4, h5, h6 {
page-break-inside: avoid;
page-break-after: avoid;
}
pre, code {
page-break-inside: avoid;
white-space: pre-wrap;
}
.fa {
display: none !important;
}
================================================
FILE: docs/css/variables.css
================================================
/* Globals */
:root {
--sidebar-width: 300px;
--sidebar-resize-indicator-width: 8px;
--sidebar-resize-indicator-space: 2px;
--page-padding: 15px;
--content-max-width: 750px;
--menu-bar-height: 50px;
--mono-font: "Source Code Pro", Consolas, "Ubuntu Mono", Menlo, "DejaVu Sans Mono", monospace, monospace;
--code-font-size: 0.875em /* please adjust the ace font size accordingly in editor.js */
}
/* Themes */
.ayu {
--bg: hsl(210, 25%, 8%);
--fg: #c5c5c5;
--sidebar-bg: #14191f;
--sidebar-fg: #c8c9db;
--sidebar-non-existant: #5c6773;
--sidebar-active: #ffb454;
--sidebar-spacer: #2d334f;
--scrollbar: var(--sidebar-fg);
--icons: #737480;
--icons-hover: #b7b9cc;
--links: #0096cf;
--inline-code-color: #ffb454;
--theme-popup-bg: #14191f;
--theme-popup-border: #5c6773;
--theme-hover: #191f26;
--quote-bg: hsl(226, 15%, 17%);
--quote-border: hsl(226, 15%, 22%);
--warning-border: #ff8e00;
--table-border-color: hsl(210, 25%, 13%);
--table-header-bg: hsl(210, 25%, 28%);
--table-alternate-bg: hsl(210, 25%, 11%);
--searchbar-border-color: #848484;
--searchbar-bg: #424242;
--searchbar-fg: #fff;
--searchbar-shadow-color: #d4c89f;
--searchresults-header-fg: #666;
--searchresults-border-color: #888;
--searchresults-li-bg: #252932;
--search-mark-bg: #e3b171;
--color-scheme: dark;
}
.coal {
--bg: hsl(200, 7%, 8%);
--fg: #98a3ad;
--sidebar-bg: #292c2f;
--sidebar-fg: #a1adb8;
--sidebar-non-existant: #505254;
--sidebar-active: #3473ad;
--sidebar-spacer: #393939;
--scrollbar: var(--sidebar-fg);
--icons: #43484d;
--icons-hover: #b3c0cc;
--links: #2b79a2;
--inline-code-color: #c5c8c6;
--theme-popup-bg: #141617;
--theme-popup-border: #43484d;
--theme-hover: #1f2124;
--quote-bg: hsl(234, 21%, 18%);
--quote-border: hsl(234, 21%, 23%);
--warning-border: #ff8e00;
--table-border-color: hsl(200, 7%, 13%);
--table-header-bg: hsl(200, 7%, 28%);
--table-alternate-bg: hsl(200, 7%, 11%);
--searchbar-border-color: #aaa;
--searchbar-bg: #b7b7b7;
--searchbar-fg: #000;
--searchbar-shadow-color: #aaa;
--searchresults-header-fg: #666;
--searchresults-border-color: #98a3ad;
--searchresults-li-bg: #2b2b2f;
--search-mark-bg: #355c7d;
--color-scheme: dark;
}
.light {
--bg: hsl(0, 0%, 100%);
--fg: hsl(0, 0%, 0%);
--sidebar-bg: #fafafa;
--sidebar-fg: hsl(0, 0%, 0%);
--sidebar-non-existant: #aaaaaa;
--sidebar-active: #1f1fff;
--sidebar-spacer: #f4f4f4;
--scrollbar: #8F8F8F;
--icons: #747474;
--icons-hover: #000000;
--links: #20609f;
--inline-code-color: #301900;
--theme-popup-bg: #fafafa;
--theme-popup-border: #cccccc;
--theme-hover: #e6e6e6;
--quote-bg: hsl(197, 37%, 96%);
--quote-border: hsl(197, 37%, 91%);
--warning-border: #ff8e00;
--table-border-color: hsl(0, 0%, 95%);
--table-header-bg: hsl(0, 0%, 80%);
--table-alternate-bg: hsl(0, 0%, 97%);
--searchbar-border-color: #aaa;
--searchbar-bg: #fafafa;
--searchbar-fg: #000;
--searchbar-shadow-color: #aaa;
--searchresults-header-fg: #666;
--searchresults-border-color: #888;
--searchresults-li-bg: #e4f2fe;
--search-mark-bg: #a2cff5;
--color-scheme: light;
}
.navy {
--bg: hsl(226, 23%, 11%);
--fg: #bcbdd0;
--sidebar-bg: #282d3f;
--sidebar-fg: #c8c9db;
--sidebar-non-existant: #505274;
--sidebar-active: #2b79a2;
--sidebar-spacer: #2d334f;
--scrollbar: var(--sidebar-fg);
--icons: #737480;
--icons-hover: #b7b9cc;
--links: #2b79a2;
--inline-code-color: #c5c8c6;
--theme-popup-bg: #161923;
--theme-popup-border: #737480;
--theme-hover: #282e40;
--quote-bg: hsl(226, 15%, 17%);
--quote-border: hsl(226, 15%, 22%);
--warning-border: #ff8e00;
--table-border-color: hsl(226, 23%, 16%);
--table-header-bg: hsl(226, 23%, 31%);
--table-alternate-bg: hsl(226, 23%, 14%);
--searchbar-border-color: #aaa;
--searchbar-bg: #aeaec6;
--searchbar-fg: #000;
--searchbar-shadow-color: #aaa;
--searchresults-header-fg: #5f5f71;
--searchresults-border-color: #5c5c68;
--searchresults-li-bg: #242430;
--search-mark-bg: #a2cff5;
--color-scheme: dark;
}
.rust {
--bg: hsl(60, 9%, 87%);
--fg: #262625;
--sidebar-bg: #3b2e2a;
--sidebar-fg: #c8c9db;
--sidebar-non-existant: #505254;
--sidebar-active: #e69f67;
--sidebar-spacer: #45373a;
--scrollbar: var(--sidebar-fg);
--icons: #737480;
--icons-hover: #262625;
--links: #2b79a2;
--inline-code-color: #6e6b5e;
--theme-popup-bg: #e1e1db;
--theme-popup-border: #b38f6b;
--theme-hover: #99908a;
--quote-bg: hsl(60, 5%, 75%);
--quote-border: hsl(60, 5%, 70%);
--warning-border: #ff8e00;
--table-border-color: hsl(60, 9%, 82%);
--table-header-bg: #b3a497;
--table-alternate-bg: hsl(60, 9%, 84%);
--searchbar-border-color: #aaa;
--searchbar-bg: #fafafa;
--searchbar-fg: #000;
--searchbar-shadow-color: #aaa;
--searchresults-header-fg: #666;
--searchresults-border-color: #888;
--searchresults-li-bg: #dec2a2;
--search-mark-bg: #e69f67;
--color-scheme: light;
}
@media (prefers-color-scheme: dark) {
.light.no-js {
--bg: hsl(200, 7%, 8%);
--fg: #98a3ad;
--sidebar-bg: #292c2f;
--sidebar-fg: #a1adb8;
--sidebar-non-existant: #505254;
--sidebar-active: #3473ad;
--sidebar-spacer: #393939;
--scrollbar: var(--sidebar-fg);
--icons: #43484d;
--icons-hover: #b3c0cc;
--links: #2b79a2;
--inline-code-color: #c5c8c6;
--theme-popup-bg: #141617;
--theme-popup-border: #43484d;
--theme-hover: #1f2124;
--quote-bg: hsl(234, 21%, 18%);
--quote-border: hsl(234, 21%, 23%);
--warning-border: #ff8e00;
--table-border-color: hsl(200, 7%, 13%);
--table-header-bg: hsl(200, 7%, 28%);
--table-alternate-bg: hsl(200, 7%, 11%);
--searchbar-border-color: #aaa;
--searchbar-bg: #b7b7b7;
--searchbar-fg: #000;
--searchbar-shadow-color: #aaa;
--searchresults-header-fg: #666;
--searchresults-border-color: #98a3ad;
--searchresults-li-bg: #2b2b2f;
--search-mark-bg: #355c7d;
}
}
================================================
FILE: docs/fonts/OPEN-SANS-LICENSE.txt
================================================
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
================================================
FILE: docs/fonts/SOURCE-CODE-PRO-LICENSE.txt
================================================
Copyright 2010, 2012 Adobe Systems Incorporated (http://www.adobe.com/), with Reserved Font Name 'Source'. All Rights Reserved. Source is a trademark of Adobe Systems Incorporated in the United States and/or other countries.
This Font Software is licensed under the SIL Open Font License, Version 1.1.
This license is copied below, and is also available with a FAQ at:
http://scripts.sil.org/OFL
-----------------------------------------------------------
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
-----------------------------------------------------------
PREAMBLE
The goals of the Open Font License (OFL) are to stimulate worldwide
development of collaborative font projects, to support the font creation
efforts of academic and linguistic communities, and to provide a free and
open framework in which fonts may be shared and improved in partnership
with others.
The OFL allows the licensed fonts to be used, studied, modified and
redistributed freely as long as they are not sold by themselves. The
fonts, including any derivative works, can be bundled, embedded,
redistributed and/or sold with any software provided that any reserved
names are not used by derivative works. The fonts and derivatives,
however, cannot be released under any other type of license. The
requirement for fonts to remain under this license does not apply
to any document created using the fonts or their derivatives.
DEFINITIONS
"Font Software" refers to the set of files released by the Copyright
Holder(s) under this license and clearly marked as such. This may
include source files, build scripts and documentation.
"Reserved Font Name" refers to any names specified as such after the
copyright statement(s).
"Original Version" refers to the collection of Font Software components as
distributed by the Copyright Holder(s).
"Modified Version" refers to any derivative made by adding to, deleting,
or substituting -- in part or in whole -- any of the components of the
Original Version, by changing formats or by porting the Font Software to a
new environment.
"Author" refers to any designer, engineer, programmer, technical
writer or other person who contributed to the Font Software.
PERMISSION & CONDITIONS
Permission is hereby granted, free of charge, to any person obtaining
a copy of the Font Software, to use, study, copy, merge, embed, modify,
redistribute, and sell modified and unmodified copies of the Font
Software, subject to the following conditions:
1) Neither the Font Software nor any of its individual components,
in Original or Modified Versions, may be sold by itself.
2) Original or Modified Versions of the Font Software may be bundled,
redistributed and/or sold with any software, provided that each copy
contains the above copyright notice and this license. These can be
included either as stand-alone text files, human-readable headers or
in the appropriate machine-readable metadata fields within text or
binary files as long as those fields can be easily viewed by the user.
3) No Modified Version of the Font Software may use the Reserved Font
Name(s) unless explicit written permission is granted by the corresponding
Copyright Holder. This restriction only applies to the primary font name as
presented to the users.
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
Software shall not be used to promote, endorse or advertise any
Modified Version, except to acknowledge the contribution(s) of the
Copyright Holder(s) and the Author(s) or with their explicit written
permission.
5) The Font Software, modified or unmodified, in part or in whole,
must be distributed entirely under this license, and must not be
distributed under any other license. The requirement for fonts to
remain under this license does not apply to any document created
using the Font Software.
TERMINATION
This license becomes null and void if any of the above conditions are
not met.
DISCLAIMER
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
OTHER DEALINGS IN THE FONT SOFTWARE.
================================================
FILE: docs/fonts/fonts.css
================================================
/* Open Sans is licensed under the Apache License, Version 2.0. See http://www.apache.org/licenses/LICENSE-2.0 */
/* Source Code Pro is under the Open Font License. See https://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&id=OFL */
/* open-sans-300 - latin_vietnamese_latin-ext_greek-ext_greek_cyrillic-ext_cyrillic */
@font-face {
font-family: 'Open Sans';
font-style: normal;
font-weight: 300;
src: local('Open Sans Light'), local('OpenSans-Light'),
url('open-sans-v17-all-charsets-300.woff2') format('woff2');
}
/* open-sans-300italic - latin_vietnamese_latin-ext_greek-ext_greek_cyrillic-ext_cyrillic */
@font-face {
font-family: 'Open Sans';
font-style: italic;
font-weight: 300;
src: local('Open Sans Light Italic'), local('OpenSans-LightItalic'),
url('open-sans-v17-all-charsets-300italic.woff2') format('woff2');
}
/* open-sans-regular - latin_vietnamese_latin-ext_greek-ext_greek_cyrillic-ext_cyrillic */
@font-face {
font-family: 'Open Sans';
font-style: normal;
font-weight: 400;
src: local('Open Sans Regular'), local('OpenSans-Regular'),
url('open-sans-v17-all-charsets-regular.woff2') format('woff2');
}
/* open-sans-italic - latin_vietnamese_latin-ext_greek-ext_greek_cyrillic-ext_cyrillic */
@font-face {
font-family: 'Open Sans';
font-style: italic;
font-weight: 400;
src: local('Open Sans Italic'), local('OpenSans-Italic'),
url('open-sans-v17-all-charsets-italic.woff2') format('woff2');
}
/* open-sans-600 - latin_vietnamese_latin-ext_greek-ext_greek_cyrillic-ext_cyrillic */
@font-face {
font-family: 'Open Sans';
font-style: normal;
font-weight: 600;
src: local('Open Sans SemiBold'), local('OpenSans-SemiBold'),
url('open-sans-v17-all-charsets-600.woff2') format('woff2');
}
/* open-sans-600italic - latin_vietnamese_latin-ext_greek-ext_greek_cyrillic-ext_cyrillic */
@font-face {
font-family: 'Open Sans';
font-style: italic;
font-weight: 600;
src: local('Open Sans SemiBold Italic'), local('OpenSans-SemiBoldItalic'),
url('open-sans-v17-all-charsets-600italic.woff2') format('woff2');
}
/* open-sans-700 - latin_vietnamese_latin-ext_greek-ext_greek_cyrillic-ext_cyrillic */
@font-face {
font-family: 'Open Sans';
font-style: normal;
font-weight: 700;
src: local('Open Sans Bold'), local('OpenSans-Bold'),
url('open-sans-v17-all-charsets-700.woff2') format('woff2');
}
/* open-sans-700italic - latin_vietnamese_latin-ext_greek-ext_greek_cyrillic-ext_cyrillic */
@font-face {
font-family: 'Open Sans';
font-style: italic;
font-weight: 700;
src: local('Open Sans Bold Italic'), local('OpenSans-BoldItalic'),
url('open-sans-v17-all-charsets-700italic.woff2') format('woff2');
}
/* open-sans-800 - latin_vietnamese_latin-ext_greek-ext_greek_cyrillic-ext_cyrillic */
@font-face {
font-family: 'Open Sans';
font-style: normal;
font-weight: 800;
src: local('Open Sans ExtraBold'), local('OpenSans-ExtraBold'),
url('open-sans-v17-all-charsets-800.woff2') format('woff2');
}
/* open-sans-800italic - latin_vietnamese_latin-ext_greek-ext_greek_cyrillic-ext_cyrillic */
@font-face {
font-family: 'Open Sans';
font-style: italic;
font-weight: 800;
src: local('Open Sans ExtraBold Italic'), local('OpenSans-ExtraBoldItalic'),
url('open-sans-v17-all-charsets-800italic.woff2') format('woff2');
}
/* source-code-pro-500 - latin_vietnamese_latin-ext_greek_cyrillic-ext_cyrillic */
@font-face {
font-family: 'Source Code Pro';
font-style: normal;
font-weight: 500;
src: url('source-code-pro-v11-all-charsets-500.woff2') format('woff2');
}
================================================
FILE: docs/gulpfile.js
================================================
var gulp = require('gulp'),
ts = require('gulp-typescript');
gulp.task('typescript', function() {
var tsResult = gulp.src('ts/**/*.ts')
.pipe(ts({
target: 'ES5',
declarationFiles: false,
noExternalResolve: true
}));
tsResult.dts.pipe(gulp.dest('dist/tsdefinitions'));
return tsResult.js.pipe(gulp.dest('dist/typescript'));
});
gulp.task('watch', function() {
gulp.watch(['ts/**/*.ts'], ['typescript']);
});
gulp.task('default', ['typescript', 'watch']);
================================================
FILE: docs/highlight.css
================================================
/*
* An increased contrast highlighting scheme loosely based on the
* "Base16 Atelier Dune Light" theme by Bram de Haan
* (http://atelierbram.github.io/syntax-highlighting/atelier-schemes/dune)
* Original Base16 color scheme by Chris Kempson
* (https://github.com/chriskempson/base16)
*/
/* Comment */
.hljs-comment,
.hljs-quote {
color: #575757;
}
/* Red */
.hljs-variable,
.hljs-template-variable,
.hljs-attribute,
.hljs-tag,
.hljs-name,
.hljs-regexp,
.hljs-link,
.hljs-name,
.hljs-selector-id,
.hljs-selector-class {
color: #d70025;
}
/* Orange */
.hljs-number,
.hljs-meta,
.hljs-built_in,
.hljs-builtin-name,
.hljs-literal,
.hljs-type,
.hljs-params {
color: #b21e00;
}
/* Green */
.hljs-string,
.hljs-symbol,
.hljs-bullet {
color: #008200;
}
/* Blue */
.hljs-title,
.hljs-section {
color: #0030f2;
}
/* Purple */
.hljs-keyword,
.hljs-selector-tag {
color: #9d00ec;
}
.hljs {
display: block;
overflow-x: auto;
background: #f6f7f6;
color: #000;
}
.hljs-emphasis {
font-style: italic;
}
.hljs-strong {
font-weight: bold;
}
.hljs-addition {
color: #22863a;
background-color: #f0fff4;
}
.hljs-deletion {
color: #b31d28;
background-color: #ffeef0;
}
================================================
FILE: docs/highlight.js
================================================
/*
Highlight.js 10.1.1 (93fd0d73)
License: BSD-3-Clause
Copyright (c) 2006-2020, Ivan Sagalaev
*/
var hljs=function(){"use strict";function e(n){Object.freeze(n);var t="function"==typeof n;return Object.getOwnPropertyNames(n).forEach((function(r){!Object.hasOwnProperty.call(n,r)||null===n[r]||"object"!=typeof n[r]&&"function"!=typeof n[r]||t&&("caller"===r||"callee"===r||"arguments"===r)||Object.isFrozen(n[r])||e(n[r])})),n}class n{constructor(e){void 0===e.data&&(e.data={}),this.data=e.data}ignoreMatch(){this.ignore=!0}}function t(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function r(e,...n){var t={};for(const n in e)t[n]=e[n];return n.forEach((function(e){for(const n in e)t[n]=e[n]})),t}function a(e){return e.nodeName.toLowerCase()}var i=Object.freeze({__proto__:null,escapeHTML:t,inherit:r,nodeStream:function(e){var n=[];return function e(t,r){for(var i=t.firstChild;i;i=i.nextSibling)3===i.nodeType?r+=i.nodeValue.length:1===i.nodeType&&(n.push({event:"start",offset:r,node:i}),r=e(i,r),a(i).match(/br|hr|img|input/)||n.push({event:"stop",offset:r,node:i}));return r}(e,0),n},mergeStreams:function(e,n,r){var i=0,s="",o=[];function l(){return e.length&&n.length?e[0].offset!==n[0].offset?e[0].offset<n[0].offset?e:n:"start"===n[0].event?e:n:e.length?e:n}function c(e){s+="<"+a(e)+[].map.call(e.attributes,(function(e){return" "+e.nodeName+'="'+t(e.value)+'"'})).join("")+">"}function u(e){s+="</"+a(e)+">"}function d(e){("start"===e.event?c:u)(e.node)}for(;e.length||n.length;){var g=l();if(s+=t(r.substring(i,g[0].offset)),i=g[0].offset,g===e){o.reverse().forEach(u);do{d(g.splice(0,1)[0]),g=l()}while(g===e&&g.length&&g[0].offset===i);o.reverse().forEach(c)}else"start"===g[0].event?o.push(g[0].node):o.pop(),d(g.splice(0,1)[0])}return s+t(r.substr(i))}});const s="</span>",o=e=>!!e.kind;class l{constructor(e,n){this.buffer="",this.classPrefix=n.classPrefix,e.walk(this)}addText(e){this.buffer+=t(e)}openNode(e){if(!o(e))return;let n=e.kind;e.sublanguage||(n=`${this.classPrefix}${n}`),this.span(n)}closeNode(e){o(e)&&(this.buffer+=s)}value(){return this.buffer}span(e){this.buffer+=`<span class="${e}">`}}class c{constructor(){this.rootNode={children:[]},this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){this.top.children.push(e)}openNode(e){const n={kind:e,children:[]};this.add(n),this.stack.push(n)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,n){return"string"==typeof n?e.addText(n):n.children&&(e.openNode(n),n.children.forEach(n=>this._walk(e,n)),e.closeNode(n)),e}static _collapse(e){"string"!=typeof e&&e.children&&(e.children.every(e=>"string"==typeof e)?e.children=[e.children.join("")]:e.children.forEach(e=>{c._collapse(e)}))}}class u extends c{constructor(e){super(),this.options=e}addKeyword(e,n){""!==e&&(this.openNode(n),this.addText(e),this.closeNode())}addText(e){""!==e&&this.add(e)}addSublanguage(e,n){const t=e.root;t.kind=n,t.sublanguage=!0,this.add(t)}toHTML(){return new l(this,this.options).value()}finalize(){return!0}}function d(e){return e?"string"==typeof e?e:e.source:null}const g="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",h={begin:"\\\\[\\s\\S]",relevance:0},f={className:"string",begin:"'",end:"'",illegal:"\\n",contains:[h]},p={className:"string",begin:'"',end:'"',illegal:"\\n",contains:[h]},b={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},m=function(e,n,t={}){var a=r({className:"comment",begin:e,end:n,contains:[]},t);return a.contains.push(b),a.contains.push({className:"doctag",begin:"(?:TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):",relevance:0}),a},v=m("//","$"),x=m("/\\*","\\*/"),E=m("#","$");var _=Object.freeze({__proto__:null,IDENT_RE:"[a-zA-Z]\\w*",UNDERSCORE_IDENT_RE:"[a-zA-Z_]\\w*",NUMBER_RE:"\\b\\d+(\\.\\d+)?",C_NUMBER_RE:g,BINARY_NUMBER_RE:"\\b(0b[01]+)",RE_STARTERS_RE:"!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",SHEBANG:(e={})=>{const n=/^#![ ]*\//;return e.binary&&(e.begin=function(...e){return e.map(e=>d(e)).join("")}(n,/.*\b/,e.binary,/\b.*/)),r({className:"meta",begin:n,end:/$/,relevance:0,"on:begin":(e,n)=>{0!==e.index&&n.ignoreMatch()}},e)},BACKSLASH_ESCAPE:h,APOS_STRING_MODE:f,QUOTE_STRING_MODE:p,PHRASAL_WORDS_MODE:b,COMMENT:m,C_LINE_COMMENT_MODE:v,C_BLOCK_COMMENT_MODE:x,HASH_COMMENT_MODE:E,NUMBER_MODE:{className:"number",begin:"\\b\\d+(\\.\\d+)?",relevance:0},C_NUMBER_MODE:{className:"number",begin:g,relevance:0},BINARY_NUMBER_MODE:{className:"number",begin:"\\b(0b[01]+)",relevance:0},CSS_NUMBER_MODE:{className:"number",begin:"\\b\\d+(\\.\\d+)?(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},REGEXP_MODE:{begin:/(?=\/[^/\n]*\/)/,contains:[{className:"regexp",begin:/\//,end:/\/[gimuy]*/,illegal:/\n/,contains:[h,{begin:/\[/,end:/\]/,relevance:0,contains:[h]}]}]},TITLE_MODE:{className:"title",begin:"[a-zA-Z]\\w*",relevance:0},UNDERSCORE_TITLE_MODE:{className:"title",begin:"[a-zA-Z_]\\w*",relevance:0},METHOD_GUARD:{begin:"\\.\\s*[a-zA-Z_]\\w*",relevance:0},END_SAME_AS_BEGIN:function(e){return Object.assign(e,{"on:begin":(e,n)=>{n.data._beginMatch=e[1]},"on:end":(e,n)=>{n.data._beginMatch!==e[1]&&n.ignoreMatch()}})}}),N="of and for in not or if then".split(" ");function w(e,n){return n?+n:function(e){return N.includes(e.toLowerCase())}(e)?0:1}const R=t,y=r,{nodeStream:k,mergeStreams:O}=i,M=Symbol("nomatch");return function(t){var a=[],i={},s={},o=[],l=!0,c=/(^(<[^>]+>|\t|)+|\n)/gm,g="Could not find the language '{}', did you forget to load/include a language module?";const h={disableAutodetect:!0,name:"Plain text",contains:[]};var f={noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",tabReplace:null,useBR:!1,languages:null,__emitter:u};function p(e){return f.noHighlightRe.test(e)}function b(e,n,t,r){var a={code:n,language:e};S("before:highlight",a);var i=a.result?a.result:m(a.language,a.code,t,r);return i.code=a.code,S("after:highlight",i),i}function m(e,t,a,s){var o=t;function c(e,n){var t=E.case_insensitive?n[0].toLowerCase():n[0];return Object.prototype.hasOwnProperty.call(e.keywords,t)&&e.keywords[t]}function u(){null!=y.subLanguage?function(){if(""!==A){var e=null;if("string"==typeof y.subLanguage){if(!i[y.subLanguage])return void O.addText(A);e=m(y.subLanguage,A,!0,k[y.subLanguage]),k[y.subLanguage]=e.top}else e=v(A,y.subLanguage.length?y.subLanguage:null);y.relevance>0&&(I+=e.relevance),O.addSublanguage(e.emitter,e.language)}}():function(){if(!y.keywords)return void O.addText(A);let e=0;y.keywordPatternRe.lastIndex=0;let n=y.keywordPatternRe.exec(A),t="";for(;n;){t+=A.substring(e,n.index);const r=c(y,n);if(r){const[e,a]=r;O.addText(t),t="",I+=a,O.addKeyword(n[0],e)}else t+=n[0];e=y.keywordPatternRe.lastIndex,n=y.keywordPatternRe.exec(A)}t+=A.substr(e),O.addText(t)}(),A=""}function h(e){return e.className&&O.openNode(e.className),y=Object.create(e,{parent:{value:y}})}function p(e){return 0===y.matcher.regexIndex?(A+=e[0],1):(L=!0,0)}var b={};function x(t,r){var i=r&&r[0];if(A+=t,null==i)return u(),0;if("begin"===b.type&&"end"===r.type&&b.index===r.index&&""===i){if(A+=o.slice(r.index,r.index+1),!l){const n=Error("0 width match regex");throw n.languageName=e,n.badRule=b.rule,n}return 1}if(b=r,"begin"===r.type)return function(e){var t=e[0],r=e.rule;const a=new n(r),i=[r.__beforeBegin,r["on:begin"]];for(const n of i)if(n&&(n(e,a),a.ignore))return p(t);return r&&r.endSameAsBegin&&(r.endRe=RegExp(t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),"m")),r.skip?A+=t:(r.excludeBegin&&(A+=t),u(),r.returnBegin||r.excludeBegin||(A=t)),h(r),r.returnBegin?0:t.length}(r);if("illegal"===r.type&&!a){const e=Error('Illegal lexeme "'+i+'" for mode "'+(y.className||"<unnamed>")+'"');throw e.mode=y,e}if("end"===r.type){var s=function(e){var t=e[0],r=o.substr(e.index),a=function e(t,r,a){let i=function(e,n){var t=e&&e.exec(n);return t&&0===t.index}(t.endRe,a);if(i){if(t["on:end"]){const e=new n(t);t["on:end"](r,e),e.ignore&&(i=!1)}if(i){for(;t.endsParent&&t.parent;)t=t.parent;return t}}if(t.endsWithParent)return e(t.parent,r,a)}(y,e,r);if(!a)return M;var i=y;i.skip?A+=t:(i.returnEnd||i.excludeEnd||(A+=t),u(),i.excludeEnd&&(A=t));do{y.className&&O.closeNode(),y.skip||y.subLanguage||(I+=y.relevance),y=y.parent}while(y!==a.parent);return a.starts&&(a.endSameAsBegin&&(a.starts.endRe=a.endRe),h(a.starts)),i.returnEnd?0:t.length}(r);if(s!==M)return s}if("illegal"===r.type&&""===i)return 1;if(B>1e5&&B>3*r.index)throw Error("potential infinite loop, way more iterations than matches");return A+=i,i.length}var E=T(e);if(!E)throw console.error(g.replace("{}",e)),Error('Unknown language: "'+e+'"');var _=function(e){function n(n,t){return RegExp(d(n),"m"+(e.case_insensitive?"i":"")+(t?"g":""))}class t{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(e,n){n.position=this.position++,this.matchIndexes[this.matchAt]=n,this.regexes.push([n,e]),this.matchAt+=function(e){return RegExp(e.toString()+"|").exec("").length-1}(e)+1}compile(){0===this.regexes.length&&(this.exec=()=>null);const e=this.regexes.map(e=>e[1]);this.matcherRe=n(function(e,n="|"){for(var t=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./,r=0,a="",i=0;i<e.length;i++){var s=r+=1,o=d(e[i]);for(i>0&&(a+=n),a+="(";o.length>0;){var l=t.exec(o);if(null==l){a+=o;break}a+=o.substring(0,l.index),o=o.substring(l.index+l[0].length),"\\"===l[0][0]&&l[1]?a+="\\"+(+l[1]+s):(a+=l[0],"("===l[0]&&r++)}a+=")"}return a}(e),!0),this.lastIndex=0}exec(e){this.matcherRe.lastIndex=this.lastIndex;const n=this.matcherRe.exec(e);if(!n)return null;const t=n.findIndex((e,n)=>n>0&&void 0!==e),r=this.matchIndexes[t];return n.splice(0,t),Object.assign(n,r)}}class a{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(e){if(this.multiRegexes[e])return this.multiRegexes[e];const n=new t;return this.rules.slice(e).forEach(([e,t])=>n.addRule(e,t)),n.compile(),this.multiRegexes[e]=n,n}considerAll(){this.regexIndex=0}addRule(e,n){this.rules.push([e,n]),"begin"===n.type&&this.count++}exec(e){const n=this.getMatcher(this.regexIndex);n.lastIndex=this.lastIndex;const t=n.exec(e);return t&&(this.regexIndex+=t.position+1,this.regexIndex===this.count&&(this.regexIndex=0)),t}}function i(e,n){const t=e.input[e.index-1],r=e.input[e.index+e[0].length];"."!==t&&"."!==r||n.ignoreMatch()}if(e.contains&&e.contains.includes("self"))throw Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return function t(s,o){const l=s;if(s.compiled)return l;s.compiled=!0,s.__beforeBegin=null,s.keywords=s.keywords||s.beginKeywords;let c=null;if("object"==typeof s.keywords&&(c=s.keywords.$pattern,delete s.keywords.$pattern),s.keywords&&(s.keywords=function(e,n){var t={};return"string"==typeof e?r("keyword",e):Object.keys(e).forEach((function(n){r(n,e[n])})),t;function r(e,r){n&&(r=r.toLowerCase()),r.split(" ").forEach((function(n){var r=n.split("|");t[r[0]]=[e,w(r[0],r[1])]}))}}(s.keywords,e.case_insensitive)),s.lexemes&&c)throw Error("ERR: Prefer `keywords.$pattern` to `mode.lexemes`, BOTH are not allowed. (see mode reference) ");return l.keywordPatternRe=n(s.lexemes||c||/\w+/,!0),o&&(s.beginKeywords&&(s.begin="\\b("+s.beginKeywords.split(" ").join("|")+")(?=\\b|\\s)",s.__beforeBegin=i),s.begin||(s.begin=/\B|\b/),l.beginRe=n(s.begin),s.endSameAsBegi
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
SYMBOL INDEX (101 symbols across 5 files)
FILE: docs/book.js
function playground_text (line 7) | function playground_text(playground, hidden = true) {
function fetch_with_timeout (line 21) | function fetch_with_timeout(url, options, timeout = 6000) {
function handle_crate_list_update (line 45) | function handle_crate_list_update(playground_block, playground_crates) {
function update_play_button (line 72) | function update_play_button(pre_block, playground_crates) {
function run_rust_code (line 102) | function run_rust_code(code_block) {
function showThemes (line 298) | function showThemes() {
function updateThemeSelected (line 304) | function updateThemeSelected() {
function hideThemes (line 311) | function hideThemes() {
function get_theme (line 317) | function get_theme() {
function set_theme (line 327) | function set_theme(theme, store = true) {
function showSidebar (line 451) | function showSidebar() {
function toggleSection (line 465) | function toggleSection(ev) {
function hideSidebar (line 473) | function hideSidebar() {
function initResize (line 506) | function initResize(e) {
function resize (line 511) | function resize(e) {
function stopResize (line 524) | function stopResize(e) {
function next (line 562) | function next() {
function prev (line 568) | function prev() {
function hideTooltip (line 598) | function hideTooltip(elem) {
function showTooltip (line 603) | function showTooltip(elem, msg) {
function updateBorder (line 687) | function updateBorder() {
FILE: docs/highlight.js
function e (line 6) | function e(n){Object.freeze(n);var t="function"==typeof n;return Object....
class n (line 6) | class n{constructor(e){void 0===e.data&&(e.data={}),this.data=e.data}ign...
method constructor (line 6) | constructor(e){void 0===e.data&&(e.data={}),this.data=e.data}
method ignoreMatch (line 6) | ignoreMatch(){this.ignore=!0}
function t (line 6) | function t(e){return e.replace(/&/g,"&").replace(/</g,"<").replac...
function r (line 6) | function r(e,...n){var t={};for(const n in e)t[n]=e[n];return n.forEach(...
function a (line 6) | function a(e){return e.nodeName.toLowerCase()}
function l (line 6) | function l(){return e.length&&n.length?e[0].offset!==n[0].offset?e[0].of...
method constructor (line 6) | constructor(e,n){this.buffer="",this.classPrefix=n.classPrefix,e.walk(...
method addText (line 6) | addText(e){this.buffer+=t(e)}
method openNode (line 6) | openNode(e){if(!o(e))return;let n=e.kind;e.sublanguage||(n=`${this.cla...
method closeNode (line 6) | closeNode(e){o(e)&&(this.buffer+=s)}
method value (line 6) | value(){return this.buffer}
method span (line 6) | span(e){this.buffer+=`<span class="${e}">`}
function c (line 6) | function c(e){s+="<"+a(e)+[].map.call(e.attributes,(function(e){return" ...
method constructor (line 6) | constructor(){this.rootNode={children:[]},this.stack=[this.rootNode]}
method top (line 6) | get top(){return this.stack[this.stack.length-1]}
method root (line 6) | get root(){return this.rootNode}
method add (line 6) | add(e){this.top.children.push(e)}
method openNode (line 6) | openNode(e){const n={kind:e,children:[]};this.add(n),this.stack.push(n)}
method closeNode (line 6) | closeNode(){if(this.stack.length>1)return this.stack.pop()}
method closeAllNodes (line 6) | closeAllNodes(){for(;this.closeNode(););}
method toJSON (line 6) | toJSON(){return JSON.stringify(this.rootNode,null,4)}
method walk (line 6) | walk(e){return this.constructor._walk(e,this.rootNode)}
method _walk (line 6) | static _walk(e,n){return"string"==typeof n?e.addText(n):n.children&&(e...
method _collapse (line 6) | static _collapse(e){"string"!=typeof e&&e.children&&(e.children.every(...
function u (line 6) | function u(e){s+="</"+a(e)+">"}
method constructor (line 6) | constructor(e){super(),this.options=e}
method addKeyword (line 6) | addKeyword(e,n){""!==e&&(this.openNode(n),this.addText(e),this.closeNo...
method addText (line 6) | addText(e){""!==e&&this.add(e)}
method addSublanguage (line 6) | addSublanguage(e,n){const t=e.root;t.kind=n,t.sublanguage=!0,this.add(t)}
method toHTML (line 6) | toHTML(){return new l(this,this.options).value()}
method finalize (line 6) | finalize(){return!0}
function d (line 6) | function d(e){("start"===e.event?c:u)(e.node)}
class l (line 6) | class l{constructor(e,n){this.buffer="",this.classPrefix=n.classPrefix,e...
method constructor (line 6) | constructor(e,n){this.buffer="",this.classPrefix=n.classPrefix,e.walk(...
method addText (line 6) | addText(e){this.buffer+=t(e)}
method openNode (line 6) | openNode(e){if(!o(e))return;let n=e.kind;e.sublanguage||(n=`${this.cla...
method closeNode (line 6) | closeNode(e){o(e)&&(this.buffer+=s)}
method value (line 6) | value(){return this.buffer}
method span (line 6) | span(e){this.buffer+=`<span class="${e}">`}
class c (line 6) | class c{constructor(){this.rootNode={children:[]},this.stack=[this.rootN...
method constructor (line 6) | constructor(){this.rootNode={children:[]},this.stack=[this.rootNode]}
method top (line 6) | get top(){return this.stack[this.stack.length-1]}
method root (line 6) | get root(){return this.rootNode}
method add (line 6) | add(e){this.top.children.push(e)}
method openNode (line 6) | openNode(e){const n={kind:e,children:[]};this.add(n),this.stack.push(n)}
method closeNode (line 6) | closeNode(){if(this.stack.length>1)return this.stack.pop()}
method closeAllNodes (line 6) | closeAllNodes(){for(;this.closeNode(););}
method toJSON (line 6) | toJSON(){return JSON.stringify(this.rootNode,null,4)}
method walk (line 6) | walk(e){return this.constructor._walk(e,this.rootNode)}
method _walk (line 6) | static _walk(e,n){return"string"==typeof n?e.addText(n):n.children&&(e...
method _collapse (line 6) | static _collapse(e){"string"!=typeof e&&e.children&&(e.children.every(...
class u (line 6) | class u extends c{constructor(e){super(),this.options=e}addKeyword(e,n){...
method constructor (line 6) | constructor(e){super(),this.options=e}
method addKeyword (line 6) | addKeyword(e,n){""!==e&&(this.openNode(n),this.addText(e),this.closeNo...
method addText (line 6) | addText(e){""!==e&&this.add(e)}
method addSublanguage (line 6) | addSublanguage(e,n){const t=e.root;t.kind=n,t.sublanguage=!0,this.add(t)}
method toHTML (line 6) | toHTML(){return new l(this,this.options).value()}
method finalize (line 6) | finalize(){return!0}
function d (line 6) | function d(e){return e?"string"==typeof e?e:e.source:null}
function w (line 6) | function w(e,n){return n?+n:function(e){return N.includes(e.toLowerCase(...
function p (line 6) | function p(e){return f.noHighlightRe.test(e)}
function b (line 6) | function b(e,n,t,r){var a={code:n,language:e};S("before:highlight",a);va...
function m (line 6) | function m(e,t,a,s){var o=t;function c(e,n){var t=E.case_insensitive?n[0...
function v (line 6) | function v(e,n){n=n||f.languages||Object.keys(i);var t=function(e){const...
function x (line 6) | function x(e){return f.tabReplace||f.useBR?e.replace(c,e=>"\n"===e?f.use...
function E (line 6) | function E(e){let n=null;const t=function(e){var n=e.className+" ";n+=e....
function T (line 6) | function T(e){return e=(e||"").toLowerCase(),i[e]||i[s[e]]}
function A (line 6) | function A(e,{languageName:n}){"string"==typeof e&&(e=[e]),e.forEach(e=>...
function I (line 6) | function I(e){var n=T(e);return n&&!n.disableAutodetect}
function S (line 6) | function S(e,n){var t=e;o.forEach((function(e){e[t]&&e[t](n)}))}
function t (line 9) | function t(e){return"(?:"+e+")?"}
function e (line 18) | function e(e){return e?"string"==typeof e?e:e.source:null}
function n (line 18) | function n(...n){return n.map(n=>e(n)).join("")}
method constructor (line 6) | constructor(e){void 0===e.data&&(e.data={}),this.data=e.data}
method ignoreMatch (line 6) | ignoreMatch(){this.ignore=!0}
function e (line 19) | function e(e){return e?"string"==typeof e?e:e.source:null}
function n (line 19) | function n(e){return a("(",e,")?")}
method constructor (line 6) | constructor(e){void 0===e.data&&(e.data={}),this.data=e.data}
method ignoreMatch (line 6) | ignoreMatch(){this.ignore=!0}
function a (line 19) | function a(...n){return n.map(n=>e(n)).join("")}
function s (line 19) | function s(...n){return"("+n.map(n=>e(n)).join("|")+")"}
function s (line 20) | function s(e){return r("(?=",e,")")}
function r (line 20) | function r(...e){return e.map(e=>(function(e){return e?"string"==typeof ...
function e (line 47) | function e(...e){return e.map(e=>(function(e){return e?"string"==typeof ...
FILE: docs/lint.js
function checkForImproperlyIndentedFencedCodeBlocks (line 72) | function checkForImproperlyIndentedFencedCodeBlocks(fileName, text) {
function getCorrectStartingColumnForLine (line 99) | function getCorrectStartingColumnForLine(lines, lineIndex) {
FILE: docs/searcher.js
function hasFocus (line 57) | function hasFocus() {
function removeChildren (line 61) | function removeChildren(elem) {
function parseURL (line 68) | function parseURL(url) {
function renderURL (line 94) | function renderURL(urlobject) {
function formatSearchMetric (line 128) | function formatSearchMetric(count, searchterm) {
function formatSearchResult (line 138) | function formatSearchResult(result, searchterms) {
function makeTeaser (line 159) | function makeTeaser(body, searchterms) {
function init (line 255) | function init(config) {
function unfocusSearchbar (line 275) | function unfocusSearchbar() {
function doSearchOrMarkFromUrl (line 285) | function doSearchOrMarkFromUrl() {
function globalKeyHandler (line 318) | function globalKeyHandler(e) {
function showSearch (line 367) | function showSearch(yes) {
function showResults (line 381) | function showResults(yes) {
function searchIconClickHandler (line 390) | function searchIconClickHandler() {
function searchbarKeyUpHandler (line 401) | function searchbarKeyUpHandler() {
function setSearchUrlParameters (line 422) | function setSearchUrlParameters(searchterm, action) {
function doSearch (line 443) | function doSearch(searchterm) {
FILE: lint.js
function checkForImproperlyIndentedFencedCodeBlocks (line 72) | function checkForImproperlyIndentedFencedCodeBlocks(fileName, text) {
function getCorrectStartingColumnForLine (line 99) | function getCorrectStartingColumnForLine(lines, lineIndex) {
Copy disabled (too large)
Download .json
Condensed preview — 321 files, each showing path, character count, and a content snippet. Download the .json file for the full structured content (17,689K chars).
[
{
"path": ".gitattributes",
"chars": 107,
"preview": "# Set language\n*.js linguist-language=TypeScript\n\n# Normalize line endings for all text files.\n* text=auto\n"
},
{
"path": ".github/CONTRIBUTING.md",
"chars": 738,
"preview": "# 贡献代码\n\n**Working on your first Pull Request?** You can learn how from this *free* series [How to Contribute to an Open "
},
{
"path": ".github/workflows/nodejs.yml",
"chars": 437,
"preview": "name: test\non: [push]\njobs:\n test:\n runs-on: ubuntu-latest\n steps:\n - name: Check out code\n uses: act"
},
{
"path": ".gitignore",
"chars": 42,
"preview": "node_modules/\r\n.DS_Store\r\n_book\r\n.yarn/*\r\n"
},
{
"path": ".travis.yml",
"chars": 36,
"preview": "language: node_js\nnode_js:\n - \"node\""
},
{
"path": ".yarnrc.yml",
"chars": 25,
"preview": "nodeLinker: node-modules\n"
},
{
"path": "CONTRIBUTING.md",
"chars": 237,
"preview": "# 如何贡献代码\n\n首先,感谢你的奉献精神!步骤如下:\n\n* 从队列中选择一项待翻译的条目。\n\n [翻译列表](https://github.com/zhongsp/TypeScript/issues?q=is%3Aissue+is%3A"
},
{
"path": "LICENSE",
"chars": 1083,
"preview": "The MIT License (MIT)\n\nCopyright (c) 2015 Shengping Zhong\n\nPermission is hereby granted, free of charge, to any person o"
},
{
"path": "PREFACE.md",
"chars": 1662,
"preview": "# 前言\n\n> Repo: [https://github.com/zhongsp/TypeScript](https://github.com/zhongsp/TypeScript)\n\n该工程是对 TypeScript 官方及开源社区书写"
},
{
"path": "README.md",
"chars": 8825,
"preview": "# TypeScript\n\n[](https://travis-ci.org/zhongs"
},
{
"path": "SUMMARY.md",
"chars": 6859,
"preview": "# TypeScript 使用指南手册\n\n[前言](PREFACE.md)\n\n# 快速上手\n\n- [快速上手](zh/tutorials/README.md)\n - [5 分钟了解 TypeScript](zh/tutorials/typ"
},
{
"path": "book.toml",
"chars": 386,
"preview": "[book]\nauthors = [\"钟胜平\", \"zhongsp\"]\nlanguage = \"zh-Hans\"\nmultilingual = false\nsrc = \"./\"\ntitle = \"TypeScript 使用指南手册\"\ndes"
},
{
"path": "docs/.nojekyll",
"chars": 72,
"preview": "This file makes sure that Github Pages doesn't process mdBook's output.\n"
},
{
"path": "docs/.travis.yml",
"chars": 36,
"preview": "language: node_js\nnode_js:\n - \"node\""
},
{
"path": "docs/404.html",
"chars": 27862,
"preview": "<!DOCTYPE HTML>\n<html lang=\"zh-Hans\" class=\"light\" dir=\"ltr\">\n <head>\n <!-- Book generated using mdBook -->\n "
},
{
"path": "docs/FontAwesome/css/font-awesome.css",
"chars": 31000,
"preview": "/*!\n * Font Awesome 4.7.0 by @davegandy - http://fontawesome.io - @fontawesome\n * License - http://fontawesome.io/lice"
},
{
"path": "docs/LICENSE",
"chars": 1083,
"preview": "The MIT License (MIT)\n\nCopyright (c) 2015 Shengping Zhong\n\nPermission is hereby granted, free of charge, to any person o"
},
{
"path": "docs/PREFACE.html",
"chars": 30201,
"preview": "<!DOCTYPE HTML>\n<html lang=\"zh-Hans\" class=\"light\" dir=\"ltr\">\n <head>\n <!-- Book generated using mdBook -->\n "
},
{
"path": "docs/ayu-highlight.css",
"chars": 929,
"preview": "/*\nBased off of the Ayu theme\nOriginal by Dempfi (https://github.com/dempfi/ayu)\n*/\n\n.hljs {\n display: block;\n overflo"
},
{
"path": "docs/book.js",
"chars": 25437,
"preview": "\"use strict\";\n\n// Fix back button cache problem\nwindow.onunload = function () { };\n\n// Global variable, shared between m"
},
{
"path": "docs/book.toml",
"chars": 386,
"preview": "[book]\nauthors = [\"钟胜平\", \"zhongsp\"]\nlanguage = \"zh-Hans\"\nmultilingual = false\nsrc = \"./\"\ntitle = \"TypeScript 使用指南手册\"\ndes"
},
{
"path": "docs/css/chrome.css",
"chars": 13207,
"preview": "/* CSS for UI elements (a.k.a. chrome) */\n\n@import 'variables.css';\n\nhtml {\n scrollbar-color: var(--scrollbar) var(--"
},
{
"path": "docs/css/general.css",
"chars": 5244,
"preview": "/* Base styles and content styles */\n\n@import 'variables.css';\n\n:root {\n /* Browser default font-size is 16px, this w"
},
{
"path": "docs/css/print.css",
"chars": 661,
"preview": "\n#sidebar,\n#menu-bar,\n.nav-chapters,\n.mobile-nav-chapters {\n display: none;\n}\n\n#page-wrapper.page-wrapper {\n trans"
},
{
"path": "docs/css/variables.css",
"chars": 6563,
"preview": "\n/* Globals */\n\n:root {\n --sidebar-width: 300px;\n --sidebar-resize-indicator-width: 8px;\n --sidebar-resize-indi"
},
{
"path": "docs/fonts/OPEN-SANS-LICENSE.txt",
"chars": 11358,
"preview": "\n Apache License\n Version 2.0, January 2004\n "
},
{
"path": "docs/fonts/SOURCE-CODE-PRO-LICENSE.txt",
"chars": 4528,
"preview": "Copyright 2010, 2012 Adobe Systems Incorporated (http://www.adobe.com/), with Reserved Font Name 'Source'. All Rights Re"
},
{
"path": "docs/fonts/fonts.css",
"chars": 3620,
"preview": "/* Open Sans is licensed under the Apache License, Version 2.0. See http://www.apache.org/licenses/LICENSE-2.0 */\n/* Sou"
},
{
"path": "docs/gulpfile.js",
"chars": 495,
"preview": "var gulp = require('gulp'),\n ts = require('gulp-typescript');\n\ngulp.task('typescript', function() {\n var tsResult = gu"
},
{
"path": "docs/highlight.css",
"chars": 1197,
"preview": "/*\n * An increased contrast highlighting scheme loosely based on the\n * \"Base16 Atelier Dune Light\" theme by Bram de Haa"
},
{
"path": "docs/highlight.js",
"chars": 136862,
"preview": "/*\n Highlight.js 10.1.1 (93fd0d73)\n License: BSD-3-Clause\n Copyright (c) 2006-2020, Ivan Sagalaev\n*/\nvar hljs=functio"
},
{
"path": "docs/index.html",
"chars": 30201,
"preview": "<!DOCTYPE HTML>\n<html lang=\"zh-Hans\" class=\"light\" dir=\"ltr\">\n <head>\n <!-- Book generated using mdBook -->\n "
},
{
"path": "docs/lint.js",
"chars": 4183,
"preview": "var markdownlint = require(\"markdownlint\");\nvar glob = require(\"glob\");\nvar fs = require(\"fs\");\n\nvar inputFiles = glob.s"
},
{
"path": "docs/package.json",
"chars": 725,
"preview": "{\n \"name\": \"typescript-handbook-cn\",\n \"version\": \"1.0.0\",\n \"description\": \"The TypeScript Handbook is a comprehensive"
},
{
"path": "docs/print.html",
"chars": 1178038,
"preview": "<!DOCTYPE HTML>\n<html lang=\"zh-Hans\" class=\"light\" dir=\"ltr\">\n <head>\n <!-- Book generated using mdBook -->\n "
},
{
"path": "docs/searcher.js",
"chars": 18547,
"preview": "\"use strict\";\nwindow.search = window.search || {};\n(function search(search) {\n // Search functionality\n //\n // "
},
{
"path": "docs/searchindex.js",
"chars": 4174901,
"preview": "Object.assign(window.search, {\"doc_urls\":[\"PREFACE.html#前言\",\"PREFACE.html#哪些内容会继续更新\",\"PREFACE.html#哪些内容可能不会继续更新\",\"PREFAC"
},
{
"path": "docs/searchindex.json",
"chars": 4174870,
"preview": "{\"doc_urls\":[\"PREFACE.html#前言\",\"PREFACE.html#哪些内容会继续更新\",\"PREFACE.html#哪些内容可能不会继续更新\",\"PREFACE.html#关于typescript入门与实战一书\",\""
},
{
"path": "docs/tomorrow-night.css",
"chars": 1667,
"preview": "/* Tomorrow Night Theme */\n/* https://github.com/jmblog/color-themes-for-highlightjs */\n/* Original theme - https://gith"
},
{
"path": "docs/zh/breaking-changes/index.html",
"chars": 30996,
"preview": "<!DOCTYPE HTML>\n<html lang=\"zh-Hans\" class=\"light\" dir=\"ltr\">\n <head>\n <!-- Book generated using mdBook -->\n "
},
{
"path": "docs/zh/breaking-changes/typescript-1.4.html",
"chars": 32937,
"preview": "<!DOCTYPE HTML>\n<html lang=\"zh-Hans\" class=\"light\" dir=\"ltr\">\n <head>\n <!-- Book generated using mdBook -->\n "
},
{
"path": "docs/zh/breaking-changes/typescript-1.5.html",
"chars": 35439,
"preview": "<!DOCTYPE HTML>\n<html lang=\"zh-Hans\" class=\"light\" dir=\"ltr\">\n <head>\n <!-- Book generated using mdBook -->\n "
},
{
"path": "docs/zh/breaking-changes/typescript-1.6.html",
"chars": 35262,
"preview": "<!DOCTYPE HTML>\n<html lang=\"zh-Hans\" class=\"light\" dir=\"ltr\">\n <head>\n <!-- Book generated using mdBook -->\n "
},
{
"path": "docs/zh/breaking-changes/typescript-1.7.html",
"chars": 31506,
"preview": "<!DOCTYPE HTML>\n<html lang=\"zh-Hans\" class=\"light\" dir=\"ltr\">\n <head>\n <!-- Book generated using mdBook -->\n "
},
{
"path": "docs/zh/breaking-changes/typescript-1.8.html",
"chars": 35055,
"preview": "<!DOCTYPE HTML>\n<html lang=\"zh-Hans\" class=\"light\" dir=\"ltr\">\n <head>\n <!-- Book generated using mdBook -->\n "
},
{
"path": "docs/zh/breaking-changes/typescript-2.0.html",
"chars": 32905,
"preview": "<!DOCTYPE HTML>\n<html lang=\"zh-Hans\" class=\"light\" dir=\"ltr\">\n <head>\n <!-- Book generated using mdBook -->\n "
},
{
"path": "docs/zh/breaking-changes/typescript-2.1.html",
"chars": 36592,
"preview": "<!DOCTYPE HTML>\n<html lang=\"zh-Hans\" class=\"light\" dir=\"ltr\">\n <head>\n <!-- Book generated using mdBook -->\n "
},
{
"path": "docs/zh/breaking-changes/typescript-2.2.html",
"chars": 30263,
"preview": "<!DOCTYPE HTML>\n<html lang=\"zh-Hans\" class=\"light\" dir=\"ltr\">\n <head>\n <!-- Book generated using mdBook -->\n "
},
{
"path": "docs/zh/breaking-changes/typescript-2.3.html",
"chars": 30351,
"preview": "<!DOCTYPE HTML>\n<html lang=\"zh-Hans\" class=\"light\" dir=\"ltr\">\n <head>\n <!-- Book generated using mdBook -->\n "
},
{
"path": "docs/zh/breaking-changes/typescript-2.4.html",
"chars": 34125,
"preview": "<!DOCTYPE HTML>\n<html lang=\"zh-Hans\" class=\"light\" dir=\"ltr\">\n <head>\n <!-- Book generated using mdBook -->\n "
},
{
"path": "docs/zh/breaking-changes/typescript-2.6.html",
"chars": 31207,
"preview": "<!DOCTYPE HTML>\n<html lang=\"zh-Hans\" class=\"light\" dir=\"ltr\">\n <head>\n <!-- Book generated using mdBook -->\n "
},
{
"path": "docs/zh/breaking-changes/typescript-2.7.html",
"chars": 33297,
"preview": "<!DOCTYPE HTML>\n<html lang=\"zh-Hans\" class=\"light\" dir=\"ltr\">\n <head>\n <!-- Book generated using mdBook -->\n "
},
{
"path": "docs/zh/breaking-changes/typescript-2.8.html",
"chars": 31405,
"preview": "<!DOCTYPE HTML>\n<html lang=\"zh-Hans\" class=\"light\" dir=\"ltr\">\n <head>\n <!-- Book generated using mdBook -->\n "
},
{
"path": "docs/zh/breaking-changes/typescript-2.9.html",
"chars": 32043,
"preview": "<!DOCTYPE HTML>\n<html lang=\"zh-Hans\" class=\"light\" dir=\"ltr\">\n <head>\n <!-- Book generated using mdBook -->\n "
},
{
"path": "docs/zh/breaking-changes/typescript-3.0.html",
"chars": 31267,
"preview": "<!DOCTYPE HTML>\n<html lang=\"zh-Hans\" class=\"light\" dir=\"ltr\">\n <head>\n <!-- Book generated using mdBook -->\n "
},
{
"path": "docs/zh/breaking-changes/typescript-3.1.html",
"chars": 35839,
"preview": "<!DOCTYPE HTML>\n<html lang=\"zh-Hans\" class=\"light\" dir=\"ltr\">\n <head>\n <!-- Book generated using mdBook -->\n "
},
{
"path": "docs/zh/breaking-changes/typescript-3.2.html",
"chars": 30512,
"preview": "<!DOCTYPE HTML>\n<html lang=\"zh-Hans\" class=\"light\" dir=\"ltr\">\n <head>\n <!-- Book generated using mdBook -->\n "
},
{
"path": "docs/zh/breaking-changes/typescript-3.4.html",
"chars": 33705,
"preview": "<!DOCTYPE HTML>\n<html lang=\"zh-Hans\" class=\"light\" dir=\"ltr\">\n <head>\n <!-- Book generated using mdBook -->\n "
},
{
"path": "docs/zh/breaking-changes/typescript-3.5.html",
"chars": 30249,
"preview": "<!DOCTYPE HTML>\n<html lang=\"zh-Hans\" class=\"light\" dir=\"ltr\">\n <head>\n <!-- Book generated using mdBook -->\n "
},
{
"path": "docs/zh/breaking-changes/typescript-3.6.html",
"chars": 31743,
"preview": "<!DOCTYPE HTML>\n<html lang=\"zh-Hans\" class=\"light\" dir=\"ltr\">\n <head>\n <!-- Book generated using mdBook -->\n "
},
{
"path": "docs/zh/declaration-files/by-example.html",
"chars": 35497,
"preview": "<!DOCTYPE HTML>\n<html lang=\"zh-Hans\" class=\"light\" dir=\"ltr\">\n <head>\n <!-- Book generated using mdBook -->\n "
},
{
"path": "docs/zh/declaration-files/consumption.html",
"chars": 30840,
"preview": "<!DOCTYPE HTML>\n<html lang=\"zh-Hans\" class=\"light\" dir=\"ltr\">\n <head>\n <!-- Book generated using mdBook -->\n "
},
{
"path": "docs/zh/declaration-files/deep-dive.html",
"chars": 35310,
"preview": "<!DOCTYPE HTML>\n<html lang=\"zh-Hans\" class=\"light\" dir=\"ltr\">\n <head>\n <!-- Book generated using mdBook -->\n "
},
{
"path": "docs/zh/declaration-files/do-s-and-don-ts.html",
"chars": 36174,
"preview": "<!DOCTYPE HTML>\n<html lang=\"zh-Hans\" class=\"light\" dir=\"ltr\">\n <head>\n <!-- Book generated using mdBook -->\n "
},
{
"path": "docs/zh/declaration-files/index.html",
"chars": 30148,
"preview": "<!DOCTYPE HTML>\n<html lang=\"zh-Hans\" class=\"light\" dir=\"ltr\">\n <head>\n <!-- Book generated using mdBook -->\n "
},
{
"path": "docs/zh/declaration-files/introduction.html",
"chars": 31976,
"preview": "<!DOCTYPE HTML>\n<html lang=\"zh-Hans\" class=\"light\" dir=\"ltr\">\n <head>\n <!-- Book generated using mdBook -->\n "
},
{
"path": "docs/zh/declaration-files/library-structures.html",
"chars": 40871,
"preview": "<!DOCTYPE HTML>\n<html lang=\"zh-Hans\" class=\"light\" dir=\"ltr\">\n <head>\n <!-- Book generated using mdBook -->\n "
},
{
"path": "docs/zh/declaration-files/publishing.html",
"chars": 35404,
"preview": "<!DOCTYPE HTML>\n<html lang=\"zh-Hans\" class=\"light\" dir=\"ltr\">\n <head>\n <!-- Book generated using mdBook -->\n "
},
{
"path": "docs/zh/declaration-files/templates.html",
"chars": 30268,
"preview": "<!DOCTYPE HTML>\n<html lang=\"zh-Hans\" class=\"light\" dir=\"ltr\">\n <head>\n <!-- Book generated using mdBook -->\n "
},
{
"path": "docs/zh/handbook/basic-types.html",
"chars": 40378,
"preview": "<!DOCTYPE HTML>\n<html lang=\"zh-Hans\" class=\"light\" dir=\"ltr\">\n <head>\n <!-- Book generated using mdBook -->\n "
},
{
"path": "docs/zh/handbook/classes.html",
"chars": 44480,
"preview": "<!DOCTYPE HTML>\n<html lang=\"zh-Hans\" class=\"light\" dir=\"ltr\">\n <head>\n <!-- Book generated using mdBook -->\n "
},
{
"path": "docs/zh/handbook/enums.html",
"chars": 37600,
"preview": "<!DOCTYPE HTML>\n<html lang=\"zh-Hans\" class=\"light\" dir=\"ltr\">\n <head>\n <!-- Book generated using mdBook -->\n "
},
{
"path": "docs/zh/handbook/functions.html",
"chars": 44571,
"preview": "<!DOCTYPE HTML>\n<html lang=\"zh-Hans\" class=\"light\" dir=\"ltr\">\n <head>\n <!-- Book generated using mdBook -->\n "
},
{
"path": "docs/zh/handbook/generics.html",
"chars": 38248,
"preview": "<!DOCTYPE HTML>\n<html lang=\"zh-Hans\" class=\"light\" dir=\"ltr\">\n <head>\n <!-- Book generated using mdBook -->\n "
},
{
"path": "docs/zh/handbook/index.html",
"chars": 30068,
"preview": "<!DOCTYPE HTML>\n<html lang=\"zh-Hans\" class=\"light\" dir=\"ltr\">\n <head>\n <!-- Book generated using mdBook -->\n "
},
{
"path": "docs/zh/handbook/interfaces.html",
"chars": 45220,
"preview": "<!DOCTYPE HTML>\n<html lang=\"zh-Hans\" class=\"light\" dir=\"ltr\">\n <head>\n <!-- Book generated using mdBook -->\n "
},
{
"path": "docs/zh/handbook/literal-types.html",
"chars": 32849,
"preview": "<!DOCTYPE HTML>\n<html lang=\"zh-Hans\" class=\"light\" dir=\"ltr\">\n <head>\n <!-- Book generated using mdBook -->\n "
},
{
"path": "docs/zh/handbook/unions-and-intersections.html",
"chars": 38808,
"preview": "<!DOCTYPE HTML>\n<html lang=\"zh-Hans\" class=\"light\" dir=\"ltr\">\n <head>\n <!-- Book generated using mdBook -->\n "
},
{
"path": "docs/zh/handbook-v2/index.html",
"chars": 30753,
"preview": "<!DOCTYPE HTML>\n<html lang=\"zh-Hans\" class=\"light\" dir=\"ltr\">\n <head>\n <!-- Book generated using mdBook -->\n "
},
{
"path": "docs/zh/handbook-v2/type-manipulation/template-literal-types.html",
"chars": 37493,
"preview": "<!DOCTYPE HTML>\n<html lang=\"zh-Hans\" class=\"light\" dir=\"ltr\">\n <head>\n <!-- Book generated using mdBook -->\n "
},
{
"path": "docs/zh/javascript/type-checking-javascript-files.html",
"chars": 50436,
"preview": "<!DOCTYPE HTML>\n<html lang=\"zh-Hans\" class=\"light\" dir=\"ltr\">\n <head>\n <!-- Book generated using mdBook -->\n "
},
{
"path": "docs/zh/project-config/compiler-options-in-msbuild.html",
"chars": 44576,
"preview": "<!DOCTYPE HTML>\n<html lang=\"zh-Hans\" class=\"light\" dir=\"ltr\">\n <head>\n <!-- Book generated using mdBook -->\n "
},
{
"path": "docs/zh/project-config/compiler-options.html",
"chars": 54459,
"preview": "<!DOCTYPE HTML>\n<html lang=\"zh-Hans\" class=\"light\" dir=\"ltr\">\n <head>\n <!-- Book generated using mdBook -->\n "
},
{
"path": "docs/zh/project-config/configuring-watch.html",
"chars": 32881,
"preview": "<!DOCTYPE HTML>\n<html lang=\"zh-Hans\" class=\"light\" dir=\"ltr\">\n <head>\n <!-- Book generated using mdBook -->\n "
},
{
"path": "docs/zh/project-config/index.html",
"chars": 30346,
"preview": "<!DOCTYPE HTML>\n<html lang=\"zh-Hans\" class=\"light\" dir=\"ltr\">\n <head>\n <!-- Book generated using mdBook -->\n "
},
{
"path": "docs/zh/project-config/integrating-with-build-tools.html",
"chars": 38649,
"preview": "<!DOCTYPE HTML>\n<html lang=\"zh-Hans\" class=\"light\" dir=\"ltr\">\n <head>\n <!-- Book generated using mdBook -->\n "
},
{
"path": "docs/zh/project-config/nightly-builds.html",
"chars": 32639,
"preview": "<!DOCTYPE HTML>\n<html lang=\"zh-Hans\" class=\"light\" dir=\"ltr\">\n <head>\n <!-- Book generated using mdBook -->\n "
},
{
"path": "docs/zh/project-config/project-references.html",
"chars": 37069,
"preview": "<!DOCTYPE HTML>\n<html lang=\"zh-Hans\" class=\"light\" dir=\"ltr\">\n <head>\n <!-- Book generated using mdBook -->\n "
},
{
"path": "docs/zh/project-config/tsconfig.json.html",
"chars": 36435,
"preview": "<!DOCTYPE HTML>\n<html lang=\"zh-Hans\" class=\"light\" dir=\"ltr\">\n <head>\n <!-- Book generated using mdBook -->\n "
},
{
"path": "docs/zh/project-config/typings-for-npm-packages.html",
"chars": 29745,
"preview": "<!DOCTYPE HTML>\n<html lang=\"zh-Hans\" class=\"light\" dir=\"ltr\">\n <head>\n <!-- Book generated using mdBook -->\n "
},
{
"path": "docs/zh/reference/advanced-types.html",
"chars": 68761,
"preview": "<!DOCTYPE HTML>\n<html lang=\"zh-Hans\" class=\"light\" dir=\"ltr\">\n <head>\n <!-- Book generated using mdBook -->\n "
},
{
"path": "docs/zh/reference/declaration-merging.html",
"chars": 38407,
"preview": "<!DOCTYPE HTML>\n<html lang=\"zh-Hans\" class=\"light\" dir=\"ltr\">\n <head>\n <!-- Book generated using mdBook -->\n "
},
{
"path": "docs/zh/reference/decorators.html",
"chars": 43794,
"preview": "<!DOCTYPE HTML>\n<html lang=\"zh-Hans\" class=\"light\" dir=\"ltr\">\n <head>\n <!-- Book generated using mdBook -->\n "
},
{
"path": "docs/zh/reference/index.html",
"chars": 30499,
"preview": "<!DOCTYPE HTML>\n<html lang=\"zh-Hans\" class=\"light\" dir=\"ltr\">\n <head>\n <!-- Book generated using mdBook -->\n "
},
{
"path": "docs/zh/reference/iterators-and-generators.html",
"chars": 32243,
"preview": "<!DOCTYPE HTML>\n<html lang=\"zh-Hans\" class=\"light\" dir=\"ltr\">\n <head>\n <!-- Book generated using mdBook -->\n "
},
{
"path": "docs/zh/reference/jsx.html",
"chars": 42786,
"preview": "<!DOCTYPE HTML>\n<html lang=\"zh-Hans\" class=\"light\" dir=\"ltr\">\n <head>\n <!-- Book generated using mdBook -->\n "
},
{
"path": "docs/zh/reference/mixins.html",
"chars": 33437,
"preview": "<!DOCTYPE HTML>\n<html lang=\"zh-Hans\" class=\"light\" dir=\"ltr\">\n <head>\n <!-- Book generated using mdBook -->\n "
},
{
"path": "docs/zh/reference/module-resolution.html",
"chars": 47523,
"preview": "<!DOCTYPE HTML>\n<html lang=\"zh-Hans\" class=\"light\" dir=\"ltr\">\n <head>\n <!-- Book generated using mdBook -->\n "
},
{
"path": "docs/zh/reference/modules.html",
"chars": 54358,
"preview": "<!DOCTYPE HTML>\n<html lang=\"zh-Hans\" class=\"light\" dir=\"ltr\">\n <head>\n <!-- Book generated using mdBook -->\n "
},
{
"path": "docs/zh/reference/namespaces-and-modules.html",
"chars": 33571,
"preview": "<!DOCTYPE HTML>\n<html lang=\"zh-Hans\" class=\"light\" dir=\"ltr\">\n <head>\n <!-- Book generated using mdBook -->\n "
},
{
"path": "docs/zh/reference/namespaces.html",
"chars": 37991,
"preview": "<!DOCTYPE HTML>\n<html lang=\"zh-Hans\" class=\"light\" dir=\"ltr\">\n <head>\n <!-- Book generated using mdBook -->\n "
},
{
"path": "docs/zh/reference/symbols.html",
"chars": 32685,
"preview": "<!DOCTYPE HTML>\n<html lang=\"zh-Hans\" class=\"light\" dir=\"ltr\">\n <head>\n <!-- Book generated using mdBook -->\n "
},
{
"path": "docs/zh/reference/triple-slash-directives.html",
"chars": 33888,
"preview": "<!DOCTYPE HTML>\n<html lang=\"zh-Hans\" class=\"light\" dir=\"ltr\">\n <head>\n <!-- Book generated using mdBook -->\n "
},
{
"path": "docs/zh/reference/type-compatibility.html",
"chars": 37125,
"preview": "<!DOCTYPE HTML>\n<html lang=\"zh-Hans\" class=\"light\" dir=\"ltr\">\n <head>\n <!-- Book generated using mdBook -->\n "
},
{
"path": "docs/zh/reference/type-inference.html",
"chars": 32913,
"preview": "<!DOCTYPE HTML>\n<html lang=\"zh-Hans\" class=\"light\" dir=\"ltr\">\n <head>\n <!-- Book generated using mdBook -->\n "
},
{
"path": "docs/zh/reference/utility-types.html",
"chars": 42316,
"preview": "<!DOCTYPE HTML>\n<html lang=\"zh-Hans\" class=\"light\" dir=\"ltr\">\n <head>\n <!-- Book generated using mdBook -->\n "
},
{
"path": "docs/zh/reference/variable-declarations.html",
"chars": 45774,
"preview": "<!DOCTYPE HTML>\n<html lang=\"zh-Hans\" class=\"light\" dir=\"ltr\">\n <head>\n <!-- Book generated using mdBook -->\n "
},
{
"path": "docs/zh/release-notes/index.html",
"chars": 32162,
"preview": "<!DOCTYPE HTML>\n<html lang=\"zh-Hans\" class=\"light\" dir=\"ltr\">\n <head>\n <!-- Book generated using mdBook -->\n "
},
{
"path": "docs/zh/release-notes/typescript-1.1.html",
"chars": 30475,
"preview": "<!DOCTYPE HTML>\n<html lang=\"zh-Hans\" class=\"light\" dir=\"ltr\">\n <head>\n <!-- Book generated using mdBook -->\n "
},
{
"path": "docs/zh/release-notes/typescript-1.3.html",
"chars": 30948,
"preview": "<!DOCTYPE HTML>\n<html lang=\"zh-Hans\" class=\"light\" dir=\"ltr\">\n <head>\n <!-- Book generated using mdBook -->\n "
},
{
"path": "docs/zh/release-notes/typescript-1.4.html",
"chars": 36675,
"preview": "<!DOCTYPE HTML>\n<html lang=\"zh-Hans\" class=\"light\" dir=\"ltr\">\n <head>\n <!-- Book generated using mdBook -->\n "
},
{
"path": "docs/zh/release-notes/typescript-1.5.html",
"chars": 41344,
"preview": "<!DOCTYPE HTML>\n<html lang=\"zh-Hans\" class=\"light\" dir=\"ltr\">\n <head>\n <!-- Book generated using mdBook -->\n "
},
{
"path": "docs/zh/release-notes/typescript-1.6.html",
"chars": 42165,
"preview": "<!DOCTYPE HTML>\n<html lang=\"zh-Hans\" class=\"light\" dir=\"ltr\">\n <head>\n <!-- Book generated using mdBook -->\n "
},
{
"path": "docs/zh/release-notes/typescript-1.7.html",
"chars": 35578,
"preview": "<!DOCTYPE HTML>\n<html lang=\"zh-Hans\" class=\"light\" dir=\"ltr\">\n <head>\n <!-- Book generated using mdBook -->\n "
},
{
"path": "docs/zh/release-notes/typescript-1.8.html",
"chars": 48368,
"preview": "<!DOCTYPE HTML>\n<html lang=\"zh-Hans\" class=\"light\" dir=\"ltr\">\n <head>\n <!-- Book generated using mdBook -->\n "
},
{
"path": "docs/zh/release-notes/typescript-2.0.html",
"chars": 56962,
"preview": "<!DOCTYPE HTML>\n<html lang=\"zh-Hans\" class=\"light\" dir=\"ltr\">\n <head>\n <!-- Book generated using mdBook -->\n "
},
{
"path": "docs/zh/release-notes/typescript-2.1.html",
"chars": 44683,
"preview": "<!DOCTYPE HTML>\n<html lang=\"zh-Hans\" class=\"light\" dir=\"ltr\">\n <head>\n <!-- Book generated using mdBook -->\n "
},
{
"path": "docs/zh/release-notes/typescript-2.2.html",
"chars": 36996,
"preview": "<!DOCTYPE HTML>\n<html lang=\"zh-Hans\" class=\"light\" dir=\"ltr\">\n <head>\n <!-- Book generated using mdBook -->\n "
},
{
"path": "docs/zh/release-notes/typescript-2.3.html",
"chars": 37479,
"preview": "<!DOCTYPE HTML>\n<html lang=\"zh-Hans\" class=\"light\" dir=\"ltr\">\n <head>\n <!-- Book generated using mdBook -->\n "
},
{
"path": "docs/zh/release-notes/typescript-2.4.html",
"chars": 34043,
"preview": "<!DOCTYPE HTML>\n<html lang=\"zh-Hans\" class=\"light\" dir=\"ltr\">\n <head>\n <!-- Book generated using mdBook -->\n "
},
{
"path": "docs/zh/release-notes/typescript-2.5.html",
"chars": 31918,
"preview": "<!DOCTYPE HTML>\n<html lang=\"zh-Hans\" class=\"light\" dir=\"ltr\">\n <head>\n <!-- Book generated using mdBook -->\n "
},
{
"path": "docs/zh/release-notes/typescript-2.6.html",
"chars": 38553,
"preview": "<!DOCTYPE HTML>\n<html lang=\"zh-Hans\" class=\"light\" dir=\"ltr\">\n <head>\n <!-- Book generated using mdBook -->\n "
},
{
"path": "docs/zh/release-notes/typescript-2.7.html",
"chars": 41560,
"preview": "<!DOCTYPE HTML>\n<html lang=\"zh-Hans\" class=\"light\" dir=\"ltr\">\n <head>\n <!-- Book generated using mdBook -->\n "
},
{
"path": "docs/zh/release-notes/typescript-2.8.html",
"chars": 45714,
"preview": "<!DOCTYPE HTML>\n<html lang=\"zh-Hans\" class=\"light\" dir=\"ltr\">\n <head>\n <!-- Book generated using mdBook -->\n "
},
{
"path": "docs/zh/release-notes/typescript-2.9.html",
"chars": 39663,
"preview": "<!DOCTYPE HTML>\n<html lang=\"zh-Hans\" class=\"light\" dir=\"ltr\">\n <head>\n <!-- Book generated using mdBook -->\n "
},
{
"path": "docs/zh/release-notes/typescript-3.0.html",
"chars": 40980,
"preview": "<!DOCTYPE HTML>\n<html lang=\"zh-Hans\" class=\"light\" dir=\"ltr\">\n <head>\n <!-- Book generated using mdBook -->\n "
},
{
"path": "docs/zh/release-notes/typescript-3.1.html",
"chars": 33808,
"preview": "<!DOCTYPE HTML>\n<html lang=\"zh-Hans\" class=\"light\" dir=\"ltr\">\n <head>\n <!-- Book generated using mdBook -->\n "
},
{
"path": "docs/zh/release-notes/typescript-3.2.html",
"chars": 38430,
"preview": "<!DOCTYPE HTML>\n<html lang=\"zh-Hans\" class=\"light\" dir=\"ltr\">\n <head>\n <!-- Book generated using mdBook -->\n "
},
{
"path": "docs/zh/release-notes/typescript-3.3.html",
"chars": 33541,
"preview": "<!DOCTYPE HTML>\n<html lang=\"zh-Hans\" class=\"light\" dir=\"ltr\">\n <head>\n <!-- Book generated using mdBook -->\n "
},
{
"path": "docs/zh/release-notes/typescript-3.4.html",
"chars": 42359,
"preview": "<!DOCTYPE HTML>\n<html lang=\"zh-Hans\" class=\"light\" dir=\"ltr\">\n <head>\n <!-- Book generated using mdBook -->\n "
},
{
"path": "docs/zh/release-notes/typescript-3.5.html",
"chars": 36435,
"preview": "<!DOCTYPE HTML>\n<html lang=\"zh-Hans\" class=\"light\" dir=\"ltr\">\n <head>\n <!-- Book generated using mdBook -->\n "
},
{
"path": "docs/zh/release-notes/typescript-3.6.html",
"chars": 42060,
"preview": "<!DOCTYPE HTML>\n<html lang=\"zh-Hans\" class=\"light\" dir=\"ltr\">\n <head>\n <!-- Book generated using mdBook -->\n "
},
{
"path": "docs/zh/release-notes/typescript-3.7.html",
"chars": 55175,
"preview": "<!DOCTYPE HTML>\n<html lang=\"zh-Hans\" class=\"light\" dir=\"ltr\">\n <head>\n <!-- Book generated using mdBook -->\n "
},
{
"path": "docs/zh/release-notes/typescript-3.8.html",
"chars": 51816,
"preview": "<!DOCTYPE HTML>\n<html lang=\"zh-Hans\" class=\"light\" dir=\"ltr\">\n <head>\n <!-- Book generated using mdBook -->\n "
},
{
"path": "docs/zh/release-notes/typescript-3.9.html",
"chars": 40371,
"preview": "<!DOCTYPE HTML>\n<html lang=\"zh-Hans\" class=\"light\" dir=\"ltr\">\n <head>\n <!-- Book generated using mdBook -->\n "
},
{
"path": "docs/zh/release-notes/typescript-4.0.html",
"chars": 50581,
"preview": "<!DOCTYPE HTML>\n<html lang=\"zh-Hans\" class=\"light\" dir=\"ltr\">\n <head>\n <!-- Book generated using mdBook -->\n "
},
{
"path": "docs/zh/release-notes/typescript-4.1.html",
"chars": 49282,
"preview": "<!DOCTYPE HTML>\n<html lang=\"zh-Hans\" class=\"light\" dir=\"ltr\">\n <head>\n <!-- Book generated using mdBook -->\n "
},
{
"path": "docs/zh/release-notes/typescript-4.2.html",
"chars": 51674,
"preview": "<!DOCTYPE HTML>\n<html lang=\"zh-Hans\" class=\"light\" dir=\"ltr\">\n <head>\n <!-- Book generated using mdBook -->\n "
},
{
"path": "docs/zh/release-notes/typescript-4.3.html",
"chars": 50512,
"preview": "<!DOCTYPE HTML>\n<html lang=\"zh-Hans\" class=\"light\" dir=\"ltr\">\n <head>\n <!-- Book generated using mdBook -->\n "
},
{
"path": "docs/zh/release-notes/typescript-4.4.html",
"chars": 51583,
"preview": "<!DOCTYPE HTML>\n<html lang=\"zh-Hans\" class=\"light\" dir=\"ltr\">\n <head>\n <!-- Book generated using mdBook -->\n "
},
{
"path": "docs/zh/release-notes/typescript-4.5.html",
"chars": 45838,
"preview": "<!DOCTYPE HTML>\n<html lang=\"zh-Hans\" class=\"light\" dir=\"ltr\">\n <head>\n <!-- Book generated using mdBook -->\n "
},
{
"path": "docs/zh/release-notes/typescript-4.6.html",
"chars": 41263,
"preview": "<!DOCTYPE HTML>\n<html lang=\"zh-Hans\" class=\"light\" dir=\"ltr\">\n <head>\n <!-- Book generated using mdBook -->\n "
},
{
"path": "docs/zh/release-notes/typescript-4.7.html",
"chars": 54552,
"preview": "<!DOCTYPE HTML>\n<html lang=\"zh-Hans\" class=\"light\" dir=\"ltr\">\n <head>\n <!-- Book generated using mdBook -->\n "
},
{
"path": "docs/zh/release-notes/typescript-4.8.html",
"chars": 38879,
"preview": "<!DOCTYPE HTML>\n<html lang=\"zh-Hans\" class=\"light\" dir=\"ltr\">\n <head>\n <!-- Book generated using mdBook -->\n "
},
{
"path": "docs/zh/release-notes/typescript-4.9.html",
"chars": 43125,
"preview": "<!DOCTYPE HTML>\n<html lang=\"zh-Hans\" class=\"light\" dir=\"ltr\">\n <head>\n <!-- Book generated using mdBook -->\n "
},
{
"path": "docs/zh/release-notes/typescript-5.0.html",
"chars": 65900,
"preview": "<!DOCTYPE HTML>\n<html lang=\"zh-Hans\" class=\"light\" dir=\"ltr\">\n <head>\n <!-- Book generated using mdBook -->\n "
},
{
"path": "docs/zh/release-notes/typescript-5.1.html",
"chars": 41073,
"preview": "<!DOCTYPE HTML>\n<html lang=\"zh-Hans\" class=\"light\" dir=\"ltr\">\n <head>\n <!-- Book generated using mdBook -->\n "
},
{
"path": "docs/zh/release-notes/typescript-5.2.html",
"chars": 53287,
"preview": "<!DOCTYPE HTML>\n<html lang=\"zh-Hans\" class=\"light\" dir=\"ltr\">\n <head>\n <!-- Book generated using mdBook -->\n "
},
{
"path": "docs/zh/release-notes/typescript-5.3.html",
"chars": 42800,
"preview": "<!DOCTYPE HTML>\n<html lang=\"zh-Hans\" class=\"light\" dir=\"ltr\">\n <head>\n <!-- Book generated using mdBook -->\n "
},
{
"path": "docs/zh/release-notes/typescript-5.4.html",
"chars": 48170,
"preview": "<!DOCTYPE HTML>\n<html lang=\"zh-Hans\" class=\"light\" dir=\"ltr\">\n <head>\n <!-- Book generated using mdBook -->\n "
},
{
"path": "docs/zh/tutorials/angular-2.html",
"chars": 30063,
"preview": "<!DOCTYPE HTML>\n<html lang=\"zh-Hans\" class=\"light\" dir=\"ltr\">\n <head>\n <!-- Book generated using mdBook -->\n "
},
{
"path": "docs/zh/tutorials/asp.net-4.html",
"chars": 39097,
"preview": "<!DOCTYPE HTML>\n<html lang=\"zh-Hans\" class=\"light\" dir=\"ltr\">\n <head>\n <!-- Book generated using mdBook -->\n "
},
{
"path": "docs/zh/tutorials/asp.net-core.html",
"chars": 42442,
"preview": "<!DOCTYPE HTML>\n<html lang=\"zh-Hans\" class=\"light\" dir=\"ltr\">\n <head>\n <!-- Book generated using mdBook -->\n "
},
{
"path": "docs/zh/tutorials/gulp.html",
"chars": 42295,
"preview": "<!DOCTYPE HTML>\n<html lang=\"zh-Hans\" class=\"light\" dir=\"ltr\">\n <head>\n <!-- Book generated using mdBook -->\n "
},
{
"path": "docs/zh/tutorials/index.html",
"chars": 30177,
"preview": "<!DOCTYPE HTML>\n<html lang=\"zh-Hans\" class=\"light\" dir=\"ltr\">\n <head>\n <!-- Book generated using mdBook -->\n "
},
{
"path": "docs/zh/tutorials/knockout.html",
"chars": 35065,
"preview": "<!DOCTYPE HTML>\n<html lang=\"zh-Hans\" class=\"light\" dir=\"ltr\">\n <head>\n <!-- Book generated using mdBook -->\n "
},
{
"path": "docs/zh/tutorials/migrating-from-javascript.html",
"chars": 42554,
"preview": "<!DOCTYPE HTML>\n<html lang=\"zh-Hans\" class=\"light\" dir=\"ltr\">\n <head>\n <!-- Book generated using mdBook -->\n "
},
{
"path": "docs/zh/tutorials/react-and-webpack.html",
"chars": 37577,
"preview": "<!DOCTYPE HTML>\n<html lang=\"zh-Hans\" class=\"light\" dir=\"ltr\">\n <head>\n <!-- Book generated using mdBook -->\n "
},
{
"path": "docs/zh/tutorials/react.html",
"chars": 50368,
"preview": "<!DOCTYPE HTML>\n<html lang=\"zh-Hans\" class=\"light\" dir=\"ltr\">\n <head>\n <!-- Book generated using mdBook -->\n "
},
{
"path": "docs/zh/tutorials/typescript-in-5-minutes.html",
"chars": 34136,
"preview": "<!DOCTYPE HTML>\n<html lang=\"zh-Hans\" class=\"light\" dir=\"ltr\">\n <head>\n <!-- Book generated using mdBook -->\n "
},
{
"path": "gulpfile.js",
"chars": 516,
"preview": "var gulp = require('gulp'),\r\n ts = require('gulp-typescript');\r\n\r\ngulp.task('typescript', function() {\r\n var tsResult "
},
{
"path": "lint.js",
"chars": 4192,
"preview": "var markdownlint = require(\"markdownlint\");\nvar glob = require(\"glob\");\nvar fs = require(\"fs\");\n\nvar inputFiles = glob.s"
},
{
"path": "package.json",
"chars": 759,
"preview": "{\n \"name\": \"typescript-handbook-cn\",\n \"version\": \"1.0.0\",\n \"description\": \"The TypeScript Handbook is a comprehensive"
},
{
"path": "zh/breaking-changes/README.md",
"chars": 818,
"preview": "# Breaking Changes\n\n- [TypeScript 3.6](typescript-3.6.md)\n- [TypeScript 3.5](typescript-3.5.md)\n- [TypeScript 3.4](types"
},
{
"path": "zh/breaking-changes/typescript-1.1.md",
"chars": 677,
"preview": "# TypeScript 1.1\n\n完整的破坏性改动列表请到这里查看:[breaking change issues](https://github.com/Microsoft/TypeScript/issues?q=is%3Aissue+"
},
{
"path": "zh/breaking-changes/typescript-1.4.md",
"chars": 2802,
"preview": "# TypeScript 1.4\n\n完整的破坏性改动列表请到这里查看:[breaking change issues](https://github.com/Microsoft/TypeScript/issues?q=is%3Aissue+"
},
{
"path": "zh/breaking-changes/typescript-1.5.md",
"chars": 3741,
"preview": "# TypeScript 1.5\n\n完整的破坏性改动列表请到这里查看:[breaking change issues](https://github.com/Microsoft/TypeScript/issues?q=is%3Aissue+"
},
{
"path": "zh/breaking-changes/typescript-1.6.md",
"chars": 3639,
"preview": "# TypeScript 1.6\n\n完整的破坏性改动列表请到这里查看:[breaking change issues](https://github.com/Microsoft/TypeScript/issues?q=is%3Aissue+"
},
{
"path": "zh/breaking-changes/typescript-1.7.md",
"chars": 1208,
"preview": "# TypeScript 1.7\n\n完整的破坏性改动列表请到这里查看:[breaking change issues](https://github.com/Microsoft/TypeScript/issues?q=is%3Aissue+"
},
{
"path": "zh/breaking-changes/typescript-1.8.md",
"chars": 3795,
"preview": "# TypeScript 1.8\n\n完整的破坏性改动列表请到这里查看:[breaking change issues](https://github.com/Microsoft/TypeScript/issues?q=is%3Aissue+"
},
{
"path": "zh/breaking-changes/typescript-2.0.md",
"chars": 1981,
"preview": "# TypeScript 2.0\n\n完整的破坏性改动列表请到这里查看:[breaking change issues](https://github.com/Microsoft/TypeScript/issues?q=is%3Aissue+"
},
{
"path": "zh/breaking-changes/typescript-2.1.md",
"chars": 4450,
"preview": "# TypeScript 2.1\n\n完整的破坏性改动列表请到这里查看:[breaking change issues](https://github.com/Microsoft/TypeScript/issues?q=is%3Aissue+"
},
{
"path": "zh/breaking-changes/typescript-2.2.md",
"chars": 364,
"preview": "# TypeScript 2.2\n\n完整的破坏性改动列表请到这里查看:[breaking change issues](https://github.com/Microsoft/TypeScript/issues?q=is%3Aissue+"
},
{
"path": "zh/breaking-changes/typescript-2.3.md",
"chars": 440,
"preview": "# TypeScript 2.3\n\n完整的破坏性改动列表请到这里查看:[breaking change issues](https://github.com/Microsoft/TypeScript/issues?q=is%3Aissue+"
},
{
"path": "zh/breaking-changes/typescript-2.4.md",
"chars": 3058,
"preview": "# TypeScript 2.4\n\n完整的破坏性改动列表请到这里查看:[breaking change issues](https://github.com/Microsoft/TypeScript/issues?q=is%3Aissue+"
},
{
"path": "zh/breaking-changes/typescript-2.6.md",
"chars": 1050,
"preview": "# TypeScript 2.6\n\n完整的破坏性改动列表请到这里查看:[breaking change issues](https://github.com/Microsoft/TypeScript/issues?q=is%3Aissue+"
},
{
"path": "zh/breaking-changes/typescript-2.7.md",
"chars": 2334,
"preview": "# TypeScript 2.7\n\n完整的破坏性改动列表请到这里查看:[breaking change issues](https://github.com/Microsoft/TypeScript/issues?q=is%3Aissue+"
},
{
"path": "zh/breaking-changes/typescript-2.8.md",
"chars": 938,
"preview": "# TypeScript 2.8\n\n## 在`--noUnusedParameters`下检查未使用的类型参数\n\n根据 [\\#20568](https://github.com/Microsoft/TypeScript/issues/205"
},
{
"path": "zh/breaking-changes/typescript-2.9.md",
"chars": 1381,
"preview": "# TypeScript 2.9\n\n## `keyof` 现在包括 `string`、`number` 和 `symbol` 键名\n\nTypeScript 2.9 将索引类型泛化为包括 `number` 和 `symbol` 命名属性。以前"
},
{
"path": "zh/breaking-changes/typescript-3.0.md",
"chars": 824,
"preview": "# TypeScript 3.0\n\n## 保留关键字 `unknown`\n\n`unknown` 现在是一个保留类型名称,因为它现在是一个内置类型。为了支持新引入的 `unknown` 类型,取决于你对 `unknown` 的使用方式,你可能"
},
{
"path": "zh/breaking-changes/typescript-3.1.md",
"chars": 5453,
"preview": "# TypeScript 3.1\n\n## 一些浏览器厂商特定的类型从`lib.d.ts`中被移除\n\nTypeScript 内置的`.d.ts`库\\(`lib.d.ts`等\\)现在会部分地从 DOM 规范的 Web IDL 文件中生成。 因此"
},
{
"path": "zh/breaking-changes/typescript-3.2.md",
"chars": 353,
"preview": "# TypeScript 3.2\n\n## `lib.d.ts` 更新\n\n### `wheelDelta` 和它的小伙伴们被移除了。\n\n`wheelDeltaX`、`wheelDelta` 和 `wheelDeltaZ` 全都被移除了,因为他"
},
{
"path": "zh/breaking-changes/typescript-3.4.md",
"chars": 2936,
"preview": "# TypeScript 3.4\n\n## 顶级 `this` 现在有类型了\n\n顶级 `this` 的类型现在被分配为 `typeof globalThis` 而不是 `any`。\n\n因此, 在 `noImplicitAny` 下访问 `th"
},
{
"path": "zh/breaking-changes/typescript-3.5.md",
"chars": 270,
"preview": "# TypeScript 3.5\n\n## `lib.d.ts` 包含了 `Omit` 辅助类型\n\nTypeScript 3.5 包含一个 `Omit` 辅助类型。\n\n因此, 你项目中任何全局定义的 `Omit` 将产生以下错误信息:\n\n``"
},
{
"path": "zh/breaking-changes/typescript-3.6.md",
"chars": 1250,
"preview": "# TypeScript 3.6\n\n## 类成员的 `constructor` 现在被叫做 `Constructors`\n\n根据 ECMAScript 规范,使用名为 `constructor` 的方法的类声明现在是构造函数,无论它们是使用"
},
{
"path": "zh/declaration-files/README.md",
"chars": 251,
"preview": "- [如何书写声明文件](./README.md)\n - [介绍](./introduction.md)\n - [举例](./by-example.md)\n - [库结构](./library-structures.md)\n - ["
},
{
"path": "zh/declaration-files/by-example.md",
"chars": 3371,
"preview": "# 举例\n\n这篇指南的目的是教你如何书写高质量的 TypeScript 声明文件。\n我们在这里会展示一些 API 的文档,以及它们的使用示例,\n并且阐述了如何为它们书写声明文件。\n\n这些例子是按复杂度递增的顺序组织的。\n\n- [带属性的对象"
},
{
"path": "zh/declaration-files/consumption.md",
"chars": 709,
"preview": "# 使用\n\n## 下载\n\n想要获取声明文件只需要用到 npm。\n\n比如,想要获取 lodash 库的声明文件,只需使用下面的命令:\n\n```text\nnpm install --save @types/lodash\n```\n\n如果一个 np"
},
{
"path": "zh/declaration-files/deep-dive.md",
"chars": 3362,
"preview": "# 深入\n\n组织模块以提供你想要的 API 结构是比较难的。\n比如,你可能想要这样一个模块,可以用或不用`new`来创建不同的类型,在不同层级上暴露出不同的命名类型,且模块对象上还带有一些属性。\n\n阅读这篇指南后,你就会了解如何编写复杂的声"
},
{
"path": "zh/declaration-files/do-s-and-don-ts.md",
"chars": 4410,
"preview": "# 最佳实践\n\n## 常规类型\n\n### `Number`,`String`,`Boolean`,`Symbol`和`Object`\n\n*不要*使用以下类型`Number`,`String`,`Boolean`,`Symbol`或`Obje"
},
{
"path": "zh/declaration-files/introduction.md",
"chars": 1552,
"preview": "声明文件一章的目的是教你如何编写高质量的 TypeScript 声明文件。\n我们假设你对 TypeScript 已经有了基本的了解。\n\n如果没有,请先阅读[TypeScript 手册](../handbook/basic-types.md)"
},
{
"path": "zh/declaration-files/library-structures.md",
"chars": 7035,
"preview": "# 代码库结构\n\n一般来讲,*组织*声明文件的方式取决于代码库是如何被使用的。\n在 JavaScript 中一个代码库有很多使用方式,这就需要你书写声明文件去匹配它们。\n这篇指南涵盖了如何识别常见代码库的模式,以及怎样书写符合相应模式的声明"
},
{
"path": "zh/declaration-files/publishing.md",
"chars": 3926,
"preview": "# 发布\n\n现在我们已经按照指南里的步骤写好了一个声明文件,是时候把它发布到 npm 了。\n有两种主要方式用来将声明文件发布到 npm:\n\n1. 与你的 npm 包捆绑在一起,或\n2. 发布到 npm 上的[@types organizat"
},
{
"path": "zh/declaration-files/templates/global-modifying-module.d.ts.md",
"chars": 1855,
"preview": "# global-modifying-module.d.ts\n\n## 修改了全局作用域的模块\n\n对于修改了全局作用域的模块来讲,在导入它们时,会对全局作用域中的值进行修改。\n比如存在某个代码库,当导入它时,它会向`String.protot"
},
{
"path": "zh/declaration-files/templates/global-plugin.d.ts.md",
"chars": 5862,
"preview": "# global-plugin.d.ts\n\n## UMD\n\n一个 UMD 模块既可以用作 ES 模块(使用导入语句),也可以用作全局变量(在缺少模块加载器的环境中使用)。\n许多流行的代码库,如[Moment.js](http://momen"
},
{
"path": "zh/declaration-files/templates/global.d.ts.md",
"chars": 2813,
"preview": "## 全局代码库\n\n全局代码库可以通过全局作用域来访问(例如,不使用任何形式的`import`语句)。\n许多代码库只是简单地导出一个或多个供使用的全局变量。\n比如,如果你使用[jQuery](https://jquery.com/),那么可"
},
{
"path": "zh/declaration-files/templates/module-class.d.ts.md",
"chars": 2301,
"preview": "<!--\nTODO:\n\n1. Not clear why UMD is thrown in here.\n2. Give both commonjs and ES module examples.\n-->\n\n示例,当你想要处理如下的 Java"
},
{
"path": "zh/declaration-files/templates/module-function.d.ts.md",
"chars": 2584,
"preview": "```ts\n// Type definitions for [~THE LIBRARY NAME~] [~OPTIONAL VERSION NUMBER~]\n// Project: [~THE PROJECT NAME~]\n// Defin"
},
{
"path": "zh/declaration-files/templates/module-plugin.d.ts.md",
"chars": 1307,
"preview": "```ts\n// Type definitions for [~THE LIBRARY NAME~] [~OPTIONAL VERSION NUMBER~]\n// Project: [~THE PROJECT NAME~]\n// Defin"
},
{
"path": "zh/declaration-files/templates/module.d.ts.md",
"chars": 1513,
"preview": "```ts\n// Type definitions for [~THE LIBRARY NAME~] [~OPTIONAL VERSION NUMBER~]\n// Project: [~THE PROJECT NAME~]\n// Defin"
}
]
// ... and 121 more files (download for full content)
About this extraction
This page contains the full source code of the zhongsp/TypeScript GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 321 files (15.0 MB), approximately 3.9M tokens, and a symbol index with 101 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.