Skip to content

Commit

Permalink
fix: allow numeric values for systemprops
Browse files Browse the repository at this point in the history
  • Loading branch information
quantizor authored and gregberge committed Oct 30, 2021
1 parent 5c635b0 commit efdefe1
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions packages/system/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ export type ThemeStates<T extends ITheme> = T extends {
? T['states']
: unknown

export type ThemeVariants<T extends ITheme> = ThemeScreens<T> & Omit<ThemeStates<T>, '_'>
export type ThemeVariants<T extends ITheme> = ThemeScreens<T> &
Omit<ThemeStates<T>, '_'>

export type ThemeProp<TType, TTheme extends ITheme> = {
[P in keyof ThemeVariants<TTheme>]?: TType | ThemeProp<TType, TTheme>
Expand Down Expand Up @@ -115,9 +116,11 @@ export interface TransformValue {
}

declare type SynthesizedPath<T extends {}> = {
[P in keyof T]: (T[P] extends {[key: string]: any; [key: number]: any}
? `${string & P}` | `${string & P}.${SynthesizedPath<T[P]>}`
: `${string & P}`) | number
[P in keyof T]:
| (T[P] extends { [key: string]: any; [key: number]: any }
? `${string & P}` | `${string & P}.${SynthesizedPath<T[P]>}`
: `${string & P}`)
| number
}[T extends any[] ? number & keyof T : keyof T]

export type ThemeNamespaceValue<
Expand Down

0 comments on commit efdefe1

Please sign in to comment.