Extracting the instance type from the ctor value that works for abstract classes #26829
Closed
3 of 4 tasks
Labels
Needs Proposal
This issue needs a plan that clarifies the finer details of how it could be implemented.
Suggestion
An idea for TypeScript
Search Terms
abstract class constructor type
Suggestion
Currently, I think there is no way to express the type of constructor functions for abstract classes. On one hand that is correct because 'new' cannot be called on them. However, sometimes there is a need to tie an instance of the abstract class with the constructor function for type-checking.
Use Cases
DI helper functions in angular and other frameworks.
Examples
Basically, this is asking for a mechanism to go from a value
C
, whereC
is a symbol for a class (abstract or not), to the typeC
.Checklist
My suggestion meets these guidelines:
The text was updated successfully, but these errors were encountered: