import { Animated } from "./Animated"; import { AnimatedInterpolation } from "./AnimatedInterpolation"; import { AnimatedWithChildren } from "./AnimatedWithChildren"; import { Animation, EndCallback } from "./Animation"; import { InterpolationConfigType } from "./Interpolation"; export declare type ValueListenerCallback = (state: { value: string | number; }) => void; /** * Standard value for driving animations. One `Animated.Value` can drive * multiple properties in a synchronized fashion, but can only be driven by one * mechanism at a time. Using a new mechanism (e.g. starting a new animation, * or calling `setValue`) will stop any previous ones. */ export declare class AnimatedValue extends AnimatedWithChildren { _value: number; _offset: number; _animation: Animation | null; _tracking: Animated | null; _listeners: { [key: string]: ValueListenerCallback; }; constructor(value: number); __detach: () => void; __getValue: () => number; /** * Directly set the value. This will stop any animations running on the value * and update all the bound properties. */ setValue(value: number): void; /** * Sets an offset that is applied on top of whatever value is set, whether via * `setValue`, an animation, or `Animated.event`. Useful for compensating * things like the start of a pan gesture. */ setOffset(offset: number): void; /** * Merges the offset value into the base value and resets the offset to zero. * The final output of the value is unchanged. */ flattenOffset(): void; /** * Adds an asynchronous listener to the value so you can observe updates from * animations. This is useful because there is no way to * synchronously read the value because it might be driven natively. */ addListener(callback: ValueListenerCallback): string; removeListener(id: string): void; removeAllListeners(): void; /** * Stops any running animation or tracking. `callback` is invoked with the * final value after stopping the animation, which is useful for updating * state to match the animation position with layout. */ stopAnimation(callback?: ((value: number) => void) | null): void; /** * Interpolates the value before updating the property, e.g. mapping 0-1 to * 0-10. */ interpolate(config: InterpolationConfigType): AnimatedInterpolation; /** * Typically only used internally, but could be used by a custom Animation * class. */ animate(animation: Animation, callback?: EndCallback): void; /** * Typically only used internally. */ stopTracking(): void; /** * Typically only used internally. */ track(tracking: Animated): void; _updateValue(value: number): void; }