Perhaps this question has been addressed before in some manner, however, I was unsure of how to phrase it.
In my Typescript file, there is a single class being exported:
export class MyClass {
...
}
In another Javascript file, I import the transpiled version of that Typescript and utilize it like so:
define('random-source', ['src/my-class'], function(MyClassMod) {
...
var myClass = new MyClassMod.MyClass();
...
});
My query revolves around whether it is possible to structure the Typescript file in such a way that only the 'MyClass' definition is exported. Currently, as seen in the Javascript code snippet, it is imported as a module name requiring '.MyClass' to access it. This can become cumbersome when dealing with multiple Typescript files containing single class definitions. Ideally, I would prefer something along the lines of:
define('random-source', ['src/my-class'], function(MyClass) {
...
var myClass = new MyClass();
...
});
Is this achievable? Appreciate any insight on this matter!