Skip to content

Commit

Permalink
fix: jssStyle type
Browse files Browse the repository at this point in the history
typescript can't work with   [K in keyof NormalCssProperties | string]
  • Loading branch information
hosseinmd committed Nov 15, 2020
1 parent 2b2704d commit 9b493ed
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions packages/jss/src/index.d.ts
Expand Up @@ -15,13 +15,17 @@ 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]: JssStyle | Func<JssStyle> | Observable<JssStyle | undefined>
}

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

0 comments on commit 9b493ed

Please sign in to comment.