import { ComponentType } from 'react'; import { CssFunction, BasicTemplateInterpolations } from '../types'; export interface FunctionIterpolation { (props: TProps): string | number; } /** * Typing for the CSS object. */ export declare type CssObject = CssFunction>; /** * Extra props added to the output Styled Component. */ export interface StyledProps { as?: keyof JSX.IntrinsicElements; } /** * This allows us to take the generic `TTag` (that will be a valid `DOM` tag) and then use it to * define correct props based on it from `JSX.IntrinsicElements`, while also injecting our own * props from `StyledProps`. */ export interface StyledFunctionFromTag { (css: CssObject | CssObject[], ...interpoltations: (BasicTemplateInterpolations | FunctionIterpolation)[]): React.ComponentType; } export interface StyledFunctionFromComponent { (css: CssObject | TemplateStringsArray, ...interpoltations: (BasicTemplateInterpolations | FunctionIterpolation)[]): React.ComponentType; } export declare type StyledComponentMap = { [Tag in keyof JSX.IntrinsicElements]: StyledFunctionFromTag; }; export interface StyledComponentInstantiator extends StyledComponentMap { /** * Typing to enable consumers to compose components, e.g: `styled(Component)` */ (Component: ComponentType): StyledFunctionFromComponent; } export declare const styled: StyledComponentInstantiator;