1- import { ComposableKindRecipe , ComposableKindRecipe as ComposableKindRecipe$1 , ComposableKindSlotRecipe , ComposableKindSlotRecipe as ComposableKindSlotRecipe$1 , ComposedDefaultedName , ComposedSlot , ComposedSlot as ComposedSlot$1 , ComposedVariants , ComposedVariants as ComposedVariants$1 , CompoundCondition , DefaultVariants , KindRecipe , KindRecipe as KindRecipe$1 , KindVariants , RecipeComposition , RecipeComposition as RecipeComposition$1 , RecipeFunction , VariantOption , VariantSelection , VariantsOf as VariantsOf$1 } from "@lynstack/recipe" ;
1+ import { ComposableKindRecipe , ComposableKindRecipe as ComposableKindRecipe$1 , ComposableKindSlotRecipe , ComposableKindSlotRecipe as ComposableKindSlotRecipe$1 , ComposedDefaultedName , ComposedSlot , ComposedVariants , ComposedVariants as ComposedVariants$1 , CompoundCondition , DefaultVariants , KindRecipe , KindRecipe as KindRecipe$1 , KindVariants , RecipeComposition , RecipeComposition as RecipeComposition$1 , RecipeFunction , VariantOption , VariantSelection , VariantsOf as VariantsOf$1 } from "@lynstack/recipe" ;
22import { ImageStyle , TextStyle , ViewStyle } from "react-native" ;
33//#region src/types.d.ts
44type NativeStyle = ViewStyle | TextStyle | ImageStyle ;
@@ -16,7 +16,7 @@ type SlotStyles<Slot extends string> = Readonly<Partial<Record<Slot, NativeStyle
1616type NoUnknownSlotStyles < Styles , Slot extends string , Inherited extends string = never > = string extends keyof Styles ? unknown : { readonly [ Name in keyof Styles ] : Name extends Slot ? NoUnknownProperties < NonNullable < Styles [ Name ] > > : Name extends Inherited ? NoUnknownProperties < NonNullable < Styles [ Name ] > > : never ; } ;
1717type NoUnknownVariantStyles < Variants , Slot extends string , Inherited extends string = never > = { readonly [ Name in keyof Variants ] : { readonly [ Option in keyof Variants [ Name ] ] : NoUnknownSlotStyles < Variants [ Name ] [ Option ] , Slot , Inherited > ; } ; } ;
1818type InheritedSlot < Composed extends readonly ComposableKindSlotRecipe$1 < NativeStyle > [ ] > = NonNullable < Composed [ number ] [ "~composition" ] > [ "slots" ] [ number ] ;
19- type NoUnknownCompoundStyles < Styles , Slot extends string , Inherited extends string = never > = Readonly < Partial < Record < Exclude < Exclude < KeyOfEach < Styles > , Slot > , Inherited > , never > > > & { readonly [ Name in Slot | Inherited ] ?: NoUnknownProperties < DeclaredStyle$1 < Styles , Name > > ; } ;
19+ type NoUnknownCompoundStyles < Styles , Slot extends string , Inherited extends string = never > = string extends KeyOfEach < Styles > ? SlotStyles < string > : Readonly < Partial < Record < Exclude < Exclude < KeyOfEach < Styles > , Slot > , Inherited > , never > > > & { readonly [ Name in Slot | Inherited ] ?: NoUnknownProperties < DeclaredStyle$1 < Styles , Name > > ; } ;
2020type DeclaredStyle$1 < Styles , Slot > = Styles extends unknown ? Slot extends keyof Styles ? Exclude < Styles [ Slot ] , undefined > : never : never ;
2121type DeclaredSlotStyles < Variants , Base , Compounds , Composed > = Base | OptionValue < Variants > | CompoundStyles < Compounds > | ComposedStyle < Composed > ;
2222type CompoundStyles < Compounds > = Compounds extends readonly ( infer Compound ) [ ] ? Compound extends {
@@ -37,7 +37,7 @@ interface SlotStyleCompoundVariant<Variants, Styles = SlotStyles<string>> {
3737interface SlotStyleRecipeConfig < Slot extends string , Variants , Base , Compounds , DefaultedName extends keyof ComposedVariants$1 < Composed , Variants > , Composed extends readonly ComposableKindSlotRecipe$1 < NativeStyle > [ ] = readonly [ ] > {
3838 readonly composes ?: Composed | undefined ;
3939 readonly slots : readonly Slot [ ] ;
40- readonly base ?: ( Base & SlotStyles < string > & NoUnknownSlotStyles < Base , NoInfer < Slot > , InheritedSlot < Composed > > ) | undefined ;
40+ readonly base ?: ( Base & NoUnknownSlotStyles < Base , NoInfer < Slot > , InheritedSlot < Composed > > ) | undefined ;
4141 readonly variants : Variants & SlotStyleRecipeVariants & NoUnknownVariantStyles < Variants , NoInfer < Slot > , InheritedSlot < Composed > > ;
4242 readonly compoundVariants ?: ( Compounds & readonly SlotStyleCompoundVariant < NoInfer < ComposedVariants$1 < Composed , Variants > > , NoUnknownCompoundStyles < CompoundStyles < Compounds > , NoInfer < Slot > , InheritedSlot < Composed > > > [ ] ) | undefined ;
4343 readonly defaultVariants ?: DefaultVariants < ComposedVariants$1 < Composed , Variants > , DefaultedName > | undefined ;
@@ -104,7 +104,7 @@ type ThemedRecipe<Theme, Props, Result, Composition = unknown> = ThemedRecipeFun
104104type ComposedThemedRecipe < Theme , Variants , DefaultedName extends keyof Variants , Result , Slots > = ThemedRecipe < Theme , VariantSelection < Variants , DefaultedName > , Result , RecipeComposition$1 < Variants , DefaultedName , NativeStyle , Slots > > ;
105105interface ThemedRecipeCreators < Theme extends object > {
106106 readonly createStyleRecipe : < const Variants , const Base = never , const Compounds = readonly [ ] , const DefaultedName extends keyof ComposedVariants$1 < Composed , Variants > = never , const Composed extends readonly ComposableKindRecipe$1 < NativeStyle > [ ] = readonly [ ] > ( config : ( theme : Theme ) => StyleRecipeConfig < Variants , Base , Compounds , DefaultedName , Composed > ) => ComposedThemedRecipe < Theme , ComposedVariants$1 < Composed , Variants > , NoInfer < DefaultedName > | InheritedDefaultedName < Composed , Variants > , RecipeStyle < Variants , Base , Compounds , Composed > , undefined > ;
107- readonly createSlotStyleRecipe : < const Slot extends string , const Variants , const Base = never , const Compounds = readonly [ ] , const DefaultedName extends keyof ComposedVariants$1 < Composed , Variants > = never , const Composed extends readonly ComposableKindSlotRecipe$1 < NativeStyle > [ ] = readonly [ ] > ( config : ( theme : Theme ) => SlotStyleRecipeConfig < Slot , Variants , Base , Compounds , DefaultedName , Composed > ) => ComposedThemedRecipe < Theme , ComposedVariants$1 < Composed , Variants > , NoInfer < DefaultedName > | InheritedDefaultedName < Composed , Variants > , RecipeSlotStyles < Slot | Exclude < Composed [ number ] [ "~composition" ] , undefined > [ "slots" ] [ number ] , Variants , Base , Compounds , Composed > , readonly ( Slot | Exclude < Composed [ number ] [ "~composition" ] , undefined > [ "slots" ] [ number ] ) [ ] > ;
107+ readonly createSlotStyleRecipe : < const Slot extends string , const Variants , const Base extends SlotStyles < string > = never , const Compounds = readonly [ ] , const DefaultedName extends keyof ComposedVariants$1 < Composed , Variants > = never , const Composed extends readonly ComposableKindSlotRecipe$1 < NativeStyle > [ ] = readonly [ ] > ( config : ( theme : Theme ) => SlotStyleRecipeConfig < Slot , Variants , Base , Compounds , DefaultedName , Composed > ) => ComposedThemedRecipe < Theme , ComposedVariants$1 < Composed , Variants > , NoInfer < DefaultedName > | InheritedDefaultedName < Composed , Variants > , RecipeSlotStyles < Slot | Exclude < Composed [ number ] [ "~composition" ] , undefined > [ "slots" ] [ number ] , Variants , Base , Compounds , Composed > , readonly ( Slot | Exclude < Composed [ number ] [ "~composition" ] , undefined > [ "slots" ] [ number ] ) [ ] > ;
108108}
109109declare function createThemedRecipes < Theme extends object > ( ) : ThemedRecipeCreators < Theme > ;
110110//#endregion
0 commit comments