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

This commit is contained in:
Amour1688 2020-08-25 21:50:33 +08:00 committed by GitHub
parent 1d55454e61
commit a47626a4a3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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<