Skip to content

Commit

Permalink
Fixed TypeScript definition of the EmotionCache by replacing the no…
Browse files Browse the repository at this point in the history
…n-existent `stylis` method with `insert` that is available at runtime (#1999)

* Update TypeScript definition of EmotionCache (#1990)

Replaced `stylis` function with `insert` function, following
the Flow definition.

* Update .changeset/honest-terms-mate.md

Co-authored-by: Mateusz Burzyński <mateuszburzynski@gmail.com>
  • Loading branch information
RoystonS and Andarist committed Sep 6, 2020
1 parent 0895f1f commit debaad9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/honest-terms-mate.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@emotion/utils': patch
---

Fixed TypeScript definition of the `EmotionCache` by replacing the non-existent `stylis` method with `insert` that is available at runtime.
7 changes: 6 additions & 1 deletion packages/utils/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ export interface StyleSheet {
}

export interface EmotionCache {
stylis(key: string, value: string): Array<string>
inserted: {
[key: string]: string | true
}
Expand All @@ -24,6 +23,12 @@ export interface EmotionCache {
key: string
compat?: true
nonce?: string
insert(
selector: string,
serialized: SerializedStyles,
sheet: StyleSheet,
shouldCache: boolean
): string | void
}

export interface SerializedStyles {
Expand Down

0 comments on commit debaad9

Please sign in to comment.