import { AStageAnimate } from "@visactor/vrender-animate";

export class CallbackDisappearAnimate extends AStageAnimate {
    constructor(from, to, duration, easing, params) {
        super(from, to, duration, easing, params), this.currentAnimationRatio = 0, this.animationTime = 0;
    }
    onUpdate(end, ratio, out) {
        super.onUpdate(end, ratio, out), this.currentAnimationRatio = ratio, this.animationTime = ratio * Math.PI * 2;
    }
    getAnimationTime() {
        return this.currentAnimationRatio > 0 ? this.animationTime : Date.now() / 1e3;
    }
    afterStageRender(stage, canvas) {
        var _a, _b;
        return null === (_b = null === (_a = this.params) || void 0 === _a ? void 0 : _a.callBack) || void 0 === _b ? void 0 : _b.call(_a, stage, canvas, this.currentAnimationRatio, this.animationTime);
    }
}