Skip to content

Commit

Permalink
fix: tweak types (#806)
Browse files Browse the repository at this point in the history
* fix: tweak types

* use import()
  • Loading branch information
huozhi authored Aug 11, 2022
1 parent 22e36bf commit 865ba14
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 10 deletions.
13 changes: 13 additions & 0 deletions global.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/// <reference types="./css" />
/// <reference types="./index" />
/// <reference types="./macro" />
/// <reference types="./style" />

import React from 'react'

declare module 'react' {
interface StyleHTMLAttributes<T> extends HTMLAttributes<T> {
jsx?: boolean
global?: boolean
}
}
11 changes: 1 addition & 10 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,3 @@
import React from 'react'

declare module 'react' {
interface StyleHTMLAttributes<T> extends HTMLAttributes<T> {
jsx?: boolean
global?: boolean
}
}

declare module 'styled-jsx' {
export type StyledJsxStyleRegistry = {
styles(options?: { nonce?: string }): JSX.Element[]
Expand All @@ -19,7 +10,7 @@ declare module 'styled-jsx' {
children,
registry
}: {
children: JSX.Element | React.ReactNode
children: JSX.Element | import('react').ReactNode
registry?: StyledJsxStyleRegistry
}): JSX.Element
export function createStyleRegistry(): StyledJsxStyleRegistry
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"files": [
"dist",
"lib",
"global.d.ts",
"index.d.ts",
"index.js",
"babel.js",
Expand Down

0 comments on commit 865ba14

Please sign in to comment.