From 6b219b7c0e7d939ccffaff122de88a709d6efc40 Mon Sep 17 00:00:00 2001 From: Johnson Chu Date: Fri, 9 Apr 2021 09:28:26 +0800 Subject: [PATCH] feat: support find definition for jsx tags, events --- 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 cd4133a9af1..f6383451633 100644 --- a/packages/runtime-dom/types/jsx.d.ts +++ b/packages/runtime-dom/types/jsx.d.ts @@ -1311,10 +1311,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 @@ -1332,7 +1330,7 @@ type ReservedProps = { type ElementAttrs = T & ReservedProps type NativeElements = { - [K in StringKeyOf]: ElementAttrs< + [K in keyof IntrinsicElementAttributes]: ElementAttrs< IntrinsicElementAttributes[K] > }