UNPKG

@visactor/vrender-animate

Version:

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

43 lines (42 loc) 1.49 kB
import { type IAnimate, type ITimeline } from '@visactor/vrender-core'; import { EventEmitter } from '@visactor/vutils'; interface AnimateNode { animate: IAnimate; next: AnimateNode | null; prev: AnimateNode | null; } export declare class DefaultTimeline extends EventEmitter implements ITimeline { id: number; protected head: AnimateNode | null; protected tail: AnimateNode | null; protected animateMap: Map<IAnimate, AnimateNode>; protected _animateCount: number; protected paused: boolean; protected _playSpeed: number; protected _totalDuration: number; protected _startTime: number; protected _currentTime: number; protected _animationEndFlag: boolean; isGlobal?: boolean; get animateCount(): number; constructor(); isRunning(): boolean; forEachAccessAnimate(cb: (animate: IAnimate, index: number) => void): void; addAnimate(animate: IAnimate): void; pause(): void; resume(): void; tick(delta: number): void; clear(): void; removeAnimate(animate: IAnimate, release?: boolean): void; protected recalculateTotalDuration(): void; getTotalDuration(): number; getPlaySpeed(): number; setPlaySpeed(speed: number): void; getPlayState(): 'playing' | 'paused' | 'stopped'; setStartTime(time: number): void; getStartTime(): number; getCurrentTime(): number; setCurrentTime(time: number): void; } export declare const defaultTimeline: DefaultTimeline; export {};