This is a Typescript question about namespaces and file management. I have a number of interfaces and classes under a single namespace. I want to segment each class or interface into its own .ts file and then be able to aggregate the files so that I can just declare the namespace in some consuming code and then have accesses to the interfaces and classes within the namespace. For example, the first file, icontact.ts:
export namespace mynamespace {
export interface IContact {
firstName: string;
lastName: string;
}
}
Second file, contact.ts:
import {IContact} from './icontact.ts';
export namespace mynamespace {
export class Contact implements IContact {
firstName: string;
lastName: string;
constructor(firstName: string, lastName: string){
this.firstName = firstName;
this.lastName = lastName:
}
}
}
I will really appreciate any help that anyone can offer.
Thanks in advance.