UNPKG

1.02 kBTypeScriptView Raw
1import type { ConfigSlotRecipes } from "./generated/recipes.gen";
2import type { RecipeVariantMap, RecipeVariantProps, SlotRecipeConfig, SystemSlotRecipeFn } from "./recipe.types";
3export type SlotRecipeKey = keyof ConfigSlotRecipes | (string & {});
4export type SlotRecipeFn<K extends SlotRecipeKey> = K extends keyof ConfigSlotRecipes ? ConfigSlotRecipes[K] : SystemSlotRecipeFn<string, {}, {}>;
5export interface UseSlotRecipeOptions<K extends SlotRecipeKey> {
6 key?: K;
7 recipe?: SlotRecipeConfig;
8}
9export declare function useSlotRecipe<Options extends {
10 key: SlotRecipeKey;
11 recipe?: SlotRecipeConfig;
12}>(options: Options): Options["key"] extends keyof ConfigSlotRecipes ? ConfigSlotRecipes[Options["key"]] : SystemSlotRecipeFn<string, {}, {}>;
13export declare function useSlotRecipe<Options extends {
14 recipe: SlotRecipeConfig;
15}>(options: Options): Options["recipe"] extends SlotRecipeConfig<infer S, infer T> ? SystemSlotRecipeFn<S, RecipeVariantProps<Options["recipe"]>, RecipeVariantMap<T>> : never;