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