import { flyToAnimationManager } from "./FlyToAnimationManager"; import type { FlyToAnimationOptions } from "./FlyToAnimationManager"; /** * 飞行动画函数 * 将一个元素从起始位置飞向目标元素 * * @example * ```tsx * const fromRef = useRef(null); * const toRef = useRef(null); * * flyToAnimation({ * fromRef, * toRef, * targetPosition: "center", * onComplete: () => console.log("动画完成"), * }); * ``` */ export const flyToAnimation = (options: FlyToAnimationOptions) => { flyToAnimationManager.flyTo(options); };