import { ElementType, PropsWithChildren, ComponentPropsWithoutRef, ComponentPropsWithRef } from 'react'; type AsProps = { as?: C; }; type PropsToOmit = keyof (AsProps & P); type PolymorphicComponentProps> = PropsWithChildren> & Omit, PropsToOmit>; type PolymorphicComponentPropsWithRef> = PolymorphicComponentProps & { ref?: PolymorphicRef; }; type PolymorphicRef = ComponentPropsWithRef["ref"]; export type { PolymorphicComponentProps, PolymorphicComponentPropsWithRef, PolymorphicRef };