import { type JSX } from "react"; export type ExtendableComponent = React.ForwardRefExoticComponent | React.ExoticComponent | React.FC | ((props: Props) => JSX.Element); export declare let extendComponent: (component: Component, defaultProps: DefaultProps) => ((props: React.ComponentProps) => import("react").FunctionComponentElement) & DefaultProps & { defaultProps: DefaultProps; }; export interface OverridableComponents { [key: string]: { type: React.ElementType; props: any; motionable?: boolean; }; } /** * Type to define a component that has overridable components. * * Each of them can define its: * - `type`: either as a native HTMLElement (the props for that element will be * automatically inferred) or as a custom React component * - `props`: any additional custom props * - `motionable`: if that component has a possible implementation with `framer-motion`, * in that case we remove some HTMLAttributes props which collides with * `MotionProps` from framer. */ export type WithComponents = Props & { [Name in keyof Components]: NonNullable, HtmlAttributesCollidingWithMotionProps> & Components[Name]["props"] : React.ComponentPropsWithoutRef & Components[Name]["props"]> : Components[Name]["type"]>; }; type HtmlAttributesCollidingWithMotionProps = "style" | "onDrag" | "onDragStart" | "onDragEnd" | "onAnimationStart" | "onAnimationEnd"; export default extendComponent;