]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
types: fix jsx type collision with generated type after concatenation
authorEvan You <yyx990803@gmail.com>
Fri, 10 Jul 2020 22:04:44 +0000 (18:04 -0400)
committerEvan You <yyx990803@gmail.com>
Fri, 10 Jul 2020 22:04:44 +0000 (18:04 -0400)
packages/runtime-dom/types/jsx.d.ts

index 77216de6a871f1d7a6551f6ef85dee93276c3ac8..2c9daff29dde91c3ca2a5b4c23d0cba8a71222ac 100644 (file)
@@ -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<E> = {
   [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 = {
   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