Skip to content

Commit ddec3e5

Browse files
authored
Fix types (#1318)
* Perfomance issue in VSCode Using recursive type * Fix css value type for using array values Allow using padding: [[0, '5px']]
1 parent 1288929 commit ddec3e5

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

packages/jss/src/index.d.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,14 @@ import * as css from 'csstype'
44
type FnValue<R> = R | ((data: any) => R)
55

66
type NormalCssProperties = css.Properties<string | number>
7-
type CssProperties = {[K in keyof NormalCssProperties]: FnValue<NormalCssProperties[K]>}
7+
type CssProperties = {[K in keyof NormalCssProperties]: FnValue<NormalCssProperties[K] | JssValue>}
88

99
// Jss Style definitions
10-
type JssStyleP<S> = CssProperties & {
11-
[key: string]: FnValue<JssValue | S>
10+
type JssStyleP = {
11+
[key: string]: FnValue<JssValue | JssStyleP>
1212
}
1313

14-
export type JssStyle = JssStyleP<
15-
JssStyleP<JssStyleP<JssStyleP<JssStyleP<JssStyleP<JssStyleP<void>>>>>>
16-
>
14+
export type JssStyle = CssProperties & JssStyleP;
1715

1816
export type Styles<Name extends string | number | symbol = string> = Record<Name, JssStyle | string>
1917
export type Classes<Name extends string | number | symbol = string> = Record<Name, string>

0 commit comments

Comments
 (0)