In TypeScript I can define the type of a variable as the type of a class. For example:
class MyClass { ... }
let myVar: typeof MyClass = MyClass;
Now I want to use this with a generic class, something like this:
class MyManager<T> {
constructor(cls: typeof T) { ... }
/* some other methods, which uses instances of T */
}
let test = new MyManager(MyClass); /* <MyClass> should be implied by the parameter */
So, I want to give my manager class another class (its constructor), because the manager needs to retreive static information associated with the class.
When compiling my code, it says that it cannot find name 'T', where my constructor is.
Any idea how to solve it?