我看到几乎所有的库定义都使用表达式export = module
。我的IDE intellij认为是一个语法错误.例如,在express定义中
declare module "express" {
function express(): Express;
module express {
...
...
...
}
export = express;
}
发布于 2013-06-30 16:04:03
Webstorm / IntelliJ-Idea目前只支持TypeScript 0.8.x语法。在typescript 0.9.0中引入了export = express;
语法,这就是为什么会出现语法错误的原因。
如果您想使用Webstorm设计时特性,可以从DefinitelyTyped:https://github.com/borisyankov/DefinitelyTyped/tree/0.8上的0.8.x分支获取旧的定义
或者,您也可以使用Visual studio 2012。
发布于 2013-08-15 21:33:40
IntelliJ 12仅支持TypeScript 0.8。
你可以从http://confluence.jetbrains.com/display/IDEADEV/IDEA+13+EAP下载IntelliJ的EAP版本,在那里他们添加了对TypeScript 0.9特性的支持。
https://stackoverflow.com/questions/17388324
复制相似问题