From: Evan You Date: Fri, 10 Jul 2020 22:04:44 +0000 (-0400) Subject: types: fix jsx type collision with generated type after concatenation X-Git-Tag: v3.0.0-beta.21~24 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=73807aeaf72ab102510f9a9dfa1dcc21c11bf23a;p=thirdparty%2Fvuejs%2Fcore.git types: fix jsx type collision with generated type after concatenation --- diff --git a/packages/runtime-dom/types/jsx.d.ts b/packages/runtime-dom/types/jsx.d.ts index 77216de6a8..2c9daff29d 100644 --- a/packages/runtime-dom/types/jsx.d.ts +++ b/packages/runtime-dom/types/jsx.d.ts @@ -1,8 +1,6 @@ // Note: this file is auto concatenated to the end of the bundled d.ts during // build. -import { Ref, ComponentPublicInstance } from '@vue/runtime-core' - // This code is based on react definition in DefinitelyTyped published under the MIT license. // Repository: https://github.com/DefinitelyTyped/DefinitelyTyped // Path in the repository: types/react/index.d.ts @@ -1307,9 +1305,16 @@ type EventHandlers = { [K in StringKeyOf]?: 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 = { key?: string | number - ref?: string | Ref | ((ref: Element | ComponentPublicInstance | null) => void) + ref?: + | string + | RuntimeCore.Ref + | ((ref: Element | RuntimeCore.ComponentInternalInstance | null) => void) } type ElementAttrs = T & EventHandlers & ReservedProps