KeyframeEffect.d.ts 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. import { IElement, IKeyframeEffect } from '@antv/g-lite';
  2. import type { Animation } from './Animation';
  3. import { AnimationEffectTiming } from './AnimationEffectTiming';
  4. export declare function makeTiming(timingInput: KeyframeEffectOptions, forGroup: boolean): AnimationEffectTiming;
  5. export declare function normalizeTimingInput(timingInput: KeyframeEffectOptions | number | undefined, forGroup: boolean): AnimationEffectTiming;
  6. export declare function numericTimingToObject(timingInput: KeyframeEffectOptions | number): KeyframeEffectOptions;
  7. /**
  8. * @see https://developer.mozilla.org/en-US/docs/Web/API/KeyframeEffect
  9. * @example
  10. const circleDownKeyframes = new KeyframeEffect(
  11. circle, // element to animate
  12. [
  13. { transform: 'translateY(0)' }, // keyframe
  14. { transform: 'translateY(100)' } // keyframe
  15. ],
  16. { duration: 3000, fill: 'forwards' } // keyframe options
  17. );
  18. *
  19. */
  20. export declare class KeyframeEffect implements IKeyframeEffect {
  21. composite: CompositeOperation;
  22. iterationComposite: IterationCompositeOperation;
  23. target: IElement | null;
  24. animation: Animation | null;
  25. timing: AnimationEffectTiming;
  26. private computedTiming;
  27. normalizedKeyframes: ComputedKeyframe[];
  28. private timeFraction;
  29. private interpolations;
  30. constructor(target: IElement | null, effectInput: Keyframe[] | PropertyIndexedKeyframes | null, timingInput?: KeyframeEffectOptions | number);
  31. applyInterpolations(): void;
  32. update(localTime: number | null): boolean;
  33. getKeyframes(): ComputedKeyframe[];
  34. setKeyframes(keyframes: Keyframe[] | PropertyIndexedKeyframes | null): void;
  35. /**
  36. * @see https://developer.mozilla.org/en-US/docs/Web/API/AnimationEffect/getComputedTiming
  37. */
  38. getComputedTiming(): ComputedEffectTiming;
  39. /**
  40. * @see https://developer.mozilla.org/en-US/docs/Web/API/AnimationEffect/getTiming
  41. */
  42. getTiming(): EffectTiming;
  43. /**
  44. * @see https://developer.mozilla.org/en-US/docs/Web/API/AnimationEffect/updateTiming
  45. */
  46. updateTiming(timing?: OptionalEffectTiming): void;
  47. }
  48. //# sourceMappingURL=KeyframeEffect.d.ts.map