react-ui-animate 4.3.1-alpha.1 → 4.3.2
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.
- package/dist/animation/{AnimationConfig.d.ts → Config.d.ts} +9 -9
- package/dist/animation/descriptors.d.ts +7 -0
- package/dist/animation/drivers.d.ts +4 -0
- package/dist/animation/helpers.d.ts +3 -0
- package/dist/animation/hooks/index.d.ts +2 -2
- package/dist/animation/hooks/useMount.d.ts +15 -9
- package/dist/animation/hooks/useValue.d.ts +7 -5
- package/dist/animation/index.d.ts +5 -5
- package/dist/animation/modules/Mount.d.ts +17 -0
- package/dist/animation/modules/index.d.ts +1 -2
- package/dist/animation/to.d.ts +9 -0
- package/dist/animation/types.d.ts +42 -25
- package/dist/gestures/controllers/DragGesture.d.ts +45 -15
- package/dist/gestures/controllers/Gesture.d.ts +12 -19
- package/dist/gestures/controllers/MoveGesture.d.ts +30 -0
- package/dist/gestures/controllers/ScrollGesture.d.ts +27 -12
- package/dist/gestures/controllers/WheelGesture.d.ts +26 -13
- package/dist/gestures/hooks/index.d.ts +4 -5
- package/dist/gestures/hooks/useDrag.d.ts +5 -4
- package/dist/gestures/hooks/useMove.d.ts +8 -0
- package/dist/gestures/hooks/useRecognizer.d.ts +12 -9
- package/dist/gestures/hooks/useScroll.d.ts +8 -4
- package/dist/gestures/hooks/useWheel.d.ts +8 -4
- package/dist/gestures/index.d.ts +1 -0
- package/dist/hooks/index.d.ts +1 -3
- package/dist/hooks/useOutsideClick.d.ts +1 -1
- package/dist/index.d.ts +5 -9
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/utils/index.d.ts +4 -0
- package/package.json +2 -2
- package/dist/animation/controllers.d.ts +0 -30
- package/dist/animation/interpolation/colors.d.ts +0 -25
- package/dist/animation/interpolation/index.d.ts +0 -1
- package/dist/animation/interpolation/interpolateNumbers.d.ts +0 -8
- package/dist/animation/modules/MountedBlock.d.ts +0 -11
- package/dist/animation/modules/ScrollableBlock.d.ts +0 -11
- package/dist/gestures/controllers/MouseMoveGesture.d.ts +0 -13
- package/dist/gestures/controllers/index.d.ts +0 -4
- package/dist/gestures/helpers/eventAttacher.d.ts +0 -11
- package/dist/gestures/helpers/index.d.ts +0 -1
- package/dist/gestures/helpers/math.d.ts +0 -34
- package/dist/gestures/helpers/withDefault.d.ts +0 -4
- package/dist/gestures/hooks/useGesture.d.ts +0 -9
- package/dist/gestures/hooks/useMouseMove.d.ts +0 -4
- package/dist/gestures/types/index.d.ts +0 -51
- package/dist/hooks/useMeasure.d.ts +0 -14
- package/dist/hooks/useWindowDimension.d.ts +0 -9
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Easing } from '@raidipesh78/re-motion';
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const Config: {
|
|
3
3
|
Timing: {
|
|
4
4
|
BOUNCE: {
|
|
5
5
|
duration: number;
|
|
@@ -41,23 +41,23 @@ export declare const AnimationConfig: {
|
|
|
41
41
|
Spring: {
|
|
42
42
|
ELASTIC: {
|
|
43
43
|
mass: number;
|
|
44
|
-
|
|
45
|
-
|
|
44
|
+
damping: number;
|
|
45
|
+
stiffness: number;
|
|
46
46
|
};
|
|
47
47
|
EASE: {
|
|
48
48
|
mass: number;
|
|
49
|
-
|
|
50
|
-
|
|
49
|
+
damping: number;
|
|
50
|
+
stiffness: number;
|
|
51
51
|
};
|
|
52
52
|
STIFF: {
|
|
53
53
|
mass: number;
|
|
54
|
-
|
|
55
|
-
|
|
54
|
+
damping: number;
|
|
55
|
+
stiffness: number;
|
|
56
56
|
};
|
|
57
57
|
WOBBLE: {
|
|
58
58
|
mass: number;
|
|
59
|
-
|
|
60
|
-
|
|
59
|
+
damping: number;
|
|
60
|
+
stiffness: number;
|
|
61
61
|
};
|
|
62
62
|
};
|
|
63
63
|
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Callbacks, DecayOptions, Descriptor, SpringOptions, TimingOptions } from './types';
|
|
2
|
+
export declare const withSpring: (to: Descriptor["to"], opts?: SpringOptions & Callbacks) => Descriptor;
|
|
3
|
+
export declare const withTiming: (to: Descriptor["to"], opts?: TimingOptions & Callbacks) => Descriptor;
|
|
4
|
+
export declare const withDecay: (velocity: number, opts?: DecayOptions & Callbacks) => Descriptor;
|
|
5
|
+
export declare const withDelay: (ms: number) => Descriptor;
|
|
6
|
+
export declare const withSequence: (animations: Descriptor[], opts?: Omit<Callbacks, "onChange">) => Descriptor;
|
|
7
|
+
export declare const withLoop: (animation: Descriptor, iterations?: number, opts?: Omit<Callbacks, "onChange">) => Descriptor;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { MotionValue } from '@raidipesh78/re-motion';
|
|
2
|
+
import type { Primitive, Descriptor } from './types';
|
|
3
|
+
export declare function buildAnimation(mv: MotionValue<Primitive>, { type, to, options }: Descriptor): import("@raidipesh78/re-motion/dist/drivers/AnimationController").AnimationController;
|
|
4
|
+
export declare function buildParallel(mvMap: Record<string, MotionValue<Primitive>>, step: Descriptor): import("@raidipesh78/re-motion/dist/drivers/AnimationController").AnimationController;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
1
|
+
export { useValue } from './useValue';
|
|
2
|
+
export { useMount } from './useMount';
|
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
import { MotionValue } from '@raidipesh78/re-motion';
|
|
2
|
-
import {
|
|
3
|
-
export
|
|
4
|
-
from?:
|
|
5
|
-
enter?:
|
|
6
|
-
exit?:
|
|
7
|
-
}
|
|
8
|
-
export
|
|
9
|
-
|
|
10
|
-
|
|
2
|
+
import type { Primitive, Descriptor } from '../types';
|
|
3
|
+
export type ConfigSingle<T extends Primitive> = {
|
|
4
|
+
from?: T;
|
|
5
|
+
enter?: T | Descriptor;
|
|
6
|
+
exit?: T | Descriptor;
|
|
7
|
+
};
|
|
8
|
+
export type ConfigMulti<I extends Record<string, Primitive>> = {
|
|
9
|
+
from: I;
|
|
10
|
+
enter?: I | Descriptor;
|
|
11
|
+
exit?: I | Descriptor;
|
|
12
|
+
};
|
|
13
|
+
export declare function useMount<T extends Primitive = number>(isOpen: boolean, config?: ConfigSingle<T>): (fn: (value: MotionValue<T>, mounted: boolean) => React.ReactNode) => React.ReactNode;
|
|
14
|
+
export declare function useMount<I extends Record<string, Primitive>>(isOpen: boolean, config: ConfigMulti<I>): (fn: (values: {
|
|
15
|
+
[K in keyof I]: MotionValue<I[K]>;
|
|
16
|
+
}, mounted: boolean) => React.ReactNode) => React.ReactNode;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { MotionValue } from '@raidipesh78/re-motion';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
readonly currentValue: V;
|
|
2
|
+
import type { Primitive, Descriptor, Controls } from '../types';
|
|
3
|
+
type Widen<T> = T extends number ? number : T extends string ? string : T;
|
|
4
|
+
type ValueReturn<T> = T extends Primitive ? MotionValue<Widen<T>> : T extends Primitive[] ? MotionValue<Widen<Primitive>>[] : {
|
|
5
|
+
[K in keyof T]: MotionValue<Widen<T[K]>>;
|
|
7
6
|
};
|
|
7
|
+
type Base = Primitive | Primitive[] | Record<string, Primitive>;
|
|
8
|
+
export declare function useValue<T extends Base>(initial: T): [ValueReturn<T>, (to: Base | Descriptor) => void, Controls];
|
|
9
|
+
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
export
|
|
5
|
-
export
|
|
1
|
+
export * from './hooks';
|
|
2
|
+
export * from './modules';
|
|
3
|
+
export * from './descriptors';
|
|
4
|
+
export * from './Config';
|
|
5
|
+
export * from './to';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import type { MotionValue } from '@raidipesh78/re-motion';
|
|
3
|
+
import type { Primitive } from '../types';
|
|
4
|
+
import { type ConfigMulti, type ConfigSingle } from '../hooks/useMount';
|
|
5
|
+
interface MountPropsSingle<T extends Primitive> extends Partial<ConfigSingle<T>> {
|
|
6
|
+
state: boolean;
|
|
7
|
+
children: (animation: MotionValue<T>) => ReactNode;
|
|
8
|
+
}
|
|
9
|
+
interface MountPropsMulti<I extends Record<string, Primitive>> extends ConfigMulti<I> {
|
|
10
|
+
state: boolean;
|
|
11
|
+
children: (animation: {
|
|
12
|
+
[K in keyof I]: MotionValue<I[K]>;
|
|
13
|
+
}) => ReactNode;
|
|
14
|
+
}
|
|
15
|
+
export declare function Mount<T extends Primitive = number>(props: MountPropsSingle<T>): JSX.Element;
|
|
16
|
+
export declare function Mount<I extends Record<string, Primitive>>(props: MountPropsMulti<I>): JSX.Element;
|
|
17
|
+
export {};
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
export
|
|
2
|
-
export * from './ScrollableBlock';
|
|
1
|
+
export { Mount } from './Mount';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
type ExtrapolateType = 'identity' | 'extend' | 'clamp';
|
|
2
|
+
interface ExtrapolateConfig {
|
|
3
|
+
extrapolate?: ExtrapolateType;
|
|
4
|
+
extrapolateRight?: ExtrapolateType;
|
|
5
|
+
extrapolateLeft?: ExtrapolateType;
|
|
6
|
+
easing?: (t: number) => number;
|
|
7
|
+
}
|
|
8
|
+
export declare function to(input: number, inRange: number[], outRange: (number | string)[], config?: ExtrapolateConfig): number | string;
|
|
9
|
+
export {};
|
|
@@ -1,25 +1,42 @@
|
|
|
1
|
-
export
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
1
|
+
export type Primitive = number | string;
|
|
2
|
+
export interface Callbacks {
|
|
3
|
+
onStart?: () => void;
|
|
4
|
+
onChange?: (v: number) => void;
|
|
5
|
+
onComplete?: () => void;
|
|
6
|
+
}
|
|
7
|
+
export interface SpringOptions {
|
|
8
|
+
stiffness?: number;
|
|
9
|
+
damping?: number;
|
|
10
|
+
mass?: number;
|
|
11
|
+
}
|
|
12
|
+
export interface TimingOptions {
|
|
13
|
+
duration?: number;
|
|
14
|
+
easing?: (t: number) => number;
|
|
15
|
+
}
|
|
16
|
+
export interface DecayOptions {
|
|
17
|
+
velocity?: number;
|
|
18
|
+
clamp?: [number, number];
|
|
19
|
+
}
|
|
20
|
+
export interface SequenceOptions {
|
|
21
|
+
animations?: Descriptor[];
|
|
22
|
+
}
|
|
23
|
+
export interface DelayOptions {
|
|
24
|
+
delay?: number;
|
|
25
|
+
}
|
|
26
|
+
export interface LoopOptions {
|
|
27
|
+
iterations?: number;
|
|
28
|
+
animation?: Descriptor;
|
|
29
|
+
}
|
|
30
|
+
export type DriverType = 'spring' | 'timing' | 'decay' | 'delay' | 'sequence' | 'loop';
|
|
31
|
+
export interface Descriptor {
|
|
32
|
+
type: DriverType;
|
|
33
|
+
to?: Primitive | Primitive[] | Record<string, Primitive>;
|
|
34
|
+
options?: SpringOptions & TimingOptions & DecayOptions & SequenceOptions & DelayOptions & LoopOptions & Callbacks;
|
|
35
|
+
}
|
|
36
|
+
export interface Controls {
|
|
37
|
+
start(): void;
|
|
38
|
+
pause(): void;
|
|
39
|
+
resume(): void;
|
|
40
|
+
cancel(): void;
|
|
41
|
+
reset(): void;
|
|
42
|
+
}
|
|
@@ -1,17 +1,47 @@
|
|
|
1
1
|
import { Gesture } from './Gesture';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
2
|
+
export interface DragEvent {
|
|
3
|
+
down: boolean;
|
|
4
|
+
movement: {
|
|
5
|
+
x: number;
|
|
6
|
+
y: number;
|
|
7
|
+
};
|
|
8
|
+
offset: {
|
|
9
|
+
x: number;
|
|
10
|
+
y: number;
|
|
11
|
+
};
|
|
12
|
+
velocity: {
|
|
13
|
+
x: number;
|
|
14
|
+
y: number;
|
|
15
|
+
};
|
|
16
|
+
event: PointerEvent;
|
|
17
|
+
cancel: () => void;
|
|
18
|
+
}
|
|
19
|
+
export interface DragConfig {
|
|
20
|
+
threshold?: number;
|
|
21
|
+
axis?: 'x' | 'y';
|
|
22
|
+
initial?: () => {
|
|
23
|
+
x: number;
|
|
24
|
+
y: number;
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
export declare class DragGesture extends Gesture<DragEvent> {
|
|
28
|
+
private config;
|
|
29
|
+
private prev;
|
|
30
|
+
private lastTime;
|
|
31
|
+
private movement;
|
|
32
|
+
private velocity;
|
|
33
|
+
private start;
|
|
34
|
+
private offset;
|
|
35
|
+
private pointerCaptured;
|
|
36
|
+
private activePointerId;
|
|
37
|
+
private attachedEls;
|
|
38
|
+
private activeEl;
|
|
39
|
+
private pointerDownPos;
|
|
40
|
+
private thresholdPassed;
|
|
41
|
+
constructor(config?: DragConfig);
|
|
42
|
+
attach(elements: HTMLElement | HTMLElement[] | Window): () => void;
|
|
43
|
+
private onDown;
|
|
44
|
+
private onMove;
|
|
45
|
+
private onUp;
|
|
46
|
+
cancel(): void;
|
|
17
47
|
}
|
|
@@ -1,20 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
_cancelEvents(): void;
|
|
13
|
-
applyCallback(callback: <T>(event: T) => void): void;
|
|
14
|
-
applyGesture({ targetElement, targetElements, callback, config, }: {
|
|
15
|
-
targetElement?: any;
|
|
16
|
-
targetElements?: any;
|
|
17
|
-
callback: <T>(event: T) => void;
|
|
18
|
-
config?: any;
|
|
19
|
-
}): () => void | undefined;
|
|
1
|
+
type Listener<E> = (event: E) => void;
|
|
2
|
+
export declare abstract class Gesture<E> {
|
|
3
|
+
static readonly VELOCITY_LIMIT = 20;
|
|
4
|
+
private changeListeners;
|
|
5
|
+
private endListeners;
|
|
6
|
+
onChange(listener: Listener<E>): this;
|
|
7
|
+
onEnd(listener: Listener<E>): this;
|
|
8
|
+
protected emitChange(event: E): void;
|
|
9
|
+
protected emitEnd(event: E): void;
|
|
10
|
+
abstract attach(elements: HTMLElement | HTMLElement | Window): () => void;
|
|
11
|
+
abstract cancel(): void;
|
|
20
12
|
}
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Gesture } from './Gesture';
|
|
2
|
+
export interface MoveEvent {
|
|
3
|
+
movement: {
|
|
4
|
+
x: number;
|
|
5
|
+
y: number;
|
|
6
|
+
};
|
|
7
|
+
offset: {
|
|
8
|
+
x: number;
|
|
9
|
+
y: number;
|
|
10
|
+
};
|
|
11
|
+
velocity: {
|
|
12
|
+
x: number;
|
|
13
|
+
y: number;
|
|
14
|
+
};
|
|
15
|
+
event: PointerEvent;
|
|
16
|
+
cancel?: () => void;
|
|
17
|
+
}
|
|
18
|
+
export declare class MoveGesture extends Gesture<MoveEvent> {
|
|
19
|
+
private attachedEls;
|
|
20
|
+
private prev;
|
|
21
|
+
private lastTime;
|
|
22
|
+
private movement;
|
|
23
|
+
private offset;
|
|
24
|
+
private velocity;
|
|
25
|
+
private startPos;
|
|
26
|
+
attach(elements: HTMLElement | HTMLElement[] | Window): () => void;
|
|
27
|
+
cancel(): void;
|
|
28
|
+
private onMove;
|
|
29
|
+
private onLeave;
|
|
30
|
+
}
|
|
@@ -1,14 +1,29 @@
|
|
|
1
|
-
import { Vector2 } from '../types';
|
|
2
1
|
import { Gesture } from './Gesture';
|
|
3
|
-
export
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
2
|
+
export interface ScrollEvent {
|
|
3
|
+
movement: {
|
|
4
|
+
x: number;
|
|
5
|
+
y: number;
|
|
6
|
+
};
|
|
7
|
+
offset: {
|
|
8
|
+
x: number;
|
|
9
|
+
y: number;
|
|
10
|
+
};
|
|
11
|
+
velocity: {
|
|
12
|
+
x: number;
|
|
13
|
+
y: number;
|
|
14
|
+
};
|
|
15
|
+
event: Event;
|
|
16
|
+
cancel?: () => void;
|
|
17
|
+
}
|
|
18
|
+
export declare class ScrollGesture extends Gesture<ScrollEvent> {
|
|
19
|
+
private attachedEls;
|
|
20
|
+
private movement;
|
|
21
|
+
private offset;
|
|
22
|
+
private velocity;
|
|
23
|
+
private prevScroll;
|
|
24
|
+
private lastTime;
|
|
25
|
+
private endTimeout?;
|
|
26
|
+
attach(elements: HTMLElement | HTMLElement[] | Window): () => void;
|
|
27
|
+
cancel(): void;
|
|
28
|
+
private onScroll;
|
|
14
29
|
}
|
|
@@ -1,15 +1,28 @@
|
|
|
1
|
-
import { Vector2 } from '../types';
|
|
2
1
|
import { Gesture } from './Gesture';
|
|
3
|
-
export
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
2
|
+
export interface WheelEvent {
|
|
3
|
+
movement: {
|
|
4
|
+
x: number;
|
|
5
|
+
y: number;
|
|
6
|
+
};
|
|
7
|
+
offset: {
|
|
8
|
+
x: number;
|
|
9
|
+
y: number;
|
|
10
|
+
};
|
|
11
|
+
velocity: {
|
|
12
|
+
x: number;
|
|
13
|
+
y: number;
|
|
14
|
+
};
|
|
15
|
+
event: globalThis.WheelEvent;
|
|
16
|
+
cancel?: () => void;
|
|
17
|
+
}
|
|
18
|
+
export declare class WheelGesture extends Gesture<WheelEvent> {
|
|
19
|
+
private attachedEls;
|
|
20
|
+
private movement;
|
|
21
|
+
private offset;
|
|
22
|
+
private velocity;
|
|
23
|
+
private lastTime;
|
|
24
|
+
private endTimeout?;
|
|
25
|
+
attach(elements: HTMLElement | HTMLElement[] | Window): () => void;
|
|
26
|
+
cancel(): void;
|
|
27
|
+
private onWheel;
|
|
15
28
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
export
|
|
5
|
-
export * from './useGesture';
|
|
1
|
+
export { useDrag } from './useDrag';
|
|
2
|
+
export { useMove } from './useMove';
|
|
3
|
+
export { useScroll } from './useScroll';
|
|
4
|
+
export { useWheel } from './useWheel';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { RefObject } from 'react';
|
|
2
|
+
import { type DragConfig, type DragEvent } from '../controllers/DragGesture';
|
|
3
|
+
export declare function useDrag<T extends HTMLElement>(refs: RefObject<T> | Array<RefObject<T>>, onDrag: (e: DragEvent & {
|
|
4
|
+
index: number;
|
|
5
|
+
}) => void, config?: DragConfig): void;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { RefObject } from 'react';
|
|
2
|
+
import { type MoveEvent } from '../controllers/MoveGesture';
|
|
3
|
+
export declare function useMove(refs: Window, onMove: (e: MoveEvent & {
|
|
4
|
+
index: 0;
|
|
5
|
+
}) => void): void;
|
|
6
|
+
export declare function useMove<T extends HTMLElement>(refs: RefObject<T> | Array<RefObject<T>>, onMove: (e: MoveEvent & {
|
|
7
|
+
index: number;
|
|
8
|
+
}) => void): void;
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}
|
|
1
|
+
import { RefObject } from 'react';
|
|
2
|
+
interface GestureInstance<E> {
|
|
3
|
+
onChange(handler: (event: E) => void): this;
|
|
4
|
+
onEnd(handler: (event: E) => void): this;
|
|
5
|
+
attach(target: Window | HTMLElement): () => void;
|
|
6
|
+
}
|
|
7
|
+
interface GestureConstructor<C, E> {
|
|
8
|
+
new (config?: C): GestureInstance<E>;
|
|
9
|
+
}
|
|
10
|
+
export declare function useRecognizer<T extends HTMLElement, C, E>(GestureClass: GestureConstructor<C, E>, refs: Window | RefObject<T> | Array<RefObject<T>>, onEvent: (e: E & {
|
|
11
|
+
index: number;
|
|
12
|
+
}) => void, config?: C): void;
|
|
10
13
|
export {};
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { RefObject } from 'react';
|
|
2
|
+
import { type ScrollEvent } from '../controllers/ScrollGesture';
|
|
3
|
+
export declare function useScroll(refs: Window, onScroll: (e: ScrollEvent & {
|
|
4
|
+
index: 0;
|
|
5
|
+
}) => void): void;
|
|
6
|
+
export declare function useScroll<T extends HTMLElement>(refs: RefObject<T> | Array<RefObject<T>>, onScroll: (e: ScrollEvent & {
|
|
7
|
+
index: number;
|
|
8
|
+
}) => void): void;
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { RefObject } from 'react';
|
|
2
|
+
import { type WheelEvent } from '../controllers/WheelGesture';
|
|
3
|
+
export declare function useWheel(refs: Window, onWheel: (e: WheelEvent & {
|
|
4
|
+
index: 0;
|
|
5
|
+
}) => void): void;
|
|
6
|
+
export declare function useWheel<T extends HTMLElement>(refs: RefObject<T> | Array<RefObject<T>>, onWheel: (e: WheelEvent & {
|
|
7
|
+
index: number;
|
|
8
|
+
}) => void): void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './hooks';
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { RefObject, DependencyList } from 'react';
|
|
2
|
-
export declare function useOutsideClick(
|
|
2
|
+
export declare function useOutsideClick(ref: RefObject<HTMLElement>, callback: (event: MouseEvent | TouchEvent) => void, deps?: DependencyList): void;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,5 @@
|
|
|
1
|
-
export { Easing, makeMotion as makeAnimated, motion as animate, } from '@raidipesh78/re-motion';
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
export
|
|
5
|
-
export
|
|
6
|
-
export { interpolateNumbers } from './animation';
|
|
7
|
-
export { useDrag, useGesture, useMouseMove, useScroll, useWheel, } from './gestures/hooks';
|
|
8
|
-
export { bin, clamp, mix, rubberClamp, move, snapTo } from './gestures/helpers';
|
|
9
|
-
export type { UseMountConfig } from './animation';
|
|
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';
|
|
5
|
+
export * from './utils';
|