import '../../../assert/js/assert.js';
import '../../../globals.js';
/**
 * ValueChangeSoundPlayer plays sounds based on changes to a numerical value.  It was initially created for supporting
 * sound generation in PhET's Slider class and variations thereof, but it may have other applications.
 *
 * This class does not extend SoundGenerator and is not itself added to the sound manager.  It is instead a player of
 * a set of sounds, each of which should be registered with the sound manager elsewhere.
 *
 * Because the sounds should only be produced when users directly change a value, and not in side-effect-ish situations
 * (such as a reset), this class does not monitor a Property.  Instead, it provides methods that can be used to evaluate
 * changes in a value and potentially play sounds (or not, if the change doesn't warrant sound generation), and it is
 * the client's responsibility to know the situations in which these methods should be called.  Often these methods will
 * be called in drag handlers and other code that handles user input.
 *
 * @author John Blanco (PhET Interactive Simulations)
 */
import Disposable, { DisposableOptions } from '../../../axon/js/Disposable.js';
import TReadOnlyProperty from '../../../axon/js/TReadOnlyProperty.js';
import Range from '../../../dot/js/Range.js';
import TSoundPlayer from '../TSoundPlayer.js';
import SoundClip from './SoundClip.js';
type SelfOptions = {
    middleMovingUpSoundPlayer?: TSoundPlayer | SoundClip;
    middleMovingDownSoundPlayer?: TSoundPlayer | SoundClip;
    middleMovingUpPlaybackRateMapper?: (value: number) => number;
    middleMovingDownPlaybackRateMapper?: (value: number) => number;
    numberOfMiddleThresholds?: number | null;
    interThresholdDelta?: number | null;
    constrainValue?: (n: number) => number;
    minSoundPlayer?: TSoundPlayer;
    maxSoundPlayer?: TSoundPlayer;
    minimumInterMiddleSoundTime?: number;
};
export type ValueChangeSoundPlayerOptions = SelfOptions & DisposableOptions;
declare class ValueChangeSoundPlayer extends Disposable {
    private interThresholdDistance;
    private readonly valueRangeProperty;
    private readonly middleMovingUpSoundPlayer;
    private readonly middleMovingDownSoundPlayer;
    private readonly middleMovingUpPlaybackRateMapper;
    private readonly middleMovingDownPlaybackRateMapper;
    private readonly minSoundPlayer;
    private readonly maxSoundPlayer;
    private readonly minimumInterMiddleSoundTime;
    private readonly constrainValue;
    private timeOfMostRecentMiddleSound;
    /**
     * @param valueRange - the range of values expected and over which sounds will be played
     * @param [providedOptions]
     */
    constructor(valueRange: Range | TReadOnlyProperty<Range>, providedOptions?: ValueChangeSoundPlayerOptions);
    /**
     * Check if the new value has reached or crossed a threshold and, if so, play the appropriate sound.  If no threshold
     * has been reached or crossed and the new value is not at the min or max, no sound will be played.
     */
    playSoundIfThresholdReached(newValue: number, oldValue: number): void;
    /**
     * Play the appropriate sound for the change in value indicated by the provided new and old values.  This will almost
     * always play a sound, but there are some exceptions.  See the code and comments for details.
     */
    playSoundForValueChange(newValue: number, oldValue: number): void;
    /**
     * Get an array that contains the next lowest and next highest thresholds for the provided value.  If the provided
     * value is exactly equal to a threshold, only the single threshold value is returned in the array.
     */
    private getSurroundingThresholds;
    /**
     * A static instance that makes no sound.  This is generally used as an option value to turn off sound generation.
     */
    static readonly NO_SOUND: ValueChangeSoundPlayer;
    /**
     * A static TSoundPlayer instance that is intended to be used as a flag for the min and max sound players to
     * indicate that the middle sound player should be used.
     */
    static readonly USE_MIDDLE_SOUND: TSoundPlayer;
}
export default ValueChangeSoundPlayer;
//# sourceMappingURL=ValueChangeSoundPlayer.d.ts.map