It took forever for me to get this working for an issue I just discovered is unrelated. The sooner they can get tools for node.js unit testing that actually work within Visual Studio's IDE the better. Can't get any of them working with NTVS and it's super
But like I said, unrelated to this issue.
Importantly, it seems as though this does not
work with internal modules,
you have to include all of the referenced files with it.
For instance, if you have an index.ts file that references an internal module, attempting to compile on
the main file results in an error. I mean, as one might expect. Compiling all of them into a single external file does get you that internal module -- but putting something like
export var externalName = InternalModule;
Doesn't actually work. It doesn't show up anywhere in the output file. So there's no way to "export the API" as you put it. I've tried all sorts of variation, but this seems closest to the one that
work, and just doesn't. I put a reference to the InternalModule in the index.ts. Here's the weird part - if I comment out everything in index.ts, the comments show up after the InternalModule in the output file. If I uncomment the export var,
blam, it's gone. So that's weird.
I kind of got it working though with several large external modules that are referenced by a single other module. Not exactly what you described, but close enough I marked it as the answer.