It seems that the information on how to actually structure code when writing Typescript is next to non-existent.
I want to make a server in node. It has external dep
Actually you can (by now):
file: class1.ts:
export class Class1 {
name: string;
constructor(name: string){
this.name = name;
}
}
file: class2.ts:
export class Class2 {
name: string;
}
consolidating module file: classes.ts:
export { Class1 } from "./class1";
export { Class2 } from "./class2";
consuming file:
import { Class1, Class2 } from "./classes";
let c1 = new Class1("Herbert");
let c2 = new Class2();
In this manner you can have one class (or interface) per file. In one consolidating module file (classes.ts) you then reference all entities that make up your "module".
Now you only have to reference (import) on single module file to access all of your classes. You still have a neat compartmentalization between files.
Hope this helps anyone still looking.