Typescript: 保留关键字列表

创建于 2015-03-28  ·  5评论  ·  资料来源: microsoft/TypeScript

某处是否有Typescript的保留关键字列表? 我环顾四周,甚至在语言规范中也找不到。

Question

最有用的评论

虽然您可以参考ES6规范来找出部分列表,但最好直接转到当前列表

根据代码,我为您删除了此代码:

| 保留字| 严格模式保留字| 内容相关关键字|
| --- | --- | --- |
| break | as | any |
| case | implements | boolean |
| catch | interface | constructor |
| class | let | declare |
| const | package | get |
| continue | private | module |
| debugger | protected | require |
| default | public | number |
| delete | static | set |
| do | yield | string |
| else | symbol | |
| enum | type | |
| export | from | |
| extends | of | |
| false | | |
| finally | | |
| for | | |
| function | | |
| if | | |
| import | | |
| in | | |
| instanceof | | |
| new | | |
| null | | |
| return | | |
| super | | |
| switch | | |
| this | | |
| throw | | |
| true | | |
| try | | |
| typeof | | |
| var | | |
| void | | |
| while | | |
| with | | |

如果您只是想更轻松地进行复制,请执行以下操作:

| 保留字|
| --- |
| break |
| case |
| catch |
| class |
| const |
| continue |
| debugger |
| default |
| delete |
| do |
| else |
| enum |
| export |
| extends |
| false |
| finally |
| for |
| function |
| if |
| import |
| in |
| instanceof |
| new |
| null |
| return |
| super |
| switch |
| this |
| throw |
| true |
| try |
| typeof |
| var |
| void |
| while |
| with |

| 严格模式保留字|
| --- |
| as |
| implements |
| interface |
| let |
| package |
| private |
| protected |
| public |
| static |
| yield |

| 内容相关关键字|
| --- |
| any |
| boolean |
| constructor |
| declare |
| get |
| module |
| require |
| number |
| set |
| string |
| symbol |
| type |
| from |
| of |

所有5条评论

虽然您可以参考ES6规范来找出部分列表,但最好直接转到当前列表

根据代码,我为您删除了此代码:

| 保留字| 严格模式保留字| 内容相关关键字|
| --- | --- | --- |
| break | as | any |
| case | implements | boolean |
| catch | interface | constructor |
| class | let | declare |
| const | package | get |
| continue | private | module |
| debugger | protected | require |
| default | public | number |
| delete | static | set |
| do | yield | string |
| else | symbol | |
| enum | type | |
| export | from | |
| extends | of | |
| false | | |
| finally | | |
| for | | |
| function | | |
| if | | |
| import | | |
| in | | |
| instanceof | | |
| new | | |
| null | | |
| return | | |
| super | | |
| switch | | |
| this | | |
| throw | | |
| true | | |
| try | | |
| typeof | | |
| var | | |
| void | | |
| while | | |
| with | | |

如果您只是想更轻松地进行复制,请执行以下操作:

| 保留字|
| --- |
| break |
| case |
| catch |
| class |
| const |
| continue |
| debugger |
| default |
| delete |
| do |
| else |
| enum |
| export |
| extends |
| false |
| finally |
| for |
| function |
| if |
| import |
| in |
| instanceof |
| new |
| null |
| return |
| super |
| switch |
| this |
| throw |
| true |
| try |
| typeof |
| var |
| void |
| while |
| with |

| 严格模式保留字|
| --- |
| as |
| implements |
| interface |
| let |
| package |
| private |
| protected |
| public |
| static |
| yield |

| 内容相关关键字|
| --- |
| any |
| boolean |
| constructor |
| declare |
| get |
| module |
| require |
| number |
| set |
| string |
| symbol |
| type |
| from |
| of |

同样是namespace ,最终可能是asyncawait

@DanielRosenwasser看起来应该有一个Wiki页面

@chinhodado @crissdev另请参阅PR在Typescript手册中创建关键字页面

此页面是否有帮助?
0 / 5 - 0 等级