【发布时间】:2017-10-12 09:22:47
【问题描述】:
我想构建 typescript,它会抛出 Duplicate identifier。
有什么问题,我想访问 WebRTC 类型。在我的 compilerOptions tsconfig.hson 我有
"lib": ["es2015", "es2016", "es2017", "dom.iterable", "dom", "scripthost"],
我需要dom。如果我将"@types/webrtc": "0.0.21", 添加到依赖项中,那么大多数部分都会显示Duplicate identifier。
如果我不这样做,那么 RTCDataChannel 数据是未定义的,并且抛出重复的部分是可以的。
我需要RTCDataChannel 我怎样才能添加它而不会出现重复错误。 ?
tsconfig.json
{
"compilerOptions": {
"target": "es6",
"module": "commonjs",
"rootDir": "src",
"outDir": ".code",
"newLine": "LF",
"lib": ["es2015", "es2016", "es2017", "dom.iterable", "dom", "scripthost"],
"moduleResolution": "node",
"importHelpers": true,
"declaration": true,
"pretty": true,
"sourceMap": true,
"inlineSources": true,
"noUnusedLocals": true
},
"exclude": [
"node_modules",
"dist",
"es",
"lib"
]
}
【问题讨论】:
标签: typescript webrtc