import '../../assert/js/assert.js';
import '../../globals.js';
import PhetioObject, { PhetioObjectOptions } from '../../tandem/js/PhetioObject.js';
import Announcer from './Announcer.js';
import Utterance, { FeatureSpecificAnnouncingControlProperty, TAlertable } from './Utterance.js';
type SelfOptions = {
    debug?: boolean;
    initialize?: boolean;
    featureSpecificAnnouncingControlPropertyName?: FeatureSpecificAnnouncingControlProperty | null;
};
type UtteranceQueueOptions = SelfOptions & PhetioObjectOptions;
declare class UtteranceQueue<A extends Announcer = Announcer> extends PhetioObject {
    readonly announcer: A;
    private readonly _initialized;
    private readonly queue;
    private _muted;
    private _enabled;
    private announcingUtteranceWrapper;
    private readonly debug;
    private readonly featureSpecificAnnouncingControlPropertyName;
    private readonly stepQueueListener;
    /**
     * @param announcer - The output implementation for the utteranceQueue, must implement an announce function
     *                             which requests speech in some way (such as the Web Speech API or aria-live)
     * @param [providedOptions]
     */
    constructor(announcer: A, providedOptions?: UtteranceQueueOptions);
    get length(): number;
    /**
     * Add an utterance ot the end of the queue.  If the utterance has a type of alert which
     * is already in the queue, the older alert will be immediately removed.
     */
    addToBack(utterance: TAlertable): void;
    /**
     * Add an utterance to the front of the queue to be read immediately.
     * @deprecated
     */
    addToFront(utterance: TAlertable): void;
    /**
     * Adds a listener to the priorityProperty of an Utterance, and puts the listener on a map so it
     * can easily be removed later. Finally, re-prioritizes Utterances in the queue based on the
     * priority of the new utterance.
     *
     * You must add the utteranceWrapper to the queue before calling this function.
     */
    private addPriorityListenerAndPrioritizeQueue;
    /**
     * Create an Utterance for the queue in case of string and clears the queue of duplicate utterances. This will also
     * remove duplicates in the queue, and update to the most recent timeInQueue variable.
     */
    private prepareUtterance;
    /**
     * Remove an Utterance from the queue. This function is only able to remove `Utterance` instances, and cannot remove
     * other TAlertable types.
     */
    removeUtterance(utterance: Utterance): void;
    /**
     * Remove earlier Utterances from the queue if the Utterance is important enough. This will also interrupt
     * the utterance that is in the process of being announced by the Announcer.
     */
    private prioritizeUtterances;
    /**
     * Given one utterance, should it cancel the other? The priority is used to determine if
     * one Utterance should cancel another, but the Announcer may override with its own logic.
     */
    private shouldUtteranceCancelOther;
    private removeOthersAndUpdateUtteranceWrapper;
    /**
     * Returns true if the UtteranceQueue is running and moving through Utterances.
     */
    get initializedAndEnabled(): boolean;
    private pruneDisposedUtterances;
    /**
     * Get the next utterance to alert if one is ready and "stable". If there are no utterances or no utterance is
     * ready to be announced, will return null.
     */
    private getNextUtterance;
    /**
     * Returns true if the utterances is in this queue.
     */
    hasUtterance(utterance: Utterance): boolean;
    /**
     * Clear the utteranceQueue of all Utterances, any Utterances remaining in the queue will
     * not be announced by the screen reader.
     */
    clear(): void;
    /**
     * Cancel the provided Utterance if it is being spoken by the Announcer. Removes the Utterance from the queue if
     * it is not being spoken by the announcer. Does nothing to other Utterances. The Announcer implements the behavior
     * to stop speech.
     */
    cancelUtterance(utterance: Utterance): void;
    /**
     * Clears all Utterances from the queue and cancels announcement of any Utterances that are being
     * announced by the Announcer.
     */
    cancel(): void;
    /**
     * Set whether or not the utterance queue is muted.  When muted, Utterances will still
     * move through the queue, but nothing will be sent to assistive technology.
     */
    setMuted(isMuted: boolean): void;
    set muted(isMuted: boolean);
    get muted(): boolean;
    /**
     * Get whether or not the utteranceQueue is muted.  When muted, Utterances will still
     * move through the queue, but nothing will be read by asistive technology.
     */
    getMuted(): boolean;
    /**
     * Set whether or not the utterance queue is enabled.  When enabled, Utterances cannot be added to
     * the queue, and the Queue cannot be cleared. Also nothing will be sent to assistive technology.
     */
    setEnabled(isEnabled: boolean): void;
    set enabled(isEnabled: boolean);
    get enabled(): boolean;
    /**
     * Get whether or not the utterance queue is enabled.  When enabled, Utterances cannot be added to
     * the queue, and the Queue cannot be cleared. Also nothing will be sent to assistive technology.
     */
    isEnabled(): boolean;
    /**
     * Step the queue, called by the timer.
     * @param dt - time since last step, in seconds
     */
    private stepQueue;
    /**
     * Immediately announce the provided Utterance. If the Announcer is ready to announce, the Utterance will be announced
     * synchronously with this call. Otherwise, the Utterance will be added to the front of the queue to be announced
     * as soon as the Announcer is ready.
     *
     * This function should generally not be used. Use addToBack() in correlation with priorityProperty and timing variables
     * to control the flow of Utterances. This function can be useful when you need an Utterance to be announced
     * synchronously with user input (for example, due to browser constraints on initializing SpeechSynthesis).
     *
     * Any duplicate instance of the provided Utterance that is already in the queue will be removed, matching the
     * behavior of addToBack().
     *
     * announceImmediately() respects Utterance.priorityProperty. A provided Utterance with a priority equal to or lower
     * than what is being announced will not interrupt and will never be announced. If an Utterance at the front of the
     * queue has a higher priority than the provided Utterance, the provided Utterance will never be announced. If the
     * provided Utterance has a higher priority than what is at the front of the queue or what is being announced, it will
     * be announced immediately and interrupt the announcer. Otherwise, it will never be announced.
     */
    announceImmediately(utterance: TAlertable): void;
    private attemptToAnnounce;
    dispose(): void;
    /**
     * Simple factory to wire up all steps for using UtteranceQueue for aria-live alerts. This accomplishes the three items
     * needed for UtteranceQueue to run:
     * 1. Step phet.axon.stepTimer on animation frame (passing it elapsed time in seconds)
     * 2. Add UtteranceQueue's aria-live elements to the document
     * 3. Create the UtteranceQueue instance
     */
    static fromFactory(): UtteranceQueue;
}
export default UtteranceQueue;
//# sourceMappingURL=UtteranceQueue.d.ts.map