import { FunctionComponent , ComponentClass , ClassType , Component , ComponentState , ComponentType } from 'react' ; import { SECRET_GLITZ_PROPERTY , ELEMENT_LIKE_TYPE } from './constants' ; import { WithRefProp } from './create' ; import { StyledElementProps , StyledType } from './predefined' ; export interface StyledElementLike < TComponent > extends StyledType { [ SECRET_GLITZ_PROPERTY ] : typeof ELEMENT_LIKE_TYPE ; value : TComponent ; } export function applyClassName < TProps extends StyledElementProps = StyledElementProps > ( component ) ; export function applyClassName < TProps extends StyledElementProps , TComponent extends ComponentClass < TProps > > ( component ) ; export function applyClassName < TProps extends StyledElementProps > ( component ) { return { [ SECRET_GLITZ_PROPERTY ] : ELEMENT_LIKE_TYPE , value : component , } ; } export function isElementLikeType < TProps extends StyledElementProps , TInstance > ( type ) { return type [ SECRET_GLITZ_PROPERTY ] === ELEMENT_LIKE_TYPE ; }