import { _BaseClient as BaseClient } from "./baseClient";
import { WindowIdentifier } from "../services/window/types";
import { StandardCallback, StandardErrorCallback, StandardPromise } from "../types";
import { MonitorCoordinates, MonitorInfoDetail, WindowOptions } from "../FEA";
import { WindowBounds } from "../services/window/types";
import { MonitorCommand } from "../common/Monitors";
import { Bounds } from "../common/FinsembleWindowData";
import { FEAWindow } from "../FEA";
declare type getStackedWindowParams = {
    /** if true and StackedWindow isn't defined, a stacked window will be created. */
    create?: boolean;
    /** If creating a stacked window, you can optionally specify an array of other windowIdentifiers to add to the stack on creation. The calling window will automatically be added. */
    windowIdentifiers?: WindowIdentifier[];
};
declare type GroupData = {
    windowNames: string[];
    isMovable: boolean;
    isAlwaysOnTop: boolean;
    topRightWindow: string;
    isARectangle: boolean;
};
/**
 *
 *@introduction
  <h2>Window Client (Finsemble Workspaces)</h2>
  ----------
 * The Window Client is primarily responsible for managing the `windowState` (the window's bounds) and `componentState` (data inside of your component).
 * The reference below is provided in case you'd like to manually trigger events.
 *
 *
 * @hideconstructor
 * @param {object} params
 * @constructor
 * @returns {WindowClient}
 */
export declare class WindowClient extends BaseClient {
    options: WindowOptions;
    title: string | null;
    windowGroups: GroupData[];
    enableWindowsAeroSnap: boolean;
    isInAService: boolean | undefined;
    commandChannel: ((arg0: any, arg1: any) => void) | undefined;
    constructor();
    /**
     * @private
     */
    bindFunctions(): void;
    /**
     * This function is fired every time the window's bounds change. It saves the window's position.
     * @private
     */
    onWindowRestored(): void;
    /**
     * @private
     */
    onWindowMaximized(): void;
    /**
     * @private
     */
    onWindowBlurred(): void;
    /**
     * @private
     */
    onWindowFocused(): void;
    /**
     * @private
     */
    onMinimizedRestored(): void;
    /**
     * @private
     */
    onWindowMinimized(): void;
    /**
     * Returns a list of the groups this window is in, if any.
     * @private
     */
    getWindowGroups(): GroupData[];
    /**
     * Handler for group updates from the window service.  Stores the groups that this window is in,
     * if any.
     * @private
     * @param err the error, if any
     * @param res the received updated group data
     */
    private groupUpdateHandler;
    /**
     * Closes window. Defaults are to remove the window from the workspace if the user presses the X button, but not if the window is closed via an app-level request (e.g., switching workspaces, so all windows need to close).
     * @param {object} params
     * @param {boolean} params.removeFromWorkspace Whether to remove the window from the workspace.
     * @param {boolean} params.closeWindow Whether to close the window. On shutdown this method is called, but the Window Service actually closes the window.
     * @param {boolean} params.userInitiated Whether the user clicked the X, or if the system asked the window to close.
     * @param {boolean} params.ignoreParent Whether or not to update the parent (stack) window when closing.
     * @param {function} cb The callback to be invoked after the method completes successfully.
     * @example
     * //Close window and remove from workspace (e.g., user closes the window).
     * FSBL.Clients.WindowClient.close({ removeFromWorkspace: true, closeWindow: true });
     * //Close window and keep in workspace (e.g., application requests that all windows close themselves).
     * FSBL.Clients.WindowClient.close({ removeFromWorkspace: false, closeWindow: false });
     */
    close(params: {
        removeFromWorkspace: boolean;
        closeWindow: boolean;
        ignoreParent?: boolean;
        userInitiated?: boolean;
    }, cb?: StandardErrorCallback<void>): StandardPromise<void>;
    /**
     * Retrieves the window's title.
     * @returns {String} title
     * @example
     * var windowTitle = FSBL.Clients.WindowClient.getWindowTitle();
     */
    getWindowTitle(): string | null;
    /**
     * This function retrieves the dimensions of the monitor that the window is on. It's currently used in the {@link launcherClient}.
     * @param {function} callback
     * @private
     */
    retrieveMonitorDimensions(cb: (monitorInfo: MonitorCoordinates) => void): Promise<void>;
    /**
     * Listens for changes in the hash and persists the change to the url property, and then saves it.
     * @private
     */
    listenForHashChanges(): void;
    /**
     * Gets the options from the window on startup and caches them on the object.
     * @private
     * @param {function} callback
     */
    getInitialOptions(cb?: () => void): Promise<void>;
    /**
     * Gets the bounds for the window on startup and saves them to the workspace.
     * @private
     * @param {function} callback
     */
    cacheInitialBounds(): Promise<void>;
    /**
     * Returns windowBounds as of the last save.
     * @returns {object}
     * @private
     */
    getWindowBounds(): Bounds;
    /**
     *
     * Saves the window's state. Rarely called manually, as it's called every time your window moves.
     * @param {Object} bounds optional param.
     * @param {boolean} setActiveWorkspaceDirty
     * @example <caption>The code below is the bulk of our listener for the <code>bounds-changed</code> event from the window. Every time the <code>bounds-changed</code> event is fired (when the window is resized or moved), we save the window's state. The first few lines just prevent the window from being dropped behind the toolbar.</caption>
     *finWindow.addEventListener('disabled-frame-bounds-changed', function (bounds) {
     * 	if (bounds.top < 45) {
     *		finWindow.moveTo(bounds.left, 45);
     *		return;
     *	}
     *	self.saveWindowBounds(bounds);
     * @private
     *});
     */
    saveWindowBounds(bounds: WindowBounds, setActiveWorkspaceDirty: boolean): void;
    /**
     * Maximizes the window taking into account any claimed space on the monitor.
     * @param {function} cb Optional callback to be invoked after the method completes successfully.
     * @example
     * FSBL.Clients.WindowClient.maximize();
     */
    maximize(cb?: StandardErrorCallback<void>): StandardPromise<void>;
    /**
     * Minimizes window.
     * @param {function} cb Optional callback to be invoked after the method completes successfully.
     * @example
     * FSBL.Clients.WindowClient.minimize();
     */
    minimize(cb?: StandardErrorCallback<void>): StandardPromise<void>;
    /**
     * Brings the window to the top of all other windows.
     * @example
     * FSBL.Clients.WindowClient.bringWindowToFront();
     */
    bringToFront(cb?: StandardErrorCallback<void>): StandardPromise<void>;
    /**
     * Brings the window to the top of all other windows
     *
     * This is a non-promisifed version for backward compatibility. Please use WindowClient.bringToFront()
     *
     * @deprecated
     */
    bringWindowToFront(cb?: StandardErrorCallback<void>): void;
    /**
     * Sets whether window is always on top. By default, this is false.
     * @param {boolean} alwaysOnTop The new mode for the window's alwaysOnTop option to be set to.
     * @param {function} cb Optional callback to be invoked after the method completes successfully.
     * @example
     * FSBL.Clients.WindowClient.setAlwaysOnTop(true);
     */
    setAlwaysOnTop(alwaysOnTop: boolean, cb?: StandardErrorCallback<void>): StandardPromise<void>;
    /**
     * Restores window from a maximized or minimized state.
     * @param {function} cb Optional callback to be invoked after the method completes successfully.
     * @example
     * FSBL.Clients.WindowClient.restore();
     */
    restore(cb?: StandardErrorCallback<void>): StandardPromise<void>;
    /**
     * @private
     */
    cacheBounds(): Promise<void>;
    /**
     * This function injects the header bar into all windows without frames that request it. This should only be used if you've decided not to use the provided <code>WindowClient.start()</code> method.
     *
     * **NOTE:** If you are using the Finsemble window title bar component, you do not need to call this function.
     * @private
     */
    injectDOM(headerHeight: number): void;
    /**
     * Given a field, this function retrieves app state. If no params are given, the full state is returned.
     * @param {object} params
     * @param {string} params.field Field to retrieve.
     * @param {Array.<string>} params.fields Fields to retrieve.
     * @param {string} params.windowName Window whose component state you are retrieving. If null, the default is to the calling window.
     * @param {function} cb The callback to be invoked after the method completes successfully.
     * @example <caption>The example below shows how we retrieve data to restore the layout in our charts.</caption>
     * FSBL.Clients.WindowClient.getComponentState({
     *	 field: 'myChartLayout',
     * }, function (err, state) {
     * 	importLayout(state);
     * });
     *
     * FSBL.Clients.WindowClient.getComponentState({
     * 		fields: ['myChartLayout', 'chartType'],
     * }, function (err, state) {
     * 	var chartType = state['chartType'];
     * 	var myChartLayout = state['myChartLayout'];
     * });
     * */
    getComponentState<T = any>(params: {
        field?: string;
        fields?: string[];
        windowName?: string;
    }, cb?: StandardErrorCallback<T>): StandardPromise<T>;
    /**
     * Given a field, this function sets and persists app state.
     * @param {object} params Object of data to be saved
     * @param {string} params.field The key name of the field to be saved. Required if not using `fields`.
     * @param {Array.<object>} params.fields An array of objects with `field` and `value` keys to be saved.
     * @param {string} params.windowName Name of the component whose state you are setting. Defaults to the calling window.
     * @param {any} params.value Value of the data being saved. Required if not using `fields`.
     * @param {function} cb The callback to be invoked after the method completes successfully.
     * @example <caption>The example below shows how we save our chart layout when it changes.</caption>
     * var s = stx.exportLayout(true);
     * //saving layout'
     * FSBL.Clients.WindowClient.setComponentState({ field: 'myChartLayout', value: s });
     * FSBL.Clients.WindowClient.setComponentState({ fields: [{field:'myChartLayout', value: s }, {field:'chartType', value: 'mountain'}]);
     * */
    setComponentState<T = any>(params: {
        field?: string;
        fields?: {
            field: string;
            value: T;
        }[];
        value?: T;
        windowName?: string;
    }, cb?: StandardErrorCallback<void>): StandardPromise<void>;
    /**
     * Given a field, this function removes it from app state.
     * @param {object} params Object of data to be removed
     * @param {string} params.field The key name of the field to be saved. Required if not using `fields`.
     * @param {Array.<object>} params.fields An array of objects with `field` keys to be removed.
     * @param {string} params.windowName The name of the window to remove component state from
     * @param {function} cb The callback to be invoked after the method completes successfully.
     * @example <caption>The example below shows how we would remove our chart layout when it no longer needed.</caption>
     * // remove unused state value
     * FSBL.Clients.WindowClient.removeComponentState({ field: 'myChartLayout'});
     * FSBL.Clients.WindowClient.removeComponentState({ fields: [{field:'myChartLayout'}, {field:'chartType'}]);
     * */
    removeComponentState(params: {
        field?: string;
        fields?: {
            field: string;
        }[];
        windowName?: string;
    }, cb?: StandardErrorCallback<void>): StandardPromise<void>;
    /**
     * Gets the window name of current window or the parent, if tabbed. The code that manages window movement will not see a child window if it's part of a stacked window. This function will return the window name that the Window Service cares about for window movement.
     * @deprecated
     */
    getWindowNameForDocking(): any;
    /**
     * Forms a group with any window that is touching the border of this window.
     */
    formGroup(): void;
    /**
     * Prevents the browser's default behavior of loading files/images if they're dropped anywhere in the window.
     * If a component has a drop area that _doesn't_ preventDefault, the image/file will still be loaded.
     * This only prevents bad behavior from happening when the user drops an image/file on part of the window that _isn't_ listening for drag/drop events (usually by accident).
     * @private
     */
    preventUnintendedDropEvents(): void;
    /**
     * If the user presses windows key + left or right it causes all kinds of abhorrent behavior. This function captures the hotkeys and essentially prevents the behavior.
     * @private
     */
    rejectWindowsKeyResizes(): void;
    /**
     * Modifies the built in page reload to also reload any views along with the default behavior.
     */
    modifyReload(): void;
    /**
     * Adds listeners to handle hash changes and finWindow listeners.
     *
     * These listeners are auto-cleaning when a window closes, so there is no need to manually close
     * them during destruction.
     * @private
     */
    addListeners(): void;
    /**
     * Sends a command to the header. Commands affect the header state,
     * so that the UI reflects what is going on in the component window.
     * @param {string} command The state object to set
     * @param {object} state The new state (merged with existing)
     * @private
     */
    updateHeaderState(command: string, state: any): void;
    /**
     * Establishes a command channel with the <a href="tutorial-UIComponents.html#window-title-bar-aka-the-fsblheader">Finsemble window title bar component</a>. The Window Client can
     * update the title bar's state via this channel.
     * @param {function} commandChannel A function callback that receives commands.
     * @private
     */
    headerCommandChannel(commandChannel: (arg0: any, arg1: any) => void): void;
    /**
     * Ejects the window from the docking group
     * @deprecated This code will be moved to finsemble-ui
     */
    ejectFromGroup(): void;
    /**
     * Deprecated. Please simply set the application's `document.title` element to change the title that appears
     * in the windowTitleBar. Or, set `components["Window Manager"].title` in the app's manifest.
     *
     * Old documentation:
     * This function sets the window's title in the windowTitleBar component, and in the DOM's title element.
     * This is useful to set the title dynamically based on state information: you can keep the window's title in sync with a piece of data (e.g., a Symbol).
     * This title will not persist between sessions automatically; use setComponentState/getComponentState to persist the title.
     * @param {String} title Window title.
     * @example <caption>The code shows how you would change your window title.</caption>
     *  FSBL.Clients.WindowClient.setWindowTitle("My Component's New Title");
     * @deprecated
     */
    setWindowTitle(title: string): void;
    /**
     * @private
     */
    setWindowTitlePrivate(title: string): void;
    /**
     * Retrieves data that was set with <a href="LauncherClient.html#spawn">LauncherClient.spawn</a>.
     * @return {object} The data provided from the component config when spawned.
     */
    getSpawnData(): any;
    /**
     * Returns a reference to the current window for the component.
     * @returns {finWindow}
     */
    getCurrentWindow(): FEAWindow;
    /**
     * For the DOM element that has been passed in, this function returns a bounding box that is relative
     * to the virtual monitor space. That is, it returns the position of the DOM element on the desktop.
     * @param {HTMLElement|string} element A selector or HTMLElement
     * @private
     */
    getDesktopBoundingBox(element: string | Element): Promise<{
        top: number;
        left: number;
        width: number;
        height: number;
        right: number;
        bottom: number;
    }>;
    /**
     * @private
     * @deprecated This code will be moved into finsemble-ui
     */
    isPointInBox(point: {
        x: number;
        y: number;
    }, box: {
        top: number;
        left: number;
        bottom?: number;
        right?: number;
        width: number;
        height: number;
    }): boolean;
    /**
     * Returns (via callback) true if the mouse is currently located (hovering) over the requested element.
     * @param {HTMLElement|string} element The element, or a selector, to check
     * @param {function} cb A function that returns a boolean
     * @private
     */
    isMouseOverDOMElement(element: Element, cb?: (result: boolean) => void): Promise<boolean>;
    /**
     * Returns the window identifier for the current component.
     * @returns {WindowIdentifier}
     */
    getWindowIdentifier(): WindowIdentifier;
    /**
     * Highlights the window as active by creating a border around the window.
     *
     * @param {boolean} active  Set to false to turn off activity
     * @private
     * @deprecated
     */
    setActive(active: boolean): void;
    /**
     * Returns the object defining bounds for the current window including the position of the left and right edges measured in pixels from the left edge of the monitor, the top and bottom edges measured in pixels from the top edge, and the width and height of the component in pixels.
     * Please note that this method differs from the right and bottom coordinates passed to LauncherClient.spawn(); those are measured from the right and bottom edges of the screen.
     * @param {StandardCallback} cb The callback to be invoked after the method completes successfully.
     */
    getBounds(cb: StandardErrorCallback<Bounds>): StandardPromise<Bounds>;
    /**
     * Defines areas of the window that will be displayed and clickable. All other areas of the window will be transparent.
     * Can be used to create click-through areas of a window.
     *
     * @param params Optional. Takes an array of rectangle Objects for the areas of the window that will be displayed and clickable.
     * Passing in an empty array or omitting this parameter will cause the full area of the window to be displayed and clickable.
     * A rectangle is defined as: {
     * 	x: x coordinate for the origin of the rectangle (integer)
     *  y: x coordinate for the origin of the rectangle (integer)
     *  width: width of the rectangle (integer)
     *  height: height of the rectangle (integer)
     * }
     * @param callback: Function = Function.prototype
     */
    setShape(params?: Array<{
        x: Number;
        y: Number;
        width: Number;
        height: Number;
    } | null>, callback?: Function): void;
    /**
     * This is used by the Finsemble window title bar when a tab is dragged for tiling or tabbing.
     * @param {*} params - <code>params.windowIdentifier</code> is required.
     * @param {WindowIdentifier} params.windowIdentifier The Finsemble identifier for the target window.
     * @param {*} cb The callback to be invoked after the method completes successfully.
     * @deprecated This code will be moved into finsemble-ui
     */
    startTilingOrTabbing(params: {
        windowIdentifier: WindowIdentifier;
    }, cb?: () => void): void;
    /**
     * Begin programmatically moving the window; the first parameter is a mouse event. Until `stopMovingWindow` is invoked, the window will follow the user's mouse. This should be invoked inside of a `mouseDown` event handler.
     */
    startMovingWindow(event: MouseEvent): void;
    /**
     * Stops moving a window that was sent in motion via `startMovingWindow`.
     */
    stopMovingWindow(): void;
    /**
     * This is used to cancel a tabbing or tiling operation.
     *
     * @param {object} params
     * @param {WindowIdentifier} params.windowIdentifier The Finsemble identifier for the window.
     * @param {Function} cb - The callback to be invoked after the method completes successfully.
     * @deprecated This code will be moved into finsemble-ui
     */
    cancelTilingOrTabbing(params: {
        windowIdentifier?: WindowIdentifier;
    }, cb?: () => void): void;
    /**
     * This is used to let Finsemble know which window is being dragged. <code>params.windowIdentifier</code> must be the identifier of the tab being dragged. This is only used if the identifier is unknown when <code>startTilingOrTabbing</code> is called.
     * @param {*} params - The <code>windowIdentifier</code> is required.
     * @param {WindowIdentifier} params.windowIdentifier The Finsemble identifier for the target window.
     * @param {*} cb - The callback to be invoked after the method completes successfully.
     * @deprecated This code will be moved into finsemble-ui
     */
    sendIdentifierForTilingOrTabbing(params: {
        windowIdentifier: WindowIdentifier;
    }, cb?: () => void): void;
    /**
     * This function is used by the Finsemble window title bar to end tiling or tabbing.
     * @param {*} params
     * @param {object} params.mousePosition Where the pointer is on the screen
     * @param {number} params.mousePosition.x X position of the pointer
     * @param {number} params.mousePosition.y Y position of the pointer
     * @param {boolean} params.allowDropOnSelf Determines whether a tab can be dropped on the window where the drag originated.
     * @param {*} cb - The callback to be invoked after the method completes successfully.
     * @deprecated This code will be moved into finsemble-ui
     */
    stopTilingOrTabbing(params: {
        mousePosition?: {
            x: number;
            y: number;
        };
        action?: string;
        allowDropOnSelf?: boolean;
    }, cb?: () => void): void;
    /**
     * Gets the stackedWindow (if this window is a child of a stacked window).
     *
     * If the calling window is not part of a stacked window, the stacked window identifier will be returned null -- unless params.create is true. In this case, a stacked window will be created and the calling window will be set as the first child
     *
     * (Typically used by Tabbing Presentation component to manage tabs.)
     *
     * @param {object=} params
     * @param {array=} params.create if true and StackedWindow isn't defined, then it will be created
     * @param {array=} params.windowIdentifiers if creating, then can optionally specify an array of other windowIdentifiers to add to stack on creation (in addition to this window).
     * @param {function} cb cb(err, stackedWindowIdentifier)
     * @private
     *
     * Typically used by Tabbing Presentation component.
     * @deprecated Move this code into UI library (windowTitleBarStore)
     */
    getStackedWindow(params?: getStackedWindowParams | StandardCallback, cb?: StandardCallback): void;
    /**
     * @private
     */
    getMonitorInfo(params?: {
        monitor?: MonitorCommand;
        windowIdentifier?: WindowIdentifier;
    }, cb?: StandardErrorCallback<MonitorInfoDetail>): StandardPromise<MonitorInfoDetail>;
    /**
     * Moves the window so that it's centered above the user's mouse.
     */
    showAtMousePosition(): void;
    /**
     * Automatically resizes the height of the window to fit the full DOM of the current window.
     * @param {object} params.padding
     * @param {number} params.padding.height How much padding around the DOM to add to the height of the window.
     * @param {number} params.padding.width How much padding around the DOM to add to the width of the window.
     * @param {number} params.maxHeight Maximum height to make the window.
     * @param {number} params.maxWidth Maximum width to make the window.
     * @param {function} cb Optional callback to be invoked after the method completes successfully.
     */
    fitToDOM(params?: {
        padding?: {
            height: number;
            width: number;
        };
        maxHeight?: number;
        maxWidth?: number;
    } | null, cb?: () => void): Promise<void>;
    /**
     * Kicks off all of the necessary methods for the app. It
     * 1. Sets up listeners to handle close and move requests from the application.
     * 2. Adds a listener that saves the window's state every time it's moved or resized.
     * @param {function} callback
     * See the [windowTitleBar tutorial](tutorial-UIComponents.html#window-title-bar) for more information.
     * @private
     */
    start(cb?: () => void): Promise<void>;
}
declare const windowClient: WindowClient;
export default windowClient;
//# sourceMappingURL=windowClient.d.ts.map