首页 > 其他 > 详细

[Typescript] Installing Promise Type Definitions Using the lib Built-In Types

时间:2018-02-03 10:33:56      阅读:225      评论:0      收藏:0      [点我收藏+]

To fix Promise is not recolized in TypeScript, we can choose to use a lib:

npm i @types/es6-promise

 

we can also use built-in libs:

{
    "compilerOptions": {
        "module": "commonjs",
        "target": "es5",
        "noImplicitAny": true,
        "sourceMap": true,
        "strictNullChecks": true,
        "noEmitOnError": true,
        "experimentalDecorators": true,
        "emitDecoratorMetadata": true,
        "lib": ["es6"],
        "skipLibCheck": true
    },
    "exclude": [
      "client/node_modules"
    ]
}

Inside "es6" have Promise already, so that we don‘t need to install other devdependices.

 

[Typescript] Installing Promise Type Definitions Using the lib Built-In Types

原文:https://www.cnblogs.com/Answer1215/p/8408483.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!