typescript export = module

时间:2013-06-30 07:53:38

标签: intellij-idea typescript

我看到几乎所有库的定义都使用表达式export = module。我的IDE intellij想法语法中的错误。例如,在快速定义中

declare module "express" {
   function express(): Express;

   module express {
      ...
      ...
      ...
   }


   export = express;
}

2 个答案:

答案 0 :(得分:1)

Webstorm / IntelliJ-Idea目前仅支持TypeScript 0.8.x语法。在typescript 0.9.0中引入了export = express;语法,这就是您获得语法错误的原因。

如果您想使用Webstorm设计时功能,您可以在DefinitelyTyped上获取0.8.x分支中的旧定义:https://github.com/borisyankov/DefinitelyTyped/tree/0.8

或者,您可以使用Visual Studio 2012.

答案 1 :(得分:0)

IntelliJ 12仅支持TypeScript 0.8。

您可以从http://confluence.jetbrains.com/display/IDEADEV/IDEA+13+EAP下载IntelliJ的EAP版本,在那里他们添加了对TypeScript 0.9功能的支持。