UNPKG

182 kBTypeScriptView Raw
1/// <reference types="react" />
2import * as react from 'react';
3import { SVGAttributes as SVGAttributes$1, CSSProperties, PropsWithoutRef, RefAttributes, ReactHTML, DetailedHTMLFactory, HTMLAttributes, useEffect, RefObject as RefObject$1 } from 'react';
4import * as react_jsx_runtime from 'react/jsx-runtime';
5
6type EasingFunction = (v: number) => number;
7type EasingModifier = (easing: EasingFunction) => EasingFunction;
8type BezierDefinition = [number, number, number, number];
9type EasingDefinition = BezierDefinition | "linear" | "easeIn" | "easeOut" | "easeInOut" | "circIn" | "circOut" | "circInOut" | "backIn" | "backOut" | "backInOut" | "anticipate";
10/**
11 * The easing function to use. Set as one of:
12 *
13 * - The name of an in-built easing function.
14 * - An array of four numbers to define a cubic bezier curve.
15 * - An easing function, that accepts and returns a progress value between `0` and `1`.
16 *
17 * @public
18 */
19type Easing = EasingDefinition | EasingFunction;
20
21type GenericKeyframesTarget<V> = [null, ...V[]] | V[];
22/**
23 * @public
24 */
25type ResolvedKeyframesTarget = GenericKeyframesTarget<number> | GenericKeyframesTarget<string>;
26/**
27 * @public
28 */
29type KeyframesTarget = ResolvedKeyframesTarget | GenericKeyframesTarget<CustomValueType>;
30/**
31 * @public
32 */
33type ResolvedSingleTarget = string | number;
34/**
35 * @public
36 */
37type SingleTarget = ResolvedSingleTarget | CustomValueType;
38/**
39 * @public
40 */
41type ResolvedValueTarget = ResolvedSingleTarget | ResolvedKeyframesTarget;
42/**
43 * @public
44 */
45type ValueTarget = SingleTarget | KeyframesTarget;
46/**
47 * Options for orchestrating the timing of animations.
48 *
49 * @public
50 */
51interface Orchestration {
52 /**
53 * Delay the animation by this duration (in seconds). Defaults to `0`.
54 *
55 * @remarks
56 * ```javascript
57 * const transition = {
58 * delay: 0.2
59 * }
60 * ```
61 *
62 * @public
63 */
64 delay?: number;
65 /**
66 * Describes the relationship between the transition and its children. Set
67 * to `false` by default.
68 *
69 * @remarks
70 * When using variants, the transition can be scheduled in relation to its
71 * children with either `"beforeChildren"` to finish this transition before
72 * starting children transitions, `"afterChildren"` to finish children
73 * transitions before starting this transition.
74 *
75 * ```jsx
76 * const list = {
77 * hidden: {
78 * opacity: 0,
79 * transition: { when: "afterChildren" }
80 * }
81 * }
82 *
83 * const item = {
84 * hidden: {
85 * opacity: 0,
86 * transition: { duration: 2 }
87 * }
88 * }
89 *
90 * return (
91 * <motion.ul variants={list} animate="hidden">
92 * <motion.li variants={item} />
93 * <motion.li variants={item} />
94 * </motion.ul>
95 * )
96 * ```
97 *
98 * @public
99 */
100 when?: false | "beforeChildren" | "afterChildren" | string;
101 /**
102 * When using variants, children animations will start after this duration
103 * (in seconds). You can add the `transition` property to both the `Frame` and the `variant` directly. Adding it to the `variant` generally offers more flexibility, as it allows you to customize the delay per visual state.
104 *
105 * ```jsx
106 * const container = {
107 * hidden: { opacity: 0 },
108 * show: {
109 * opacity: 1,
110 * transition: {
111 * delayChildren: 0.5
112 * }
113 * }
114 * }
115 *
116 * const item = {
117 * hidden: { opacity: 0 },
118 * show: { opacity: 1 }
119 * }
120 *
121 * return (
122 * <motion.ul
123 * variants={container}
124 * initial="hidden"
125 * animate="show"
126 * >
127 * <motion.li variants={item} />
128 * <motion.li variants={item} />
129 * </motion.ul>
130 * )
131 * ```
132 *
133 * @public
134 */
135 delayChildren?: number;
136 /**
137 * When using variants, animations of child components can be staggered by this
138 * duration (in seconds).
139 *
140 * For instance, if `staggerChildren` is `0.01`, the first child will be
141 * delayed by `0` seconds, the second by `0.01`, the third by `0.02` and so
142 * on.
143 *
144 * The calculated stagger delay will be added to `delayChildren`.
145 *
146 * ```jsx
147 * const container = {
148 * hidden: { opacity: 0 },
149 * show: {
150 * opacity: 1,
151 * transition: {
152 * staggerChildren: 0.5
153 * }
154 * }
155 * }
156 *
157 * const item = {
158 * hidden: { opacity: 0 },
159 * show: { opacity: 1 }
160 * }
161 *
162 * return (
163 * <motion.ol
164 * variants={container}
165 * initial="hidden"
166 * animate="show"
167 * >
168 * <motion.li variants={item} />
169 * <motion.li variants={item} />
170 * </motion.ol>
171 * )
172 * ```
173 *
174 * @public
175 */
176 staggerChildren?: number;
177 /**
178 * The direction in which to stagger children.
179 *
180 * A value of `1` staggers from the first to the last while `-1`
181 * staggers from the last to the first.
182 *
183 * ```jsx
184 * const container = {
185 * hidden: { opacity: 0 },
186 * show: {
187 * opacity: 1,
188 * transition: {
189 * staggerChildren: 0.5,
190 * staggerDirection: -1
191 * }
192 * }
193 * }
194 *
195 * const item = {
196 * hidden: { opacity: 0 },
197 * show: { opacity: 1 }
198 * }
199 *
200 * return (
201 * <motion.ul
202 * variants={container}
203 * initial="hidden"
204 * animate="show"
205 * >
206 * <motion.li variants={item} size={50} />
207 * <motion.li variants={item} size={50} />
208 * </motion.ul>
209 * )
210 * ```
211 *
212 * @public
213 */
214 staggerDirection?: number;
215}
216interface Repeat {
217 /**
218 * The number of times to repeat the transition. Set to `Infinity` for perpetual repeating.
219 *
220 * Without setting `repeatType`, this will loop the animation.
221 *
222 * ```jsx
223 * <motion.div
224 * animate={{ rotate: 180 }}
225 * transition={{ repeat: Infinity, duration: 2 }}
226 * />
227 * ```
228 *
229 * @public
230 */
231 repeat?: number;
232 /**
233 * How to repeat the animation. This can be either:
234 *
235 * "loop": Repeats the animation from the start
236 *
237 * "reverse": Alternates between forward and backwards playback
238 *
239 * "mirror": Switches `from` and `to` alternately
240 *
241 * ```jsx
242 * <motion.div
243 * animate={{ rotate: 180 }}
244 * transition={{
245 * repeat: 1,
246 * repeatType: "reverse",
247 * duration: 2
248 * }}
249 * />
250 * ```
251 *
252 * @public
253 */
254 repeatType?: "loop" | "reverse" | "mirror";
255 /**
256 * When repeating an animation, `repeatDelay` will set the
257 * duration of the time to wait, in seconds, between each repetition.
258 *
259 * ```jsx
260 * <motion.div
261 * animate={{ rotate: 180 }}
262 * transition={{ repeat: Infinity, repeatDelay: 1 }}
263 * />
264 * ```
265 *
266 * @public
267 */
268 repeatDelay?: number;
269}
270/**
271 * An animation that animates between two or more values over a specific duration of time.
272 * This is the default animation for non-physical values like `color` and `opacity`.
273 *
274 * @public
275 */
276interface Tween extends Repeat {
277 /**
278 * Set `type` to `"tween"` to use a duration-based tween animation.
279 * If any non-orchestration `transition` values are set without a `type` property,
280 * this is used as the default animation.
281 *
282 * ```jsx
283 * <motion.path
284 * animate={{ pathLength: 1 }}
285 * transition={{ duration: 2, type: "tween" }}
286 * />
287 * ```
288 *
289 * @public
290 */
291 type?: "tween";
292 /**
293 * The duration of the tween animation. Set to `0.3` by default, 0r `0.8` if animating a series of keyframes.
294 *
295 * ```jsx
296 * const variants = {
297 * visible: {
298 * opacity: 1,
299 * transition: { duration: 2 }
300 * }
301 * }
302 * ```
303 *
304 * @public
305 */
306 duration?: number;
307 /**
308 * The easing function to use. Set as one of the below.
309 *
310 * - The name of an existing easing function.
311 *
312 * - An array of four numbers to define a cubic bezier curve.
313 *
314 * - An easing function, that accepts and returns a value `0-1`.
315 *
316 * If the animating value is set as an array of multiple values for a keyframes
317 * animation, `ease` can be set as an array of easing functions to set different easings between
318 * each of those values.
319 *
320 *
321 * ```jsx
322 * <motion.div
323 * animate={{ opacity: 0 }}
324 * transition={{ ease: [0.17, 0.67, 0.83, 0.67] }}
325 * />
326 * ```
327 *
328 * @public
329 */
330 ease?: Easing | Easing[];
331 /**
332 * When animating keyframes, `times` can be used to determine where in the animation each keyframe is reached.
333 * Each value in `times` is a value between `0` and `1`, representing `duration`.
334 *
335 * There must be the same number of `times` as there are keyframes.
336 * Defaults to an array of evenly-spread durations.
337 *
338 * ```jsx
339 * <motion.div
340 * animate={{ scale: [0, 1, 0.5, 1] }}
341 * transition={{ times: [0, 0.1, 0.9, 1] }}
342 * />
343 * ```
344 *
345 * @public
346 */
347 times?: number[];
348 /**
349 * When animating keyframes, `easings` can be used to define easing functions between each keyframe. This array should be one item fewer than the number of keyframes, as these easings apply to the transitions between the keyframes.
350 *
351 * ```jsx
352 * <motion.div
353 * animate={{ backgroundColor: ["#0f0", "#00f", "#f00"] }}
354 * transition={{ easings: ["easeIn", "easeOut"] }}
355 * />
356 * ```
357 *
358 * @public
359 */
360 easings?: Easing[];
361 /**
362 * The value to animate from.
363 * By default, this is the current state of the animating value.
364 *
365 * ```jsx
366 * <motion.div
367 * animate={{ rotate: 180 }}
368 * transition={{ from: 90, duration: 2 }}
369 * />
370 * ```
371 *
372 * @public
373 */
374 from?: number | string;
375}
376/**
377 * An animation that simulates spring physics for realistic motion.
378 * This is the default animation for physical values like `x`, `y`, `scale` and `rotate`.
379 *
380 * @public
381 */
382interface Spring extends Repeat {
383 /**
384 * Set `type` to `"spring"` to animate using spring physics for natural
385 * movement. Type is set to `"spring"` by default.
386 *
387 * ```jsx
388 * <motion.div
389 * animate={{ rotate: 180 }}
390 * transition={{ type: 'spring' }}
391 * />
392 * ```
393 *
394 * @public
395 */
396 type: "spring";
397 /**
398 * Stiffness of the spring. Higher values will create more sudden movement.
399 * Set to `100` by default.
400 *
401 * ```jsx
402 * <motion.section
403 * animate={{ rotate: 180 }}
404 * transition={{ type: 'spring', stiffness: 50 }}
405 * />
406 * ```
407 *
408 * @public
409 */
410 stiffness?: number;
411 /**
412 * Strength of opposing force. If set to 0, spring will oscillate
413 * indefinitely. Set to `10` by default.
414 *
415 * ```jsx
416 * <motion.a
417 * animate={{ rotate: 180 }}
418 * transition={{ type: 'spring', damping: 300 }}
419 * />
420 * ```
421 *
422 * @public
423 */
424 damping?: number;
425 /**
426 * Mass of the moving object. Higher values will result in more lethargic
427 * movement. Set to `1` by default.
428 *
429 * ```jsx
430 * <motion.feTurbulence
431 * animate={{ baseFrequency: 0.5 } as any}
432 * transition={{ type: "spring", mass: 0.5 }}
433 * />
434 * ```
435 *
436 * @public
437 */
438 mass?: number;
439 /**
440 * The duration of the animation, defined in seconds. Spring animations can be a maximum of 10 seconds.
441 *
442 * If `bounce` is set, this defaults to `0.8`.
443 *
444 * Note: `duration` and `bounce` will be overridden if `stiffness`, `damping` or `mass` are set.
445 *
446 * ```jsx
447 * <motion.div
448 * animate={{ x: 100 }}
449 * transition={{ type: "spring", duration: 0.8 }}
450 * />
451 * ```
452 *
453 * @public
454 */
455 duration?: number;
456 /**
457 * `bounce` determines the "bounciness" of a spring animation.
458 *
459 * `0` is no bounce, and `1` is extremely bouncy.
460 *
461 * If `duration` is set, this defaults to `0.25`.
462 *
463 * Note: `bounce` and `duration` will be overridden if `stiffness`, `damping` or `mass` are set.
464 *
465 * ```jsx
466 * <motion.div
467 * animate={{ x: 100 }}
468 * transition={{ type: "spring", bounce: 0.25 }}
469 * />
470 * ```
471 *
472 * @public
473 */
474 bounce?: number;
475 /**
476 * End animation if absolute speed (in units per second) drops below this
477 * value and delta is smaller than `restDelta`. Set to `0.01` by default.
478 *
479 * ```jsx
480 * <motion.div
481 * animate={{ rotate: 180 }}
482 * transition={{ type: 'spring', restSpeed: 0.5 }}
483 * />
484 * ```
485 *
486 * @public
487 */
488 restSpeed?: number;
489 /**
490 * End animation if distance is below this value and speed is below
491 * `restSpeed`. When animation ends, spring gets “snapped” to. Set to
492 * `0.01` by default.
493 *
494 * ```jsx
495 * <motion.div
496 * animate={{ rotate: 180 }}
497 * transition={{ type: 'spring', restDelta: 0.5 }}
498 * />
499 * ```
500 *
501 * @public
502 */
503 restDelta?: number;
504 /**
505 * The value to animate from.
506 * By default, this is the initial state of the animating value.
507 *
508 * ```jsx
509 * <motion.div
510 * animate={{ rotate: 180 }}
511 * transition={{ type: 'spring', from: 90 }}
512 * />
513 * ```
514 *
515 * @public
516 */
517 from?: number | string;
518 /**
519 * The initial velocity of the spring. By default this is the current velocity of the component.
520 *
521 * ```jsx
522 * <motion.div
523 * animate={{ rotate: 180 }}
524 * transition={{ type: 'spring', velocity: 2 }}
525 * />
526 * ```
527 *
528 * @public
529 */
530 velocity?: number;
531}
532/**
533 * An animation that decelerates a value based on its initial velocity,
534 * usually used to implement inertial scrolling.
535 *
536 * Optionally, `min` and `max` boundaries can be defined, and inertia
537 * will snap to these with a spring animation.
538 *
539 * This animation will automatically precalculate a target value,
540 * which can be modified with the `modifyTarget` property.
541 *
542 * This allows you to add snap-to-grid or similar functionality.
543 *
544 * Inertia is also the animation used for `dragTransition`, and can be configured via that prop.
545 *
546 * @public
547 */
548interface Inertia {
549 /**
550 * Set `type` to animate using the inertia animation. Set to `"tween"` by
551 * default. This can be used for natural deceleration, like momentum scrolling.
552 *
553 * ```jsx
554 * <motion.div
555 * animate={{ rotate: 180 }}
556 * transition={{ type: "inertia", velocity: 50 }}
557 * />
558 * ```
559 *
560 * @public
561 */
562 type: "inertia";
563 /**
564 * A function that receives the automatically-calculated target and returns a new one. Useful for snapping the target to a grid.
565 *
566 * ```jsx
567 * <motion.div
568 * drag
569 * dragTransition={{
570 * power: 0,
571 * // Snap calculated target to nearest 50 pixels
572 * modifyTarget: target => Math.round(target / 50) * 50
573 * }}
574 * />
575 * ```
576 *
577 * @public
578 */
579 modifyTarget?(v: number): number;
580 /**
581 * If `min` or `max` is set, this affects the stiffness of the bounce
582 * spring. Higher values will create more sudden movement. Set to `500` by
583 * default.
584 *
585 * ```jsx
586 * <motion.div
587 * drag
588 * dragTransition={{
589 * min: 0,
590 * max: 100,
591 * bounceStiffness: 100
592 * }}
593 * />
594 * ```
595 *
596 * @public
597 */
598 bounceStiffness?: number;
599 /**
600 * If `min` or `max` is set, this affects the damping of the bounce spring.
601 * If set to `0`, spring will oscillate indefinitely. Set to `10` by
602 * default.
603 *
604 * ```jsx
605 * <motion.div
606 * drag
607 * dragTransition={{
608 * min: 0,
609 * max: 100,
610 * bounceDamping: 8
611 * }}
612 * />
613 * ```
614 *
615 * @public
616 */
617 bounceDamping?: number;
618 /**
619 * A higher power value equals a further target. Set to `0.8` by default.
620 *
621 * ```jsx
622 * <motion.div
623 * drag
624 * dragTransition={{ power: 0.2 }}
625 * />
626 * ```
627 *
628 * @public
629 */
630 power?: number;
631 /**
632 * Adjusting the time constant will change the duration of the
633 * deceleration, thereby affecting its feel. Set to `700` by default.
634 *
635 * ```jsx
636 * <motion.div
637 * drag
638 * dragTransition={{ timeConstant: 200 }}
639 * />
640 * ```
641 *
642 * @public
643 */
644 timeConstant?: number;
645 /**
646 * End the animation if the distance to the animation target is below this value, and the absolute speed is below `restSpeed`.
647 * When the animation ends, the value gets snapped to the animation target. Set to `0.01` by default.
648 * Generally the default values provide smooth animation endings, only in rare cases should you need to customize these.
649 *
650 * ```jsx
651 * <motion.div
652 * drag
653 * dragTransition={{ restDelta: 10 }}
654 * />
655 * ```
656 *
657 * @public
658 */
659 restDelta?: number;
660 /**
661 * Minimum constraint. If set, the value will "bump" against this value (or immediately spring to it if the animation starts as less than this value).
662 *
663 * ```jsx
664 * <motion.div
665 * drag
666 * dragTransition={{ min: 0, max: 100 }}
667 * />
668 * ```
669 *
670 * @public
671 */
672 min?: number;
673 /**
674 * Maximum constraint. If set, the value will "bump" against this value (or immediately snap to it, if the initial animation value exceeds this value).
675 *
676 * ```jsx
677 * <motion.div
678 * drag
679 * dragTransition={{ min: 0, max: 100 }}
680 * />
681 * ```
682 *
683 * @public
684 */
685 max?: number;
686 /**
687 * The value to animate from. By default, this is the current state of the animating value.
688 *
689 * ```jsx
690 * <Frame
691 * drag
692 * dragTransition={{ from: 50 }}
693 * />
694 * ```
695 *
696 * @public
697 */
698 from?: number | string;
699 /**
700 * The initial velocity of the animation.
701 * By default this is the current velocity of the component.
702 *
703 * ```jsx
704 * <motion.div
705 * animate={{ rotate: 180 }}
706 * transition={{ type: 'inertia', velocity: 200 }}
707 * />
708 * ```
709 *
710 * @public
711 */
712 velocity?: number;
713}
714/**
715 * Keyframes tweens between multiple `values`.
716 *
717 * These tweens can be arranged using the `duration`, `easings`, and `times` properties.
718 */
719interface Keyframes {
720 /**
721 * Set `type` to `"keyframes"` to animate using the keyframes animation.
722 * Set to `"tween"` by default. This can be used to animate between a series of values.
723 *
724 * @public
725 */
726 type: "keyframes";
727 /**
728 * An array of numbers between 0 and 1, where `1` represents the `total` duration.
729 *
730 * Each value represents at which point during the animation each item in the animation target should be hit, so the array should be the same length as `values`.
731 *
732 * Defaults to an array of evenly-spread durations.
733 *
734 * @public
735 */
736 times?: number[];
737 /**
738 * An array of easing functions for each generated tween, or a single easing function applied to all tweens.
739 *
740 * This array should be one item less than `values`, as these easings apply to the transitions *between* the `values`.
741 *
742 * ```jsx
743 * const transition = {
744 * backgroundColor: {
745 * type: 'keyframes',
746 * easings: ['circIn', 'circOut']
747 * }
748 * }
749 * ```
750 *
751 * @public
752 */
753 ease?: Easing | Easing[];
754 /**
755 * The total duration of the animation. Set to `0.3` by default.
756 *
757 * ```jsx
758 * const transition = {
759 * type: "keyframes",
760 * duration: 2
761 * }
762 *
763 * <Frame
764 * animate={{ opacity: 0 }}
765 * transition={transition}
766 * />
767 * ```
768 *
769 * @public
770 */
771 duration?: number;
772 /**
773 * @public
774 */
775 repeatDelay?: number;
776}
777/**
778 * @public
779 */
780interface Just {
781 /**
782 * @public
783 */
784 type: "just";
785}
786/**
787 * @public
788 */
789interface None {
790 /**
791 * Set `type` to `false` for an instant transition.
792 *
793 * @public
794 */
795 type: false;
796}
797/**
798 * @public
799 */
800type PermissiveTransitionDefinition = {
801 [key: string]: any;
802};
803/**
804 * @public
805 */
806type TransitionDefinition = Tween | Spring | Keyframes | Inertia | Just | None | PermissiveTransitionDefinition;
807type TransitionMap = Orchestration & TransitionDefinition & {
808 [key: string]: TransitionDefinition;
809};
810/**
811 * Transition props
812 *
813 * @public
814 */
815type Transition$1 = (Orchestration & Repeat & TransitionDefinition) | (Orchestration & Repeat & TransitionMap);
816type Omit$1<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
817type CSSPropertiesWithoutTransitionOrSingleTransforms = Omit$1<CSSProperties, "transition" | "rotate" | "scale" | "perspective">;
818type SVGTransformAttributes = {
819 attrX?: number;
820 attrY?: number;
821 attrScale?: number;
822};
823type TargetProperties = CSSPropertiesWithoutTransitionOrSingleTransforms & SVGAttributes$1<SVGElement> & SVGTransformAttributes & TransformProperties & CustomStyles & SVGPathProperties;
824/**
825 * @public
826 */
827type MakeCustomValueType<T> = {
828 [K in keyof T]: T[K] | CustomValueType;
829};
830/**
831 * @public
832 */
833type Target = MakeCustomValueType<TargetProperties>;
834/**
835 * @public
836 */
837type MakeKeyframes<T> = {
838 [K in keyof T]: T[K] | T[K][] | [null, ...T[K][]];
839};
840/**
841 * @public
842 */
843type TargetWithKeyframes = MakeKeyframes<Target>;
844/**
845 * An object that specifies values to animate to. Each value may be set either as
846 * a single value, or an array of values.
847 *
848 * It may also option contain these properties:
849 *
850 * - `transition`: Specifies transitions for all or individual values.
851 * - `transitionEnd`: Specifies values to set when the animation finishes.
852 *
853 * ```jsx
854 * const target = {
855 * x: "0%",
856 * opacity: 0,
857 * transition: { duration: 1 },
858 * transitionEnd: { display: "none" }
859 * }
860 * ```
861 *
862 * @public
863 */
864type TargetAndTransition = TargetWithKeyframes & {
865 transition?: Transition$1;
866 transitionEnd?: Target;
867};
868type TargetResolver = (custom: any, current: Target, velocity: Target) => TargetAndTransition | string;
869/**
870 * @public
871 */
872type Variant = TargetAndTransition | TargetResolver;
873/**
874 * @public
875 */
876type Variants = {
877 [key: string]: Variant;
878};
879/**
880 * @public
881 */
882interface CustomValueType {
883 mix: (from: any, to: any) => (p: number) => number | string;
884 toValue: () => number | string;
885}
886
887/**
888 * An update function. It accepts a timestamp used to advance the animation.
889 */
890type Update = (timestamp: number) => void;
891/**
892 * Drivers accept a update function and call it at an interval. This interval
893 * could be a synchronous loop, a setInterval, or tied to the device's framerate.
894 */
895interface DriverControls {
896 start: () => void;
897 stop: () => void;
898 now: () => number;
899}
900type Driver = (update: Update) => DriverControls;
901
902interface SVGAttributes {
903 accentHeight?: number | string | undefined;
904 accumulate?: "none" | "sum" | undefined;
905 additive?: "replace" | "sum" | undefined;
906 alignmentBaseline?: "auto" | "baseline" | "before-edge" | "text-before-edge" | "middle" | "central" | "after-edge" | "text-after-edge" | "ideographic" | "alphabetic" | "hanging" | "mathematical" | "inherit" | undefined;
907 allowReorder?: "no" | "yes" | undefined;
908 alphabetic?: number | string | undefined;
909 amplitude?: number | string | undefined;
910 arabicForm?: "initial" | "medial" | "terminal" | "isolated" | undefined;
911 ascent?: number | string | undefined;
912 attributeName?: string | undefined;
913 attributeType?: string | undefined;
914 autoReverse?: boolean | undefined;
915 azimuth?: number | string | undefined;
916 baseFrequency?: number | string | undefined;
917 baselineShift?: number | string | undefined;
918 baseProfile?: number | string | undefined;
919 bbox?: number | string | undefined;
920 begin?: number | string | undefined;
921 bias?: number | string | undefined;
922 by?: number | string | undefined;
923 calcMode?: number | string | undefined;
924 capHeight?: number | string | undefined;
925 clip?: number | string | undefined;
926 clipPath?: string | undefined;
927 clipPathUnits?: number | string | undefined;
928 clipRule?: number | string | undefined;
929 colorInterpolation?: number | string | undefined;
930 colorInterpolationFilters?: "auto" | "sRGB" | "linearRGB" | "inherit" | undefined;
931 colorProfile?: number | string | undefined;
932 colorRendering?: number | string | undefined;
933 contentScriptType?: number | string | undefined;
934 contentStyleType?: number | string | undefined;
935 cursor?: number | string | undefined;
936 cx?: number | string | undefined;
937 cy?: number | string | undefined;
938 d?: string | undefined;
939 decelerate?: number | string | undefined;
940 descent?: number | string | undefined;
941 diffuseConstant?: number | string | undefined;
942 direction?: number | string | undefined;
943 display?: number | string | undefined;
944 divisor?: number | string | undefined;
945 dominantBaseline?: number | string | undefined;
946 dur?: number | string | undefined;
947 dx?: number | string | undefined;
948 dy?: number | string | undefined;
949 edgeMode?: number | string | undefined;
950 elevation?: number | string | undefined;
951 enableBackground?: number | string | undefined;
952 end?: number | string | undefined;
953 exponent?: number | string | undefined;
954 externalResourcesRequired?: boolean | undefined;
955 fill?: string | undefined;
956 fillOpacity?: number | string | undefined;
957 fillRule?: "nonzero" | "evenodd" | "inherit" | undefined;
958 filter?: string | undefined;
959 filterRes?: number | string | undefined;
960 filterUnits?: number | string | undefined;
961 floodColor?: number | string | undefined;
962 floodOpacity?: number | string | undefined;
963 focusable?: boolean | "auto" | undefined;
964 fontFamily?: string | undefined;
965 fontSize?: number | string | undefined;
966 fontSizeAdjust?: number | string | undefined;
967 fontStretch?: number | string | undefined;
968 fontStyle?: number | string | undefined;
969 fontVariant?: number | string | undefined;
970 fontWeight?: number | string | undefined;
971 format?: number | string | undefined;
972 fr?: number | string | undefined;
973 from?: number | string | undefined;
974 fx?: number | string | undefined;
975 fy?: number | string | undefined;
976 g1?: number | string | undefined;
977 g2?: number | string | undefined;
978 glyphName?: number | string | undefined;
979 glyphOrientationHorizontal?: number | string | undefined;
980 glyphOrientationVertical?: number | string | undefined;
981 glyphRef?: number | string | undefined;
982 gradientTransform?: string | undefined;
983 gradientUnits?: string | undefined;
984 hanging?: number | string | undefined;
985 horizAdvX?: number | string | undefined;
986 horizOriginX?: number | string | undefined;
987 href?: string | undefined;
988 ideographic?: number | string | undefined;
989 imageRendering?: number | string | undefined;
990 in2?: number | string | undefined;
991 in?: string | undefined;
992 intercept?: number | string | undefined;
993 k1?: number | string | undefined;
994 k2?: number | string | undefined;
995 k3?: number | string | undefined;
996 k4?: number | string | undefined;
997 k?: number | string | undefined;
998 kernelMatrix?: number | string | undefined;
999 kernelUnitLength?: number | string | undefined;
1000 kerning?: number | string | undefined;
1001 keyPoints?: number | string | undefined;
1002 keySplines?: number | string | undefined;
1003 keyTimes?: number | string | undefined;
1004 lengthAdjust?: number | string | undefined;
1005 letterSpacing?: number | string | undefined;
1006 lightingColor?: number | string | undefined;
1007 limitingConeAngle?: number | string | undefined;
1008 local?: number | string | undefined;
1009 markerEnd?: string | undefined;
1010 markerHeight?: number | string | undefined;
1011 markerMid?: string | undefined;
1012 markerStart?: string | undefined;
1013 markerUnits?: number | string | undefined;
1014 markerWidth?: number | string | undefined;
1015 mask?: string | undefined;
1016 maskContentUnits?: number | string | undefined;
1017 maskUnits?: number | string | undefined;
1018 mathematical?: number | string | undefined;
1019 mode?: number | string | undefined;
1020 numOctaves?: number | string | undefined;
1021 offset?: number | string | undefined;
1022 opacity?: number | string | undefined;
1023 operator?: number | string | undefined;
1024 order?: number | string | undefined;
1025 orient?: number | string | undefined;
1026 orientation?: number | string | undefined;
1027 origin?: number | string | undefined;
1028 overflow?: number | string | undefined;
1029 overlinePosition?: number | string | undefined;
1030 overlineThickness?: number | string | undefined;
1031 paintOrder?: number | string | undefined;
1032 panose1?: number | string | undefined;
1033 path?: string | undefined;
1034 pathLength?: number | string | undefined;
1035 patternContentUnits?: string | undefined;
1036 patternTransform?: number | string | undefined;
1037 patternUnits?: string | undefined;
1038 pointerEvents?: number | string | undefined;
1039 points?: string | undefined;
1040 pointsAtX?: number | string | undefined;
1041 pointsAtY?: number | string | undefined;
1042 pointsAtZ?: number | string | undefined;
1043 preserveAlpha?: boolean | undefined;
1044 preserveAspectRatio?: string | undefined;
1045 primitiveUnits?: number | string | undefined;
1046 r?: number | string | undefined;
1047 radius?: number | string | undefined;
1048 refX?: number | string | undefined;
1049 refY?: number | string | undefined;
1050 renderingIntent?: number | string | undefined;
1051 repeatCount?: number | string | undefined;
1052 repeatDur?: number | string | undefined;
1053 requiredExtensions?: number | string | undefined;
1054 requiredFeatures?: number | string | undefined;
1055 restart?: number | string | undefined;
1056 result?: string | undefined;
1057 rotate?: number | string | undefined;
1058 rx?: number | string | undefined;
1059 ry?: number | string | undefined;
1060 scale?: number | string | undefined;
1061 seed?: number | string | undefined;
1062 shapeRendering?: number | string | undefined;
1063 slope?: number | string | undefined;
1064 spacing?: number | string | undefined;
1065 specularConstant?: number | string | undefined;
1066 specularExponent?: number | string | undefined;
1067 speed?: number | string | undefined;
1068 spreadMethod?: string | undefined;
1069 startOffset?: number | string | undefined;
1070 stdDeviation?: number | string | undefined;
1071 stemh?: number | string | undefined;
1072 stemv?: number | string | undefined;
1073 stitchTiles?: number | string | undefined;
1074 stopColor?: string | undefined;
1075 stopOpacity?: number | string | undefined;
1076 strikethroughPosition?: number | string | undefined;
1077 strikethroughThickness?: number | string | undefined;
1078 string?: number | string | undefined;
1079 stroke?: string | undefined;
1080 strokeDasharray?: string | number | undefined;
1081 strokeDashoffset?: string | number | undefined;
1082 strokeLinecap?: "butt" | "round" | "square" | "inherit" | undefined;
1083 strokeLinejoin?: "miter" | "round" | "bevel" | "inherit" | undefined;
1084 strokeMiterlimit?: number | string | undefined;
1085 strokeOpacity?: number | string | undefined;
1086 strokeWidth?: number | string | undefined;
1087 surfaceScale?: number | string | undefined;
1088 systemLanguage?: number | string | undefined;
1089 tableValues?: number | string | undefined;
1090 targetX?: number | string | undefined;
1091 targetY?: number | string | undefined;
1092 textAnchor?: string | undefined;
1093 textDecoration?: number | string | undefined;
1094 textLength?: number | string | undefined;
1095 textRendering?: number | string | undefined;
1096 to?: number | string | undefined;
1097 transform?: string | undefined;
1098 u1?: number | string | undefined;
1099 u2?: number | string | undefined;
1100 underlinePosition?: number | string | undefined;
1101 underlineThickness?: number | string | undefined;
1102 unicode?: number | string | undefined;
1103 unicodeBidi?: number | string | undefined;
1104 unicodeRange?: number | string | undefined;
1105 unitsPerEm?: number | string | undefined;
1106 vAlphabetic?: number | string | undefined;
1107 values?: string | undefined;
1108 vectorEffect?: number | string | undefined;
1109 version?: string | undefined;
1110 vertAdvY?: number | string | undefined;
1111 vertOriginX?: number | string | undefined;
1112 vertOriginY?: number | string | undefined;
1113 vHanging?: number | string | undefined;
1114 vIdeographic?: number | string | undefined;
1115 viewBox?: string | undefined;
1116 viewTarget?: number | string | undefined;
1117 visibility?: number | string | undefined;
1118 vMathematical?: number | string | undefined;
1119 widths?: number | string | undefined;
1120 wordSpacing?: number | string | undefined;
1121 writingMode?: number | string | undefined;
1122 x1?: number | string | undefined;
1123 x2?: number | string | undefined;
1124 x?: number | string | undefined;
1125 xChannelSelector?: string | undefined;
1126 xHeight?: number | string | undefined;
1127 xlinkActuate?: string | undefined;
1128 xlinkArcrole?: string | undefined;
1129 xlinkHref?: string | undefined;
1130 xlinkRole?: string | undefined;
1131 xlinkShow?: string | undefined;
1132 xlinkTitle?: string | undefined;
1133 xlinkType?: string | undefined;
1134 xmlBase?: string | undefined;
1135 xmlLang?: string | undefined;
1136 xmlns?: string | undefined;
1137 xmlnsXlink?: string | undefined;
1138 xmlSpace?: string | undefined;
1139 y1?: number | string | undefined;
1140 y2?: number | string | undefined;
1141 y?: number | string | undefined;
1142 yChannelSelector?: string | undefined;
1143 z?: number | string | undefined;
1144 zoomAndPan?: string | undefined;
1145}
1146
1147interface ProgressTimeline {
1148 currentTime: null | {
1149 value: number;
1150 };
1151 cancel?: VoidFunction;
1152}
1153
1154interface Point {
1155 x: number;
1156 y: number;
1157}
1158interface Axis {
1159 min: number;
1160 max: number;
1161}
1162interface Box {
1163 x: Axis;
1164 y: Axis;
1165}
1166interface BoundingBox {
1167 top: number;
1168 right: number;
1169 bottom: number;
1170 left: number;
1171}
1172interface AxisDelta {
1173 translate: number;
1174 scale: number;
1175 origin: number;
1176 originPoint: number;
1177}
1178interface Delta {
1179 x: AxisDelta;
1180 y: AxisDelta;
1181}
1182type TransformPoint = (point: Point) => Point;
1183
1184type ReducedMotionConfig = "always" | "never" | "user";
1185/**
1186 * @public
1187 */
1188interface MotionConfigContext {
1189 /**
1190 * Internal, exported only for usage in Framer
1191 */
1192 transformPagePoint: TransformPoint;
1193 /**
1194 * Internal. Determines whether this is a static context ie the Framer canvas. If so,
1195 * it'll disable all dynamic functionality.
1196 */
1197 isStatic: boolean;
1198 /**
1199 * Defines a new default transition for the entire tree.
1200 *
1201 * @public
1202 */
1203 transition?: Transition$1;
1204 /**
1205 * If true, will respect the device prefersReducedMotion setting by switching
1206 * transform animations off.
1207 *
1208 * @public
1209 */
1210 reducedMotion?: ReducedMotionConfig;
1211 /**
1212 * A custom `nonce` attribute used when wanting to enforce a Content Security Policy (CSP).
1213 * For more details see:
1214 * https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/style-src#unsafe_inline_styles
1215 *
1216 * @public
1217 */
1218 nonce?: string;
1219}
1220/**
1221 * @public
1222 */
1223declare const MotionConfigContext: react.Context<MotionConfigContext>;
1224
1225declare class NodeStack {
1226 lead?: IProjectionNode;
1227 prevLead?: IProjectionNode;
1228 members: IProjectionNode[];
1229 add(node: IProjectionNode): void;
1230 remove(node: IProjectionNode): void;
1231 relegate(node: IProjectionNode): boolean;
1232 promote(node: IProjectionNode, preserveFollowOpacity?: boolean): void;
1233 exitAnimationComplete(): void;
1234 scheduleRender(): void;
1235 /**
1236 * Clear any leads that have been removed this render to prevent them from being
1237 * used in future animations and to prevent memory leaks
1238 */
1239 removeLeadSnapshot(): void;
1240}
1241
1242interface WithDepth {
1243 depth: number;
1244}
1245
1246declare class FlatTree {
1247 private children;
1248 private isDirty;
1249 add(child: WithDepth): void;
1250 remove(child: WithDepth): void;
1251 forEach(callback: (child: WithDepth) => void): void;
1252}
1253
1254interface SwitchLayoutGroup {
1255 register?: (member: IProjectionNode) => void;
1256 deregister?: (member: IProjectionNode) => void;
1257}
1258type InitialPromotionConfig = {
1259 /**
1260 * The initial transition to use when the elements in this group mount (and automatically promoted).
1261 * Subsequent updates should provide a transition in the promote method.
1262 */
1263 transition?: Transition$1;
1264 /**
1265 * If the follow tree should preserve its opacity when the lead is promoted on mount
1266 */
1267 shouldPreserveFollowOpacity?: (member: IProjectionNode) => boolean;
1268};
1269type SwitchLayoutGroupContext = SwitchLayoutGroup & InitialPromotionConfig;
1270/**
1271 * Internal, exported only for usage in Framer
1272 */
1273declare const SwitchLayoutGroupContext: react.Context<SwitchLayoutGroupContext>;
1274
1275interface Measurements {
1276 animationId: number;
1277 measuredBox: Box;
1278 layoutBox: Box;
1279 latestValues: ResolvedValues;
1280 source: number;
1281}
1282type Phase = "snapshot" | "measure";
1283interface ScrollMeasurements {
1284 animationId: number;
1285 phase: Phase;
1286 offset: Point;
1287 isRoot: boolean;
1288 wasRoot: boolean;
1289}
1290type LayoutEvents = "willUpdate" | "didUpdate" | "beforeMeasure" | "measure" | "projectionUpdate" | "animationStart" | "animationComplete";
1291interface IProjectionNode<I = unknown> {
1292 id: number;
1293 animationId: number;
1294 parent?: IProjectionNode;
1295 relativeParent?: IProjectionNode;
1296 root?: IProjectionNode;
1297 children: Set<IProjectionNode>;
1298 path: IProjectionNode[];
1299 nodes?: FlatTree;
1300 depth: number;
1301 instance: I;
1302 mount: (node: I, isLayoutDirty?: boolean) => void;
1303 unmount: () => void;
1304 options: ProjectionNodeOptions;
1305 setOptions(options: ProjectionNodeOptions): void;
1306 layout?: Measurements;
1307 snapshot?: Measurements;
1308 target?: Box;
1309 relativeTarget?: Box;
1310 relativeTargetOrigin?: Box;
1311 targetDelta?: Delta;
1312 targetWithTransforms?: Box;
1313 scroll?: ScrollMeasurements;
1314 treeScale?: Point;
1315 projectionDelta?: Delta;
1316 projectionDeltaWithTransform?: Delta;
1317 latestValues: ResolvedValues;
1318 isLayoutDirty: boolean;
1319 isProjectionDirty: boolean;
1320 isSharedProjectionDirty: boolean;
1321 isTransformDirty: boolean;
1322 resolvedRelativeTargetAt?: number;
1323 shouldResetTransform: boolean;
1324 prevTransformTemplateValue: string | undefined;
1325 isUpdateBlocked(): boolean;
1326 updateManuallyBlocked: boolean;
1327 updateBlockedByResize: boolean;
1328 blockUpdate(): void;
1329 unblockUpdate(): void;
1330 isUpdating: boolean;
1331 needsReset: boolean;
1332 startUpdate(): void;
1333 willUpdate(notifyListeners?: boolean): void;
1334 didUpdate(): void;
1335 measure(removeTransform?: boolean): Measurements;
1336 measurePageBox(): Box;
1337 updateLayout(): void;
1338 updateSnapshot(): void;
1339 clearSnapshot(): void;
1340 updateScroll(phase?: Phase): void;
1341 scheduleUpdateProjection(): void;
1342 scheduleCheckAfterUnmount(): void;
1343 checkUpdateFailed(): void;
1344 sharedNodes: Map<string, NodeStack>;
1345 registerSharedNode(id: string, node: IProjectionNode): void;
1346 getStack(): NodeStack | undefined;
1347 isVisible: boolean;
1348 hide(): void;
1349 show(): void;
1350 scheduleRender(notifyAll?: boolean): void;
1351 getClosestProjectingParent(): IProjectionNode | undefined;
1352 setTargetDelta(delta: Delta): void;
1353 resetTransform(): void;
1354 resetSkewAndRotation(): void;
1355 applyTransform(box: Box, transformOnly?: boolean): Box;
1356 resolveTargetDelta(force?: boolean): void;
1357 calcProjection(): void;
1358 getProjectionStyles(styleProp?: MotionStyle): MotionStyle | undefined;
1359 clearMeasurements(): void;
1360 resetTree(): void;
1361 isProjecting(): boolean;
1362 animationValues?: ResolvedValues;
1363 currentAnimation?: AnimationPlaybackControls;
1364 isTreeAnimating?: boolean;
1365 isAnimationBlocked?: boolean;
1366 isTreeAnimationBlocked: () => boolean;
1367 setAnimationOrigin(delta: Delta): void;
1368 startAnimation(transition: Transition$1): void;
1369 finishAnimation(): void;
1370 hasCheckedOptimisedAppear: boolean;
1371 isLead(): boolean;
1372 promote(options?: {
1373 needsReset?: boolean;
1374 transition?: Transition$1;
1375 preserveFollowOpacity?: boolean;
1376 }): void;
1377 relegate(): boolean;
1378 resumeFrom?: IProjectionNode;
1379 resumingFrom?: IProjectionNode;
1380 isPresent?: boolean;
1381 addEventListener(name: LayoutEvents, handler: any): VoidFunction;
1382 notifyListeners(name: LayoutEvents, ...args: any): void;
1383 hasListeners(name: LayoutEvents): boolean;
1384 hasTreeAnimated: boolean;
1385 preserveOpacity?: boolean;
1386}
1387interface ProjectionNodeOptions {
1388 animate?: boolean;
1389 layoutScroll?: boolean;
1390 layoutRoot?: boolean;
1391 alwaysMeasureLayout?: boolean;
1392 onExitComplete?: VoidFunction;
1393 animationType?: "size" | "position" | "both" | "preserve-aspect";
1394 layoutId?: string;
1395 layout?: boolean | string;
1396 visualElement?: VisualElement;
1397 crossfade?: boolean;
1398 transition?: Transition$1;
1399 initialPromotionConfig?: InitialPromotionConfig;
1400}
1401
1402type AnimationType = "animate" | "whileHover" | "whileTap" | "whileDrag" | "whileFocus" | "whileInView" | "exit";
1403
1404type VisualElementAnimationOptions = {
1405 delay?: number;
1406 transitionOverride?: Transition$1;
1407 custom?: any;
1408 type?: AnimationType;
1409};
1410
1411interface AnimationState$1 {
1412 animateChanges: (type?: AnimationType) => Promise<any>;
1413 setActive: (type: AnimationType, isActive: boolean, options?: VisualElementAnimationOptions) => Promise<any>;
1414 setAnimateFunction: (fn: any) => void;
1415 getState: () => {
1416 [key: string]: AnimationTypeState;
1417 };
1418 reset: () => void;
1419}
1420interface AnimationTypeState {
1421 isActive: boolean;
1422 protectedKeys: {
1423 [key: string]: true;
1424 };
1425 needsAnimating: {
1426 [key: string]: boolean;
1427 };
1428 prevResolvedValues: {
1429 [key: string]: any;
1430 };
1431 prevProp?: VariantLabels | TargetAndTransition;
1432}
1433
1434/**
1435 * @public
1436 */
1437interface PresenceContextProps {
1438 id: string;
1439 isPresent: boolean;
1440 register: (id: string | number) => () => void;
1441 onExitComplete?: (id: string | number) => void;
1442 initial?: false | VariantLabels;
1443 custom?: any;
1444}
1445/**
1446 * @public
1447 */
1448declare const PresenceContext: react.Context<PresenceContextProps | null>;
1449
1450/**
1451 * A VisualElement is an imperative abstraction around UI elements such as
1452 * HTMLElement, SVGElement, Three.Object3D etc.
1453 */
1454declare abstract class VisualElement<Instance = unknown, RenderState = unknown, Options extends {} = {}> {
1455 /**
1456 * VisualElements are arranged in trees mirroring that of the React tree.
1457 * Each type of VisualElement has a unique name, to detect when we're crossing
1458 * type boundaries within that tree.
1459 */
1460 abstract type: string;
1461 /**
1462 * An `Array.sort` compatible function that will compare two Instances and
1463 * compare their respective positions within the tree.
1464 */
1465 abstract sortInstanceNodePosition(a: Instance, b: Instance): number;
1466 /**
1467 * Measure the viewport-relative bounding box of the Instance.
1468 */
1469 abstract measureInstanceViewportBox(instance: Instance, props: MotionProps & Partial<MotionConfigContext>): Box;
1470 /**
1471 * When a value has been removed from all animation props we need to
1472 * pick a target to animate back to. For instance, for HTMLElements
1473 * we can look in the style prop.
1474 */
1475 abstract getBaseTargetFromProps(props: MotionProps, key: string): string | number | undefined | MotionValue;
1476 /**
1477 * When we first animate to a value we need to animate it *from* a value.
1478 * Often this have been specified via the initial prop but it might be
1479 * that the value needs to be read from the Instance.
1480 */
1481 abstract readValueFromInstance(instance: Instance, key: string, options: Options): string | number | null | undefined;
1482 /**
1483 * When a value has been removed from the VisualElement we use this to remove
1484 * it from the inherting class' unique render state.
1485 */
1486 abstract removeValueFromRenderState(key: string, renderState: RenderState): void;
1487 /**
1488 * Run before a React or VisualElement render, builds the latest motion
1489 * values into an Instance-specific format. For example, HTMLVisualElement
1490 * will use this step to build `style` and `var` values.
1491 */
1492 abstract build(renderState: RenderState, latestValues: ResolvedValues, props: MotionProps): void;
1493 /**
1494 * Apply the built values to the Instance. For example, HTMLElements will have
1495 * styles applied via `setProperty` and the style attribute, whereas SVGElements
1496 * will have values applied to attributes.
1497 */
1498 abstract renderInstance(instance: Instance, renderState: RenderState, styleProp?: MotionStyle, projection?: IProjectionNode): void;
1499 /**
1500 * If true, will-change will be applied to the element. Only HTMLVisualElements
1501 * currently support this.
1502 */
1503 applyWillChange: boolean;
1504 resolveKeyframes: <T extends string | number>(keyframes: UnresolvedKeyframes<T>, onComplete: (resolvedKeyframes: ResolvedKeyframes<T>) => void, name: string, value: MotionValue<T>) => KeyframeResolver<T>;
1505 /**
1506 * If the component child is provided as a motion value, handle subscriptions
1507 * with the renderer-specific VisualElement.
1508 */
1509 handleChildMotionValue?(): void;
1510 /**
1511 * This method takes React props and returns found MotionValues. For example, HTML
1512 * MotionValues will be found within the style prop, whereas for Three.js within attribute arrays.
1513 *
1514 * This isn't an abstract method as it needs calling in the constructor, but it is
1515 * intended to be one.
1516 */
1517 scrapeMotionValuesFromProps(_props: MotionProps, _prevProps: MotionProps, _visualElement: VisualElement): {
1518 [key: string]: MotionValue | string | number;
1519 };
1520 /**
1521 * A reference to the current underlying Instance, e.g. a HTMLElement
1522 * or Three.Mesh etc.
1523 */
1524 current: Instance | null;
1525 /**
1526 * A reference to the parent VisualElement (if exists).
1527 */
1528 parent: VisualElement | undefined;
1529 /**
1530 * A set containing references to this VisualElement's children.
1531 */
1532 children: Set<VisualElement<unknown, unknown, {}>>;
1533 /**
1534 * The depth of this VisualElement within the overall VisualElement tree.
1535 */
1536 depth: number;
1537 /**
1538 * The current render state of this VisualElement. Defined by inherting VisualElements.
1539 */
1540 renderState: RenderState;
1541 /**
1542 * An object containing the latest static values for each of this VisualElement's
1543 * MotionValues.
1544 */
1545 latestValues: ResolvedValues;
1546 /**
1547 * Determine what role this visual element should take in the variant tree.
1548 */
1549 isVariantNode: boolean;
1550 isControllingVariants: boolean;
1551 /**
1552 * If this component is part of the variant tree, it should track
1553 * any children that are also part of the tree. This is essentially
1554 * a shadow tree to simplify logic around how to stagger over children.
1555 */
1556 variantChildren?: Set<VisualElement>;
1557 /**
1558 * Decides whether this VisualElement should animate in reduced motion
1559 * mode.
1560 *
1561 * TODO: This is currently set on every individual VisualElement but feels
1562 * like it could be set globally.
1563 */
1564 shouldReduceMotion: boolean | null;
1565 /**
1566 * Normally, if a component is controlled by a parent's variants, it can
1567 * rely on that ancestor to trigger animations further down the tree.
1568 * However, if a component is created after its parent is mounted, the parent
1569 * won't trigger that mount animation so the child needs to.
1570 *
1571 * TODO: This might be better replaced with a method isParentMounted
1572 */
1573 manuallyAnimateOnMount: boolean;
1574 /**
1575 * This can be set by AnimatePresence to force components that mount
1576 * at the same time as it to mount as if they have initial={false} set.
1577 */
1578 blockInitialAnimation: boolean;
1579 /**
1580 * A reference to this VisualElement's projection node, used in layout animations.
1581 */
1582 projection?: IProjectionNode;
1583 /**
1584 * A map of all motion values attached to this visual element. Motion
1585 * values are source of truth for any given animated value. A motion
1586 * value might be provided externally by the component via props.
1587 */
1588 values: Map<string, MotionValue<any>>;
1589 /**
1590 * The AnimationState, this is hydrated by the animation Feature.
1591 */
1592 animationState?: AnimationState$1;
1593 KeyframeResolver: typeof KeyframeResolver;
1594 /**
1595 * The options used to create this VisualElement. The Options type is defined
1596 * by the inheriting VisualElement and is passed straight through to the render functions.
1597 */
1598 readonly options: Options;
1599 /**
1600 * A reference to the latest props provided to the VisualElement's host React component.
1601 */
1602 props: MotionProps;
1603 prevProps?: MotionProps;
1604 presenceContext: PresenceContextProps | null;
1605 prevPresenceContext?: PresenceContextProps | null;
1606 /**
1607 * Cleanup functions for active features (hover/tap/exit etc)
1608 */
1609 private features;
1610 /**
1611 * A map of every subscription that binds the provided or generated
1612 * motion values onChange listeners to this visual element.
1613 */
1614 private valueSubscriptions;
1615 /**
1616 * A reference to the ReducedMotionConfig passed to the VisualElement's host React component.
1617 */
1618 private reducedMotionConfig;
1619 /**
1620 * On mount, this will be hydrated with a callback to disconnect
1621 * this visual element from its parent on unmount.
1622 */
1623 private removeFromVariantTree;
1624 /**
1625 * A reference to the previously-provided motion values as returned
1626 * from scrapeMotionValuesFromProps. We use the keys in here to determine
1627 * if any motion values need to be removed after props are updated.
1628 */
1629 private prevMotionValues;
1630 /**
1631 * When values are removed from all animation props we need to search
1632 * for a fallback value to animate to. These values are tracked in baseTarget.
1633 */
1634 private baseTarget;
1635 /**
1636 * Create an object of the values we initially animated from (if initial prop present).
1637 */
1638 private initialValues;
1639 /**
1640 * An object containing a SubscriptionManager for each active event.
1641 */
1642 private events;
1643 /**
1644 * An object containing an unsubscribe function for each prop event subscription.
1645 * For example, every "Update" event can have multiple subscribers via
1646 * VisualElement.on(), but only one of those can be defined via the onUpdate prop.
1647 */
1648 private propEventSubscriptions;
1649 constructor({ parent, props, presenceContext, reducedMotionConfig, blockInitialAnimation, visualState, }: VisualElementOptions<Instance, RenderState>, options?: Options);
1650 mount(instance: Instance): void;
1651 unmount(): void;
1652 private bindToMotionValue;
1653 sortNodePosition(other: VisualElement<Instance>): number;
1654 updateFeatures(): void;
1655 notifyUpdate: () => void;
1656 triggerBuild(): void;
1657 render: () => void;
1658 private isRenderScheduled;
1659 scheduleRender: () => void;
1660 /**
1661 * Measure the current viewport box with or without transforms.
1662 * Only measures axis-aligned boxes, rotate and skew must be manually
1663 * removed with a re-render to work.
1664 */
1665 measureViewportBox(): Box;
1666 getStaticValue(key: string): string | number;
1667 setStaticValue(key: string, value: string | number): void;
1668 /**
1669 * Update the provided props. Ensure any newly-added motion values are
1670 * added to our map, old ones removed, and listeners updated.
1671 */
1672 update(props: MotionProps, presenceContext: PresenceContextProps | null): void;
1673 getProps(): MotionProps;
1674 /**
1675 * Returns the variant definition with a given name.
1676 */
1677 getVariant(name: string): Variant | undefined;
1678 /**
1679 * Returns the defined default transition on this component.
1680 */
1681 getDefaultTransition(): Transition$1 | undefined;
1682 getTransformPagePoint(): any;
1683 getClosestVariantNode(): VisualElement | undefined;
1684 getVariantContext(startAtParent?: boolean): undefined | VariantStateContext;
1685 /**
1686 * Add a child visual element to our set of children.
1687 */
1688 addVariantChild(child: VisualElement): (() => boolean) | undefined;
1689 /**
1690 * Add a motion value and bind it to this visual element.
1691 */
1692 addValue(key: string, value: MotionValue): void;
1693 /**
1694 * Remove a motion value and unbind any active subscriptions.
1695 */
1696 removeValue(key: string): void;
1697 /**
1698 * Check whether we have a motion value for this key
1699 */
1700 hasValue(key: string): boolean;
1701 /**
1702 * Get a motion value for this key. If called with a default
1703 * value, we'll create one if none exists.
1704 */
1705 getValue(key: string): MotionValue | undefined;
1706 getValue(key: string, defaultValue: string | number | null): MotionValue;
1707 /**
1708 * If we're trying to animate to a previously unencountered value,
1709 * we need to check for it in our state and as a last resort read it
1710 * directly from the instance (which might have performance implications).
1711 */
1712 readValue(key: string, target?: string | number | null): any;
1713 /**
1714 * Set the base target to later animate back to. This is currently
1715 * only hydrated on creation and when we first read a value.
1716 */
1717 setBaseTarget(key: string, value: string | number): void;
1718 /**
1719 * Find the base target for a value thats been removed from all animation
1720 * props.
1721 */
1722 getBaseTarget(key: string): ResolvedValues[string] | undefined | null;
1723 on<EventName extends keyof VisualElementEventCallbacks>(eventName: EventName, callback: VisualElementEventCallbacks[EventName]): VoidFunction;
1724 notify<EventName extends keyof VisualElementEventCallbacks>(eventName: EventName, ...args: any): void;
1725}
1726
1727type UnresolvedKeyframes<T extends string | number> = Array<T | null>;
1728type ResolvedKeyframes<T extends string | number> = Array<T>;
1729type OnKeyframesResolved<T extends string | number> = (resolvedKeyframes: ResolvedKeyframes<T>, finalKeyframe: T) => void;
1730declare class KeyframeResolver<T extends string | number = any> {
1731 name?: string;
1732 element?: VisualElement<any>;
1733 finalKeyframe?: T;
1734 suspendedScrollY?: number;
1735 protected unresolvedKeyframes: UnresolvedKeyframes<string | number>;
1736 private motionValue?;
1737 private onComplete;
1738 /**
1739 * Track whether this resolver has completed. Once complete, it never
1740 * needs to attempt keyframe resolution again.
1741 */
1742 private isComplete;
1743 /**
1744 * Track whether this resolver is async. If it is, it'll be added to the
1745 * resolver queue and flushed in the next frame. Resolvers that aren't going
1746 * to trigger read/write thrashing don't need to be async.
1747 */
1748 private isAsync;
1749 /**
1750 * Track whether this resolver needs to perform a measurement
1751 * to resolve its keyframes.
1752 */
1753 needsMeasurement: boolean;
1754 /**
1755 * Track whether this resolver is currently scheduled to resolve
1756 * to allow it to be cancelled and resumed externally.
1757 */
1758 isScheduled: boolean;
1759 constructor(unresolvedKeyframes: UnresolvedKeyframes<string | number>, onComplete: OnKeyframesResolved<T>, name?: string, motionValue?: MotionValue<T>, element?: VisualElement<any>, isAsync?: boolean);
1760 scheduleResolve(): void;
1761 readKeyframes(): void;
1762 setFinalKeyframe(): void;
1763 measureInitialState(): void;
1764 renderEndStyles(): void;
1765 measureEndState(): void;
1766 complete(): void;
1767 cancel(): void;
1768 resume(): void;
1769}
1770
1771interface AnimationPlaybackLifecycles<V> {
1772 onUpdate?: (latest: V) => void;
1773 onPlay?: () => void;
1774 onComplete?: () => void;
1775 onRepeat?: () => void;
1776 onStop?: () => void;
1777}
1778interface Transition extends AnimationPlaybackOptions, Omit<SpringOptions, "keyframes">, Omit<InertiaOptions$1, "keyframes">, KeyframeOptions {
1779 delay?: number;
1780 elapsed?: number;
1781 driver?: Driver;
1782 type?: "decay" | "spring" | "keyframes" | "tween" | "inertia";
1783 duration?: number;
1784 autoplay?: boolean;
1785}
1786interface ValueAnimationTransition<V = any> extends Transition, AnimationPlaybackLifecycles<V> {
1787}
1788type ResolveKeyframes<V extends string | number> = (keyframes: V[], onComplete: OnKeyframesResolved<V>, name?: string, motionValue?: any) => KeyframeResolver<V>;
1789interface ValueAnimationOptions<V extends string | number = number> extends ValueAnimationTransition {
1790 keyframes: V[];
1791 KeyframeResolver?: typeof KeyframeResolver;
1792 name?: string;
1793 motionValue?: MotionValue<V>;
1794 from?: V;
1795 isGenerator?: boolean;
1796}
1797interface AnimationScope<T = any> {
1798 readonly current: T;
1799 animations: AnimationPlaybackControls[];
1800}
1801type StyleTransitions = {
1802 [K in keyof CSSStyleDeclarationWithTransform]?: Transition;
1803};
1804type SVGPathTransitions = {
1805 [K in keyof SVGPathProperties]: Transition;
1806};
1807type SVGTransitions = {
1808 [K in keyof SVGAttributes]: Transition;
1809};
1810type VariableTransitions = {
1811 [key: `--${string}`]: Transition;
1812};
1813type AnimationOptionsWithValueOverrides<V = any> = StyleTransitions & SVGPathTransitions & SVGTransitions & VariableTransitions & ValueAnimationTransition<V>;
1814interface DynamicAnimationOptions extends Omit<AnimationOptionsWithValueOverrides, "delay"> {
1815 delay?: number | DynamicOption<number>;
1816}
1817type ElementOrSelector = Element | Element[] | NodeListOf<Element> | string;
1818/**
1819 * @public
1820 */
1821interface AnimationPlaybackControls {
1822 time: number;
1823 speed: number;
1824 state?: AnimationPlayState;
1825 duration: number;
1826 stop: () => void;
1827 play: () => void;
1828 pause: () => void;
1829 complete: () => void;
1830 cancel: () => void;
1831 then: (onResolve: VoidFunction, onReject?: VoidFunction) => Promise<void>;
1832 attachTimeline?: (timeline: ProgressTimeline) => VoidFunction;
1833}
1834type DynamicOption<T> = (i: number, total: number) => T;
1835interface CSSStyleDeclarationWithTransform extends Omit<CSSStyleDeclaration, "direction" | "transition" | "x" | "y" | "z"> {
1836 x: number | string;
1837 y: number | string;
1838 z: number | string;
1839 rotateX: number | string;
1840 rotateY: number | string;
1841 rotateZ: number | string;
1842 scaleX: number;
1843 scaleY: number;
1844 scaleZ: number;
1845 skewX: number | string;
1846 skewY: number | string;
1847}
1848type ValueKeyframe = string | number;
1849type UnresolvedValueKeyframe = ValueKeyframe | null;
1850type ValueKeyframesDefinition = ValueKeyframe | ValueKeyframe[] | UnresolvedValueKeyframe[];
1851type StyleKeyframesDefinition = {
1852 [K in keyof CSSStyleDeclarationWithTransform]?: ValueKeyframesDefinition;
1853};
1854type SVGKeyframesDefinition = {
1855 [K in keyof SVGAttributes]?: ValueKeyframesDefinition;
1856};
1857type VariableKeyframesDefinition = {
1858 [key: `--${string}`]: ValueKeyframesDefinition;
1859};
1860type SVGPathKeyframesDefinition = {
1861 [K in keyof SVGPathProperties]?: ValueKeyframesDefinition;
1862};
1863type DOMKeyframesDefinition = StyleKeyframesDefinition & SVGKeyframesDefinition & SVGPathKeyframesDefinition & VariableKeyframesDefinition;
1864interface VelocityOptions {
1865 velocity?: number;
1866 restSpeed?: number;
1867 restDelta?: number;
1868}
1869type RepeatType = "loop" | "reverse" | "mirror";
1870interface AnimationPlaybackOptions {
1871 repeat?: number;
1872 repeatType?: RepeatType;
1873 repeatDelay?: number;
1874}
1875interface DurationSpringOptions {
1876 duration?: number;
1877 bounce?: number;
1878}
1879interface SpringOptions extends DurationSpringOptions, VelocityOptions {
1880 stiffness?: number;
1881 damping?: number;
1882 mass?: number;
1883}
1884interface DecayOptions extends VelocityOptions {
1885 keyframes?: number[];
1886 power?: number;
1887 timeConstant?: number;
1888 modifyTarget?: (v: number) => number;
1889}
1890interface InertiaOptions$1 extends DecayOptions {
1891 bounceStiffness?: number;
1892 bounceDamping?: number;
1893 min?: number;
1894 max?: number;
1895}
1896interface KeyframeOptions {
1897 ease?: Easing | Easing[];
1898 times?: number[];
1899}
1900type AnimationDefinition = VariantLabels | TargetAndTransition | TargetResolver;
1901/**
1902 * @public
1903 */
1904interface AnimationControls {
1905 /**
1906 * Starts an animation on all linked components.
1907 *
1908 * @remarks
1909 *
1910 * ```jsx
1911 * controls.start("variantLabel")
1912 * controls.start({
1913 * x: 0,
1914 * transition: { duration: 1 }
1915 * })
1916 * ```
1917 *
1918 * @param definition - Properties or variant label to animate to
1919 * @param transition - Optional `transtion` to apply to a variant
1920 * @returns - A `Promise` that resolves when all animations have completed.
1921 *
1922 * @public
1923 */
1924 start(definition: AnimationDefinition, transitionOverride?: Transition): Promise<any>;
1925 /**
1926 * Instantly set to a set of properties or a variant.
1927 *
1928 * ```jsx
1929 * // With properties
1930 * controls.set({ opacity: 0 })
1931 *
1932 * // With variants
1933 * controls.set("hidden")
1934 * ```
1935 *
1936 * @privateRemarks
1937 * We could perform a similar trick to `.start` where this can be called before mount
1938 * and we maintain a list of of pending actions that get applied on mount. But the
1939 * expectation of `set` is that it happens synchronously and this would be difficult
1940 * to do before any children have even attached themselves. It's also poor practise
1941 * and we should discourage render-synchronous `.start` calls rather than lean into this.
1942 *
1943 * @public
1944 */
1945 set(definition: AnimationDefinition): void;
1946 /**
1947 * Stops animations on all linked components.
1948 *
1949 * ```jsx
1950 * controls.stop()
1951 * ```
1952 *
1953 * @public
1954 */
1955 stop(): void;
1956 mount(): () => void;
1957}
1958
1959/**
1960 * @public
1961 */
1962type Subscriber<T> = (v: T) => void;
1963/**
1964 * @public
1965 */
1966type PassiveEffect<T> = (v: T, safeSetter: (v: T) => void) => void;
1967interface MotionValueEventCallbacks<V> {
1968 animationStart: () => void;
1969 animationComplete: () => void;
1970 animationCancel: () => void;
1971 change: (latestValue: V) => void;
1972 renderRequest: () => void;
1973}
1974interface ResolvedValues$1 {
1975 [key: string]: string | number;
1976}
1977interface Owner {
1978 current: HTMLElement | unknown;
1979 getProps: () => {
1980 onUpdate?: (latest: ResolvedValues$1) => void;
1981 };
1982}
1983interface MotionValueOptions {
1984 owner?: Owner;
1985}
1986/**
1987 * `MotionValue` is used to track the state and velocity of motion values.
1988 *
1989 * @public
1990 */
1991declare class MotionValue<V = any> {
1992 /**
1993 * This will be replaced by the build step with the latest version number.
1994 * When MotionValues are provided to motion components, warn if versions are mixed.
1995 */
1996 version: string;
1997 /**
1998 * If a MotionValue has an owner, it was created internally within Framer Motion
1999 * and therefore has no external listeners. It is therefore safe to animate via WAAPI.
2000 */
2001 owner?: Owner;
2002 /**
2003 * The current state of the `MotionValue`.
2004 */
2005 private current;
2006 /**
2007 * The previous state of the `MotionValue`.
2008 */
2009 private prev;
2010 /**
2011 * The previous state of the `MotionValue` at the end of the previous frame.
2012 */
2013 private prevFrameValue;
2014 /**
2015 * The last time the `MotionValue` was updated.
2016 */
2017 private updatedAt;
2018 /**
2019 * The time `prevFrameValue` was updated.
2020 */
2021 private prevUpdatedAt;
2022 private stopPassiveEffect?;
2023 /**
2024 * A reference to the currently-controlling animation.
2025 */
2026 animation?: AnimationPlaybackControls;
2027 setCurrent(current: V): void;
2028 setPrevFrameValue(prevFrameValue?: V | undefined): void;
2029 /**
2030 * Adds a function that will be notified when the `MotionValue` is updated.
2031 *
2032 * It returns a function that, when called, will cancel the subscription.
2033 *
2034 * When calling `onChange` inside a React component, it should be wrapped with the
2035 * `useEffect` hook. As it returns an unsubscribe function, this should be returned
2036 * from the `useEffect` function to ensure you don't add duplicate subscribers..
2037 *
2038 * ```jsx
2039 * export const MyComponent = () => {
2040 * const x = useMotionValue(0)
2041 * const y = useMotionValue(0)
2042 * const opacity = useMotionValue(1)
2043 *
2044 * useEffect(() => {
2045 * function updateOpacity() {
2046 * const maxXY = Math.max(x.get(), y.get())
2047 * const newOpacity = transform(maxXY, [0, 100], [1, 0])
2048 * opacity.set(newOpacity)
2049 * }
2050 *
2051 * const unsubscribeX = x.on("change", updateOpacity)
2052 * const unsubscribeY = y.on("change", updateOpacity)
2053 *
2054 * return () => {
2055 * unsubscribeX()
2056 * unsubscribeY()
2057 * }
2058 * }, [])
2059 *
2060 * return <motion.div style={{ x }} />
2061 * }
2062 * ```
2063 *
2064 * @param subscriber - A function that receives the latest value.
2065 * @returns A function that, when called, will cancel this subscription.
2066 *
2067 * @deprecated
2068 */
2069 onChange(subscription: Subscriber<V>): () => void;
2070 /**
2071 * An object containing a SubscriptionManager for each active event.
2072 */
2073 private events;
2074 on<EventName extends keyof MotionValueEventCallbacks<V>>(eventName: EventName, callback: MotionValueEventCallbacks<V>[EventName]): VoidFunction;
2075 clearListeners(): void;
2076 /**
2077 * Sets the state of the `MotionValue`.
2078 *
2079 * @remarks
2080 *
2081 * ```jsx
2082 * const x = useMotionValue(0)
2083 * x.set(10)
2084 * ```
2085 *
2086 * @param latest - Latest value to set.
2087 * @param render - Whether to notify render subscribers. Defaults to `true`
2088 *
2089 * @public
2090 */
2091 set(v: V, render?: boolean): void;
2092 setWithVelocity(prev: V, current: V, delta: number): void;
2093 /**
2094 * Set the state of the `MotionValue`, stopping any active animations,
2095 * effects, and resets velocity to `0`.
2096 */
2097 jump(v: V, endAnimation?: boolean): void;
2098 updateAndNotify: (v: V, render?: boolean) => void;
2099 /**
2100 * Returns the latest state of `MotionValue`
2101 *
2102 * @returns - The latest state of `MotionValue`
2103 *
2104 * @public
2105 */
2106 get(): NonNullable<V>;
2107 /**
2108 * @public
2109 */
2110 getPrevious(): V | undefined;
2111 /**
2112 * Returns the latest velocity of `MotionValue`
2113 *
2114 * @returns - The latest velocity of `MotionValue`. Returns `0` if the state is non-numerical.
2115 *
2116 * @public
2117 */
2118 getVelocity(): number;
2119 hasAnimated: boolean;
2120 /**
2121 * Stop the currently active animation.
2122 *
2123 * @public
2124 */
2125 stop(): void;
2126 /**
2127 * Returns `true` if this value is currently animating.
2128 *
2129 * @public
2130 */
2131 isAnimating(): boolean;
2132 private clearAnimation;
2133 /**
2134 * Destroy and clean up subscribers to this `MotionValue`.
2135 *
2136 * The `MotionValue` hooks like `useMotionValue` and `useTransform` automatically
2137 * handle the lifecycle of the returned `MotionValue`, so this method is only necessary if you've manually
2138 * created a `MotionValue` via the `motionValue` function.
2139 *
2140 * @public
2141 */
2142 destroy(): void;
2143}
2144declare function motionValue<V>(init: V, options?: MotionValueOptions): MotionValue<V>;
2145
2146type RefObject<T> = {
2147 current: T | null;
2148};
2149
2150/**
2151 * Passed in to pan event handlers like `onPan` the `PanInfo` object contains
2152 * information about the current state of the tap gesture such as its
2153 * `point`, `delta`, `offset` and `velocity`.
2154 *
2155 * ```jsx
2156 * <motion.div onPan={(event, info) => {
2157 * console.log(info.point.x, info.point.y)
2158 * }} />
2159 * ```
2160 *
2161 * @public
2162 */
2163interface PanInfo {
2164 /**
2165 * Contains `x` and `y` values for the current pan position relative
2166 * to the device or page.
2167 *
2168 * ```jsx
2169 * function onPan(event, info) {
2170 * console.log(info.point.x, info.point.y)
2171 * }
2172 *
2173 * <motion.div onPan={onPan} />
2174 * ```
2175 *
2176 * @public
2177 */
2178 point: Point;
2179 /**
2180 * Contains `x` and `y` values for the distance moved since
2181 * the last event.
2182 *
2183 * ```jsx
2184 * function onPan(event, info) {
2185 * console.log(info.delta.x, info.delta.y)
2186 * }
2187 *
2188 * <motion.div onPan={onPan} />
2189 * ```
2190 *
2191 * @public
2192 */
2193 delta: Point;
2194 /**
2195 * Contains `x` and `y` values for the distance moved from
2196 * the first pan event.
2197 *
2198 * ```jsx
2199 * function onPan(event, info) {
2200 * console.log(info.offset.x, info.offset.y)
2201 * }
2202 *
2203 * <motion.div onPan={onPan} />
2204 * ```
2205 *
2206 * @public
2207 */
2208 offset: Point;
2209 /**
2210 * Contains `x` and `y` values for the current velocity of the pointer, in px/ms.
2211 *
2212 * ```jsx
2213 * function onPan(event, info) {
2214 * console.log(info.velocity.x, info.velocity.y)
2215 * }
2216 *
2217 * <motion.div onPan={onPan} />
2218 * ```
2219 *
2220 * @public
2221 */
2222 velocity: Point;
2223}
2224
2225interface DragControlOptions {
2226 snapToCursor?: boolean;
2227 cursorProgress?: Point;
2228}
2229
2230/**
2231 * Can manually trigger a drag gesture on one or more `drag`-enabled `motion` components.
2232 *
2233 * ```jsx
2234 * const dragControls = useDragControls()
2235 *
2236 * function startDrag(event) {
2237 * dragControls.start(event, { snapToCursor: true })
2238 * }
2239 *
2240 * return (
2241 * <>
2242 * <div onPointerDown={startDrag} />
2243 * <motion.div drag="x" dragControls={dragControls} />
2244 * </>
2245 * )
2246 * ```
2247 *
2248 * @public
2249 */
2250declare class DragControls {
2251 private componentControls;
2252 /**
2253 * Start a drag gesture on every `motion` component that has this set of drag controls
2254 * passed into it via the `dragControls` prop.
2255 *
2256 * ```jsx
2257 * dragControls.start(e, {
2258 * snapToCursor: true
2259 * })
2260 * ```
2261 *
2262 * @param event - PointerEvent
2263 * @param options - Options
2264 *
2265 * @public
2266 */
2267 start(event: react.PointerEvent | PointerEvent, options?: DragControlOptions): void;
2268}
2269/**
2270 * Usually, dragging is initiated by pressing down on a `motion` component with a `drag` prop
2271 * and moving it. For some use-cases, for instance clicking at an arbitrary point on a video scrubber, we
2272 * might want to initiate that dragging from a different component than the draggable one.
2273 *
2274 * By creating a `dragControls` using the `useDragControls` hook, we can pass this into
2275 * the draggable component's `dragControls` prop. It exposes a `start` method
2276 * that can start dragging from pointer events on other components.
2277 *
2278 * ```jsx
2279 * const dragControls = useDragControls()
2280 *
2281 * function startDrag(event) {
2282 * dragControls.start(event, { snapToCursor: true })
2283 * }
2284 *
2285 * return (
2286 * <>
2287 * <div onPointerDown={startDrag} />
2288 * <motion.div drag="x" dragControls={dragControls} />
2289 * </>
2290 * )
2291 * ```
2292 *
2293 * @public
2294 */
2295declare function useDragControls(): DragControls;
2296
2297type DragElastic = boolean | number | Partial<BoundingBox>;
2298/**
2299 * @public
2300 */
2301interface DragHandlers {
2302 /**
2303 * Callback function that fires when dragging starts.
2304 *
2305 * ```jsx
2306 * <motion.div
2307 * drag
2308 * onDragStart={
2309 * (event, info) => console.log(info.point.x, info.point.y)
2310 * }
2311 * />
2312 * ```
2313 *
2314 * @public
2315 */
2316 onDragStart?(event: MouseEvent | TouchEvent | PointerEvent, info: PanInfo): void;
2317 /**
2318 * Callback function that fires when dragging ends.
2319 *
2320 * ```jsx
2321 * <motion.div
2322 * drag
2323 * onDragEnd={
2324 * (event, info) => console.log(info.point.x, info.point.y)
2325 * }
2326 * />
2327 * ```
2328 *
2329 * @public
2330 */
2331 onDragEnd?(event: MouseEvent | TouchEvent | PointerEvent, info: PanInfo): void;
2332 /**
2333 * Callback function that fires when the component is dragged.
2334 *
2335 * ```jsx
2336 * <motion.div
2337 * drag
2338 * onDrag={
2339 * (event, info) => console.log(info.point.x, info.point.y)
2340 * }
2341 * />
2342 * ```
2343 *
2344 * @public
2345 */
2346 onDrag?(event: MouseEvent | TouchEvent | PointerEvent, info: PanInfo): void;
2347 /**
2348 * Callback function that fires a drag direction is determined.
2349 *
2350 * ```jsx
2351 * <motion.div
2352 * drag
2353 * dragDirectionLock
2354 * onDirectionLock={axis => console.log(axis)}
2355 * />
2356 * ```
2357 *
2358 * @public
2359 */
2360 onDirectionLock?(axis: "x" | "y"): void;
2361 /**
2362 * Callback function that fires when drag momentum/bounce transition finishes.
2363 *
2364 * ```jsx
2365 * <motion.div
2366 * drag
2367 * onDragTransitionEnd={() => console.log('Drag transition complete')}
2368 * />
2369 * ```
2370 *
2371 * @public
2372 */
2373 onDragTransitionEnd?(): void;
2374}
2375/**
2376 * @public
2377 */
2378type InertiaOptions = Partial<Omit<Inertia, "velocity" | "type">>;
2379/**
2380 * @public
2381 */
2382interface DraggableProps extends DragHandlers {
2383 /**
2384 * Enable dragging for this element. Set to `false` by default.
2385 * Set `true` to drag in both directions.
2386 * Set `"x"` or `"y"` to only drag in a specific direction.
2387 *
2388 * ```jsx
2389 * <motion.div drag="x" />
2390 * ```
2391 */
2392 drag?: boolean | "x" | "y";
2393 /**
2394 * Properties or variant label to animate to while the drag gesture is recognised.
2395 *
2396 * ```jsx
2397 * <motion.div whileDrag={{ scale: 1.2 }} />
2398 * ```
2399 */
2400 whileDrag?: VariantLabels | TargetAndTransition;
2401 /**
2402 * If `true`, this will lock dragging to the initially-detected direction. Defaults to `false`.
2403 *
2404 * ```jsx
2405 * <motion.div drag dragDirectionLock />
2406 * ```
2407 */
2408 dragDirectionLock?: boolean;
2409 /**
2410 * Allows drag gesture propagation to child components. Set to `false` by
2411 * default.
2412 *
2413 * ```jsx
2414 * <motion.div drag="x" dragPropagation />
2415 * ```
2416 */
2417 dragPropagation?: boolean;
2418 /**
2419 * Applies constraints on the permitted draggable area.
2420 *
2421 * It can accept an object of optional `top`, `left`, `right`, and `bottom` values, measured in pixels.
2422 * This will define a distance the named edge of the draggable component.
2423 *
2424 * Alternatively, it can accept a `ref` to another component created with React's `useRef` hook.
2425 * This `ref` should be passed both to the draggable component's `dragConstraints` prop, and the `ref`
2426 * of the component you want to use as constraints.
2427 *
2428 * ```jsx
2429 * // In pixels
2430 * <motion.div
2431 * drag="x"
2432 * dragConstraints={{ left: 0, right: 300 }}
2433 * />
2434 *
2435 * // As a ref to another component
2436 * const MyComponent = () => {
2437 * const constraintsRef = useRef(null)
2438 *
2439 * return (
2440 * <motion.div ref={constraintsRef}>
2441 * <motion.div drag dragConstraints={constraintsRef} />
2442 * </motion.div>
2443 * )
2444 * }
2445 * ```
2446 */
2447 dragConstraints?: false | Partial<BoundingBox> | RefObject<Element>;
2448 /**
2449 * The degree of movement allowed outside constraints. 0 = no movement, 1 =
2450 * full movement.
2451 *
2452 * Set to `0.5` by default. Can also be set as `false` to disable movement.
2453 *
2454 * By passing an object of `top`/`right`/`bottom`/`left`, individual values can be set
2455 * per constraint. Any missing values will be set to `0`.
2456 *
2457 * ```jsx
2458 * <motion.div
2459 * drag
2460 * dragConstraints={{ left: 0, right: 300 }}
2461 * dragElastic={0.2}
2462 * />
2463 * ```
2464 */
2465 dragElastic?: DragElastic;
2466 /**
2467 * Apply momentum from the pan gesture to the component when dragging
2468 * finishes. Set to `true` by default.
2469 *
2470 * ```jsx
2471 * <motion.div
2472 * drag
2473 * dragConstraints={{ left: 0, right: 300 }}
2474 * dragMomentum={false}
2475 * />
2476 * ```
2477 */
2478 dragMomentum?: boolean;
2479 /**
2480 * Allows you to change dragging inertia parameters.
2481 * When releasing a draggable Frame, an animation with type `inertia` starts. The animation is based on your dragging velocity. This property allows you to customize it.
2482 * See {@link https://framer.com/api/animation/#inertia | Inertia} for all properties you can use.
2483 *
2484 * ```jsx
2485 * <motion.div
2486 * drag
2487 * dragTransition={{ bounceStiffness: 600, bounceDamping: 10 }}
2488 * />
2489 * ```
2490 */
2491 dragTransition?: InertiaOptions;
2492 /**
2493 * Usually, dragging is initiated by pressing down on a component and moving it. For some
2494 * use-cases, for instance clicking at an arbitrary point on a video scrubber, we
2495 * might want to initiate dragging from a different component than the draggable one.
2496 *
2497 * By creating a `dragControls` using the `useDragControls` hook, we can pass this into
2498 * the draggable component's `dragControls` prop. It exposes a `start` method
2499 * that can start dragging from pointer events on other components.
2500 *
2501 * ```jsx
2502 * const dragControls = useDragControls()
2503 *
2504 * function startDrag(event) {
2505 * dragControls.start(event, { snapToCursor: true })
2506 * }
2507 *
2508 * return (
2509 * <>
2510 * <div onPointerDown={startDrag} />
2511 * <motion.div drag="x" dragControls={dragControls} />
2512 * </>
2513 * )
2514 * ```
2515 */
2516 dragControls?: DragControls;
2517 /**
2518 * If true, element will snap back to its origin when dragging ends.
2519 *
2520 * Enabling this is the equivalent of setting all `dragConstraints` axes to `0`
2521 * with `dragElastic={1}`, but when used together `dragConstraints` can define
2522 * a wider draggable area and `dragSnapToOrigin` will ensure the element
2523 * animates back to its origin on release.
2524 */
2525 dragSnapToOrigin?: boolean;
2526 /**
2527 * By default, if `drag` is defined on a component then an event listener will be attached
2528 * to automatically initiate dragging when a user presses down on it.
2529 *
2530 * By setting `dragListener` to `false`, this event listener will not be created.
2531 *
2532 * ```jsx
2533 * const dragControls = useDragControls()
2534 *
2535 * function startDrag(event) {
2536 * dragControls.start(event, { snapToCursor: true })
2537 * }
2538 *
2539 * return (
2540 * <>
2541 * <div onPointerDown={startDrag} />
2542 * <motion.div
2543 * drag="x"
2544 * dragControls={dragControls}
2545 * dragListener={false}
2546 * />
2547 * </>
2548 * )
2549 * ```
2550 */
2551 dragListener?: boolean;
2552 /**
2553 * If `dragConstraints` is set to a React ref, this callback will call with the measured drag constraints.
2554 *
2555 * @public
2556 */
2557 onMeasureDragConstraints?: (constraints: BoundingBox) => BoundingBox | void;
2558 /**
2559 * Usually, dragging uses the layout project engine, and applies transforms to the underlying VisualElement.
2560 * Passing MotionValues as _dragX and _dragY instead applies drag updates to these motion values.
2561 * This allows you to manually control how updates from a drag gesture on an element is applied.
2562 *
2563 * @public
2564 */
2565 _dragX?: MotionValue<number>;
2566 /**
2567 * Usually, dragging uses the layout project engine, and applies transforms to the underlying VisualElement.
2568 * Passing MotionValues as _dragX and _dragY instead applies drag updates to these motion values.
2569 * This allows you to manually control how updates from a drag gesture on an element is applied.
2570 *
2571 * @public
2572 */
2573 _dragY?: MotionValue<number>;
2574}
2575
2576/**
2577 * @public
2578 */
2579interface LayoutProps {
2580 /**
2581 * If `true`, this component will automatically animate to its new position when
2582 * its layout changes.
2583 *
2584 * ```jsx
2585 * <motion.div layout />
2586 * ```
2587 *
2588 * This will perform a layout animation using performant transforms. Part of this technique
2589 * involved animating an element's scale. This can introduce visual distortions on children,
2590 * `boxShadow` and `borderRadius`.
2591 *
2592 * To correct distortion on immediate children, add `layout` to those too.
2593 *
2594 * `boxShadow` and `borderRadius` will automatically be corrected if they are already being
2595 * animated on this component. Otherwise, set them directly via the `initial` prop.
2596 *
2597 * If `layout` is set to `"position"`, the size of the component will change instantly and
2598 * only its position will animate. If `layout` is set to `"size"`, the position of the
2599 * component will change instantly but its size will animate.
2600 *
2601 * If `layout` is set to `"size"`, the position of the component will change instantly and
2602 * only its size will animate.
2603 *
2604 * If `layout` is set to `"preserve-aspect"`, the component will animate size & position if
2605 * the aspect ratio remains the same between renders, and just position if the ratio changes.
2606 *
2607 * @public
2608 */
2609 layout?: boolean | "position" | "size" | "preserve-aspect";
2610 /**
2611 * Enable shared layout transitions between different components with the same `layoutId`.
2612 *
2613 * When a component with a layoutId is removed from the React tree, and then
2614 * added elsewhere, it will visually animate from the previous component's bounding box
2615 * and its latest animated values.
2616 *
2617 * ```jsx
2618 * {items.map(item => (
2619 * <motion.li layout>
2620 * {item.name}
2621 * {item.isSelected && <motion.div layoutId="underline" />}
2622 * </motion.li>
2623 * ))}
2624 * ```
2625 *
2626 * If the previous component remains in the tree it will crossfade with the new component.
2627 *
2628 * @public
2629 */
2630 layoutId?: string;
2631 /**
2632 * A callback that will fire when a layout animation on this component starts.
2633 *
2634 * @public
2635 */
2636 onLayoutAnimationStart?(): void;
2637 /**
2638 * A callback that will fire when a layout animation on this component completes.
2639 *
2640 * @public
2641 */
2642 onLayoutAnimationComplete?(): void;
2643 /**
2644 * @public
2645 */
2646 layoutDependency?: any;
2647 /**
2648 * Whether a projection node should measure its scroll when it or its descendants update their layout.
2649 *
2650 * @public
2651 */
2652 layoutScroll?: boolean;
2653 /**
2654 * Whether an element should be considered a "layout root", where
2655 * all children will be forced to resolve relatively to it.
2656 * Currently used for `position: sticky` elements in Framer.
2657 */
2658 layoutRoot?: boolean;
2659 /**
2660 * Attached to a portal root to ensure we attach the child to the document root and don't
2661 * perform scale correction on it.
2662 */
2663 "data-framer-portal-id"?: string;
2664}
2665
2666/** @public */
2667interface EventInfo {
2668 point: Point;
2669}
2670
2671/**
2672 * @public
2673 */
2674interface FocusHandlers {
2675 /**
2676 * Properties or variant label to animate to while the focus gesture is recognised.
2677 *
2678 * ```jsx
2679 * <motion.input whileFocus={{ scale: 1.2 }} />
2680 * ```
2681 */
2682 whileFocus?: VariantLabels | TargetAndTransition;
2683}
2684/**
2685 * Passed in to tap event handlers like `onTap` the `TapInfo` object contains
2686 * information about the tap gesture such as it‘s location.
2687 *
2688 * ```jsx
2689 * function onTap(event, info) {
2690 * console.log(info.point.x, info.point.y)
2691 * }
2692 *
2693 * <motion.div onTap={onTap} />
2694 * ```
2695 *
2696 * @public
2697 */
2698interface TapInfo {
2699 /**
2700 * Contains `x` and `y` values for the tap gesture relative to the
2701 * device or page.
2702 *
2703 * ```jsx
2704 * function onTapStart(event, info) {
2705 * console.log(info.point.x, info.point.y)
2706 * }
2707 *
2708 * <motion.div onTapStart={onTapStart} />
2709 * ```
2710 *
2711 * @public
2712 */
2713 point: Point;
2714}
2715/**
2716 * @public
2717 */
2718interface TapHandlers {
2719 /**
2720 * Callback when the tap gesture successfully ends on this element.
2721 *
2722 * ```jsx
2723 * function onTap(event, info) {
2724 * console.log(info.point.x, info.point.y)
2725 * }
2726 *
2727 * <motion.div onTap={onTap} />
2728 * ```
2729 *
2730 * @param event - The originating pointer event.
2731 * @param info - An {@link TapInfo} object containing `x` and `y` values for the `point` relative to the device or page.
2732 */
2733 onTap?(event: MouseEvent | TouchEvent | PointerEvent, info: TapInfo): void;
2734 /**
2735 * Callback when the tap gesture starts on this element.
2736 *
2737 * ```jsx
2738 * function onTapStart(event, info) {
2739 * console.log(info.point.x, info.point.y)
2740 * }
2741 *
2742 * <motion.div onTapStart={onTapStart} />
2743 * ```
2744 *
2745 * @param event - The originating pointer event.
2746 * @param info - An {@link TapInfo} object containing `x` and `y` values for the `point` relative to the device or page.
2747 */
2748 onTapStart?(event: MouseEvent | TouchEvent | PointerEvent, info: TapInfo): void;
2749 /**
2750 * Callback when the tap gesture ends outside this element.
2751 *
2752 * ```jsx
2753 * function onTapCancel(event, info) {
2754 * console.log(info.point.x, info.point.y)
2755 * }
2756 *
2757 * <motion.div onTapCancel={onTapCancel} />
2758 * ```
2759 *
2760 * @param event - The originating pointer event.
2761 * @param info - An {@link TapInfo} object containing `x` and `y` values for the `point` relative to the device or page.
2762 */
2763 onTapCancel?(event: MouseEvent | TouchEvent | PointerEvent, info: TapInfo): void;
2764 /**
2765 * Properties or variant label to animate to while the component is pressed.
2766 *
2767 * ```jsx
2768 * <motion.div whileTap={{ scale: 0.8 }} />
2769 * ```
2770 */
2771 whileTap?: VariantLabels | TargetAndTransition;
2772 /**
2773 * If `true`, the tap gesture will attach its start listener to window.
2774 *
2775 * Note: This is not supported publically.
2776 */
2777 globalTapTarget?: boolean;
2778}
2779/**
2780 * @public
2781 */
2782interface PanHandlers {
2783 /**
2784 * Callback function that fires when the pan gesture is recognised on this element.
2785 *
2786 * **Note:** For pan gestures to work correctly with touch input, the element needs
2787 * touch scrolling to be disabled on either x/y or both axis with the
2788 * [touch-action](https://developer.mozilla.org/en-US/docs/Web/CSS/touch-action) CSS rule.
2789 *
2790 * ```jsx
2791 * function onPan(event, info) {
2792 * console.log(info.point.x, info.point.y)
2793 * }
2794 *
2795 * <motion.div onPan={onPan} />
2796 * ```
2797 *
2798 * @param event - The originating pointer event.
2799 * @param info - A {@link PanInfo} object containing `x` and `y` values for:
2800 *
2801 * - `point`: Relative to the device or page.
2802 * - `delta`: Distance moved since the last event.
2803 * - `offset`: Offset from the original pan event.
2804 * - `velocity`: Current velocity of the pointer.
2805 */
2806 onPan?(event: PointerEvent, info: PanInfo): void;
2807 /**
2808 * Callback function that fires when the pan gesture begins on this element.
2809 *
2810 * ```jsx
2811 * function onPanStart(event, info) {
2812 * console.log(info.point.x, info.point.y)
2813 * }
2814 *
2815 * <motion.div onPanStart={onPanStart} />
2816 * ```
2817 *
2818 * @param event - The originating pointer event.
2819 * @param info - A {@link PanInfo} object containing `x`/`y` values for:
2820 *
2821 * - `point`: Relative to the device or page.
2822 * - `delta`: Distance moved since the last event.
2823 * - `offset`: Offset from the original pan event.
2824 * - `velocity`: Current velocity of the pointer.
2825 */
2826 onPanStart?(event: PointerEvent, info: PanInfo): void;
2827 /**
2828 * Callback function that fires when we begin detecting a pan gesture. This
2829 * is analogous to `onMouseStart` or `onTouchStart`.
2830 *
2831 * ```jsx
2832 * function onPanSessionStart(event, info) {
2833 * console.log(info.point.x, info.point.y)
2834 * }
2835 *
2836 * <motion.div onPanSessionStart={onPanSessionStart} />
2837 * ```
2838 *
2839 * @param event - The originating pointer event.
2840 * @param info - An {@link EventInfo} object containing `x`/`y` values for:
2841 *
2842 * - `point`: Relative to the device or page.
2843 */
2844 onPanSessionStart?(event: PointerEvent, info: EventInfo): void;
2845 /**
2846 * Callback function that fires when the pan gesture ends on this element.
2847 *
2848 * ```jsx
2849 * function onPanEnd(event, info) {
2850 * console.log(info.point.x, info.point.y)
2851 * }
2852 *
2853 * <motion.div onPanEnd={onPanEnd} />
2854 * ```
2855 *
2856 * @param event - The originating pointer event.
2857 * @param info - A {@link PanInfo} object containing `x`/`y` values for:
2858 *
2859 * - `point`: Relative to the device or page.
2860 * - `delta`: Distance moved since the last event.
2861 * - `offset`: Offset from the original pan event.
2862 * - `velocity`: Current velocity of the pointer.
2863 */
2864 onPanEnd?(event: PointerEvent, info: PanInfo): void;
2865}
2866/**
2867 * @public
2868 */
2869interface HoverHandlers {
2870 /**
2871 * Properties or variant label to animate to while the hover gesture is recognised.
2872 *
2873 * ```jsx
2874 * <motion.div whileHover={{ scale: 1.2 }} />
2875 * ```
2876 */
2877 whileHover?: VariantLabels | TargetAndTransition;
2878 /**
2879 * Callback function that fires when pointer starts hovering over the component.
2880 *
2881 * ```jsx
2882 * <motion.div onHoverStart={() => console.log('Hover starts')} />
2883 * ```
2884 */
2885 onHoverStart?(event: MouseEvent, info: EventInfo): void;
2886 /**
2887 * Callback function that fires when pointer stops hovering over the component.
2888 *
2889 * ```jsx
2890 * <motion.div onHoverEnd={() => console.log("Hover ends")} />
2891 * ```
2892 */
2893 onHoverEnd?(event: MouseEvent, info: EventInfo): void;
2894}
2895
2896type ViewportEventHandler = (entry: IntersectionObserverEntry | null) => void;
2897interface ViewportOptions {
2898 root?: RefObject<Element>;
2899 once?: boolean;
2900 margin?: string;
2901 amount?: "some" | "all" | number;
2902}
2903interface ViewportProps {
2904 whileInView?: VariantLabels | TargetAndTransition;
2905 onViewportEnter?: ViewportEventHandler;
2906 onViewportLeave?: ViewportEventHandler;
2907 viewport?: ViewportOptions;
2908}
2909
2910/**
2911 * Either a string, or array of strings, that reference variants defined via the `variants` prop.
2912 * @public
2913 */
2914type VariantLabels = string | string[];
2915interface TransformProperties {
2916 x?: string | number;
2917 y?: string | number;
2918 z?: string | number;
2919 translateX?: string | number;
2920 translateY?: string | number;
2921 translateZ?: string | number;
2922 rotate?: string | number;
2923 rotateX?: string | number;
2924 rotateY?: string | number;
2925 rotateZ?: string | number;
2926 scale?: string | number;
2927 scaleX?: string | number;
2928 scaleY?: string | number;
2929 scaleZ?: string | number;
2930 skew?: string | number;
2931 skewX?: string | number;
2932 skewY?: string | number;
2933 originX?: string | number;
2934 originY?: string | number;
2935 originZ?: string | number;
2936 perspective?: string | number;
2937 transformPerspective?: string | number;
2938}
2939/**
2940 * @public
2941 */
2942interface SVGPathProperties {
2943 pathLength?: number;
2944 pathOffset?: number;
2945 pathSpacing?: number;
2946}
2947interface CustomStyles {
2948 /**
2949 * Framer Library custom prop types. These are not actually supported in Motion - preferably
2950 * we'd have a way of external consumers injecting supported styles into this library.
2951 */
2952 size?: string | number;
2953 radius?: string | number;
2954 shadow?: string;
2955 image?: string;
2956}
2957type MakeMotion<T> = MakeCustomValueType<{
2958 [K in keyof T]: T[K] | MotionValue<number> | MotionValue<string> | MotionValue<any>;
2959}>;
2960type MotionCSS = MakeMotion<Omit$1<CSSProperties, "rotate" | "scale" | "perspective">>;
2961/**
2962 * @public
2963 */
2964type MotionTransform = MakeMotion<TransformProperties>;
2965/**
2966 * @public
2967 */
2968type MotionStyle = MotionCSS & MotionTransform & MakeMotion<SVGPathProperties> & MakeCustomValueType<CustomStyles>;
2969/**
2970 * @public
2971 */
2972interface RelayoutInfo {
2973 delta: {
2974 x: number;
2975 y: number;
2976 width: number;
2977 height: number;
2978 };
2979}
2980/**
2981 * @public
2982 */
2983type ResolveLayoutTransition = (info: RelayoutInfo) => Transition$1 | boolean;
2984/**
2985 * @public
2986 */
2987interface AnimationProps {
2988 /**
2989 * Properties, variant label or array of variant labels to start in.
2990 *
2991 * Set to `false` to initialise with the values in `animate` (disabling the mount animation)
2992 *
2993 * ```jsx
2994 * // As values
2995 * <motion.div initial={{ opacity: 1 }} />
2996 *
2997 * // As variant
2998 * <motion.div initial="visible" variants={variants} />
2999 *
3000 * // Multiple variants
3001 * <motion.div initial={["visible", "active"]} variants={variants} />
3002 *
3003 * // As false (disable mount animation)
3004 * <motion.div initial={false} animate={{ opacity: 0 }} />
3005 * ```
3006 */
3007 initial?: boolean | Target | VariantLabels;
3008 /**
3009 * Values to animate to, variant label(s), or `AnimationControls`.
3010 *
3011 * ```jsx
3012 * // As values
3013 * <motion.div animate={{ opacity: 1 }} />
3014 *
3015 * // As variant
3016 * <motion.div animate="visible" variants={variants} />
3017 *
3018 * // Multiple variants
3019 * <motion.div animate={["visible", "active"]} variants={variants} />
3020 *
3021 * // AnimationControls
3022 * <motion.div animate={animation} />
3023 * ```
3024 */
3025 animate?: AnimationControls | TargetAndTransition | VariantLabels | boolean;
3026 /**
3027 * A target to animate to when this component is removed from the tree.
3028 *
3029 * This component **must** be the first animatable child of an `AnimatePresence` to enable this exit animation.
3030 *
3031 * This limitation exists because React doesn't allow components to defer unmounting until after
3032 * an animation is complete. Once this limitation is fixed, the `AnimatePresence` component will be unnecessary.
3033 *
3034 * ```jsx
3035 * import { AnimatePresence, motion } from 'framer-motion'
3036 *
3037 * export const MyComponent = ({ isVisible }) => {
3038 * return (
3039 * <AnimatePresence>
3040 * {isVisible && (
3041 * <motion.div
3042 * initial={{ opacity: 0 }}
3043 * animate={{ opacity: 1 }}
3044 * exit={{ opacity: 0 }}
3045 * />
3046 * )}
3047 * </AnimatePresence>
3048 * )
3049 * }
3050 * ```
3051 */
3052 exit?: TargetAndTransition | VariantLabels;
3053 /**
3054 * Variants allow you to define animation states and organise them by name. They allow
3055 * you to control animations throughout a component tree by switching a single `animate` prop.
3056 *
3057 * Using `transition` options like `delayChildren` and `staggerChildren`, you can orchestrate
3058 * when children animations play relative to their parent.
3059
3060 *
3061 * After passing variants to one or more `motion` component's `variants` prop, these variants
3062 * can be used in place of values on the `animate`, `initial`, `whileFocus`, `whileTap` and `whileHover` props.
3063 *
3064 * ```jsx
3065 * const variants = {
3066 * active: {
3067 * backgroundColor: "#f00"
3068 * },
3069 * inactive: {
3070 * backgroundColor: "#fff",
3071 * transition: { duration: 2 }
3072 * }
3073 * }
3074 *
3075 * <motion.div variants={variants} animate="active" />
3076 * ```
3077 */
3078 variants?: Variants;
3079 /**
3080 * Default transition. If no `transition` is defined in `animate`, it will use the transition defined here.
3081 * ```jsx
3082 * const spring = {
3083 * type: "spring",
3084 * damping: 10,
3085 * stiffness: 100
3086 * }
3087 *
3088 * <motion.div transition={spring} animate={{ scale: 1.2 }} />
3089 * ```
3090 */
3091 transition?: Transition$1;
3092}
3093/**
3094 * @public
3095 */
3096interface MotionAdvancedProps {
3097 /**
3098 * Custom data to use to resolve dynamic variants differently for each animating component.
3099 *
3100 * ```jsx
3101 * const variants = {
3102 * visible: (custom) => ({
3103 * opacity: 1,
3104 * transition: { delay: custom * 0.2 }
3105 * })
3106 * }
3107 *
3108 * <motion.div custom={0} animate="visible" variants={variants} />
3109 * <motion.div custom={1} animate="visible" variants={variants} />
3110 * <motion.div custom={2} animate="visible" variants={variants} />
3111 * ```
3112 *
3113 * @public
3114 */
3115 custom?: any;
3116 /**
3117 * @public
3118 * Set to `false` to prevent inheriting variant changes from its parent.
3119 */
3120 inherit?: boolean;
3121 /**
3122 * @public
3123 * Set to `false` to prevent throwing an error when a `motion` component is used within a `LazyMotion` set to strict.
3124 */
3125 ignoreStrict?: boolean;
3126}
3127/**
3128 * Props for `motion` components.
3129 *
3130 * @public
3131 */
3132interface MotionProps extends AnimationProps, EventProps, PanHandlers, TapHandlers, HoverHandlers, FocusHandlers, ViewportProps, DraggableProps, LayoutProps, MotionAdvancedProps {
3133 /**
3134 *
3135 * The React DOM `style` prop, enhanced with support for `MotionValue`s and separate `transform` values.
3136 *
3137 * ```jsx
3138 * export const MyComponent = () => {
3139 * const x = useMotionValue(0)
3140 *
3141 * return <motion.div style={{ x, opacity: 1, scale: 0.5 }} />
3142 * }
3143 * ```
3144 */
3145 style?: MotionStyle;
3146 /**
3147 * By default, Framer Motion generates a `transform` property with a sensible transform order. `transformTemplate`
3148 * can be used to create a different order, or to append/preprend the automatically generated `transform` property.
3149 *
3150 * ```jsx
3151 * <motion.div
3152 * style={{ x: 0, rotate: 180 }}
3153 * transformTemplate={
3154 * ({ x, rotate }) => `rotate(${rotate}deg) translateX(${x}px)`
3155 * }
3156 * />
3157 * ```
3158 *
3159 * @param transform - The latest animated transform props.
3160 * @param generatedTransform - The transform string as automatically generated by Framer Motion
3161 *
3162 * @public
3163 */
3164 transformTemplate?(transform: TransformProperties, generatedTransform: string): string;
3165 children?: React.ReactNode | MotionValue<number> | MotionValue<string>;
3166 "data-framer-appear-id"?: string;
3167}
3168
3169interface VisualState<Instance, RenderState> {
3170 renderState: RenderState;
3171 latestValues: ResolvedValues;
3172 mount?: (instance: Instance) => void;
3173}
3174type UseVisualState<Instance, RenderState> = (props: MotionProps, isStatic: boolean) => VisualState<Instance, RenderState>;
3175interface UseVisualStateConfig<Instance, RenderState> {
3176 applyWillChange?: boolean;
3177 scrapeMotionValuesFromProps: ScrapeMotionValuesFromProps;
3178 createRenderState: () => RenderState;
3179 onMount?: (props: MotionProps, instance: Instance, visualState: VisualState<Instance, RenderState>) => void;
3180}
3181declare const makeUseVisualState: <I, RS>(config: UseVisualStateConfig<I, RS>) => UseVisualState<I, RS>;
3182
3183type VariantStateContext = {
3184 initial?: string | string[];
3185 animate?: string | string[];
3186 exit?: string | string[];
3187 whileHover?: string | string[];
3188 whileDrag?: string | string[];
3189 whileFocus?: string | string[];
3190 whileTap?: string | string[];
3191};
3192type ScrapeMotionValuesFromProps = (props: MotionProps, prevProps: MotionProps, visualElement?: VisualElement) => {
3193 [key: string]: MotionValue | string | number;
3194};
3195type VisualElementOptions<Instance, RenderState = any> = {
3196 visualState: VisualState<Instance, RenderState>;
3197 parent?: VisualElement<unknown>;
3198 variantParent?: VisualElement<unknown>;
3199 presenceContext: PresenceContextProps | null;
3200 props: MotionProps;
3201 blockInitialAnimation?: boolean;
3202 reducedMotionConfig?: ReducedMotionConfig;
3203};
3204/**
3205 * A generic set of string/number values
3206 */
3207interface ResolvedValues {
3208 [key: string]: string | number;
3209}
3210interface VisualElementEventCallbacks {
3211 BeforeLayoutMeasure: () => void;
3212 LayoutMeasure: (layout: Box, prevLayout?: Box) => void;
3213 LayoutUpdate: (layout: Axis, prevLayout: Axis) => void;
3214 Update: (latest: ResolvedValues) => void;
3215 AnimationStart: (definition: AnimationDefinition) => void;
3216 AnimationComplete: (definition: AnimationDefinition) => void;
3217 LayoutAnimationStart: () => void;
3218 LayoutAnimationComplete: () => void;
3219 SetAxisTarget: () => void;
3220 Unmount: () => void;
3221}
3222interface LayoutLifecycles {
3223 onBeforeLayoutMeasure?(box: Box): void;
3224 onLayoutMeasure?(box: Box, prevBox: Box): void;
3225}
3226interface AnimationLifecycles {
3227 /**
3228 * Callback with latest motion values, fired max once per frame.
3229 *
3230 * ```jsx
3231 * function onUpdate(latest) {
3232 * console.log(latest.x, latest.opacity)
3233 * }
3234 *
3235 * <motion.div animate={{ x: 100, opacity: 0 }} onUpdate={onUpdate} />
3236 * ```
3237 */
3238 onUpdate?(latest: ResolvedValues): void;
3239 /**
3240 * Callback when animation defined in `animate` begins.
3241 *
3242 * The provided callback will be called with the triggering animation definition.
3243 * If this is a variant, it'll be the variant name, and if a target object
3244 * then it'll be the target object.
3245 *
3246 * This way, it's possible to figure out which animation has started.
3247 *
3248 * ```jsx
3249 * function onStart() {
3250 * console.log("Animation started")
3251 * }
3252 *
3253 * <motion.div animate={{ x: 100 }} onAnimationStart={onStart} />
3254 * ```
3255 */
3256 onAnimationStart?(definition: AnimationDefinition): void;
3257 /**
3258 * Callback when animation defined in `animate` is complete.
3259 *
3260 * The provided callback will be called with the triggering animation definition.
3261 * If this is a variant, it'll be the variant name, and if a target object
3262 * then it'll be the target object.
3263 *
3264 * This way, it's possible to figure out which animation has completed.
3265 *
3266 * ```jsx
3267 * function onComplete() {
3268 * console.log("Animation completed")
3269 * }
3270 *
3271 * <motion.div
3272 * animate={{ x: 100 }}
3273 * onAnimationComplete={definition => {
3274 * console.log('Completed animating', definition)
3275 * }}
3276 * />
3277 * ```
3278 */
3279 onAnimationComplete?(definition: AnimationDefinition): void;
3280}
3281type EventProps = LayoutLifecycles & AnimationLifecycles;
3282type CreateVisualElement<Instance> = (Component: string | React.ComponentType<React.PropsWithChildren<unknown>>, options: VisualElementOptions<Instance>) => VisualElement<Instance>;
3283
3284type UnionStringArray$1<T extends Readonly<string[]>> = T[number];
3285declare 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"];
3286type SVGElements = UnionStringArray$1<typeof svgElements>;
3287
3288type UnionStringArray<T extends Readonly<string[]>> = T[number];
3289declare const htmlElements: readonly ["a", "abbr", "address", "area", "article", "aside", "audio", "b", "base", "bdi", "bdo", "big", "blockquote", "body", "br", "button", "canvas", "caption", "cite", "code", "col", "colgroup", "data", "datalist", "dd", "del", "details", "dfn", "dialog", "div", "dl", "dt", "em", "embed", "fieldset", "figcaption", "figure", "footer", "form", "h1", "h2", "h3", "h4", "h5", "h6", "head", "header", "hgroup", "hr", "html", "i", "iframe", "img", "input", "ins", "kbd", "keygen", "label", "legend", "li", "link", "main", "map", "mark", "menu", "menuitem", "meta", "meter", "nav", "noscript", "object", "ol", "optgroup", "option", "output", "p", "param", "picture", "pre", "progress", "q", "rp", "rt", "ruby", "s", "samp", "script", "section", "select", "small", "source", "span", "strong", "style", "sub", "summary", "sup", "table", "tbody", "td", "textarea", "tfoot", "th", "thead", "time", "title", "tr", "track", "u", "ul", "var", "video", "wbr", "webview"];
3290type HTMLElements = UnionStringArray<typeof htmlElements>;
3291
3292interface TransformOrigin {
3293 originX?: number | string;
3294 originY?: number | string;
3295 originZ?: number | string;
3296}
3297interface HTMLRenderState {
3298 /**
3299 * A mutable record of transforms we want to apply directly to the rendered Element
3300 * every frame. We use a mutable data structure to reduce GC during animations.
3301 */
3302 transform: ResolvedValues;
3303 /**
3304 * A mutable record of transform origins we want to apply directly to the rendered Element
3305 * every frame. We use a mutable data structure to reduce GC during animations.
3306 */
3307 transformOrigin: TransformOrigin;
3308 /**
3309 * A mutable record of styles we want to apply directly to the rendered Element
3310 * every frame. We use a mutable data structure to reduce GC during animations.
3311 */
3312 style: ResolvedValues;
3313 /**
3314 * A mutable record of CSS variables we want to apply directly to the rendered Element
3315 * every frame. We use a mutable data structure to reduce GC during animations.
3316 */
3317 vars: ResolvedValues;
3318}
3319/**
3320 * @public
3321 */
3322type ForwardRefComponent<T, P> = {
3323 readonly $$typeof: symbol;
3324} & ((props: PropsWithoutRef<P> & RefAttributes<T>) => JSX.Element);
3325/**
3326 * Support for React component props
3327 */
3328type UnwrapFactoryAttributes<F> = F extends DetailedHTMLFactory<infer P, any> ? P : never;
3329type UnwrapFactoryElement<F> = F extends DetailedHTMLFactory<any, infer P> ? P : never;
3330type HTMLAttributesWithoutMotionProps<Attributes extends HTMLAttributes<Element>, Element extends HTMLElement> = {
3331 [K in Exclude<keyof Attributes, keyof MotionProps>]?: Attributes[K];
3332};
3333/**
3334 * @public
3335 */
3336type HTMLMotionProps<TagName extends keyof ReactHTML> = HTMLAttributesWithoutMotionProps<UnwrapFactoryAttributes<ReactHTML[TagName]>, UnwrapFactoryElement<ReactHTML[TagName]>> & MotionProps;
3337/**
3338 * Motion-optimised versions of React's HTML components.
3339 *
3340 * @public
3341 */
3342type HTMLMotionComponents = {
3343 [K in HTMLElements]: ForwardRefComponent<UnwrapFactoryElement<ReactHTML[K]>, HTMLMotionProps<K>>;
3344};
3345
3346interface SVGAttributesWithoutMotionProps<T> extends Pick<SVGAttributes$1<T>, Exclude<keyof SVGAttributes$1<T>, keyof MotionProps>> {
3347}
3348/**
3349 * Blanket-accept any SVG attribute as a `MotionValue`
3350 * @public
3351 */
3352type SVGAttributesAsMotionValues<T> = MakeMotion<SVGAttributesWithoutMotionProps<T>>;
3353type UnwrapSVGFactoryElement<F> = F extends React.SVGProps<infer P> ? P : never;
3354/**
3355 * @public
3356 */
3357interface SVGMotionProps<T> extends SVGAttributesAsMotionValues<T>, MotionProps {
3358}
3359/**
3360 * Motion-optimised versions of React's SVG components.
3361 *
3362 * @public
3363 */
3364type SVGMotionComponents = {
3365 [K in SVGElements]: ForwardRefComponent<UnwrapSVGFactoryElement<JSX.IntrinsicElements[K]>, SVGMotionProps<UnwrapSVGFactoryElement<JSX.IntrinsicElements[K]>>>;
3366};
3367
3368declare abstract class Feature<T extends any = any> {
3369 isMounted: boolean;
3370 node: VisualElement<T>;
3371 constructor(node: VisualElement<T>);
3372 abstract mount(): void;
3373 abstract unmount(): void;
3374 update(): void;
3375}
3376
3377declare function MeasureLayout(props: MotionProps & {
3378 visualElement: VisualElement;
3379}): react_jsx_runtime.JSX.Element;
3380
3381interface FeatureClass<Props = unknown> {
3382 new (props: Props): Feature<Props>;
3383}
3384type HydratedFeatureDefinition = {
3385 isEnabled: (props: MotionProps) => boolean;
3386 Feature: FeatureClass<unknown>;
3387 ProjectionNode?: any;
3388 MeasureLayout?: typeof MeasureLayout;
3389};
3390interface HydratedFeatureDefinitions {
3391 animation?: HydratedFeatureDefinition;
3392 exit?: HydratedFeatureDefinition;
3393 drag?: HydratedFeatureDefinition;
3394 tap?: HydratedFeatureDefinition;
3395 focus?: HydratedFeatureDefinition;
3396 hover?: HydratedFeatureDefinition;
3397 pan?: HydratedFeatureDefinition;
3398 inView?: HydratedFeatureDefinition;
3399 layout?: HydratedFeatureDefinition;
3400}
3401type FeatureDefinition = {
3402 isEnabled: HydratedFeatureDefinition["isEnabled"];
3403 Feature?: HydratedFeatureDefinition["Feature"];
3404 ProjectionNode?: HydratedFeatureDefinition["ProjectionNode"];
3405 MeasureLayout?: HydratedFeatureDefinition["MeasureLayout"];
3406};
3407type FeatureDefinitions = {
3408 [K in keyof HydratedFeatureDefinitions]: FeatureDefinition;
3409};
3410type FeaturePackage = {
3411 Feature?: HydratedFeatureDefinition["Feature"];
3412 ProjectionNode?: HydratedFeatureDefinition["ProjectionNode"];
3413 MeasureLayout?: HydratedFeatureDefinition["MeasureLayout"];
3414};
3415type FeaturePackages = {
3416 [K in keyof HydratedFeatureDefinitions]: FeaturePackage;
3417};
3418interface FeatureBundle extends FeaturePackages {
3419 renderer: CreateVisualElement<any>;
3420}
3421type LazyFeatureBundle$1 = () => Promise<FeatureBundle>;
3422type RenderComponent<Instance, RenderState> = (Component: string | react.ComponentType<react.PropsWithChildren<unknown>>, props: MotionProps, ref: react.Ref<Instance>, visualState: VisualState<Instance, RenderState>, isStatic: boolean, visualElement?: VisualElement<Instance>) => any;
3423
3424interface MotionComponentConfig<Instance, RenderState> {
3425 preloadedFeatures?: FeatureBundle;
3426 createVisualElement?: CreateVisualElement<Instance>;
3427 useRender: RenderComponent<Instance, RenderState>;
3428 useVisualState: UseVisualState<Instance, RenderState>;
3429 Component: string | react.ComponentType<react.PropsWithChildren<unknown>>;
3430}
3431/**
3432 * Create a `motion` component.
3433 *
3434 * This function accepts a Component argument, which can be either a string (ie "div"
3435 * for `motion.div`), or an actual React component.
3436 *
3437 * Alongside this is a config option which provides a way of rendering the provided
3438 * component "offline", or outside the React render cycle.
3439 */
3440declare function createMotionComponent<Props extends {}, Instance, RenderState>({ preloadedFeatures, createVisualElement, useRender, useVisualState, Component, }: MotionComponentConfig<Instance, RenderState>): react.ForwardRefExoticComponent<react.PropsWithoutRef<Props & MotionProps> & react.RefAttributes<Instance>>;
3441
3442/**
3443 * I'd rather the return type of `custom` to be implicit but this throws
3444 * incorrect relative paths in the exported types and API Extractor throws
3445 * a wobbly.
3446 */
3447type CustomDomComponent<Props> = react.ForwardRefExoticComponent<react.PropsWithoutRef<Props & MotionProps> & react.RefAttributes<SVGElement | HTMLElement>>;
3448interface CustomMotionComponentConfig {
3449 forwardMotionProps?: boolean;
3450}
3451
3452type DOMMotionComponents = HTMLMotionComponents & SVGMotionComponents;
3453
3454/**
3455 * HTML & SVG components, optimised for use with gestures and animation. These can be used as
3456 * drop-in replacements for any HTML & SVG component, all CSS & SVG properties are supported.
3457 *
3458 * @public
3459 */
3460declare const motion: (<Props extends {}>(Component: string | react.ComponentType<react.PropsWithChildren<Props>>, customMotionComponentConfig?: CustomMotionComponentConfig) => CustomDomComponent<Props>) & HTMLMotionComponents & SVGMotionComponents;
3461/**
3462 * Create a DOM `motion` component with the provided string. This is primarily intended
3463 * as a full alternative to `motion` for consumers who have to support environments that don't
3464 * support `Proxy`.
3465 *
3466 * ```javascript
3467 * import { createDomMotionComponent } from "framer-motion"
3468 *
3469 * const motion = {
3470 * div: createDomMotionComponent('div')
3471 * }
3472 * ```
3473 *
3474 * @public
3475 */
3476declare function createDomMotionComponent<T extends keyof DOMMotionComponents>(key: T): DOMMotionComponents[T];
3477
3478/**
3479 * @public
3480 */
3481declare const m: (<Props extends {}>(Component: string | react.ComponentType<react.PropsWithChildren<Props>>, customMotionComponentConfig?: CustomMotionComponentConfig) => CustomDomComponent<Props>) & HTMLMotionComponents & SVGMotionComponents;
3482
3483/**
3484 * @public
3485 */
3486interface AnimatePresenceProps {
3487 /**
3488 * By passing `initial={false}`, `AnimatePresence` will disable any initial animations on children
3489 * that are present when the component is first rendered.
3490 *
3491 * ```jsx
3492 * <AnimatePresence initial={false}>
3493 * {isVisible && (
3494 * <motion.div
3495 * key="modal"
3496 * initial={{ opacity: 0 }}
3497 * animate={{ opacity: 1 }}
3498 * exit={{ opacity: 0 }}
3499 * />
3500 * )}
3501 * </AnimatePresence>
3502 * ```
3503 *
3504 * @public
3505 */
3506 initial?: boolean;
3507 /**
3508 * When a component is removed, there's no longer a chance to update its props. So if a component's `exit`
3509 * prop is defined as a dynamic variant and you want to pass a new `custom` prop, you can do so via `AnimatePresence`.
3510 * This will ensure all leaving components animate using the latest data.
3511 *
3512 * @public
3513 */
3514 custom?: any;
3515 /**
3516 * Fires when all exiting nodes have completed animating out.
3517 *
3518 * @public
3519 */
3520 onExitComplete?: () => void;
3521 /**
3522 * Replace with `mode="wait"`
3523 *
3524 * @deprecated
3525 *
3526 * Replace with `mode="wait"`
3527 */
3528 exitBeforeEnter?: boolean;
3529 /**
3530 * Determines how to handle entering and exiting elements.
3531 *
3532 * - `"sync"`: Default. Elements animate in and out as soon as they're added/removed.
3533 * - `"popLayout"`: Exiting elements are "popped" from the page layout, allowing sibling
3534 * elements to immediately occupy their new layouts.
3535 * - `"wait"`: Only renders one component at a time. Wait for the exiting component to animate out
3536 * before animating the next component in.
3537 *
3538 * @public
3539 */
3540 mode?: "sync" | "popLayout" | "wait";
3541 /**
3542 * Internal. Used in Framer to flag that sibling children *shouldn't* re-render as a result of a
3543 * child being removed.
3544 */
3545 presenceAffectsLayout?: boolean;
3546}
3547
3548/**
3549 * `AnimatePresence` enables the animation of components that have been removed from the tree.
3550 *
3551 * When adding/removing more than a single child, every child **must** be given a unique `key` prop.
3552 *
3553 * Any `motion` components that have an `exit` property defined will animate out when removed from
3554 * the tree.
3555 *
3556 * ```jsx
3557 * import { motion, AnimatePresence } from 'framer-motion'
3558 *
3559 * export const Items = ({ items }) => (
3560 * <AnimatePresence>
3561 * {items.map(item => (
3562 * <motion.div
3563 * key={item.id}
3564 * initial={{ opacity: 0 }}
3565 * animate={{ opacity: 1 }}
3566 * exit={{ opacity: 0 }}
3567 * />
3568 * ))}
3569 * </AnimatePresence>
3570 * )
3571 * ```
3572 *
3573 * You can sequence exit animations throughout a tree using variants.
3574 *
3575 * If a child contains multiple `motion` components with `exit` props, it will only unmount the child
3576 * once all `motion` components have finished animating out. Likewise, any components using
3577 * `usePresence` all need to call `safeToRemove`.
3578 *
3579 * @public
3580 */
3581declare const AnimatePresence: react.FunctionComponent<react.PropsWithChildren<AnimatePresenceProps>>;
3582
3583type IsValidProp = (key: string) => boolean;
3584declare function filterProps(props: MotionProps, isDom: boolean, forwardMotionProps: boolean): MotionProps;
3585
3586interface MotionConfigProps extends Partial<MotionConfigContext> {
3587 children?: react.ReactNode;
3588 isValidProp?: IsValidProp;
3589}
3590/**
3591 * `MotionConfig` is used to set configuration options for all children `motion` components.
3592 *
3593 * ```jsx
3594 * import { motion, MotionConfig } from "framer-motion"
3595 *
3596 * export function App() {
3597 * return (
3598 * <MotionConfig transition={{ type: "spring" }}>
3599 * <motion.div animate={{ x: 100 }} />
3600 * </MotionConfig>
3601 * )
3602 * }
3603 * ```
3604 *
3605 * @public
3606 */
3607declare function MotionConfig({ children, isValidProp, ...config }: MotionConfigProps): react_jsx_runtime.JSX.Element;
3608
3609type LazyFeatureBundle = () => Promise<FeatureBundle>;
3610/**
3611 * @public
3612 */
3613interface LazyProps {
3614 children?: React.ReactNode;
3615 /**
3616 * Can be used to provide a feature bundle synchronously or asynchronously.
3617 *
3618 * ```jsx
3619 * // features.js
3620 * import { domAnimation } from "framer-motion"
3621 * export default domAnimation
3622 *
3623 * // index.js
3624 * import { LazyMotion, m } from "framer-motion"
3625 *
3626 * const loadFeatures = import("./features.js")
3627 * .then(res => res.default)
3628 *
3629 * function Component() {
3630 * return (
3631 * <LazyMotion features={loadFeatures}>
3632 * <m.div animate={{ scale: 1.5 }} />
3633 * </LazyMotion>
3634 * )
3635 * }
3636 * ```
3637 *
3638 * @public
3639 */
3640 features: FeatureBundle | LazyFeatureBundle;
3641 /**
3642 * If `true`, will throw an error if a `motion` component renders within
3643 * a `LazyMotion` component.
3644 *
3645 * ```jsx
3646 * // This component will throw an error that explains using a motion component
3647 * // instead of the m component will break the benefits of code-splitting.
3648 * function Component() {
3649 * return (
3650 * <LazyMotion features={domAnimation} strict>
3651 * <motion.div />
3652 * </LazyMotion>
3653 * )
3654 * }
3655 * ```
3656 *
3657 * @public
3658 */
3659 strict?: boolean;
3660}
3661
3662/**
3663 * Used in conjunction with the `m` component to reduce bundle size.
3664 *
3665 * `m` is a version of the `motion` component that only loads functionality
3666 * critical for the initial render.
3667 *
3668 * `LazyMotion` can then be used to either synchronously or asynchronously
3669 * load animation and gesture support.
3670 *
3671 * ```jsx
3672 * // Synchronous loading
3673 * import { LazyMotion, m, domAnimation } from "framer-motion"
3674 *
3675 * function App() {
3676 * return (
3677 * <LazyMotion features={domAnimation}>
3678 * <m.div animate={{ scale: 2 }} />
3679 * </LazyMotion>
3680 * )
3681 * }
3682 *
3683 * // Asynchronous loading
3684 * import { LazyMotion, m } from "framer-motion"
3685 *
3686 * function App() {
3687 * return (
3688 * <LazyMotion features={() => import('./path/to/domAnimation')}>
3689 * <m.div animate={{ scale: 2 }} />
3690 * </LazyMotion>
3691 * )
3692 * }
3693 * ```
3694 *
3695 * @public
3696 */
3697declare function LazyMotion({ children, features, strict }: LazyProps): react_jsx_runtime.JSX.Element;
3698
3699type InheritOption = boolean | "id";
3700interface Props$2 {
3701 id?: string;
3702 inherit?: InheritOption;
3703}
3704declare const LayoutGroup: react.FunctionComponent<react.PropsWithChildren<Props$2>>;
3705
3706interface Props$1<V> {
3707 /**
3708 * A HTML element to render this component as. Defaults to `"li"`.
3709 *
3710 * @public
3711 */
3712 as?: keyof ReactHTML;
3713 /**
3714 * The value in the list that this component represents.
3715 *
3716 * @public
3717 */
3718 value: V;
3719 /**
3720 * A subset of layout options primarily used to disable layout="size"
3721 *
3722 * @public
3723 * @default true
3724 */
3725 layout?: true | "position";
3726}
3727
3728interface Props<V> {
3729 /**
3730 * A HTML element to render this component as. Defaults to `"ul"`.
3731 *
3732 * @public
3733 */
3734 as?: keyof ReactHTML;
3735 /**
3736 * The axis to reorder along. By default, items will be draggable on this axis.
3737 * To make draggable on both axes, set `<Reorder.Item drag />`
3738 *
3739 * @public
3740 */
3741 axis?: "x" | "y";
3742 /**
3743 * A callback to fire with the new value order. For instance, if the values
3744 * are provided as a state from `useState`, this could be the set state function.
3745 *
3746 * @public
3747 */
3748 onReorder: (newOrder: V[]) => void;
3749 /**
3750 * The latest values state.
3751 *
3752 * ```jsx
3753 * function Component() {
3754 * const [items, setItems] = useState([0, 1, 2])
3755 *
3756 * return (
3757 * <Reorder.Group values={items} onReorder={setItems}>
3758 * {items.map((item) => <Reorder.Item key={item} value={item} />)}
3759 * </Reorder.Group>
3760 * )
3761 * }
3762 * ```
3763 *
3764 * @public
3765 */
3766 values: V[];
3767}
3768
3769declare const Reorder: {
3770 Group: <V>(props: Props<V> & Omit<HTMLMotionProps<any>, "values"> & {
3771 children?: react.ReactNode;
3772 } & {
3773 ref?: react.ForwardedRef<any> | undefined;
3774 }) => react_jsx_runtime.JSX.Element;
3775 Item: <V_1>(props: Props$1<V_1> & {
3776 color?: string | undefined;
3777 content?: string | undefined;
3778 translate?: "no" | "yes" | undefined;
3779 hidden?: boolean | undefined;
3780 suppressHydrationWarning?: boolean | undefined;
3781 className?: string | undefined;
3782 id?: string | undefined;
3783 lang?: string | undefined;
3784 role?: react.AriaRole | undefined;
3785 tabIndex?: number | undefined;
3786 "aria-activedescendant"?: string | undefined;
3787 "aria-atomic"?: (boolean | "false" | "true") | undefined;
3788 "aria-autocomplete"?: "both" | "none" | "inline" | "list" | undefined;
3789 "aria-braillelabel"?: string | undefined;
3790 "aria-brailleroledescription"?: string | undefined;
3791 "aria-busy"?: (boolean | "false" | "true") | undefined;
3792 "aria-checked"?: boolean | "mixed" | "false" | "true" | undefined;
3793 "aria-colcount"?: number | undefined;
3794 "aria-colindex"?: number | undefined;
3795 "aria-colindextext"?: string | undefined;
3796 "aria-colspan"?: number | undefined;
3797 "aria-controls"?: string | undefined;
3798 "aria-current"?: boolean | "page" | "false" | "true" | "step" | "location" | "date" | "time" | undefined;
3799 "aria-describedby"?: string | undefined;
3800 "aria-description"?: string | undefined;
3801 "aria-details"?: string | undefined;
3802 "aria-disabled"?: (boolean | "false" | "true") | undefined;
3803 "aria-dropeffect"?: "none" | "copy" | "move" | "link" | "execute" | "popup" | undefined;
3804 "aria-errormessage"?: string | undefined;
3805 "aria-expanded"?: (boolean | "false" | "true") | undefined;
3806 "aria-flowto"?: string | undefined;
3807 "aria-grabbed"?: (boolean | "false" | "true") | undefined;
3808 "aria-haspopup"?: boolean | "grid" | "listbox" | "menu" | "false" | "true" | "dialog" | "tree" | undefined;
3809 "aria-hidden"?: (boolean | "false" | "true") | undefined;
3810 "aria-invalid"?: boolean | "false" | "true" | "grammar" | "spelling" | undefined;
3811 "aria-keyshortcuts"?: string | undefined;
3812 "aria-label"?: string | undefined;
3813 "aria-labelledby"?: string | undefined;
3814 "aria-level"?: number | undefined;
3815 "aria-live"?: "off" | "assertive" | "polite" | undefined;
3816 "aria-modal"?: (boolean | "false" | "true") | undefined;
3817 "aria-multiline"?: (boolean | "false" | "true") | undefined;
3818 "aria-multiselectable"?: (boolean | "false" | "true") | undefined;
3819 "aria-orientation"?: "horizontal" | "vertical" | undefined;
3820 "aria-owns"?: string | undefined;
3821 "aria-placeholder"?: string | undefined;
3822 "aria-posinset"?: number | undefined;
3823 "aria-pressed"?: boolean | "mixed" | "false" | "true" | undefined;
3824 "aria-readonly"?: (boolean | "false" | "true") | undefined;
3825 "aria-relevant"?: "all" | "text" | "additions" | "additions removals" | "additions text" | "removals" | "removals additions" | "removals text" | "text additions" | "text removals" | undefined;
3826 "aria-required"?: (boolean | "false" | "true") | undefined;
3827 "aria-roledescription"?: string | undefined;
3828 "aria-rowcount"?: number | undefined;
3829 "aria-rowindex"?: number | undefined;
3830 "aria-rowindextext"?: string | undefined;
3831 "aria-rowspan"?: number | undefined;
3832 "aria-selected"?: (boolean | "false" | "true") | undefined;
3833 "aria-setsize"?: number | undefined;
3834 "aria-sort"?: "none" | "ascending" | "descending" | "other" | undefined;
3835 "aria-valuemax"?: number | undefined;
3836 "aria-valuemin"?: number | undefined;
3837 "aria-valuenow"?: number | undefined;
3838 "aria-valuetext"?: string | undefined;
3839 dangerouslySetInnerHTML?: {
3840 __html: string | TrustedHTML;
3841 } | undefined;
3842 onCopy?: react.ClipboardEventHandler<any> | undefined;
3843 onCopyCapture?: react.ClipboardEventHandler<any> | undefined;
3844 onCut?: react.ClipboardEventHandler<any> | undefined;
3845 onCutCapture?: react.ClipboardEventHandler<any> | undefined;
3846 onPaste?: react.ClipboardEventHandler<any> | undefined;
3847 onPasteCapture?: react.ClipboardEventHandler<any> | undefined;
3848 onCompositionEnd?: react.CompositionEventHandler<any> | undefined;
3849 onCompositionEndCapture?: react.CompositionEventHandler<any> | undefined;
3850 onCompositionStart?: react.CompositionEventHandler<any> | undefined;
3851 onCompositionStartCapture?: react.CompositionEventHandler<any> | undefined;
3852 onCompositionUpdate?: react.CompositionEventHandler<any> | undefined;
3853 onCompositionUpdateCapture?: react.CompositionEventHandler<any> | undefined;
3854 onFocus?: react.FocusEventHandler<any> | undefined;
3855 onFocusCapture?: react.FocusEventHandler<any> | undefined;
3856 onBlur?: react.FocusEventHandler<any> | undefined;
3857 onBlurCapture?: react.FocusEventHandler<any> | undefined;
3858 onChange?: react.FormEventHandler<any> | undefined;
3859 onChangeCapture?: react.FormEventHandler<any> | undefined;
3860 onBeforeInput?: react.FormEventHandler<any> | undefined;
3861 onBeforeInputCapture?: react.FormEventHandler<any> | undefined;
3862 onInput?: react.FormEventHandler<any> | undefined;
3863 onInputCapture?: react.FormEventHandler<any> | undefined;
3864 onReset?: react.FormEventHandler<any> | undefined;
3865 onResetCapture?: react.FormEventHandler<any> | undefined;
3866 onSubmit?: react.FormEventHandler<any> | undefined;
3867 onSubmitCapture?: react.FormEventHandler<any> | undefined;
3868 onInvalid?: react.FormEventHandler<any> | undefined;
3869 onInvalidCapture?: react.FormEventHandler<any> | undefined;
3870 onLoad?: react.ReactEventHandler<any> | undefined;
3871 onLoadCapture?: react.ReactEventHandler<any> | undefined;
3872 onError?: react.ReactEventHandler<any> | undefined;
3873 onErrorCapture?: react.ReactEventHandler<any> | undefined;
3874 onKeyDown?: react.KeyboardEventHandler<any> | undefined;
3875 onKeyDownCapture?: react.KeyboardEventHandler<any> | undefined;
3876 onKeyPress?: react.KeyboardEventHandler<any> | undefined;
3877 onKeyPressCapture?: react.KeyboardEventHandler<any> | undefined;
3878 onKeyUp?: react.KeyboardEventHandler<any> | undefined;
3879 onKeyUpCapture?: react.KeyboardEventHandler<any> | undefined;
3880 onAbort?: react.ReactEventHandler<any> | undefined;
3881 onAbortCapture?: react.ReactEventHandler<any> | undefined;
3882 onCanPlay?: react.ReactEventHandler<any> | undefined;
3883 onCanPlayCapture?: react.ReactEventHandler<any> | undefined;
3884 onCanPlayThrough?: react.ReactEventHandler<any> | undefined;
3885 onCanPlayThroughCapture?: react.ReactEventHandler<any> | undefined;
3886 onDurationChange?: react.ReactEventHandler<any> | undefined;
3887 onDurationChangeCapture?: react.ReactEventHandler<any> | undefined;
3888 onEmptied?: react.ReactEventHandler<any> | undefined;
3889 onEmptiedCapture?: react.ReactEventHandler<any> | undefined;
3890 onEncrypted?: react.ReactEventHandler<any> | undefined;
3891 onEncryptedCapture?: react.ReactEventHandler<any> | undefined;
3892 onEnded?: react.ReactEventHandler<any> | undefined;
3893 onEndedCapture?: react.ReactEventHandler<any> | undefined;
3894 onLoadedData?: react.ReactEventHandler<any> | undefined;
3895 onLoadedDataCapture?: react.ReactEventHandler<any> | undefined;
3896 onLoadedMetadata?: react.ReactEventHandler<any> | undefined;
3897 onLoadedMetadataCapture?: react.ReactEventHandler<any> | undefined;
3898 onLoadStart?: react.ReactEventHandler<any> | undefined;
3899 onLoadStartCapture?: react.ReactEventHandler<any> | undefined;
3900 onPause?: react.ReactEventHandler<any> | undefined;
3901 onPauseCapture?: react.ReactEventHandler<any> | undefined;
3902 onPlay?: react.ReactEventHandler<any> | undefined;
3903 onPlayCapture?: react.ReactEventHandler<any> | undefined;
3904 onPlaying?: react.ReactEventHandler<any> | undefined;
3905 onPlayingCapture?: react.ReactEventHandler<any> | undefined;
3906 onProgress?: react.ReactEventHandler<any> | undefined;
3907 onProgressCapture?: react.ReactEventHandler<any> | undefined;
3908 onRateChange?: react.ReactEventHandler<any> | undefined;
3909 onRateChangeCapture?: react.ReactEventHandler<any> | undefined;
3910 onResize?: react.ReactEventHandler<any> | undefined;
3911 onResizeCapture?: react.ReactEventHandler<any> | undefined;
3912 onSeeked?: react.ReactEventHandler<any> | undefined;
3913 onSeekedCapture?: react.ReactEventHandler<any> | undefined;
3914 onSeeking?: react.ReactEventHandler<any> | undefined;
3915 onSeekingCapture?: react.ReactEventHandler<any> | undefined;
3916 onStalled?: react.ReactEventHandler<any> | undefined;
3917 onStalledCapture?: react.ReactEventHandler<any> | undefined;
3918 onSuspend?: react.ReactEventHandler<any> | undefined;
3919 onSuspendCapture?: react.ReactEventHandler<any> | undefined;
3920 onTimeUpdate?: react.ReactEventHandler<any> | undefined;
3921 onTimeUpdateCapture?: react.ReactEventHandler<any> | undefined;
3922 onVolumeChange?: react.ReactEventHandler<any> | undefined;
3923 onVolumeChangeCapture?: react.ReactEventHandler<any> | undefined;
3924 onWaiting?: react.ReactEventHandler<any> | undefined;
3925 onWaitingCapture?: react.ReactEventHandler<any> | undefined;
3926 onAuxClick?: react.MouseEventHandler<any> | undefined;
3927 onAuxClickCapture?: react.MouseEventHandler<any> | undefined;
3928 onClick?: react.MouseEventHandler<any> | undefined;
3929 onClickCapture?: react.MouseEventHandler<any> | undefined;
3930 onContextMenu?: react.MouseEventHandler<any> | undefined;
3931 onContextMenuCapture?: react.MouseEventHandler<any> | undefined;
3932 onDoubleClick?: react.MouseEventHandler<any> | undefined;
3933 onDoubleClickCapture?: react.MouseEventHandler<any> | undefined;
3934 onDragCapture?: react.DragEventHandler<any> | undefined;
3935 onDragEndCapture?: react.DragEventHandler<any> | undefined;
3936 onDragEnter?: react.DragEventHandler<any> | undefined;
3937 onDragEnterCapture?: react.DragEventHandler<any> | undefined;
3938 onDragExit?: react.DragEventHandler<any> | undefined;
3939 onDragExitCapture?: react.DragEventHandler<any> | undefined;
3940 onDragLeave?: react.DragEventHandler<any> | undefined;
3941 onDragLeaveCapture?: react.DragEventHandler<any> | undefined;
3942 onDragOver?: react.DragEventHandler<any> | undefined;
3943 onDragOverCapture?: react.DragEventHandler<any> | undefined;
3944 onDragStartCapture?: react.DragEventHandler<any> | undefined;
3945 onDrop?: react.DragEventHandler<any> | undefined;
3946 onDropCapture?: react.DragEventHandler<any> | undefined;
3947 onMouseDown?: react.MouseEventHandler<any> | undefined;
3948 onMouseDownCapture?: react.MouseEventHandler<any> | undefined;
3949 onMouseEnter?: react.MouseEventHandler<any> | undefined;
3950 onMouseLeave?: react.MouseEventHandler<any> | undefined;
3951 onMouseMove?: react.MouseEventHandler<any> | undefined;
3952 onMouseMoveCapture?: react.MouseEventHandler<any> | undefined;
3953 onMouseOut?: react.MouseEventHandler<any> | undefined;
3954 onMouseOutCapture?: react.MouseEventHandler<any> | undefined;
3955 onMouseOver?: react.MouseEventHandler<any> | undefined;
3956 onMouseOverCapture?: react.MouseEventHandler<any> | undefined;
3957 onMouseUp?: react.MouseEventHandler<any> | undefined;
3958 onMouseUpCapture?: react.MouseEventHandler<any> | undefined;
3959 onSelect?: react.ReactEventHandler<any> | undefined;
3960 onSelectCapture?: react.ReactEventHandler<any> | undefined;
3961 onTouchCancel?: react.TouchEventHandler<any> | undefined;
3962 onTouchCancelCapture?: react.TouchEventHandler<any> | undefined;
3963 onTouchEnd?: react.TouchEventHandler<any> | undefined;
3964 onTouchEndCapture?: react.TouchEventHandler<any> | undefined;
3965 onTouchMove?: react.TouchEventHandler<any> | undefined;
3966 onTouchMoveCapture?: react.TouchEventHandler<any> | undefined;
3967 onTouchStart?: react.TouchEventHandler<any> | undefined;
3968 onTouchStartCapture?: react.TouchEventHandler<any> | undefined;
3969 onPointerDown?: react.PointerEventHandler<any> | undefined;
3970 onPointerDownCapture?: react.PointerEventHandler<any> | undefined;
3971 onPointerMove?: react.PointerEventHandler<any> | undefined;
3972 onPointerMoveCapture?: react.PointerEventHandler<any> | undefined;
3973 onPointerUp?: react.PointerEventHandler<any> | undefined;
3974 onPointerUpCapture?: react.PointerEventHandler<any> | undefined;
3975 onPointerCancel?: react.PointerEventHandler<any> | undefined;
3976 onPointerCancelCapture?: react.PointerEventHandler<any> | undefined;
3977 onPointerEnter?: react.PointerEventHandler<any> | undefined;
3978 onPointerLeave?: react.PointerEventHandler<any> | undefined;
3979 onPointerOver?: react.PointerEventHandler<any> | undefined;
3980 onPointerOverCapture?: react.PointerEventHandler<any> | undefined;
3981 onPointerOut?: react.PointerEventHandler<any> | undefined;
3982 onPointerOutCapture?: react.PointerEventHandler<any> | undefined;
3983 onGotPointerCapture?: react.PointerEventHandler<any> | undefined;
3984 onGotPointerCaptureCapture?: react.PointerEventHandler<any> | undefined;
3985 onLostPointerCapture?: react.PointerEventHandler<any> | undefined;
3986 onLostPointerCaptureCapture?: react.PointerEventHandler<any> | undefined;
3987 onScroll?: react.UIEventHandler<any> | undefined;
3988 onScrollCapture?: react.UIEventHandler<any> | undefined;
3989 onWheel?: react.WheelEventHandler<any> | undefined;
3990 onWheelCapture?: react.WheelEventHandler<any> | undefined;
3991 onAnimationStartCapture?: react.AnimationEventHandler<any> | undefined;
3992 onAnimationEnd?: react.AnimationEventHandler<any> | undefined;
3993 onAnimationEndCapture?: react.AnimationEventHandler<any> | undefined;
3994 onAnimationIteration?: react.AnimationEventHandler<any> | undefined;
3995 onAnimationIterationCapture?: react.AnimationEventHandler<any> | undefined;
3996 onTransitionEnd?: react.TransitionEventHandler<any> | undefined;
3997 onTransitionEndCapture?: react.TransitionEventHandler<any> | undefined;
3998 nonce?: string | undefined;
3999 slot?: string | undefined;
4000 title?: string | undefined;
4001 dir?: string | undefined;
4002 defaultChecked?: boolean | undefined;
4003 defaultValue?: string | number | readonly string[] | undefined;
4004 suppressContentEditableWarning?: boolean | undefined;
4005 accessKey?: string | undefined;
4006 autoFocus?: boolean | undefined;
4007 contentEditable?: "inherit" | (boolean | "false" | "true") | "plaintext-only" | undefined;
4008 contextMenu?: string | undefined;
4009 draggable?: (boolean | "false" | "true") | undefined;
4010 spellCheck?: (boolean | "false" | "true") | undefined;
4011 radioGroup?: string | undefined;
4012 about?: string | undefined;
4013 datatype?: string | undefined;
4014 inlist?: any;
4015 prefix?: string | undefined;
4016 property?: string | undefined;
4017 rel?: string | undefined;
4018 resource?: string | undefined;
4019 rev?: string | undefined;
4020 typeof?: string | undefined;
4021 vocab?: string | undefined;
4022 autoCapitalize?: string | undefined;
4023 autoCorrect?: string | undefined;
4024 autoSave?: string | undefined;
4025 itemProp?: string | undefined;
4026 itemScope?: boolean | undefined;
4027 itemType?: string | undefined;
4028 itemID?: string | undefined;
4029 itemRef?: string | undefined;
4030 results?: number | undefined;
4031 security?: string | undefined;
4032 unselectable?: "off" | "on" | undefined;
4033 inputMode?: "none" | "text" | "search" | "tel" | "url" | "email" | "numeric" | "decimal" | undefined;
4034 is?: string | undefined;
4035 } & MotionProps & {
4036 children?: react.ReactNode;
4037 } & {
4038 ref?: react.ForwardedRef<any> | undefined;
4039 }) => react_jsx_runtime.JSX.Element;
4040};
4041
4042type SequenceTime = number | "<" | `+${number}` | `-${number}` | `${string}`;
4043type SequenceLabel = string;
4044interface SequenceLabelWithTime {
4045 name: SequenceLabel;
4046 at: SequenceTime;
4047}
4048interface At {
4049 at?: SequenceTime;
4050}
4051type MotionValueSegment = [
4052 MotionValue,
4053 UnresolvedValueKeyframe | UnresolvedValueKeyframe[]
4054];
4055type MotionValueSegmentWithTransition = [
4056 MotionValue,
4057 UnresolvedValueKeyframe | UnresolvedValueKeyframe[],
4058 Transition & At
4059];
4060type DOMSegment = [ElementOrSelector, DOMKeyframesDefinition];
4061type DOMSegmentWithTransition = [
4062 ElementOrSelector,
4063 DOMKeyframesDefinition,
4064 DynamicAnimationOptions & At
4065];
4066type Segment = MotionValueSegment | MotionValueSegmentWithTransition | DOMSegment | DOMSegmentWithTransition | SequenceLabel | SequenceLabelWithTime;
4067type AnimationSequence = Segment[];
4068interface SequenceOptions extends AnimationPlaybackOptions {
4069 delay?: number;
4070 duration?: number;
4071 defaultTransition?: Transition;
4072}
4073interface AbsoluteKeyframe {
4074 value: string | number | null;
4075 at: number;
4076 easing?: Easing;
4077}
4078type ValueSequence = AbsoluteKeyframe[];
4079interface SequenceMap {
4080 [key: string]: ValueSequence;
4081}
4082type ResolvedAnimationDefinition = {
4083 keyframes: {
4084 [key: string]: UnresolvedValueKeyframe[];
4085 };
4086 transition: {
4087 [key: string]: Transition;
4088 };
4089};
4090type ResolvedAnimationDefinitions = Map<Element | MotionValue, ResolvedAnimationDefinition>;
4091
4092declare const createScopedAnimate: (scope?: AnimationScope) => {
4093 <V>(from: V, to: V | GenericKeyframesTarget<V>, options?: ValueAnimationTransition<V>): AnimationPlaybackControls;
4094 <V_1>(value: MotionValue<V_1>, keyframes: V_1 | GenericKeyframesTarget<V_1>, options?: ValueAnimationTransition<V_1> | undefined): AnimationPlaybackControls;
4095 (value: ElementOrSelector, keyframes: DOMKeyframesDefinition, options?: DynamicAnimationOptions): AnimationPlaybackControls;
4096 (sequence: AnimationSequence, options?: SequenceOptions): AnimationPlaybackControls;
4097};
4098declare const animate: {
4099 <V>(from: V, to: V | GenericKeyframesTarget<V>, options?: ValueAnimationTransition<V>): AnimationPlaybackControls;
4100 <V_1>(value: MotionValue<V_1>, keyframes: V_1 | GenericKeyframesTarget<V_1>, options?: ValueAnimationTransition<V_1> | undefined): AnimationPlaybackControls;
4101 (value: ElementOrSelector, keyframes: DOMKeyframesDefinition, options?: DynamicAnimationOptions): AnimationPlaybackControls;
4102 (sequence: AnimationSequence, options?: SequenceOptions): AnimationPlaybackControls;
4103};
4104
4105interface ScrollOptions {
4106 source?: Element;
4107 axis?: "x" | "y";
4108}
4109type OnScroll = (progress: number) => void;
4110interface AxisScrollInfo {
4111 current: number;
4112 offset: number[];
4113 progress: number;
4114 scrollLength: number;
4115 velocity: number;
4116 targetOffset: number;
4117 targetLength: number;
4118 containerLength: number;
4119 interpolatorOffsets?: number[];
4120 interpolate?: EasingFunction;
4121}
4122interface ScrollInfo {
4123 time: number;
4124 x: AxisScrollInfo;
4125 y: AxisScrollInfo;
4126}
4127type OnScrollInfo = (info: ScrollInfo) => void;
4128type SupportedEdgeUnit = "px" | "vw" | "vh" | "%";
4129type EdgeUnit = `${number}${SupportedEdgeUnit}`;
4130type NamedEdges = "start" | "end" | "center";
4131type EdgeString = NamedEdges | EdgeUnit | `${number}`;
4132type Edge = EdgeString | number;
4133type ProgressIntersection = [number, number];
4134type Intersection = `${Edge} ${Edge}`;
4135type ScrollOffset = Array<Edge | Intersection | ProgressIntersection>;
4136interface ScrollInfoOptions {
4137 container?: HTMLElement;
4138 target?: Element;
4139 axis?: "x" | "y";
4140 offset?: ScrollOffset;
4141 smooth?: number;
4142}
4143
4144declare class GroupPlaybackControls implements AnimationPlaybackControls {
4145 animations: AnimationPlaybackControls[];
4146 constructor(animations: Array<AnimationPlaybackControls | undefined>);
4147 then(onResolve: VoidFunction, onReject?: VoidFunction): Promise<void>;
4148 /**
4149 * TODO: Filter out cancelled or stopped animations before returning
4150 */
4151 private getAll;
4152 private setAll;
4153 attachTimeline(timeline: any): () => void;
4154 get time(): number;
4155 set time(time: number);
4156 get speed(): number;
4157 set speed(speed: number);
4158 get duration(): number;
4159 private runAll;
4160 play(): void;
4161 pause(): void;
4162 stop: () => void;
4163 cancel(): void;
4164 complete(): void;
4165}
4166
4167declare class ScrollTimeline implements ProgressTimeline {
4168 constructor(options: ScrollOptions);
4169 currentTime: null | {
4170 value: number;
4171 };
4172 cancel?: VoidFunction;
4173}
4174declare global {
4175 interface Window {
4176 ScrollTimeline: ScrollTimeline;
4177 }
4178}
4179declare function scroll(onScroll: OnScroll | GroupPlaybackControls, options?: ScrollOptions): VoidFunction;
4180
4181declare function scrollInfo(onScroll: OnScrollInfo, { container, ...options }?: ScrollInfoOptions): () => void;
4182
4183type ViewChangeHandler = (entry: IntersectionObserverEntry) => void;
4184type MarginValue = `${number}${'px' | '%'}`;
4185type MarginType = MarginValue | `${MarginValue} ${MarginValue}` | `${MarginValue} ${MarginValue} ${MarginValue}` | `${MarginValue} ${MarginValue} ${MarginValue} ${MarginValue}`;
4186interface InViewOptions {
4187 root?: Element | Document;
4188 margin?: MarginType;
4189 amount?: "some" | "all" | number;
4190}
4191declare function inView(elementOrSelector: ElementOrSelector, onStart: (entry: IntersectionObserverEntry) => void | ViewChangeHandler, { root, margin: rootMargin, amount }?: InViewOptions): VoidFunction;
4192
4193declare const anticipate: (p: number) => number;
4194
4195declare const backOut: (t: number) => number;
4196declare const backIn: EasingFunction;
4197declare const backInOut: EasingFunction;
4198
4199declare const circIn: EasingFunction;
4200declare const circOut: EasingFunction;
4201declare const circInOut: EasingFunction;
4202
4203declare const easeIn: (t: number) => number;
4204declare const easeOut: (t: number) => number;
4205declare const easeInOut: (t: number) => number;
4206
4207declare function cubicBezier(mX1: number, mY1: number, mX2: number, mY2: number): (t: number) => number;
4208
4209declare const mirrorEasing: EasingModifier;
4210
4211declare const reverseEasing: EasingModifier;
4212
4213type StaggerOrigin = "first" | "last" | "center" | number;
4214type StaggerOptions = {
4215 startDelay?: number;
4216 from?: StaggerOrigin;
4217 ease?: Easing;
4218};
4219declare function stagger(duration?: number, { startDelay, from, ease }?: StaggerOptions): DynamicOption<number>;
4220
4221/**
4222 * @public
4223 */
4224interface TransformOptions<T> {
4225 /**
4226 * Clamp values to within the given range. Defaults to `true`
4227 *
4228 * @public
4229 */
4230 clamp?: boolean;
4231 /**
4232 * Easing functions to use on the interpolations between each value in the input and output ranges.
4233 *
4234 * 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.
4235 *
4236 * @public
4237 */
4238 ease?: EasingFunction | EasingFunction[];
4239 /**
4240 * Provide a function that can interpolate between any two values in the provided range.
4241 *
4242 * @public
4243 */
4244 mixer?: (from: T, to: T) => (v: number) => any;
4245}
4246/**
4247 * Transforms numbers into other values by mapping them from an input range to an output range.
4248 * Returns the type of the input provided.
4249 *
4250 * @remarks
4251 *
4252 * Given an input range of `[0, 200]` and an output range of
4253 * `[0, 1]`, this function will return a value between `0` and `1`.
4254 * The input range must be a linear series of numbers. The output range
4255 * can be any supported value type, such as numbers, colors, shadows, arrays, objects and more.
4256 * Every value in the output range must be of the same type and in the same format.
4257 *
4258 * ```jsx
4259 * import * as React from "react"
4260 * import { transform } from "framer-motion"
4261 *
4262 * export function MyComponent() {
4263 * const inputRange = [0, 200]
4264 * const outputRange = [0, 1]
4265 * const output = transform(100, inputRange, outputRange)
4266 *
4267 * // Returns 0.5
4268 * return <div>{output}</div>
4269 * }
4270 * ```
4271 *
4272 * @param inputValue - A number to transform between the input and output ranges.
4273 * @param inputRange - A linear series of numbers (either all increasing or decreasing).
4274 * @param outputRange - A series of numbers, colors, strings, or arrays/objects of those. Must be the same length as `inputRange`.
4275 * @param options - Clamp: Clamp values to within the given range. Defaults to `true`.
4276 *
4277 * @public
4278 */
4279declare function transform<T>(inputValue: number, inputRange: number[], outputRange: T[], options?: TransformOptions<T>): T;
4280/**
4281 *
4282 * Transforms numbers into other values by mapping them from an input range to an output range.
4283 *
4284 * Given an input range of `[0, 200]` and an output range of
4285 * `[0, 1]`, this function will return a value between `0` and `1`.
4286 * The input range must be a linear series of numbers. The output range
4287 * can be any supported value type, such as numbers, colors, shadows, arrays, objects and more.
4288 * Every value in the output range must be of the same type and in the same format.
4289 *
4290 * ```jsx
4291 * import * as React from "react"
4292 * import { Frame, transform } from "framer"
4293 *
4294 * export function MyComponent() {
4295 * const inputRange = [-200, -100, 100, 200]
4296 * const outputRange = [0, 1, 1, 0]
4297 * const convertRange = transform(inputRange, outputRange)
4298 * const output = convertRange(-150)
4299 *
4300 * // Returns 0.5
4301 * return <div>{output}</div>
4302 * }
4303 *
4304 * ```
4305 *
4306 * @param inputRange - A linear series of numbers (either all increasing or decreasing).
4307 * @param outputRange - A series of numbers, colors or strings. Must be the same length as `inputRange`.
4308 * @param options - Clamp: clamp values to within the given range. Defaults to `true`.
4309 *
4310 * @public
4311 */
4312declare function transform<T>(inputRange: number[], outputRange: T[], options?: TransformOptions<T>): (inputValue: number) => T;
4313
4314declare const clamp: (min: number, max: number, v: number) => number;
4315
4316type DelayedFunction = (overshoot: number) => void;
4317/**
4318 * Timeout defined in ms
4319 */
4320declare function delay(callback: DelayedFunction, timeout: number): () => void;
4321
4322declare const distance: (a: number, b: number) => number;
4323declare function distance2D(a: Point, b: Point): number;
4324
4325type DevMessage = (check: boolean, message: string) => void;
4326declare let warning: DevMessage;
4327declare let invariant: DevMessage;
4328
4329type Mix<T> = (v: number) => T;
4330type MixerFactory<T> = (from: T, to: T) => Mix<T>;
4331interface InterpolateOptions<T> {
4332 clamp?: boolean;
4333 ease?: EasingFunction | EasingFunction[];
4334 mixer?: MixerFactory<T>;
4335}
4336/**
4337 * Create a function that maps from a numerical input array to a generic output array.
4338 *
4339 * Accepts:
4340 * - Numbers
4341 * - Colors (hex, hsl, hsla, rgb, rgba)
4342 * - Complex (combinations of one or more numbers or strings)
4343 *
4344 * ```jsx
4345 * const mixColor = interpolate([0, 1], ['#fff', '#000'])
4346 *
4347 * mixColor(0.5) // 'rgba(128, 128, 128, 1)'
4348 * ```
4349 *
4350 * TODO Revist this approach once we've moved to data models for values,
4351 * probably not needed to pregenerate mixer functions.
4352 *
4353 * @public
4354 */
4355declare function interpolate<T>(input: number[], output: T[], { clamp: isClamp, ease, mixer }?: InterpolateOptions<T>): (v: number) => T;
4356
4357type Mixer<T> = (p: number) => T;
4358
4359declare function mix<T>(from: T, to: T): Mixer<T>;
4360declare function mix(from: number, to: number, p: number): number;
4361
4362declare const pipe: (...transformers: Function[]) => Function;
4363
4364declare const progress: (from: number, to: number, value: number) => number;
4365
4366declare const wrap: (min: number, max: number, v: number) => number;
4367
4368type Process = (data: FrameData) => void;
4369type Schedule = (process: Process, keepAlive?: boolean, immediate?: boolean) => Process;
4370interface Step {
4371 schedule: Schedule;
4372 cancel: (process: Process) => void;
4373 process: (data: FrameData) => void;
4374}
4375type StepId = "read" | "resolveKeyframes" | "update" | "preRender" | "render" | "postRender";
4376type Batcher = {
4377 [key in StepId]: Schedule;
4378};
4379type Steps = {
4380 [key in StepId]: Step;
4381};
4382interface FrameData {
4383 delta: number;
4384 timestamp: number;
4385 isProcessing: boolean;
4386}
4387
4388declare const frame: Batcher;
4389declare const cancelFrame: (process: Process) => void;
4390declare const frameData: FrameData;
4391declare const steps: Steps;
4392
4393/**
4394 * @deprecated
4395 *
4396 * Import as `frame` instead.
4397 */
4398declare const sync: Batcher;
4399/**
4400 * @deprecated
4401 *
4402 * Use cancelFrame(callback) instead.
4403 */
4404declare const cancelSync: Record<string, (process: Process) => void>;
4405
4406declare const animations: FeaturePackages;
4407
4408interface MotionContextProps<Instance = unknown> {
4409 visualElement?: VisualElement<Instance>;
4410 initial?: false | string | string[];
4411 animate?: string | string[];
4412}
4413declare const MotionContext: react.Context<MotionContextProps<unknown>>;
4414
4415declare const createBox: () => Box;
4416
4417declare function calcLength(axis: Axis): number;
4418
4419declare function isDragActive(): boolean;
4420
4421type EventListenerWithPointInfo = (e: PointerEvent, info: EventInfo) => void;
4422declare const addPointerInfo: (handler: EventListenerWithPointInfo) => EventListener;
4423
4424declare function addPointerEvent(target: EventTarget, eventName: string, handler: EventListenerWithPointInfo, options?: AddEventListenerOptions): () => void;
4425
4426declare const isMotionValue: (value: any) => value is MotionValue<any>;
4427
4428declare const isBrowser: boolean;
4429
4430declare function useUnmountEffect(callback: () => void): void;
4431
4432declare const useIsomorphicLayoutEffect: typeof useEffect;
4433
4434declare function useForceUpdate(): [VoidFunction, number];
4435
4436/**
4437 * @public
4438 */
4439declare const domMin: FeatureBundle;
4440
4441/**
4442 * @public
4443 */
4444declare const domAnimation: FeatureBundle;
4445
4446/**
4447 * @public
4448 */
4449declare const domMax: FeatureBundle;
4450
4451/**
4452 * Creates a `MotionValue` to track the state and velocity of a value.
4453 *
4454 * Usually, these are created automatically. For advanced use-cases, like use with `useTransform`, you can create `MotionValue`s externally and pass them into the animated component via the `style` prop.
4455 *
4456 * ```jsx
4457 * export const MyComponent = () => {
4458 * const scale = useMotionValue(1)
4459 *
4460 * return <motion.div style={{ scale }} />
4461 * }
4462 * ```
4463 *
4464 * @param initial - The initial state.
4465 *
4466 * @public
4467 */
4468declare function useMotionValue<T>(initial: T): MotionValue<T>;
4469
4470/**
4471 * Combine multiple motion values into a new one using a string template literal.
4472 *
4473 * ```jsx
4474 * import {
4475 * motion,
4476 * useSpring,
4477 * useMotionValue,
4478 * useMotionTemplate
4479 * } from "framer-motion"
4480 *
4481 * function Component() {
4482 * const shadowX = useSpring(0)
4483 * const shadowY = useMotionValue(0)
4484 * const shadow = useMotionTemplate`drop-shadow(${shadowX}px ${shadowY}px 20px rgba(0,0,0,0.3))`
4485 *
4486 * return <motion.div style={{ filter: shadow }} />
4487 * }
4488 * ```
4489 *
4490 * @public
4491 */
4492declare function useMotionTemplate(fragments: TemplateStringsArray, ...values: Array<MotionValue | number | string>): MotionValue<string>;
4493
4494/**
4495 * If the provided value is a MotionValue, this returns the actual value, otherwise just the value itself
4496 *
4497 * TODO: Remove and move to library
4498 */
4499declare function resolveMotionValue(value?: string | number | CustomValueType | MotionValue): string | number;
4500
4501type InputRange = number[];
4502type SingleTransformer<I, O> = (input: I) => O;
4503type MultiTransformer<I, O> = (input: I[]) => O;
4504/**
4505 * Create a `MotionValue` that transforms the output of another `MotionValue` by mapping it from one range of values into another.
4506 *
4507 * @remarks
4508 *
4509 * Given an input range of `[-200, -100, 100, 200]` and an output range of
4510 * `[0, 1, 1, 0]`, the returned `MotionValue` will:
4511 *
4512 * - When provided a value between `-200` and `-100`, will return a value between `0` and `1`.
4513 * - When provided a value between `-100` and `100`, will return `1`.
4514 * - When provided a value between `100` and `200`, will return a value between `1` and `0`
4515 *
4516 *
4517 * The input range must be a linear series of numbers. The output range
4518 * can be any value type supported by Framer Motion: numbers, colors, shadows, etc.
4519 *
4520 * Every value in the output range must be of the same type and in the same format.
4521 *
4522 * ```jsx
4523 * export const MyComponent = () => {
4524 * const x = useMotionValue(0)
4525 * const xRange = [-200, -100, 100, 200]
4526 * const opacityRange = [0, 1, 1, 0]
4527 * const opacity = useTransform(x, xRange, opacityRange)
4528 *
4529 * return (
4530 * <motion.div
4531 * animate={{ x: 200 }}
4532 * style={{ opacity, x }}
4533 * />
4534 * )
4535 * }
4536 * ```
4537 *
4538 * @param inputValue - `MotionValue`
4539 * @param inputRange - A linear series of numbers (either all increasing or decreasing)
4540 * @param outputRange - A series of numbers, colors or strings. Must be the same length as `inputRange`.
4541 * @param options -
4542 *
4543 * - clamp: boolean. Clamp values to within the given range. Defaults to `true`
4544 * - ease: EasingFunction[]. 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.
4545 *
4546 * @returns `MotionValue`
4547 *
4548 * @public
4549 */
4550declare function useTransform<I, O>(value: MotionValue<number>, inputRange: InputRange, outputRange: O[], options?: TransformOptions<O>): MotionValue<O>;
4551/**
4552 * Create a `MotionValue` that transforms the output of another `MotionValue` through a function.
4553 * In this example, `y` will always be double `x`.
4554 *
4555 * ```jsx
4556 * export const MyComponent = () => {
4557 * const x = useMotionValue(10)
4558 * const y = useTransform(x, value => value * 2)
4559 *
4560 * return <motion.div style={{ x, y }} />
4561 * }
4562 * ```
4563 *
4564 * @param input - A `MotionValue` that will pass its latest value through `transform` to update the returned `MotionValue`.
4565 * @param transform - A function that accepts the latest value from `input` and returns a new value.
4566 * @returns `MotionValue`
4567 *
4568 * @public
4569 */
4570declare function useTransform<I, O>(input: MotionValue<I>, transformer: SingleTransformer<I, O>): MotionValue<O>;
4571/**
4572 * Pass an array of `MotionValue`s and a function to combine them. In this example, `z` will be the `x` multiplied by `y`.
4573 *
4574 * ```jsx
4575 * export const MyComponent = () => {
4576 * const x = useMotionValue(0)
4577 * const y = useMotionValue(0)
4578 * const z = useTransform([x, y], ([latestX, latestY]) => latestX * latestY)
4579 *
4580 * return <motion.div style={{ x, y, z }} />
4581 * }
4582 * ```
4583 *
4584 * @param input - An array of `MotionValue`s that will pass their latest values through `transform` to update the returned `MotionValue`.
4585 * @param transform - A function that accepts the latest values from `input` and returns a new value.
4586 * @returns `MotionValue`
4587 *
4588 * @public
4589 */
4590declare function useTransform<I, O>(input: MotionValue<string>[] | MotionValue<number>[] | MotionValue<string | number>[], transformer: MultiTransformer<I, O>): MotionValue<O>;
4591declare function useTransform<I, O>(transformer: () => O): MotionValue<O>;
4592
4593/**
4594 * Creates a `MotionValue` that, when `set`, will use a spring animation to animate to its new state.
4595 *
4596 * It can either work as a stand-alone `MotionValue` by initialising it with a value, or as a subscriber
4597 * to another `MotionValue`.
4598 *
4599 * @remarks
4600 *
4601 * ```jsx
4602 * const x = useSpring(0, { stiffness: 300 })
4603 * const y = useSpring(x, { damping: 10 })
4604 * ```
4605 *
4606 * @param inputValue - `MotionValue` or number. If provided a `MotionValue`, when the input `MotionValue` changes, the created `MotionValue` will spring towards that value.
4607 * @param springConfig - Configuration options for the spring.
4608 * @returns `MotionValue`
4609 *
4610 * @public
4611 */
4612declare function useSpring(source: MotionValue<string> | MotionValue<number> | number, config?: SpringOptions): MotionValue<number>;
4613
4614/**
4615 * Creates a `MotionValue` that updates when the velocity of the provided `MotionValue` changes.
4616 *
4617 * ```javascript
4618 * const x = useMotionValue(0)
4619 * const xVelocity = useVelocity(x)
4620 * const xAcceleration = useVelocity(xVelocity)
4621 * ```
4622 *
4623 * @public
4624 */
4625declare function useVelocity(value: MotionValue<number>): MotionValue<number>;
4626
4627interface UseScrollOptions extends Omit<ScrollInfoOptions, "container" | "target"> {
4628 container?: RefObject$1<HTMLElement>;
4629 target?: RefObject$1<HTMLElement>;
4630 layoutEffect?: boolean;
4631}
4632declare function useScroll({ container, target, layoutEffect, ...options }?: UseScrollOptions): {
4633 scrollX: MotionValue<number>;
4634 scrollY: MotionValue<number>;
4635 scrollXProgress: MotionValue<number>;
4636 scrollYProgress: MotionValue<number>;
4637};
4638
4639/**
4640 * @deprecated useElementScroll is deprecated. Convert to useScroll({ container: ref })
4641 */
4642declare function useElementScroll(ref: RefObject$1<HTMLElement>): {
4643 scrollX: MotionValue<number>;
4644 scrollY: MotionValue<number>;
4645 scrollXProgress: MotionValue<number>;
4646 scrollYProgress: MotionValue<number>;
4647};
4648
4649/**
4650 * @deprecated useViewportScroll is deprecated. Convert to useScroll()
4651 */
4652declare function useViewportScroll(): {
4653 scrollX: MotionValue<number>;
4654 scrollY: MotionValue<number>;
4655 scrollXProgress: MotionValue<number>;
4656 scrollYProgress: MotionValue<number>;
4657};
4658
4659declare function useTime(): MotionValue<number>;
4660
4661interface WillChange extends MotionValue {
4662 add(name: string): undefined | VoidFunction;
4663}
4664
4665declare function useWillChange(): WillChange;
4666
4667declare function useMotionValueEvent<V, EventName extends keyof MotionValueEventCallbacks<V>>(value: MotionValue<V>, event: EventName, callback: MotionValueEventCallbacks<V>[EventName]): void;
4668
4669/**
4670 * A hook that returns `true` if we should be using reduced motion based on the current device's Reduced Motion setting.
4671 *
4672 * This can be used to implement changes to your UI based on Reduced Motion. For instance, replacing motion-sickness inducing
4673 * `x`/`y` animations with `opacity`, disabling the autoplay of background videos, or turning off parallax motion.
4674 *
4675 * It will actively respond to changes and re-render your components with the latest setting.
4676 *
4677 * ```jsx
4678 * export function Sidebar({ isOpen }) {
4679 * const shouldReduceMotion = useReducedMotion()
4680 * const closedX = shouldReduceMotion ? 0 : "-100%"
4681 *
4682 * return (
4683 * <motion.div animate={{
4684 * opacity: isOpen ? 1 : 0,
4685 * x: isOpen ? 0 : closedX
4686 * }} />
4687 * )
4688 * }
4689 * ```
4690 *
4691 * @return boolean
4692 *
4693 * @public
4694 */
4695declare function useReducedMotion(): boolean | null;
4696
4697declare function useReducedMotionConfig(): boolean | null;
4698
4699/**
4700 * @public
4701 */
4702declare function animationControls(): AnimationControls;
4703
4704declare function useAnimate<T extends Element = any>(): [AnimationScope<T>, {
4705 <V>(from: V, to: V | GenericKeyframesTarget<V>, options?: ValueAnimationTransition<V> | undefined): AnimationPlaybackControls;
4706 <V_1>(value: MotionValue<V_1>, keyframes: V_1 | GenericKeyframesTarget<V_1>, options?: ValueAnimationTransition<V_1> | undefined): AnimationPlaybackControls;
4707 (value: ElementOrSelector, keyframes: DOMKeyframesDefinition, options?: DynamicAnimationOptions | undefined): AnimationPlaybackControls;
4708 (sequence: AnimationSequence, options?: SequenceOptions | undefined): AnimationPlaybackControls;
4709}];
4710
4711/**
4712 * Creates `AnimationControls`, which can be used to manually start, stop
4713 * and sequence animations on one or more components.
4714 *
4715 * The returned `AnimationControls` should be passed to the `animate` property
4716 * of the components you want to animate.
4717 *
4718 * These components can then be animated with the `start` method.
4719 *
4720 * ```jsx
4721 * import * as React from 'react'
4722 * import { motion, useAnimation } from 'framer-motion'
4723 *
4724 * export function MyComponent(props) {
4725 * const controls = useAnimation()
4726 *
4727 * controls.start({
4728 * x: 100,
4729 * transition: { duration: 0.5 },
4730 * })
4731 *
4732 * return <motion.div animate={controls} />
4733 * }
4734 * ```
4735 *
4736 * @returns Animation controller with `start` and `stop` methods
4737 *
4738 * @public
4739 */
4740declare function useAnimationControls(): AnimationControls;
4741declare const useAnimation: typeof useAnimationControls;
4742
4743type FrameCallback = (timestamp: number, delta: number) => void;
4744declare function useAnimationFrame(callback: FrameCallback): void;
4745
4746declare function animateVisualElement(visualElement: VisualElement, definition: AnimationDefinition, options?: VisualElementAnimationOptions): Promise<void>;
4747
4748type Cycle = (i?: number) => void;
4749type CycleState<T> = [T, Cycle];
4750/**
4751 * Cycles through a series of visual properties. Can be used to toggle between or cycle through animations. It works similar to `useState` in React. It is provided an initial array of possible states, and returns an array of two arguments.
4752 *
4753 * An index value can be passed to the returned `cycle` function to cycle to a specific index.
4754 *
4755 * ```jsx
4756 * import * as React from "react"
4757 * import { motion, useCycle } from "framer-motion"
4758 *
4759 * export const MyComponent = () => {
4760 * const [x, cycleX] = useCycle(0, 50, 100)
4761 *
4762 * return (
4763 * <motion.div
4764 * animate={{ x: x }}
4765 * onTap={() => cycleX()}
4766 * />
4767 * )
4768 * }
4769 * ```
4770 *
4771 * @param items - items to cycle through
4772 * @returns [currentState, cycleState]
4773 *
4774 * @public
4775 */
4776declare function useCycle<T>(...items: T[]): CycleState<T>;
4777
4778/**
4779 * Check whether a prop name is a valid `MotionProp` key.
4780 *
4781 * @param key - Name of the property to check
4782 * @returns `true` is key is a valid `MotionProp`.
4783 *
4784 * @public
4785 */
4786declare function isValidMotionProp(key: string): boolean;
4787
4788type SafeToRemove = () => void;
4789type AlwaysPresent = [true, null];
4790type Present = [true];
4791type NotPresent = [false, SafeToRemove];
4792/**
4793 * When a component is the child of `AnimatePresence`, it can use `usePresence`
4794 * to access information about whether it's still present in the React tree.
4795 *
4796 * ```jsx
4797 * import { usePresence } from "framer-motion"
4798 *
4799 * export const Component = () => {
4800 * const [isPresent, safeToRemove] = usePresence()
4801 *
4802 * useEffect(() => {
4803 * !isPresent && setTimeout(safeToRemove, 1000)
4804 * }, [isPresent])
4805 *
4806 * return <div />
4807 * }
4808 * ```
4809 *
4810 * If `isPresent` is `false`, it means that a component has been removed the tree, but
4811 * `AnimatePresence` won't really remove it until `safeToRemove` has been called.
4812 *
4813 * @public
4814 */
4815declare function usePresence(): AlwaysPresent | Present | NotPresent;
4816/**
4817 * Similar to `usePresence`, except `useIsPresent` simply returns whether or not the component is present.
4818 * There is no `safeToRemove` function.
4819 *
4820 * ```jsx
4821 * import { useIsPresent } from "framer-motion"
4822 *
4823 * export const Component = () => {
4824 * const isPresent = useIsPresent()
4825 *
4826 * useEffect(() => {
4827 * !isPresent && console.log("I've been removed!")
4828 * }, [isPresent])
4829 *
4830 * return <div />
4831 * }
4832 * ```
4833 *
4834 * @public
4835 */
4836declare function useIsPresent(): boolean;
4837
4838interface UseInViewOptions extends Omit<InViewOptions, "root" | "amount"> {
4839 root?: RefObject$1<Element>;
4840 once?: boolean;
4841 amount?: "some" | "all" | number;
4842}
4843declare function useInView(ref: RefObject$1<Element>, { root, margin, amount, once }?: UseInViewOptions): boolean;
4844
4845/**
4846 * Attaches an event listener directly to the provided DOM element.
4847 *
4848 * Bypassing React's event system can be desirable, for instance when attaching non-passive
4849 * event handlers.
4850 *
4851 * ```jsx
4852 * const ref = useRef(null)
4853 *
4854 * useDomEvent(ref, 'wheel', onWheel, { passive: false })
4855 *
4856 * return <div ref={ref} />
4857 * ```
4858 *
4859 * @param ref - React.RefObject that's been provided to the element you want to bind the listener to.
4860 * @param eventName - Name of the event you want listen for.
4861 * @param handler - Function to fire when receiving the event.
4862 * @param options - Options to pass to `Event.addEventListener`.
4863 *
4864 * @public
4865 */
4866declare function useDomEvent(ref: RefObject$1<EventTarget>, eventName: string, handler?: EventListener | undefined, options?: AddEventListenerOptions): void;
4867
4868/**
4869 * Checks if a component is a `motion` component.
4870 */
4871declare function isMotionComponent(component: React.ComponentType | string): boolean;
4872
4873/**
4874 * Unwraps a `motion` component and returns either a string for `motion.div` or
4875 * the React component for `motion(Component)`.
4876 *
4877 * If the component is not a `motion` component it returns undefined.
4878 */
4879declare function unwrapMotionComponent(component: React.ComponentType | string): React.ComponentType | string | undefined;
4880
4881type ScaleCorrector = (latest: string | number, node: IProjectionNode) => string | number;
4882interface ScaleCorrectorDefinition {
4883 correct: ScaleCorrector;
4884 applyTo?: string[];
4885}
4886interface ScaleCorrectorMap {
4887 [key: string]: ScaleCorrectorDefinition;
4888}
4889
4890declare function addScaleCorrector(correctors: ScaleCorrectorMap): void;
4891
4892declare function useInstantTransition(): (callback: () => void) => void;
4893declare function disableInstantTransitions(): void;
4894
4895declare function useInstantLayoutTransition(): (cb?: (() => void) | undefined) => void;
4896
4897declare function useResetProjection(): () => void;
4898
4899/**
4900 * Build a CSS transform style from individual x/y/scale etc properties.
4901 *
4902 * This outputs with a default order of transforms/scales/rotations, this can be customised by
4903 * providing a transformTemplate function.
4904 */
4905declare function buildTransform(transform: HTMLRenderState["transform"], transformIsDefault: boolean, transformTemplate?: MotionProps["transformTemplate"]): string;
4906
4907declare const visualElementStore: WeakMap<any, VisualElement<unknown, unknown, {}>>;
4908
4909interface ValueAnimationOptionsWithDefaults<T extends string | number> extends ValueAnimationOptions<T> {
4910 autoplay: boolean;
4911 delay: number;
4912 repeat: number;
4913 repeatDelay: number;
4914 repeatType: RepeatType;
4915}
4916declare abstract class BaseAnimation<T extends string | number, Resolved> implements AnimationPlaybackControls {
4917 protected options: ValueAnimationOptionsWithDefaults<T>;
4918 protected resolveFinishedPromise: VoidFunction;
4919 protected currentFinishedPromise: Promise<void>;
4920 protected isStopped: boolean;
4921 protected _resolved: Resolved & {
4922 keyframes: ResolvedKeyframes<T>;
4923 };
4924 protected hasAttemptedResolve: boolean;
4925 protected resolver: KeyframeResolver<T>;
4926 constructor({ autoplay, delay, type, repeat, repeatDelay, repeatType, ...options }: ValueAnimationOptions<T>);
4927 protected abstract initPlayback(keyframes: ResolvedKeyframes<T>, finalKeyframe?: T): Resolved | false;
4928 abstract play(): void;
4929 abstract pause(): void;
4930 abstract stop(): void;
4931 abstract cancel(): void;
4932 abstract complete(): void;
4933 abstract get speed(): number;
4934 abstract set speed(newSpeed: number);
4935 abstract get time(): number;
4936 abstract set time(newTime: number);
4937 abstract get duration(): number;
4938 abstract get state(): AnimationPlayState;
4939 /**
4940 * A getter for resolved data. If keyframes are not yet resolved, accessing
4941 * this.resolved will synchronously flush all pending keyframe resolvers.
4942 * This is a deoptimisation, but at its worst still batches read/writes.
4943 */
4944 get resolved(): (Resolved & {
4945 keyframes: ResolvedKeyframes<T>;
4946 finalKeyframe?: T;
4947 }) | undefined;
4948 /**
4949 * A method to be called when the keyframes resolver completes. This method
4950 * will check if its possible to run the animation and, if not, skip it.
4951 * Otherwise, it will call initPlayback on the implementing class.
4952 */
4953 protected onKeyframesResolved(keyframes: ResolvedKeyframes<T>, finalKeyframe?: T): void;
4954 onPostResolved(): void;
4955 /**
4956 * Allows the returned animation to be awaited or promise-chained. Currently
4957 * resolves when the animation finishes at all but in a future update could/should
4958 * reject if its cancels.
4959 */
4960 then(resolve: VoidFunction, reject?: VoidFunction): Promise<void>;
4961 protected updateFinishedPromise(): void;
4962}
4963
4964interface AnimationState<V> {
4965 value: V;
4966 done: boolean;
4967}
4968interface KeyframeGenerator<V> {
4969 calculatedDuration: null | number;
4970 next: (t: number) => AnimationState<V>;
4971}
4972
4973interface ResolvedData<T extends string | number> {
4974 generator: KeyframeGenerator<T>;
4975 mirroredGenerator: KeyframeGenerator<T> | undefined;
4976 mapPercentToKeyframes: ((v: number) => T) | undefined;
4977 /**
4978 * Duration of the animation as calculated by the generator.
4979 */
4980 calculatedDuration: number;
4981 /**
4982 * Duration of the animation plus repeatDelay.
4983 */
4984 resolvedDuration: number;
4985 /**
4986 * Total duration of the animation including repeats.
4987 */
4988 totalDuration: number;
4989}
4990/**
4991 * Animation that runs on the main thread. Designed to be WAAPI-spec in the subset of
4992 * features we expose publically. Mostly the compatibility is to ensure visual identity
4993 * between both WAAPI and main thread animations.
4994 */
4995declare class MainThreadAnimation<T extends string | number> extends BaseAnimation<T, ResolvedData<T>> {
4996 /**
4997 * The driver that's controlling the animation loop. Normally this is a requestAnimationFrame loop
4998 * but in tests we can pass in a synchronous loop.
4999 */
5000 private driver?;
5001 /**
5002 * The time at which the animation was paused.
5003 */
5004 private holdTime;
5005 /**
5006 * The time at which the animation was started.
5007 */
5008 private startTime;
5009 /**
5010 * The time at which the animation was cancelled.
5011 */
5012 private cancelTime;
5013 /**
5014 * The current time of the animation.
5015 */
5016 private currentTime;
5017 /**
5018 * Playback speed as a factor. 0 would be stopped, -1 reverse and 2 double speed.
5019 */
5020 private playbackSpeed;
5021 /**
5022 * The state of the animation to apply when the animation is resolved. This
5023 * allows calls to the public API to control the animation before it is resolved,
5024 * without us having to resolve it first.
5025 */
5026 private pendingPlayState;
5027 constructor({ KeyframeResolver, ...options }: ValueAnimationOptions<T>);
5028 protected initPlayback(keyframes: ResolvedKeyframes<T>): {
5029 generator: KeyframeGenerator<any>;
5030 mirroredGenerator: KeyframeGenerator<T> | undefined;
5031 mapPercentToKeyframes: ((v: number) => T) | undefined;
5032 calculatedDuration: number;
5033 resolvedDuration: number;
5034 totalDuration: number;
5035 };
5036 onPostResolved(): void;
5037 tick(timestamp: number, sample?: boolean): {
5038 done: boolean;
5039 value: T;
5040 };
5041 state: AnimationPlayState;
5042 get duration(): number;
5043 get time(): number;
5044 set time(newTime: number);
5045 get speed(): number;
5046 set speed(newSpeed: number);
5047 play(): void;
5048 pause(): void;
5049 /**
5050 * This method is bound to the instance to fix a pattern where
5051 * animation.stop is returned as a reference from a useEffect.
5052 */
5053 stop: () => void;
5054 complete(): void;
5055 finish(): void;
5056 cancel(): void;
5057 private teardown;
5058 private stopDriver;
5059 sample(time: number): AnimationState<T>;
5060}
5061declare function animateValue(options: ValueAnimationOptions<any>): MainThreadAnimation<any>;
5062
5063type Transformer = (v: any) => any;
5064type ValueType = {
5065 test: (v: any) => boolean;
5066 parse: (v: any) => any;
5067 transform?: Transformer;
5068 createTransformer?: (template: string) => Transformer;
5069 default?: any;
5070 getAnimatableNone?: (v: any) => any;
5071};
5072type RGBA = {
5073 red: number;
5074 green: number;
5075 blue: number;
5076 alpha: number;
5077};
5078type HSLA = {
5079 hue: number;
5080 saturation: number;
5081 lightness: number;
5082 alpha: number;
5083};
5084type Color = HSLA | RGBA;
5085
5086declare const color: {
5087 test: (v: any) => boolean;
5088 parse: (v: any) => RGBA | HSLA;
5089 transform: (v: HSLA | RGBA | string) => string;
5090};
5091
5092type CSSVariableName = `--${string}`;
5093type CSSVariableToken = `var(${CSSVariableName})`;
5094
5095declare function test(v: any): boolean;
5096type ComplexValues = Array<CSSVariableToken | string | number | Color>;
5097declare function parseComplexValue(v: string | number): ComplexValues;
5098declare function createTransformer(source: string | number): (v: Array<CSSVariableToken | Color | number | string>) => string;
5099declare function getAnimatableNone(v: string | number): string;
5100declare const complex: {
5101 test: typeof test;
5102 parse: typeof parseComplexValue;
5103 createTransformer: typeof createTransformer;
5104 getAnimatableNone: typeof getAnimatableNone;
5105};
5106
5107declare const px: {
5108 test: (v: string | number) => boolean;
5109 parse: typeof parseFloat;
5110 transform: (v: number | string) => string;
5111};
5112
5113declare const MotionGlobalConfig: {
5114 skipAnimations: boolean;
5115 useManualTiming: boolean;
5116};
5117
5118interface AcceleratedValueAnimationOptions<T extends string | number = number> extends ValueAnimationOptions<T> {
5119 name: string;
5120 motionValue: MotionValue<T>;
5121}
5122interface ResolvedAcceleratedAnimation {
5123 animation: Animation;
5124 duration: number;
5125 times: ValueAnimationOptions["times"];
5126 type: ValueAnimationOptions["type"];
5127 ease: ValueAnimationOptions["ease"];
5128 keyframes: string[] | number[];
5129}
5130declare class AcceleratedAnimation<T extends string | number> extends BaseAnimation<T, ResolvedAcceleratedAnimation> {
5131 protected options: ValueAnimationOptionsWithDefaults<T> & {
5132 name: string;
5133 motionValue: MotionValue<T>;
5134 };
5135 constructor(options: ValueAnimationOptions<T>);
5136 /**
5137 * An AnimationTimline to attach to the WAAPI animation once it's created.
5138 */
5139 private pendingTimeline;
5140 protected initPlayback(keyframes: ResolvedKeyframes<T>, finalKeyframe: T): false | {
5141 animation: Animation;
5142 duration: number;
5143 times: number[] | undefined;
5144 type: "keyframes" | "spring" | "decay" | "tween" | "inertia" | undefined;
5145 ease: Easing | Easing[] | undefined;
5146 keyframes: number[] | string[];
5147 };
5148 get duration(): number;
5149 get time(): number;
5150 set time(newTime: number);
5151 get speed(): number;
5152 set speed(newSpeed: number);
5153 get state(): AnimationPlayState;
5154 /**
5155 * Replace the default DocumentTimeline with another AnimationTimeline.
5156 * Currently used for scroll animations.
5157 */
5158 attachTimeline(timeline: any): (any: void) => void;
5159 play(): void;
5160 pause(): void;
5161 stop(): void;
5162 complete(): void;
5163 cancel(): void;
5164 static supports(options: ValueAnimationOptions): options is AcceleratedValueAnimationOptions;
5165}
5166
5167interface NativeAnimationOptions {
5168 delay?: number;
5169 duration?: number;
5170 ease?: Easing | Easing[];
5171 times?: number[];
5172 repeat?: number;
5173 repeatType?: "loop" | "reverse" | "mirror";
5174}
5175
5176type HandoffFunction = (storeId: string, valueName: string, value?: MotionValue, frame?: Batcher) => null | number;
5177/**
5178 * The window global object acts as a bridge between our inline script
5179 * triggering the optimized appear animations, and Framer Motion.
5180 */
5181declare global {
5182 interface Window {
5183 HandoffAppearAnimations?: HandoffFunction;
5184 HandoffComplete?: boolean;
5185 HandoffCancelAllAnimations?: VoidFunction;
5186 }
5187}
5188
5189declare function startOptimizedAppearAnimation(element: HTMLElement, name: string, keyframes: string[] | number[], options: NativeAnimationOptions, onReady?: (animation: Animation) => void): void;
5190
5191declare const optimizedAppearDataAttribute: "data-framer-appear-id";
5192
5193declare function spring({ keyframes, restDelta, restSpeed, ...options }: ValueAnimationOptions<number>): KeyframeGenerator<number>;
5194
5195interface NodeGroup {
5196 add: (node: IProjectionNode) => void;
5197 remove: (node: IProjectionNode) => void;
5198 dirty: VoidFunction;
5199}
5200
5201interface LayoutGroupContextProps {
5202 id?: string;
5203 group?: NodeGroup;
5204 forceRender?: VoidFunction;
5205}
5206declare const LayoutGroupContext: react.Context<LayoutGroupContextProps>;
5207
5208/**
5209 * @public
5210 */
5211interface ScrollMotionValues {
5212 scrollX: MotionValue<number>;
5213 scrollY: MotionValue<number>;
5214 scrollXProgress: MotionValue<number>;
5215 scrollYProgress: MotionValue<number>;
5216}
5217
5218/**
5219 * Note: Still used by components generated by old versions of Framer
5220 *
5221 * @deprecated
5222 */
5223declare const DeprecatedLayoutGroupContext: react.Context<string | null>;
5224
5225/**
5226 * This is not an officially supported API and may be removed
5227 * on any version.
5228 */
5229declare function useAnimatedState(initialState: any): any[];
5230
5231interface ScaleMotionValues {
5232 scaleX: MotionValue<number>;
5233 scaleY: MotionValue<number>;
5234}
5235/**
5236 * Returns a `MotionValue` each for `scaleX` and `scaleY` that update with the inverse
5237 * of their respective parent scales.
5238 *
5239 * This is useful for undoing the distortion of content when scaling a parent component.
5240 *
5241 * By default, `useInvertedScale` will automatically fetch `scaleX` and `scaleY` from the nearest parent.
5242 * By passing other `MotionValue`s in as `useInvertedScale({ scaleX, scaleY })`, it will invert the output
5243 * of those instead.
5244 *
5245 * ```jsx
5246 * const MyComponent = () => {
5247 * const { scaleX, scaleY } = useInvertedScale()
5248 * return <motion.div style={{ scaleX, scaleY }} />
5249 * }
5250 * ```
5251 *
5252 * @deprecated
5253 */
5254declare function useInvertedScale(scale?: Partial<ScaleMotionValues>): ScaleMotionValues;
5255
5256declare const AnimateSharedLayout: react.FunctionComponent<react.PropsWithChildren<unknown>>;
5257
5258export { type AbsoluteKeyframe, AcceleratedAnimation, AnimatePresence, type AnimatePresenceProps, AnimateSharedLayout, type AnimationControls, type AnimationDefinition, type AnimationLifecycles, type AnimationOptionsWithValueOverrides, type AnimationPlaybackControls, type AnimationPlaybackLifecycles, type AnimationPlaybackOptions, type AnimationProps, type AnimationScope, type AnimationSequence, type AnimationType, type At, type Axis, type AxisDelta, type BezierDefinition, type BoundingBox, type Box, type CSSStyleDeclarationWithTransform, type CreateVisualElement, type CustomDomComponent, type CustomValueType, type Cycle, type CycleState, type DOMKeyframesDefinition, type DOMMotionComponents, type DOMSegment, type DOMSegmentWithTransition, type DecayOptions, type DelayedFunction, type Delta, DeprecatedLayoutGroupContext, type DevMessage, DragControls, type DragElastic, type DragHandlers, type DraggableProps, type DurationSpringOptions, type DynamicAnimationOptions, type DynamicOption, type Easing, type EasingDefinition, type EasingFunction, type EasingModifier, type ElementOrSelector, type EventInfo, type FeatureBundle, type FeatureDefinition, type FeatureDefinitions, type FeaturePackage, type FeaturePackages, FlatTree, type FocusHandlers, type ForwardRefComponent, type HTMLMotionProps, type HoverHandlers, type HydratedFeatureDefinition, type HydratedFeatureDefinitions, type IProjectionNode, type Inertia, type InertiaOptions$1 as InertiaOptions, type InterpolateOptions, type KeyframeOptions, type Keyframes, type KeyframesTarget, LayoutGroup, LayoutGroupContext, type LayoutProps, type LazyFeatureBundle$1 as LazyFeatureBundle, LazyMotion, type LazyProps, type MixerFactory, type MotionAdvancedProps, MotionConfig, MotionConfigContext, type MotionConfigProps, MotionContext, MotionGlobalConfig, type MotionProps, type MotionStyle, type MotionTransform, MotionValue, type MotionValueSegment, type MotionValueSegmentWithTransition, type None, type Orchestration, type PanHandlers, type PanInfo, type PassiveEffect, type Point, PresenceContext, type RelayoutInfo, type RenderComponent, Reorder, type Repeat, type RepeatType, type ResolveKeyframes, type ResolveLayoutTransition, type ResolvedAnimationDefinition, type ResolvedAnimationDefinitions, type ResolvedKeyframesTarget, type ResolvedSingleTarget, type ResolvedValueTarget, type ResolvedValues, type SVGAttributesAsMotionValues, type SVGKeyframesDefinition, type SVGMotionProps, type SVGPathKeyframesDefinition, type SVGPathTransitions, type SVGTransitions, type ScrapeMotionValuesFromProps, type ScrollMotionValues, type Segment, type SequenceLabel, type SequenceLabelWithTime, type SequenceMap, type SequenceOptions, type SequenceTime, type SingleTarget, type Spring, type SpringOptions, type StyleKeyframesDefinition, type StyleTransitions, type Subscriber, SwitchLayoutGroupContext, type TapHandlers, type TapInfo, type Target, type TargetAndTransition, type TransformPoint, type Transition$1 as Transition, type Tween, type UnresolvedValueKeyframe, type UseInViewOptions, type UseScrollOptions, type ValueAnimationOptions, type ValueAnimationTransition, type ValueKeyframe, type ValueKeyframesDefinition, type ValueSequence, type ValueTarget, type ValueType, type VariableKeyframesDefinition, type VariableTransitions, type Variant, type VariantLabels, type Variants, type VelocityOptions, VisualElement, type VisualState, addPointerEvent, addPointerInfo, addScaleCorrector, animate, animateValue, animateVisualElement, animationControls, animations, anticipate, backIn, backInOut, backOut, buildTransform, calcLength, cancelFrame, cancelSync, circIn, circInOut, circOut, clamp, color, complex, createBox, createDomMotionComponent, createMotionComponent, createScopedAnimate, cubicBezier, delay, disableInstantTransitions, distance, distance2D, domAnimation, domMax, domMin, easeIn, easeInOut, easeOut, filterProps, frame, frameData, inView, interpolate, invariant, isBrowser, isDragActive, isMotionComponent, isMotionValue, isValidMotionProp, m, makeUseVisualState, mirrorEasing, mix, motion, motionValue, optimizedAppearDataAttribute, pipe, progress, px, resolveMotionValue, reverseEasing, scroll, scrollInfo, spring, stagger, startOptimizedAppearAnimation, steps, sync, transform, unwrapMotionComponent, useAnimate, useAnimation, useAnimationControls, useAnimationFrame, useCycle, useAnimatedState as useDeprecatedAnimatedState, useInvertedScale as useDeprecatedInvertedScale, useDomEvent, useDragControls, useElementScroll, useForceUpdate, useInView, useInstantLayoutTransition, useInstantTransition, useIsPresent, useIsomorphicLayoutEffect, useMotionTemplate, useMotionValue, useMotionValueEvent, usePresence, useReducedMotion, useReducedMotionConfig, useResetProjection, useScroll, useSpring, useTime, useTransform, useUnmountEffect, useVelocity, useViewportScroll, useWillChange, visualElementStore, warning, wrap };