TypeScript - 导入声明与本地声明'xxxxxxx'

时间:2016-04-10 07:18:55

标签: typescript

当编译错误“导入声明与'xxxxx'的本地声明冲突”时,我该怎么办?

let rootElement: Element = document.getRootElement();

我的代码中有这一行会导致编译错误。

在typescript的lib.d.ts中声明的类型“Element”与在我通过npm安装的d.ts文件中声明的Type“Element”冲突。

现在,我将导入的d.ts文件中声明的Type的名称更改为其他名称,但还有其他智能方法可以解决此冲突问题吗?

这是导致冲突问题的d.ts文件。 https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/14fe4313f4a1cf69add3505a2ab1dbc690dc2116/google-apps-script/google-apps-script.xml-service.d.ts

0 个答案:

没有答案