/** * Animation Engine * * Provides smooth, performant animations for chart transitions * including zoom, pan, data updates, and custom animations. */ export type EasingFunction = (t: number) => number; export declare const easings: { /** Linear easing - constant speed */ readonly linear: (t: number) => number; /** Ease in - starts slow, accelerates */ readonly easeIn: (t: number) => number; /** Ease out - starts fast, decelerates */ readonly easeOut: (t: number) => number; /** Ease in-out - slow start and end */ readonly easeInOut: (t: number) => number; /** Cubic ease out - smoother deceleration */ readonly easeOutCubic: (t: number) => number; /** Cubic ease in-out */ readonly easeInOutCubic: (t: number) => number; /** Spring-like bounce at the end */ readonly spring: (t: number) => number; /** Elastic overshoot */ readonly elastic: (t: number) => number; /** Bounce effect */ readonly bounce: (t: number) => number; }; export type EasingName = keyof typeof easings; export interface AnimationOptions { /** Duration in milliseconds */ duration: number; /** Easing function name or custom function */ easing?: EasingName | EasingFunction; /** Callback on each frame with progress 0-1 */ onUpdate: (progress: number) => void; /** Callback when animation completes */ onComplete?: () => void; /** Callback if animation is cancelled */ onCancel?: () => void; } export interface AnimationHandle { /** Unique animation ID */ id: string; /** Cancel the animation */ cancel: () => void; /** Promise that resolves when animation completes */ promise: Promise; /** Whether animation is currently running */ isRunning: () => boolean; } export interface BoundsAnimation { /** Target X range [min, max] */ xRange?: [number, number]; /** Target Y range [min, max] */ yRange?: [number, number]; /** Duration in ms (default: 300) */ duration?: number; /** Easing function (default: 'easeOutCubic') */ easing?: EasingName | EasingFunction; } export declare class AnimationEngine { private animations; private frameId; private idCounter; private isDestroyed; /** * Start a new animation */ animate(options: AnimationOptions): AnimationHandle; /** * Animate numeric value interpolation */ interpolate(from: number, to: number, options: Omit & { onUpdate: (value: number) => void; }): AnimationHandle; /** * Animate bounds transition */ animateBounds(current: { xMin: number; xMax: number; yMin: number; yMax: number; }, target: BoundsAnimation, onUpdate: (bounds: { xMin: number; xMax: number; yMin: number; yMax: number; }) => void, onComplete?: () => void): AnimationHandle; /** * Cancel a specific animation */ cancel(id: string): void; /** * Cancel all running animations */ cancelAll(): void; /** * Check if any animations are running */ isAnimating(): boolean; /** * Returns a promise that resolves when all current animations are complete */ waitForIdle(): Promise; /** * Get number of active animations */ getActiveCount(): number; /** * Destroy the animation engine */ destroy(): void; private ensureLoop; private tick; } export interface ChartAnimationConfig { /** Enable all animations */ enabled: boolean; /** Zoom animation settings */ zoom: { enabled: boolean; duration: number; easing: EasingName; }; /** Pan animation settings */ pan: { enabled: boolean; duration: number; easing: EasingName; }; /** Data update animation settings */ dataUpdate: { enabled: boolean; duration: number; easing: EasingName; }; /** Series entry animation */ seriesEntry: { enabled: boolean; duration: number; easing: EasingName; }; /** Auto-scale animation */ autoScale: { enabled: boolean; duration: number; easing: EasingName; }; } export declare const DEFAULT_ANIMATION_CONFIG: ChartAnimationConfig; /** * Merge user config with defaults */ export declare function mergeAnimationConfig(config?: Partial): ChartAnimationConfig; export declare function getSharedAnimationEngine(): AnimationEngine;