import { Style } from '@glitz/core' ; import { FunctionComponent , Component , ComponentState , ComponentClass , ClassType , ForwardRefExoticComponent , RefAttributes , ComponentType , } from 'react' ; import { StyledElementLike } from './apply-class-name' ; import createComponent , { StyledComponent , StyledComponentWithRef , WithoutRefProp } from './create' ; import createDecorator , { StyledDecorator , isStyle } from './decorator' ; import { WithoutCompose , StyledForwardStyle } from './forward-style' ; import { StyledElementProps } from './predefined' ; export type Styles = Style | readonly Style [ ] | StyledDecorator | false | undefined ; export interface Styled { < TProps = { } > ( component , ... styles ) : StyledComponent < WithoutRefProp < TProps > > ; < TProps , TInstance > ( component , ... styles ) : StyledComponentWithRef < TProps , TInstance > ; < TProps > ( component , ... styles ) : StyledComponent < TProps > ; < TProps > ( component , ... styles ) : StyledComponent < WithoutCompose < TProps > > ; < TProps , TInstance extends Component < TProps , ComponentState > > ( component , ... styles ) : StyledComponentWithRef < WithoutCompose < TProps > , TInstance > ; < TProps extends StyledElementProps > ( component , ... styles ) : StyledComponent < TProps > ; < TProps extends StyledElementProps , TInstance extends Component < TProps , ComponentState > > ( component , ... styles ) : StyledComponentWithRef < TProps , TInstance > ; < TProps , TInstance > ( component , ... styles ) : StyledComponentWithRef < TProps , TInstance > ; < TProps , TInstance extends Component < TProps , ComponentState > > ( component , ... styles ) : StyledComponentWithRef < TProps , TInstance > ; ( ... styles ) : StyledDecorator ; ( ) : StyledDecorator ; ( component , ... styles ) : StyledComponent < any > ; ( style ) : StyledDecorator ; } function creator < TProps > ( arg1 , ... arg2 ) ; function creator ( ... styles ) ; function creator ( ) ; function creator < TProps > ( arg1 ? , ... arg2 ) { return isStyle ( arg1 ) ? createDecorator ( [ arg1 , arg2 ] ) : createComponent < TProps > ( arg1 , arg2 ) ; } export const createStyled = creator ;