feat(types/ide): support find definition for jsx tags, events (#3570)
This commit is contained in:
parent
81e69b29ec
commit
8ed3ed6c27
6
packages/runtime-dom/types/jsx.d.ts
vendored
6
packages/runtime-dom/types/jsx.d.ts
vendored
@ -1296,10 +1296,8 @@ export interface Events {
|
|||||||
onTransitionstart: TransitionEvent
|
onTransitionstart: TransitionEvent
|
||||||
}
|
}
|
||||||
|
|
||||||
type StringKeyOf<T> = Extract<keyof T, string>
|
|
||||||
|
|
||||||
type EventHandlers<E> = {
|
type EventHandlers<E> = {
|
||||||
[K in StringKeyOf<E>]?: E[K] extends Function ? E[K] : (payload: E[K]) => void
|
[K in keyof E]?: E[K] extends Function ? E[K] : (payload: E[K]) => void
|
||||||
}
|
}
|
||||||
|
|
||||||
// use namespace import to avoid collision with generated types which use
|
// use namespace import to avoid collision with generated types which use
|
||||||
@ -1317,7 +1315,7 @@ type ReservedProps = {
|
|||||||
type ElementAttrs<T> = T & ReservedProps
|
type ElementAttrs<T> = T & ReservedProps
|
||||||
|
|
||||||
type NativeElements = {
|
type NativeElements = {
|
||||||
[K in StringKeyOf<IntrinsicElementAttributes>]: ElementAttrs<
|
[K in keyof IntrinsicElementAttributes]: ElementAttrs<
|
||||||
IntrinsicElementAttributes[K]
|
IntrinsicElementAttributes[K]
|
||||||
>
|
>
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user