Is there a type for “Class” in Typescript? And does “any” include it?

后端 未结 7 775
渐次进展
渐次进展 2020-12-07 18:34

In Java, you can give a class to a method as a parameter using the type \"Class\". I didn\'t find anything similar in the typescript docs - is it possible to hand a class to

相关标签:
7条回答
  • 2020-12-07 19:27

    Here's an example of a type that includes only classes:

    declare type Class<T = any> = new (...args: any[]) => T;
    
    0 讨论(0)
提交回复
热议问题