From 8ed3ed6c27b0fb9a1b6994eddc967e42d4b3d4e1 Mon Sep 17 00:00:00 2001 From: Johnson Chu Date: Fri, 2 Jul 2021 01:49:16 +0800 Subject: [PATCH] feat(types/ide): support find definition for jsx tags, events (#3570) --- packages/runtime-dom/types/jsx.d.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/packages/runtime-dom/types/jsx.d.ts b/packages/runtime-dom/types/jsx.d.ts index ea09228e..21f91b9a 100644 --- a/packages/runtime-dom/types/jsx.d.ts +++ b/packages/runtime-dom/types/jsx.d.ts @@ -1296,10 +1296,8 @@ export interface Events { onTransitionstart: TransitionEvent } -type StringKeyOf = Extract - type EventHandlers = { - [K in StringKeyOf]?: 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 & ReservedProps type NativeElements = { - [K in StringKeyOf]: ElementAttrs< + [K in keyof IntrinsicElementAttributes]: ElementAttrs< IntrinsicElementAttributes[K] > }