import { CSSProperties, StyleRule } from '@vanilla-extract/css'; interface ResponsiveArray extends ReadonlyArray { 0: Value; length: Length; } interface RequiredResponsiveArray extends ReadonlyArray { 0: Exclude; length: Length; } /** * Produces the union `1 | 2 | ... | MaxLength` for a literal `MaxLength`. */ type LengthUpTo = [unknown], Result = never> = Counter['length'] extends MaxLength ? Result | MaxLength : LengthUpTo; type ResponsiveArrayConfig = readonly [Value, Value, ...Value[]]; type ResponsiveArrayByMaxLength = ResponsiveArray, Value | null>; type RequiredResponsiveArrayByMaxLength = RequiredResponsiveArray, Value | null>; type ConditionalPropertyValue = { defaultClass: string | undefined; conditions: { [conditionName: string]: string; }; }; type ConditionalWithResponsiveArrayProperty = { responsiveArray: Array; values: { [valueName: string]: ConditionalPropertyValue; }; }; type ConditionalProperty = { values: { [valueName: string]: ConditionalPropertyValue; }; }; type UnconditionalProperty = { values: { [valueName: string]: { defaultClass: string; }; }; }; type ShorthandProperty = { mappings: Array; }; type SprinklesProperties = { styles: { [property: string]: ConditionalWithResponsiveArrayProperty | ConditionalProperty | ShorthandProperty | UnconditionalProperty; }; }; type ResponsiveArrayVariant = ResponsiveArrayByMaxLength; type ConditionalStyle = (Values[keyof Values]['defaultClass'] extends string ? keyof Values : never) | { [Condition in keyof Values[keyof Values]['conditions']]?: keyof Values; } | undefined; type ConditionalStyleWithResponsiveArray = ConditionalStyle | ResponsiveArrayVariant; type ChildSprinkleProps = { [Prop in keyof Sprinkles]?: Sprinkles[Prop] extends ConditionalWithResponsiveArrayProperty ? ConditionalStyleWithResponsiveArray : Sprinkles[Prop] extends ConditionalProperty ? ConditionalStyle : Sprinkles[Prop] extends ShorthandProperty ? Sprinkles[Sprinkles[Prop]['mappings'][number]] extends ConditionalWithResponsiveArrayProperty ? ConditionalStyleWithResponsiveArray : Sprinkles[Sprinkles[Prop]['mappings'][number]] extends ConditionalProperty ? ConditionalStyle : Sprinkles[Sprinkles[Prop]['mappings'][number]] extends UnconditionalProperty ? keyof Sprinkles[Sprinkles[Prop]['mappings'][number]]['values'] | undefined : never : Sprinkles[Prop] extends UnconditionalProperty ? keyof Sprinkles[Prop]['values'] | undefined : never; }; type SprinkleProps> = Args extends [ infer L, ...infer R ] ? (L extends SprinklesProperties ? ChildSprinkleProps : never) & SprinkleProps : {}; type SprinklesFn> = ((props: SprinkleProps) => string) & { properties: Set>; }; type ExtractValue> | ResponsiveArrayByMaxLength> = Value extends ResponsiveArrayByMaxLength ? NonNullable : Value extends Partial> ? NonNullable : Value; type Conditions = { conditions: { defaultCondition: ConditionName | false; conditionNames: Array; responsiveArray?: Array; }; }; type ExtractDefaultCondition> = SprinklesProperties['conditions']['defaultCondition']; type ExtractConditionNames> = SprinklesProperties['conditions']['conditionNames'][number]; type ConditionalValue, Value extends string | number | boolean> = (ExtractDefaultCondition extends false ? never : Value) | Partial, Value>> | (SprinklesProperties['conditions']['responsiveArray'] extends { length: number; } ? ResponsiveArrayByMaxLength : never); type RequiredConditionalObject = Record & Partial>; type RequiredConditionalValue, Value extends string | number | boolean> = ExtractDefaultCondition extends false ? never : Value | RequiredConditionalObject, false>, Exclude, ExtractDefaultCondition>, Value> | (SprinklesProperties['conditions']['responsiveArray'] extends { length: number; } ? RequiredResponsiveArrayByMaxLength : never); declare function createNormalizeValueFn>(properties: SprinklesProperties): (value: ConditionalValue) => Partial, Value>>; declare function createMapValueFn>(properties: SprinklesProperties): >(value: Value, fn: (inputValue: ExtractValue, key: ExtractConditionNames) => OutputValue) => Value extends string | number | boolean ? OutputValue : Partial, OutputValue>>; type ConditionKey = '@media' | '@scope' | '@supports' | '@container' | 'selector'; type Condition = Partial>; type BaseConditions = { [conditionName: string]: Condition; }; type AtomicCSSProperties = { [Property in keyof CSSProperties]?: Record> | ReadonlyArray; }; type AtomicCustomProperties = Record>>; type AtomicProperties = AtomicCSSProperties | AtomicCustomProperties; type ShorthandOptions; }> = { shorthands: Shorthands; }; type UnconditionalAtomicOptions = { '@layer'?: string; properties: Properties; }; type ResponsiveArrayOptions = { responsiveArray: ResponsiveArrayConfig & { length: ResponsiveLength; }; }; type ConditionalAtomicOptions | false> = UnconditionalAtomicOptions & { conditions: Conditions; defaultCondition: DefaultCondition; }; type Values = { [Value in Property extends ReadonlyArray ? Property[number] : Property extends Array ? Property[number] : keyof Property]: Result; }; type UnconditionalAtomicStyles = { conditions: never; styles: { [Property in keyof Properties]: { values: Values; }; }; }; type ConditionalAtomicStyles | false> = { conditions: { defaultCondition: DefaultCondition; conditionNames: Array; }; styles: { [Property in keyof Properties]: { values: Values; }; }; }; type ConditionalWithResponsiveArrayAtomicStyles | false> = { conditions: { defaultCondition: DefaultCondition; conditionNames: Array; responsiveArray: Array & { length: ResponsiveLength; }; }; styles: { [Property in keyof Properties]: { responsiveArray: Array & { length: ResponsiveLength; }; values: Values; }; }; }; type ShorthandAtomicStyles; }> = { styles: { [Shorthand in keyof Shorthands]: { mappings: Shorthands[Shorthand]; }; }; }; declare function defineProperties; }, DefaultCondition extends keyof Conditions | Array | false>(options: ConditionalAtomicOptions & ShorthandOptions & ResponsiveArrayOptions): ConditionalWithResponsiveArrayAtomicStyles & ShorthandAtomicStyles; declare function defineProperties; }, DefaultCondition extends keyof Conditions | Array | false>(options: ConditionalAtomicOptions & ShorthandOptions): ConditionalAtomicStyles & ShorthandAtomicStyles; declare function defineProperties | false>(options: ConditionalAtomicOptions & ResponsiveArrayOptions): ConditionalWithResponsiveArrayAtomicStyles; declare function defineProperties | false>(options: ConditionalAtomicOptions): ConditionalAtomicStyles; declare function defineProperties; }>(options: UnconditionalAtomicOptions & ShorthandOptions): UnconditionalAtomicStyles & ShorthandAtomicStyles; declare function defineProperties(options: UnconditionalAtomicOptions): UnconditionalAtomicStyles; declare function createSprinkles>(...config: Args): SprinklesFn; export { type ConditionalValue, type RequiredConditionalValue, type ResponsiveArray, type SprinklesProperties, defineProperties as createAtomicStyles, createSprinkles as createAtomsFn, createMapValueFn, createNormalizeValueFn, createSprinkles, defineProperties };