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的更多相关文章

  1. Hex-Rays decompiler type definitions and convenience macros

    /****************************************************************************************** Copyrigh ...

  2. The repository for high quality TypeScript type definitions

    Best practices This is a guide to the best practices to follow when creating typing files. There are ...

  3. [TypeScript] Type Definitions and Modules

    For example you are building your own module, the same as Lodash: my-lodash.d.ts declare module &quo ...

  4. [TypeScript] Avoid any type

    To avoid using "any" type is a best pratice. The reason for that is it disable the power o ...

  5. [TypeScript] Use TypeScript’s never Type for Exhaustiveness Checking

    TypeScript 2.0 introduced a new primitive type called never, the type of values that never occur. It ...

  6. [TypeScript] Represent Non-Primitive Types with TypeScript’s object Type

    ypeScript 2.2 introduced the object, a type that represents any non-primitive type. It can be used t ...

  7. [TypeScript] Define Custom Type Guard Functions in TypeScript

    One aspect of control flow based type analysis is that the TypeScript compiler narrows the type of a ...

  8. [TypeScript] Installing TypeScript and Running the TypeScript Compiler (tsc)

    This lesson shows you how to install TypeScript and run the TypeScript compiler against a .ts file f ...

  9. 【typedef】Type definitions 自定义类型

随机推荐

  1. Laravel核心解读--Contracts契约

    Contracts Laravel 的契约是一组定义框架提供的核心服务的接口, 例如我们在介绍用户认证的章节中到的用户看守器契约IllumninateContractsAuthGuard 和用户提供器 ...

  2. LCA题集

    点的距离(模板题) 树中两点间的距离就是d[u] + d[v] - 2 * d[lca(u, v)] #include<bits/stdc++.h> #define REP(i, a, b ...

  3. HDU 4324 Contest 3

    直接DFS即可 #include <iostream> #include <string.h> #include <algorithm> #include < ...

  4. Codeforces 10A-Power Consumption Calculation(模拟)

    A. Power Consumption Calculation time limit per test 1 second memory limit per test 256 megabytes in ...

  5. java-面向对象(二)

    这几天正在看HeadFirst的时候,突然认为面向对象的几个特点,有点理解模糊不清.所以在这再次回想一下,加深印象. 上篇博客(http://blog.csdn.net/u010539352/arti ...

  6. MongoDB数据查询详解

    查询全部 ​ db.infos.find(); db.infos.find({"url":"www.baidu.com"}); id不要显示出来 db.info ...

  7. caffe中lenet_solver.prototxt配置文件注解

    caffe框架自带的例子mnist里有一个lenet_solver.prototxt文件,这个文件是具体的训练网络的引入文件,定义了CNN网络架构之外的一些基础参数,如总的迭代次数.测试间隔.基础学习 ...

  8. Oracle 11g AWR生成报告

    1.生成单实例 AWR 报告: @$ORACLE_HOME/rdbms/admin/awrrpt.sql 2.生成 Oracle RAC AWR 报告: @$ORACLE_HOME/rdbms/adm ...

  9. 关于Tomcat的启动

    1.Tomcat分为安装版和解压版. 2.在Tomcat的解压版的bin路径下启动startup.bat的时候,如果没有启动成功,请检查是否设置了JAVA_HOME 3.建议不要在环境变量里面设置CA ...

  10. OEM12C(12.1.0.5)安装插件监控mysql(linux)

    目录结构: 文章参考论坛:https://blog.csdn.net/u010719917/article/details/78128200 环境说明: oms:12.1.0.5  os:centos ...