utils.d.ts 1.5 KB

1234567891011121314151617181920212223242526
  1. import type { DisplayObject } from '../shapes';
  2. import type { GUI } from '../core';
  3. import type { AnimationOption, AnimationResult, GenericAnimation, StandardAnimationOption } from './types';
  4. export declare function parseAnimationOption(option: AnimationOption): StandardAnimationOption;
  5. export declare function onAnimateFinished(animation: AnimationResult, callback: () => void): void;
  6. export declare function onAnimatesFinished(animations: AnimationResult[], callback: () => void): void;
  7. export declare function animate(target: DisplayObject | GUI<any>, keyframes: Keyframe[], options: GenericAnimation): import("@antv/g-lite").IAnimation | null;
  8. /**
  9. * transition source shape to target shape
  10. * @param source
  11. * @param target
  12. * @param options
  13. * @param after destroy or hide source shape after transition
  14. */
  15. export declare function transitionShape(source: DisplayObject, target: DisplayObject, options: GenericAnimation, after?: 'destroy' | 'hide'): (import("@antv/g-lite").IAnimation | null)[];
  16. /**
  17. * execute transition animation on element
  18. * @description in the current stage, only support the following properties:
  19. * x, y, width, height, opacity, fill, stroke, lineWidth, radius
  20. * @param target element to be animated
  21. * @param state target properties or element
  22. * @param options transition options
  23. * @param animate whether to animate
  24. * @returns transition instance
  25. */
  26. export declare function transition(target: DisplayObject | GUI<any>, state: Record<string, any> | (DisplayObject | GUI<any>), options: GenericAnimation): import("@antv/g-lite").IAnimation | null;