Skip to content
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

feat(types): add generics to components #14230

Merged
merged 7 commits into from
Oct 6, 2021
Merged

Conversation

KaelWD
Copy link
Member

@KaelWD KaelWD commented Oct 4, 2021

Prop types can be inferred based on others:
Screenshot_20211004_231426
Screenshot_20211004_231453
Screenshot_20211004_231910

Also allows typed slots with volar: vuejs/language-tools#539

I tried adding the ability to type $el too but typescript doesn't like (new () => A) & (new () => B)

I extends Record<'$el', any> ? (new () => Omit<BaseI, '$el'>) & T : Base & T

@KaelWD KaelWD marked this pull request as ready for review October 4, 2021 12:58
@KaelWD KaelWD self-assigned this Oct 4, 2021
@KaelWD KaelWD added the T: enhancement Functionality that enhances existing features label Oct 4, 2021
@KaelWD KaelWD added this to the v3.0.0 milestone Oct 4, 2021
@KaelWD KaelWD merged commit 827c6ee into next Oct 6, 2021
@KaelWD KaelWD deleted the feat/generic-component-types branch October 6, 2021 09:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T: enhancement Functionality that enhances existing features typescript
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant