@teacss/classes 0.10.9 → 0.10.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/attributes.d.ts +13 -0
- package/dist/attributes.js +20 -0
- package/dist/cache.d.ts +25 -0
- package/dist/cache.js +101 -0
- package/dist/generated/merge-policy.d.ts +5 -0
- package/dist/generated/merge-policy.js +37 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +3 -0
- package/dist/input.d.ts +15 -0
- package/dist/input.js +116 -0
- package/dist/merge.d.ts +58 -0
- package/dist/merge.js +475 -0
- package/dist/recipe.d.ts +193 -0
- package/dist/recipe.js +594 -0
- package/dist/syntax/group.d.ts +35 -0
- package/dist/syntax/group.js +306 -0
- package/dist/syntax/literal.d.ts +17 -0
- package/dist/syntax/literal.js +152 -0
- package/dist/syntax/token.d.ts +51 -0
- package/dist/syntax/token.js +132 -0
- package/package.json +1 -1
package/dist/recipe.d.ts
ADDED
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
import { type ClassValue, type Merger } from "./input.js";
|
|
2
|
+
import { mergePrepared, prepareFragment } from "./merge.js";
|
|
3
|
+
export type ClassProp = {
|
|
4
|
+
className?: ClassValue;
|
|
5
|
+
};
|
|
6
|
+
type ReservedSlotName = "class" | "className" | "then" | "toJSON" | "toString" | "valueOf";
|
|
7
|
+
type ReservedVariantName = "class" | "className" | "classKeys";
|
|
8
|
+
type StaticallyUnsafeSchemaName = "__proto__";
|
|
9
|
+
type CanonicalKey<Key> = Key extends string ? Key : Key extends number ? `${Key}` : never;
|
|
10
|
+
type CanonicalKeys<Value> = CanonicalKey<Extract<keyof Value, string | number>>;
|
|
11
|
+
type SchemaWhitespace = "\u0009" | "\u000b" | "\u000c" | "\u0020" | "\u00a0" | "\u1680" | "\u2000" | "\u2001" | "\u2002" | "\u2003" | "\u2004" | "\u2005" | "\u2006" | "\u2007" | "\u2008" | "\u2009" | "\u200a" | "\u2028" | "\u2029" | "\u202f" | "\u205f" | "\u3000" | "\ufeff" | "\n" | "\r";
|
|
12
|
+
type StripLeadingWhitespace<Value extends string> = Value extends `${SchemaWhitespace}${infer Rest}` ? StripLeadingWhitespace<Rest> : Value;
|
|
13
|
+
type WhitespaceOnlyName<Name extends string> = Name extends unknown ? (StripLeadingWhitespace<Name> extends "" ? Name : never) : never;
|
|
14
|
+
type NumericChoiceInput<Key extends string> = Key extends `${infer Numeric extends number}` ? (number extends Numeric ? never : `${Numeric}` extends Key ? Numeric : never) : never;
|
|
15
|
+
type ChoiceInput<Choices extends string> = Choices | NumericChoiceInput<Choices> | (Extract<Choices, "true" | "false"> extends never ? never : boolean);
|
|
16
|
+
type VariantSelection<Choices extends string> = ChoiceInput<Choices> | null;
|
|
17
|
+
type VariantSchema = Readonly<Record<string, string>>;
|
|
18
|
+
type RecordInput = Readonly<Record<string, any>>;
|
|
19
|
+
type NonRecordInput = readonly unknown[] | ((...args: any[]) => any) | (abstract new (...args: any[]) => any);
|
|
20
|
+
type VariantSelections<Variants extends VariantSchema> = keyof Variants extends never ? Readonly<Record<symbol, unknown>> : {
|
|
21
|
+
readonly [Name in keyof Variants]?: VariantSelection<Extract<Variants[Name], string>> | undefined;
|
|
22
|
+
};
|
|
23
|
+
type DefinitionVariantSelections<Variants extends VariantSchema> = VariantSelections<Variants> & Readonly<Record<symbol, unknown>>;
|
|
24
|
+
/**
|
|
25
|
+
* Read-only introspection snapshot carried by every recipe function so
|
|
26
|
+
* tooling (dead-token guards, docs generators, Storybook controls) can
|
|
27
|
+
* enumerate the variant space without parsing source. `anatomy` lists the
|
|
28
|
+
* declared `defaults` object keys (empty for single-element recipes),
|
|
29
|
+
* `variants` maps each axis to its choice names, `defaultVariants` reports
|
|
30
|
+
* declared defaults (booleans in their normalized `"true"`/`"false"`
|
|
31
|
+
* spelling), and `compoundVariantCount` counts the declared compound
|
|
32
|
+
* entries.
|
|
33
|
+
*/
|
|
34
|
+
export interface RecipeIntrospection {
|
|
35
|
+
readonly anatomy: readonly string[];
|
|
36
|
+
readonly variants: Readonly<Record<string, readonly string[]>>;
|
|
37
|
+
readonly defaultVariants: Readonly<Record<string, string>>;
|
|
38
|
+
readonly compoundVariantCount: number;
|
|
39
|
+
}
|
|
40
|
+
type RecipeCarrier = {
|
|
41
|
+
readonly [Symbol.unscopables]: never;
|
|
42
|
+
readonly config: RecipeIntrospection;
|
|
43
|
+
};
|
|
44
|
+
type IsAny<Value> = 0 extends 1 & Value ? true : false;
|
|
45
|
+
type IsUnion<Value, Whole = Value> = IsAny<Value> extends true ? false : Value extends Whole ? ([Whole] extends [Value] ? false : true) : never;
|
|
46
|
+
type InvalidRecordShape<Value> = Value extends unknown ? (Value extends NonRecordInput ? true : false) : never;
|
|
47
|
+
type OptionalSchemaKeys<Value> = Value extends unknown ? {
|
|
48
|
+
[Key in Extract<keyof Value, string | number>]-?: {} extends Pick<Value, Key> ? Key : never;
|
|
49
|
+
}[Extract<keyof Value, string | number>] : never;
|
|
50
|
+
type OpenSchemaKeys<Value> = string extends keyof Value ? string : number extends keyof Value ? number : never;
|
|
51
|
+
type ValidateStableSchema<Value> = IsAny<Value> extends true ? unknown : true extends IsUnion<Value> ? never : true extends InvalidRecordShape<Value> ? never : OpenSchemaKeys<Value> extends never ? (OptionalSchemaKeys<Value> extends never ? unknown : never) : never;
|
|
52
|
+
type ValidateNonUnion<Value> = IsAny<Value> extends true ? unknown : true extends IsUnion<Value> ? never : unknown;
|
|
53
|
+
type ValidateRecordShape<Value> = IsAny<Value> extends true ? unknown : true extends InvalidRecordShape<Value> ? never : unknown;
|
|
54
|
+
type ValidateKnownKeys<Value, Keys extends PropertyKey> = IsAny<Value> extends true ? unknown : Exclude<Extract<keyof Value, string | number>, Keys> extends never ? unknown : never;
|
|
55
|
+
type ValidatePropsInput<Input, Props> = IsAny<Input> extends true ? unknown : true extends InvalidRecordShape<Exclude<Input, undefined>> ? never : Exclude<CanonicalKeys<Exclude<Input, undefined>>, CanonicalKeys<Props>> extends never ? unknown : never;
|
|
56
|
+
type SlotProps<Variants extends VariantSchema> = keyof Variants extends never ? ClassProp : VariantSelections<Variants> & ClassProp;
|
|
57
|
+
type SingleRecipeProps<Variants extends VariantSchema> = VariantSelections<Variants> & ClassProp;
|
|
58
|
+
type RecipeResult<Slots extends string, Variants extends VariantSchema> = {
|
|
59
|
+
readonly [Slot in Slots]: <const Input>(props?: Input & SlotProps<Variants> & NoInfer<ValidatePropsInput<Input, SlotProps<Variants>>>) => string;
|
|
60
|
+
};
|
|
61
|
+
type TeaRecipeResult<Slots extends string, Variants extends VariantSchema> = RecipeResult<Slots, Variants>;
|
|
62
|
+
type TeaSingleRecipe<Variants extends VariantSchema> = (<const Input>(props?: Input & SingleRecipeProps<Variants> & NoInfer<ValidatePropsInput<Input, SingleRecipeProps<Variants>>>) => string) & RecipeCarrier;
|
|
63
|
+
type TeaMultiElementRecipe<Slots extends string, Variants extends VariantSchema> = (<const Input>(props?: Input & VariantSelections<Variants> & NoInfer<ValidatePropsInput<Input, VariantSelections<Variants>>>) => TeaRecipeResult<Slots, Variants>) & RecipeCarrier;
|
|
64
|
+
type BrandedRecipe = Function & RecipeCarrier;
|
|
65
|
+
type SingleBrandedRecipe = BrandedRecipe & ((props?: any) => string);
|
|
66
|
+
type MultiElementBrandedRecipe = BrandedRecipe & ((props?: any) => Readonly<Record<string, (props?: any) => string>>);
|
|
67
|
+
type SchemaFromSelections<Selections> = {
|
|
68
|
+
readonly [Name in Exclude<Extract<keyof NonNullable<Selections>, string>, keyof ClassProp>]: Extract<NonNullable<Selections>[Name], string>;
|
|
69
|
+
};
|
|
70
|
+
type ParentSchema<Parent> = [Parent] extends [RecipeCarrier & ((props?: infer Selections) => infer Result)] ? {
|
|
71
|
+
readonly classKeys: Result extends string ? never : Extract<keyof Result, string>;
|
|
72
|
+
readonly variants: SchemaFromSelections<Selections>;
|
|
73
|
+
} : {
|
|
74
|
+
readonly classKeys: never;
|
|
75
|
+
readonly variants: {};
|
|
76
|
+
};
|
|
77
|
+
type ParentClassKeys<Parent> = Extract<ParentSchema<Parent>["classKeys"], string>;
|
|
78
|
+
type ParentVariants<Parent> = ParentSchema<Parent>["variants"] extends infer Variants extends VariantSchema ? Variants : {};
|
|
79
|
+
type StylesInput = RecordInput;
|
|
80
|
+
type SlotNames<Styles> = CanonicalKeys<Styles>;
|
|
81
|
+
type EffectiveSlots<Parent, Styles> = ParentClassKeys<Parent> | SlotNames<Styles>;
|
|
82
|
+
type SlotTargetMap<Slots extends string> = Readonly<Partial<Record<Slots, ClassValue>>>;
|
|
83
|
+
type VariantsInput = RecordInput;
|
|
84
|
+
type OwnVariantSchema<Variants> = [Variants] extends [VariantsInput] ? {
|
|
85
|
+
readonly [Name in keyof Variants as CanonicalKey<Name>]: CanonicalKeys<Variants[Name]>;
|
|
86
|
+
} : {};
|
|
87
|
+
type VariantChoicesAt<Schema, Name extends PropertyKey> = Extract<Schema extends Readonly<Record<Name, infer Choices>> ? Choices : never, string>;
|
|
88
|
+
type MergeVariantSchemas<Parent, Child> = {
|
|
89
|
+
readonly [Name in Extract<keyof Parent | keyof Child, string>]: VariantChoicesAt<Parent, Name> | VariantChoicesAt<Child, Name>;
|
|
90
|
+
};
|
|
91
|
+
type EffectiveVariants<Parent, Variants> = MergeVariantSchemas<ParentVariants<Parent>, OwnVariantSchema<Variants>>;
|
|
92
|
+
type CompoundConditions<Variants extends VariantSchema> = {
|
|
93
|
+
readonly [Name in keyof Variants]?: VariantSelection<Extract<Variants[Name], string>> | readonly [VariantSelection<Extract<Variants[Name], string>>, ...VariantSelection<Extract<Variants[Name], string>>[]];
|
|
94
|
+
};
|
|
95
|
+
type SingleCompoundDefinition<Variants extends VariantSchema> = {
|
|
96
|
+
readonly className: string;
|
|
97
|
+
} & CompoundConditions<Variants>;
|
|
98
|
+
type MultiElementCompoundDefinition<Slots extends string, Variants extends VariantSchema> = ({
|
|
99
|
+
readonly className: SlotTargetMap<NoInfer<Slots>>;
|
|
100
|
+
readonly classKeys?: never;
|
|
101
|
+
} | {
|
|
102
|
+
readonly className: string;
|
|
103
|
+
readonly classKeys: readonly [NoInfer<Slots>, ...NoInfer<Slots>[]];
|
|
104
|
+
}) & CompoundConditions<Variants>;
|
|
105
|
+
type InvalidSlotNames<Styles> = Extract<SlotNames<Styles>, ReservedSlotName | StaticallyUnsafeSchemaName> | WhitespaceOnlyName<SlotNames<Styles>>;
|
|
106
|
+
type InvalidVariantNames<Variants> = Extract<CanonicalKeys<NonNullable<Variants>>, ReservedVariantName | StaticallyUnsafeSchemaName> | WhitespaceOnlyName<CanonicalKeys<NonNullable<Variants>>>;
|
|
107
|
+
type InvalidChoiceNames<Choices> = Extract<CanonicalKeys<Choices>, StaticallyUnsafeSchemaName>;
|
|
108
|
+
type AllowedSlotNames<Styles> = InvalidSlotNames<Styles> extends never ? unknown : never;
|
|
109
|
+
type AllowedVariantNames<Variants> = InvalidVariantNames<Variants> extends never ? unknown : never;
|
|
110
|
+
type ValidateStyles<Styles> = SlotNames<Styles> extends never ? never : Styles extends Readonly<Record<Extract<keyof Styles, string | number>, ClassValue>> ? unknown : never;
|
|
111
|
+
type SlotTargetNames<Targets> = Targets extends unknown ? CanonicalKeys<Targets> : never;
|
|
112
|
+
type ValidateSlotTargetValues<Targets> = Targets extends RecordInput ? {
|
|
113
|
+
readonly [Name in keyof Targets]: Name extends symbol ? Targets[Name] : Targets[Name] extends ClassValue ? Targets[Name] : never;
|
|
114
|
+
} : never;
|
|
115
|
+
type InvalidSlotTargetValueNames<Targets> = Targets extends RecordInput ? {
|
|
116
|
+
readonly [Name in Extract<keyof Targets, string | number>]-?: IsAny<Targets[Name]> extends true ? never : Targets[Name] extends ClassValue ? never : Name;
|
|
117
|
+
}[Extract<keyof Targets, string | number>] : never;
|
|
118
|
+
type ValidateSlotTargets<Targets, Slots extends string> = IsAny<Targets> extends true ? unknown : true extends InvalidRecordShape<Targets> ? never : [Targets] extends [RecordInput] ? (Exclude<SlotTargetNames<Targets>, Slots> extends never ? (InvalidSlotTargetValueNames<Targets> extends never ? ValidateSlotTargetValues<Targets> : never) : never) : never;
|
|
119
|
+
type ValidateSingleChoices<Choices> = ValidateStableSchema<Choices> extends never ? never : InvalidChoiceNames<Choices> extends never ? CanonicalKeys<Choices> extends never ? never : Choices extends RecordInput ? {
|
|
120
|
+
readonly [Name in keyof Choices]: Name extends symbol ? Choices[Name] : IsAny<Choices[Name]> extends true ? unknown : [Choices[Name]] extends [string] ? Choices[Name] : never;
|
|
121
|
+
} : never : never;
|
|
122
|
+
type ValidateMultiElementChoices<Choices, Slots extends string> = ValidateStableSchema<Choices> extends never ? never : InvalidChoiceNames<Choices> extends never ? CanonicalKeys<Choices> extends never ? never : Choices extends RecordInput ? {
|
|
123
|
+
readonly [Name in keyof Choices]: ValidateSlotTargets<Choices[Name], Slots>;
|
|
124
|
+
} : never : never;
|
|
125
|
+
type ValidateSingleVariants<Variants> = [Variants] extends [VariantsInput] ? {
|
|
126
|
+
readonly [Name in keyof Variants]: ValidateSingleChoices<Variants[Name]>;
|
|
127
|
+
} : unknown;
|
|
128
|
+
type ValidateMultiElementVariants<Variants, Slots extends string> = [Variants] extends [VariantsInput] ? {
|
|
129
|
+
readonly [Name in keyof Variants]: ValidateMultiElementChoices<Variants[Name], Slots>;
|
|
130
|
+
} : unknown;
|
|
131
|
+
type ValidateCompoundCondition<Condition> = undefined extends Condition ? never : Condition extends readonly [] ? never : Condition;
|
|
132
|
+
type ValidateSingleCompoundOutput<Output> = IsAny<Output> extends true ? unknown : [Output] extends [string] ? Output : never;
|
|
133
|
+
type ValidateMultiElementCompoundOutput<Output, Slots extends string> = SlotTargetNames<Output> extends never ? never : ValidateSlotTargets<Output, Slots>;
|
|
134
|
+
type HasDuplicateClassKeys<Targets extends readonly unknown[], Seen = never> = Targets extends readonly [infer Target, ...infer Rest] ? (Extract<Target, Seen> extends never ? HasDuplicateClassKeys<Rest, Seen | Target> : true) : false;
|
|
135
|
+
type ValidateCompoundClassKeys<Targets, Slots extends string> = IsAny<Targets> extends true ? unknown : Targets extends readonly [unknown, ...unknown[]] ? (Exclude<Targets[number], Slots> extends never ? (HasDuplicateClassKeys<Targets> extends false ? Targets : never) : never) : never;
|
|
136
|
+
type ValidateSingleCompoundEntry<Entry, Variants extends VariantSchema> = true extends InvalidRecordShape<Entry> ? never : Entry extends RecordInput ? {
|
|
137
|
+
readonly [Name in keyof Entry]: Name extends symbol ? Entry[Name] : Name extends "className" ? ValidateSingleCompoundOutput<Entry[Name]> : Name extends string | number ? (CanonicalKey<Name> extends keyof Variants ? ValidateCompoundCondition<Entry[Name]> : never) : never;
|
|
138
|
+
} : never;
|
|
139
|
+
type ValidateMultiElementCompoundEntry<Entry, Slots extends string, Variants extends VariantSchema> = true extends InvalidRecordShape<Entry> ? never : Entry extends RecordInput ? "classKeys" extends OptionalSchemaKeys<Entry> ? never : {
|
|
140
|
+
readonly [Name in keyof Entry]: Name extends symbol ? Entry[Name] : Name extends "className" ? "classKeys" extends keyof Entry ? ValidateSingleCompoundOutput<Entry[Name]> : ValidateMultiElementCompoundOutput<Entry[Name], Slots> : Name extends "classKeys" ? ValidateCompoundClassKeys<Entry[Name], Slots> : Name extends string | number ? CanonicalKey<Name> extends keyof Variants ? ValidateCompoundCondition<Entry[Name]> : never : never;
|
|
141
|
+
} : never;
|
|
142
|
+
type ValidateSingleCompounds<Compounds, Variants extends VariantSchema> = Compounds extends readonly unknown[] ? {
|
|
143
|
+
readonly [Index in keyof Compounds]: ValidateSingleCompoundEntry<Compounds[Index], Variants>;
|
|
144
|
+
} : unknown;
|
|
145
|
+
type ValidateMultiElementCompounds<Compounds, Slots extends string, Variants extends VariantSchema> = Compounds extends readonly unknown[] ? {
|
|
146
|
+
readonly [Index in keyof Compounds]: ValidateMultiElementCompoundEntry<Compounds[Index], Slots, Variants>;
|
|
147
|
+
} : unknown;
|
|
148
|
+
type SingleRecipeDefinition<Style extends string, Parent extends SingleBrandedRecipe | undefined, Variants extends VariantsInput | undefined, Compounds extends readonly SingleCompoundDefinition<EffectiveVariants<Parent, Variants>>[] | undefined> = {
|
|
149
|
+
readonly defaults: Style;
|
|
150
|
+
readonly variants?: (Variants & ValidateStableSchema<Exclude<Variants, undefined>> & AllowedVariantNames<Variants> & ValidateSingleVariants<Variants>) | undefined;
|
|
151
|
+
readonly defaultVariants?: DefinitionVariantSelections<NoInfer<EffectiveVariants<Parent, Variants>>> | undefined;
|
|
152
|
+
readonly compoundVariants?: (Compounds & ValidateSingleCompounds<Compounds, EffectiveVariants<Parent, Variants>>) | undefined;
|
|
153
|
+
readonly extend?: (Parent & ValidateNonUnion<Parent>) | undefined;
|
|
154
|
+
};
|
|
155
|
+
type MultiElementRecipeDefinition<Styles extends StylesInput, Parent extends MultiElementBrandedRecipe | undefined, Variants extends VariantsInput | undefined, Compounds extends readonly MultiElementCompoundDefinition<EffectiveSlots<Parent, Styles>, EffectiveVariants<Parent, Variants>>[] | undefined> = {
|
|
156
|
+
readonly defaults: Styles & ValidateStyles<Styles> & ValidateStableSchema<Styles> & AllowedSlotNames<Styles>;
|
|
157
|
+
readonly variants?: (Variants & ValidateStableSchema<Exclude<Variants, undefined>> & AllowedVariantNames<Variants> & ValidateMultiElementVariants<Variants, EffectiveSlots<Parent, Styles>>) | undefined;
|
|
158
|
+
readonly defaultVariants?: DefinitionVariantSelections<NoInfer<EffectiveVariants<Parent, Variants>>> | undefined;
|
|
159
|
+
readonly compoundVariants?: (Compounds & ValidateMultiElementCompounds<Compounds, EffectiveSlots<Parent, Styles>, EffectiveVariants<Parent, Variants>>) | undefined;
|
|
160
|
+
readonly extend?: (Parent & ValidateNonUnion<Parent>) | undefined;
|
|
161
|
+
};
|
|
162
|
+
type RecipeInference<Styles, Parent, Variants, Compounds> = {
|
|
163
|
+
readonly defaults: Styles;
|
|
164
|
+
readonly variants?: Variants | undefined;
|
|
165
|
+
readonly compoundVariants?: Compounds | undefined;
|
|
166
|
+
readonly extend?: Parent;
|
|
167
|
+
};
|
|
168
|
+
type ExtendedRecipeInference<Styles, Parent, Variants, Compounds> = Omit<RecipeInference<Styles, Parent, Variants, Compounds>, "extend"> & {
|
|
169
|
+
readonly extend: Parent;
|
|
170
|
+
};
|
|
171
|
+
type InheritedRecipeInference<Parent, Variants, Compounds> = Omit<ExtendedRecipeInference<never, Parent, Variants, Compounds>, "defaults">;
|
|
172
|
+
type InheritedSingleRecipeDefinition<Parent extends SingleBrandedRecipe, Variants extends VariantsInput | undefined, Compounds extends readonly SingleCompoundDefinition<EffectiveVariants<Parent, Variants>>[] | undefined> = Omit<SingleRecipeDefinition<string, Parent, Variants, Compounds>, "defaults">;
|
|
173
|
+
type InheritedMultiElementRecipeDefinition<Parent extends MultiElementBrandedRecipe, Variants extends VariantsInput | undefined, Compounds extends readonly MultiElementCompoundDefinition<ParentClassKeys<Parent>, EffectiveVariants<Parent, Variants>>[] | undefined> = Omit<MultiElementRecipeDefinition<{}, Parent, Variants, Compounds>, "defaults">;
|
|
174
|
+
type RecipeDefinitionField = "defaults" | "compoundVariants" | "defaultVariants" | "extend" | "variants";
|
|
175
|
+
type ValidateDefinitionInput<Definition> = ValidateRecordShape<Definition> & ValidateKnownKeys<Definition, RecipeDefinitionField>;
|
|
176
|
+
type ValidateInheritedDefinitionInput<Definition> = ValidateRecordShape<Definition> & ValidateKnownKeys<Definition, Exclude<RecipeDefinitionField, "defaults">>;
|
|
177
|
+
export type Reciper = {
|
|
178
|
+
<const Style extends string, const Variants extends VariantsInput | undefined = undefined, const Compounds extends readonly SingleCompoundDefinition<EffectiveVariants<undefined, Variants>>[] | undefined = undefined, const Definition = unknown>(definition: RecipeInference<Style, undefined, Variants, Compounds> & Definition & NoInfer<SingleRecipeDefinition<Style, undefined, Variants, Compounds>> & NoInfer<ValidateDefinitionInput<Definition>>): TeaSingleRecipe<EffectiveVariants<undefined, Variants>>;
|
|
179
|
+
<const Parent extends SingleBrandedRecipe, const Style extends string, const Variants extends VariantsInput | undefined = undefined, const Compounds extends readonly SingleCompoundDefinition<EffectiveVariants<Parent, Variants>>[] | undefined = undefined, const Definition = unknown>(definition: ExtendedRecipeInference<Style, Parent, Variants, Compounds> & Definition & NoInfer<SingleRecipeDefinition<Style, Parent, Variants, Compounds>> & NoInfer<ValidateDefinitionInput<Definition>>): TeaSingleRecipe<EffectiveVariants<Parent, Variants>>;
|
|
180
|
+
<const Parent extends SingleBrandedRecipe, const Variants extends VariantsInput | undefined = undefined, const Compounds extends readonly SingleCompoundDefinition<EffectiveVariants<Parent, Variants>>[] | undefined = undefined, const Definition = unknown>(definition: InheritedRecipeInference<Parent, Variants, Compounds> & Definition & NoInfer<InheritedSingleRecipeDefinition<Parent, Variants, Compounds>> & NoInfer<ValidateInheritedDefinitionInput<Definition>>): TeaSingleRecipe<EffectiveVariants<Parent, Variants>>;
|
|
181
|
+
<const Styles extends StylesInput, const Variants extends VariantsInput | undefined = undefined, const Compounds extends readonly MultiElementCompoundDefinition<EffectiveSlots<undefined, Styles>, EffectiveVariants<undefined, Variants>>[] | undefined = undefined, const Definition = unknown>(definition: RecipeInference<Styles, undefined, Variants, Compounds> & Definition & NoInfer<MultiElementRecipeDefinition<Styles, undefined, Variants, Compounds>> & NoInfer<ValidateDefinitionInput<Definition>>): TeaMultiElementRecipe<EffectiveSlots<undefined, Styles>, EffectiveVariants<undefined, Variants>>;
|
|
182
|
+
<const Parent extends MultiElementBrandedRecipe, const Variants extends VariantsInput | undefined = undefined, const Compounds extends readonly MultiElementCompoundDefinition<ParentClassKeys<Parent>, EffectiveVariants<Parent, Variants>>[] | undefined = undefined, const Definition = unknown>(definition: InheritedRecipeInference<Parent, Variants, Compounds> & Definition & NoInfer<InheritedMultiElementRecipeDefinition<Parent, Variants, Compounds>> & NoInfer<ValidateInheritedDefinitionInput<Definition>>): TeaMultiElementRecipe<ParentClassKeys<Parent>, EffectiveVariants<Parent, Variants>>;
|
|
183
|
+
<const Parent extends MultiElementBrandedRecipe, const Styles extends StylesInput, const Variants extends VariantsInput | undefined = undefined, const Compounds extends readonly MultiElementCompoundDefinition<EffectiveSlots<Parent, Styles>, EffectiveVariants<Parent, Variants>>[] | undefined = undefined, const Definition = unknown>(definition: ExtendedRecipeInference<Styles, Parent, Variants, Compounds> & Definition & NoInfer<MultiElementRecipeDefinition<Styles, Parent, Variants, Compounds>> & NoInfer<ValidateDefinitionInput<Definition>>): TeaMultiElementRecipe<EffectiveSlots<Parent, Styles>, EffectiveVariants<Parent, Variants>>;
|
|
184
|
+
};
|
|
185
|
+
export type VariantProps<Recipe> = Recipe extends RecipeCarrier & ((props?: infer Props) => unknown) ? VariantSelections<SchemaFromSelections<Props>> : never;
|
|
186
|
+
export declare function createRecipeRuntime(runtime: {
|
|
187
|
+
cn: Merger;
|
|
188
|
+
prepareFragment: typeof prepareFragment;
|
|
189
|
+
mergePrepared: typeof mergePrepared;
|
|
190
|
+
}): Reciper;
|
|
191
|
+
export declare const recipe: Reciper;
|
|
192
|
+
export {};
|
|
193
|
+
//# sourceMappingURL=recipe.d.ts.map
|