From 9b493ed089df97e63462f509b72c6fc966546d20 Mon Sep 17 00:00:00 2001 From: Hossein Mohammadi Date: Sun, 15 Nov 2020 17:24:24 +0330 Subject: [PATCH 1/2] fix: jssStyle type typescript can't work with [K in keyof NormalCssProperties | string] --- packages/jss/src/index.d.ts | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/packages/jss/src/index.d.ts b/packages/jss/src/index.d.ts index 1dfe120e1..b9d039df3 100644 --- a/packages/jss/src/index.d.ts +++ b/packages/jss/src/index.d.ts @@ -15,13 +15,17 @@ type NormalCssValues = K extends keyof NormalCssProperties ? NormalCssProperties[K] | JssValue : JssValue -export type JssStyle = { - [K in keyof NormalCssProperties | string]: - | NormalCssValues - | JssStyle - | Func | JssStyle | undefined> - | Observable | JssStyle | undefined> -} +export type JssStyle = + | { + [K in keyof NormalCssProperties]: + | NormalCssValues + | JssStyle + | Func | JssStyle | undefined> + | Observable | JssStyle | undefined> + } + | { + [K: string]: JssStyle | Func | Observable + } export type Styles = Record< Name, From 74b94ba4f0eab68a65cdf641d9d2b8677fc19562 Mon Sep 17 00:00:00 2001 From: Hossein Mohammadi Date: Mon, 16 Nov 2020 10:08:27 +0330 Subject: [PATCH 2/2] chore: add missed JssValue --- packages/jss/src/index.d.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/jss/src/index.d.ts b/packages/jss/src/index.d.ts index b9d039df3..edfc7ce16 100644 --- a/packages/jss/src/index.d.ts +++ b/packages/jss/src/index.d.ts @@ -24,7 +24,11 @@ export type JssStyle = | Observable | JssStyle | undefined> } | { - [K: string]: JssStyle | Func | Observable + [K: string]: + | JssValue + | JssStyle + | Func + | Observable } export type Styles = Record<