UNPKG

1.81 kBTypeScriptView Raw
1import type { StyleLayoutAnimation } from './commonTypes';
2import { ReduceMotion } from '../commonTypes';
3import type { SharedValue, AnimatableValue, AnimationObject, EasingFunction } from '../commonTypes';
4import type { EasingFunctionFactory } from '../Easing';
5export declare function assertEasingIsWorklet(easing: EasingFunction | EasingFunctionFactory): void;
6export declare function initialUpdaterRun<T>(updater: () => T): T;
7interface RecognizedPrefixSuffix {
8 prefix?: string;
9 suffix?: string;
10 strippedValue: number;
11}
12export declare function recognizePrefixSuffix(value: string | number): RecognizedPrefixSuffix;
13export declare function getReduceMotionFromConfig(config?: ReduceMotion): boolean;
14/**
15 * Returns the value that should be assigned to `animation.reduceMotion` for a
16 * given config. If the config is not defined, `undefined` is returned.
17 */
18export declare function getReduceMotionForAnimation(config?: ReduceMotion): boolean | undefined;
19type AnimationToDecoration<T extends AnimationObject | StyleLayoutAnimation, U extends AnimationObject | StyleLayoutAnimation> = T extends StyleLayoutAnimation ? Record<string, unknown> : U | (() => U) | AnimatableValue;
20export declare function defineAnimation<T extends AnimationObject | StyleLayoutAnimation, // type that's supposed to be returned
21U extends AnimationObject | StyleLayoutAnimation = T>(starting: AnimationToDecoration<T, U>, factory: () => T): T;
22/**
23 * Lets you cancel a running animation paired to a shared value.
24 *
25 * @param sharedValue - The shared value of a running animation that you want to
26 * cancel.
27 * @see https://docs.swmansion.com/react-native-reanimated/docs/core/cancelAnimation
28 */
29export declare function cancelAnimation<T>(sharedValue: SharedValue<T>): void;
30export {};
31//# sourceMappingURL=util.d.ts.map
\No newline at end of file