Generic type for class.
Rest
interface A { a: number}class B implements A { a = 1}// Store class in variableconst c: Class<A> = Bconsole.log(typeof c === Class<B>) // true// Passing class to functionfunction f(p: Class<A>) { console.log(p)}f(B) // ok Copy
interface A { a: number}class B implements A { a = 1}// Store class in variableconst c: Class<A> = Bconsole.log(typeof c === Class<B>) // true// Passing class to functionfunction f(p: Class<A>) { console.log(p)}f(B) // ok
Generic type for class.