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

types: fix type error with Vue #9556 #3574

Merged
merged 1 commit into from
Dec 4, 2023
Merged

Conversation

pikax
Copy link
Contributor

@pikax pikax commented Nov 20, 2023

Before submitting the PR, please make sure you do the following

  • Read the Contributing Guidelines.
  • Read the Pull Request Guidelines.
  • Check that there isn't already a PR that solves the problem the same way to avoid creating a duplicate.
  • Provide a description in this PR that addresses what the PR is solving, or reference the issue that it solves (e.g. fixes #123).
  • Ideally, include relevant tests that fail without this PR but pass with it.

Description

Working on this PR vuejs/core#9556 to introduce some type utilities and improve defineComponent type.

That causes the defineComponent to be more strict on types.

This PR has compatibility with the correct Vue version, only an issue when that PR is merged.

Additional context

A more elegant approach would use the introduced DeclareComponent helper to patch $slots :

export type DefineTemplateComponent<
  Bindings extends object,
  Slots extends Record<string, Slot | undefined>,
> = DeclareComponetn<{
  new(): { $slots: { default(_: Bindings & { $slots: Slots }): any } }
}>

But that not compatible with 3.3.

@Alfred-Skyblue Alfred-Skyblue added direction: approved The direction of feature/change is approved by the team. May require some small changes. vue: upstream labels Nov 21, 2023
@antfu antfu merged commit 9c72d5c into vueuse:main Dec 4, 2023
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
direction: approved The direction of feature/change is approved by the team. May require some small changes. vue: upstream
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants