import '../../assert/js/assert.js';
import '../../globals.js';
/**
 * An easing-based controllable animation.
 *
 * We use some terminology to describe points and regions in time for an animation:
 *
 *             starts                            begins                                finishes
 *               |             delay               |             animation                |
 * time-->       |           (waiting)             |     (animated values changing)       |
 * ---------------------------------------------------------------------------------------------------------------------
 *               |------------------------------running-----------------------------------|
 *                                                 |-------------animating----------------|
 *
 * TODO #3: pause/cancel (and stop->cancel renaming)
 * TODO #3: function for blending with angular/rotational values
 * TODO #3: consider keyframed animation helper?
 * TODO #3: Hooks for attaching/detaching stepping via screens/nodes
 * TODO #3: Add documentation examples (contingent on how screen/node hooks work)
 *
 * @author Jonathan Olson <jonathan.olson@colorado.edu>
 */
import BooleanProperty from '../../axon/js/BooleanProperty.js';
import Disposable, { DisposableOptions } from '../../axon/js/Disposable.js';
import Emitter from '../../axon/js/Emitter.js';
import { TReadOnlyEmitter } from '../../axon/js/TEmitter.js';
import { AnimationTargetOptions } from './AnimationTarget.js';
type SelfOptions<TargetTypes, TargetObjectTypes extends {
    [K in keyof TargetTypes]: unknown;
}> = {
    targets?: {
        [K in keyof TargetTypes]: AnimationTargetOptions<TargetTypes[K], TargetObjectTypes[K]>;
    } | null;
    duration?: number | null;
    delay?: number;
    stepEmitter?: TReadOnlyEmitter<[number]> | null;
};
export type AnimationOptions<SelfType = unknown, SelfObjectType = unknown, TargetTypes = unknown[], TargetObjectTypes extends {
    [K in keyof TargetTypes]: unknown;
} = {
    [K in keyof TargetTypes]: unknown;
}> = SelfOptions<TargetTypes, TargetObjectTypes> & AnimationTargetOptions<SelfType, SelfObjectType> & DisposableOptions;
declare class Animation<SelfType = unknown, SelfObjectType = unknown, TargetTypes = unknown[], TargetObjectTypes extends {
    [K in keyof TargetTypes]: unknown;
} = {
    [K in keyof TargetTypes]: unknown;
}> extends Disposable {
    private readonly targets;
    private readonly duration;
    private readonly delay;
    private length;
    private remainingDelay;
    private remainingAnimation;
    readonly runningProperty: BooleanProperty;
    readonly animatingProperty: BooleanProperty;
    readonly startEmitter: Emitter<[]>;
    readonly beginEmitter: Emitter<[]>;
    readonly finishEmitter: Emitter<[number]>;
    readonly stopEmitter: Emitter<[]>;
    readonly endedEmitter: Emitter<[]>;
    readonly updateEmitter: Emitter<[]>;
    /**
     * The constructor config will define one or more animation "targets" (specific values to be animated). The config
     * available for targets is documented in AnimationTarget.
     *
     * If there is only one target, it is recommended to pass in those config in the top-level Animation config, e.g.:
     * | var someNumberProperty = new NumberProperty( 0 );
     * | new Animation( {
     * |   // Options for the Animation as a whole
     * |   duration: 2,
     * |
     * |   // Options for the one target to change
     * |   property: someNumberProperty,
     * |   to: 5
     * | } );
     *
     * However multiple different targets are supported, and should be specified in the `targets` option:
     * | var someNumberProperty = new NumberProperty( 100 );
     * | var someObject = { someAttribute: new Vector2( 100, 5 ) };
     * | new Animation( {
     * |   // Options for the Animation as a whole
     * |   duration: 2,
     * |
     * |   targets: [ {
     * |     // First target
     * |     property: someNumberProperty,
     * |     to: 5
     * |   }, {
     * |     // Second target
     * |     object: someObject,
     * |     attribute: 'someAttribute',
     * |     to: new Vector2( 50, 10 )
     * |   } ]
     * | } );
     *
     * NOTE: The length of the animation needs to be specified in exactly one place. This can usually be done by
     * specifying the `duration` in the config, but `speed` can also be used in any of the targets.
     *
     * EXAMPLE: It's possible to create continuous animation loops, where animations cycle back and forth, e.g.:
     * | var moreOpaque = new Animation( {
     * |   object: animatedCircle,
     * |   attribute: 'opacity',
     * |   from: 0.5,
     * |   to: 1,
     * |   duration: 0.5,
     * |   easing: Easing.QUADRATIC_IN_OUT
     * | } );
     * | var lessOpaque = new Animation( {
     * |   object: animatedCircle,
     * |   attribute: 'opacity',
     * |   from: 1,
     * |   to: 0.5,
     * |   duration: 0.5,
     * |   easing: Easing.QUADRATIC_IN_OUT
     * | } );
     * | moreOpaque.then( lessOpaque );
     * | lessOpaque.then( moreOpaque );
     * | lessOpaque.start();
     */
    constructor(providedConfig: AnimationOptions<SelfType, SelfObjectType, TargetTypes, TargetObjectTypes>);
    /**
     * Starts the animation (or if it has a delay, sets the animation to start after that delay).
     *
     * @param [dt] - If provided, step this far into the animation initially.  Used for chaining animations.
     */
    start(dt?: number): this;
    /**
     * Stops the animation (or if waiting for the delay, will not "start" the animation).
     */
    stop(): this;
    /**
     * Steps the animation forward by a certain amount of time.
     *
     * @param dt - In seconds
     */
    step(dt: number): this;
    /**
     * After this animation is complete, the given animation will be started.
     *
     * @returns - Returns the passed-in animation so things can be chained nicely.
     */
    then(animation: Animation): Animation;
    dispose(): void;
}
export default Animation;
//# sourceMappingURL=Animation.d.ts.map