It seems to be fixed in versions 0.9.1.1 and later. You just need to create a module with the same name as the class in which you want to insert types, and paste your nested types into it.
More specifically, this is how you do it:
declare module a { class b { } module b { class c { } } } var myB = new ab(); var myC = new abc();
This also works when nesting types in typescript code with the export keyword:
export module a { export class b { } export module b { export enum c { C1 = 1, C2 = 2, C3 = 3, } } }
As mentioned by @recursive in the comments below, the declaration order is important. Therefore, the class definition must be located in front of the module with nested types.
sboisse Feb 20 '14 at 21:44 2014-02-20 21:44
source share