Clip.d.ts 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. import { AnimationEasing } from './easing';
  2. import type Animation from './Animation';
  3. declare type OnframeCallback = (percent: number) => void;
  4. declare type ondestroyCallback = () => void;
  5. declare type onrestartCallback = () => void;
  6. export declare type DeferredEventTypes = 'destroy' | 'restart';
  7. export interface ClipProps {
  8. life?: number;
  9. delay?: number;
  10. loop?: boolean;
  11. gap?: number;
  12. easing?: AnimationEasing;
  13. onframe?: OnframeCallback;
  14. ondestroy?: ondestroyCallback;
  15. onrestart?: onrestartCallback;
  16. }
  17. export default class Clip {
  18. private _life;
  19. private _delay;
  20. private _initialized;
  21. private _startTime;
  22. private _pausedTime;
  23. private _paused;
  24. animation: Animation;
  25. loop: boolean;
  26. gap: number;
  27. easing: AnimationEasing;
  28. next: Clip;
  29. prev: Clip;
  30. onframe: OnframeCallback;
  31. ondestroy: ondestroyCallback;
  32. onrestart: onrestartCallback;
  33. constructor(opts: ClipProps);
  34. step(globalTime: number, deltaTime: number): boolean;
  35. private _restart;
  36. pause(): void;
  37. resume(): void;
  38. }
  39. export {};