topic : understanding how to set a custom module in Typescript
read this
In ECMAScript 6, modules are stored in files. There is exactly one module per file and one file per module. You have two ways of exporting things from a module. These two ways can be mixed, but it is usually better to use them separately.
Based on the above we need the export, as a part of the test.js file. Let's adjust the content of it like this:
// module format
export module (namespace) {
// implementation here
}
import * as app1 from "./test";
import {App} from "./test";
And we can consume imported stuff like this:
var a1: app1.App.SomeClass = new app1.App.SomeClass();
var a2: app1.App.OtherClass = new app1.App.OtherClass();
var b1: app2.App.SomeClass = new app2.App.SomeClass();
var b2: app2.App.OtherClass = new app2.App.OtherClass();
var c1: App.SomeClass = new App.SomeClass();
var c2: App.OtherClass = new App.OtherClass();
topic : understanding how to set a custom module in Typescript
read this
and then you can use it like,
reference