types: fix jsx type collision with generated type after concatenation

This commit is contained in:
Evan You 2020-07-10 18:04:44 -04:00
parent 4c43d4e5b9
commit 73807aeaf7

View File

@ -1,8 +1,6 @@
// Note: this file is auto concatenated to the end of the bundled d.ts during // Note: this file is auto concatenated to the end of the bundled d.ts during
// build. // build.
import { Ref, ComponentPublicInstance } from '@vue/runtime-core'
// This code is based on react definition in DefinitelyTyped published under the MIT license. // This code is based on react definition in DefinitelyTyped published under the MIT license.
// Repository: https://github.com/DefinitelyTyped/DefinitelyTyped // Repository: https://github.com/DefinitelyTyped/DefinitelyTyped
// Path in the repository: types/react/index.d.ts // Path in the repository: types/react/index.d.ts
@ -1307,9 +1305,16 @@ type EventHandlers<E> = {
[K in StringKeyOf<E>]?: E[K] extends Function ? E[K] : (payload: E[K]) => void [K in StringKeyOf<E>]?: E[K] extends Function ? E[K] : (payload: E[K]) => void
} }
// use namespace import to avoid collision with generated types which use
// named imports.
import * as RuntimeCore from '@vue/runtime-core'
type ReservedProps = { type ReservedProps = {
key?: string | number key?: string | number
ref?: string | Ref | ((ref: Element | ComponentPublicInstance | null) => void) ref?:
| string
| RuntimeCore.Ref
| ((ref: Element | RuntimeCore.ComponentInternalInstance | null) => void)
} }
type ElementAttrs<T> = T & EventHandlers<Events> & ReservedProps type ElementAttrs<T> = T & EventHandlers<Events> & ReservedProps