I am looking at using typescript within node, and am currently used to using typescript via the ///<reference.../> syntax purely using internal modules. However with larger projects this can get unwieldy as you can have modules referencing other modules which all have interlinking references.
So for this node project I was thinking about trying to group all logical components as internal modules/classes much like before, so they will all internally reference each other, but expose them via one external module which would expose the underlying classes etc.
This way the syntax would be very similar of nodes existing requiring mechanisms, like:
import database = require("my-external-db-module.ts");
var connection = new database.Connection(someUrl);
rather than
///<reference path="my-internal-db-modules.ts" />
var connection = new Database.Connection(someUrl);
And I imagine the syntax would be something like:
///<reference path="all-my-internal-module-files-etc.ts" />
///<reference path="..." />
export module SomeExposingModule
{
// Not quite sure what to put in here to expose the internal modules
}
So are there any sort of best practices around this sort of thing or any others who have done something similar, or does everyone just stick to using internal modules for complex stuff?