Animation.d.ts 963 B

12345678910111213141516171819202122232425262728293031323334353637
  1. import Eventful from '../core/Eventful';
  2. import Animator from './Animator';
  3. import Clip from './Clip';
  4. export declare function getTime(): number;
  5. interface Stage {
  6. update?: () => void;
  7. }
  8. interface AnimationOption {
  9. stage?: Stage;
  10. }
  11. export default class Animation extends Eventful {
  12. stage: Stage;
  13. private _head;
  14. private _tail;
  15. private _running;
  16. private _time;
  17. private _pausedTime;
  18. private _pauseStart;
  19. private _paused;
  20. constructor(opts?: AnimationOption);
  21. addClip(clip: Clip): void;
  22. addAnimator(animator: Animator<any>): void;
  23. removeClip(clip: Clip): void;
  24. removeAnimator(animator: Animator<any>): void;
  25. update(notTriggerFrameAndStageUpdate?: boolean): void;
  26. _startLoop(): void;
  27. start(): void;
  28. stop(): void;
  29. pause(): void;
  30. resume(): void;
  31. clear(): void;
  32. isFinished(): boolean;
  33. animate<T>(target: T, options: {
  34. loop?: boolean;
  35. }): Animator<T>;
  36. }
  37. export {};