zhangjian
2023-06-05 0976d2d0f90cff460cedfdc8bd74e98c2c31a58c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import Element, { ElementProps } from 'zrender/lib/Element.js';
import { ZREasing } from './types.js';
declare type AnimationWrapDoneCallback = () => void;
/**
 * Animate multiple elements with a single done-callback.
 *
 * @example
 *  animation
 *      .createWrap()
 *      .add(el1, {x: 10, y: 10})
 *      .add(el2, {shape: {width: 500}, style: {fill: 'red'}}, 400)
 *      .done(function () { // done })
 *      .start('cubicOut');
 */
declare class AnimationWrap {
    private _storage;
    private _elExistsMap;
    private _finishedCallback;
    /**
     * Caution: a el can only be added once, otherwise 'done'
     * might not be called. This method checks this (by el.id),
     * suppresses adding and returns false when existing el found.
     *
     * @return Whether adding succeeded.
     */
    add(el: Element, target: ElementProps, duration?: number, delay?: number, easing?: ZREasing): boolean;
    /**
     * Only execute when animation done/aborted.
     */
    finished(callback: AnimationWrapDoneCallback): AnimationWrap;
    /**
     * Will stop exist animation firstly.
     */
    start(): AnimationWrap;
}
export declare function createWrap(): AnimationWrap;
export {};