/*!
 * Copyright 2017 - 2020 by ChartIQ, Inc.
 * All rights reserved.
 */
import { StandardErrorCallback, StandardPromise } from "../types";
/**
 * 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.
 *
 * This is exported because it is called by LinkerButton until that can be rewritten to use HTML5 events
 *
 * ```JavaScript
 * var myFunction = function () {...}
 * FSBL.Clients.HotkeyClient.addBrowserHotkey(["ctrl","shift","s"],myFunction)
 * ```
 * @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 {boolean} [addedByUser] Indicates that Hotkey was added as Local Hotkey by user.
 * @internal
 * @private
 * @ignore
 */
export declare const addBrowserHotkey: (keyArr: string[], handler: () => void, addedByUser?: boolean | undefined) => void;
/**
 * This method is deprecated. Use HTML5 key events when a window is in focus.
 *
 * 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.
 *
 * ```JavaScript
 * var myFunction = function () {...}
 * FSBL.Clients.HotkeyClient.addLocalHotkey(["ctrl", "shift", "s"], myFunction, cb)
 * ```
 * @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.
 * @deprecated
 */
export declare const addLocalHotkey: (keyArr: string[], handler: (...args: any[]) => void, cb?: StandardErrorCallback<void> | undefined) => StandardPromise<void>;
/**
 * This method is deprecated. Use HTML5 key events when a window is in focus.
 *
 * Removes a local hotkey.
 *
 * ```JavaScript
 * FSBL.Clients.HotkeyClient.removeLocalHotkey(["ctrl", "shift", "s"], myFunction, cb)
 * ```
 * @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.
 * @deprecated
 */
export declare const removeLocalHotkey: (keyArr: string[], handler: (...args: any[]) => void, cb?: StandardErrorCallback<void> | undefined) => 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.
 *
 * ```JavaScript
 * var myFunction = function () {...}
 * FSBL.Clients.HotkeyClient.addGlobalHotkey(["ctrl", "shift", "s"], myFunction, cb)
 * ```
 * @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.
 */
export declare const addGlobalHotkey: (keyArr: string[], handler: Function | any, cb?: StandardErrorCallback<void> | undefined) => StandardPromise<void>;
/**
 * Removes a global hotkey.
 *
 * ```JavaScript
 * FSBL.Clients.HotkeyClient.removeGlobalHotkey(["ctrl", "shift", "s"], myFunction, cb)
 * ```
 * @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.
 */
export declare const removeGlobalHotkey: (keyArr: string[], handler: Function | any, cb?: StandardErrorCallback<void> | undefined) => StandardPromise<void>;
/**
 * Unregister all hotkeys, both locally and service-side.
 * @param {StandardCallback} cb Optional callback function
 */
export declare const removeAllHotkeys: (cb?: StandardErrorCallback<void> | undefined) => StandardPromise<void>;
/**
 * Automatically unregister all hotkeys when the window containing the client closes
 * @ignore
 */
export declare const onClose: (cb?: (() => void) | undefined) => void;
/**
 * @ignore
 */
export declare const HotkeyClient: {
    /**
     * For backward compatibility
     * @private
     * @deprecated
     */
    initialize: () => void;
    /**
     * For backward compatibility
     * @private
     * @deprecated
     */
    onReady: (cb?: any) => void;
    onClose: (cb?: (() => void) | undefined) => void;
    addGlobalHotkey: (keyArr: string[], handler: Function | any, cb?: StandardErrorCallback<void> | undefined) => StandardPromise<void>;
    removeAllHotkeys: (cb?: StandardErrorCallback<void> | undefined) => StandardPromise<void>;
    removeGlobalHotkey: (keyArr: string[], handler: Function | any, cb?: StandardErrorCallback<void> | undefined) => StandardPromise<void>;
    addLocalHotkey: (keyArr: string[], handler: (...args: any[]) => void, cb?: StandardErrorCallback<void> | undefined) => StandardPromise<void>;
    removeLocalHotkey: (keyArr: string[], handler: (...args: any[]) => void, cb?: StandardErrorCallback<void> | undefined) => StandardPromise<void>;
    addBrowserHotkey: (keyArr: string[], handler: () => void, addedByUser?: boolean | undefined) => void;
};
/**
 * @ignore
 */
export default HotkeyClient;
//# sourceMappingURL=hotkeyClient.d.ts.map