import ProceduralKeyframeAnimator from './animation/ProceduralKeyframeAnimator'; import { Animator } from './animation/Animator'; import Notifier from './core/Notifier'; import Clip from './animation/Clip'; interface Stage { render?: () => void; } /** * Animation is global timeline that schedule all clips. each frame animation will set the time of clips to current and update the states of clips * * @example * const animation = new clay.Timeline(); * const node = new clay.Node(); * animation.animate(node.position) * .when(1000, { * x: 500, * y: 500 * }) * .when(2000, { * x: 100, * y: 100 * }) * .when(3000, { * z: 10 * }) * .start('spline'); */ export declare function getTime(): number; interface TimelineOption { stage?: Stage; } export default class Timeline extends Notifier { stage: Stage; private _head?; private _tail?; private _running; private _time; private _pausedTime; private _pauseStart; private _paused; constructor(opts?: TimelineOption); /** * Add clip */ addClip(clip: Clip): void; /** * Add animator */ addAnimator(animator: Animator): void; /** * Delete animation clip */ removeClip(clip: Clip): void; /** * Delete animation clip */ removeAnimator(animator: Animator): void; update(notTriggerFrameAndStageUpdate?: boolean): void; _startLoop(): void; /** * Start animation. */ start(): void; /** * Stop animation. */ stop(): void; /** * Pause animation. */ pause(): void; /** * Resume animation. */ resume(): void; /** * Clear animation. */ clear(): void; /** * Whether animation finished. */ isFinished(): boolean; /** * Creat animator for a target, whose props can be animated. */ animate(target: T, options?: { loop?: boolean; }): ProceduralKeyframeAnimator; } export {};