export declare enum ModifierKeys {
    CMD = 0,
    CTRL = 1,
    SHIFT = 2,
    ALT = 3
}
declare type ModifierHandler = {
    cb: (e?: KeyboardEvent) => void;
    or?: ModifierKeys[];
    and?: ModifierKeys[];
};
declare type Handler = (e?: KeyboardEvent) => void;
export declare type Mapping = {
    [key: number]: Handler | ModifierHandler;
};
/**
 * Sets up hotkeys for a component. Should generally be called in componentDidMount.
 * @param {function|Object} mapping the hotkey mapping keycodes to callback.
 * @param {Number} throttleMs the number of milliseconds to throttle keydown events with.
 * For example:
 *  setupHotkeys({32: this.playMusic})  // fires playMusic() on 'space'
 *
 * The mapping values may be an object with three fields:
 *  cb: the callback to fire
 *  or: modifier keys that must be OR'd with the hotkey
 *  and: modifier keys that must be AND'd with the hotkey
 *
 * For example:
 *  setupHotkeys({32: {cb: this.playMusic, or: [CMD, CTRL]})
 *    // fires on 'cmd+space' or 'ctrl+space'
 *  setupHotkeys({32: {cb: this.playMusic, and: [CMD, CTRL]})
 *    // fires on 'cmd+ctrl+space'
 *  setupHotkeys({32: {cb: this.playMusic, or: [ALT, CTRL], and: [CMD, SHIFT]})
 *    // fires on 'cmd+shift+alt+space' or 'cmd+shift+ctrl+space'\
 * @returns {function} the event listener function
 */
export declare function setupHotkeys(mapping: Mapping, throttleMs?: number, preventDefault?: boolean): (e: KeyboardEvent) => void;
/**
 * Removes a hotkey event listener.
 * @param {function} hook the function hook returned by setupHotkeys.
 */
export declare function removeHotkeys(hook: (e: KeyboardEvent) => void): void;
export {};
