]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
feat(types/ide): support find definition for jsx tags, events (#3570)
authorJohnson Chu <johnsoncodehk@gmail.com>
Thu, 1 Jul 2021 17:49:16 +0000 (01:49 +0800)
committerGitHub <noreply@github.com>
Thu, 1 Jul 2021 17:49:16 +0000 (13:49 -0400)
packages/runtime-dom/types/jsx.d.ts

index ea09228e1ffb9c8f0df25c2570f5081ff6d6aeb6..21f91b9a40a537fe5619776fad57a098807fe0aa 100644 (file)
@@ -1296,10 +1296,8 @@ export interface Events {
   onTransitionstart: TransitionEvent
 }
 
-type StringKeyOf<T> = Extract<keyof T, string>
-
 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
@@ -1317,7 +1315,7 @@ type ReservedProps = {
 type ElementAttrs<T> = T & ReservedProps
 
 type NativeElements = {
-  [K in StringKeyOf<IntrinsicElementAttributes>]: ElementAttrs<
+  [K in keyof IntrinsicElementAttributes]: ElementAttrs<
     IntrinsicElementAttributes[K]
   >
 }