UNPKG

@lightningjs/renderer

Version:
34 lines (33 loc) 1.35 kB
import type { AnimationControllerState, IAnimationController } from '../../common/IAnimationController.js'; import type { AnimationManager } from './AnimationManager.js'; import type { CoreAnimation } from './CoreAnimation.js'; import { EventEmitter } from '../../common/EventEmitter.js'; export declare class CoreAnimationController extends EventEmitter implements IAnimationController { private manager; private animation; stoppedPromise: Promise<void>; /** * If this is null, then the animation is in a finished / stopped state. */ stoppedResolve: (() => void) | null; state: AnimationControllerState; constructor(manager: AnimationManager, animation: CoreAnimation); start(): IAnimationController; stop(reset?: boolean): IAnimationController; pause(): IAnimationController; restore(): IAnimationController; waitUntilStopped(): Promise<void>; private registerAnimation; private unregisterAnimation; private makeStoppedPromise; private onDestroy; private onFinished; private onAnimating; /** * manually override the tick event to emit the progress of the animation as well * we are first checking if there are any listeners for the tick event. this avoid unnecessary object creation. * @param this * @returns */ private onTick; }