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

Commit c6e3c90

Browse files
committed
chore: declare global props
1 parent 64c1cb3 commit c6e3c90

File tree

4 files changed

+12
-4
lines changed

4 files changed

+12
-4
lines changed

global.d.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1+
export {}
12
declare global {
23
namespace JSX {
3-
interface IntrinsicAttributes {
4+
export interface IntrinsicAttributes {
45
as?: string
56
label?: string
7+
poop?: 'name' | 'hard' | 'soft'
68
}
79
}
810
}

packages/c-button/src/button.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { h, defineComponent, PropType, computed, cloneVNode } from 'vue'
1+
import { defineComponent, PropType, computed, cloneVNode } from 'vue'
22
import {
33
chakra,
44
DOMElements,

packages/system/src/chakra.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,12 @@ interface StyleResolverOptions extends StyleResolverProps {
5050

5151
interface ChakraFactoryOptions extends StyleResolverProps {}
5252

53+
declare global {
54+
namespace JSX {
55+
interface IntrinsicAttributes extends StyleResolverProps {}
56+
}
57+
}
58+
5359
const chakraProps = {
5460
__css: Object as PropType<StyleResolverProps['__css']>,
5561
sx: Object as PropType<StyleResolverProps['sx']>,
@@ -253,7 +259,7 @@ export const resolveStyles = (
253259
}
254260

255261
type IChakraFactory = {
256-
[key in DOMElements]: DefineComponent
262+
[key in DOMElements]: DefineComponent | JSX.Element
257263
} & {
258264
(tag: DOMElements, options?: StyleResolverProps): DefineComponent
259265
}

tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"esModuleInterop": true, /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */
1717
"skipLibCheck": true, /* Skip type checking of declaration files. */
1818
"forceConsistentCasingInFileNames": true, /* Disallow inconsistently-cased references to the same file. */
19-
"typeRoots": ["./node_modules/@types", "./jsx.d.ts"]
19+
"typeRoots": ["./node_modules/@types", "./global.d.ts"]
2020
},
2121
"include": [
2222
"packages",

0 commit comments

Comments
 (0)