I've finished porting a JavaScript library to TypeScript in Visual Studio 2012. All in all its about 60 classes, with each class defined in its own .ts file.
All classes are defined in the same module. I use reference comments to reder to classes defined in other files. The layout of every file looks like this:
///<reference path='./../myotherclass.ts' />
module MyModule {
export class MyClass {
...
}
}
Now I've created a second project in the same solution which is going to be the actual application using my newly ported library. I have to include my library somehow and I guess that's what the module system is for. However, I'm not sure what file(s) to import as MyModule is spread over dozens of files. Is this what I can use the .d.ts file for?
Also, to be able to import a module, it has to be declared with the 'export' keyword but if I do that then it is not found by reference comments anymore.
On top of all that, both projects should be compiled so that the compiler output can be readily used with a module loader like requireJS.
What's the best approach to accomplish all this?
Thank you!