We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Constructor, utility type, lib.es5.d.ts
The following type should be added to lib.es5.d.ts:
type Constructor<T> = new (...args: any[]) => T
This is a common pattern used in mixins and other class oriented declarations:
This also complements the existing utility types:
type Constructor<T> = new(...args: any[]) => T; function Tagged<T extends Constructor<{}>>(Base: T) { return class extends Base { _tag: string; constructor(...args: any[]) { super(...args); this._tag = ""; } } } const TaggedPoint = Tagged(Point);
My suggestion meets these guidelines:
The text was updated successfully, but these errors were encountered:
Duplicate of #20256.
Sorry, something went wrong.
This issue has been marked as a 'Duplicate' and has seen no recent activity. It has been automatically closed for house-keeping purposes.
Constructor
No branches or pull requests
Search Terms
Constructor, utility type, lib.es5.d.ts
Suggestion
The following type should be added to lib.es5.d.ts:
Use Cases
This is a common pattern used in mixins and other class oriented declarations:
This also complements the existing utility types:
Examples
Checklist
My suggestion meets these guidelines:
The text was updated successfully, but these errors were encountered: