I am looking for a guide on how to create a class declaration in a .d.ts file.
The class has a method that takes a type T and returns an instance of T.
You need something creative and then it floats smoothly:
interface Creator<T> { new (): T; } function factory<T>( arg: Creator<T> ): T { return new arg(); } // Usage: class Foo { something = 123; } var foo = factory( Foo ); // foo:Foo