UNPKG

@popmotion/popcorn

Version:

Utility functions for animation and interactions.

12 lines (11 loc) 484 B
import { Easing } from '@popmotion/easing'; declare type MixEasing = Easing | Easing[]; declare type InterpolateOptions<T> = { clamp?: boolean; ease?: MixEasing; mixer?: MixerFactory<T>; }; declare type Mix<T> = (v: number) => T; export declare type MixerFactory<T> = (from: T, to: T) => Mix<T>; declare function interpolate<T>(input: number[], output: T[], { clamp, ease, mixer }?: InterpolateOptions<T>): Mix<T | string | number>; export default interpolate;