Reputation:
I'm trying to write an ambient module in node.js using the Visual Studio developer tools.
The module looks like this
module "Module" {
export class Class {
first = "First";
second = "Second";
}
}
I think attempt to use this in another file:
var m = require("Module");
var c = new m.Class();
The typing on the require statement is fine, but this gives a compiler error, saying "Only ambient modules can use quoted names".
How then am I supposed to write my TypeScript modules such that they can be imported into other project files, and the import is strongly typed?
Upvotes: 2
Views: 1229