Skip to content

Proposal: change the signature of the Constructor<T> type for use in mixins #217

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

Closed
jolleekin opened this issue Sep 21, 2018 · 3 comments · Fixed by #801
Closed

Proposal: change the signature of the Constructor<T> type for use in mixins #217

jolleekin opened this issue Sep 21, 2018 · 3 comments · Fixed by #801

Comments

@jolleekin
Copy link

Issue

Please change the signature of the Constructor<T> type (declared in decorators.ts) to use any instead of unknown so it can be used to create mixins. Without this change, anyone using lit-element will have to declare his/her own Constructor<T> type to create mixins.

export type Constructor<T> = {
  new (...args: unknown[]): T
};

// should be changed to

export type Constructor<T> = {
  new (...args: any[]): T
};

// or

export type Constructor<T> = new (...args: any[]) => T;

Versions

  • lit-element: v0.6.1
@aadamsx
Copy link

aadamsx commented Sep 21, 2018

If you know what needs to be done (it sounds like you do), submit a PR! :)

@justinfagnani
Copy link
Contributor

This seems fine, but we should file an upstream issue on TypeScript

@jolleekin
Copy link
Author

Seems like this is the upstream issue 14126

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants