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): support find definition for jsx tags, events #3570

Merged
merged 1 commit into from Jul 1, 2021
Merged

feat(types): support find definition for jsx tags, events #3570

merged 1 commit into from Jul 1, 2021

Conversation

johnsoncodehk
Copy link
Member

@johnsoncodehk johnsoncodehk commented Apr 9, 2021

StringKeyOf seem has no practical effect, unused it to support find definition for jsx tags and events in IDE.

Animation

@johnsoncodehk johnsoncodehk changed the title feat: support find definition for jsx tags, events feat(runtime-dom): support find definition for jsx tags, events Apr 9, 2021
Copy link
Member

@pikax pikax left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

The type is slightly different but I think there's no real world implications

type StringKeyOf<T> = Extract<keyof T, string>

type EventHandlers<E> = {
  [K in StringKeyOf<E>]?: E[K] extends Function ? E[K] : (payload: E[K]) => void
}

type EventHandlers2<E> = {
  [K in keyof E]?: E[K] extends Function ? E[K] : (payload: E[K]) => void
}

declare const SS: unique symbol
type DDD = EventHandlers<{ [SS]: 1 } & { [number: number]: 'ee' }>
type DDD2 = EventHandlers2<{ [SS]: 1 } & { [number: number]: 'ee' }>

An extra set of eyes might be good here

@johnsoncodehk johnsoncodehk changed the title feat(runtime-dom): support find definition for jsx tags, events feat(types): support find definition for jsx tags, events Apr 28, 2021
@yyx990803 yyx990803 merged commit 8ed3ed6 into vuejs:master Jul 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants