@shopware-ag/dive
Version:
Shopware Spatial Framework
46 lines (45 loc) • 1.26 kB
TypeScript
import { Animator } from './Animator.ts';
import { TAnimatorLoopMode, TAnimatorState } from '../types/AnimatorTypes.ts';
type EasingFunction = (amount: number) => number;
export type AnimationTarget = {
object: any;
to: any;
};
export type TargetAnimatorOptions = {
easing?: EasingFunction;
onUpdate?: () => void;
onComplete?: () => void;
};
/**
* Animator for programmatic target-based animations.
*
* Bundles multiple animation targets into a single logical animation unit
* using an isolated TWEEN.Group per instance.
*
* @module
*/
export declare class TargetAnimator extends Animator {
private _group;
private _tweens;
private _snapshots;
private _state;
private _duration;
private _loop;
private _options?;
private _completedCount;
constructor(targets: AnimationTarget | AnimationTarget[], duration: number, options?: TargetAnimatorOptions);
get state(): TAnimatorState;
get duration(): number;
get loop(): TAnimatorLoopMode;
set loop(value: TAnimatorLoopMode);
get time(): number;
set time(_value: number);
play(): this;
pause(): this;
resume(): this;
stop(): this;
update(): void;
private _restoreSnapshots;
dispose(): void;
}
export {};