Skip to content

Commit

Permalink
fix VariantProps are of type any (#60)
Browse files Browse the repository at this point in the history
  • Loading branch information
zwgnr authored Jun 16, 2023
1 parent ce043d3 commit 2500bdd
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,8 @@ export declare const tv: TV;

export declare const defaultConfig: TVConfig;

export type VariantProps<Component extends (...args: any) => any> = Omit<
OmitUndefined<Parameters<Component>[0]>,
"class" | "className"
>;
export type VariantProps<T> = T extends {variants: infer V}
? V extends TVVariantsDefault<any, undefined>
? {[K in TVVariantKeys<V, any>[number]]?: keyof V[K]}
: never
: never;

0 comments on commit 2500bdd

Please sign in to comment.