diff --git a/.changeset/grumpy-suns-doubt.md b/.changeset/grumpy-suns-doubt.md new file mode 100644 index 000000000..bd707f2fd --- /dev/null +++ b/.changeset/grumpy-suns-doubt.md @@ -0,0 +1,5 @@ +--- +"@vanilla-extract/recipes": patch +--- + +Improve IDE hover of `RecipeVariants` type by explicitly resolving its output diff --git a/packages/recipes/src/types.ts b/packages/recipes/src/types.ts index f9ec697f9..6206778c8 100644 --- a/packages/recipes/src/types.ts +++ b/packages/recipes/src/types.ts @@ -1,5 +1,9 @@ import type { ComplexStyleRule } from '@vanilla-extract/css'; +type Resolve = { + [Key in keyof T]: T[Key]; +} & {}; + type RecipeStyleRule = ComplexStyleRule | string; export type VariantDefinitions = Record; @@ -48,5 +52,6 @@ export type RuntimeFn = (( classNames: RecipeClassNames; }; -export type RecipeVariants> = - Parameters[0]; +export type RecipeVariants> = Resolve< + Parameters[0] +>;