import type { ComponentType } from 'react'; import type { CssType, CssFunction } from '../types.js'; /** * Extra props added to the output Styled Component. */ export interface StyledProps { as?: keyof JSX.IntrinsicElements; } export type ObjectInterpolation = CssType | CssType[]; export type TemplateStringsInterpolation = CssFunction | CssFunction[]; export interface StyledComponent { (...css: ObjectInterpolation[]): React.ComponentType; (template: TemplateStringsArray, ...interpolations: TemplateStringsInterpolation[]): React.ComponentType; } export type StyledComponentMap = { [Tag in keyof JSX.IntrinsicElements]: StyledComponent; }; export interface CreateStyledComponent extends StyledComponentMap { (Component: ComponentType): StyledComponent; } /** * ## Styled component * * Create a component that styles a JSX element which comes with built-in behavior such as `ref` and `as` prop support. * For further details [read the documentation](https://compiledcssinjs.com/docs/api-styled). * * ### Style with objects * * @example * ``` * styled.div({ * fontSize: 12, * }); * ``` * * ### Style with template literals * * @example * ``` * styled.div` * font-size: 12px * `; * ``` * * ### Compose styles with arrays * * @example * ``` * import { css } from '@compiled/react'; * * styled.div([ * { fontSize: 12 }, * css`font-size: 12px;` * ]); * * styled.div( * { fontSize: 12 }, * css`font-size: 12px` * ); * ``` */ export declare const styled: CreateStyledComponent;