import type OpenFin from '@openfin/core'; import type { SearchProviderInfo } from '../../../search-api/src/shapes'; import { ApplicationUUID } from './application'; export declare enum WindowName { Home = "openfin-home", Dock = "openfin-dock", Storefront = "openfin-storefront", HomeInternal = "openfin-home-internal", BrowserIndicator = "openfin-browser-indicator", BrowserWindow = "internal-generated-window", ClassicWindow = "internal-generated-classic-window", BrowserAddressSearchPrefix = "openfin-browser-menu-address-search-", DockCompanion = "openfin-dock-companion", AICompanionPrefix = "openfin-ai-companion-", AboutPageWindow = "here-about-page", FindInPageViewPrefix = "here-find-in-page-view-", BrowserMenu = "openfin-browser-menu", BrowserSaveMenu = "openfin-browser-save-menu", DockSaveWorkspaceMenu = "openfin-dock3-save-workspace-menu", DropdownMenu = "openfin-enterprise-dropdown-menu", EnterpriseContextMenu = "openfin-enterprise-context-menu", TabSearchMenu = "openfin-browser-tab-search-menu", EnterpriseBookmarkDialogWindow = "openfin-enterprise-bookmark-dialog", ZoomControlsDialog = "here-zoom-controls-dialog", UpdateVersionModal = "here-update-version-modal", ApplyAndPublishModal = "here-apply-and-publish-modal", PublishOnCloseModal = "here-publish-on-close-modal", DesktopSignalsModal = "here-desktop-signals-modal", IntentsResolverModal = "here-intents-resolver-modal", /** Browser-zone Home VPW window (platform child window). */ HomeVpw = "home-vpw", /** Browser-zone Storefront VPW window (platform child window). */ StorefrontVpw = "storefront-vpw", /** Dock3 window (platform child window). */ Dock3 = "dock3" } export interface WindowIdentity { uuid: ApplicationUUID | string; name: WindowName | string; } export interface WindowCreationOptionsExtended extends OpenFin.PlatformWindowCreationOptions { backgroundThrottling?: boolean; } export interface Point { left: number; top: number; } interface Size { height: number; width: number; } /** * Gets the center point of a window given its bounds * * @param bounds OpenFin WindowBounds - left, top, height, width * @returns A {@link OpenFin.Point} representing the center of the monitor */ export declare const getCenterFromBounds: (bounds: OpenFin.WindowBounds) => Point; /** * Gets the center point of a monitor given its bounds * * @param bounds RectangleByEdgePositions - left, top, right, bottom. The bounds of the monitor * @returns A {@link OpenFin.Point} representing the center of the monitor */ export declare const getCenterFromMonitorBounds: (bounds: OpenFin.RectangleByEdgePositions) => Point; /** * Gets the top and left coords of a window given its size and center point * @param center point representing the desired center coords * @param size height and width of the window * @returns coords representing the left, top of window given the center point */ export declare const getBoundsFromCenter: (center: Point, size: Size) => OpenFin.Bounds; /** * Get a wrapped OpenFin window. * * This method can only be used in an OF env. * If used outside of OF, such as in a pre-rendering context, will throw a clear and traceable error. * * @param identity the window identity. * @returns the wrapped OpenFin window identity. */ export declare function getOFWindow(identity: WindowIdentity): OpenFin.Window; /** The OpenFin identity for the process. */ export declare const currentOFIdentity: WindowIdentity; /** Get the current OpenFin window. */ export declare function getCurrentOFWindow(): OpenFin.Window; /** The OpenFin identity for the Home window. */ export declare const homeOFIdentity: { readonly name: WindowName.Home; readonly uuid: ApplicationUUID.Workspace; }; /** The OpenFin identity for the Dock window. */ export declare const dockOFIdentity: { readonly name: WindowName.Dock; readonly uuid: ApplicationUUID.Workspace; }; /** The OpenFin identity for the Notification Center window. */ export declare const notificationCenterOFIdentity: { readonly name: "Notification-Center"; readonly uuid: "notifications-service"; }; /** The OpenFin identity for the Storefront window. */ export declare const storefrontOFIdentity: { readonly name: WindowName.Storefront; readonly uuid: ApplicationUUID.Workspace; }; /** The OpenFin identity for the Provider window. */ export declare const providerOFIdentity: { readonly name: ApplicationUUID.Workspace; readonly uuid: ApplicationUUID.Workspace; }; /** Home VPW window identity under a platform UUID. */ export declare const getHomeVpwOFIdentity: (platformUuid: string) => WindowIdentity; /** Storefront VPW window identity under a platform UUID. */ export declare const getStorefrontVpwOFIdentity: (platformUuid: string) => WindowIdentity; /** Dock3 window identity under a platform UUID. */ export declare const getDock3OFIdentity: (platformUuid: string) => WindowIdentity; /** * Get the Home OpenFin window. */ export declare function getHomeOFWindow(): OpenFin.Window; export declare function getDockOFWindow(): OpenFin.Window; /** * Helper for max and restoring a window. * @param identity the identity of the window to maximize or restore. */ export declare function maxOrRestore(identity: WindowIdentity): Promise; /** * Helper for showing a window. * This method ensures the window is shown, brought to front and focused. * @param identity the identity of the window to show. */ export declare function showAndFocus(identity: WindowIdentity): Promise; /** * Helper for hiding a window. * This method ensures the window is hidden and blurred. * @param identity the identity of the window to hide. */ export declare function hide(identity: WindowIdentity): Promise; /** * Helper for showing / hiding a window. * This method calls showAndFocus / hideAndBlur * @param identity the identity of the window to hide. */ export declare function toggleVisibility(identity: WindowIdentity): Promise; export declare const toggleDock: () => Promise; export declare function isAnimatingSize(): boolean; /** * Resizes a window to width and height saved in the store * if they differ from current window size. */ export declare function restoreWindowSize(): Promise; export declare function setSize(width: number, height: number): Promise; export declare function animateSize(width: number, height: number): Promise; /** * Returns true if the window identity is that of a browser window. * @param identity the window identity * @returns boolean */ export declare const isBrowserWindow: (identity: OpenFin.Identity) => Promise; /** * Force document body size. Called when resizing or on scaling changes. */ export declare function forceBodySize(): void; /** * Gets all currently open browser windows. */ export declare function getBrowserWindows(): Promise; export declare function getModalWindows(): Promise; /** * Returns true if the OpenFin window for the provided identity is running. * */ export declare const isWindowRunning: (identity: WindowIdentity) => Promise; export declare const isApplicationRunning: (uuid: string) => Promise; /** * Check if Storefront window is running. * @returns true if the Storefront window is running. */ export declare const isStorefrontWindowRunning: () => Promise; export declare const isDockWindowRunning: () => Promise; export declare const isHomeWindowRunning: () => Promise; export declare const isNotificationCenterRunning: () => Promise; export declare const isProviderWindowRunning: () => Promise; export declare const showAndFocusStorefront: () => Promise; export declare const showAndFocusDock: () => Promise; export declare const getDisableMultiplePagesOption: (identity: WindowIdentity) => Promise; export declare const getIsLockedOption: (identity: WindowIdentity) => Promise; export declare const getPlatformWindowTitle: (identity: WindowIdentity) => Promise; /** * Prefer a running Home VPW window for the platform; fall back to classic Home. */ export declare const resolvePreferredHomeIdentity: (platformUuid: string) => Promise; /** * Prefer a running Storefront VPW window for the platform; fall back to classic Storefront. */ export declare const resolvePreferredStorefrontIdentity: (platformUuid: string) => Promise; export declare const showPreferredHomeWindow: (platformUuid: string) => Promise; export declare const showPreferredStorefrontWindow: (platformUuid: string) => Promise; /** * Prefer a running Dock3 window for the platform; fall back to classic Dock. */ export declare const resolvePreferredDockIdentity: (platformUuid: string) => Promise; export declare const showPreferredDockWindow: (platformUuid: string) => Promise; /** * Whether classic and/or VPW Home/Storefront windows are running. * When `platformUuid` is provided, VPW windows under that platform count as running. */ export declare const getComponentWindowStatus: (platformUuid?: string) => Promise<{ storefrontRunning: boolean; homeRunning: boolean; }>; export declare const deserializeWindowBounds: (serialized: string) => OpenFin.WindowBounds | null; export declare const serializeWindowBounds: (bounds: OpenFin.WindowBounds) => string; /** * Calculates the dynamic height for the home window based on subheader configuration * @param baseHeight - The base height for the home window * @param subHeaderConfig - The subheader configuration from search provider * @returns The calculated height based on missing subheader elements */ export declare const calculateHomeWindowHeight: (baseHeight: number, subHeaderConfig?: SearchProviderInfo["subHeader"]) => number; export declare const getWindowBounds: (window: OpenFin.Window) => Promise; /** * calculates the percenage of the window that is present within the monitor (float in range 0-1) * * @param bounds the bounds of the window * @param monitor the monitor to check against */ export declare function getPercentageOfBoundsInMonitor(bounds: OpenFin.Bounds, monitor: OpenFin.MonitorDetails): number; export declare function getMonitorWindowMostOn(parentWindowBounds: OpenFin.Bounds): Promise; export {};