Skip to content

Add support for abstract constructor types #36392

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Jan 8, 2021
Prev Previous commit
Next Next commit
Reverting use of 'abstract' in lib/es5.d.ts due to eslint issues
  • Loading branch information
rbuckton committed Jul 11, 2020
commit 42528abebfb6a8b63651e0fab302cbc67d72233c
4 changes: 2 additions & 2 deletions src/lib/es5.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1496,7 +1496,7 @@ type Parameters<T extends (...args: any) => any> = T extends (...args: infer P)
/**
* Obtain the parameters of a constructor function type in a tuple
*/
type ConstructorParameters<T extends abstract new (...args: any) => any> = T extends abstract new (...args: infer P) => any ? P : never;
type ConstructorParameters<T extends new (...args: any) => any> = T extends new (...args: infer P) => any ? P : never;

/**
* Obtain the return type of a function type
Expand All @@ -1506,7 +1506,7 @@ type ReturnType<T extends (...args: any) => any> = T extends (...args: any) => i
/**
* Obtain the return type of a constructor function type
*/
type InstanceType<T extends abstract new (...args: any) => any> = T extends abstract new (...args: any) => infer R ? R : any;
type InstanceType<T extends new (...args: any) => any> = T extends new (...args: any) => infer R ? R : any;

/**
* Marker for contextual 'this' type
Expand Down