UNPKG

@visactor/vrender-animate

Version:

This module provides a graph-based animation system for VRender.

24 lines (23 loc) 938 B
import type { IGraphic } from '@visactor/vrender-core'; import type { IAnimationConfig } from '../executor/executor'; export declare class ComponentAnimator { private component; private tasks; private started; private completed; private totalDuration; private onStartCallbacks; private onEndCallbacks; private onUpdateCallbacks; constructor(component: IGraphic); animate(graphic: IGraphic, config: IAnimationConfig): ComponentAnimator; onStart(callback: () => void): ComponentAnimator; onEnd(callback: () => void): ComponentAnimator; onUpdate(callback: (progress: number) => void): ComponentAnimator; start(): ComponentAnimator; deleteSelfAttr(key: string): void; deleteSelfAttrs(keys: string[]): void; stop(type?: 'start' | 'end'): ComponentAnimator; getDuration(): number; } export declare function createComponentAnimator(component: IGraphic): ComponentAnimator;