/** @see https://foxact.skk.moe/polymorphic */ type PolymorphicComponentProps = object> = OwnProps & { [K in PropName]?: Component | React.ReactElement; } & Omit, keyof OwnProps | PropName>; /** @see https://foxact.skk.moe/polymorphic */ type PolymorphicRef = React.ComponentPropsWithRef['ref']; interface RenderPolymorphicOptions { props: Record; defaultComponent: React.ElementType; ref?: React.Ref; } /** @see https://foxact.skk.moe/polymorphic */ declare function createPolymorphic(propName: PropName): { readonly propName: PropName; readonly renderPolymorphic: (options: RenderPolymorphicOptions) => React.ReactNode; }; export { createPolymorphic }; export type { PolymorphicComponentProps, PolymorphicRef };