在 Typescript 中实现了哪些 ES6 特性?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/22260978/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Which ES6 features are implemented in Typescript?
提问by urish
I was looking for a list of Ecmascript 6 features that are currently implemented in typescript but couldn't find anything up to date online.
我正在寻找当前在打字稿中实现但在网上找不到任何最新内容的 Ecmascript 6 功能列表。
Here is the list of features I have come up with so far:
这是迄今为止我提出的功能列表:
- Arrow functions.
- Rest parameter
- Default parameter values
- Classes (is the entire spec implemented?)
- Modules (I think there are some implementation differences though)
- 箭头函数。
- 休息参数
- 默认参数值
- 类(是否实现了整个规范?)
- 模块(我认为虽然存在一些实现差异)
Thanks!
谢谢!
采纳答案by Simon
This table also lists TypeScript along with many other browsers and their current ES6 implementation level:
此表还列出了 TypeScript 以及许多其他浏览器及其当前的 ES6 实现级别:
回答by Mike Cheel
I found this link:
我找到了这个链接:
https://typescript.codeplex.com/wikipage?title=ECMAScript%206%20Status&referringTitle=Roadmap
https://typescript.codeplex.com/wikipage?title=ECMAScript%206%20Status&referringTitle=Roadmap
It contains the known alignment between Typescript and ES6. It doesn't appear to be updated since the end of April however. This is probably because of the move to Github. There is no equivalent table however on github. The roadmap page over there is:
它包含 Typescript 和 ES6 之间的已知对齐方式。但是,自 4 月底以来,它似乎没有更新。这可能是因为迁移到 Github。但是在 github 上没有等效的表。那边的路线图页面是:
https://github.com/Microsoft/TypeScript/wiki/Roadmap
https://github.com/Microsoft/TypeScript/wiki/Roadmap
Hopefully they can update it with a matrix similar to the one on codeplex.
希望他们可以用一个类似于 codeplex 的矩阵来更新它。
EDIT
编辑
I found this link:
我找到了这个链接:
https://github.com/Microsoft/TypeScript/milestones
https://github.com/Microsoft/TypeScript/milestones
While not a table of feature mappings you can get an idea of progress towards completion of their road map versions. As of me writing this, version 2.0 is about 40% complete. They say they try to release every 6 to 8 weeks.
虽然不是功能映射表,但您可以了解完成其路线图版本的进度。在我写这篇文章的时候,2.0 版已经完成了大约 40%。他们说他们尝试每 6 到 8 周发布一次。
回答by diosney
Some of the ECMAScript 6 features supported by TypeScript:
TypeScript 支持的一些 ECMAScript 6 特性:
- Classes (with support for optional type annotations)
- Generics
- Modules (internal modules are the ones related to ECMAScript 6)
- Arrow functions
- Defaults parameters
- 类(支持可选类型注释)
- 泛型
- 模块(内部模块是与 ECMAScript 6 相关的模块)
- 箭头函数
- 默认参数
Source:
来源:
回答by vitkon
Kagnax's table is not relevant now http://kangax.github.io/compat-table/es6/
Kagnax 的表现在不相关 http://kangax.github.io/compat-table/es6/
It contains information about Typescript 1.6 In Jan 2017 version 2.1.5 is available and has more features.
它包含有关 Typescript 1.6 的信息 2017 年 1 月版本 2.1.5 可用并具有更多功能。