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

export { createPolymorphic };
export type { PolymorphicComponentProps, PolymorphicRef };
