TypeScript · Senior · Question 40 of 75

How do you type a parameter that accepts an abstract class constructor?

Explanation

Abstract construct signatures (TS 4.2) let you accept both abstract and regular classes - e.g. in mixin functions. new (...args) => T won't accept an abstract class. There's no built-in Constructor<T>; people usually declare it themselves.

Further reading

Problem with a question

TypeScript · Senior · question 40

Test yourself

Take the TypeScript · Senior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz