import '../../../assert/js/assert.js';
import '../../../globals.js';
import { Shape } from '../../../kite/js/imports.js';
import { Display, Node, TOverlay, TPaint } from '../imports.js';
import TProperty from '../../../axon/js/TProperty.js';
export type Highlight = Node | Shape | null | 'invisible';
export type HighlightOverlayOptions = {
    pdomFocusHighlightsVisibleProperty?: TProperty<boolean>;
    interactiveHighlightsVisibleProperty?: TProperty<boolean>;
    readingBlockHighlightsVisibleProperty?: TProperty<boolean>;
};
export default class HighlightOverlay implements TOverlay {
    private readonly display;
    private readonly focusRootNode;
    private trail;
    private node;
    private activeHighlight;
    private mode;
    private groupMode;
    private groupHighlightNode;
    private transformTracker;
    private groupTransformTracker;
    private nodeModeHighlight;
    private nodeModeHighlightLayered;
    private transformDirty;
    private readonly highlightNode;
    private readonly readingBlockHighlightNode;
    private addedReadingBlockHighlight;
    private activeReadingBlockNode;
    private readingBlockTrail;
    private readingBlockTransformDirty;
    private readingBlockTransformTracker;
    private readonly pdomFocusHighlightsVisibleProperty;
    private readonly interactiveHighlightsVisibleProperty;
    private readonly readingBlockHighlightsVisibleProperty;
    private readonly focusDisplay;
    readonly domElement: HTMLElement;
    private readonly shapeFocusHighlightPath;
    private readonly boundsFocusHighlightPath;
    private readonly groupFocusHighlightPath;
    private readonly groupFocusHighlightParent;
    private readonly readingBlockHighlightPath;
    private readonly boundsListener;
    private readonly transformListener;
    private readonly domFocusListener;
    private readonly readingBlockTransformListener;
    private readonly focusHighlightListener;
    private readonly interactiveHighlightListener;
    private readonly focusHighlightsVisibleListener;
    private readonly voicingHighlightsVisibleListener;
    private readonly pointerFocusListener;
    private readonly lockedPointerFocusListener;
    private readonly readingBlockFocusListener;
    private readonly readingBlockHighlightChangeListener;
    constructor(display: Display, focusRootNode: Node, providedOptions?: HighlightOverlayOptions);
    /**
     * Releases references
     */
    dispose(): void;
    /**
     * Returns whether or not this HighlightOverlay is displaying some highlight.
     */
    hasHighlight(): boolean;
    /**
     * Returns true if there is an active highlight around a ReadingBlock while the voicingManager is speaking its
     * Voicing content.
     */
    hasReadingBlockHighlight(): boolean;
    /**
     * Activates the highlight, choosing a mode for whether the highlight will be a shape, node, or bounds.
     *
     * @param trail - The focused trail to highlight. It assumes that this trail is in this display.
     * @param node - Node receiving the highlight
     * @param nodeHighlight - the highlight to use
     * @param layerable - Is the highlight layerable in the scene graph?
     * @param visibleProperty - Property controlling the visibility for the provided highlight
     */
    private activateHighlight;
    /**
     * Activate a focus highlight, activating the highlight and adding a listener that will update the highlight whenever
     * the Node's focusHighlight changes
     */
    private activateFocusHighlight;
    /**
     * Activate an interactive highlight, activating the highlight and adding a listener that will update the highlight
     * changes while it is active.
     */
    private activateInteractiveHighlight;
    /**
     * Activate the Reading Block highlight. This highlight is separate from others in the overlay and will always
     * surround the Bounds of the focused Node. It is shown in response to certain input on Nodes with Voicing while
     * the voicingManager is speaking.
     *
     * Note that customizations for this highlight are not supported at this time, that could be added in the future if
     * we need.
     */
    private activateReadingBlockHighlight;
    /**
     * Deactivate the speaking highlight by making it invisible.
     */
    private deactivateReadingBlockHighlight;
    /**
     * Deactivates the all active highlights, disposing and removing listeners as necessary.
     */
    private deactivateHighlight;
    /**
     * Activate all 'group' focus highlights by searching for ancestor nodes from the node that has focus
     * and adding a rectangle around it if it has a "groupFocusHighlight". A group highlight will only appear around
     * the closest ancestor that has a one.
     */
    private activateGroupHighlights;
    /**
     * Update focus highlight colors. This is a no-op if we are in 'node' mode, or if none of the highlight colors
     * have changed.
     *
     * TODO: Support updating focus highlight strokes in 'node' mode as well? https://github.com/phetsims/scenery/issues/1581
     */
    private updateHighlightColors;
    /**
     * Remove all group focus highlights by making them invisible, or removing them from the root of this overlay,
     * depending on mode.
     */
    private deactivateGroupHighlights;
    /**
     * Called from HighlightOverlay after transforming the highlight. Only called when the transform changes.
     */
    private afterTransform;
    /**
     * Every time the transform changes on the target Node signify that updates are necessary, see the usage of the
     * TransformTrackers.
     */
    private onTransformChange;
    /**
     * Mark that the transform for the ReadingBlock highlight is out of date and needs to be recalculated next update.
     */
    private onReadingBlockTransformChange;
    /**
     * Called when bounds change on our node when we are in "Bounds" mode
     */
    private onBoundsChange;
    /**
     * Called when the main Scenery focus pair (Display,Trail) changes. The Trail points to the Node that has
     * focus and a highlight will appear around this Node if focus highlights are visible.
     */
    private onFocusChange;
    /**
     * Called when the pointerFocusProperty changes. pointerFocusProperty will have the Trail to the
     * Node that composes Voicing and is under the Pointer. A highlight will appear around this Node if
     * voicing highlights are visible.
     */
    private onPointerFocusChange;
    /**
     * Redraws the highlight. There are cases where we want to do this regardless of whether the pointer focus
     * is locked, such as when the highlight changes changes for a Node that is activated for highlighting.
     *
     * As of 8/11/21 we also decided that Interactive Highlights should also never be shown while
     * PDOM highlights are visible, to avoid confusing cases where the Interactive Highlight
     * can appear while the DOM focus highlight is active and conveying information. In the future
     * we might make it so that both can be visible at the same time, but that will require
     * changing the look of one of the highlights so it is clear they are distinct.
     */
    private updateInteractiveHighlight;
    /**
     * Called whenever the lockedPointerFocusProperty changes. If the lockedPointerFocusProperty changes we probably
     * have to update the highlight because interaction with a Node that uses InteractiveHighlighting just ended.
     */
    private onLockedPointerFocusChange;
    /**
     * Responsible for deactivating the Reading Block highlight when the display.focusManager.readingBlockFocusProperty changes.
     * The Reading Block waits to activate until the voicingManager starts speaking because there is often a stop speaking
     * event that comes right after the speaker starts to interrupt the previous utterance.
     */
    private onReadingBlockFocusChange;
    /**
     * If the focused node has an updated focus highlight, we must do all the work of highlight deactivation/activation
     * as if the application focus changed. If focus highlight mode changed, we need to add/remove static listeners,
     * add/remove highlight children, and so on. Called when focus highlight changes, but should only ever be
     * necessary when the node has focus.
     */
    private onFocusHighlightChange;
    /**
     * If the Node has pointer focus and the interacive highlight changes, we must do all of the work to reapply the
     * highlight as if the value of the focusProperty changed.
     */
    private onInteractiveHighlightChange;
    /**
     * Redraw the highlight for the ReadingBlock if it changes while the reading block highlight is already
     * active for a Node.
     */
    private onReadingBlockHighlightChange;
    /**
     * When focus highlight visibility changes, deactivate highlights or reactivate the highlight around the Node
     * with focus.
     */
    private onFocusHighlightsVisibleChange;
    /**
     * When voicing highlight visibility changes, deactivate highlights or reactivate the highlight around the Node
     * with focus. Note that when voicing is disabled we will never set the pointerFocusProperty to prevent
     * extra work, so this function shouldn't do much. But it is here to complete the API.
     */
    private onVoicingHighlightsVisibleChange;
    /**
     * Called by Display, updates this overlay in the Display.updateDisplay call.
     */
    update(): void;
    /**
     * Set the inner color of all focus highlights.
     */
    static setInnerHighlightColor(color: TPaint): void;
    /**
     * Get the inner color of all focus highlights.
     */
    static getInnerHighlightColor(): TPaint;
    /**
     * Set the outer color of all focus highlights.
     */
    static setOuterHilightColor(color: TPaint): void;
    /**
     * Get the outer color of all focus highlights.
     */
    static getOuterHighlightColor(): TPaint;
    /**
     * Set the inner color of all group focus highlights.
     */
    static setInnerGroupHighlightColor(color: TPaint): void;
    /**
     * Get the inner color of all group focus highlights
     */
    static getInnerGroupHighlightColor(): TPaint;
    /**
     * Set the outer color of all group focus highlight.
     */
    static setOuterGroupHighlightColor(color: TPaint): void;
    /**
     * Get the outer color of all group focus highlights.
     */
    static getOuterGroupHighlightColor(): TPaint;
}
//# sourceMappingURL=HighlightOverlay.d.ts.map