File tree 2 files changed +32
-9
lines changed
2 files changed +32
-9
lines changed Original file line number Diff line number Diff line change 1
1
// global JSX namespace registration
2
- import { JSX as JSXInternal } from './jsx-runtime'
2
+ // somehow we have to copy=pase the jsx-runtime types here to make TypeScript happy
3
+ import { VNode , VNodeRef } from '@vue/runtime-dom'
4
+ import { IntrinsicElementAttributes } from './jsx-runtime/dom'
5
+
6
+ export * from './jsx-runtime/dom'
7
+
8
+ export type ReservedProps = {
9
+ key ?: string | number | symbol
10
+ ref ?: VNodeRef
11
+ ref_for ?: boolean
12
+ ref_key ?: string
13
+ }
14
+
15
+ export type NativeElements = {
16
+ [ K in keyof IntrinsicElementAttributes ] : IntrinsicElementAttributes [ K ] &
17
+ ReservedProps
18
+ }
3
19
4
20
declare global {
5
21
namespace JSX {
6
- interface Element extends JSXInternal . Element { }
7
- interface ElementClass extends JSXInternal . ElementClass { }
8
- interface ElementAttributesProperty
9
- extends JSXInternal . ElementAttributesProperty { }
10
- interface IntrinsicElements extends JSXInternal . IntrinsicElements { }
11
- interface IntrinsicAttributes extends JSXInternal . IntrinsicAttributes { }
22
+ export interface Element extends VNode { }
23
+ export interface ElementClass {
24
+ $props : { }
25
+ }
26
+ export interface ElementAttributesProperty {
27
+ $props : { }
28
+ }
29
+ export interface IntrinsicElements extends NativeElements {
30
+ // allow arbitrary elements
31
+ // @ts -ignore suppress ts:2374 = Duplicate string index signature.
32
+ [ name : string ] : any
33
+ }
34
+ export interface IntrinsicAttributes extends ReservedProps { }
12
35
}
13
36
}
14
-
15
- export { }
Original file line number Diff line number Diff line change 2
2
// imports the global JSX namespace registration for compat.
3
3
// TODO: remove in 3.4
4
4
import '../jsx'
5
+
6
+ export * from '../jsx-runtime/dom'
You can’t perform that action at this time.
0 commit comments