Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/typescript/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Typescript 在';lib';es6和es2017之间的tsconfig.json中的属性?_Typescript_Ecmascript 6_Typescript Typings_Typescript2.0_Ecmascript 2017 - Fatal编程技术网

Typescript 在';lib';es6和es2017之间的tsconfig.json中的属性?

Typescript 在';lib';es6和es2017之间的tsconfig.json中的属性?,typescript,ecmascript-6,typescript-typings,typescript2.0,ecmascript-2017,Typescript,Ecmascript 6,Typescript Typings,Typescript2.0,Ecmascript 2017,我一直在研究tsconfig.json文件中的编译器选项中lib属性的可能值是什么意思。我在页面上找到了与这些值对应的相关d.ts文件,显然通过使用ES2017包括以下ES功能: /// <reference path="lib.es2016.d.ts" /> /// <reference path="lib.es2017.object.d.ts" /> /// <reference path="lib.es2017.sharedmemory.d.ts" />

我一直在研究
tsconfig.json
文件中的
编译器选项中
lib
属性的可能值是什么意思。我在页面上找到了与这些值对应的相关
d.ts
文件,显然通过使用
ES2017
包括以下ES功能:

/// <reference path="lib.es2016.d.ts" />
/// <reference path="lib.es2017.object.d.ts" />
/// <reference path="lib.es2017.sharedmemory.d.ts" />
/// <reference path="lib.es2017.string.d.ts" />
/// <reference path="lib.es2015.d.ts" />
/// <reference path="lib.es2016.array.include.d.ts" />
/// <reference path="lib.es2015.core.d.ts" />
/// <reference path="lib.es2015.collection.d.ts" />
/// <reference path="lib.es2015.generator.d.ts" />
/// <reference path="lib.es2015.iterable.d.ts" />
/// <reference path="lib.es2015.promise.d.ts" />
/// <reference path="lib.es2015.proxy.d.ts" />
/// <reference path="lib.es2015.reflect.d.ts" />
/// <reference path="lib.es2015.symbol.d.ts" />
/// <reference path="lib.es2015.symbol.wellknown.d.ts" />
/// <reference path="lib.es5.d.ts" />
或者这个:

{
  ...
  "compilerOptions": {
    ...
    "lib": ["es2017", "es6", "dom"]
  },
  ...
  }
}

在对上的
lib
文件夹进行一些挖掘和比较后,我发现,在
compilerOptions
lib
属性中使用
es6
与这些参考中找到的代码相对应:

/// <reference path="lib.es2015.core.d.ts" />
/// <reference path="lib.es2015.collection.d.ts" />
/// <reference path="lib.es2015.generator.d.ts" />
/// <reference path="lib.es2015.iterable.d.ts" />
/// <reference path="lib.es2015.promise.d.ts" />
/// <reference path="lib.es2015.proxy.d.ts" />
/// <reference path="lib.es2015.reflect.d.ts" />
/// <reference path="lib.es2015.symbol.d.ts" />
/// <reference path="lib.es2015.symbol.wellknown.d.ts" />
/// <reference path="lib.es5.d.ts" />
/// <reference path="lib.dom.d.ts" />
/// <reference path="lib.scripthost.d.ts.d.ts" />
/// <reference path="lib.dom.iterable.d.ts" />

ES6==ES2015
@Bergi井并不是真正按照打字脚本打字。它包括所有ES2015内容和其他内容。看看我的回答。
/// <reference path="lib.es2015.core.d.ts" />
/// <reference path="lib.es2015.collection.d.ts" />
/// <reference path="lib.es2015.generator.d.ts" />
/// <reference path="lib.es2015.iterable.d.ts" />
/// <reference path="lib.es2015.promise.d.ts" />
/// <reference path="lib.es2015.proxy.d.ts" />
/// <reference path="lib.es2015.reflect.d.ts" />
/// <reference path="lib.es2015.symbol.d.ts" />
/// <reference path="lib.es2015.symbol.wellknown.d.ts" />
/// <reference path="lib.es5.d.ts" />
/// <reference path="lib.dom.d.ts" />
/// <reference path="lib.scripthost.d.ts.d.ts" />
/// <reference path="lib.dom.iterable.d.ts" />
{
  ...
  "compilerOptions": {
    ...
    "lib": ["es2017", "dom", "dom.iterable", "scripthost"]
  },
  ...
  }
}