import type * as React from 'react'; export type CommonProps = { id?: string; className?: string; style?: React.CSSProperties; }; /** * Makes `as` prop available and merges original OwnProps and the inferred props from `as` element. * Extends ForwardRefExoticComponent so ref gets the correct type. * * `DefaultAs` should be the default element that is used for the `as` prop. * * @example * const Button = React.forwardRef((props, forwardedRef) => { * // ... * }) as PolymorphicForwardRefComponent<'button', ButtonOwnProps>; */ export interface PolymorphicForwardRefComponent extends React.ForwardRefExoticComponent ? React.ComponentPropsWithRef : never, OwnProps & { as?: DefaultAs; }>> { (props: As extends keyof React.JSX.IntrinsicElements ? Merge : As extends React.ComponentType ? Merge : never): React.ReactElement | null; } type Merge = Omit & P2; export {};