react-ui-animate 5.2.0-next.6 → 5.3.0-next.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. package/dist/index.d.ts +651 -5
  2. package/dist/index.mjs +1 -0
  3. package/package.json +34 -24
  4. package/dist/animation/Config.d.ts +0 -63
  5. package/dist/animation/descriptors.d.ts +0 -7
  6. package/dist/animation/drivers.d.ts +0 -4
  7. package/dist/animation/helpers.d.ts +0 -3
  8. package/dist/animation/hooks/index.d.ts +0 -2
  9. package/dist/animation/hooks/useMount.d.ts +0 -16
  10. package/dist/animation/hooks/useValue.d.ts +0 -9
  11. package/dist/animation/index.d.ts +0 -5
  12. package/dist/animation/modules/Mount.d.ts +0 -17
  13. package/dist/animation/modules/index.d.ts +0 -1
  14. package/dist/animation/to.d.ts +0 -2
  15. package/dist/animation/types.d.ts +0 -42
  16. package/dist/gestures/controllers/DragGesture.d.ts +0 -47
  17. package/dist/gestures/controllers/Gesture.d.ts +0 -13
  18. package/dist/gestures/controllers/MoveGesture.d.ts +0 -30
  19. package/dist/gestures/controllers/ScrollGesture.d.ts +0 -29
  20. package/dist/gestures/controllers/WheelGesture.d.ts +0 -28
  21. package/dist/gestures/hooks/index.d.ts +0 -4
  22. package/dist/gestures/hooks/useDrag.d.ts +0 -5
  23. package/dist/gestures/hooks/useMove.d.ts +0 -8
  24. package/dist/gestures/hooks/useRecognizer.d.ts +0 -13
  25. package/dist/gestures/hooks/useScroll.d.ts +0 -11
  26. package/dist/gestures/hooks/useWheel.d.ts +0 -8
  27. package/dist/hooks/events/useOutsideClick.d.ts +0 -2
  28. package/dist/hooks/index.d.ts +0 -2
  29. package/dist/hooks/observers/useInView.d.ts +0 -5
  30. package/dist/hooks/observers/useScrollProgress.d.ts +0 -23
  31. package/dist/index.js +0 -2
  32. package/dist/index.js.map +0 -1
  33. package/dist/utils/index.d.ts +0 -4
package/dist/index.d.ts CHANGED
@@ -1,5 +1,651 @@
1
- export { combine, Easing, makeMotion as makeAnimated, motion as animate, } from '@raidipesh78/re-motion';
2
- export * from './animation';
3
- export * from './hooks';
4
- export * from './gestures/hooks';
5
- export * from './utils';
1
+ import * as react from 'react';
2
+ import { RefObject, AllHTMLAttributes, SVGAttributes, CSSProperties, ReactNode, ReactElement, DependencyList } from 'react';
3
+
4
+ interface AnimateController {
5
+ start(): void;
6
+ pause(): void;
7
+ resume(): void;
8
+ cancel(): void;
9
+ reset(): void;
10
+ setOnComplete?(fn: () => void): void;
11
+ }
12
+ interface AnimateHooks {
13
+ onStart?(): void;
14
+ onPause?(): void;
15
+ onResume?(): void;
16
+ onComplete?(): void;
17
+ }
18
+
19
+ type Primitive = number | string;
20
+ type ExtrapolateType = 'identity' | 'extend' | 'clamp';
21
+ interface ExtrapolateConfig {
22
+ extrapolate?: ExtrapolateType;
23
+ extrapolateRight?: ExtrapolateType;
24
+ extrapolateLeft?: ExtrapolateType;
25
+ easing?: (t: number) => number;
26
+ }
27
+ interface Callbacks {
28
+ onStart?: () => void;
29
+ onChange?: (v: number) => void;
30
+ onComplete?: () => void;
31
+ }
32
+ interface SpringOptions$1 {
33
+ stiffness?: number;
34
+ damping?: number;
35
+ mass?: number;
36
+ from?: number;
37
+ }
38
+ interface TimingOptions$1 {
39
+ duration?: number;
40
+ easing?: (t: number) => number;
41
+ from?: number;
42
+ }
43
+ interface DecayOptions$1 {
44
+ velocity?: number;
45
+ clamp?: [number, number];
46
+ elastic?: boolean | number;
47
+ }
48
+ interface SequenceOptions {
49
+ animations?: Descriptor[];
50
+ }
51
+ interface DelayOptions {
52
+ delay?: number;
53
+ }
54
+ interface LoopOptions {
55
+ iterations?: number;
56
+ animation?: Descriptor;
57
+ }
58
+ type DriverType = 'spring' | 'timing' | 'decay' | 'delay' | 'sequence' | 'loop';
59
+ interface Descriptor {
60
+ type: DriverType;
61
+ to?: Primitive | Primitive[] | Record<string, Primitive>;
62
+ options?: SpringOptions$1 & TimingOptions$1 & DecayOptions$1 & SequenceOptions & DelayOptions & LoopOptions & Callbacks;
63
+ }
64
+ interface Controls {
65
+ start(): void;
66
+ pause(): void;
67
+ resume(): void;
68
+ cancel(): void;
69
+ reset(): void;
70
+ }
71
+
72
+ type Subscriber<T> = (value: T) => void;
73
+ declare class AnimateValue<T = number> {
74
+ private subscribers;
75
+ private _current;
76
+ private _initial;
77
+ private controller?;
78
+ constructor(initial: T);
79
+ get current(): T;
80
+ get initial(): T;
81
+ set(value: T): void;
82
+ /**
83
+ * @internal only use internally
84
+ */
85
+ _internalSet(value: T): void;
86
+ subscribe(fn: Subscriber<T>): () => void;
87
+ reset(): void;
88
+ destroy(): void;
89
+ to<U>(mapperFn: (value: T) => U): AnimateValue<U>;
90
+ to(inRange: number[], outRange: (number | string)[], config?: ExtrapolateConfig): AnimateValue<number | string>;
91
+ setAnimationController(controller: AnimateController): void;
92
+ getAnimationController(): AnimateController | undefined;
93
+ }
94
+ declare function isAnimateValue(value: any): value is AnimateValue<any>;
95
+
96
+ declare const transformKeys: readonly ["translateX", "translateY", "translateZ", "rotate", "rotateX", "rotateY", "rotateZ", "scale", "scaleX", "scaleY", "skewX", "skewY", "perspective"];
97
+
98
+ interface UseInViewOptions extends IntersectionObserverInit {
99
+ once?: boolean;
100
+ }
101
+ declare function useInView(ref: RefObject<Element>, options?: UseInViewOptions): boolean;
102
+
103
+ type AnimateValueCompatible = AnimateValue<number> | AnimateValue<string> | AnimateValue<number | string>;
104
+ type CSSPropertiesWithoutTransforms = Omit<CSSProperties, (typeof transformKeys)[number]>;
105
+ type AnimateStyle = {
106
+ [K in keyof CSSPropertiesWithoutTransforms]?: CSSPropertiesWithoutTransforms[K] | AnimateValueCompatible;
107
+ } & {
108
+ [key in (typeof transformKeys)[number]]?: AnimateValueCompatible | number | string;
109
+ };
110
+ type AnimateHTMLAttributes<T> = {
111
+ [K in keyof AllHTMLAttributes<T>]?: AllHTMLAttributes<T>[K] | AnimateValueCompatible;
112
+ };
113
+ type AnimateSVGAttributes<T> = {
114
+ [K in keyof SVGAttributes<T>]?: SVGAttributes<T>[K] | AnimateValueCompatible;
115
+ };
116
+ type AnimateProp = {
117
+ [K in keyof AnimateStyle]?: Descriptor | Primitive;
118
+ };
119
+ type AnimateAttributes<T extends EventTarget> = Omit<AnimateHTMLAttributes<T> & AnimateSVGAttributes<T>, 'style' | 'animate' | 'exit' | 'hover' | 'press' | 'focus' | 'view' | 'viewOptions'> & {
120
+ style?: AnimateStyle;
121
+ /**
122
+ * Declarative animations to run when the component mounts or updates.
123
+ */
124
+ animate?: AnimateProp;
125
+ /**
126
+ * Declarative animations to run when the component exits (inside AnimatePresence).
127
+ */
128
+ exit?: AnimateProp;
129
+ /**
130
+ * Animations or styles to apply when the element is hovered.
131
+ */
132
+ hover?: AnimateProp;
133
+ /**
134
+ * Animations or styles to apply when the element is pressed (mouse down or touch start).
135
+ */
136
+ press?: AnimateProp;
137
+ /**
138
+ * Animations or styles to apply when the element is focused.
139
+ */
140
+ focus?: AnimateProp;
141
+ /**
142
+ * Animations or styles to apply when the element enters the viewport.
143
+ */
144
+ view?: AnimateProp;
145
+ /**
146
+ * Options for the IntersectionObserver used by view animations.
147
+ */
148
+ viewOptions?: UseInViewOptions;
149
+ };
150
+
151
+ declare function makeAnimated<Tag extends keyof JSX.IntrinsicElements>(tag: Tag): react.ForwardRefExoticComponent<Omit<AnimateHTMLAttributes<HTMLElement> & AnimateSVGAttributes<HTMLElement>, "style" | "animate" | "exit" | "hover" | "press" | "focus" | "view" | "viewOptions"> & {
152
+ style?: AnimateStyle;
153
+ animate?: AnimateProp;
154
+ exit?: AnimateProp;
155
+ hover?: AnimateProp;
156
+ press?: AnimateProp;
157
+ focus?: AnimateProp;
158
+ view?: AnimateProp;
159
+ viewOptions?: UseInViewOptions;
160
+ } & react.RefAttributes<HTMLElement>>;
161
+
162
+ declare const animate: { [K in keyof JSX.IntrinsicElements]: ReturnType<typeof makeAnimated<K>>; };
163
+
164
+ interface TimingOptions extends AnimateHooks {
165
+ duration?: number;
166
+ easing?: (t: number) => number;
167
+ from?: number;
168
+ onChange?: (value: number) => void;
169
+ }
170
+ declare function timing(value: AnimateValue<number> | AnimateValue<string> | AnimateValue<number | string>, target: number | string, options?: TimingOptions): AnimateController;
171
+
172
+ interface SpringOptions extends AnimateHooks {
173
+ stiffness?: number;
174
+ damping?: number;
175
+ mass?: number;
176
+ from?: number;
177
+ onChange?(value: number): void;
178
+ }
179
+ declare function spring(value: AnimateValue<number> | AnimateValue<string> | AnimateValue<number | string>, target: number | string, options?: SpringOptions): AnimateController;
180
+
181
+ interface DecayOptions extends AnimateHooks {
182
+ decay?: number;
183
+ clamp?: [number, number];
184
+ elastic?: boolean | number;
185
+ onChange?(value: number): void;
186
+ }
187
+ declare class DecayController implements AnimateController {
188
+ private value;
189
+ private velocity;
190
+ private deceleration;
191
+ private hooks;
192
+ private startTime;
193
+ private from;
194
+ private frameId;
195
+ private position;
196
+ private readonly restSpeed;
197
+ private isPaused;
198
+ private isCancelled;
199
+ private pausedAt;
200
+ private clampBounds?;
201
+ private elasticConstant?;
202
+ constructor(value: AnimateValue<number>, velocity: number, deceleration: number, hooks: DecayOptions);
203
+ start(): void;
204
+ private animate;
205
+ pause(): void;
206
+ resume(): void;
207
+ cancel(): void;
208
+ reset(): void;
209
+ setOnComplete(fn: () => void): void;
210
+ }
211
+ declare function decay(value: AnimateValue<number>, velocity: number, options?: DecayOptions): DecayController;
212
+
213
+ declare function parallel(controllers: AnimateController[], hooks?: AnimateHooks): AnimateController;
214
+ declare function sequence(controllers: AnimateController[], hooks?: AnimateHooks): AnimateController;
215
+ declare function loop(controller: AnimateController, iterations: number, hooks?: AnimateHooks): AnimateController;
216
+ declare function delay(duration: number): AnimateController;
217
+
218
+ /**
219
+ * Copyright (c) 2015-present, Facebook, Inc.
220
+ * All rights reserved.
221
+ *
222
+ * This source code is licensed under the MIT license found in the
223
+ * LICENSE file in the root directory of this source tree.
224
+ *
225
+ */
226
+ /**
227
+ * This class implements common easing functions. The math is pretty obscure,
228
+ * but this cool website has nice visual illustrations of what they represent:
229
+ * http://xaedes.de/dev/transitions/
230
+ */
231
+ declare class Easing {
232
+ static step0(n: number): 1 | 0;
233
+ static step1(n: number): 1 | 0;
234
+ static linear(t: number): number;
235
+ static ease(t: number): number;
236
+ static quad(t: number): number;
237
+ static cubic(t: number): number;
238
+ static poly(n: number): (t: number) => number;
239
+ static sin(t: number): number;
240
+ static circle(t: number): number;
241
+ static exp(t: number): number;
242
+ /**
243
+ * A simple elastic interaction, similar to a spring. Default bounciness
244
+ * is 1, which overshoots a little bit once. 0 bounciness doesn't overshoot
245
+ * at all, and bounciness of N > 1 will overshoot about N times.
246
+ *
247
+ * Wolfram Plots:
248
+ *
249
+ * http://tiny.cc/elastic_b_1 (default bounciness = 1)
250
+ * http://tiny.cc/elastic_b_3 (bounciness = 3)
251
+ */
252
+ static elastic(bounciness?: number): (t: number) => number;
253
+ static back(s: number): (t: number) => number;
254
+ static bounce(t: number): number;
255
+ static bezier(x1: number, y1: number, x2: number, y2: number): (t: number) => number;
256
+ static in(easing: (t: number) => number): (t: number) => number;
257
+ /**
258
+ * Runs an easing function backwards.
259
+ */
260
+ static out(easing: (t: number) => number): (t: number) => number;
261
+ /**
262
+ * Makes any easing function symmetrical.
263
+ */
264
+ static inOut(easing: (t: number) => number): (t: number) => number;
265
+ }
266
+
267
+ /**
268
+ * Combines multiple AnimateValue instances into a single AnimateValue
269
+ * using a combiner function.
270
+ */
271
+ declare function combine<T extends any[], U>(inputs: {
272
+ [K in keyof T]: AnimateValue<T[K]>;
273
+ }, combiner: (...values: T) => U): AnimateValue<U>;
274
+
275
+ declare function to(input: number, inRange: number[], outRange: (number | string)[], config?: ExtrapolateConfig): number | string;
276
+
277
+ declare const withSpring: (to: Descriptor["to"], opts?: SpringOptions$1 & Callbacks) => Descriptor;
278
+ declare const withTiming: (to: Descriptor["to"], opts?: TimingOptions$1 & Callbacks) => Descriptor;
279
+ declare const withDecay: (velocity: number, opts?: DecayOptions$1 & Callbacks) => Descriptor;
280
+ declare const withDelay: (ms: number) => Descriptor;
281
+ declare const withSequence: (animations: Descriptor[], opts?: Omit<Callbacks, "onChange">) => Descriptor;
282
+ declare const withLoop: (animation: Descriptor, iterations?: number, opts?: Omit<Callbacks, "onChange">) => Descriptor;
283
+
284
+ declare const Config: {
285
+ Timing: {
286
+ BOUNCE: {
287
+ duration: number;
288
+ easing: typeof Easing.bounce;
289
+ };
290
+ EASE_IN: {
291
+ duration: number;
292
+ easing: (t: number) => number;
293
+ };
294
+ EASE_OUT: {
295
+ duration: number;
296
+ easing: (t: number) => number;
297
+ };
298
+ EASE_IN_OUT: {
299
+ duration: number;
300
+ easing: (t: number) => number;
301
+ };
302
+ POWER1: {
303
+ duration: number;
304
+ easing: (t: number) => number;
305
+ };
306
+ POWER2: {
307
+ duration: number;
308
+ easing: (t: number) => number;
309
+ };
310
+ POWER3: {
311
+ duration: number;
312
+ easing: (t: number) => number;
313
+ };
314
+ POWER4: {
315
+ duration: number;
316
+ easing: (t: number) => number;
317
+ };
318
+ LINEAR: {
319
+ duration: number;
320
+ easing: typeof Easing.linear;
321
+ };
322
+ };
323
+ Spring: {
324
+ ELASTIC: {
325
+ mass: number;
326
+ damping: number;
327
+ stiffness: number;
328
+ };
329
+ EASE: {
330
+ mass: number;
331
+ damping: number;
332
+ stiffness: number;
333
+ };
334
+ STIFF: {
335
+ mass: number;
336
+ damping: number;
337
+ stiffness: number;
338
+ };
339
+ WOBBLE: {
340
+ mass: number;
341
+ damping: number;
342
+ stiffness: number;
343
+ };
344
+ };
345
+ };
346
+
347
+ type Widen<T> = T extends number ? number : T extends string ? string : T;
348
+ type ValueReturn<T> = T extends Primitive ? AnimateValue<Widen<T>> : T extends Primitive[] ? AnimateValue<Widen<Primitive>>[] : {
349
+ [K in keyof T]: AnimateValue<Widen<T[K]>>;
350
+ };
351
+ type Base = Primitive | Primitive[] | Record<string, Primitive>;
352
+ declare function useValue<T extends Base>(initial: T): [ValueReturn<T>, (to: Base | Descriptor) => void, Controls];
353
+
354
+ interface PresenceProps {
355
+ /**
356
+ * Children to animate. Each direct child should have a unique `key` prop.
357
+ */
358
+ children?: ReactNode;
359
+ /**
360
+ * When true, the initial render will skip the enter animation.
361
+ * @default true
362
+ */
363
+ initial?: boolean;
364
+ /**
365
+ * Callback when all exiting nodes have completed animating out.
366
+ */
367
+ onExitComplete?: () => void;
368
+ /**
369
+ * When a new child enters, determines behavior of existing children.
370
+ * - "sync": (default) Exiting and entering children animate simultaneously.
371
+ * - "wait": Exiting children complete before entering children start.
372
+ * - "popLayout": Exiting children are removed from layout flow immediately.
373
+ */
374
+ mode?: 'sync' | 'wait' | 'popLayout';
375
+ }
376
+ interface PresenceContextValue {
377
+ /**
378
+ * Whether this is the initial mount (skip enter animation if Presence.initial=false)
379
+ */
380
+ isInitialMount: boolean;
381
+ /**
382
+ * Whether this element is exiting
383
+ */
384
+ isExiting: boolean;
385
+ /**
386
+ * Call this when exit animation completes to remove the element
387
+ */
388
+ onExitComplete: () => void;
389
+ /**
390
+ * Internal: Counter to force re-renders when exit state changes
391
+ */
392
+ _forceUpdate?: number;
393
+ }
394
+ declare const PresenceContext: react.Context<PresenceContextValue | null>;
395
+ /**
396
+ * Hook to access presence state from within an animated component.
397
+ */
398
+ declare function usePresence(): [boolean, () => void];
399
+ /**
400
+ * Hook to check if this is the initial mount (for skipping initial animations).
401
+ */
402
+ declare function useIsPresent(): boolean;
403
+ /**
404
+ * Presence enables exit animations when children are removed from the tree.
405
+ *
406
+ * @example
407
+ * ```tsx
408
+ * <Presence>
409
+ * {isVisible && (
410
+ * <animate.div
411
+ * key="modal"
412
+ * style={{ opacity: 0 }}
413
+ * animate={{ opacity: withTiming(1) }}
414
+ * exit={{ opacity: withTiming(0) }}
415
+ * />
416
+ * )}
417
+ * </Presence>
418
+ * ```
419
+ */
420
+ declare function Presence({ children, initial, onExitComplete, mode, }: PresenceProps): ReactElement;
421
+
422
+ /**
423
+ * Animation Recipes - Pre-built, tested animations for common use cases
424
+ */
425
+ declare const fadeIn: AnimateProp;
426
+ declare const fadeOut: AnimateProp;
427
+ declare const fadeInUp: AnimateProp;
428
+ declare const fadeInDown: AnimateProp;
429
+ declare const fadeInLeft: AnimateProp;
430
+ declare const fadeInRight: AnimateProp;
431
+ declare const slideInUp: AnimateProp;
432
+ declare const slideInDown: AnimateProp;
433
+ declare const slideInLeft: AnimateProp;
434
+ declare const slideInRight: AnimateProp;
435
+ declare const slideOutUp: AnimateProp;
436
+ declare const slideOutDown: AnimateProp;
437
+ declare const slideOutLeft: AnimateProp;
438
+ declare const slideOutRight: AnimateProp;
439
+ declare const scaleIn: AnimateProp;
440
+ declare const scaleOut: AnimateProp;
441
+ declare const scaleUp: AnimateProp;
442
+ declare const scaleDown: AnimateProp;
443
+ declare const bounceIn: AnimateProp;
444
+ declare const bounceOut: AnimateProp;
445
+ declare const rotateIn: AnimateProp;
446
+ declare const rotateOut: AnimateProp;
447
+ declare const spin: AnimateProp;
448
+ declare const zoomIn: AnimateProp;
449
+ declare const zoomOut: AnimateProp;
450
+ declare const flipX: AnimateProp;
451
+ declare const flipY: AnimateProp;
452
+ declare const slideFadeIn: AnimateProp;
453
+ declare const slideFadeOut: AnimateProp;
454
+ declare const scaleFadeIn: AnimateProp;
455
+ declare const scaleFadeOut: AnimateProp;
456
+ declare const hoverScale: AnimateProp;
457
+ declare const hoverLift: AnimateProp;
458
+ declare const hoverGlow: AnimateProp;
459
+ declare const pressScale: AnimateProp;
460
+ declare const pressDown: AnimateProp;
461
+ declare const exitFade: AnimateProp;
462
+ declare const exitSlideUp: AnimateProp;
463
+ declare const exitSlideDown: AnimateProp;
464
+ declare const exitScale: AnimateProp;
465
+ declare const recipes: {
466
+ readonly fadeIn: AnimateProp;
467
+ readonly fadeOut: AnimateProp;
468
+ readonly fadeInUp: AnimateProp;
469
+ readonly fadeInDown: AnimateProp;
470
+ readonly fadeInLeft: AnimateProp;
471
+ readonly fadeInRight: AnimateProp;
472
+ readonly slideInUp: AnimateProp;
473
+ readonly slideInDown: AnimateProp;
474
+ readonly slideInLeft: AnimateProp;
475
+ readonly slideInRight: AnimateProp;
476
+ readonly slideOutUp: AnimateProp;
477
+ readonly slideOutDown: AnimateProp;
478
+ readonly slideOutLeft: AnimateProp;
479
+ readonly slideOutRight: AnimateProp;
480
+ readonly scaleIn: AnimateProp;
481
+ readonly scaleOut: AnimateProp;
482
+ readonly scaleUp: AnimateProp;
483
+ readonly scaleDown: AnimateProp;
484
+ readonly bounceIn: AnimateProp;
485
+ readonly bounceOut: AnimateProp;
486
+ readonly rotateIn: AnimateProp;
487
+ readonly rotateOut: AnimateProp;
488
+ readonly spin: AnimateProp;
489
+ readonly zoomIn: AnimateProp;
490
+ readonly zoomOut: AnimateProp;
491
+ readonly flipX: AnimateProp;
492
+ readonly flipY: AnimateProp;
493
+ readonly slideFadeIn: AnimateProp;
494
+ readonly slideFadeOut: AnimateProp;
495
+ readonly scaleFadeIn: AnimateProp;
496
+ readonly scaleFadeOut: AnimateProp;
497
+ readonly hoverScale: AnimateProp;
498
+ readonly hoverLift: AnimateProp;
499
+ readonly hoverGlow: AnimateProp;
500
+ readonly pressScale: AnimateProp;
501
+ readonly pressDown: AnimateProp;
502
+ readonly exitFade: AnimateProp;
503
+ readonly exitSlideUp: AnimateProp;
504
+ readonly exitSlideDown: AnimateProp;
505
+ readonly exitScale: AnimateProp;
506
+ };
507
+
508
+ declare function useOutsideClick(ref: RefObject<HTMLElement>, callback: (event: MouseEvent | TouchEvent) => void, deps?: DependencyList): void;
509
+
510
+ interface DragEvent {
511
+ down: boolean;
512
+ movement: {
513
+ x: number;
514
+ y: number;
515
+ };
516
+ offset: {
517
+ x: number;
518
+ y: number;
519
+ };
520
+ velocity: {
521
+ x: number;
522
+ y: number;
523
+ };
524
+ event: PointerEvent;
525
+ cancel: () => void;
526
+ }
527
+ interface DragConfig {
528
+ threshold?: number;
529
+ axis?: 'x' | 'y';
530
+ initial?: () => {
531
+ x: number;
532
+ y: number;
533
+ };
534
+ }
535
+
536
+ declare function useDrag<T extends HTMLElement>(refs: RefObject<T> | Array<RefObject<T>>, onDrag: (e: DragEvent & {
537
+ index: number;
538
+ }) => void, config?: DragConfig): void;
539
+
540
+ interface MoveEvent {
541
+ movement: {
542
+ x: number;
543
+ y: number;
544
+ };
545
+ offset: {
546
+ x: number;
547
+ y: number;
548
+ };
549
+ velocity: {
550
+ x: number;
551
+ y: number;
552
+ };
553
+ event: PointerEvent;
554
+ cancel?: () => void;
555
+ }
556
+
557
+ declare function useMove(refs: Window, onMove: (e: MoveEvent & {
558
+ index: 0;
559
+ }) => void): void;
560
+ declare function useMove<T extends HTMLElement>(refs: RefObject<T> | Array<RefObject<T>>, onMove: (e: MoveEvent & {
561
+ index: number;
562
+ }) => void): void;
563
+
564
+ interface ScrollEvent {
565
+ movement: {
566
+ x: number;
567
+ y: number;
568
+ };
569
+ offset: {
570
+ x: number;
571
+ y: number;
572
+ };
573
+ velocity: {
574
+ x: number;
575
+ y: number;
576
+ };
577
+ event: Event;
578
+ cancel?: () => void;
579
+ }
580
+
581
+ type SupportedEdgeUnit = 'px' | 'vw' | 'vh' | '%';
582
+ type EdgeUnit = `${number}${SupportedEdgeUnit}`;
583
+ type NamedEdges = 'start' | 'end' | 'center';
584
+ type EdgeString = NamedEdges | EdgeUnit | `${number}`;
585
+ type Edge = EdgeString | number;
586
+ type ProgressIntersection = [number, number];
587
+ type Intersection = `${Edge} ${Edge}`;
588
+ type ScrollOffset = Array<Edge | Intersection | ProgressIntersection>;
589
+ interface UseScrollProgressOptions {
590
+ target?: RefObject<HTMLElement>;
591
+ axis?: 'x' | 'y';
592
+ offset?: ScrollOffset;
593
+ animate?: boolean;
594
+ toDescriptor?: (t: number) => Descriptor;
595
+ }
596
+ declare function useScrollProgress(refs: Window | RefObject<HTMLElement>, { target, axis, offset, animate, toDescriptor, }?: UseScrollProgressOptions): {
597
+ scrollYProgress: AnimateValue<number>;
598
+ scrollXProgress: AnimateValue<number>;
599
+ };
600
+
601
+ declare function useScroll<T extends HTMLElement>(refs: Window | RefObject<T> | RefObject<T>[], onScroll: (e: ScrollEvent & {
602
+ index: number;
603
+ }) => void): void;
604
+ declare function useScroll<T extends HTMLElement>(refs: Window | RefObject<T> | RefObject<T>[], options?: UseScrollProgressOptions): {
605
+ scrollYProgress: AnimateValue<number>;
606
+ scrollXProgress: AnimateValue<number>;
607
+ };
608
+
609
+ interface WheelEvent {
610
+ movement: {
611
+ x: number;
612
+ y: number;
613
+ };
614
+ offset: {
615
+ x: number;
616
+ y: number;
617
+ };
618
+ velocity: {
619
+ x: number;
620
+ y: number;
621
+ };
622
+ event: globalThis.WheelEvent;
623
+ cancel?: () => void;
624
+ }
625
+
626
+ declare function useWheel(refs: Window, onWheel: (e: WheelEvent & {
627
+ index: 0;
628
+ }) => void): void;
629
+ declare function useWheel<T extends HTMLElement>(refs: RefObject<T> | Array<RefObject<T>>, onWheel: (e: WheelEvent & {
630
+ index: number;
631
+ }) => void): void;
632
+
633
+ interface GestureInstance<E> {
634
+ onChange(handler: (event: E) => void): this;
635
+ onEnd(handler: (event: E) => void): this;
636
+ attach(target: Window | HTMLElement): () => void;
637
+ }
638
+ interface GestureConstructor<C, E> {
639
+ new (config?: C): GestureInstance<E>;
640
+ }
641
+ declare function useRecognizer<T extends HTMLElement, C, E>(GestureClass: GestureConstructor<C, E>, refs: Window | RefObject<T> | Array<RefObject<T>>, onEvent: (e: E & {
642
+ index: number;
643
+ }) => void, config?: C): void;
644
+
645
+ declare function clamp(value: number, lowerbound: number, upperbound: number): number;
646
+ declare function rubberClamp(value: number, lowerbound: number, upperbound: number, constant?: number): number;
647
+ declare function snapTo(value: number, velocity: number, snapPoints: Array<number>): number;
648
+ declare function move(array: Array<any>, moveIndex: number, toIndex: number): any[];
649
+
650
+ export { AnimateValue, Config, Easing, Presence, PresenceContext, animate, bounceIn, bounceOut, clamp, combine, decay, delay, exitFade, exitScale, exitSlideDown, exitSlideUp, fadeIn, fadeInDown, fadeInLeft, fadeInRight, fadeInUp, fadeOut, flipX, flipY, hoverGlow, hoverLift, hoverScale, isAnimateValue, loop, makeAnimated, move, parallel, pressDown, pressScale, recipes, rotateIn, rotateOut, rubberClamp, scaleDown, scaleFadeIn, scaleFadeOut, scaleIn, scaleOut, scaleUp, sequence, slideFadeIn, slideFadeOut, slideInDown, slideInLeft, slideInRight, slideInUp, slideOutDown, slideOutLeft, slideOutRight, slideOutUp, snapTo, spin, spring, timing, to, useDrag, useInView, useIsPresent, useMove, useOutsideClick, usePresence, useRecognizer, useScroll, useScrollProgress, useValue, useWheel, withDecay, withDelay, withLoop, withSequence, withSpring, withTiming, zoomIn, zoomOut };
651
+ export type { AnimateAttributes, AnimateController, AnimateHTMLAttributes, AnimateHooks, AnimateProp, AnimateSVGAttributes, AnimateStyle, Callbacks, Controls, DecayOptions$1 as DecayOptions, DelayOptions, Descriptor, DragConfig, DragEvent, DriverType, ExtrapolateConfig, ExtrapolateType, LoopOptions, MoveEvent, PresenceContextValue, PresenceProps, Primitive, ScrollEvent, SequenceOptions, SpringOptions$1 as SpringOptions, TimingOptions$1 as TimingOptions, UseInViewOptions, UseScrollProgressOptions, WheelEvent };