UNPKG

3.21 kBTypeScriptView Raw
1import type { EntryExitAnimationFunction, AnimationFunction, LayoutAnimationFunction } from './commonTypes';
2import { ReduceMotion } from '../../commonTypes';
3export declare class BaseAnimationBuilder {
4 durationV?: number;
5 delayV?: number;
6 reduceMotionV: ReduceMotion;
7 randomizeDelay: boolean;
8 callbackV?: (finished: boolean) => void;
9 static createInstance: <T extends typeof BaseAnimationBuilder>(this: T) => InstanceType<T>;
10 build: () => EntryExitAnimationFunction | LayoutAnimationFunction;
11 /**
12 * Lets you adjust the animation duration. Can be chained alongside other
13 * [layout animation
14 * modifiers](https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/glossary#layout-animation-modifier).
15 *
16 * @param durationMs - Length of the animation (in milliseconds).
17 */
18 static duration<T extends typeof BaseAnimationBuilder>(this: T, durationMs: number): InstanceType<T>;
19 duration(durationMs: number): this;
20 /**
21 * Lets you adjust the delay before the animation starts (in milliseconds).
22 * Can be chained alongside other [layout animation
23 * modifiers](https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/glossary#layout-animation-modifier).
24 *
25 * @param delayMs - Delay before the animation starts (in milliseconds).
26 */
27 static delay<T extends typeof BaseAnimationBuilder>(this: T, delayMs: number): InstanceType<T>;
28 delay(delayMs: number): this;
29 /**
30 * The callback that will fire after the animation ends. Can be chained
31 * alongside other [layout animation
32 * modifiers](https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/glossary#layout-animation-modifier).
33 *
34 * @param callback - Callback that will fire after the animation ends.
35 */
36 static withCallback<T extends typeof BaseAnimationBuilder>(this: T, callback: (finished: boolean) => void): InstanceType<T>;
37 withCallback(callback: (finished: boolean) => void): this;
38 /**
39 * Lets you adjust the behavior when the device's reduced motion accessibility
40 * setting is turned on. Can be chained alongside other [layout animation
41 * modifiers](https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/glossary#layout-animation-modifier).
42 *
43 * @param reduceMotion - Determines how the animation responds to the device's
44 * reduced motion accessibility setting. Default to `ReduceMotion.System` -
45 * {@link ReduceMotion}.
46 */
47 static reduceMotion<T extends typeof BaseAnimationBuilder>(this: T, reduceMotion: ReduceMotion): InstanceType<T>;
48 reduceMotion(reduceMotionV: ReduceMotion): this;
49 static getDuration(): number;
50 getDuration(): number;
51 /** @deprecated Use `.delay()` with `Math.random()` instead */
52 static randomDelay<T extends typeof BaseAnimationBuilder>(this: T): InstanceType<T>;
53 randomDelay(): this;
54 getDelay(): number;
55 getReduceMotion(): ReduceMotion;
56 getDelayFunction(): AnimationFunction;
57 static build<T extends typeof BaseAnimationBuilder>(this: T): EntryExitAnimationFunction | LayoutAnimationFunction;
58}
59//# sourceMappingURL=BaseAnimationBuilder.d.ts.map
\No newline at end of file