Skip to content

Commit 9ae4a91

Browse files
authored
Improved the declared types related to Stylis (#2493)
1 parent 045f0ac commit 9ae4a91

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

.changeset/itchy-waves-beg.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@emotion/cache': patch
3+
---
4+
5+
Improved the declared types related to Stylis. This should improve the compatibility with the types published in `@types/stylis`.

packages/cache/types/index.d.ts

+5-4
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,10 @@ export { EmotionCache }
77
export interface StylisElement {
88
type: string
99
value: string
10-
props: Array<string>
10+
props: Array<string> | string
1111
root: StylisElement | null
12-
children: Array<StylisElement>
12+
parent: StylisElement | null
13+
children: Array<StylisElement> | string
1314
line: number
1415
column: number
1516
length: number
@@ -20,14 +21,14 @@ export type StylisPluginCallback = (
2021
index: number,
2122
children: Array<StylisElement>,
2223
callback: StylisPluginCallback
23-
) => string | undefined
24+
) => string | void
2425

2526
export type StylisPlugin = (
2627
element: StylisElement,
2728
index: number,
2829
children: Array<StylisElement>,
2930
callback: StylisPluginCallback
30-
) => string | undefined
31+
) => string | void
3132

3233
export interface Options {
3334
nonce?: string

0 commit comments

Comments
 (0)