import type { MotionValue } from "framer-motion"; import { FinishFunction, UpdateObserver } from "./Observers.js"; /** @public */ export type Cancel = () => void; /** * @public */ export type TransactionId = number; export interface Change { value: Value; oldValue?: Value; } export type ToAnimatable = PossiblyAnimatable extends Animatable ? Animatable : Animatable; export type FromAnimatable = PossiblyAnimatable extends Animatable ? Value : PossiblyAnimatable; export type ToAnimatableOrValue = PossiblyAnimatable extends Animatable ? Value | Animatable : PossiblyAnimatable | Animatable; /** @public */ export type AnimatableObject = { [K in keyof T]: ToAnimatableOrValue; }; /** * @public * @deprecated */ export type DeprecatedAnimationTarget = Animatable | AnimatableObject | MotionValue; /** * @public * @deprecated Use {@link useMotionValue} instead */ export interface Animatable extends UpdateObserver { /** * Get the current value out of this Animatable object * @remarks * ```jsx * const a = Animatable(0) * a.get() // returns 0 * await animate(a, 42) * a.get() // returns 42 * ``` * @returns Current value * @public */ get(): Value; /** * Set a new value to a animatable object * @remarks * The passed value can be an Animatable value too * ```jsx * const a = Animatable(0) * const b = Animatable(100) * a.set(42) * a.get() // returns 42 * a.set(b) * a.get() // returns 100 * ``` * @param value - New value to set to the animatable * @public */ set(value: Value | Animatable): void; /** * @public */ set(value: Value | Animatable, transaction?: TransactionId): void; /** * @internal */ finishTransaction(transaction: TransactionId): FinishFunction[]; } /** * @public */ export declare const Animatable: { (value: Value | Animatable): Animatable; /** * @internal */ transaction(update: (updater: (animatable: Animatable, value: any) => void, transactionId: TransactionId) => void): void; /** * @public */ getNumber(value: number | Animatable | null | undefined, defaultValue?: number): number; /** @internal */ get(value: Value_1 | Animatable | null | undefined, defaultValue: Value_1): Value_1; /** * @internal */ objectToValues(object: AnimatableObject): Object_1; }; /** * @internal * @deprecated */ export declare function isAnimatable(value: any): value is Animatable; //# sourceMappingURL=Animatable.d.ts.map