Skip to content

Commit 73807ae

Browse files
committed
types: fix jsx type collision with generated type after concatenation
1 parent 4c43d4e commit 73807ae

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

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

+8-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
// Note: this file is auto concatenated to the end of the bundled d.ts during
22
// build.
33

4-
import { Ref, ComponentPublicInstance } from '@vue/runtime-core'
5-
64
// This code is based on react definition in DefinitelyTyped published under the MIT license.
75
// Repository: https://github.com/DefinitelyTyped/DefinitelyTyped
86
// Path in the repository: types/react/index.d.ts
@@ -1307,9 +1305,16 @@ type EventHandlers<E> = {
13071305
[K in StringKeyOf<E>]?: E[K] extends Function ? E[K] : (payload: E[K]) => void
13081306
}
13091307

1308+
// use namespace import to avoid collision with generated types which use
1309+
// named imports.
1310+
import * as RuntimeCore from '@vue/runtime-core'
1311+
13101312
type ReservedProps = {
13111313
key?: string | number
1312-
ref?: string | Ref | ((ref: Element | ComponentPublicInstance | null) => void)
1314+
ref?:
1315+
| string
1316+
| RuntimeCore.Ref
1317+
| ((ref: Element | RuntimeCore.ComponentInternalInstance | null) => void)
13131318
}
13141319

13151320
type ElementAttrs<T> = T & EventHandlers<Events> & ReservedProps

0 commit comments

Comments
 (0)