Generic type for class.
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
Rest
Generated using TypeDoc
Generic type for class.
Example