import '../../../assert/js/assert.js';
import '../../../globals.js';
/**
 * Responsible for setting the provided focusProperty to null when the Focused node either
 * becomes invisible on the Display or is removed from the scene graph. It uses a
 * TrailVisibilityTracker to determine if any Node in the Trail has become invisible.
 *
 * Meant to be scenery-internal and used by FocusManager.
 *
 * @author Jesse Greenberg
 */
import TProperty from '../../../axon/js/TProperty.js';
import { Focus } from '../imports.js';
declare class FocusDisplayedController {
    private node;
    private visibilityTracker;
    private focusProperty;
    private readonly boundVisibilityListener;
    private readonly boundInstancesChangedListener;
    private readonly boundNodeDisposedListener;
    private readonly boundFocusListener;
    constructor(focusProperty: TProperty<Focus | null>);
    /**
     * When Focus changes, remove any listeners that were attached from last Focus and
     * add new listeners if focus has a new value.
     */
    private handleFocusChange;
    /**
     * When the Trail becomes invisible, Focus should be set to null.
     */
    private handleTrailVisibilityChange;
    /**
     * If there are no more Instances for the Node with focus it has been removed from
     * the scene graph and so Focus should be set to null.
     */
    private handleInstancesChange;
    /**
     * While this focus-clear is mostly covered by listening for instance changes, there is an intermediate state between
     * when a Node is disposed, and when the Instance tree is updated to reflect that disposal (during updateDisplay()).
     * This function handles that atypical case (pretty much impossible to get to in PhET sims except during fuzzing).
     */
    private handleNodeDisposed;
    /**
     * Add listeners that watch when the Displayed state of the Node with Focus has changed,
     * including visibility of the trail and attachment to a scene graph.
     */
    private addDisplayedListeners;
    /**
     * Remove any listeners that were added to observables that fire when the Node's displayed
     * state may have changed.
     */
    private removeDisplayedListeners;
    dispose(): void;
}
export default FocusDisplayedController;
//# sourceMappingURL=FocusDisplayedController.d.ts.map