1 | import type { AnimatableValue, AnimationObject, Animation, ReduceMotion, Timestamp, RequiredKeys } from '../../commonTypes';
|
2 | export declare const VELOCITY_EPS: number;
|
3 | export declare const SLOPE_FACTOR = 0.1;
|
4 | export interface DecayAnimation extends Animation<DecayAnimation> {
|
5 | lastTimestamp: Timestamp;
|
6 | startTimestamp: Timestamp;
|
7 | initialVelocity: number;
|
8 | velocity: number;
|
9 | current: AnimatableValue;
|
10 | }
|
11 | export interface InnerDecayAnimation extends Omit<DecayAnimation, 'current'>, AnimationObject {
|
12 | current: number;
|
13 | springActive?: boolean;
|
14 | }
|
15 |
|
16 |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 |
|
25 |
|
26 |
|
27 |
|
28 |
|
29 |
|
30 |
|
31 |
|
32 |
|
33 | export type DecayConfig = {
|
34 | deceleration?: number;
|
35 | velocityFactor?: number;
|
36 | velocity?: number;
|
37 | reduceMotion?: ReduceMotion;
|
38 | } & ({
|
39 | rubberBandEffect?: false;
|
40 | clamp?: [min: number, max: number];
|
41 | } | {
|
42 | rubberBandEffect: true;
|
43 | clamp: [min: number, max: number];
|
44 | rubberBandFactor?: number;
|
45 | });
|
46 | export type DefaultDecayConfig = RequiredKeys<DecayConfig, 'deceleration' | 'velocityFactor' | 'velocity'> & {
|
47 | rubberBandFactor: number;
|
48 | };
|
49 | export type RubberBandDecayConfig = RequiredKeys<DefaultDecayConfig, 'clamp'> & {
|
50 | rubberBandEffect: true;
|
51 | };
|
52 | export declare function isValidRubberBandConfig(config: DefaultDecayConfig): config is RubberBandDecayConfig;
|
53 |
|
\ | No newline at end of file |