import React from 'react'; import { CSSProperties } from '../index'; /** * @desc Utility type for getting props type of React component. */ export declare type PropsOf> = Tag extends React.SFC ? Props & React.Attributes : Tag extends React.ComponentClass ? (Tag extends new (...args: Array) => infer Instance ? Props & React.ClassAttributes : never) : never; declare type AsProp = { as?: React.ElementType; }; /** * _isStyled is a private type to validate that selectors are Styled Components. * This is required to ensure extra properties are not attached to StyledComponents that style others: * ``const Dialog = styled.div` ${Button} { color: red; } `` * Without the _isStyled type, Button's properties could appear on Dialog which would be incorrect. */ declare type _isStyled = { __linaria: { className: string; extends: React.ComponentType | string; }; }; export declare type StyledComponent = React.FunctionComponent & AsProp & ExtraProps> & _isStyled; declare type StyledTag = (strings: TemplateStringsArray, ...exprs: Array | ((props?: any) => string | number) | [unknown]>) => StyledComponent; declare type JSXInEl = JSX.IntrinsicElements; declare type GetProps = T extends keyof JSXInEl ? JSXInEl[T] : T extends React.ComponentType ? PropsOf : {}; declare type CreateStyled = { readonly [key in keyof JSXInEl]: StyledTag; } & { (tag: Tag): StyledTag; >(tag: Tag): StyledTag; }; declare const _default: CreateStyled; export default _default;