From 2500bdd9130772fe03488c68849efa39d0d7cc00 Mon Sep 17 00:00:00 2001 From: Zach <86675944+zwagnr@users.noreply.github.com> Date: Fri, 16 Jun 2023 14:42:37 -0400 Subject: [PATCH] fix VariantProps are of type any (#60) --- src/index.d.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/index.d.ts b/src/index.d.ts index 1cd9ec4..62f918d 100644 --- a/src/index.d.ts +++ b/src/index.d.ts @@ -267,7 +267,8 @@ export declare const tv: TV; export declare const defaultConfig: TVConfig; -export type VariantProps any> = Omit< - OmitUndefined[0]>, - "class" | "className" ->; +export type VariantProps = T extends {variants: infer V} + ? V extends TVVariantsDefault + ? {[K in TVVariantKeys[number]]?: keyof V[K]} + : never + : never;