There are numerous StackOverflow questions that touch on this subject, but either aren\'t quite the same as what I\'m attempting, or are for previous versions of TypeScript.
This is what I make of your situation.
Your modules...
You need to name your file after your module, so a.ts
, should actually be m.ts
and should contain something like...
import express = module('express');
export class a {
A: b;
A2: express.ServerResponse;
}
export class b {
B: number;
}
You shouldn't be using reference
statements here.
When you are running code on nodejs, you can't really split your code across multiple files because the file itself is your module - when you import m = module('m');
it will look for m.js
. What you can do is organise your files in a folder structure.
import x = module('m/x'); // m/x.js
import y = module('m/y'); // m/y.js