import '../../../assert/js/assert.js';
import '../../../globals.js';
import TEmitter from '../../../axon/js/TEmitter.js';
import PickOptional from '../../../phet-core/js/types/PickOptional.js';
import PhetioAction from '../../../tandem/js/PhetioAction.js';
import { PhetioObjectOptions } from '../../../tandem/js/PhetioObject.js';
import { EnglishKey, EnglishKeyString } from '../imports.js';
export type KeyStateTrackerOptions = PickOptional<PhetioObjectOptions, 'tandem'>;
declare class KeyStateTracker {
    private keyState;
    private _lastKeyDown;
    private attachedToDocument;
    private documentKeyupListener;
    private documentKeydownListener;
    private documentBlurListener;
    private _enabled;
    readonly keydownEmitter: TEmitter<[KeyboardEvent]>;
    readonly keyupEmitter: TEmitter<[KeyboardEvent]>;
    readonly keyDownStateChangedEmitter: TEmitter<[KeyboardEvent | null]>;
    readonly keydownUpdateAction: PhetioAction<[KeyboardEvent]>;
    readonly keyupUpdateAction: PhetioAction<[KeyboardEvent]>;
    private readonly disposeKeyStateTracker;
    constructor(options?: KeyStateTrackerOptions);
    /**
     * Implements keyboard dragging when listener is attached to the Node, public so listener is attached
     * with addInputListener(). Only updated when enabled.
     *
     * Note that this event is assigned in the constructor, and not to the prototype. As of writing this,
     * `Node.addInputListener` only supports type properties as event listeners, and not the event keys as
     * prototype methods. Please see https://github.com/phetsims/scenery/issues/851 for more information.
     */
    keydownUpdate(domEvent: KeyboardEvent): void;
    /**
     * Modifier keys might be part of the domEvent but the browser may or may not have received a keydown/keyup event
     * with specifically for the modifier key. This will add or remove modifier keys in that case.
     */
    private correctModifierKeys;
    /**
     * Behavior for keyboard 'up' DOM event. Public so it can be attached with addInputListener(). Only updated when
     * enabled.
     *
     * Note that this event is assigned in the constructor, and not to the prototype. As of writing this,
     * `Node.addInputListener` only supports type properties as event listeners, and not the event keys as
     * prototype methods. Please see https://github.com/phetsims/scenery/issues/851 for more information.
     */
    keyupUpdate(domEvent: KeyboardEvent): void;
    /**
     * Returns true if any of the movement keys are down (arrow keys or WASD keys).
     */
    get movementKeysDown(): boolean;
    /**
     * Returns the KeyboardEvent.code from the last key down that updated the keystate.
     */
    getLastKeyDown(): string | null;
    /**
     * Returns true if a key with the KeyboardEvent.code is currently down.
     */
    isKeyDown(key: string): boolean;
    /**
     * Returns true if the key with the KeyboardEvent.code is currently down.
     */
    isEnglishKeyDown(key: EnglishKey): boolean;
    /**
     * Returns the set of keys that are currently down.
     *
     * NOTE: Always returns a new array, so a defensive copy is not needed.
     */
    getKeysDown(): string[];
    /**
     * Returns the set of EnglishKeys that are currently down.
     *
     * NOTE: Always returns a new Set, so a defensive copy is not needed.
     */
    getEnglishKeysDown(): Set<EnglishKeyString>;
    /**
     * Returns true if any of the keys in the list are currently down. Keys are the KeyboardEvent.code strings.
     */
    isAnyKeyInListDown(keyList: string[]): boolean;
    /**
     * Returns true if ALL of the keys in the list are currently down. Values of the keyList array are the
     * KeyboardEvent.code for the keys you are interested in.
     */
    areKeysDown(keyList: string[]): boolean;
    /**
     * Returns true if ALL keys in the list are down and ONLY the keys in the list are down. Values of keyList array
     * are the KeyboardEvent.code for keys you are interested in OR the KeyboardEvent.key in the special case of
     * modifier keys.
     *
     * (scenery-internal)
     */
    areKeysExclusivelyDown(keyList: string[]): boolean;
    /**
     * Returns true if every key in the list is down but no other modifier keys are down, unless
     * the modifier key is in the list. For example
     * areKeysDownWithoutModifiers( [ 'ShiftLeft', 'ArrowLeft' ] ) -> true if left shift and left arrow keys are down.
     * areKeysDownWithoutModifiers( [ 'ShiftLeft', 'ArrowLeft' ] ) -> true if left shift, left arrow, and J keys are down.
     * areKeysDownWithoutModifiers( [ 'ArrowLeft' ] ) -> false if left shift and arrow left keys are down.
     * areKeysDownWithoutModifiers( [ 'ArrowLeft' ] ) -> true if the left arrow key is down.
     * areKeysDownWithoutModifiers( [ 'ArrowLeft' ] ) -> true if the left arrow and R keys are down.
     *
     * This is important for determining when keyboard events should fire listeners. Say you have two KeyboardListeners -
     * One fires from key 'c' and another fires from 'shift-c'. If the user presses 'shift-c', you do NOT want both to
     * fire.
     *
     * @param keyList - List of KeyboardEvent.code strings for keys you are interested in.
     */
    areKeysDownWithoutExtraModifiers(keyList: string[]): boolean;
    /**
     * Returns true if any keys are down according to teh keyState.
     */
    keysAreDown(): boolean;
    /**
     * Returns true if the "Enter" key is currently down.
     */
    get enterKeyDown(): boolean;
    /**
     * Returns true if the shift key is currently down.
     */
    get shiftKeyDown(): boolean;
    /**
     * Returns true if the alt key is currently down.
     */
    get altKeyDown(): boolean;
    /**
     * Returns true if the control key is currently down.
     */
    get ctrlKeyDown(): boolean;
    /**
     * Returns true if one of the meta keys is currently down.
     */
    get metaKeyDown(): boolean;
    /**
     * Returns the amount of time that the provided key has been held down. Error if the key is not currently down.
     * @param key - KeyboardEvent.code for the key you are inspecting.
     */
    timeDownForKey(key: string): number;
    /**
     * Clear the entire state of the key tracker, basically restarting the tracker.
     */
    clearState(skipNotify?: boolean): void;
    /**
     * Step function for the tracker. JavaScript does not natively handle multiple keydown events at once,
     * so we need to track the state of the keyboard in an Object and manage dragging in this function.
     * In order for the drag handler to work.
     *
     * @param dt - time in seconds that has passed since the last update
     */
    private step;
    /**
     * Add this KeyStateTracker to the window so that it updates whenever the document receives key events. This is
     * useful if you want to observe key presses while DOM focus not within the PDOM root.
     */
    attachToWindow(): void;
    /**
     * The KeyState is cleared when the tracker is disabled.
     */
    setEnabled(enabled: boolean): void;
    set enabled(enabled: boolean);
    get enabled(): boolean;
    isEnabled(): boolean;
    /**
     * Detach listeners from the document that would update the state of this KeyStateTracker on key presses.
     */
    detachFromDocument(): void;
    dispose(): void;
}
export default KeyStateTracker;
//# sourceMappingURL=KeyStateTracker.d.ts.map