import PrivateEventManager from "../../../common/events/PrivateEventManager"; import * as constants from "../../../common/constants"; import { StandardError, StandardErrorCallback, StandardPromise } from "../../../types"; import { WrapState, WindowEventName, WindowBounds, WindowIdentifier } from "../types"; import { FinsembleWindowData } from "../types"; export declare type ComponentMutateParams = { /** Field to save. */ field?: string; /** Fields to save. */ fields?: { field: string; }[]; /** Key to store the data under. */ key?: string; /** Whether the data is componentState or windowData. Defaults to "windowData" */ stateVar?: "componentState" | "windowData"; /** Topic that the data is stored under. */ topic?: string; /** Value to save. */ value?: any; }; declare type Wrap = Record; export declare abstract class BaseWindow { Group: any; componentState: any; wrapState: WrapState; name: string; windowName: string; windowOptions: any; bounds: object; wrapStateChangeSubscription: any; parentWindow: any; windowKey: string; componentKey: string; TITLE_CHANGED_CHANNEL: string; TITLE_CHANGED_SUBSCRIPTION: any; windowState: number; identifier?: WindowIdentifier; type: string | null; windowType?: string | null; setWindowType?: string; types: any; parentSubscribeID: any; eventManager: PrivateEventManager; eventlistenerHandlerMap: object; guid: string; dockedPosition?: number; enableWindowsAeroSnap: boolean; finishedMove: boolean; oldState: any; limits: any; static additionalWorkspaceFields: Array; private static cache; cachedBounds: WindowBounds; constructor(params: { [x: string]: any; setWindowType: string | number; windowType: string; windowName: string; }); abstract removeListeners(): void; static WINDOWSTATE: typeof constants.WINDOWSTATE; windowServiceChannelName(channelTopic: string): string; eventChannelName(channelTopic: string): string; _startMove(changeType?: number): void; _stopMove(): void; doConstruction(params: { [x: string]: any; setWindowType: string | number; windowType?: string; windowName: string; }): any; static registerType(name: string, type: any): void; /** * This is used to bind all functions only in BaseWindow and not in the child wrappers to the wrappers. Without this binding, the value of "this" in the functions is wrong. * @param {} obj */ static bindFunctions(obj: BaseWindow): void; setupListeners(name: string): void; /** * Event handler which is invoked when the title for a window changes. * * Title change events look like: * title: string - the new title * windowName: string - the name of the window which changed * * @param error the error from the event * @param response the event response */ onTitleChanged(error: any, response: { data: { title: string; windowName: string; source?: string; }; }): Promise; /** * Async wrap. Given a name/windowName, it will query the launcher for information required to wrap the window. Then it will return an object that can be operated on. Also this creates a cache of all wrapped windows for performance. Our clients wrap the same window often and this was causing excessive messaging to the store and degrading performance. * @param {*} params Need only name in most cases. For service and other cases where the window is not part of what the launcher considers active windows, name and uuid are required * @param {*} cb */ static wrap: typeof BaseWindow.getInstance; static getInstanceStandardized(params: any): StandardPromise; static getInstance(params: any, cb?: StandardErrorCallback): Promise<{ wrap: BaseWindow; }>; static _createWrap(params: { retrievedIdentifier?: WindowIdentifier; windowIdentifier: WindowIdentifier; name: string | number; setWindowType: any; }): Promise<{ wrap: BaseWindow; }>; static _windowReady: (windowName: string) => Promise; static _getRemoveWrapChannel(name: string): string; handleWrapRemoveRequest(): void; cleanupRouter(): void; handleWrapStateChange: (error: any, response: { data: { state: any; }; }) => void; onReady(cb?: () => void): Promise; /** * @param {string} methodName method name (e.g. "minimize", "maximize") * @param {object} params * @param {function=} callback * @memberof FinsembleWindow * @private */ queryWindowService(methodName: string, params: any, callback?: Function): void; addEventListener(eventName: WindowEventName, handler: Function): void; removeEventListener(eventName: WindowEventName, handler: Function): void; /** *Register a window with docking. Use this if you don't want to use the full initialization function * * @param {Object} params - can be anything that is passed to docking for window registration. * @param {Function} cb * @memberof FSBLWindow */ registerWithDocking(params: any, cb: { (): void; (err: StandardError, response?: any): void; }): void; /** *Unregister a window with docking * * @memberof FSBLWindow */ unRegisterWithDocking(): void; /** *This is if we want to handle the full register/ready state inside of the window register with docking send the message to launcher saying that component is ready * * @memberof FSBLWindow */ initializeWindow(params: any): void; wrapReady(): void; _minimize(params: { notifyDocking?: boolean; initialLoad?: boolean; invokedByParent?: boolean; windowIdentifier?: WindowIdentifier; }, cb?: Function): void; _maximize(params: { notifyDocking?: boolean; invokedByParent?: boolean; windowIdentifier?: WindowIdentifier; initialLoad?: boolean; }, cb?: Function): void; _restore(params: { checkMaximize?: boolean; checkMinimize?: boolean; invokedByParent?: boolean; windowIdentifier?: WindowIdentifier; }, cb?: StandardErrorCallback<{ shouldContinue: boolean; }>): StandardPromise<{ shouldContinue: boolean; }>; _blur(params: { invokedByParent?: any; windowIdentifier?: any; }, cb?: Function): void; _focus(params: { invokedByParent?: any; windowIdentifier?: any; }, cb?: Function): void; _bringToFront(params: { invokedByParent?: any; windowIdentifier?: any; }, cb?: Function): void; _isShowing(params: { invokedByParent?: any; windowIdentifier?: any; }, cb?: Function): void; disableFrame(cb?: Function): void; _setBounds(params: { bounds?: any; invokedByParent?: any; windowIdentifier?: any; }, cb?: Function): void; _getBounds(params: { invokedByParent?: any; windowIdentifier?: any; }, cb: (err: any, response: any) => void): StandardPromise; _getBoundsFromSystem(params: { invokedByParent?: any; windowIdentifier?: any; }, cb: { (err: any, response: any): void; (arg0: any, arg1: any): void; (arg0: any, arg1: { shouldContinue: boolean; }): void; }): void; _updateOptions(params: { alwaysOnTop?: boolean; dontFireEvents?: boolean; invokedByParent?: any; windowIdentifier?: any; title?: string; showTaskbarIcon?: boolean; taskbarIconGroup?: string; opacity?: number; autoShow?: boolean; }, cb?: Function): void; _hide(params: { invokedByParent?: any; windowIdentifier?: any; }, cb?: Function): void; _show(params: { invokedByParent?: boolean; windowIdentifier?: WindowIdentifier; shouldMaximize?: boolean; shouldRestore?: boolean; saveState?: boolean; switchedMonitors?: boolean; }, cb?: StandardErrorCallback<{ shouldContinue: boolean; }>): StandardPromise<{ shouldContinue: boolean; }>; _showAt(params: { invokedByParent?: any; windowIdentifier?: any; }, cb?: Function): void; /** * Close * @param params * @param params.fromSystem Bool. If true, event bubbled up because of an alt+f4, task manager, etc. Something closed the window that wasn't Finsemble. * @param cb */ _close(params?: { fromSystem?: any; removeFromWorkspace?: any; stackedWindowIdentifier?: any; invokedByParent?: any; ignoreParent?: any; windowIdentifier?: any; noDocking?: any; force?: boolean; }, cb?: StandardErrorCallback<{ shouldContinue: boolean; }>): StandardPromise<{ shouldContinue: boolean; }>; _alwaysOnTop(params: { alwaysOnTop?: boolean; invokedByParent?: any; windowIdentifier?: any; }, cb?: Function): void; /** * Returns the alwaysOnTop state for the window. * @param params This parameter is ignored. * @param cb A callback accepting two arguments: an error object (which is always `null` for this method), and a boolean value representing the alwaysOnTop state. * Disable eslint below because params is undefined, but we don't want to refactor the other calls to expect the 1st param to equal the callback. */ _isAlwaysOnTop(params?: {}, cb?: Function): boolean; _setOpacity(params: { invokedByParent?: any; windowIdentifier?: any; opacity: number; persist?: boolean; }, cb?: Function): void; _saveWindowOptions(params: { invokedByParent?: any; windowIdentifier?: any; }, cb?: Function): void; _getOptions(_params: any, cb?: Function): any; abstract _setResizable(isResizeable: boolean, cb?: Function): void; /** * Invoked to indicate an operation (e.g. dragging out of tab region) has started. This signals the Docking service to start tracking the mouse location and invoking tiling behavior as needed. Typically inherited (base function only). * @param {object} params for future use * * @example * // dragging tab example using tracking and group * BaseWindow.startTabTileMonitoring(); * // if dragging tab is in a group, then remove it given tracking results will decide what to do with the window * BaseWindow.Group.getGroupID(this.identifier, function (err, tileGroupId) { * if (!err) { // if no error then must be in a tile group * self.Group.removeWindow(this.identifier); * } * }); */ startTabTileMonitoring(params: any): void; /** * Invoked by client originating a dragStart that it has has ended. Typically inherited (base function only). * @param {object} params for future use * @param {function=} callback option callback that support overriding default behavior * * BaseWindow.stopTabTileMonitoring(params, function(err, results, defaultTabTileAction) { * // . . . custom code goes here . . . * defaultTabTileAction(results); // now take default action or call your own function instead * }); * */ stopTabTileMonitoring(params: any, callback: (arg0: StandardError, arg1: any, arg2: any) => void): void; /** * Defines default TabTile action for stopTabTileMonitoring. May be overwritten by client -- see example in stopTabTileMonitoring. Typically inherited (base function only). * * @param {any} stopTabTileResults * @memberof BaseWindow * * @private */ defaultTabTileAction(stopTabTileResults: { stoppedLocation: any; tileGroupId: any; dropCoordinates: any; droppedOnWindowIdentifier: any; }): void; mergeBounds(bounds: { top: number; left: number; width: number; height: number; }): void; startMove(params: { windowIdentifier?: any; }): void; stopMove(params: { windowIdentifier?: any; }): void; /** * Given a field, this function retrieves component or window state. If no params are given you get the full state * @param {object} params * @param {string} params.stateVar A string containing "componentState" or "windowState" * @param {string} params.field field * @param {array} params.fields fields * @param {string} params.key The storage key for the window. * @param {function} cb Callback * @private * */ getFSBLState(params: { stateVar?: "componentState" | "windowData"; field?: string; fields?: string[]; key: string; }, cb?: StandardErrorCallback): StandardPromise; /** * Given params, will return the component state. Either the params to search for, or the entire state. * * @param {object} params * @param {string} params.field field * @param {array} params.fields fields * @param {function} cb Callback */ getComponentState(params: { stateVar?: "componentState" | "windowData"; field?: string; fields?: any; key?: string; }, cb?: StandardErrorCallback): StandardPromise; /** * Given params, will return the window state. Either the params to search for, or the entire state. * * @param {object} params * @param {string} params.field field * @param {array} params.fields fields * @param {function} cb Callback */ getWindowState(params: any, cb?: StandardErrorCallback): StandardPromise; /** * Given params, will set the component state. Any fields included will be added to the state * * @param {object} params * @param {string} params.field field * @param {array} params.fields fields * @param {function} cb Callback */ setComponentState(params: { fields?: any; }, cb?: Function): Promise; /** * Removes one or more specified attributes from a component state in storage * for this window. * * In addition to the name of the window, params should include either a `field` * property as a string or a `fields` property as an array of strings. * * @param {object} params * @param {string} [params.field] field * @param {array} [params.fields] fields * @param {function} cb Callback */ removeComponentState(params: ComponentMutateParams, cb?: StandardErrorCallback): void; /** * Given params, will set the window state. Any fields included will be added to the state * * @param {object} params * @param {string} params.field field * @param {array} params.fields fields * @param {function} cb Callback */ setWindowState(params: { fields?: any; }, cb: any): Promise; saveWindowState(state: number): void; static cleanupState(state: any): Promise; saveCompleteWindowState(state: any, cb?: Function): Promise; /** * Given a field, this function sets and persists app state. * @param {object} params * @param {string} [params.field] field * @param {array} [params.fields] fields * @param {function=} cb Callback * */ setFSBLState(params: { fields?: any; key?: any; stateVar?: any; field?: any; value?: any; }, cb: Function): Promise; /** * Removes one or more specified attributes from either component or window state in storage. * * In addition to the name of the window, params should include either a `field` * property as a string or a `fields` property as an array of strings. * * @param {object} params * @param {string} [params.field] field * @param {array} [params.fields] fields * @param {function=} cb Callback * */ removeFSBLState(params: ComponentMutateParams, cb?: StandardErrorCallback): void; /** *Cancels startTabTileMonitoring. Example use is a user "excapes" out of a drag operation. * * @param {object} params for future use * @memberof BaseWindow */ cancelTabTileMonitoring(params: any): void; /** * Return the parent window's wrapper (e.g. StackedWindow). * */ getParent(): any; /** * Sets the parent window (e.g. stackedWindow) and emits "setParent" event to window listeners. * * @param {object} stackedWindowIdentifier identifer of window to set as parent (e.g. stackedWindowIdentifier). * */ setParent(windowIdentifier: { windowName: any; }, cb?: Function): void; /** * Clears the parent reference and emits "clearParent" event to window listeners. Used only internally. * * @private * */ clearParent(): void; setTitle(title: any): void; close(params?: any, cb?: Function): StandardPromise; _animate(params: any, cb: (arg0: string, arg1: { shouldContinue: boolean; }) => void): void; } export {}; //# sourceMappingURL=BaseWindow.d.ts.map