Просмотр исходного кода

types(jsx): make HTMLAttributes and SVGAttributes extend Events (#1941)

Amour1688 5 лет назад
Родитель
Сommit
a47626a4a3
1 измененных файлов с 3 добавлено и 3 удалено
  1. 3 3
      packages/runtime-dom/types/jsx.d.ts

+ 3 - 3
packages/runtime-dom/types/jsx.d.ts

@@ -245,7 +245,7 @@ interface AriaAttributes {
   'aria-valuetext'?: string
 }
 
-export interface HTMLAttributes extends AriaAttributes {
+export interface HTMLAttributes extends AriaAttributes, EventHandlers<Events> {
   innerHTML?: string
 
   class?: any
@@ -734,7 +734,7 @@ export interface WebViewHTMLAttributes extends HTMLAttributes {
   webpreferences?: string
 }
 
-export interface SVGAttributes extends AriaAttributes {
+export interface SVGAttributes extends AriaAttributes, EventHandlers<Events> {
   innerHTML?: string
 
   /**
@@ -1322,7 +1322,7 @@ type ReservedProps = {
     | ((ref: Element | RuntimeCore.ComponentInternalInstance | null) => void)
 }
 
-type ElementAttrs<T> = T & EventHandlers<Events> & ReservedProps
+type ElementAttrs<T> = T & ReservedProps
 
 type NativeElements = {
   [K in StringKeyOf<IntrinsicElementAttributes>]: ElementAttrs<