import type { CSSProperties, DetailedHTMLFactory, ForwardRefExoticComponent, HTMLAttributes, PropsWithoutRef, ReactHTML, RefAttributes, SVGAttributes } from "react"; import { Options, MotionEvent, CustomPointerEvent, ViewEvent } from "@motionone/dom"; import type { svgElements, htmlElements } from "./utils/supported-elements"; export interface MotionEventHandlers { onMotionStart?: (event: MotionEvent) => void; onMotionComplete?: (event: MotionEvent) => void; onHoverStart?: (event: CustomPointerEvent) => void; onHoverEnd?: (event: CustomPointerEvent) => void; onPressStart?: (event: CustomPointerEvent) => void; onPressEnd?: (event: CustomPointerEvent) => void; onViewEnter?: (event: ViewEvent) => void; onViewLeave?: (event: ViewEvent) => void; } export interface ElementProps { style: CSSProperties; } declare type UnionStringArray> = T[number]; export declare type HTMLElements = UnionStringArray; export declare type SVGElements = UnionStringArray; /** * @public */ export declare type ForwardRefComponent = ForwardRefExoticComponent & RefAttributes>; /** * Support for React component props */ declare type UnwrapFactoryAttributes = F extends DetailedHTMLFactory ? P : never; declare type UnwrapFactoryElement = F extends DetailedHTMLFactory ? P : never; declare type HTMLAttributesWithoutMotionProps, Element extends HTMLElement> = { [K in Exclude]?: Attributes[K]; }; /** * @public */ export declare type MotionHTMLProps = HTMLAttributesWithoutMotionProps, UnwrapFactoryElement> & Options & MotionEventHandlers; /** * Motion-optimised versions of React's HTML components. * * @public */ export declare type MotionHTMLComponents = { [K in HTMLElements]: ForwardRefComponent, MotionHTMLProps>; }; interface SVGAttributesWithoutOptions extends Pick, Exclude, keyof Options>> { } declare type UnwrapSVGFactoryElement = F extends React.SVGProps ? P : never; /** * @public */ export interface MotionSVGProps extends SVGAttributesWithoutOptions, Options, MotionEventHandlers { } /** * Motion-optimised versions of React's SVG components. * * @public */ export declare type MotionSVGComponents = { [K in SVGElements]: ForwardRefComponent, MotionSVGProps>>; }; export declare type MotionDOMComponents = MotionHTMLComponents & MotionSVGComponents; export {}; //# sourceMappingURL=types.d.ts.map