Skip to content
This repository was archived by the owner on Sep 20, 2024. It is now read-only.

Commit fe54713

Browse files
committed
chore: types fixed
1 parent 8a50d2f commit fe54713

File tree

5 files changed

+22
-2
lines changed

5 files changed

+22
-2
lines changed

env.d.ts

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
import type { HTMLAttributes, VNode } from "vue"
22
import type { ChakraProps } from "@chakra-ui/vue-system"
3+
import { DefineComponent } from "vue"
4+
import { ChakraFactoryProps, ComponentWithProps } from "@chakra-ui/vue-system"
35

46
declare global {
5-
namespace h.JSX {
7+
namespace JSX {
68
interface Element extends VNode {}
7-
interface ElementClass {
9+
interface ElementClass
10+
extends DefineComponent<ChakraFactoryProps>,
11+
ComponentWithProps<ChakraFactoryProps> {
812
$props: {}
913
}
1014
interface ElementAttributesProperty {
@@ -16,3 +20,9 @@ declare global {
1620
ChakraProps {}
1721
}
1822
}
23+
24+
declare module "vue" {
25+
export type JSXComponent<Props = any> =
26+
| { new (): ComponentPublicInstance<Props> }
27+
| FunctionalComponent<Props>
28+
}

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,7 @@
180180
]
181181
},
182182
"devDependencies": {
183+
"@types/react": "file:stub/types__react",
183184
"happy-dom": "^6.0.3"
184185
}
185186
}

stub/types__react/index.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
// https://github.com/johnsoncodehk/volar/discussions/592
2+
export {}

stub/types__react/package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"name": "@types/react",
3+
"version": "0.0.0"
4+
}

yarn.lock

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3608,6 +3608,9 @@
36083608
resolved "https://registry.yarnpkg.com/@types/qs/-/qs-6.9.7.tgz#63bb7d067db107cc1e457c303bc25d511febf6cb"
36093609
integrity sha512-FGa1F62FT09qcrueBA6qYTrJPVDzah9a+493+o2PCXsesWHIn27G98TsSMs3WPNbZIEj4+VJf6saSFpvD+3Zsw==
36103610

3611+
"@types/react@file:stub/types__react":
3612+
version "0.0.0"
3613+
36113614
"@types/recursive-readdir@^2.2.0":
36123615
version "2.2.1"
36133616
resolved "https://registry.yarnpkg.com/@types/recursive-readdir/-/recursive-readdir-2.2.1.tgz#330f5ec0b73e8aeaf267a6e056884e393f3543a3"

0 commit comments

Comments
 (0)