Skip to content

Commit

Permalink
update types / improve theme typing
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathantneal committed Jul 22, 2021
1 parent 74fd16e commit 6bbce2e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 10 deletions.
13 changes: 8 additions & 5 deletions packages/core/types/sheet.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export default interface Sheet<
name: string
}
},
theme: {
theme: string & {
(
nameOrScalesArg0: (
| string
Expand Down Expand Up @@ -71,10 +71,13 @@ export default interface Sheet<
}
)
)
): {
className: string
selector: string
}
):
& string
& {
className: string
selector: string
}
& ThemeTokens<Extract<typeof nameOrScalesArg0 | typeof nameOrScalesArg1, { [scale: string] : unknown }>, Prefix>
} & {
[Scale in keyof Theme]: {
[Token in keyof Theme[Scale]]: ThemeUtil.Token<Extract<Token, string | number>, string, Extract<Scale, string>, Prefix>
Expand Down
13 changes: 8 additions & 5 deletions packages/react/types/sheet.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export default interface Sheet<
name: string
}
},
theme: {
theme: string & {
(
nameOrScalesArg0: (
| string
Expand Down Expand Up @@ -71,10 +71,13 @@ export default interface Sheet<
}
)
)
): {
className: string
selector: string
} & ThemeTokens<Extract<typeof nameOrScalesArg0 | typeof nameOrScalesArg1, { [scale: string] : unknown }>, Prefix>
):
& string
& {
className: string
selector: string
}
& ThemeTokens<Extract<typeof nameOrScalesArg0 | typeof nameOrScalesArg1, { [scale: string] : unknown }>, Prefix>
} & {
[Scale in keyof Theme]: {
[Token in keyof Theme[Scale]]: ThemeUtil.Token<Extract<Token, string | number>, string, Extract<Scale, string>, Prefix>
Expand Down

0 comments on commit 6bbce2e

Please sign in to comment.