Skip to content

Commit

Permalink
fix: jssStyle type (#1423)
Browse files Browse the repository at this point in the history
* fix: jssStyle type

typescript can't work with   [K in keyof NormalCssProperties | string]

* chore: add missed JssValue
  • Loading branch information
hosseinmd authored Nov 18, 2020
1 parent f9d9372 commit 3c33514
Showing 1 changed file with 15 additions and 7 deletions.
22 changes: 15 additions & 7 deletions packages/jss/src/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,21 @@ type NormalCssValues<K> = K extends keyof NormalCssProperties
? NormalCssProperties[K] | JssValue
: JssValue

export type JssStyle = {
[K in keyof NormalCssProperties | string]:
| NormalCssValues<K>
| JssStyle
| Func<NormalCssValues<K> | JssStyle | undefined>
| Observable<NormalCssValues<K> | JssStyle | undefined>
}
export type JssStyle =
| {
[K in keyof NormalCssProperties]:
| NormalCssValues<K>
| JssStyle
| Func<NormalCssValues<K> | JssStyle | undefined>
| Observable<NormalCssValues<K> | JssStyle | undefined>
}
| {
[K: string]:
| JssValue
| JssStyle
| Func<JssValue | JssStyle | undefined>
| Observable<JssValue | JssStyle | undefined>
}

export type Styles<Name extends string | number | symbol = string> = Record<
Name,
Expand Down

0 comments on commit 3c33514

Please sign in to comment.