@qyu/anim-core
Version:
Animation definition and implementation
22 lines (21 loc) • 797 B
TypeScript
import type { Anim } from "../type/Anim.js";
export type AnimSpring_Point = {
readonly state: number;
readonly velocity: number;
};
export type AnimNewSpring_Config = {
/** higher frequency - faster animation */
readonly natfreq: number;
/** higher damping ratio - more damping. */
readonly dampratio: number;
readonly target: number;
readonly effect: (state: number, velocity: number) => void;
/** animation will end when all conditions are met */
readonly precision?: {
/** minimal velocity - default is 0.01 */
readonly velocity?: number;
/** minimal displacement - default is 0.1 */
readonly displacement?: number;
};
};
export declare const anim_new_spring: (config: AnimNewSpring_Config) => Anim<AnimSpring_Point>;