= {
readonly $$typeof: symbol;
} & ((props: PropsWithoutRef & RefAttributes) => JSX.Element);
type AttributesWithoutMotionProps = {
[K in Exclude]?: Attributes[K];
};
/**
* @public
*/
type HTMLMotionProps = AttributesWithoutMotionProps & MotionProps;
/**
* Motion-optimised versions of React's HTML components.
*
* @public
*/
type HTMLMotionComponents = {
[K in keyof HTMLElements]: ForwardRefComponent>;
};
interface Props$1 {
/**
* A HTML element to render this component as. Defaults to `"ul"`.
*
* @public
*/
as?: keyof HTMLElements;
/**
* The axis to reorder along. By default, items will be draggable on this axis.
* To make draggable on both axes, set ``
*
* @public
*/
axis?: "x" | "y";
/**
* A callback to fire with the new value order. For instance, if the values
* are provided as a state from `useState`, this could be the set state function.
*
* @public
*/
onReorder: (newOrder: V[]) => void;
/**
* The latest values state.
*
* ```jsx
* function Component() {
* const [items, setItems] = useState([0, 1, 2])
*
* return (
*
* {items.map((item) => )}
*
* )
* }
* ```
*
* @public
*/
values: V[];
}
type ReorderGroupProps = Props$1 & Omit, "values"> & React$1.PropsWithChildren<{}>;
declare function ReorderGroupComponent({ children, as, axis, onReorder, values, ...props }: ReorderGroupProps, externalRef?: React$1.ForwardedRef): react_jsx_runtime.JSX.Element;
declare const ReorderGroup: (props: ReorderGroupProps & {
ref?: React$1.ForwardedRef;
}) => ReturnType;
interface Props {
/**
* A HTML element to render this component as. Defaults to `"li"`.
*
* @public
*/
as?: keyof HTMLElements;
/**
* The value in the list that this component represents.
*
* @public
*/
value: V;
/**
* A subset of layout options primarily used to disable layout="size"
*
* @public
* @default true
*/
layout?: true | "position";
}
type ReorderItemProps = Props & HTMLMotionProps & React$1.PropsWithChildren<{}>;
declare function ReorderItemComponent({ children, style, value, as, onDrag, layout, ...props }: ReorderItemProps, externalRef?: React$1.ForwardedRef): react_jsx_runtime.JSX.Element;
declare const ReorderItem: (props: ReorderItemProps & {
ref?: React$1.ForwardedRef;
}) => ReturnType;
declare namespace namespace_d {
export { ReorderGroup as Group, ReorderItem as Item };
}
type UnionStringArray> = T[number];
declare const svgElements: readonly ["animate", "circle", "defs", "desc", "ellipse", "g", "image", "line", "filter", "marker", "mask", "metadata", "path", "pattern", "polygon", "polyline", "rect", "stop", "svg", "switch", "symbol", "text", "tspan", "use", "view", "clipPath", "feBlend", "feColorMatrix", "feComponentTransfer", "feComposite", "feConvolveMatrix", "feDiffuseLighting", "feDisplacementMap", "feDistantLight", "feDropShadow", "feFlood", "feFuncA", "feFuncB", "feFuncG", "feFuncR", "feGaussianBlur", "feImage", "feMerge", "feMergeNode", "feMorphology", "feOffset", "fePointLight", "feSpecularLighting", "feSpotLight", "feTile", "feTurbulence", "foreignObject", "linearGradient", "radialGradient", "textPath"];
type SVGElements = UnionStringArray;
interface SVGAttributesWithoutMotionProps extends Pick, Exclude, keyof MotionProps>> {
}
/**
* Blanket-accept any SVG attribute as a `MotionValue`
* @public
*/
type SVGAttributesAsMotionValues = MakeMotion>;
type UnwrapSVGFactoryElement = F extends React.SVGProps ? P : never;
/**
* @public
*/
interface SVGMotionProps extends SVGAttributesAsMotionValues, MotionProps {
}
/**
* Motion-optimised versions of React's SVG components.
*
* @public
*/
type SVGMotionComponents = {
[K in SVGElements]: ForwardRefComponent, SVGMotionProps>>;
};
interface MotionComponentConfig {
preloadedFeatures?: FeatureBundle;
createVisualElement?: CreateVisualElement;
useRender: RenderComponent;
useVisualState: UseVisualState;
Component: string | React$1.ComponentType>;
}
type MotionComponentProps = {
[K in Exclude]?: Props[K];
} & MotionProps;
/**
* Create a `motion` component.
*
* This function accepts a Component argument, which can be either a string (ie "div"
* for `motion.div`), or an actual React component.
*
* Alongside this is a config option which provides a way of rendering the provided
* component "offline", or outside the React render cycle.
*/
declare function createRendererMotionComponent({ preloadedFeatures, createVisualElement, useRender, useVisualState, Component, }: MotionComponentConfig): React$1.ForwardRefExoticComponent>;
declare const m: ((Component: string | TagName | React$1.ComponentType, { forwardMotionProps }?: {
forwardMotionProps: boolean;
}) => TagName extends "symbol" | "clipPath" | "filter" | "mask" | "marker" | "text" | "animate" | "stop" | "path" | "image" | "circle" | "switch" | "svg" | keyof HTMLElements | "defs" | "desc" | "ellipse" | "feBlend" | "feColorMatrix" | "feComponentTransfer" | "feComposite" | "feConvolveMatrix" | "feDiffuseLighting" | "feDisplacementMap" | "feDistantLight" | "feDropShadow" | "feFlood" | "feFuncA" | "feFuncB" | "feFuncG" | "feFuncR" | "feGaussianBlur" | "feImage" | "feMerge" | "feMergeNode" | "feMorphology" | "feOffset" | "fePointLight" | "feSpecularLighting" | "feSpotLight" | "feTile" | "feTurbulence" | "foreignObject" | "g" | "line" | "linearGradient" | "metadata" | "pattern" | "polygon" | "polyline" | "radialGradient" | "rect" | "textPath" | "tspan" | "use" | "view" ? DOMMotionComponents[TagName] : React$1.ComponentType>>) & HTMLMotionComponents & SVGMotionComponents & {
create: (Component: string | TagName | React$1.ComponentType, { forwardMotionProps }?: {
forwardMotionProps: boolean;
}) => TagName extends "symbol" | "clipPath" | "filter" | "mask" | "marker" | "text" | "animate" | "stop" | "path" | "image" | "circle" | "switch" | "svg" | keyof HTMLElements | "defs" | "desc" | "ellipse" | "feBlend" | "feColorMatrix" | "feComponentTransfer" | "feComposite" | "feConvolveMatrix" | "feDiffuseLighting" | "feDisplacementMap" | "feDistantLight" | "feDropShadow" | "feFlood" | "feFuncA" | "feFuncB" | "feFuncG" | "feFuncR" | "feGaussianBlur" | "feImage" | "feMerge" | "feMergeNode" | "feMorphology" | "feOffset" | "fePointLight" | "feSpecularLighting" | "feSpotLight" | "feTile" | "feTurbulence" | "foreignObject" | "g" | "line" | "linearGradient" | "metadata" | "pattern" | "polygon" | "polyline" | "radialGradient" | "rect" | "textPath" | "tspan" | "use" | "view" ? DOMMotionComponents[TagName] : React$1.ComponentType>>;
};
declare const motion: ((Component: string | TagName | React$1.ComponentType, { forwardMotionProps }?: {
forwardMotionProps: boolean;
}) => TagName extends "symbol" | "clipPath" | "filter" | "mask" | "marker" | "text" | "animate" | "stop" | "path" | "image" | "circle" | "switch" | "svg" | keyof HTMLElements | "defs" | "desc" | "ellipse" | "feBlend" | "feColorMatrix" | "feComponentTransfer" | "feComposite" | "feConvolveMatrix" | "feDiffuseLighting" | "feDisplacementMap" | "feDistantLight" | "feDropShadow" | "feFlood" | "feFuncA" | "feFuncB" | "feFuncG" | "feFuncR" | "feGaussianBlur" | "feImage" | "feMerge" | "feMergeNode" | "feMorphology" | "feOffset" | "fePointLight" | "feSpecularLighting" | "feSpotLight" | "feTile" | "feTurbulence" | "foreignObject" | "g" | "line" | "linearGradient" | "metadata" | "pattern" | "polygon" | "polyline" | "radialGradient" | "rect" | "textPath" | "tspan" | "use" | "view" ? DOMMotionComponents[TagName] : React$1.ComponentType>>) & HTMLMotionComponents & SVGMotionComponents & {
create: (Component: string | TagName | React$1.ComponentType, { forwardMotionProps }?: {
forwardMotionProps: boolean;
}) => TagName extends "symbol" | "clipPath" | "filter" | "mask" | "marker" | "text" | "animate" | "stop" | "path" | "image" | "circle" | "switch" | "svg" | keyof HTMLElements | "defs" | "desc" | "ellipse" | "feBlend" | "feColorMatrix" | "feComponentTransfer" | "feComposite" | "feConvolveMatrix" | "feDiffuseLighting" | "feDisplacementMap" | "feDistantLight" | "feDropShadow" | "feFlood" | "feFuncA" | "feFuncB" | "feFuncG" | "feFuncR" | "feGaussianBlur" | "feImage" | "feMerge" | "feMergeNode" | "feMorphology" | "feOffset" | "fePointLight" | "feSpecularLighting" | "feSpotLight" | "feTile" | "feTurbulence" | "foreignObject" | "g" | "line" | "linearGradient" | "metadata" | "pattern" | "polygon" | "polyline" | "radialGradient" | "rect" | "textPath" | "tspan" | "use" | "view" ? DOMMotionComponents[TagName] : React$1.ComponentType>>;
};
type ObjectTarget = {
[K in keyof O]?: O[K] | GenericKeyframesTarget;
};
type SequenceTime = number | "<" | `+${number}` | `-${number}` | `${string}`;
type SequenceLabel = string;
interface SequenceLabelWithTime {
name: SequenceLabel;
at: SequenceTime;
}
interface At {
at?: SequenceTime;
}
type MotionValueSegment = [
MotionValue,
UnresolvedValueKeyframe | UnresolvedValueKeyframe[]
];
type MotionValueSegmentWithTransition = [
MotionValue,
UnresolvedValueKeyframe | UnresolvedValueKeyframe[],
Transition$1 & At
];
type DOMSegment = [ElementOrSelector, DOMKeyframesDefinition];
type DOMSegmentWithTransition = [
ElementOrSelector,
DOMKeyframesDefinition,
AnimationOptions & At
];
type ObjectSegment = [O, ObjectTarget];
type ObjectSegmentWithTransition = [
O,
ObjectTarget,
AnimationOptions & At
];
type Segment = ObjectSegment | ObjectSegmentWithTransition | SequenceLabel | SequenceLabelWithTime | MotionValueSegment | MotionValueSegmentWithTransition | DOMSegment | DOMSegmentWithTransition;
type AnimationSequence = Segment[];
interface SequenceOptions extends AnimationPlaybackOptions {
delay?: number;
duration?: number;
defaultTransition?: Transition$1;
}
interface AbsoluteKeyframe {
value: string | number | null;
at: number;
easing?: Easing;
}
type ValueSequence = AbsoluteKeyframe[];
interface SequenceMap {
[key: string]: ValueSequence;
}
type ResolvedAnimationDefinition = {
keyframes: {
[key: string]: UnresolvedValueKeyframe[];
};
transition: {
[key: string]: Transition$1;
};
};
type ResolvedAnimationDefinitions = Map;
/**
* Creates an animation function that is optionally scoped
* to a specific element.
*/
declare function createScopedAnimate(scope?: AnimationScope): {
(sequence: AnimationSequence, options?: SequenceOptions): AnimationPlaybackControls;
(value: string | MotionValue, keyframes: string | GenericKeyframesTarget, options?: ValueAnimationTransition): AnimationPlaybackControls;
(value: number | MotionValue, keyframes: number | GenericKeyframesTarget, options?: ValueAnimationTransition): AnimationPlaybackControls;
(value: V | MotionValue, keyframes: V | GenericKeyframesTarget, options?: ValueAnimationTransition): AnimationPlaybackControls;
(element: ElementOrSelector, keyframes: DOMKeyframesDefinition, options?: AnimationOptions): AnimationPlaybackControls;
(object: O | O[], keyframes: ObjectTarget, options?: AnimationOptions): AnimationPlaybackControls;
};
declare const animate: {
(sequence: AnimationSequence, options?: SequenceOptions): AnimationPlaybackControls;
(value: string | MotionValue, keyframes: string | GenericKeyframesTarget, options?: ValueAnimationTransition): AnimationPlaybackControls;
(value: number | MotionValue, keyframes: number | GenericKeyframesTarget, options?: ValueAnimationTransition): AnimationPlaybackControls;
(value: V | MotionValue, keyframes: V | GenericKeyframesTarget, options?: ValueAnimationTransition): AnimationPlaybackControls;
(element: ElementOrSelector, keyframes: DOMKeyframesDefinition, options?: AnimationOptions): AnimationPlaybackControls;
(object: O | O[], keyframes: ObjectTarget, options?: AnimationOptions): AnimationPlaybackControls;
};
declare const animateMini: (elementOrSelector: ElementOrSelector, keyframes: DOMKeyframesDefinition, options?: AnimationOptions) => AnimationPlaybackControls;
interface ScrollOptions {
source?: HTMLElement;
container?: HTMLElement;
target?: Element;
axis?: "x" | "y";
offset?: ScrollOffset;
}
type OnScrollProgress = (progress: number) => void;
type OnScrollWithInfo = (progress: number, info: ScrollInfo) => void;
type OnScroll = OnScrollProgress | OnScrollWithInfo;
interface AxisScrollInfo {
current: number;
offset: number[];
progress: number;
scrollLength: number;
velocity: number;
targetOffset: number;
targetLength: number;
containerLength: number;
interpolatorOffsets?: number[];
interpolate?: EasingFunction;
}
interface ScrollInfo {
time: number;
x: AxisScrollInfo;
y: AxisScrollInfo;
}
type OnScrollInfo = (info: ScrollInfo) => void;
type SupportedEdgeUnit = "px" | "vw" | "vh" | "%";
type EdgeUnit = `${number}${SupportedEdgeUnit}`;
type NamedEdges = "start" | "end" | "center";
type EdgeString = NamedEdges | EdgeUnit | `${number}`;
type Edge = EdgeString | number;
type ProgressIntersection = [number, number];
type Intersection = `${Edge} ${Edge}`;
type ScrollOffset = Array;
interface ScrollInfoOptions {
container?: HTMLElement;
target?: Element;
axis?: "x" | "y";
offset?: ScrollOffset;
}
declare global {
interface Window {
ScrollTimeline: ScrollTimeline;
}
}
declare class ScrollTimeline implements ProgressTimeline {
constructor(options: ScrollOptions);
currentTime: null | {
value: number;
};
cancel?: VoidFunction;
}
declare function scroll(onScroll: OnScroll | AnimationPlaybackControls, { axis, ...options }?: ScrollOptions): VoidFunction;
declare function scrollInfo(onScroll: OnScrollInfo, { container, ...options }?: ScrollInfoOptions): () => void;
type ViewChangeHandler = (entry: IntersectionObserverEntry) => void;
type MarginValue = `${number}${"px" | "%"}`;
type MarginType = MarginValue | `${MarginValue} ${MarginValue}` | `${MarginValue} ${MarginValue} ${MarginValue}` | `${MarginValue} ${MarginValue} ${MarginValue} ${MarginValue}`;
interface InViewOptions {
root?: Element | Document;
margin?: MarginType;
amount?: "some" | "all" | number;
}
declare function inView(elementOrSelector: ElementOrSelector, onStart: (entry: IntersectionObserverEntry) => void | ViewChangeHandler, { root, margin: rootMargin, amount }?: InViewOptions): VoidFunction;
declare const anticipate: (p: number) => number;
declare const backOut: (t: number) => number;
declare const backIn: motion_dom.EasingFunction;
declare const backInOut: motion_dom.EasingFunction;
declare const circIn: EasingFunction;
declare const circOut: EasingFunction;
declare const circInOut: EasingFunction;
declare function cubicBezier(mX1: number, mY1: number, mX2: number, mY2: number): (t: number) => number;
declare const easeIn: (t: number) => number;
declare const easeOut: (t: number) => number;
declare const easeInOut: (t: number) => number;
declare const mirrorEasing: EasingModifier;
declare const reverseEasing: EasingModifier;
type Direction = "start" | "end";
declare function steps(numSteps: number, direction?: Direction): EasingFunction;
declare function inertia({ keyframes, velocity, power, timeConstant, bounceDamping, bounceStiffness, modifyTarget, min, max, restDelta, restSpeed, }: ValueAnimationOptions): KeyframeGenerator;
declare function keyframes({ duration, keyframes: keyframeValues, times, ease, }: ValueAnimationOptions): KeyframeGenerator;
declare function spring(optionsOrVisualDuration?: ValueAnimationOptions | number, bounce?: number): KeyframeGenerator;
type StaggerOrigin = "first" | "last" | "center" | number;
type StaggerOptions = {
startDelay?: number;
from?: StaggerOrigin;
ease?: Easing;
};
declare function stagger(duration?: number, { startDelay, from, ease }?: StaggerOptions): DynamicOption;
type Process = (data: FrameData) => void;
type Schedule = (process: Process, keepAlive?: boolean, immediate?: boolean) => Process;
interface Step {
schedule: Schedule;
cancel: (process: Process) => void;
process: (data: FrameData) => void;
}
type StepId = "read" | "resolveKeyframes" | "update" | "preRender" | "render" | "postRender";
type Batcher = {
[key in StepId]: Schedule;
};
type Steps = {
[key in StepId]: Step;
};
interface FrameData {
delta: number;
timestamp: number;
isProcessing: boolean;
}
declare const frame: Batcher;
declare const cancelFrame: (process: Process) => void;
declare const frameData: FrameData;
declare const frameSteps: Steps;
/**
* An eventloop-synchronous alternative to performance.now().
*
* Ensures that time measurements remain consistent within a synchronous context.
* Usually calling performance.now() twice within the same synchronous context
* will return different values which isn't useful for animations when we're usually
* trying to sync animations to the same frame.
*/
declare const time: {
now: () => number;
set: (newTime: number) => void;
};
declare const clamp: (min: number, max: number, v: number) => number;
type DelayedFunction = (overshoot: number) => void;
/**
* Timeout defined in ms
*/
declare function delay(callback: DelayedFunction, timeout: number): () => void;
declare const distance: (a: number, b: number) => number;
declare function distance2D(a: Point, b: Point): number;
type Mix = (v: number) => T;
type MixerFactory = (from: T, to: T) => Mix;
interface InterpolateOptions {
clamp?: boolean;
ease?: EasingFunction | EasingFunction[];
mixer?: MixerFactory;
}
/**
* Create a function that maps from a numerical input array to a generic output array.
*
* Accepts:
* - Numbers
* - Colors (hex, hsl, hsla, rgb, rgba)
* - Complex (combinations of one or more numbers or strings)
*
* ```jsx
* const mixColor = interpolate([0, 1], ['#fff', '#000'])
*
* mixColor(0.5) // 'rgba(128, 128, 128, 1)'
* ```
*
* TODO Revist this approach once we've moved to data models for values,
* probably not needed to pregenerate mixer functions.
*
* @public
*/
declare function interpolate(input: number[], output: T[], { clamp: isClamp, ease, mixer }?: InterpolateOptions): (v: number) => T;
type Mixer = (p: number) => T;
declare function mix(from: T, to: T): Mixer;
declare function mix(from: number, to: number, p: number): number;
declare const pipe: (...transformers: Function[]) => Function;
/**
* @public
*/
interface TransformOptions {
/**
* Clamp values to within the given range. Defaults to `true`
*
* @public
*/
clamp?: boolean;
/**
* Easing functions to use on the interpolations between each value in the input and output ranges.
*
* If provided as an array, the array must be one item shorter than the input and output ranges, as the easings apply to the transition **between** each.
*
* @public
*/
ease?: EasingFunction | EasingFunction[];
/**
* Provide a function that can interpolate between any two values in the provided range.
*
* @public
*/
mixer?: (from: T, to: T) => (v: number) => any;
}
/**
* Transforms numbers into other values by mapping them from an input range to an output range.
* Returns the type of the input provided.
*
* @remarks
*
* Given an input range of `[0, 200]` and an output range of
* `[0, 1]`, this function will return a value between `0` and `1`.
* The input range must be a linear series of numbers. The output range
* can be any supported value type, such as numbers, colors, shadows, arrays, objects and more.
* Every value in the output range must be of the same type and in the same format.
*
* ```jsx
* import * as React from "react"
* import { transform } from "framer-motion"
*
* export function MyComponent() {
* const inputRange = [0, 200]
* const outputRange = [0, 1]
* const output = transform(100, inputRange, outputRange)
*
* // Returns 0.5
* return {output}
* }
* ```
*
* @param inputValue - A number to transform between the input and output ranges.
* @param inputRange - A linear series of numbers (either all increasing or decreasing).
* @param outputRange - A series of numbers, colors, strings, or arrays/objects of those. Must be the same length as `inputRange`.
* @param options - Clamp: Clamp values to within the given range. Defaults to `true`.
*
* @public
*/
declare function transform(inputValue: number, inputRange: number[], outputRange: T[], options?: TransformOptions): T;
/**
*
* Transforms numbers into other values by mapping them from an input range to an output range.
*
* Given an input range of `[0, 200]` and an output range of
* `[0, 1]`, this function will return a value between `0` and `1`.
* The input range must be a linear series of numbers. The output range
* can be any supported value type, such as numbers, colors, shadows, arrays, objects and more.
* Every value in the output range must be of the same type and in the same format.
*
* ```jsx
* import * as React from "react"
* import { Frame, transform } from "framer"
*
* export function MyComponent() {
* const inputRange = [-200, -100, 100, 200]
* const outputRange = [0, 1, 1, 0]
* const convertRange = transform(inputRange, outputRange)
* const output = convertRange(-150)
*
* // Returns 0.5
* return {output}
* }
*
* ```
*
* @param inputRange - A linear series of numbers (either all increasing or decreasing).
* @param outputRange - A series of numbers, colors or strings. Must be the same length as `inputRange`.
* @param options - Clamp: clamp values to within the given range. Defaults to `true`.
*
* @public
*/
declare function transform(inputRange: number[], outputRange: T[], options?: TransformOptions): (inputValue: number) => T;
declare const wrap: (min: number, max: number, v: number) => number;
/**
* @deprecated
*
* Import as `frame` instead.
*/
declare const sync: Batcher;
/**
* @deprecated
*
* Use cancelFrame(callback) instead.
*/
declare const cancelSync: Record void>;
declare const animations: FeaturePackages;
interface MotionContextProps {
visualElement?: VisualElement;
initial?: false | string | string[];
animate?: string | string[];
}
declare const MotionContext: React$1.Context>;
declare const createBox: () => Box;
declare function calcLength(axis: Axis): number;
type EventListenerWithPointInfo = (e: PointerEvent, info: EventInfo) => void;
declare const addPointerInfo: (handler: EventListenerWithPointInfo) => EventListener;
declare function addPointerEvent(target: EventTarget, eventName: string, handler: EventListenerWithPointInfo, options?: AddEventListenerOptions): () => void;
declare const isMotionValue: (value: any) => value is MotionValue;
declare const isBrowser: boolean;
declare function useUnmountEffect(callback: () => void): void;
declare const useIsomorphicLayoutEffect: typeof useEffect;
declare function useForceUpdate(): [VoidFunction, number];
/**
* @public
*/
declare const domAnimation: FeatureBundle;
/**
* @public
*/
declare const domMax: FeatureBundle;
/**
* @public
*/
declare const domMin: FeatureBundle;
declare function useMotionValueEvent>(value: MotionValue, event: EventName, callback: MotionValueEventCallbacks[EventName]): void;
/**
* @deprecated useElementScroll is deprecated. Convert to useScroll({ container: ref })
*/
declare function useElementScroll(ref: RefObject$1): {
scrollX: MotionValue;
scrollY: MotionValue