import * as stylex from "@stylexjs/stylex"; import { InlineStyles, StyleXClassNameFor, StyleXVar, Theme, VarGroup } from "@stylexjs/stylex"; import { AtRules, Properties, Pseudos } from "csstype"; import { CSSPropertiesWithExtras } from "@stylexjs/stylex/lib/types/StyleXTypes"; //#region src/index.d.ts /** * @public */ type StyleDeck = StyleDeck[] | StyleCard | readonly [StyleCard, InlineStyles] | Theme> | NonApplicableThemeProperties | NonApplicableObjectProperties | NonApplicableSymbolProperties | undefined; /** * @internal */ type StylexAttributes = ReturnType<(typeof stylex)['attrs']>; /** * @internal */ declare function mergeClassAttribute(originalClass: string, { class: compiledClass, ...attributes }: StylexAttributes): StylexAttributes; /** * @internal */ type StylexProperties = ReturnType<(typeof stylex)['props']>; /** * @internal */ declare function mergeClassProperty(originalClass: string, { className: compiledClass, ...properties }: StylexProperties): StylexProperties; /** * @internal */ declare function attrs(this: unknown, ...styles: any[]): ReturnType<(typeof stylex)['attrs']> extends infer T ? { [Key in keyof T]: T[Key] | undefined } : never; /** * Apply styles as props `{ className, style }`, or attrs `{ class, style }`. * * @example * ```tsx * function App() { * return ( *
* hello *
* ) * } * * const styles = stylex.create({ * italic: { * fontStyle: 'italic', * } * }) * ``` * * @public */ declare const apply: (...styledeck: StyleDeck[]) => StylexProperties; /** * Composes styles into a deck (`StyleDeck`) for component style props. * * @param styles - Style objects or `StyleDeck` * @returns Compiled deck (`StyleDeck`) * * @example * ```tsx * function Feed() { * return ( * * ) * } * * function Post({ styledeck }: { styledeck?: StyleDeck }) { * return ( *
* Lorem ipsum *
* ) * } * ``` * * @public */ declare const sheet: (...styledeck: T) => T; /** * @internal */ type StyleCard = { [TKey in keyof T]: TKey extends keyof PseudoElementRecord ? NonNullable extends infer U ? { [UKey in keyof U]: SourceValue> } | CompiledValue : never : SourceValue> | CompiledValue> }; /** * @internal */ type StyleConfig = CommonProperties | CustomProperties | CompiledProperties | PseudoElementRecord; /** * @internal */ type PseudoElementRecord = Partial> | `${ParameterizedPseudoElementKey}(${string})`, CommonProperties | CustomProperties | CompiledProperties>>; /** * @internal */ type CustomProperties = Partial>; /** * @internal */ type CompiledProperties = Partial, {}>>; /** * @internal */ type CommonProperties = Properties & Omit; /** * @internal */ type SourceValue = false | ResolvableValue | ContextualValue; /** * @internal */ type ResolvableValue = T | readonly T[] | (() => T | null | undefined) | null | undefined; /** * @internal */ type ContextualValue = ({ default: ResolvableValue; } & { [Key in PseudoClassKey | `${ParameterizedPseudoClassKey}(${string})` | AtRules | `${AtRules} ${string}`]?: ResolvableValue | ContextualValue }) & NonApplicableObjectProperties & NonApplicableStringProperties; /** * @internal */ type PseudoClassKey = Exclude; /** * @internal */ type ParameterizedPseudoClassKey = ':active-view-transition-type' | ':dir' | ':has' | ':heading' | ':host-context' | ':host' | ':is' | ':lang' | ':not' | ':nth-child' | ':nth-last-child' | ':nth-last-of-type' | ':nth-of-type' | ':state' | ':where'; /** * @internal */ type PseudoElementKey = Extract | Extract; /** * @internal */ type ParameterizedPseudoElementKey = '::cue' | '::highlight' | '::part' | '::picker' | '::scroll-button' | '::slotted' | '::view-transition-group' | '::view-transition-image-pair' | '::view-transition-new' | '::view-transition-old'; /** * @internal */ type LegacyPseudoElementKey = ':after' | ':before' | ':first-letter' | ':first-line' | ':-moz-placeholder' | ':-ms-input-placeholder'; /** * @internal */ interface NonApplicableThemeProperties { /** @deprecated not applicable */ theme?: never; } /** * @internal */ interface CompiledValue { /** @deprecated not applicable */ _opaque: StyleXClassNameFor['_opaque']; /** @deprecated not applicable */ _key: StyleXClassNameFor['_key']; /** @deprecated not applicable */ _value: StyleXClassNameFor['_value'] | null; } /** * @internal */ interface NonApplicableObjectProperties { /** @deprecated not applicable */ toString?: object['toString'] | undefined; /** @deprecated not applicable */ valueOf?: object['valueOf'] | undefined; } /** * @internal */ interface NonApplicableSymbolProperties { /** @deprecated not applicable */ description?: never; } /** * @internal */ interface NonApplicableStringProperties { /** @deprecated not applicable */ at?: never; /** @deprecated not applicable */ charAt?: never; /** @deprecated not applicable */ charCodeAt?: never; /** @deprecated not applicable */ codePointAt?: never; /** @deprecated not applicable */ concat?: never; /** @deprecated not applicable */ endsWith?: never; /** @deprecated not applicable */ includes?: never; /** @deprecated not applicable */ indexOf?: never; /** @deprecated not applicable */ lastIndexOf?: never; /** @deprecated not applicable */ length?: never; /** @deprecated not applicable */ localeCompare?: never; /** @deprecated not applicable */ match?: never; /** @deprecated not applicable */ matchAll?: never; /** @deprecated not applicable */ normalize?: never; /** @deprecated not applicable */ padEnd?: never; /** @deprecated not applicable */ padStart?: never; /** @deprecated not applicable */ repeat?: never; /** @deprecated not applicable */ replace?: never; /** @deprecated not applicable */ replaceAll?: never; /** @deprecated not applicable */ search?: never; /** @deprecated not applicable */ slice?: never; /** @deprecated not applicable */ split?: never; /** @deprecated not applicable */ startsWith?: never; /** @deprecated not applicable */ substring?: never; /** @deprecated not applicable */ toLocaleLowerCase?: never; /** @deprecated not applicable */ toLocaleUpperCase?: never; /** @deprecated not applicable */ toLowerCase?: never; /** @deprecated not applicable */ toUpperCase?: never; /** @deprecated not applicable */ trim?: never; /** @deprecated not applicable */ trimEnd?: never; /** @deprecated not applicable */ trimStart?: never; } //#endregion export { type StyleDeck, apply, sheet, type CommonProperties as "~CommonProperties", type CompiledProperties as "~CompiledProperties", type CompiledValue as "~CompiledValue", type ContextualValue as "~ContextualValue", type CustomProperties as "~CustomProperties", type LegacyPseudoElementKey as "~LegacyPseudoElementKey", type NonApplicableObjectProperties as "~NonApplicableObjectProperties", type NonApplicableStringProperties as "~NonApplicableStringProperties", type NonApplicableSymbolProperties as "~NonApplicableSymbolProperties", type NonApplicableThemeProperties as "~NonApplicableThemeProperties", type ParameterizedPseudoClassKey as "~ParameterizedPseudoClassKey", type ParameterizedPseudoElementKey as "~ParameterizedPseudoElementKey", type PseudoClassKey as "~PseudoClassKey", type PseudoElementKey as "~PseudoElementKey", type PseudoElementRecord as "~PseudoElementRecord", type ResolvableValue as "~ResolvableValue", type SourceValue as "~SourceValue", type StyleCard as "~StyleCard", type StyleConfig as "~StyleConfig", type StylexAttributes as "~StylexAttributes", type StylexProperties as "~StylexProperties", attrs as "~attrs", mergeClassAttribute as "~mergeClassAttribute", mergeClassProperty as "~mergeClassProperty" };