import * as React from 'react' ; export type AssignableRef < ValueType > = { bivarianceHack ( instance ) : void ; } [ 'bivarianceHack' ] | React . MutableRefObject < ValueType | null > | null ; export type Use < BaseProps = any > = React . ElementType < BaseProps > ; export type PropsWithUse < ComponentType extends Use , ComponentProps > = ComponentProps & Omit < React . ComponentPropsWithRef < ComponentType > , 'use' | keyof ComponentProps > & { use ? : string | ComponentType ; } ; export type PropsFromUse < ComponentType extends Use , ComponentProps > = ( PropsWithUse < ComponentType , ComponentProps > & { use : string | ComponentType ; } ) & PropsWithUse < ComponentType , ComponentProps > ; export type ComponentWithForwardedRef < ElementType extends React . ElementType , ComponentProps > = React . ForwardRefExoticComponent < ComponentProps & React . HTMLProps < React . ElementType < ElementType > > & React . ComponentPropsWithRef < ElementType > > ; export interface ComponentWithUse < ComponentType extends Use , ComponentProps > { < TT extends Use > ( props ) : React . ReactElement | null ; ( props ) : React . ReactElement | null ; displayName ? : string ; propTypes ? : React . WeakValidationMap < PropsWithUse < ComponentType , ComponentProps > > ; contextTypes ? : React . ValidationMap < any > ; defaultProps ? : Partial < PropsWithUse < ComponentType , ComponentProps > > ; useProps ? : ( props ? : Partial < ComponentProps > , config ? : { themeKey ? : string ; } ) => any ; } export function forwardRefWithUse < Props , ComponentType extends Use > ( comp ) { return ( React . forwardRef ( comp as any ) as unknown ) as ComponentWithUse < ComponentType , Props > ; }