TypeScript support for exporting objects not working

Given a module that exports an instance of an object likes so:

var test = { name: "John Doe"};
export = test;

Then importing this module in another file like so:

import obj1 = require('./Object1');
var test = obj1.name;

WebStorm does not seem to recognize members on the imported module. TypeScript compilation works fine.

If I wrap the instance in an exported module like so:

export module Container {
  export var test = { name: "John Doe"};
}

And then update the consuming file like so:

import Container = require('./Object1');
var test = Container.Container.test.name;

Everything works. Any idea what might be wrong here? Am I missing something? Bug?

1 comment

Please sign in to leave a comment.