Skip to content

Commit

Permalink
Improved the declared types related to Stylis (#2493)
Browse files Browse the repository at this point in the history
  • Loading branch information
Andarist committed Oct 3, 2021
1 parent 045f0ac commit 9ae4a91
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .changeset/itchy-waves-beg.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@emotion/cache': patch
---

Improved the declared types related to Stylis. This should improve the compatibility with the types published in `@types/stylis`.
9 changes: 5 additions & 4 deletions packages/cache/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ export { EmotionCache }
export interface StylisElement {
type: string
value: string
props: Array<string>
props: Array<string> | string
root: StylisElement | null
children: Array<StylisElement>
parent: StylisElement | null
children: Array<StylisElement> | string
line: number
column: number
length: number
Expand All @@ -20,14 +21,14 @@ export type StylisPluginCallback = (
index: number,
children: Array<StylisElement>,
callback: StylisPluginCallback
) => string | undefined
) => string | void

export type StylisPlugin = (
element: StylisElement,
index: number,
children: Array<StylisElement>,
callback: StylisPluginCallback
) => string | undefined
) => string | void

export interface Options {
nonce?: string
Expand Down

0 comments on commit 9ae4a91

Please sign in to comment.