import type { ImageProps, ImageStyle, TextProps, TextStyle, ViewProps, ViewStyle, } from 'react-native'; import type { propertyTokenMap } from './propertyTokenMap'; import type { CSSProperties, RefAttributes } from 'react'; export type RNStyledProps = ViewStyle | ImageStyle | TextStyle; export type RNProps = ViewProps | TextProps | ImageProps; export type GenericKey = string | number | symbol; export type PropertyTokenType = typeof propertyTokenMap; export type IState = | 'indeterminate' | 'checked' | 'readOnly' | 'required' | 'invalid' | 'focus' | 'focusVisible' | 'hover' | 'pressed' | 'active' | 'loading' | 'disabled'; export type StyledValue = { [key: string]: any }; // This contains aliases and tokens export type CSSObject = { [key: string]: any }; export type PLATFORMS = 'ios' | 'android' | 'web'; export type COLORMODES = 'dark' | 'light'; /*************************** CORE TYPES *************************************************/ export interface IStyledPlugin { config?: IStyled; register(styledUtils: IStyled): void; inputMiddleWare(styledObj: any): void; componentMiddleWare?(props: any): void; } export interface IAnimationDriverPlugin { config?: IStyled; register(styledUtils: IStyled): void; engine: any; } export class IAnimationResolver { aliases?: any; tokens?: any; ref?: any; } export class IStyled { aliases?: any; tokens?: any; ref?: any; } export interface Tokens { colors?: { [key: GenericKey]: Record & {} }; sizes?: { [key: GenericKey]: Record & {} }; space?: { [key: GenericKey]: Record & {} }; borderWidths?: { [key: GenericKey]: Record & {} }; radii?: { [key: GenericKey]: Record & {} }; breakpoints?: { [key: GenericKey]: Record & {} }; mediaQueries?: { [key: GenericKey]: Record & {} }; letterSpacings?: { [key: GenericKey]: Record & {} }; opacity?: { [key: GenericKey]: Record & {} }; lineHeights?: { [key: GenericKey]: any }; fontWeights?: { [key: GenericKey]: any }; fonts?: { [key: GenericKey]: any }; fontSizes?: { [key: GenericKey]: any }; } // Config Types export type AliasesType = { [key: string]: keyof RNStyledProps; }; export type GlobalPluginType = unknown; export type GenericAliases = {}; export type GenericGlobalStyle = { // variants: {}; }; export type CreateConfig = { aliases: AliasesType; tokens: CreateGenericConfig['tokens']; globalStyle?: CreateGenericConfig['globalStyle']; }; export type ThemeStyles = Partial<{ [key: string]: { [key in keyof IToken]?: { //@ts-ignore [k in `${keyof IToken[key]}`]?: // @ts-ignore | `$${key}$${keyof IToken[key]}` | (String & {}) | number; }; //& Partial<{ [Key: string]: any }>; }; }>; // export type ThemeStyles = Partial<{ // [key: string]: Tokens; // }>; // Generic Creator export type GlueStackConfig< IToken extends Tokens, IGlobalAliases, IGlobalStyle, PluginType = [] > = { tokens: IToken; aliases: IGlobalAliases; globalStyle?: GlobalStyles; plugins?: PluginType; themes?: ThemeStyles; }; export type ComponentsThemeType = { [key: string]: { theme: GlobalStyles; }; }; export type InferConfig = Conf extends GlueStackConfig< infer A, infer C, infer D, infer B > ? GlueStackConfig : any; export type CreateGenericConfig = GlueStackConfig< Tokens, GenericAliases, GenericGlobalStyle, GlobalPluginType >; export type CreateGenericComponents = GlueStackConfig< Tokens, GenericAliases, GenericGlobalStyle >; // All Aliases export type Aliases = GSConfig['aliases']; export type Plugins = GSConfig['plugins']; export type Components = GSConfig['components']; export type IMediaQueries = keyof GSConfig['tokens']['mediaQueries']; export type SxStyleProps< GenericComponentStyles, Variants, GenericComponentProps, PluginType > = { sx?: Partial< SxProps< GenericComponentStyles, Variants, GenericComponentProps, '', '', PluginType > & { [Key in `@${IMediaQueries}`]?: SxProps< GenericComponentStyles, Variants, GenericComponentProps, '', Key, PluginType >; } >; }; //@ts-ignore type GlobalVariants = GSConfig['globalStyle']['variants']; type GlobalThemes = keyof GSConfig['themes']; export type IComponentStyleConfig = Partial<{ descendantStyle: any; ancestorStyle: any; resolveProps: any; componentName: ComCon; }>; export type Config = { alias: { [K: string]: any }; tokens: { colors: { [K: string]: any }; mediaQueries: { [K: string]: any }; }; }; type PropertyTokenMapType = { [key: string]: keyof Tokens; }; type ResolverType = { [key: string]: (rawValue: any, resolver: any) => any }; type PropsResolveType = { props?: Partial; }; type PropertyResolverType = PropsResolveType & ResolverType; export type ExtendedConfigType = { propertyTokenMap?: PropertyTokenMapType; propertyResolver?: PropertyResolverType; plugins?: Array; }; /*********************** GLOBAL STYLE TYPES ****************************************/ export type GlobalVariantAliasesProps = | AliasesProps | RNStyledProps; export type GlobalVariantSx = Partial< GlobalVariantAliasesProps > & { props?: RNProps & RNStyledProps & GlobalVariantAliasesProps & { [k in keyof Variants]?: keyof Variants[k]; } & { as?: any; } & Partial<{ [Key: string]: any }>; } & { [Key in `_${COLORMODES}`]?: GlobalVariantSx< Aliases, Tokens, Variants, PLATFORM >; } & { [Key in `:${IState}`]?: GlobalVariantSx; } & { [Key in `_${PLATFORMS}`]?: GlobalVariantSx; } & { [Key in `_${string & {}}`]?: | GlobalVariantSx | { [key in string]?: any; }; }; type GlobalCompoundVariant = { [Key in keyof Variants]?: keyof Variants[Key]; } & { value?: GlobalVariantSx; }; type GlobalVariantType = { [Key: string & {}]: { [Key in keyof Variants | (string & {})]?: Partial< GlobalVariantSx & { // @ts-ignore [K in `@${keyof TokenTypes['mediaQueries']}`]?: GlobalVariantSx< AliasTypes, TokenTypes, Variants >; } >; }; }; export type GlobalStyles = GlobalVariantSx< AliasTypes, TokenTypes, 'variants' extends keyof Variants ? Variants['variants'] : unknown > & { // @ts-ignore [K in `@${keyof TokenTypes['mediaQueries']}`]?: GlobalVariantSx< AliasTypes, TokenTypes, Variants >; } & { variants: GlobalVariantType< 'variants' extends keyof Variants ? Variants['variants'] : unknown, AliasTypes, TokenTypes >; compoundVariants?: readonly GlobalCompoundVariant< 'variants' extends keyof Variants ? Variants['variants'] : unknown, AliasTypes, TokenTypes >[]; }; /*********************** USER THEME / SX TYPES ****************************************/ export type ITheme = Partial< StyledThemeProps< Variants, 'style' extends keyof P ? P['style'] : {}, P, 'animationComponentGluestack' extends keyof P ? P['animationComponentGluestack'] extends true ? Plugins : [] : [] > >; export type StyledThemeProps< Variants, GenericComponentStyles, GenericComponentProps, PluginTypes > = SxProps< GenericComponentStyles, Variants & GlobalVariants, GenericComponentProps, '', '', PluginTypes > & { [Key in `@${IMediaQueries}`]: SxProps< GenericComponentStyles, Variants, GenericComponentProps, '', Key, PluginTypes >; } & { variants: VariantType< Variants, GenericComponentStyles, GenericComponentProps, PluginTypes >; // sizes?: SizeTypeNew; compoundVariants?: Array< CompoundVariant >; defaultProps?: { [Key in keyof MergeNested< VariantType< Variants, GenericComponentStyles, GenericComponentProps, PluginTypes >, GlobalVariants >]?: keyof MergeNested< VariantType< Variants, GenericComponentStyles, GenericComponentProps, PluginTypes >, GlobalVariants >[Key]; } & { [key: string]: any }; }; type StylePropsType = | (RNStyles & AliasesProps>) | (PLATFORM extends '_web' ? TokenizedRNStyleProps : {}); type PassingPropsType< GenericComponentStyles, Variants, GenericComponentProps, MediaQuery, PluginType > = MediaQuery extends '' ? { props?: Partial< GenericComponentProps & RNStyles & AliasesProps> & { as?: any; } & { [Key in keyof MergeNested< VariantType< Variants, GenericComponentStyles, GenericComponentProps, PluginType >, GlobalVariants >]?: | keyof MergeNested< VariantType< Variants, GenericComponentStyles, GenericComponentProps, PluginType >, GlobalVariants >[Key]; } & { [Key: string]: any } >; } : {}; type AnimatedPropsType = { opacity: number | string; x: number | string | {}; y: number | string | {}; scale: any; scaleX: any; scaleY: any; skewX: any; skewY: any; perspective: any; rotate: number; rotateY: number; rotateZ: number; matrix: any; }; // componentDriver // eslint-disable-next-line @typescript-eslint/no-unused-vars type PluginPropsType< PluginType, GenericComponentProps, GenericComponentStyles, PLATFORM > = { [key in keyof UnionToIntersection< // @ts-ignore ReturnType >]: Partial & Partial> & Partial; }; export type SxProps< GenericComponentStyles = AliasesProps, Variants = unknown, GenericComponentProps = unknown, PLATFORM = '', MediaQuery = '', PluginType = [] > = | Partial< StylePropsType & PassingPropsType< GenericComponentStyles, Variants, GenericComponentProps, MediaQuery, PluginType > > | (Partial< PluginPropsType< PluginType, GenericComponentProps, GenericComponentStyles, PLATFORM > > & { [Key in `_${COLORMODES}`]?: SxProps< GenericComponentStyles, Variants, GenericComponentProps, PLATFORM, MediaQuery, PluginType >; } & { [Key in `.${GlobalThemes}`]?: SxProps< GenericComponentStyles, Variants, GenericComponentProps, PLATFORM, MediaQuery, PluginType > & PassingPropsType< GenericComponentStyles, Variants, GenericComponentProps, MediaQuery, PluginType > & Partial<{ [key: string]: any; }>; } & { [Key in `.${string}`]?: SxProps< GenericComponentStyles, Variants, GenericComponentProps, PLATFORM, MediaQuery, PluginType > & PassingPropsType< GenericComponentStyles, Variants, GenericComponentProps, MediaQuery, PluginType > & Partial<{ [key: string]: any; }>; } & { [Key in `:${IState}`]?: SxProps< GenericComponentStyles, Variants, GenericComponentProps, PLATFORM, MediaQuery, PluginType >; } & { [Key in `_${PLATFORMS}`]?: SxProps< GenericComponentStyles, Variants, GenericComponentProps, Key, MediaQuery, PluginType > & PassingPropsType< GenericComponentStyles, Variants, GenericComponentProps, MediaQuery, PluginType > & Partial<{ [key: string]: any; }>; } & { [Key in `_${string}`]?: SxProps< RNStyledProps, {}, GenericComponentProps, PLATFORM, MediaQuery, PluginType > & PassingPropsType< GenericComponentStyles, {}, GenericComponentProps, MediaQuery, PluginType > & Partial<{ [key: string]: any; }>; }); export type VariantType< Variants, GenericComponentStyles, GenericComponentProps, PluginTypes > = | { [Key1 in keyof Variants]: { [Key in keyof Variants[Key1]]: Partial< SxProps< GenericComponentStyles, Variants, GenericComponentProps, '', '', PluginTypes > & { [K in `@${IMediaQueries}`]?: SxProps< GenericComponentStyles, Variants, GenericComponentProps, '', K, PluginTypes >; } >; }; }; type CompoundVariant = { [Key in keyof Variants]?: keyof Variants[Key] extends 'true' | 'false' ? boolean : keyof Variants[Key]; } & { value?: SxProps; }; /*********************** VERBOSED THEME / SX TYPES ****************************************/ export type VerbosedSxProps< GenericComponentStyles = AliasesProps, PLATFORM = '' > = { style?: (GenericComponentStyles | AliasesProps) & (PLATFORM extends 'web' ? { [key: string]: any } : { [key: string]: any }); state?: { [key: string]: VerbosedSxProps; }; colorMode?: { [key: string]: VerbosedSxProps; }; platform?: { [K in PLATFORMS]?: VerbosedSxProps; }; descendants?: Record>; }; export type StyledVerbosedThemeProps = { baseStyle: VerbosedSxProps & { queries?: Array>; }; variants: VerbosedVariantType; defaultProps?: { [Key in keyof Variants]?: keyof Variants[Key]; }; }; export type MediaQuery = { condition: `$${keyof GSConfig['tokens']['mediaQueries']}`; value: VerbosedSxProps; }; export type VerbosedVariantType = | { [Key1 in keyof Variants]: { [Key in keyof Variants[Key1] | (string & {})]?: Partial< VerbosedSxProps >; }; } | { [Key: string & {}]: any }; export type SxPropsTemp = { style?: any; state?: { [key: string]: VerbosedSxProps }; platform?: { [key: string]: VerbosedSxProps; }; descendants?: { [key: string]: VerbosedSxProps; }; colorMode?: { [key: string]: VerbosedSxProps; }; }; export type Sx = { sx: VerbosedSxProps; variant: any; size: any; states?: { hover?: VerbosedSxProps; active?: VerbosedSxProps; focus?: VerbosedSxProps; }; ancestorStyle: { [key: string]: VerbosedSxProps; }; children?: React.ReactNode | { (resolveContextChildrenStyle: any): void }; colorMode?: string; }; export type Path = Array; export type QueryType = { condition: string; value: VerbosedSX; }; export type QueryTypeResolved = { original: QueryType; resolved: QueryType; }; export type VerbosedSX = { style?: StyledValue; queries?: Array; platform?: { [K in PLATFORMS]?: VerbosedSX }; colorMode?: { [K in COLORMODES]?: VerbosedSX }; theme?: { [key: string]: VerbosedSX }; state?: { [K in IState]?: VerbosedSX }; descendants?: { [key: string]: VerbosedSX }; }; export type VerbosedSxResolved = { styledValueResolvedWithMeta: StyledValueResolvedWithMeta; queriesResolved: Array; platform?: { [K in PLATFORMS]?: VerbosedSX }; colorMode?: { [key: string]: VerbosedSxResolved }; theme?: { [key: string]: VerbosedSxResolved }; state?: { [key: string]: VerbosedSxResolved }; descendants?: { [key: string]: VerbosedSxResolved }; }; export type Styled = { baseStyle?: VerbosedSX; variants?: { [key: string]: VerbosedSX }; sizes?: { [key: string]: VerbosedSX }; defaultProps?: { [key: string]: any }; }; export type StyledResolved = { baseStyle: VerbosedSxResolved | undefined; variants: { [key: string]: VerbosedSxResolved } | undefined; compoundVariants?: Array | undefined; }; export type StyledValueResolvedWithMeta = { original?: StyledValue; resolved?: CSSObject; meta: { path?: Path; weight?: number; cssId: string; cssRuleset: string; colorMode?: string; queryCondition?: string; condition?: any; }; }; export type OrderedSXResolved = Array; export type IVerbosedTheme = Partial< //@ts-ignore StyledVerbosedThemeProps >; export type StateIds = { [key in IState | COLORMODES]?: { ids: Array; }; }; export type DefaultAndState = { default: Array; state: StateIds; }; export type IdsStateColorMode = { ids?: Array; state?: { [key: string]: IdsStateColorMode }; colorMode?: { [key: string]: IdsStateColorMode }; props?: any; }; export type StyleIds = { baseStyle: IdsStateColorMode & { theme?: { [key: string]: IdsStateColorMode }; }; variants: { [key: string]: { [key: string]: IdsStateColorMode & { theme?: { [key: string]: IdsStateColorMode }; }; }; }; compoundVariants: Array<{ [key: string]: IdsStateColorMode & { theme?: { [key: string]: IdsStateColorMode }; }; condition: { [key: string]: any }; }>; }; /********************* CONFIG FROM DECLARE MODULE *****************************************/ export interface ICustomConfig {} export interface ICustomComponents {} export interface GSConfig extends Omit, ICustomConfig, GenericComponents { components: ICustomComponents; } interface GenericComponents { components: {}; } /********************* COMPONENT PROPS TYPE *****************************************/ export type StyledComponentProps< GenericComponentStyles, Variants, GenericComponentProps, ComCon, P > = Omit< 'sx' extends keyof GenericComponentProps ? GenericComponentProps & VariantProps : Partial< Omit< GenericComponentProps & ComponentProps< GenericComponentStyles, Variants, GenericComponentProps > & VariantProps & UtilityProps< GenericComponentStyles, Variants, GenericComponentProps >, 'animationComponentGluestack' > > & RefAttributes

, 'animationComponentGluestack' >; export type VariantProps = GSConfig['globalStyle'] extends object ? { [Key in keyof MergeNestedThree< GlobalVariants, Variants, // @ts-ignore Components[`${ComCon}`]['theme']['variants'] >]?: keyof MergeNestedThree< GlobalVariants, Variants, // @ts-ignore Components[`${ComCon}`]['theme']['variants'] >[Key] extends 'true' | 'false' ? boolean : keyof MergeNestedThree< GlobalVariants, Variants, // @ts-ignore Components[`${ComCon}`]['theme']['variants'] >[Key]; } : { [Key in keyof MergeNested< Variants, // @ts-ignore Components[`${ComCon}`]['theme']['variants'] >]?: keyof MergeNested< Variants, // @ts-ignore Components[`${ComCon}`]['theme']['variants'] >[Key] extends 'true' | 'false' ? boolean : keyof MergeNested< Variants, // @ts-ignore Components[`${ComCon}`]['theme']['variants'] >[Key]; }; export type ComponentProps = SxStyleProps< GenericComponentStyles, Variants, P, 'animationComponentGluestack' extends keyof P ? P['animationComponentGluestack'] extends true ? Plugins : [] : [] > & { states?: { [K in IState]?: boolean; }; as?: any; }; export type VerbosedUtilityProps< GenericComponentStyles, VariantProps, GenericComponentProps > = { [key in `$${IState}`]: SxProps< GenericComponentStyles, VariantProps, GenericComponentProps >; } & { [key in `$${PLATFORMS}`]?: SxProps< GenericComponentStyles, VariantProps, GenericComponentProps >; } & { [key in `$${IMediaQueries}`]?: SxProps< GenericComponentStyles, VariantProps, GenericComponentProps >; } & { [key in `$_${string}`]?: SxProps< RNStyledProps, VariantProps, GenericComponentProps >; }; type Permutations = T extends any ? U extends '' ? T : `$${T}-${Permutations, ''>}` : never; type StatePropsCombination = Permutations; type PlatformPropsCombination = Permutations; type MediaQueryCombination = Permutations; type ColorModeCombination = Permutations; type ThemeCombination = Permutations<`t_${GlobalThemes}`, T>; type LastPart = T extends `${string}-${infer Rest}` ? LastPart : T; export type UtilityPropsCombinations = | StatePropsCombination | PlatformPropsCombination | MediaQueryCombination | ColorModeCombination | ThemeCombination; export type UtilityProps< GenericComponentStyles, Variants, GenericComponentProps > = Omit< TokenizedRNStyleProps>, keyof GenericComponentProps > & Omit< AliasesProps>, keyof GenericComponentProps > & Partial<{ [key in UtilityPropsCombinations< Extract, string> >]?: LastPart extends keyof PropertyTokenType ? PropertyTokenType[LastPart] extends 'sizes' ? key extends `$web-${string}` ? WithSizeNegativeValue | (string & {}) : | WithSizeNegativeValue | ExtendRNStyle> : PropertyTokenType[LastPart] extends 'space' ? key extends `$web-${string}` ? | WithNegativeValue< StringifyToken< //@ts-ignore keyof GSConfig['tokens'][PropertyTokenType[LastPart]] > > | (string & {}) : | WithNegativeValue< StringifyToken< keyof GSConfig['tokens'][PropertyTokenType[LastPart]] > > | ExtendRNStyle< GetRNStyles, LastPart > : PropertyTokenType[LastPart] extends keyof GSConfig['tokens'] ? key extends `$web-${string}` ? | (string & {}) | StringifyToken< //@ts-ignore keyof GSConfig['tokens'][PropertyTokenType[LastPart]] > | ExtendRNStyle< GetRNStyles, LastPart > : | StringifyToken< keyof GSConfig['tokens'][PropertyTokenType[LastPart]] > | ExtendRNStyle< GetRNStyles, LastPart > : LastPart extends keyof GetRNStyles ? GetRNStyles[LastPart] : never : LastPart extends keyof GetRNStyles ? GetRNStyles[LastPart] : never; }> & Partial<{ [key in UtilityPropsCombinations< keyof Aliases >]?: LastPart extends keyof Aliases ? Aliases[LastPart] extends keyof GetRNStyles ? PropertyTokenType[Aliases[LastPart]] extends 'sizes' ? key extends `$web-${string}` ? | (string & {}) | WithSizeNegativeValue | ExtendRNStyle< GetRNStyles, //@ts-ignore Aliases[LastPart] > : | WithSizeNegativeValue | ExtendRNStyle< GetRNStyles, Aliases[LastPart] > : PropertyTokenType[Aliases[LastPart]] extends 'space' ? key extends `$web-${string}` ? | (string & {}) | WithNegativeValue< StringifyToken< //@ts-ignore keyof GSConfig['tokens'][PropertyTokenType[Aliases[LastPart]]] > > | ExtendRNStyle< GetRNStyles, //@ts-ignore Aliases[LastPart] > : | WithNegativeValue< StringifyToken< keyof GSConfig['tokens'][PropertyTokenType[Aliases[LastPart]]] > > | ExtendRNStyle< GetRNStyles, Aliases[LastPart] > : key extends `$web-${string}` ? | (string & {}) | StringifyToken< //@ts-ignore keyof GSConfig['tokens'][PropertyTokenType[Aliases[LastPart]]] > | ExtendRNStyle< GetRNStyles, //@ts-ignore Aliases[LastPart] > : | StringifyToken< keyof GSConfig['tokens'][PropertyTokenType[Aliases[LastPart]]] > | ExtendRNStyle< GetRNStyles, Aliases[LastPart] > : never : any; }> & Partial< VerbosedUtilityProps< GenericComponentStyles, Variants, GenericComponentProps > >; // & // Partial<{ // [key in `$${IState | PLATFORMS | IMediaQueries}-${string}`]?: any; // }>; /********************* UTILITY TYPE *****************************************/ export type StringifyToken = T extends number | string ? `$${T}` : T; type FilteredKeys = { [K in keyof T]: T[K] extends never | undefined ? never : K; }[keyof T]; export type RemoveNever = { [K in FilteredKeys]: T[K]; }; type WithNegativeValue = T extends string | number ? T | `-${T}` : T; // Mapping tokens with scale value of alaises export type AliasesProps< GenericComponentStyles = RNStyledProps, Aliases = GSConfig['aliases'], Tokens = GSConfig['tokens'] > = RemoveNever<{ [key in keyof Aliases]?: Aliases[key] extends keyof GenericComponentStyles ? //@ts-expect-error PropertyTokenType[Aliases[key]] extends 'sizes' ? | WithSizeNegativeValue | ExtendRNStyle : //@ts-expect-error PropertyTokenType[Aliases[key]] extends 'space' ? | WithNegativeValue< //@ts-expect-error StringifyToken > | ExtendRNStyle : //@ts-expect-error | StringifyToken | ExtendRNStyle : never; }>; type MergeNested = T extends object ? U extends object ? { [K in keyof (T & U)]: K extends keyof T ? K extends keyof U ? MergeNested : T[K] : //@ts-ignore U[K]; } : T : U; type MergeNestedThree = MergeNested, W>; export type RNStyles = TokenizedRNStyleProps< UnionToIntersection< Partial< Exclude< GenericComponentStyles, undefined | null | false | string | number > > > >; export type UnionToIntersection = ( U extends any ? (k: U) => void : never ) extends (k: infer I) => void ? I : never; export type GetRNStyles = UnionToIntersection< Partial< Exclude< GenericComponentStyles, undefined | null | false | string | number | any[] > > >; export type ExtendRNStyle = //@ts-ignore GenericComponentStyles[key] extends | string | undefined | (symbol & { __TYPE__: 'Color' }) ? string & {} : //@ts-ignore GenericComponentStyles[key] extends string | undefined ? string & {} : //@ts-ignore GenericComponentStyles[key] extends number | undefined ? number & {} : //@ts-ignore GenericComponentStyles[key] extends number | string | undefined ? (number & {}) | (string & {}) : //@ts-ignore GenericComponentStyles[key]; type WithSizeNegativeValue = keyof Tokens extends 'sizes' ? //@ts-expect-error | StringifyToken //@ts-expect-error | StringifyToken : //@ts-expect-error StringifyToken; export type TokenizedRNStyleProps< GenericComponentStyles, Tokens = GSConfig['tokens'] > = { [key in keyof GenericComponentStyles]?: key extends keyof PropertyTokenType ? PropertyTokenType[key] extends 'sizes' ? | WithSizeNegativeValue | ExtendRNStyle : PropertyTokenType[key] extends 'space' ? | WithNegativeValue< //@ts-expect-error StringifyToken > | ExtendRNStyle : //@ts-ignore | StringifyToken | ExtendRNStyle : GenericComponentStyles[key]; }; export type IWrapperType = | 'global' | 'forwarded-base' | 'forwarded-descendant-base' | 'forwarded-variant' | 'forwarded-descendant-variant' | 'boot-base' | 'boot-base-state' | 'boot-descendant-base' | 'boot-descendant-base-state' | 'boot-variant' | 'boot-variant-state' | 'boot-descendant-variant' | 'boot-descendant-variant-state' | 'extended-base' | 'extended-base-state' | 'extended-descendant-base' | 'extended-descendant-base-state' | 'extended-variant' | 'extended-variant-state' | 'extended-descendant-variant' | 'extended-descendant-variant-state' | 'composed-base' | 'composed-base-state' | 'composed-descendant-base' | 'composed-descendant-base-state' | 'composed-variant' | 'composed-variant-state' | 'composed-descendant-variant' | 'composed-descendant-variant-state' | 'passing-base' | 'inline-base' | 'inline-variant' | 'inline-descendant-base' | 'inline-base-state'; export type GlobalStyleMap = Map< IWrapperType, Array<{ [key: string]: Array<{ [key: string]: { meta?: { queryCondition?: string; original?: Object; propertyTokenMap?: Object; extendedConfig?: Object; }; value?: Object | string; }; }>; }> >; export type ExtendedTheme = ITheme< Variants, ViewProps | ImageProps | TextProps >; // export type CreateStyle = { // theme: Component & // ITheme; // componentConfig?: Omit; // }; export type CreateComponents = { [key in keyof T]: T[key]; }; export type StyledConfig = any;