import type { ComponentProps, ComponentPropsWithRef } from 'react'; import type { RNStyle } from '../core/types'; export type AnyObject = Record; type StyleToClass = K extends 'style' ? 'className' : K extends `${infer StyleProp}Style` ? `${StyleProp}ClassName` : never; type ColorPropToClass = K extends 'color' ? 'colorClassName' : K extends `${string}Color` | `${string}color${string}` ? `${K}ClassName` : never; export type ApplyUniwind = { [K in keyof TProps as StyleToClass]?: string; } & { [K in keyof TProps as ColorPropToClass]?: string; } & TProps; export type ApplyUniwindOptions = { [K in keyof TOptions as TOptions[K] extends undefined ? never : TOptions[K]['fromClassName']]?: string; } & TProps; export type Component = React.JSXElementConstructor; export type OptionMapping = { fromClassName: string; styleProperty?: keyof RNStyle; }; export type WithUniwind = { >(Component: TComponent): (props: ApplyUniwind> & {}) => React.ReactNode; , const TOptions extends { [K in keyof ComponentProps]?: OptionMapping; }>(Component: TComponent, options: TOptions): (props: ApplyUniwindOptions, TOptions> & {}) => React.ReactNode; }; export {};