import '../../../assert/js/assert.js';
import '../../../globals.js';
// Copyright 2021-2023, University of Colorado Boulder
/**
 * A singleton with an instance of an AnimatedPanZoomListener that can be easily accessed for an application.
 * The AnimatedPanZoomListener adds global key press listeners and it is reasonable that you would only want
 * one for a document/application.
 *
 * @author Jesse Greenberg
 */
import { AnimatedPanZoomListener, scenery } from '../imports.js';
class AnimatedPanZoomSingleton {
    constructor() {
        // A reference to the instance of the listener, null until initialized.
        this._listener = null;
    }
    initialize(targetNode, options) {
        this._listener = new AnimatedPanZoomListener(targetNode, options);
    }
    dispose() {
        assert && assert(this._listener, 'No listener, call initialize first.');
        this._listener.dispose();
        this._listener = null;
    }
    /**
     * Returns the AnimatedPanZoomListener.
     */
    get listener() {
        assert && assert(this._listener, 'No listener, call initialize first.');
        return this._listener;
    }
    /**
     * Returns true if the animatedPanZoomSingleton has been initialized.
     */
    get initialized() {
        return !!this._listener;
    }
}
const animatedPanZoomSingleton = new AnimatedPanZoomSingleton();
scenery.register('animatedPanZoomSingleton', animatedPanZoomSingleton);
export default animatedPanZoomSingleton;
//# sourceMappingURL=animatedPanZoomSingleton.js.map