/*!
 * Copyright 2017 - 2020 by ChartIQ, Inc.
 * All rights reserved.
 */
import { _BaseClient as BaseClient } from "./baseClient";
import { StandardErrorCallback, StandardPromise } from "../types";
declare class KeyStroke {
    keyStrokeHandlers: {
        keyString: string;
        handler: () => void;
    }[];
    key: string | null;
    shift: boolean;
    ctrl: boolean;
    alt: boolean;
    cmd: boolean;
    capsLock: boolean;
    noKeyCapture: boolean;
    downValue: string | null;
    registerKeyHandler(entry: {
        keyString: string;
        handler: () => void;
    }): void;
    keyup(e: KeyboardEvent): void;
    keydown(e: KeyboardEvent): void;
    keypress(e: KeyboardEvent): void;
    gotKeyStroke(key: any): void;
    initialize(): void;
}
/**
 * @introduction
 *
 * <h2>Hotkey Client (Finsemble Flow)</h2>
 *
 * This module contains Finsemble's Hotkey Client. Use this API to register event handlers for hotkeys (key combinations).
 * Key combinations (sometimes referred to as "key chords") are defined as arrays. An example key combination is `["shift","ctrl","f"]` which would trigger whenever a user presses those three keys simultaneously.
 *
 * Common keys include "shift","ctrl","alt","backspace","tab","esc","enter","left","right,"up","down","space","pgup","pgdn". A complete list can be output by running: `console.log(FSBL.Clients.HotkeyClient.keyMap)`. Take care to consider that not every keyboard contains every key.
 *
 * Two types of hotkeys are supported: **local hotkeys**, which will only be triggered when the window which defined the hotkey is in focus, and **global hotkeys**, which will are triggered anytime, regardless of whether the window is in focus or not.
 *
 * For more information, see the [Hotkey tutorial](tutorial-Hotkeys.html).
 *
 *
 *
 * @constructor
 * @hideconstructor
 * @publishedName HotkeyClient
 * @param {*} params
 */
export declare class HotkeyClient extends BaseClient {
    localListeners: Record<string, Record<string, (...args: any[]) => void>>;
    keyStrokes: KeyStroke | null;
    constructor();
    /**
     *Adds a local hotkey which fires only when the window calling the method is in focus. If you execute this function more than once for the same key combination, both hotkeys will coexist, and would need to be removed separately.
     * @param {Array.<string>} keyArr Array of strings representing hotkey key combination.
     * @param {function} handler Function to be executed when the hotkey combination is pressed. It is recommended that you define a variable to represent the handler function, as the same function must be passed in order to remove the hotkey.
     * @param {StandardCallback} cb Callback to be called after local hotkey is added.
     * @example
     * var myFunction = function () {...}
     * FSBL.Clients.HotkeyClient.addLocalHotkey(["ctrl", "shift", "s"], myFunction, cb)
     */
    addLocalHotkey(keyArr: string[], handler: (...args: any[]) => void, cb?: StandardErrorCallback<void>): StandardPromise<void>;
    /**
     *Adds a local hotkey, firing only when the window calling the method is in focus. If you execute this function more than once for the same key combination, both hotkeys will coexist, and would need to be remove separately.
     * This function uses browser key capture, so it will work when assimilation is not running
     * @param {Array} [keyArr] Array of strings representing hotkey key combination.
     * @param {function} [handler] Function to be executed when the hotkey combination is pressed. It is recommended that you define a variable to represent the handler function, as the same function must be passed in order to remove the hotkey.
     * @param {function} cb Callback to be called after local hotkey is added.
     * @private
     * @example
     * var myFunction = function () {...}
     * FSBL.Clients.HotkeyClient.addBrowserHotkey(["ctrl","shift","s"],myFunction,cb)
     */
    addBrowserHotkey(keyArr: string[], handler: () => void): void;
    /**
     *Removes a local hotkey.
     * @param {Array.<string>} keyArr Array of strings representing hotkey key combination.
     * @param {function} handler Handler registered for the hotkey to be removed.
     * @param {StandardCallback} cb Callback to be called after local hotkey is removed.
     * @example
     *
     * FSBL.Clients.HotkeyClient.removeLocalHotkey(["ctrl", "shift", "s"], myFunction, cb)
     */
    removeLocalHotkey(keyArr: string[], handler: (...args: any[]) => void, cb?: StandardErrorCallback<void>): StandardPromise<void>;
    /**
     *Adds a global hotkey which fires regardless of what window is in focus. If you execute this function more than once for the same key combination, both hotkeys will coexist, and would need to be removed separately.
     * @param {Array.<string>} keyArr Array of strings representing a hotkey key combination.
     * @param {function} handler Function to be executed when the hotkey combination is pressed. It is recommended that you define a variable to represent the handler function, as the same function must be passed in order to remove the hotkey.
     * @param {StandardCallback} cb Callback to be called after local hotkey is added.
     * @example
     * var myFunction = function () {...}
     * FSBL.Clients.HotkeyClient.addGlobalHotkey(["ctrl", "shift", "s"], myFunction, cb)
     */
    addGlobalHotkey(keyArr: string[], handler: Function | any, cb?: StandardErrorCallback<void>): StandardPromise<void>;
    /**
     *Removes a global hotkey.
     * @param {Array.<string>} keyArr Array of strings representing hotkey key combination.
     * @param {function} handler Handler registered for the hotkey to be removed.
     * @param {StandardCallback} cb Callback to be called after local hotkey is removed.
     * @example
     *
     * FSBL.Clients.HotkeyClient.removeGlobalHotkey(["ctrl", "shift", "s"], myFunction, cb)
     */
    removeGlobalHotkey(keyArr: string[], handler: Function | any, cb?: StandardErrorCallback<void>): StandardPromise<void>;
    /**
     * Unregister all hotkeys, both locally and service-side.
     * @param {StandardCallback} cb Optional callback function
     *
     */
    removeAllHotkeys(cb?: StandardErrorCallback<void>): StandardPromise<void>;
    /**
     * Handler for "hotkey triggered" messages from the service, called upon client initialization.
     * @private
     */
    start(): void;
    /**
     * Automatically unregister all hotkeys when the window containing the client closes
     * @private
     */
    onClose(cb: () => void): void;
}
declare const hotkeyClient: HotkeyClient;
export default hotkeyClient;
//# sourceMappingURL=hotkeysClient.d.ts.map