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. python_字符串常用操作

    name = "monicao"name.capitalize() #首字母大写print(name.capitalize()) print(name.count("o& ...

  2. 2019-03-15 Python time datetime 获取当下时间 和 格式化时间

    import datetime start_date='2018-01-10' end_date='2019-01-10'# 转换为2018-01-10 00:00:00start_date=date ...

  3. ajax异步请求获取数据,实现滚动数字的效果。

    BackgroundPositionAnimate.js下载 需要导入的js: <script type="text/javascript" src="js/jqu ...

  4. Spring IoC容器实现

    1,Spring的两种IoC容器 BeanFactory 基础类型的IoC容器: 采用延迟初始化策略(容器初始化完成后并不会创建bean的对象,只有当收到初始化请求时才进行初始化): 由于延迟初始化, ...

  5. 2015 Multi-University Training Contest 3 hdu 5318 The Goddess Of The Moon

    The Goddess Of The Moon Time Limit: 6000/3000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/ ...

  6. NYIST 489 哭泣天使

    哭泣天使时间限制:1000 ms | 内存限制:65535 KB难度:5 描述Doctor Who乘着Tardis带着Amy来到了一个星球,一开Tadis大门,发现这个星球上有个壮观的石像群,全是一些 ...

  7. Error: Password file read access must be restricted: /etc/cassandra/jmxremote.password

    在配置JMX远程访问的时候,设置jmxremote.password文件权限,修改该文件时添加写权限,chmod +w jmxremote.password ,放开角色信息那俩行的注释,保存,再使用c ...

  8. 我是怎么从项目中的lib加JAR更换为maven管理的

    原来我对maven的使用应该还是去年的时候吧,当时对maven并不感冒(请不要吐槽哈),认为为什么一定要用maven来管理呢,我自己管理jar不是一样么,当时还认为自己管理jar还各种方便还对mave ...

  9. Android解决ScrollView视图导致其底部的布局栏被推到上边的问题

    近期有个xml布局文件,我说下大概意思: <ScrollView> ...... </ScrollView> <RelativeLayout> ...... < ...

  10. Educational Codeforces Round 6 A. Professor GukiZ's Robot 水

    A. Professor GukiZ's Robot   Professor GukiZ makes a new robot. The robot are in the point with coor ...