import { FinsembleWindow } from "../common/FinsembleWindow";
import { SpawnParams } from "../services/window/types";
import { StandardError, StandardErrorCallback, StandardPromise } from "../types";
import { WindowIdentifier, WindowDescriptor, WindowLocator, ShowWindowParams } from "../services/window/types";
import { MonitorCommand, MonitorInfoDetail } from "../common/Monitors";
export declare type ComponentDescriptor = Record<string, any>;
export declare type ComponentList = Record<string, ComponentDescriptor>;
export declare type MonitorInfo = any;
export declare type SpawnResponse = {
    windowDescriptor: WindowDescriptor;
    windowIdentifier: WindowIdentifier;
    finWindow: FinsembleWindow;
    launchGroupWindows?: string[];
};
/**
 * Get a list of registered components (those that were entered into <i>components.json</i>).
 *
 * @param cb Callback returns an object map of components. Each component object
 * contains the default config for that component.
 */
export declare const getComponentList: (cb?: StandardErrorCallback<ComponentList> | undefined) => StandardPromise<ComponentList>;
/**
 * Get the component config (from <i>components.json</i>) for a specific component.
 *
 * @param componentType The type of the component.
 * @param cb Callback returns the default config (windowDescriptor) for the requested componentType.
 */
export declare const getComponentDefaultConfig: (componentType: string, cb?: StandardErrorCallback<ComponentDescriptor> | undefined) => StandardPromise<ComponentDescriptor>;
/**
 * Gets monitorInfo (dimensions and position) for all monitors. Returns an array of monitorInfo objects. See <a href="tutorial-LauncherClient.html#getMonitorInfo">LauncherClient#getMonitorInfo</a> for the format of a monitorInfo object.
 *
 * @param cb Returns an array of monitorInfo objects.
 */
export declare const getMonitorInfoAll: (cb?: StandardErrorCallback<MonitorInfoDetail[]> | undefined) => StandardPromise<MonitorInfoDetail[]>;
/**
 * Gets monitor information for a given windowIdentifier or for a specific monitor.
 * If neither the identifier or monitor are provided then the monitorInfo for the current window is returned.
 *
 *
 * The information returned contains:
 *
 * **monitorRect** - The full dimensions for the monitor. <br>
 * **availableRect** - The dimensions for the available space on the monitor (less the Windows task bar). <br>
 * **position** - The position of the monitor, numerically from zero to X. Primary monitor is zero. <br>
 * **whichMonitor** - Contains the string "primary" if it is the primary monitor. <br>
 *
 * The dimensions are supplemented with the following additional members:
 *
 * **width** - The width as calculated (right - left). <br>
 * **height** - The height as calculated (bottom - top). <br>
 *
 * @param params
 * @param params.windowIdentifier The windowIdentifier to get the monitorInfo. If undefined, then the current window.
 * @param params.monitor If passed then a specific monitor is identified. Valid values include:
 *
 * <b>"mine"</b> - Place the window on the same monitor as the calling window.
 *
 * Integer value from 0-n (0 being the primary monitor).
 *
 * <b>"primary"</b> indicates the user's primary monitor.
 *
 * <b>"all"</b> - Put a copy of the component on all monitors.
 * @param cb Returns a monitorInfo object containing the monitorRect and availableRect.
 *
 * @returns A promise that resolves to a monitorInfo
 */
export declare const getMonitorInfo: (params?: {
    monitor?: MonitorCommand;
    windowIdentifier?: WindowIdentifier;
}, cb?: StandardErrorCallback<MonitorInfoDetail> | undefined) => StandardPromise<MonitorInfoDetail>;
/**
 * Displays a window and relocates/resizes it according to the values contained in parameters. If the specified window is in a group or tabbed, it will be unsnapped/ungrouped/untabbed from the other windows.
 * If invoked on a tabbed window or a window in a group, the window will be removed from the tab/group.
 *
 * Caution: A window can inherit parameters only once, at the time when it’s spawned. When the component already exists, changing parameters other than positioning arguments (monitor, relativeWindow, top, bottom, left, right, width, height) has no effect.
 *
 * ```JavaScript
 * FSBL.Clients.LauncherClient.showWindow({windowName: "Welcome Component-86-3416-Finsemble", componentType: "Welcome Component"}, {spawnIfNotFound: true}, (err, data)=> {});
 * ```
 * @param windowIdentifier A windowIdentifier. This is an object containing windowName and componentType. If windowName is not given, Finsemble will try to find it by componentType.
 * @param params Configuration settings from the <i><a href="tutorial-ConfigReference.html#finsemble-appd---manifest-window">finsemble.appd[].manifest.window</a></i> section of the application manifest may be used as parameters to this function, except for the `options` element.
 * These are the same as <a href="tutorial-LauncherClient.html#spawn">LauncherClient.spawn()</a> with the following exceptions:
 * <ul>
 * 	<li><b>monitor</b> - Same as spawn() except that null or undefined means don't move the window to a different monitor.</li>
 *  <li><b>left</b> - Same as spawn() except that null or undefined means don't move the window from current horizontal location.</li>
 *  <li><b>top</b> - Same as spawn() except that null or undefined means don't move the window from current vertical location.</li>
 *  <li><b>slave</b> - Cannot be set for an existing window. Will only go into effect if the window is spawned. (In other words, only use this in conjunction with spawnIfNotFound).</li>
 *  <li><b>spawnIfNotFound</b> - If true, then spawns a new window if the requested one cannot be found. Note: only works if the windowIdentifier contains a componentType.</li>
 *  <li><b>autoFocus</b> - Whether or not the window should be focused when shown.</li>
 * </ul>
 * @param cb Callback to be invoked after the function is completed regardless if the call fails or succeeds.
 * Callback contains two arguments in the following order.
 * <ol>
 * 	<li><b>error</b>: an object containing details related to the reason the call failed and where the exception occurred. This object will be null if the call has succeeded.</li>
 * 	<li><b>data</b>: an object with the following information:
 * 		<ul>
 * 			<li><b>windowIdentifier</b> - The <a href="tutorial-ComponentTypesAndWindowNames.html">WindowIdentifier</a> for the new window.</li>
 * 			<li><b>windowDescriptor</b> - The <a href="tutorial-ComponentTypesAndWindowNames.html">WindowDescriptor</a> of the new window.</li>
 * 			<li><b>finWindow</b> - A <code>finWindow</code> object referencing the new window.</li>
 * 		</ul>
 * 	</li>
 * </ol>
 */
export declare const showWindow: (windowLocator: WindowLocator, params: ShowWindowParams, cb?: StandardErrorCallback<SpawnResponse> | undefined) => StandardPromise<SpawnResponse>;
/**
 * A convenient method for dealing with a common use-case, which is toggling the appearance and disappearance of a child window when a button is pressed, aka drop down menus.
 * Call this method from the click handler for your element. Your child window will need to close itself on blur events.
 * Caution: A window can inherit parameters only once, at the time when it’s spawned. When the component already exists, changing parameters other than positioning arguments (monitor, relativeWindow, top, bottom, left, right, width, height) has no effect.
 * @param element The DOM element, or selector, clicked by the end user.
 * @param windowIdentifier Identifies the child window
 * @param params Parameters to be passed to <a href="tutorial-LauncherClient.html#showWindow">LauncherClient.showWindow()</a> if the child window is allowed to open
 */
export declare const toggleWindowOnClick: (element: HTMLElement, windowLocator: WindowLocator, params: ShowWindowParams) => void;
/**
 * Asks the Launcher service to spawn a new component. Any parameter below can also be specified in <i>public/config/components.json</i>, which will
 * then operate as the default for that value.
 *
 * The launcher parameters mimic CSS window positioning.
 * For instance, to set a full screen window use `{left: 0, top: 0, right: 0, bottom: 0}`.
 * This is functionally equivalent to: `{left: 0, top: 0, width: "100%", height: "100%"}`.
 *
 * You can also spawn more than one component at a time by using a single action, such as clicking a button on a menu.
 * See https://github.com/ChartIQ/finsemble-seed/tree/recipes/SpawnComponentGroup for an example of spawning a component group.
 *
 * ```JavaScript
 * FSBL.Clients.LauncherClient.spawn("Welcome Component", {left: 0, top: 0, position: "relative"}, (err, data)=> {});
 * ```
 * @param component The application or component to spawn.
 * @param params Configuration settings from the <i><a href="tutorial-ConfigReference.html#finsemble-appd---manifest-window">finsemble.appd[].manifest.window</a></i> section of the application manifest may be used as parameters to this function, except for the `options` element.
 * @param cb Function invoked after the window is created
 */
export declare const spawn: (component: string, params: SpawnParams, cb?: StandardErrorCallback<SpawnResponse> | undefined) => Promise<{
    error?: StandardError;
    response?: SpawnResponse | undefined;
}>;
/**
 * Returns a windowIdentifier for the current window.
 *
 * @param cb Callback function returns windowIdentifier for this window (optional or use the returned Promise)
 * @returns A promise that resolves to a windowIdentifier
 */
export declare const getMyWindowIdentifier: (cb?: ((windowIdentifier: WindowIdentifier) => void) | undefined) => Promise<WindowIdentifier>;
/**
 * Gets the windowDescriptor for all open windows.
 *
 * <b>Note:</b> This returns descriptors even if the window is not part of the workspace.
 *
 * ```JavaScript
 * FSBL.Clients.LauncherClient.getActiveDescriptors(function (error, response) {
 * 	if (error) {
 *		Logger.system.error("Error getting active descriptors: ",  + JSON.stringify(error));
 *	} else {
 *		const activeDescriptors = response;
 *		//{
 *		//	...
 *		//	Toolbar-1-Finsemble: {...},
 *		//	Welcome-Component-80-6453-Finsemble: {...},
 *		//	...
 *		//}
 * 	}
 * });
 * ```
 * @param cb Callback returns an object containing windowDescriptors keyed by name.
 */
export declare const getActiveDescriptors: (cb?: StandardErrorCallback<Record<string, WindowDescriptor>> | undefined) => StandardPromise<Record<string, WindowDescriptor>>;
/**
 * @private Adds a custom component.
 * @ignore
 */
export declare const addUserDefinedComponent: (params: {
    name: string;
    url: string;
}, cb?: StandardErrorCallback<void> | undefined) => StandardPromise<void>;
/**
 * @private Adds a custom component.
 * @ignore
 */
export declare const removeUserDefinedComponent: (params: {
    name: string;
    url?: string;
}, cb?: StandardErrorCallback<void> | undefined) => StandardPromise<void>;
/**
 * @ignore
 */
export declare const LauncherClient: {
    /**
     * For backward compatibility
     * @private
     * @deprecated
     */
    initialize: () => void;
    /**
     * For backward compatibility
     * @private
     * @deprecated
     */
    onReady: (cb?: any) => void;
    addToGroups: (params: {
        windowIdentifier?: WindowIdentifier | undefined;
        groupNames?: string[] | undefined;
    }, cb: (err?: StandardError) => void) => Promise<{
        err: StandardError;
    }>;
    getGroupsForWindow: (params: {
        windowIdentifier: WindowIdentifier;
    } | null, cb?: Function) => Promise<unknown>;
    removeWindowsFromGroup: (params: {
        windowList?: string[] | WindowIdentifier[] | undefined;
        groupName?: string | undefined;
    }, cb?: Function) => Promise<unknown>;
    addWindowsToGroup: (params: {
        windowList?: string[] | WindowIdentifier[] | undefined;
        groupName?: string | undefined;
    }, cb?: Function) => Promise<unknown>;
    createWindowGroup: (params: {
        windowList?: string[] | WindowIdentifier[] | undefined;
        groupName?: string | undefined;
    }, cb?: Function) => Promise<unknown>;
    minimizeWindows: (params: {
        windowList?: string[] | WindowIdentifier[] | undefined;
        groupName?: string | undefined;
        componentType?: string | undefined;
    }, cb?: Function | undefined) => Promise<void>;
    hyperFocus: (params: {
        windowList?: string[] | WindowIdentifier[] | undefined;
        groupName?: string | undefined;
        componentType?: string | undefined;
    }, cb?: (() => void) | undefined) => Promise<void>;
    bringWindowsToFront: (params?: {
        windowList?: string[] | WindowIdentifier[] | undefined;
        groupName?: string | undefined;
        componentType?: string | undefined;
    }, cb?: Function) => Promise<void>;
    getComponentsThatCanReceiveDataTypes: (params: {
        dataTypes: string[];
    }, cb?: Function) => Promise<unknown>;
    removeUserDefinedComponent: (params: {
        name: string;
        url?: string;
    }, cb?: StandardErrorCallback<void> | undefined) => StandardPromise<void>;
    addUserDefinedComponent: (params: {
        name: string;
        url: string;
    }, cb?: StandardErrorCallback<void> | undefined) => StandardPromise<void>;
    getPendingWindows: () => StandardPromise<string[]>;
    getActiveAndPendingWindowNames: (cb?: Function) => Promise<{
        err: any;
        data: any;
    }>;
    getActiveDescriptors: (cb?: StandardErrorCallback<Record<string, WindowDescriptor>> | undefined) => StandardPromise<Record<string, WindowDescriptor>>;
    getMyWindowIdentifier: (cb?: ((windowIdentifier: WindowIdentifier) => void) | undefined) => Promise<WindowIdentifier>;
    getMonitor: (windowIdentifier: WindowIdentifier, cb?: StandardErrorCallback<any> | undefined) => StandardPromise<any>;
    spawn: (component: string, params: SpawnParams, cb?: StandardErrorCallback<SpawnResponse> | undefined) => Promise<{
        error?: StandardError;
        response?: SpawnResponse | undefined;
    }>;
    toggleWindowOnClick: (element: HTMLElement, windowLocator: WindowLocator, params: ShowWindowParams) => void;
    showWindow: (windowLocator: WindowLocator, params: ShowWindowParams, cb?: StandardErrorCallback<SpawnResponse> | undefined) => StandardPromise<SpawnResponse>;
    unRegisterComponent: (params: {
        componentType: string;
    }, cb?: StandardErrorCallback<string> | undefined) => StandardPromise<string>;
    registerComponent: (params: {
        componentType: string;
        manifest: ComponentDescriptor;
    }, cb: StandardErrorCallback<string>) => StandardPromise<string>;
    getMonitorInfo: (params?: {
        monitor?: MonitorCommand;
        windowIdentifier?: WindowIdentifier;
    }, cb?: StandardErrorCallback<MonitorInfoDetail> | undefined) => StandardPromise<MonitorInfoDetail>;
    getMonitorInfoAll: (cb?: StandardErrorCallback<MonitorInfoDetail[]> | undefined) => StandardPromise<MonitorInfoDetail[]>;
    getComponentDefaultConfig: (componentType: string, cb?: StandardErrorCallback<ComponentDescriptor> | undefined) => StandardPromise<ComponentDescriptor>;
    getComponentList: (cb?: StandardErrorCallback<ComponentList> | undefined) => StandardPromise<ComponentList>;
};
/**
 * @ignore
 */
export default LauncherClient;
//# sourceMappingURL=launcherClient.d.ts.map