UNPKG

svelte-image-viewer

Version:

A couple of simple components for displaying content with pan and zoom capabilities.

14 lines (13 loc) 561 B
/** * Smoothly animates a value towards a target using requestAnimationFrame. * * @param initialValue - The initial value to start from * @param smoothing - How quickly to approach the target (0-1, lower = smoother/slower) * @param threshold - Stop animating when within this distance of target * @returns Object with current value state and update function */ export declare function moveTowards(initialValue?: number | (() => number), smoothing?: number, threshold?: number): { readonly current: number; target: number; destroy(): void; };