user2536049
user2536049

Reputation: 23

typescript export = module

I see almost all definitions of libraries use the expression export = module. My IDE intellij idea of ​​an error in the syntax. For example, in express difinitions

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

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


   export = express;
}

Upvotes: 0

Views: 610

Answers (2)

curial
curial

Reputation: 514

IntelliJ 12 only supports TypeScript 0.8.

You can download the EAP version for IntelliJ from http://confluence.jetbrains.com/display/IDEADEV/IDEA+13+EAP where they added support for TypeScript 0.9 features.

Upvotes: 0

basarat
basarat

Reputation: 275927

Webstorm / IntelliJ-Idea only support TypeScript 0.8.x syntax at the moment. The export = express; syntax was introduced in typescript 0.9.0 which is why you are getting the syntax errors.

If you want to use Webstorm design time features, You can grab the old definitions from the 0.8.x branch on DefinitelyTyped : https://github.com/borisyankov/DefinitelyTyped/tree/0.8

Alternatively you can use Visual studio 2012.

Upvotes: 1

Related Questions