Skip to content

Commit

Permalink
fix: issue with "morph" variants autocomplete and erroring (#423)
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathantneal authored Feb 19, 2021
1 parent cf7ebc5 commit a2c5383
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/core/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -432,8 +432,8 @@ export interface TStyledSheet<A extends TConditions = {}, B extends TTheme = {},
prefix: string
}

export type StrictMorphVariant<T> = T extends number ? `${T}` | T : T extends 'true' ? 'true' | true : T extends 'false' ? 'false' | false : T
export type MorphVariant<T> = T extends number ? `${T}` | T : T extends 'true' ? 'true' | boolean : T extends 'false' ? 'false' | boolean : T extends `${number}` ? number : T
export type StrictMorphVariant<T> = T extends number ? `${T}` | T : T extends 'true' ? true | T : T extends 'false' ? false | T : T
export type MorphVariant<T> = T extends number ? `${T}` | T : T extends 'true' ? boolean | T : T extends 'false' ? boolean | T : T extends `${number}` ? number | T : T

export type VariantsCall<Variants, Conditions> = {
[k in keyof Variants]?: MorphVariant<keyof Variants[k]> | { [I in keyof Conditions]?: MorphVariant<keyof Variants[k]> }
Expand Down

0 comments on commit a2c5383

Please sign in to comment.