import type OpenFin from '@openfin/core'; import type { IconProps, IconType } from '@openfin/ui-library'; import type { WorkspaceIndicatorConfig } from '../../common/src/utils/indicators/workspace-indicators'; import type { ModalResponseEvent } from '../../common/src/utils/menu-window-provider'; import type { AnalyticsEvent, AnalyticsEventInternal } from '../../common/src/utils/usage-register'; import type { BaseCustomDropdownItem, CustomActionSpecifier, CustomButtonConfig } from '../../common/src/api/action'; import type { Resource } from '../../common/src/api/i18next'; import type { TrackedSite } from '../../common/src/api/pages/idb'; import type { AddDefaultPagePayload, AttachedPage, BookmarkNode, CopyPagePayload, CreateBookmarkNodeRequest, HandlePagesAndWindowClosePayload, HandlePagesAndWindowCloseResult, HandleSaveModalOnPageClosePayload, Page, PageLayoutsWithSelectedViews, PageWithUpdatableRuntimeAttribs, SaveModalOnPageCloseResult, SetActivePageForWindowPayload, ShouldPageClosePayload, ShouldPageCloseResult, UpdateBookmarkNodeRequest, ViewsPreventingUnloadPayload } from '../../common/src/api/pages/shapes'; import type { NotificationsCustomManifestOptions } from '../../common/src/api/shapes/notifications'; import type { ViewTabAppearanceOptions } from '../../common/src/api/shapes/view-tab'; import type { CustomThemes, GeneratedPalettes, NotificationIndicatorColorsParsed } from '../../common/src/api/theming'; import type { App, DockProviderConfigWithIdentity, StoreButtonConfig } from '../../client-api/src/shapes'; import type { WorkflowIntegration } from '../../client-api/src/shapes/integrations'; import type { DockCompanionButton } from '../../dock3/src/shapes/index'; import type { AddPagesOptions, BasePageOpts, PageOpts } from '../../enterprise-api/src/shapes'; export * from '../../dock3/src/shapes'; export * from '../../storefront-vpw/src/shapes'; export { AppManifestType } from '../../client-api/src/shapes'; export type { App, AppIntent, Image } from '../../client-api/src/shapes'; export type { CustomActionSpecifier, CustomButtonConfig } from '../../common/src/api/action'; export type { AttachedPage, Page, PagePinnedState, PageLayout, PageLayoutDetails, PageWithUpdatableRuntimeAttribs, PanelConfigHorizontal, PanelConfigVertical, PanelConfig, ExtendedPanelConfig, CopyPagePayload, HandleSaveModalOnPageClosePayload, SaveModalOnPageCloseResult, SetActivePageForWindowPayload, ShouldPageClosePayload, ShouldPageCloseResult, ViewsPreventingUnloadPayload } from '../../common/src/api/pages/shapes'; export { PanelPosition } from '../../common/src/api/pages/shapes'; export type { ThemedIcon, ViewTabAppearanceOptions, ViewTabColorRole, ViewTabControl, ViewTabControlPosition, ViewTabStateColorOptions } from '../../common/src/api/shapes/view-tab'; export type { CustomThemes, CustomThemeOptions, ThemeOptions, CustomThemeOptionsWithScheme, CustomPaletteSet, BaseThemeOptions, ThemeExtension, WorkspaceThemeSet, NotificationIndicatorColorsSet, NotificationIndicatorColorsSetDarkScheme, NotificationIndicatorColorsSetLightScheme, NotificationIndicatorColorsWithScheme } from '../../common/src/api/theming'; export type { AnalyticsEvent } from '../../common/src/utils/usage-register'; export type { WorkflowIntegration } from '../../client-api/src/shapes/integrations'; /** * Platform capabilities for feature detection by workspace components (Home, Dock). * @internal */ export interface PlatformCapabilities { languageBroadcast?: { home?: boolean; dock?: boolean; notifications?: boolean; }; /** * When true, co-bundled windows load locale JSON via i18next-http-backend * instead of the `_getLanguageResources` IPC bulk transfer. * @internal */ httpLanguagePacks?: boolean; /** * i18next-http-backend loadPath advertised by the provider when HTTP packs * were enabled at `WorkspacePlatform.init`. Windows must not read this from * the shared manifest — Workspace and Enterprise can share one manifest. * @internal */ languagePacksApiUrl?: string; } /** * Request for creating a saved page in persistent storage. */ export interface CreateSavedPageRequest { /** The page to create. */ page: Page; } /** * Request for updating a saved page in persistent storage. */ export interface UpdateSavedPageRequest { /** The ID of the page to update. */ pageId: string; /** The updated page. */ page: Page; } export declare enum PageChangeEventType { UrlChange = "URL_CHANGE", ViewAdded = "VIEW_ADDED", ViewRemoved = "VIEW_REMOVED", PageContextAdded = "PAGE_CONTEXT_ADDED", PageContextRemoved = "PAGE_CONTEXT_REMOVED" } export type PageChangeEventDetails = UrlChangeDetails | ViewAddedDetails | ViewRemovedDetails | PageContextRemovedDetails | PageContextAddedDetails; export interface PageContextRemovedDetails { type: PageChangeEventType.PageContextRemoved; viewIdentity: OpenFin.Identity; } export interface PageContextAddedDetails { type: PageChangeEventType.PageContextAdded; viewIdentity: OpenFin.Identity; contextId: string; } export interface UrlChangeDetails { type: PageChangeEventType.UrlChange; viewIdentity: OpenFin.Identity; urlBefore: string; urlAfter: string; } export interface ViewAddedDetails { type: PageChangeEventType.ViewAdded; viewIdentity: OpenFin.Identity; } export interface ViewRemovedDetails { type: PageChangeEventType.ViewRemoved; viewIdentity: OpenFin.Identity; } export interface HandlePageChangesPayload { /** The page with new changes. */ page: AttachedPage; /** The OF window identity containing the page. */ identity: OpenFin.Identity; /** Additional details about the page change event. */ eventDetails?: PageChangeEventDetails; } export interface ModifiedPageState { hasUnsavedChanges?: boolean; } /** * Request for reordering the pages attached to a window. */ export interface ReorderPagesRequest { /** An array of page ids that specify the order of the pages attached to the window. */ pageIds: string[]; } /** * Request for opening a logo context menu in Browser. */ export interface OpenGlobalContextMenuRequest { /** Client x-coordinate where context menu should be shown. */ x: number; /** Client y-coordinate where context menu should be shown. */ y: number; /** Miscellaneous options necessary for implementing custom logic in the provider override. */ customData?: any; /** Identities of the currently selected views */ selectedViews?: OpenFin.Identity[]; } /**Shape of the data property of a context menu template item */ export interface ContextMenuItemData { type: string; action?: CustomActionSpecifier; } /**Types of global context menu options, including pre-defined ones. * User-defined context menu items should use the value `Custom` */ export declare enum GlobalContextMenuOptionType { NewWindow = "NewWindow", NewPage = "NewPage", SavePage = "SavePage", SavePageAs = "SavePageAs", Print = "Print", PrintAll = "PrintAll", PrintScreen = "PrintScreen", CloseWindow = "CloseWindow", RestoreChanges = "RestoreChanges", SaveWorkspace = "SaveWorkspace", SaveWorkspaceAs = "SaveWorkspaceAs", RenameWorkspace = "RenameWorkspace", SwitchWorkspace = "SwitchWorkspace", DeleteWorkspace = "DeleteWorkspace", Downloads = "Downloads", OpenStorefront = "OpenStorefront", ManageDesktopSignals = "ManageDesktopSignals", FindInPage = "FindInPage", Appearance = "Appearance", Quit = "Quit", Custom = "Custom" } /** * Types of color scheme. */ export declare enum ColorSchemeOptionType { Light = "light", Dark = "dark", System = "system" } /** * Defines the title used for the browser window. * `custom` - uses the value of `value` property * `page-title` - uses the title of the active page * `view-title` - uses the title of the active view */ export type WindowTitle = { type: 'custom'; value: string; } | { type: 'page-title'; } | { type: 'view-title'; }; /**Types of page tab context menu options, including pre-defined ones. * User-defined context menu items should use the value `Custom` */ export declare enum PageTabContextMenuOptionType { Close = "Close", Duplicate = "Duplicate", Rename = "Rename", Save = "Save", SaveAs = "Save As", NewPage = "New Page", /** Workspace Browser: pin a normal tab (sets `pinned: 'user'`). */ Pin = "Pin", /** Workspace Browser: unpin a user-pinned tab (clears `pinned`). */ Unpin = "Unpin", /** Enterprise Browser: toggle Golden Layout view tab headers (multi-view Supertabs). * @internal */ ShowHideTabs = "ShowHideTabs",// Enterprise DeletePage = "Delete Page",// Enterprise SaveWorkspaceAs = "SaveWorkspaceAs",// Enterprise Refresh = "Refresh",// Enterprise CloseOthers = "Close others",// Enterprise Delete = "Delete",// Enterprise Print = "Print",// Enterprise PrintAll = "PrintAll",// Enterprise PrintScreen = "PrintScreen",// Enterprise ManageDesktopSignals = "ManageDesktopSignals",// Enterprise AddToChannel = "AddToChannel",// Enterprise Custom = "Custom" } /** @internal */ export declare enum EnterpriseMainContextMenuOptionType { Lock = "Lock", AddToChanel = "AddToChannel", ManageDesktopSignals = "ManageDesktopSignals",// Enterprise FindInPage = "FindInPage",// Enterprise Print = "Print", Pin = "Pin", SetLanguage = "SetLanguage" } /** @internal */ export declare enum BookmarkItemContextMenuOptionType { EditName = "Edit Name", Move = "Move", Delete = "Delete" } /**Shape of the data property of a global context menu template item */ export interface GlobalContextMenuItemData extends ContextMenuItemData { type: GlobalContextMenuOptionType; } /** @internal */ export interface EnterpriseMainContextMenuItemData extends ContextMenuItemData { type: GlobalContextMenuOptionType | EnterpriseMainContextMenuOptionType | ViewTabMenuOptionType; option?: string; locale?: string; } export interface AddToChanel extends GlobalContextMenuItemData { workspaceId: string; } export interface WorkspaceContextMenuItemData extends GlobalContextMenuItemData { workspaceId: string; } export interface AppearanceContextMenuItemData extends GlobalContextMenuItemData { scheme: ColorSchemeOptionType; } /**Configuration of an option in the global context menu */ export type GlobalContextMenuItemTemplate = OpenFin.MenuItemTemplate; /** @internal */ export type EnterpriseMainContextMenuItemTemplate = OpenFin.MenuItemTemplate; /** @internal */ export interface BookmarkItemContextMenuItemData extends ContextMenuItemData { type: BookmarkItemContextMenuOptionType; folderId?: string; } /** @internal */ export type BookmarkItemContextMenuItemTemplate = OpenFin.MenuItemTemplate; /**Shape of the data property of a page tab context menu template item */ export interface PageTabContextMenuItemData extends ContextMenuItemData { type: PageTabContextMenuOptionType; /** Property to specify which option was selected when there are * several options of the same type (e.g. which channel was selected) */ option?: string; } /**Configuration of an option in the page tab context menu */ export interface PageTabContextMenuItemTemplate extends OpenFin.MenuItemTemplate { data?: PageTabContextMenuItemData; } /**Payload received by a Custom Action that is invoked by a custom global context menu option */ export interface GlobalContextMenuOptionActionPayload { callerType: CustomActionCallerType.GlobalContextMenu; /** Identity of the browser window where the context menu is invoked */ windowIdentity: OpenFin.Identity; /** Any data necessary for the functioning of specified custom action*/ customData?: any; } /**Payload received by a Custom Action that is invoked by a custom page tab context menu option */ export interface PageTabContextMenuOptionActionPayload { callerType: CustomActionCallerType.PageTabContextMenu; /** Identity of the browser window where the context menu is invoked */ windowIdentity: OpenFin.Identity; /** Any data necessary for the functioning of specified custom action*/ customData?: any; /** Id of the page on which the context menu is invoked */ pageId: string; } /** * Payload received by the openGlobalContextMenu provider override. */ export type OpenGlobalContextMenuPayload = OpenGlobalContextMenuRequest & { /** Template defining the options to show in the context menu. */ template: GlobalContextMenuItemTemplate[]; /** Identity of the Browser window where context menu should be shown. */ identity: OpenFin.Identity; /** Default function that handles stock context menu options. */ callback: (data: GlobalContextMenuItemData, payload: OpenGlobalContextMenuPayload) => any; }; /** * Request for opening the global context menu with custom context menu in Enterprise Browser. * @internal */ export type InternalOpenGlobalContextMenuRequest = OpenGlobalContextMenuRequest & { /** Coordinates associated with a target element for a custom context menu request. */ rect?: DOMRect; }; export type ViewTabContextMenuTemplate = OpenFin.MenuItemTemplate; /** * UI elements within a view tab that can be navigated to via keyboard. */ export type ViewTabElements = 'inactive-tab' | 'active-tab' | 'inactive-tab-close-button' | 'active-tab-close-button' | 'inactive-tab-custom-control' | 'active-tab-custom-control' | 'add-tab-button'; /** * Configuration options for view tab keyboard navigation behavior. */ export interface ViewTabOptions { /** * Elements in the view tab that are able to be focused using * arrow keys when an element in the view is selected. * The order of the items in the array have no impact. * Note: these are not mutually exclusive and can overlap. * Default (when undefined): ["inactive-tab","active-tab","active-tab-close-button","inactive-tab-close-button","active-tab-custom-control","inactive-tab-custom-control","add-tab-button"] */ arrowNavigation?: ViewTabElements[]; /** * Elements in the view tab that are able to be focused using * tab and shift+tab when an element in the view is selected. * The order of the items in the array have no impact. * Note: these are not mutually exclusive and can overlap. * Default (when undefined): ["active-tab","add-tab-button"] */ tabNavigation?: ViewTabElements[]; } /** * Configuration options for accessibility features in the Browser. */ export interface AccessibilityOptions { /** * View tab keyboard navigation options. */ viewTabOptions?: ViewTabOptions; } /** * Request for opening a view tab context menu in Browser. */ export interface OpenViewTabContextMenuRequest { /** Client x-coordinate where context menu should be shown. */ x: number; /** Client y-coordinate where context menu should be shown. */ y: number; /** Miscellaneous options necessary for implementing custom logic in the provider override. */ customData?: any; /** Template defining the options to show in the context menu. */ template: ViewTabContextMenuTemplate[]; /** Ids of selected views */ selectedViews: OpenFin.Identity[]; } /** * Request for opening a page tab context menu in Browser. */ export interface OpenPageTabContextMenuRequest { /** Client x-coordinate where context menu should be shown. */ x: number; /** Client y-coordinate where context menu should be shown. */ y: number; /** Miscellaneous options necessary for implementing custom logic in the provider override. */ customData?: any; /** Id of the page on which the context menu is invoked */ pageId: string; } /** * View tab context menu types for {@link WorkspacePlatformProvider.openViewTabContextMenu} override. */ export declare enum ViewTabMenuOptionType { /** * Create new view in a page. */ NewView = "NewView", /** * Duplicate selected views in a page. */ DuplicateViews = "DuplicateView", /** * Open content from the selected view in system's default web browser. */ OpenWithDefaultBrowser = "OpenWithDefaultBrowser", /** * Reload the selected views. */ ReloadViews = "ReloadTab", /** * Close the selected views. */ CloseViews = "CloseTab", /** * Add selected views to a color channel. */ AddToChannel = "AddToChannel", /** * Remove selected views from a color channel. */ RemoveFromChannel = "RemoveFromChannel", /** * Navigate back to the previous content. */ Back = "Back", /** * Navigate forward to the next content. */ Forward = "Forward", /** * Print the selected view. */ Print = "Print", /** * Prints visible views. */ PrintAll = "PrintAll", /** * Prints a screenshot of the browser window. */ PrintScreen = "PrintScreen", /** * Translate the selected view's content to the detected target language. */ TranslatePage = "TranslatePage", /** * Revert translated content back to the original language. */ RevertTranslation = "RevertTranslation", /** * Custom context menu option defined by API client. */ Custom = "Custom" } export interface ViewTabMenuData { type: ViewTabMenuOptionType; action?: CustomActionSpecifier; option?: string; } export interface ViewTabCustomActionPayload { callerType: CustomActionCallerType.ViewTabContextMenu; /** Any data necessary for the functioning of specified custom action*/ customData: any; /** Identity of the Browser window where context menu should be shown. */ windowIdentity: OpenFin.Identity; selectedViews: OpenFin.Identity[]; } export interface ViewTabControlActionPayload { callerType: CustomActionCallerType.ViewTabControl; /** Identity of the Browser window containing the view tab. */ windowIdentity: OpenFin.Identity; /** Identity of the view represented by the tab. */ viewIdentity: OpenFin.Identity; /** Any data necessary for the functioning of the specified custom action. */ customData?: any; /** Client x-coordinate where the control was invoked. */ x: number; /** Client y-coordinate where the control was invoked. */ y: number; } /** * Payload received by the openViewTabContextMenu provider override. */ export type OpenViewTabContextMenuPayload = OpenViewTabContextMenuRequest & { /** Identity of the Browser window where context menu should be shown. */ identity: OpenFin.Identity; /** Default function that handles stock context menu options. */ callback: (data: ViewTabMenuData, req: OpenViewTabContextMenuPayload) => any; }; /** * Payload received by the openViewTabContextMenu provider override. */ export type OpenPageTabContextMenuPayload = OpenPageTabContextMenuRequest & { /** Identity of the Browser window where context menu should be shown. */ identity: OpenFin.Identity; /** Template defining the options to show in the context menu. */ template: PageTabContextMenuItemTemplate[]; /** Default function that handles stock context menu options. */ callback: (data: PageTabContextMenuItemData, req: OpenPageTabContextMenuPayload) => any; }; /** * Request for opening the global context menu with custom context menu in Enterprise Browser. * @internal */ export type InternalOpenPageTabContextMenuRequest = OpenPageTabContextMenuRequest & { /** Coordinates associated with a target element for a custom context menu request. */ rect?: DOMRect; }; /** * Request to update the attributes of a page in which is attached to a running browser window. */ export interface UpdateAttachedPageRequest { /** The ID of the page to update. */ pageId: string; /** The updated page. */ page: Partial; } export interface ReparentPageRequest { /** The ID of the page to reparent. */ pageId: string; } /** * Types of buttons on browser windows */ export declare enum BrowserButtonType { ShowHideTabs = "ShowHideTabs", ColorLinking = "ColorLinking", PresetLayouts = "PresetLayouts", LockUnlockPage = "LockUnlockPage", SaveMenu = "SaveMenu", SavePage = "SavePage", Download = "Download", Minimise = "Minimise", Maximise = "Maximise", Close = "Close", Custom = "Custom" } /** * The shape of the payload sent by a custom button click to a custom action handler */ export interface CustomButtonActionPayload { /** Calling the CustomButton type */ callerType: CustomActionCallerType.CustomButton; /** Identity for the current window. */ windowIdentity: OpenFin.Identity; /** Any data necessary for the functioning of specified custom action*/ customData: any; /** Screen x-coordinate where custom button should be shown. */ x: number; /** Screen y-coordinate where custom button should be shown. */ y: number; } /** * The shape of the payload that is sent by a store app primary button or secondary button click to a platform custom action handler */ export interface StoreCustomButtonActionPayload extends Omit { /** * Invoking application id. */ appId: string; sourceButtonConfig: StoreButtonConfig; secondaryButtons: StoreButtonConfig[]; primaryButton: StoreButtonConfig; callerType: CustomActionCallerType.StoreCustomButton; storeFrontProviderId: string; } /** * The shape of the payload sent by a custom dropdown menu item to a custom action handler */ export interface CustomDropdownItemActionPayload { /** Calling the CustomButton type */ callerType: CustomActionCallerType.CustomDropdownItem; /** Identity for the current window. */ windowIdentity: OpenFin.Identity; /** Any data necessary for the functioning of specified custom action*/ customData: any; } /** * Custom browser buttons */ export interface CustomBrowserButtonConfig extends CustomButtonConfig { /** Type of custom browser button */ type: BrowserButtonType.Custom; } /** * Default Browser Button types */ export interface PreDefinedButtonConfig { /** Type of default browser button */ type: Exclude; /** Button name text when hovered over */ tooltip?: string; /** icon URL for icon image */ iconUrl?: string; iconProps?: IconProps; disabled?: boolean; parentHover?: boolean; } /** * Configuration Object for the show/hide tabs button within the browser toolbar * * @example * ```ts * const showHideTabsConfig: ShowHideTabsConfig = { * type: BrowserButtonType.ShowHideTabs, * disabled: false * }; * ``` */ export type ShowHideTabsConfig = { type: BrowserButtonType.ShowHideTabs; disabled?: boolean; tabsShownIconUrl?: { /** * The URL of the icon to display when the button is disabled and tabs are hidden. * * The button is disabled when the page is locked. */ disabled?: string; /** * The URL of the icon to display when the button is enabled and tabs are hidden. */ enabled?: string; }; tabsHiddenIconUrl?: { /** * The URL of the icon to display when the button is disabled and tabs are hidden. * * The button is disabled when the page is locked. */ disabled?: string; /** * The URL of the icon to display when the button is enabled and tabs are hidden. */ enabled?: string; }; }; /** * Configuration Object for the page lock/unlock button within the browser toolbar * * @example * ```ts * const lockUnlockPageConfig: LockUnlockPageConfig = { * type: BrowserButtonType.LockUnlockPage, * disabled: false * }; * ``` */ export type LockUnlockPageConfig = { type: BrowserButtonType.LockUnlockPage; disabled?: boolean; lockedIconUrl?: string; unlockedIconUrl?: string; }; /** * Buttons on the left of WindowStateButtonOptions */ export type ToolbarButton = ShowHideTabsConfig | LockUnlockPageConfig | CustomBrowserButtonConfig | PreDefinedButtonConfig; export interface ToolbarOptions { buttons: ToolbarButton[]; } /** * Buttons to the top far right of Browser */ export type WindowStateButton = CustomBrowserButtonConfig | PreDefinedButtonConfig; export interface WindowStateButtonOptions { buttons: WindowStateButton[]; } /**Types of context menu options for Save button, including pre-defined ones. * User-defined context menu items should use the value `Custom` */ export declare enum SaveButtonContextMenuOptionType { SavePage = "SavePage", SaveWorkspace = "SaveWorkspace", SavePageAs = "SavePageAs", SaveWorkspaceAs = "SaveWorkspaceAs", Custom = "Custom" } /**Shape of the data property of a save button context menu template item */ export interface SaveButtonContextMenuItemData extends ContextMenuItemData { type: SaveButtonContextMenuOptionType; } /**Configuration of an option in the save button context menu */ export interface SaveButtonContextMenuItemTemplate extends OpenFin.MenuItemTemplate { data?: SaveButtonContextMenuItemData; } /** * Request for opening a context menu from save button in Browser. */ export interface OpenSaveButtonContextMenuRequest { /** Client x-coordinate where context menu should be shown. */ x: number; /** Client y-coordinate where context menu should be shown. */ y: number; /** Screen x-coordinate of save button */ buttonLeft: number; /** width of save button */ buttonWidth: number; /** Miscellaneous options necessary for implementing custom logic in the provider override. */ customData?: any; /** Id of the page on which the context menu is invoked */ pageId: string; } /** * Payload received by the openSaveButtonContextMenu provider override. */ export type OpenSaveButtonContextMenuPayload = OpenSaveButtonContextMenuRequest & { /** Identity of the Browser window where context menu should be shown. */ identity: OpenFin.Identity; /** Template defining the options to show in the context menu. */ template: SaveButtonContextMenuItemTemplate[]; /** Default function that handles stock context menu options. */ callback: (data: SaveButtonContextMenuItemData, req: OpenSaveButtonContextMenuPayload) => any; }; /**Payload received by a Custom Action that is invoked by a custom save button context menu option */ export interface OpenSaveContextMenuOptionActionPayload { callerType: CustomActionCallerType.SaveButtonContextMenu; /** Identity of the browser window where the context menu is invoked */ windowIdentity: OpenFin.Identity; /** Any data necessary for the functioning of specified custom action*/ customData?: any; /** Id of the page on which the context menu is invoked */ pageId: string; } export declare enum WindowType { Browser = "browser", Platform = "platform" } /** How view tab widths are calculated. `'uniform'` is today's equal-width behavior. */ export type ViewTabWidthMode = 'uniform' | 'content'; export interface BrowserWorkspacePlatformViewOptions { browserNavigationButtons?: RequireAtLeastOne<{ back?: boolean; forward?: boolean; reload?: boolean; }>; /** Per-view tab appearance options. */ viewTab?: ViewTabAppearanceOptions; } type RequireAtLeastOne = Pick> & { [K in Keys]-?: Required> & Partial>>; }[Keys]; export interface BrowserCreateViewPayload { opts: BrowserCreateViewRequest; target?: OpenFin.CreateViewTarget; targetView?: OpenFin.Identity; } export interface BrowserCreateViewRequest extends OpenFin.PlatformViewCreationOptions { workspacePlatform?: BrowserWorkspacePlatformViewOptions; } export interface BrowserViewState extends OpenFin.ViewState { workspacePlatform?: BrowserWorkspacePlatformViewOptions; } /** * Enables or disables the tab-search chevron button for a specific tab location. */ export interface TabSearchLocationOptions { enabled: boolean; } /** * Configures where tab-search chevron buttons should be shown in a browser window. */ export interface TabSearchButtonOptions { pageTabs?: TabSearchLocationOptions; viewTabs?: TabSearchLocationOptions; } export interface BrowserWorkspacePlatformWindowOptions { /** For internal usage. Defaults to 'browser' when Browser is enabled when the WorkspacePlatform is initialized. In order to use * non-Browser layout windows ('platform' windows) in a Browser-enabled workspace platform, set windowType to `platform`. In that instance, the other properties * in the workspacePlatform object are not relevant. * */ windowType?: WindowType | // Be very careful when changing this formatting. If you change the formatting, validate that `'enterprise'` is still stripped out. /** @internal */ 'enterprise'; /** The initial set of pages to add to the created browser window. */ pages: Page[]; /** The favicon to display on the top left of the created browser window. */ favicon?: string; /** * A UI friendly title for the created browser window. * Type string for window title is deprecated, please use WindowTitle type instead. */ title?: WindowTitle | string; /** * URL used for new-tab actions: the plus button in the tabstrip, the new-tab hotkey, and the * "New tab" context menu entry. * * If you do not provide a newTabUrl, then the plus button in the tabstrip will not be shown and * users cannot create a new empty tab. * * This does not control a newly created window's initial content; that comes from `pages`. */ newTabUrl?: string; /** * URL used for new-page and new-window actions. * * If you do not provide a newPageUrl, then the new Page plus button will not be shown and you * cannot create a new empty Page or Window. * * This does not automatically control a newly created window's initial content; a caller of * `Browser.createWindow` must include a page using this URL in `pages`. */ newPageUrl?: string; toolbarOptions?: ToolbarOptions; windowStateButtonOptions?: WindowStateButtonOptions; /** Specifies the min and max sizes for page tabs. * Page tabs will expand to take all available space up to the specified maximum size. * Similarly, they will collapse down to the specified minimum size. * When there is not enough room to fit the tabs, the tabstrip will become scrollable. * Sizes can be specified as pixels (e.g. "100px") or as percentage of tab strip width (e.g. "20%"). * The default value for both min and max is "120px". To maintain usability, minimum values below 28px will be ignored and 28px will be used as the minimum. */ pageTabDimensions?: { minWidth?: string; maxWidth?: string; }; /** * Specifies the min and max sizes for view tabs in a layout, and how those widths are calculated. * View tabs will expand to take all available space up to the specified maximum size. * Similarly, they will collapse down to the specified minimum size. * When there is not enough room to fit the tabs, the tabstrip will become scrollable. * Sizes can be specified as pixels (e.g. "100px") or as percentage of tab strip width (e.g. "20%"). * Defaults depend on the width mode: `'uniform'` uses "120px" for both bounds, while `'content'` sizes a * tab to its own chrome and so applies no minimum and a "200px" maximum. * To maintain usability, minimum values below 28px will be ignored and 28px will be used as the minimum. * * @example * ```ts * workspacePlatform: { * viewTabDimensions: { * widthMode: 'content', * minWidth: '50px', * maxWidth: '200px' * } * } * ``` */ viewTabDimensions?: { minWidth?: string; maxWidth?: string; /** * Controls how view tab widths are calculated. * - `'uniform'` (default): current equal-width tab behavior. * - `'content'`: tab width is driven by tab chrome (label, favicon, spinner, controls) within min/max bounds. */ widthMode?: ViewTabWidthMode; }; /** * Controls whether tab-search chevron buttons are shown for page tabs and view tabs. * * By default, both locations are disabled unless explicitly enabled. * * @example * ```ts * workspacePlatform: { * tabSearchButton: { * viewTabs: { enabled: true }, * pageTabs: { enabled: true } * } * } * ``` * * @example * ```ts * workspacePlatform: { * tabSearchButton: { * viewTabs: { enabled: true }, * // pageTabs omitted: disabled * } * } * ``` */ tabSearchButton?: TabSearchButtonOptions; /** * Accessibility options for the browser window. * These options override the default accessibility options set at the platform or browser initialization level. * * @example * ```ts * import * as WorkspacePlatform from '@openfin/workspace-platform'; * * const platform = WorkspacePlatform.getCurrentSync(); * const browserWin = platform.Browser.createWindow({ * ..., * workspacePlatform: { * ..., * accessibilityOptions: { * viewTabOptions: { * arrowNavigation: ["inactive-tab", "active-tab"], * tabNavigation: ["active-tab"] * } * } * } * }); * ``` */ accessibilityOptions?: AccessibilityOptions; /** * Use when you want to display navigation buttons in Browser toolbar. Disabled by default. * * @example * ``` * import * as WP from "@openfin/workspace-platform"; * * const platform = WP.getCurrentSync(); * const browserWin = platform.Browser.createWindow({ * ..., * workspacePlatform: { * ..., * navigationButtons: { * enabled: true; * } * } * }); * ``` * * @example * ``` * // With disabled default keyboard shortcuts * const browserWin = platform.Browser.createWindow({ * ..., * workspacePlatform: { * ..., * navigationButtons: { * enabled: true; * hotkeysDisabled: true; * } * } * }); * ``` */ navigationButtons?: { enabled: false; } | { enabled: true; hotkeysDisabled?: boolean; }; /** * Remove the Page UI and only allow a single page in the browser window. * Must be set to true for this behavior. If this is not set to false, * then an empty `pages` option will be populated with a single page. */ disableMultiplePages?: boolean; /** * When true, disables the ability to drag pages into the window. False by default. */ preventPageDragIn?: boolean; /** * When true, disables the ability to close pages, drag pages within the window, * and drag pages into/out of the window. False by default. */ isLocked?: boolean; /** * When true, disables the ability to drag pages out of a window. False by default. */ preventPageDragOut?: boolean; /** * When true, page tabs in the window will not be draggable. * This includes reordering pages and dragging them out of the window. * False by default. */ preventPageDrag?: boolean; /** * When true, disables the ability to close pages in the window. False by default. */ preventPageClose?: boolean; /** * When true, disables the find in page feature for the window. * The find in page view will not be created and no find in page logic will run. * This option must be set at window creation time and cannot be changed dynamically. * False by default. */ disableFindInPage?: boolean; /** * Taskbar Icon for the Browser Window. If light and dark icon are defined, then the taskbar icon will change when the scheme changes. */ icon?: string | TaskbarIcon; /** * The size of icons in the browser window. This is set from the platform-level * `browserIconSize` option during window creation. * @internal Propagated from BrowserInitConfig.browserIconSize */ browserIconSize?: IconSize; } /** * Request for creating a browser window. */ export interface BrowserCreateWindowRequest extends Omit { /** WorkspacePlatform specific window options. These options will not work unless a workspace platform has been initialized. */ workspacePlatform: BrowserWorkspacePlatformWindowOptions | { /** For internal usage. Defaults to 'browser' when Browser is enabled when the WorkspacePlatform is initialized. In order to use * non-Browser layout windows ('platform' windows) in a Browser-enabled workspace platform, set windowType to `platform`. In that instance, the other properties * in the workspacePlatform object are not relevant. * */ windowType: WindowType.Platform; }; /** The icon to display on the taskbar. * @deprecated Use the icon property in the workspacePlatform object instead. */ icon?: string; /** * @interal - The Ai Panel options for the window. If the url is not set, the panel will not show up. */ aiPanelOptions?: AiPanelOptions; } /** * A window that is part of a browser snapshot. */ export type BrowserSnapshotWindow = OpenFin.WindowCreationOptions & BrowserCreateWindowRequest; /** * A browser snapshot. */ export interface BrowserSnapshot { /** The state of the windows that were running at the time the snapshot was taken. */ windows: BrowserSnapshotWindow[]; } /** * Controller for interacting with a browser window. */ export interface BrowserWindowModule { /** The identity of the browser window. */ identity: OpenFin.Identity; /** Underlying OpenFin window Controller. */ openfinWindow: OpenFin.Window; /** * Get a page that is attached to the browser window. * * ```ts * import * as WorkspacePlatform from '@openfin/workspace-platform'; * * const workspacePlatform = WorkspacePlatform.getCurrentSync(); * // assume a browser window already exists * const windows = await workspacePlatform.Browser.getAllWindows(); * const page = await windows[0].getPage('MyPageId'); * ``` * @param id the id of the page to get. */ getPage(id: string): Promise; /** * Return all the pages that are attached to a browser window. * * ```ts * import * as WorkspacePlatform from '@openfin/workspace-platform'; * * const workspacePlatform = WorkspacePlatform.getCurrentSync(); * // assume a browser window already exists * const windows = await workspacePlatform.Browser.getAllWindows(); * const pages = await windows[0].getPages(); * ``` */ getPages(): Promise; /** * Set the active page for the browser window. If `multiplePagesDisabled` is `true` an error will be thrown. * * ```ts * import * as WorkspacePlatform from '@openfin/workspace-platform'; * * const workspacePlatform = WorkspacePlatform.getCurrentSync(); * // assume a browser window already exists * const windows = await workspacePlatform.Browser.getAllWindows(); * await windows[0].setActivePage('MyPageId'); * ``` * @param id the id of the attached page to set as active. */ setActivePage(id: string): Promise; /** * Attach a page to a browser window. * If `multiplePagesDisabled` is `true` or a page with same id or title is attached to an existing browser window, an error will be thrown. * * ```ts * import * as WorkspacePlatform from '@openfin/workspace-platform'; * * const workspacePlatform = WorkspacePlatform.getCurrentSync(); * const layout = { * content: [ * { * type: 'stack', * content: [ * { * type: 'component', * componentName: 'view', * componentState: { * name: 'myViewName', * url: 'http://google.com' * } * } * ] * } * ] * }; * const page = { * title: 'myPageTitle', * pageId: 'myPageId', * layout * }; * // assume a browser window already exists * const windows = await workspacePlatform.Browser.getAllWindows(); * await windows[0].addPage(page); * // focus window * await windows[0].openfinWindow.focus(); * // restore window if minimized * await windows[0].openfinWindow.restore(); * ``` * @param page the attach page to a browser window. */ addPage(page: PageWithUpdatableRuntimeAttribs): Promise; /** * Remove an existing page from an existing browser window and reparent it to another existing browser window. * If `multiplePagesDisabled` is `true` an error will be thrown. * * ```ts * import * as WorkspacePlatform from '@openfin/workspace-platform'; * * const workspacePlatform = WorkspacePlatform.getCurrentSync(); * * // assume a page and multiple browser windows already exists * const wrappedTargetWindow = workspacePlatform.Browser.wrapSync(identity) * const reparentPageRequest = { pageId: 'my-target-page' } * // wrap the window to which you wish to move the page and call reparentPage * await wrappedTargetWindow.reparentPage(reparentPageRequest); * // focus window * await wrappedTargetWindow.openfinWindow.focus(); * // restore window if minimized * await wrappedTargetWindow.openfinWindow.restore(); * ``` * @param req the reparent page request. */ reparentPage(req: ReparentPageRequest): Promise; /** * Remove an attached page from the browser window. * * ```ts * import * as WorkspacePlatform from '@openfin/workspace-platform'; * * const workspacePlatform = WorkspacePlatform.getCurrentSync(); * // assume a browser window already exists * const windows = await workspacePlatform.Browser.getAllWindows(); * await windows[0].removePage('myPageId'); * ``` * @param id the id of the attached page to remove from the browser window. */ removePage(id: string): Promise; /** * Update a page in which is attached to the browser window. * * ```ts * import * as WorkspacePlatform from '@openfin/workspace-platform'; * * const workspacePlatform = WorkspacePlatform.getCurrentSync(); * const layout = { * content: [ * { * type: 'stack', * content: [ * { * type: 'component', * componentName: 'view', * componentState: { * name: 'myViewName', * url: 'http://google.com' * } * } * ] * } * ] * }; * const page = { * title: 'myPageTitle', * pageId: 'myPageId', * layout * }; * // assume a browser window already exists * const windows = await workspacePlatform.Browser.getAllWindows(); * const req = { * pageId: 'myPageId', * page * }; * await windows[0].updatePage(req); * ``` * @param req the update request. */ updatePage(req: UpdateAttachedPageRequest): Promise; /** * Reorder pages attached to the browser window. If `multiplePagesDisabled` is `true` an error will be thrown. * * ```ts * import * as WorkspacePlatform from '@openfin/workspace-platform'; * * const workspacePlatform = WorkspacePlatform.getCurrentSync(); * // assume a browser window already exists and has three pages in it * const windows = await workspacePlatform.Browser.getAllWindows(); * await windows[0].reorderPages(['myPageId2', 'myPageId1', 'myPageId3']); * ``` * @param req the reorder pages request. */ reorderPages(req: ReorderPagesRequest): Promise; /** * Replace toolbar options with custom toolbar options * * ```ts * import * as WorkspacePlatform from '@openfin/workspace-platform'; * * // to set the array to our default buttons, pass in null * * const workspacePlatform = WorkspacePlatform.getCurrentSync(); * workspacePlatform.Browser.wrapSync(identity).replaceToolbarOptions({buttons:[{ * type: 'Custom', * tooltip: 'Custom Tooltip', * disabled: false, * iconUrl: 'https://www.openfin.co/favicon.ico', * action: { * id: 'sample-custom-action-name', * customData: { * message: 'Clicked on custom Toolbar button' * } * } * }]}) * * const openFinWindow = fin.Window.wrapSync(identity); * // call getOptions() to view updated toolbarOptions under workspacePlatform * await openFinWindow.getOptions() * ``` * @param options new toolbar options. */ replaceToolbarOptions(options: ToolbarOptions): Promise; /** * Replace window state button options with custom window state button options * * ```ts * import * as WorkspacePlatform from '@openfin/workspace-platform'; * * // to set the array to our default buttons, pass in null * * const workspacePlatform = WorkspacePlatform.getCurrentSync(); * workspacePlatform.Browser.wrapSync(identity).replaceWindowStateButtonOptions({buttons:[{ * type: 'Custom', * tooltip: 'Custom tooltip', * disabled: false, * iconUrl: 'https://www.openfin.co/favicon.ico', * action: { * id: 'sample-custom-action-name', * customData: { * message: 'Clicked on custom window state button' * } * } * }]}) * * const openFinWindow = fin.Window.wrapSync(identity); * // call getOptions() to view updated windowStateButtonOptions under workspacePlatform * await openFinWindow.getOptions() * ``` * @param options new window state options. */ replaceWindowStateButtonOptions(options: WindowStateButtonOptions): Promise; /** * Updates the browser window title based on the provided title object. * * @param title The new title object for the browser window. * * @example * ```typescript * import * as WorkspacePlatform from '@openfin/workspace-platform'; * const workspacePlatform = WorkspacePlatform.getCurrentSync(); * workspacePlatform.Browser.wrapSync(identity).updateBrowserWindowTitle({type: 'view-title'}); * ``` * * @example * ```typescript * import * as WorkspacePlatform from '@openfin/workspace-platform'; * const workspacePlatform = WorkspacePlatform.getCurrentSync(); * workspacePlatform.Browser.wrapSync(identity).updateBrowserWindowTitle({type: 'custom', value: 'My Custom Title'}); * ``` * * @typedef WindowTitle * @type {Object} * @property {string} type - The type of the window title ('custom', 'page-title', or 'view-title'). * @property {string} [value] - The value associated with the 'custom' type. */ updateBrowserWindowTitle(title: WindowTitle): Promise; /** * Open global context menu in the browser window. By default, this context menu appears * when clicking on the logo in the upper-left corner of the window. * * ```ts * import * as WorkspacePlatform from '@openfin/workspace-platform'; * * const browserIdentity = { * name: 'example-browser-window-name', * uuid: 'my-application' * }; * const workspacePlatform = WorkspacePlatform.getCurrentSync(); * workspacePlatform.Browser.wrapSync(browserIdentity)._openGlobalContextMenu({ * x: 100, * y: 150 * }); * ``` * @param req the global context menu request. * @internal */ _openGlobalContextMenu(req: InternalOpenGlobalContextMenuRequest): Promise; /** @internal */ _openViewTabContextMenu(req: OpenViewTabContextMenuRequest): Promise; /** @internal */ _openPageTabContextMenu(req: InternalOpenPageTabContextMenuRequest): Promise; /** @internal */ _openSaveButtonContextMenu(req: OpenSaveButtonContextMenuRequest): Promise; /** * ```ts * import * as WorkspacePlatform from '@openfin/workspace-platform * * const browserIdentity = { * name: 'example-browser-window-name', * uuid:'my-app-id' * }; * * const wp = WorkspacePlatform.getCurrentSync(); * * // eslint-disable-next-line no-underscore-dangle * wp.Browser.wrapSync(browserIdentity)._openSaveModal({ * id: 'my-page-id', * menuType: WorkspacePlatform.SaveModalType.SAVE_PAGE_AS, * }); * ``` * @param req the modal request object * @internal */ _openSaveModal(req: OpenSaveMenuRequest): Promise; /** * Internal implementation of addPage that supports adding at a specific index * @internal */ _addPage(page: PageWithUpdatableRuntimeAttribs, opts?: PageOpts): Promise; /** * Internal implementation for adding multiple pages to a browser window at once * @internal */ _addPages(pages: Array<{ page: PageWithUpdatableRuntimeAttribs; opts?: BasePageOpts; }>, opts?: AddPagesOptions): Promise; /** * Internal implementation to retrieve selected view ids from available layouts in a browser window instances */ _getLayoutsWithSelectedViews(): Promise; /** * Internal implementation that supports adding at a specific index * @param req the reparent page request. * @internal */ _reparentPage(req: ReparentPageRequest & { index?: number; }): Promise; /** * ```ts * * const newPage = await makeNewLandingPage(); * const browser = getCurrentSync().Browser.wrapSync(currentOFIdentity); * await browser._addDefaultPage({ identity: currentOFIdentity, page: newPage }); * ``` * @param req the default page request object * @internal */ _addDefaultPage(req: AddDefaultPagePayload): Promise; /** @internal */ _trackRemovedTab(req: any): Promise; /** @internal */ _restoreRemovedTab(req?: any): Promise; /** @internal */ _trackVisitedSite(req: any): Promise; /** @internal */ _getRecentlyVisitedSites(req?: ContentSortRequest): Promise; /** @internal */ _getFrequentlyVisitedSites(req?: any): Promise; /** @internal */ _searchSites(req: SearchSitesRequest): Promise; /** @internal */ _getCuratedContent(req?: ContentSortRequest): Promise; /** @internal */ _handleRequestNavigation(args: NavigationRequest): Promise; /** @internal */ _getSearchProviders(req?: any): Promise; /** @internal */ _sendUpdateVersionModalResponse(payload: SendUpdateVersionModalResponsePayload): Promise; _bookmarks: BrowserBookmarks; } export interface BrowserBookmarks { /** * Implementation for creating a new bookmark node. * @param req The request object specifying the attributes of the new node. * @internal */ _createBookmarkNode(req: CreateBookmarkNodeRequest): Promise; /** * Implementation for getting a bookmark node. * @param string The unique id of the node. Returns root node when left undefined. * @internal */ _getBookmarkNode(id?: string): Promise; /** * Implementation for searching for a bookmark node. * @param query The string used to filter bookmark nodes by title or, in the case of bookmarks, URL, as well. * @internal */ _searchBookmarkNodes(query: string): Promise; /** * Implementation for updating a bookmark node. * @param req The request object with the updated attributes of the targeted node. * @internal */ _updateBookmarkNode(req: UpdateBookmarkNodeRequest): Promise; /** * Implementation for deleting a bookmark node. * @param id The unique id of the node. * @internal */ _deleteBookmarkNode(id: string): Promise; } /** * @internal */ export type NavigationRequest = { windowIdentity: OpenFin.Identity; viewIdentity: OpenFin.Identity; } & ({ action: 'result-selected'; trigger?: SiteAction; site: Site; openMode?: 'replace' | 'new-tab' | 'new-window'; } | (SearchSitesRequest & { action: 'search-input'; })); /** * @internal */ export type SearchSitesRequest = { /** * The search query to use when searching for results. */ query: string; /** * The ID of the query request. This prevents result contamination from other queries. */ queryId: string; /** * The ID of the active search provider being queried. */ providerId?: string; /** * Page number */ pageNumber?: number; /** * Number of results per page */ pageSize?: number; /** * Array of filter IDs for a search provider */ filters?: string[]; }; /** * @internal */ export type SearchProviderResult = { id: string; results?: Site[]; pageNumber?: number; pageSize?: number; showViewMore?: boolean; queryId?: string; supportsPaging?: boolean; }; /** * @internal */ export type SearchSitesResponse = Array; /** * @internal */ export type SiteAction = { id: string; title: string; altText?: string; icon?: { light: string; dark: string; }; description?: string; }; /** * @internal */ export type SiteInfo = { id: string; title: string; subTitle?: string; cta?: string; actions?: SiteAction[]; rightSideIcon?: IconType; customData?: unknown; }; /** * @internal */ export type { IconType }; /** * @internal */ export type AppSite = SiteInfo & { type: 'app' | 'website'; url?: string; icon: string; options?: { icon?: { size?: 'standard' | 'large'; }; }; }; /** * @internal */ export type WorkspaceSite = SupertabSite | CollectionSite; /** * @internal */ export type SupertabSite = SiteInfo & { type: 'page'; isPublished?: boolean; }; /** * @internal */ export type CollectionSite = SiteInfo & { type: 'collection' | 'workspace'; }; /** * @internal */ export type Site = AppSite | WorkspaceSite; /** * @internal */ export type ContentSortRequest = { sortBy?: 'title' | 'timestamp' | 'createdAt'; sortOrder?: 'asc' | 'desc'; }; /** * @internal * action is undefined when the site is actioned with the default action. */ export type ActionedSite = Site & { action?: SiteAction; }; /** * Factory for wrapping browser windows and global operations. */ export interface BrowserWindowFactory { /** * Synchronously returns a Browser Window object that represents an existing window * * @param identity of the window */ wrapSync: (identity: OpenFin.Identity) => BrowserWindowModule; /** * Get a list of all pages that are attached to any running browser window. * * ```ts * import * as WorkspacePlatform from '@openfin/workspace-platform'; * * const workspacePlatform = WorkspacePlatform.getCurrentSync(); * const attachedPages = await workspacePlatform.Browser.getAllAttachedPages(); * ``` */ getAllAttachedPages(): Promise; /** * Get all the Browser Windows that are running in the Workspace Platform. * * ```ts * import * as WorkspacePlatform from '@openfin/workspace-platform'; * * const workspacePlatform = WorkspacePlatform.getCurrentSync(); * const windows = await workspacePlatform.Browser.getAllWindows(); * ``` */ getAllWindows(): Promise; /** * Create a new browser window. * * ```ts * import * as WorkspacePlatform from '@openfin/workspace-platform'; * * const workspacePlatform = WorkspacePlatform.getCurrentSync(); * const layout = { * content: [ * { * type: 'stack', * content: [ * { * type: 'component', * componentName: 'view', * componentState: { * name: 'myViewName', * url: 'http://google.com' * } * } * ] * } * ] * }; * const page = { * title: 'myPageTitle', * pageId: 'myPageId', * layout * }; * const options: BrowserCreateWindowRequest = { * workspacePlatform: { * pages: [page], * title: 'My Window Title', * favicon: 'https://google.com/favicon.ico', * disableMultiplePages: true, // disable page functionality for the window * toolbarOptions: { // configure the set of tray icons for the window * buttons: [ * { // adding a custom tray icon for the window * type: BrowserButtonType.Custom, * tooltip: 'Sample Tray Icon', * disabled: false, * iconUrl: 'https://www.openfin.co/favicon.ico', * action: { * // This action needs to be registed in customActions property in the call WorkspacePlatform.init * id: 'sample-trayicon-custom-action', * customData: { * message: 'Clicked on custom Toolbar button' * } * } * }, * { * type: BrowserButtonType.ShowHideTabs * }, * { * type: BrowserButtonType.ColorLinking * }, * { * type: BrowserButtonType.PresetLayouts * }, * { * type: BrowserButtonType.SaveMenu * } * ] * } * windowStateButtonOptions: { * //configure the set of icons for setting window states * buttons: [ * { // adding a custom window state icon for the window * id: 'windowState123', * type: BrowserButtonType.Custom, * tooltip: 'Sample Window State button', * disabled: false, * iconUrl: 'https://www.openfin.co/favicon.ico', * action: { * // This action needs to be registered in customActions property in the call WorkspacePlatform.init * id: 'sample-window-state-custom-action', * customData: { * message: 'Clicked on custom Window State button' * } * } * }, * { // override tooltip and icon URL for standard Maximise button * type: BrowserButtonType.Maximise, * tooltip: overrideWindowStateIcons ? 'Studio Maximise' : undefined, * iconUrl: overrideWindowStateIcons ? 'https://www.openfin.co/favicon.ico' : undefined * }, * { * type: BrowserButtonType.Minimise * }, * { * type: BrowserButtonType.Close * } * ] * } * } * }; * const window = await workspacePlatform.Browser.createWindow(options); * ``` * * @param options the browser window creation options * @remarks * **View names are singleton**: It is not recommended to provide view names, but if they are provided, they can only be used by one view at a time. * * **Expected Behavior**: If a new view is created using the same view name as an already existing view, the new view will be created, with the view name, and the existing view will be destroyed. */ createWindow(options: BrowserCreateWindowRequest): Promise; /** * Get a unique title for a page. * * ```ts * import * as WorkspacePlatform from '@openfin/workspace-platform'; * * const workspacePlatform = WorkspacePlatform.getCurrentSync(); * const uniqueTitle = await workspacePlatform.Browser.getUniquePageTitle('myTitle'); * ``` * @param title a prefix for the title. */ getUniquePageTitle(title?: string): Promise; /** * Get the identity of the last focused Browser window. * * ```ts * import * as WorkspacePlatform from '@openfin/workspace-platform'; * * const workspacePlatform = WorkspacePlatform.getCurrentSync(); * const windowIdentity = await workspacePlatform.Browser.getLastFocusedWindow(); * ``` */ getLastFocusedWindow(): Promise; /** * Gets a page that contains a given view identity. * * @param viewIdentity the identity of the view to search for. */ getPageByViewIdentity(viewIdentity: OpenFin.Identity): Promise<{ page: AttachedPage; windowIdentity: OpenFin.Identity; pageIndex: number; }>; } /** * API for interacting with persistent storage. */ export interface WorkspacePlatformStorage { /** * Get all pages that are saved in persistent storage. * * ```ts * import * as WorkspacePlatform from '@openfin/workspace-platform'; * * const workspacePlatform = WorkspacePlatform.getCurrentSync(); * const pages = await workspacePlatform.Storage.getPages(); * ``` */ getPages(): Promise; /** * Get a specific page in persistent storage. * * ```ts * import * as WorkspacePlatform from '@openfin/workspace-platform'; * * const workspacePlatform = WorkspacePlatform.getCurrentSync(); * const myPage = await workspacePlatform.Storage.getPage('myPageId'); * ``` * @param id the id of the page to get. * * * @returns a page object or undefined if page doesn't exist. */ getPage(id: string): Promise; /** * Create a page in persistent storage. * * ```ts * import * as WorkspacePlatform from '@openfin/workspace-platform'; * * const workspacePlatform = WorkspacePlatform.getCurrentSync(); * const layout = { * content: [ * { * type: 'stack', * content: [ * { * type: 'component', * componentName: 'view', * componentState: { * name: 'myViewName', * url: 'http://google.com' * } * } * ] * } * ] * }; * const page = { * title: 'myPageTitle', * pageId: 'myPageId', * layout * }; * await workspacePlatform.Storage.createPage({page}); * ``` * @param page the page to create in persistent storage. */ createPage(page: CreateSavedPageRequest): Promise; /** * Update a page in persistent storage. * * ```ts * import * as WorkspacePlatform from '@openfin/workspace-platform'; * * const workspacePlatform = WorkspacePlatform.getCurrentSync(); * const layout = { * content: [ * { * type: 'stack', * content: [ * { * type: 'component', * componentName: 'view', * componentState: { * name: 'myViewName', * url: 'http://google.com' * } * } * ] * } * ] * }; * const page = { * title: 'myPageTitle', * pageId: 'myPageId', * layout * }; * const req = { * pageId: 'myPageId', * page * }; * await workspacePlatform.Storage.updatePage(req); * ``` * @param req the update saved page request. */ updatePage(req: UpdateSavedPageRequest): Promise; /** * Delete a page from persistent storage. * * ```ts * import * as WorkspacePlatform from '@openfin/workspace-platform'; * * const workspacePlatform = WorkspacePlatform.getCurrentSync(); * await workspacePlatform.Storage.deletePage('myPageId'); * ``` * @param id the id of the page to delete. */ deletePage(id: string): Promise; /** * Save a page in persistent storage. * * This is a helper function that will call `getPage` to determine if a page is already in storage. * If the page is already in storage, it will call `updatePage`. * If it does not exist in storage, the function will call `createPage` instead. * * ```ts * import * as WorkspacePlatform from '@openfin/workspace-platform'; * * const workspacePlatform = WorkspacePlatform.getCurrentSync(); * const layout = { * content: [ * { * type: 'stack', * content: [ * { * type: 'component', * componentName: 'view', * componentState: { * name: 'myViewName', * url: 'http://google.com' * } * } * ] * } * ] * }; * const page = { * title: 'myPageTitle', * pageId: 'myPageId', * layout * }; * await workspacePlatform.Storage.savePage(page); * ``` * @param page the page to save. */ savePage(page: Page): Promise; /** * Get all workspaces that are saved in persistent storage. * * ```ts * import * as WorkspacePlatform from '@openfin/workspace-platform'; * * const workspacePlatform = WorkspacePlatform.getCurrentSync(); * const workspaces = await workspacePlatform.Storage.getWorkspaces(); * ``` */ getWorkspaces(): Promise; /** * Get all workspaces metadata including the workspaceId and title that are saved in persistent storage. * * ```ts * import * as WorkspacePlatform from '@openfin/workspace-platform'; * * const workspacePlatform = WorkspacePlatform.getCurrentSync(); * const workspacesMetadata = await workspacePlatform.Storage.getWorkspacesMetadata(); * ``` */ getWorkspacesMetadata(): Promise[]>; /** * Get a specific workspace in persistent storage. * * ```ts * import * as WorkspacePlatform from '@openfin/workspace-platform'; * * const workspacePlatform = WorkspacePlatform.getCurrentSync(); * const myWorkspace = await workspacePlatform.Storage.getWorkspace('myWorkspaceId'); * ``` * @param id the id of the workspace to get. * * * @returns a workspace object or undefined if workspace doesn't exist. * */ getWorkspace(id: string): Promise; /** * Create a workspace in persistent storage. * * @param workspace the workspace to create in persistent storage. */ createWorkspace(workspace: CreateSavedWorkspaceRequest): Promise; /** * Update a workspace in persistent storage. * @param req the update saved workspace request. */ updateWorkspace(req: UpdateSavedWorkspaceRequest): Promise; /** * Delete a workspace from persistent storage. * * ```ts * import * as WorkspacePlatform from '@openfin/workspace-platform'; * * const workspacePlatform = WorkspacePlatform.getCurrentSync(); * await workspacePlatform.Storage.deleteWorkspace('myWorkspaceId'); * ``` * @param id the id of the workspace to delete. */ deleteWorkspace(id: string): Promise; /** * Save a workspace in persistent storage. * * This is a helper function that will call `getWorkspace` to determine if a workspace is already in storage. * If the workspace is already in storage, it will call `updateWorkspace`. * If it does not exist in storage, the function will call `createWorkspace` instead. * * @param workspace the workspace to save. */ saveWorkspace(workspace: Workspace): Promise; /** * Implementation for getting the dock provider from persistent storage. * * @param id The id of the dock provider to get. */ getDockProviderConfig(id: string): Promise; /** * Implementation for saving a dock provider config to persistent storage. * * @param config The new dock config to save to persistent storage. */ saveDockProviderConfig(config: DockProviderConfigWithIdentity): Promise; } /** * Request for launching an application. */ export interface LaunchAppRequest { target?: OpenFin.EntityInfo; app: App; } export interface ThemeApi { /** * @deprecated This method is deprecated. It is recommended to use {@link getGeneratedPalettes} instead. * Get the legacy themes from the platform provider. * @returns the legacy themes or null if the platform provider is using the new theme system. */ getThemes(): Promise; /** * Get the generated palettes from the platform provider. * @returns the generated palettes. */ getGeneratedPalettes(): Promise; /** * @internal * Get the theme palette sheet from the platform provider. * @returns the theme palette sheet. */ getThemePaletteSheet(): Promise; /** * Set the selected scheme for the platform provider. * @param newScheme the new scheme to set. */ setSelectedScheme(newScheme: ColorSchemeOptionType): Promise; /** * Get the selected scheme from the platform provider. * @returns the selected scheme. */ getSelectedScheme(): Promise; /** * @internal * Whether the active platform theme is a legacy theme defined with a single shared palette (light and dark are not independently specified). */ getIsLegacySinglePaletteTheme(): Promise; /** * @internal * Get the notification indicator colors from the platform provider. * @returns the notification indicator colors. */ getNotificationIndicatorColorsInternal(): Promise; /** * @internal * Build a legacy NotificationsThemeSet from the current generated palettes. * Used for backwards compatibility with older Notification Center versions * that do not support detailed theming. */ getLegacyNotificationsThemeInternal(): Promise; } /** * @internal * Legacy theme format expected by Notification Center <= 2.13. * Each scheme contains a styled-components DefaultTheme-compatible object * with optional embedded notification indicator colors. */ export interface LegacyNotificationsThemeSet { light: Record & { notificationIndicatorColors?: Record; }; dark: Record & { notificationIndicatorColors?: Record; }; } /** * Controller for a Workspace Platform. */ export interface WorkspacePlatformModule extends OpenFin.Platform { /** * Launch a browser snapshot that contains windows with pages. * * @param snapshot the browser snapshot to launch or a url or filepath to retrieve a JSON snapshot. * @param options options for launching the snapshot. */ applySnapshot(snapshot: BrowserSnapshot | string, options?: OpenFin.ApplySnapshotOptions): Promise; /** * Get a snapshot that contains browser windows with pages. */ getSnapshot(): Promise; /** * Preferred way of getting View options with Workspace Platform. * * @param viewIdentity * * @example * ``` * import * as WP from "@openfin/workspace-platform"; * * const platform = WP.getCurrentSync(); * const view = await platform.createView(options); * const viewOptions = await platform.getViewSnapshot(view.identity); * * console.log(viewOptions.workspacePlatform); * ``` */ getViewSnapshot(viewIdentity: OpenFin.Identity): Promise; /** * Use when you need to create a View into Browser window. In addition to what regular platfom `createView` offers, here you can specify `workspacePlatform` options for settings related to Workspace Platform. * * For general details about this method, see docs for `@openfin/core`. * * * @example * ``` * import * as WP from "@openfin/workspace-platform"; * * const platform = WP.getCurrentSync(); * * platform.createView({ * url: "https://url-to-your-app.com", * ..., * workspacePlatform: { * browserNavigationButtons: { * reload: false, * back: true, * forward: true * } * } * }); * ``` * @remarks * **View names are singleton**: It is not recommended to provide view names, but if they are provided, they can only be used by one view at a time. * * **Expected Behavior**: If a new view is created using the same view name as an already existing view, the new view will be created, with the view name, and the existing view will be destroyed. */ createView(viewOptions: Partial | BrowserCreateViewRequest, target?: OpenFin.CreateViewTarget, targetView?: OpenFin.Identity): Promise; /** * Invokes a custom action defined by platform provider * @internal */ _invokeCustomAction(actionId: string, payload: CustomActionPayload): Promise; /** * Requests the platform to create a dialog to ask user if they want to quit the platform. * @internal */ _requestQuitPlatformDialog(req: ShowQuitPlatformDialogRequest): Promise; /** * Shows a modal dialog to inform the user about a version update. * @internal */ _showUpdateVersionModal(req: ShowUpdateVersionModalRequest): Promise; /** * Shows the Apply and Publish modal (unsaved Supertab changes). * @internal */ _showApplyAndPublishModal(): Promise; /** * Launch an application. * * @deprecated This method is deprecated. It is recommended to use [createView](https://developers.openfin.co/of-docs/docs/platform-getting-started#add-a-view-to-an-existing-window) or [createWindow](https://developers.openfin.co/of-docs/docs/platform-getting-started#create-a-platform-window) instead. * * ```ts * import * as WorkspacePlatform from '@openfin/workspace-platform'; * * const workspacePlatform = WorkspacePlatform.getCurrentSync(); * const req = { * app: { * appId: 'myAppId', * title: 'appTitle', * manifest: 'http://localhost/app.json', * manifestType: AppManifestType.Manifest, * icons:[ * { * icon: "https://cdn.openfin.co/demos/notifications/generator/images/icon-blue.png", * src: "https://cdn.openfin.co/demos/notifications/generator/images/icon-blue.png", * type: "ico", * }, * ] * } * } * workspacePlatform.launchApp(req); * * ``` * @param req the launch app request. */ launchApp(req: LaunchAppRequest): Promise; /** * Gets a workspace data structure that represents the current state of the user's desktop. * @param options Options for getting the current workspace. */ getCurrentWorkspace(options?: GetCurrentWorkspaceOptions): Promise; /** * Sets the workspace as the current active workspace. Does not apply the workspace to the user's desktop. * @param workspace the workspace to set as current active workspace. */ setActiveWorkspace(workspace: Workspace): Promise; /** * Applies the given workspace to the user's desktop. Makes that workspace the active workspace. * * @param workspace the workspace to apply to the desktop and set as the current active workspace. * @param options see {@link ApplyWorkspaceOptions}. * * @returns true if the workspace was applied, false if the workspace was not applied. * * @example Brief example of how to apply a workspace, currently stored in storage, to the desktop. * * ```ts * const workspacePlatform = getCurrentSync(); * // This assumes that there is at least one workspace in storage. * const allWorkspaces = await workspacePlatform.Storage.getWorkspaces(); * * // Apply the first workspace in storage to the desktop. * await workspacePlatform.applyWorkspace(allWorkspaces[0], { * // Customize the behavior of the applyWorkspace call. * skipPrompt: false, * applySnapshotOptions: { * closeExistingWindows: false, * closeSnapshotWindows: false, * skipOutOfBoundsCheck: false, * }, * }); * ``` */ applyWorkspace(workspace: Workspace, options?: ApplyWorkspaceOptions): Promise; /** * Applies last saved version of current workspace. * @param options see {@link ApplyWorkspaceOptions}. * @returns String indicating the outcome of the API call, one of: 'success', 'not-saved-workspace', 'user-declined'. * See {@link RestoreLastSavedWorkspaceResult} for detailed description. */ restoreLastSavedWorkspace(options?: ApplyWorkspaceOptions): Promise; /** * Returns the ISO language code of the currently active language. * * @returns The active language code (e.g. `'en-US'`, `'es-ES'`). * * @example Example of how to get the current language on Browser * * ```ts * import * as WorkspacePlatform from '@openfin/workspace-platform'; * WorkspacePlatform.getCurrentSync().getLanguage(); * ``` */ getLanguage(): Promise; /** * Fetches currently selected language and language resources from platform provider. * @internal */ _getLanguageResources(): Promise<{ currentLanguage: Locale; resources: Resource; }>; /** * Returns platform capabilities for feature detection by workspace components. * @internal */ _getCapabilities(): Promise; /** * Sets the language to ISO language code passed in * @param locale the ISO language code * * @example Example of how to set a different language on Browser * * ```ts * import * as WorkspacePlatform from '@openfin/workspace-platform'; * WorkspacePlatform.getCurrentSync().setLanguage('zh-CN'); * ``` */ setLanguage(locale: Locale): Promise; /** * Implementation for getting the notifications workspace platform configuration. * @deprecated Notifications config is now part of the platform manifest and is automatically resolved by the notifications API. Do not use this method as it will not return the correct configuration. */ getNotificationsConfig(): Promise; /** * @internal */ _raiseAnalytics(events: AnalyticsEventInternal[]): Promise; /** * Triggers all browser windows to refresh bookmarks data * @internal */ _refreshBookmarksInternal(): Promise; /** * Launches a bookmark in the browser window. * @param payload * @internal */ _launchBookmarkInternal: (payload: LaunchBookmarkPayload) => Promise; /** * Updates companion dock favorites list. * @param favorites * @internal */ _updateDockFavoritesInternal: (favorites: DockEntry[]) => Promise; /** * Updates companion dock content menu. * @param contentMenu * @internal */ _updateContentMenuInternal: (contentMenu: ContentMenuEntry[]) => Promise; /** * Launches companion dock content menu item. * @param id * @internal */ _launchDockEntryInternal: (payload: LaunchDockEntryPayload) => Promise; /** * Sets companion dock favorites list order. * @internal */ _setDockFavoritesInternal: (favorites: DockEntry[]) => Promise; /** * Sets companion dock's default buttons list order. * @internal */ _setDefaultDockButtonsOrderInternal: (favorites: DockCompanionButton[]) => Promise; /** * Removes a favorite from the companion dock. * @param dock entry * @internal */ _removeDockFavoriteInternal: (entry: DockEntry) => Promise; /** * Adds a favorite to the companion dock. * @param dock entry * @internal */ _addDockFavoriteInternal: (entry: DockEntry) => Promise; /** * Navigates companion dock content menu to a specified folder. * @param id * @internal */ _navigateContentMenuInternal(id: string): Promise; /** * Retrieves companion dock workspaces dropdown context menu. * @internal */ _openDockWorkspacesContextMenuInternal(): Promise; /** * Handles companion dock workspaces dropdown context menu response. * @param payload * @internal */ _handleDockWorkspacesMenuResponseInternal(payload: any): Promise; /** * Retrieves companion dock content dropdown context menu. * @param collections * @internal */ _refreshDockCollectionMenuInternal(collections: Collection[]): Promise; /** * Launch companion dock collection * @param collection * @internal */ _launchCollectionInternal(collection: Collection): Promise; /** * * Finds a browser window with only a single tab on the landing page, brings it forward, and * focuses and expands its search menu. If such a browser window doesn't exist, it will create one. * @param payload * @internal */ _focusAndExpandSearchInternal(): Promise; /** Shows a popup window for HERE About page with provided data parameters * @internal */ _showAboutPagePopup(payload: AboutPageConfig): Promise; /** * The browser window factory for the Workspace Platform. */ Browser: BrowserWindowFactory; /** * The storage API for the Workspace Platform. */ Storage: WorkspacePlatformStorage; /** * Theme API for the Workspace Platform. */ Theme: ThemeApi; } export interface WorkspacePlatformProvider extends OpenFin.PlatformProvider { /** * Implementation for getting a list of saved pages from persistent storage. * @param query an optional query. */ getSavedPages(query?: string): Promise; /** * Implementation for getting a single page in persistent storage. * @param id * * @returns a page object or undefined if page doesn't exist. */ getSavedPage(id: string): Promise; /** * Implementation for creating a saved page in persistent storage. * @param req the create saved page request. */ createSavedPage(req: CreateSavedPageRequest): Promise; /** * Implementation for updating a saved page in persistent storage. * @param req the update saved page request. */ updateSavedPage(req: UpdateSavedPageRequest): Promise; /** * Implementation for deleting a saved page in persistent storage. * @param id of the id of the page to delete. */ deleteSavedPage(id: string): Promise; /** * Implementation for detecting if a page change qualifies as putting the page in an unsaved state. * @param payload the page with new changes and the identity of the OF window where the page change occured. */ handlePageChanges(payload: HandlePageChangesPayload): Promise; /** * Implementation for getting a list of saved workspaces from persistent storage. * @param query an optional query. */ getSavedWorkspaces(query?: string): Promise; /** * Implementation for getting a list of saved workspaces metadata from persistent storage. * @param query an optional query. */ getSavedWorkspacesMetadata(query?: string): Promise[]>; /** * Implementation for getting a single workspace in persistent storage. * @param id * * * @returns a workspace object or undefined if workspace doesn't exist. */ getSavedWorkspace(id: string): Promise; /** * Implementation for creating a saved workspace in persistent storage. * @param req the create saved workspace request. */ createSavedWorkspace(req: CreateSavedWorkspaceRequest): Promise; /** * Implementation for updating a saved workspace in persistent storage. * @param req the update saved workspace request. */ updateSavedWorkspace(req: UpdateSavedWorkspaceRequest): Promise; /** * Implementation for getting the dock provider from persistent storage. * * @param id The id of the dock provider to get. */ getDockProviderConfig(id: string): Promise; /** * Implementation for saving a dock provider config to persistent storage. * * @param config The new dock config to save to persistent storage. */ saveDockProviderConfig(config: DockProviderConfigWithIdentity): Promise; /** * Implementation for deleting a saved workspace in persistent storage. * @param id of the id of the workspace to delete. */ deleteSavedWorkspace(id: string): Promise; /** * Applies a workspace to the user's desktop. Makes that workspace the active workspace. * @param payload {@link ApplyWorkspacePayload} * * @returns true if the workspace was applied, false if the workspace was not applied. */ applyWorkspace(payload: ApplyWorkspacePayload): Promise; /** * Applies a workspace to the user's desktop. Makes that workspace the active workspace. * @param payload {@link RestoreLastSavedWorkspacePayload} * @internal * * @returns String indicating the outcome of the API call, one of: 'success', 'not-saved-workspace', 'user-declined'. */ restoreLastSavedWorkspaceInternal(payload: RestoreLastSavedWorkspacePayload): Promise; /** * Implementation for showing a global context menu given a menu template, * handler callback, and screen coordinates. For an example of overriding, see {@link WorkspacePlatformOverrideCallback}. * @param req the payload received by the provider call * @param callerIdentity OF identity of the entity from which the request originated */ openGlobalContextMenu(req: OpenGlobalContextMenuPayload, callerIdentity: OpenFin.Identity): Promise; /** * Implementation for showing a view tab context menu given a menu template, * handler callback, and screen coordinates. For an example of overriding, see {@link WorkspacePlatformOverrideCallback}. * @param req the payload received by the provider call * @param callerIdentity OF identity of the entity from which the request originated */ openViewTabContextMenu(req: OpenViewTabContextMenuPayload, callerIdentity: OpenFin.Identity): Promise; /** * Implementation for showing a page tab context menu given a menu template, * handler callback, and screen coordinates. For an example of overriding, see {@link WorkspacePlatformOverrideCallback}. * @param req the payload received by the provider call * @param callerIdentity OF identity of the entity from which the request originated */ openPageTabContextMenu(req: OpenPageTabContextMenuPayload, callerIdentity: OpenFin.Identity): Promise; /** * Implementation for showing a context menu for save button given a menu template, * handler callback, and screen coordinates. For an example of overriding, see {@link WorkspacePlatformOverrideCallback}. * @param req the payload received by the provider call * @param callerIdentity OF identity of the entity from which the request originated */ openSaveButtonContextMenu(req: OpenSaveButtonContextMenuPayload, callerIdentity: OpenFin.Identity): Promise; /** * Implementation for getting selected {@link CustomThemes theme} scheme. */ getSelectedScheme(): ColorSchemeOptionType | null | undefined; /** * Implementation for setting selected {@link CustomThemes theme} scheme. * @param schemeType {@link ColorSchemeOptionType scheme} to be set */ setSelectedScheme(schemeType: ColorSchemeOptionType): Promise; /** * @internal * Whether the active platform theme is a legacy single-palette theme (Appearance scheme switching is not supported). */ getIsLegacySinglePaletteTheme(): boolean; /** * Implementation for handling Workspace analytics events * @param req the payload received by the provider */ handleAnalytics(req: AnalyticsEvent[]): Promise; /** * Override when you need to add custom functionality when creating a view. * * @param payload creatin options for the new view * @param callerIdentity identity of the entity that called {@link WorkspacePlatformModule.createView} */ createView(payload: BrowserCreateViewPayload, callerIdentity: OpenFin.Identity): Promise; /** * Implementation for deciding whether a modal informing about loss of unsaved changes will be displayed when closing a page. * The default implementation returns `{ shouldShowModal: true }` if the page has unsaved changes (`hasUnsavedChanges` page property) * and `false` otherwise. */ handleSaveModalOnPageClose(payload: HandleSaveModalOnPageClosePayload): Promise; /** * This override is called upon closing of the page by user or for each page in a window that is being closed by user. * * In case of closing a page individually, the close operation will be aborted if a False value is returned. * * In case of closing a window, the return value will be used to form payload of handlePagesAndWindowClose override, which determines whether the window should proceed with closing. * * Default behavior: if beforeunload is disabled for the platform, True is always returned. * If enableBeforeUnload is set to true and getUserDecisionForBeforeUnload override is configured to respect beforeunload decisions of views, * then True is only returned if no views are preventing unload. */ shouldPageClose(payload: ShouldPageClosePayload): Promise; /** * This override is called upon closing of a window by user and its return value determines whether the window should proceed closing. * pagesPreventingClose and pagesNotPreventingClose represent pages in the window, grouped based on the value returned by shouldPageClose override for each page. * Default implementation will abort closing of the window if any of the pages within it are prevented from closing. * @param payload Contains pages that were prevented from closing, pages that weren't, and identity of the window * @returns `Promise<{shouldWindowClose: boolean}>` which determines whether closing of the window will proceed */ handlePagesAndWindowClose(payload: HandlePagesAndWindowClosePayload): Promise; /** * Handle the decision of whether a Window, Page or specific View should close when trying to prevent an unload. This is meant to be overridden. * Called in {@link WorkspacePlatformProvider.closeWindow} and {@link WorkspacePlatformProvider.closeView}. * * When closing a Page, this override is called by {@link WorkspacePlatformProvider.shouldPageClose} * and page proceeds to close if all views passed in are determined to close. In this case, the `closeType` property will have `'page'` value. * * Normally you would use this method to show a dialog indicating that there are Views that are trying to prevent an unload. * By default it will always return all Views passed into it as meaning to close. * @param payload * @example * * ```js * const overrideCallback = (PlatformProvider) => { * class Override extends PlatformProvider { * async getUserDecisionForBeforeUnload(payload, callerIdentity) { * const { windowShouldClose, viewsPreventingUnload, viewsNotPreventingUnload, windowId, closeType } = payload; * * // launch dialog and wait for user response * const continueWithClose = await showDialog(viewsPreventingUnload, windowId, closeType); * * if (continueWithClose) { * return { windowShouldClose, viewsToClose: [...viewsNotPreventingUnload, ...viewsPreventingUnload] }; * } else { * return { windowShouldClose: false, viewsToClose: [] }; * } * } * } * return new Override(); * } * * fin.Platform.init({ overrideCallback }); * * async function showDialog(viewsPreventingUnload, windowId, closeType) { * // Show a dialog and await for user response * } * ``` * */ getUserDecisionForBeforeUnload(payload: ViewsPreventingUnloadPayload): Promise; /** * Implementation for setting the active page in a browser window. * Called when the active page is changed and on browser window creation. */ setActivePage(payload: SetActivePageForWindowPayload): Promise; /** * Implementation for creating a copy of a page. Called when a page is Saved-As or Duplicated. * * Note: The `page.layout` and `page.panels` property cannot be overridden for 'Save As' operations, * the `page.layout` and `page.panels` property provided in the return value will be ignored, and the layout and panels of * the original page will remain after 'Save As' is performed. */ copyPage(payload: CopyPagePayload): Promise; /** * Implementation for getting current selected language * @returns language in ISO language code */ getLanguage(): Promise; /** * Implementation for setting a language * @param locale in ISO language code format */ setLanguage(locale: Locale): Promise; /** * Implementation for adding custom default page * @param payload {@link AddDefaultPagePayload} */ addDefaultPage(payload: AddDefaultPagePayload): Promise; getPageByViewIdentity(viewIdentity: OpenFin.Identity): Promise>>; /** @internal */ restoreRemovedTabInternal(): Promise; /** @internal */ trackVisitedSiteInternal(site: Site): Promise; /** @internal */ getRecentVisitedSitesInternal(siteCount?: number): Promise; /** @internal */ getFrequentlyVisitedSitesInternal(): Promise; /** @internal */ searchSitesInternal(payload: { req: SearchSitesRequest; } & { identity: OpenFin.Identity; }): Promise; /** @internal */ handleRequestNavigationInternal(req: NavigationRequest): Promise; /** @internal */ refreshBookmarksInternal(): Promise; /** @internal */ launchBookmarkInternal(payload: LaunchBookmarkPayload): Promise; /** @internal */ updateDockFavoritesInternal(favorites: DockEntry[]): Promise; /** @internal */ updateContentMenuInternal(contentMenu: ContentMenuEntry[]): Promise; /** @internal */ launchDockEntryInternal(payload: LaunchDockEntryPayload): Promise; /** @internal */ setDefaultDockButtonsOrderInternal(workspaceButtons: DockCompanionButton[]): Promise; /** @internal */ setDockFavoritesOrderInternal(favorites: DockEntry[]): Promise; /** @internal */ navigateContentMenuInternal(id: string): Promise; /** @internal */ getDockWorkspacesContextMenuInternal(): Promise; /** @internal */ handleDockWorkspacesMenuResponseInternal(payload: any): Promise; /** @internal */ refreshDockCollectionMenuInternal(collections: Collection[]): Promise; /** @internal */ launchCollectionInternal(collection: Collection): Promise; /** @internal */ focusAndExpandSearchInternal(): Promise; /** @internal */ sendUpdateVersionModalResponseInternal(payload: SendUpdateVersionModalResponsePayload): Promise; } /** * The origins from which a custom action can be invoked */ export declare enum CustomActionCallerType { CustomButton = "CustomButton", StoreCustomButton = "StoreCustomButton", CustomDropdownItem = "CustomDropdownItem", GlobalContextMenu = "GlobalContextMenu", ViewTabControl = "ViewTabControl", ViewTabContextMenu = "ViewTabContextMenu", PageTabContextMenu = "PageTabContextMenu", SaveButtonContextMenu = "SaveButtonContextMenu", API = "API" } /**The payload received by a Custom Action. * The `callerType` property can be used to determine what data is available in the payload and cast accordingly. * When `callerType == CustomActionCallerType.API`, the payload is defined by the code directly invoking the action.*/ export type CustomActionPayload = { callerType: CustomActionCallerType.API; } | CustomButtonActionPayload | StoreCustomButtonActionPayload | CustomDropdownItemActionPayload | GlobalContextMenuOptionActionPayload | ViewTabControlActionPayload | ViewTabCustomActionPayload | PageTabContextMenuOptionActionPayload | OpenSaveContextMenuOptionActionPayload; /** * Payload received by invokeCustomActionInternal platform provider method * @internal */ export interface InvokeCustomActionRequest { actionId: string; payload: CustomActionPayload; } /** * Payload received by showQuitPlatformDialog platform provider method * @internal */ export interface ShowQuitPlatformDialogRequest { /** An optional custom title for the dialog. */ title?: string; /** Should the dialog be centered on the monitor instead of on top of the platform window */ shouldCenterOnMonitor?: boolean; } export interface GetCurrentWorkspaceOptions { skipSnapshotUpdate?: boolean; } /** * Options for the {@link WorkspacePlatformModule.applyWorkspace applyWorkspace} method. * */ export interface ApplyWorkspaceOptions { /** * If true, the workspace will be applied without prompting the user to confirm. * If false, the user will be prompted to confirm the workspace application. * @default false */ skipPrompt?: boolean; /** * The window to use as the parent for the workspace switch confirmation dialog. */ promptContainerWindowIdentity?: OpenFin.Identity; /** * Options to apply the workspace snapshot with. */ applySnapshotOptions?: ApplySnapshotOptions; /** Should the dialog modal be centered on the monitor instead of on top of the platform window */ shouldCenterModalOnMonitor?: boolean; } /** * Options used within the {@link WorkspacePlatformModule.applyWorkspace applyWorkspace} method. * * @inheritDoc OpenFin.ApplySnapshotOptions */ export interface ApplySnapshotOptions extends OpenFin.ApplySnapshotOptions { /** * When true, applyWorkspace will close all existing windows, * replacing current Platform state with the given snapshot. * * @default true */ closeExistingWindows?: boolean; } /** * Payload received by applyWorkspace platform provider method */ export type ApplyWorkspacePayload = Workspace & { options?: ApplyWorkspaceOptions; }; /** * Payload received by restoreLastSavedWorkspaceInternal platform provider method * @internal */ export type RestoreLastSavedWorkspacePayload = ApplyWorkspaceOptions; /** * Variants of results returned by restoreLastSavedWorkspace method. * * 'success' - workspace was successfully applied * * 'not-saved-workspace' - currently active workspace has never been saved, hence no changes were applied * * 'user-declined' - confirmation modal was shown and user declined to apply last saved workspace (only relevant when skipPrompt==false) */ export type RestoreLastSavedWorkspaceResult = 'success' | 'not-saved-workspace' | 'user-declined'; /** * Defines custom action map where the key is the custom action ID and value is the action handler */ export interface CustomActionsMap { [actionId: string]: (payload: CustomActionPayload) => any; } /** * Configuration object of the Workspace Platform's Analytics Config. */ export interface AnalyticsConfig { /** * Enable sending of Analytics data to OpenFin * * @default false * * @remarks OpenFin workspace utilizes a [HTML iframe](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe) in order to send analytics data to OpenFin. In order to facilitate this, and allow for the use of `fin` APIs within the iframe, you must enable injection of the OpenFin API into cross-origin iframes. This can be configured within the [manifest](https://developers.openfin.co/of-docs/docs/application-configuration) like so: * ```json * { * "platform": { * "api": { * "iframe": { * "crossOriginInjection": true * } * }, * // The rest of the manifest configuration is omitted for brevity * } * } * ``` */ sendToOpenFin: boolean; } /** * The built-in language codes supported by the Workspace Platform out of the box. * * @deprecated No longer used for language validation. The platform now accepts any language * code that has a resource bundle registered in i18next, including codes defined in an * external `translation-override.json`. This export will be removed in a future major version. */ export declare const SUPPORTED_LANGUAGES: string[]; /** * An ISO language code accepted by the Workspace Platform. * * **Built-in languages** (supported out of the box): * - `en-US` — English (default) * - `de-DE` — German * - `ja-JP` — Japanese * - `ko-KR` — Korean * - `ru-RU` — Russian * - `zh-CN` — Chinese (Simplified) * - `zh-Hant` — Chinese (Traditional) * * **Adding custom languages** via `translationOverridesUrl`: * * Supply a `translationOverridesUrl` in your Desktop Owner Settings (DOS) or application manifest * pointing to a `translation-override.json` file. Any language code defined in that file will be * accepted at runtime in addition to the built-in list above. * * Example `translation-override.json`: * ```json * { * "x.x.x": { * "es-ES": { * "global.save": "Guardar", * "contextMenu.newWindow": "Nueva ventana" * } * } * } * ``` * * The `translationOverridesUrl` can be configured in two ways: * * _Via Desktop Owner Settings_ (`dos.json` on macOS, registry on Windows): * ```json * { * "desktopSettings": { * "systemApps": { * "workspace": { * "customConfig": { * "translationOverridesUrl": "https://example.com/translation-override.json" * } * } * } * } * } * ``` * * _Via the application manifest_ (under `platform.workspace`): * ```json * { * "platform": { * "workspace": { * "translationOverridesUrl": "https://example.com/translation-override.json" * } * } * } * ``` */ export type Locale = string; /** * Configures the workspace to self-host using an asar bundle at the * specified path. * * @remarks Intended as a development tool - in production, * use {@link WorkspaceAsarAssetConfig}. */ export type WorkspaceAsarPathConfig = { /** * Path of the asar bundle with which to self-host. */ path: string; }; /** * Configures the workspace to self-host using the specified asar bundle * app asset. */ export type WorkspaceAsarAssetConfig = { /** * App asset alias of the asar bundle with which to self-host. */ alias: string; }; /** * Configuration for initializing a Workspace platform. */ export interface WorkspacePlatformInitConfig { customActions?: CustomActionsMap; /** * Config for overriding browser options and behavior. * Set to null to initialize the platform without the browser */ browser?: BrowserInitConfig | null; /** * Customize the Looks and Feel of the Workspace Platform by providing a custom palette. * * The `backgroundPrimary` color **must** be either a hex, rgb, rgba, hsl, or hsla value. * * Two palettes are provided by default: `light` and `dark`. * The `dark` palette is used by default. * * @example * * ```ts * import * as WorkspacePlatform from '@openfin/workspace-platform'; * * // This is the palette used to create the OpenFin dark theme * const customPalette: WorkspacePlatform.CustomPaletteSet = { * brandPrimary: '#504CFF', * brandSecondary: '#383A40', * backgroundPrimary: '#000', * background1: '#111214', * background2: '#1E1F23', * background3: '#24262B', * background4: '#2F3136', * background5: '#383A40', * background6: '#53565F', * statusSuccess: '#35C759', * statusWarning: '#C93400', * statusCritical: '#000', * statusActive: '#0879C4', * inputBackground: '#53565F', * inputColor: '#FFFFFF', * inputPlaceholder: '#C9CBD2', * inputDisabled: '#7D808A', * inputFocused: '#C9CBD2', * textDefault: '#FFFFFF', * textHelp: '#C9CBD2', * textInactive: '#7D808A', * }; * * const customTheme: WorkspacePlatform.CustomThemes = [{ * label: "My Custom Theme", * palette: customPalette * }]; * * await WorkspacePlatform.init({ * browser: { * title: "My Browser" * }, * theme: customThemes, * overrideCallback * }); * ``` */ theme?: CustomThemes; /** * Set the initial language for the Browser. * * The built-in ISO language codes are `'en-US'`, `'ja-JP'`, `'zh-CN'`, `'ko-KR'`, * `'ru-RU'`, `'de-DE'`, and `'zh-Hant'`. Any additional language code defined in an * external `translation-override.json` (configured via `translationOverridesUrl`) is * also accepted. * * When `languagePacksApiUrl` is set, i18next loads packs over HTTP from that * i18next-http-backend `loadPath` (e.g. `${origin}/platform/api/localization/{{lng}}/{{ns}}.json`) * instead of the bundled locale JSON. Omit it to keep the built-in packs. * * @example * ```ts * await WorkspacePlatform.init({ * browser: { * title: "My Browser" * }, * language: { * initialLanguage: 'ru-RU' * } * }); * ``` * @default 'en-US' * */ language?: { initialLanguage?: Locale; /** * i18next-http-backend loadPath. When provided, HTTP language packs are used * even if the manifest did not inject `languagePacksApiUrl`. */ languagePacksApiUrl?: string; }; /** * Override workspace platform behavior */ overrideCallback?: WorkspacePlatformOverrideCallback | OpenFin.ConstructorOverride[]; /** * Override workspace platform interop behavior * https://developer.openfin.co/docs/javascript/stable/classes/OpenFin.InteropBroker.html */ interopOverride?: OpenFin.OverrideCallback | OpenFin.ConstructorOverride[]; /** * Config for Workspace Platform analytics */ analytics?: AnalyticsConfig; /** * Config for Workspace Platform Integrations * * @example * ```ts * import * as WorkspacePlatform from '@openfin/workspace-platform'; * import { Integrations } from '@openfin/workspace'; * * const microsoftIntegration = new Integrations.Microsoft365WorkflowIntegration({ * connect: { * clientId: '', * redirectUri: '', * tenantId: '' * } * }); * * await WorkspacePlatform.init({ * browser: { }, * integrations: [microsoftIntegration] * }); * ``` */ integrations?: WorkflowIntegration[]; /** * Config for overriding default notifications behaviour. * Leave undefined to use OpenFin hosted Notification Center. * @deprecated Notifications config is now part of the platform manifest and is automatically resolved by the notifications API. Do not use this property as it will not have any effect. */ notifications?: NotificationsCustomManifestOptions; /** * Configuration for self-hosting of workspace assets. */ workspaceAsar?: WorkspaceAsarAssetConfig | WorkspaceAsarPathConfig; } /** * Extend or replace default functionality in order to customize behavior of a Workspace Platform Provider. * * To implement your own handlers for Workspace Platform behavior, extend the provided class and override any methods you'd like to alter. * * ```ts * import * as WorkspacePlatform from '@openfin/workspace-platform'; * import { UpdateSavedPageRequest } from '../../client-api-platform/src/shapes'; * * const overrideCallback: WorkspacePlatform.WorkspacePlatformOverrideCallback = async ( * WorkspacePlatformProvider * ) => { * class Override extends WorkspacePlatformProvider { * // Override the default behavior of updateSavedPage * updateSavedPage = async (req: UpdateSavedPageRequest): Promise => { * console.log(`saving page ${req.page.pageId}`); * // calling custom function to the save page here * }; * * // add a custom menu item in Global Context Menu * openGlobalContextMenu(req: WorkspacePlatform.OpenGlobalContextMenuPayload, callerIdentity: any) { * return super.openGlobalContextMenu( * { * ...req, * template: [ * ...req.template, * { * label: 'Sample custom global option', * data: { * type: GlobalContextMenuOptionType.Custom, * action: { * // This action needs to be registered in customActions property in the call WorkspacePlatform.init * id: 'sample-custom-global-menu-action' * } * } * } * ] * }, * callerIdentity * ); * } * * // add a custom menu item in View Tab Context Menu * openViewTabContextMenu = async (payload: OpenViewTabContextMenuPayload, callerIdentity) => { * const viewsInfo = await Promise.all(payload.selectedViews.map(async (v) => fin.View.wrapSync(v).getInfo())); * * const enableBack = viewsInfo.every((viewInfo) => viewInfo.canNavigateBack === true); * const enableForward = viewsInfo.every((viewInfo) => viewInfo.canNavigateForward === true); * * return super.openViewTabContextMenu({ * ...payload, * template: [ * { * label: 'Sample View Tab Context Menu', * data: { * type: ViewTabMenuOptionType.Custom, * action: { * // This action needs to be registered in customActions property in the call WorkspacePlatform.init * id: 'sample-viewtab-action', * customData: 'Custom View Tab Action' * } * } * }, * { * type: 'normal', * label: 'Back', * data: { * type: ViewTabMenuOptionType.Back * }, * enabled: enableBack * }, * { * type: 'normal', * label: 'Forward', * data: { * type: ViewTabMenuOptionType.Forward * }, * enabled: enableForward * }, * ...payload.template * ] * }, callerIdentity); * }; * * // add a custom menu item in Save Context Menu * openSaveButtonContextMenu = (req: WorkspacePlatform.OpenSaveButtonContextMenuPayload, callerIdentity: OpenFin.Identity) => { * return super.openSaveButtonContextMenu( * { * ...req, * template: [ * ...req.template, * { * label: 'Save custom option', * data: { * type: SaveButtonContextMenuOptionType.Custom, * action: { * id: 'sample-custom-action-name', * customData: { * someProp: 'Save Button task' * } * } * } * } * ] * }, * callerIdentity * ); * } * } * return new Override(); * }; * * await WorkspacePlatform.init({ * browser: { * title: "My Workspace Platform" * } * overrideCallback, * customActions: { * 'sample-custom-global-menu-action': (payload: CustomActionPayload) => { * alert('This custom action works ' + JSON.stringify(payload)); * return 'someresponse'; * }, * 'sample-viewtab-action': (payload: ViewTabCustomActionPayload) => { * alert('This custom action works ' + JSON.stringify(payload)); * return 'someresponse'; * } * } * }); * ``` */ export type WorkspacePlatformOverrideCallback = OpenFin.OverrideCallback; /** * @deprecated */ export type BrowserOverrideCallback = WorkspacePlatformOverrideCallback; /** * Content menu entry shape cloned and re-exported from UI Library. */ export type ContentMenuEntry = { bookmarked?: boolean; } & ({ type: 'folder'; id: string; label: string; children: ContentMenuEntry[]; } | { type: 'item'; id: string; icon: string | { dark: string; light: string; }; label: string; itemData: any; }); export type LaunchDockEntryPayload = { entry: DockEntry; sourceEvent?: Pick; }; export type BookmarkDockEntryPayload = { entry: DockEntry; }; /** * Represents dock entry for favorites */ export type DockEntry = { type: 'folder'; id: string; label: string; icon?: string | { dark: string; light: string; }; } | { type: 'item'; id: string; icon: string | { dark: string; light: string; }; label: string; itemData?: any; }; /** * Configuration for the right side ai panel. * @internal */ export interface AiPanelOptions { enabled: boolean; url?: string; } /** * Configuration options for Browser window's icons. */ export type IconSize = 'large' | 'default'; /** * Configuration for initializing a Browser. */ export interface BrowserInitConfig { /** * Default options for creating a new Browser window. These options are not applied on any non-Browser windows that get created. These default options will take precedence over * defaultWindowOptions included in the manifest. Any option not included in WorkspacePlatform.getCurrentSync().Browser.createWindow(options) call will default to the value provided in this field. */ defaultWindowOptions?: Partial; /** Default options when creating a new page. If `iconUrl`, `unsavedIconUrl`, `panels` or `closeButton` are not defined when creating a page, setting will default to `defaultPageOptions`. */ defaultPageOptions?: Pick; /** * The default options when creating a new view. Any option not included in WorkspacePlatform.getCurrentSync().Browser.createView(options) call will default to the value provided in this field. * * @example * ```ts * import * as WorkspacePlatform from '@openfin/workspace-platform'; * * await WorkspacePlatform.init({ * browser: { * defaultViewOptions: { * workspacePlatform: { * browserNavigationButtons: { * back: true, * forward: true, * reload: true * } * } * } * } * }); * ``` */ defaultViewOptions?: Partial; /** * The platform title. UI friendly title for the platform in browser. */ title?: string; /** * By default, the icons in the browser are displayed at the default size. If you * want to display the icons at a larger size, set this property to 'large'. This * will increase the size of the icons in the browser. If you have custom icons * that are PNGs you will need to update these assets for best results. */ browserIconSize?: IconSize; /** * Default accessibility options that will be applied to all browser windows. * These options can be overridden at the window creation level via workspacePlatform.accessibilityOptions. * * @example * ```ts * import * as WorkspacePlatform from '@openfin/workspace-platform'; * * await WorkspacePlatform.init({ * browser: { * title: "My Browser", * accessibilityOptions: { * viewTabOptions: { * arrowNavigation: ["inactive-tab", "active-tab"], * tabNavigation: ["active-tab"] * } * } * } * }); * ``` */ accessibilityOptions?: AccessibilityOptions; /** * Override workspace platform behavior * * @deprecated Please use the `overrideCallback` property of {@link WorkspacePlatformInitConfig} */ overrideCallback?: BrowserOverrideCallback; /** * @deprecated * Override workspace platform interop behavior * * https://developer.openfin.co/docs/javascript/stable/classes/OpenFin.InteropBroker.html */ interopOverride?: OpenFin.OverrideCallback; /** * @internal */ browserBaseUrl?: string; /** * @internal */ aiPanelOptions?: AiPanelOptions; /** * When true, allows multiple pages to share the same title across browser * windows. No numeric suffixes are appended and attach/add operations * will not reject on title collision. `pageId` remains the unique * identifier for all page operations. * * Defaults to `false` (current unique-title behavior preserved). */ allowDuplicatePageTitles?: boolean; /** * Opt-in suppression flags for workspace success indicators. * Both flags default to `false`; existing platforms see no behaviour change. * * @example * ```ts * await WorkspacePlatform.init({ * browser: { * indicators: { * suppressWorkspaceSwitched: true, * suppressWorkspaceSaved: true, * }, * }, * }); * ``` */ indicators?: WorkspaceIndicatorConfig; } interface WorkspaceMetadata { APIVersion: string; } export interface Workspace { workspaceId: string; /** While not required, it is suggested that Workspace titles be unique. */ title: string; metadata?: WorkspaceMetadata; snapshot: BrowserSnapshot; } export interface Collection { collectionId: string; title: string; } /** * Request for creating a saved workspace in persistent storage. */ export interface CreateSavedWorkspaceRequest { /** The workspace to create. */ workspace: Workspace; } /** * Request for updating a saved workspace in persistent storage. */ export interface UpdateSavedWorkspaceRequest { /** The ID of the workspace to update. */ workspaceId: string; /** The updated workspace. */ workspace: Workspace; } /** * @internal */ export declare enum SaveModalType { SAVE_PAGE = "SAVE_PAGE", SAVE_WORKSPACE = "SAVE_WORKSPACE", SAVE_PAGE_AS = "SAVE_PAGE_AS", SAVE_WORKSPACE_AS = "SAVE_WORKSPACE_AS", RENAME_PAGE = "RENAME_PAGE", RENAME_WORKSPACE = "RENAME_WORKSPACE" } export type OpenSaveWorkspaceMenuRequest = { menuType: SaveModalType.SAVE_WORKSPACE | SaveModalType.SAVE_WORKSPACE_AS | SaveModalType.RENAME_WORKSPACE; id?: never; }; /** * Request to create a save modal. * @private */ export type OpenSaveMenuRequest = { menuType: SaveModalType.SAVE_PAGE | SaveModalType.SAVE_PAGE_AS | SaveModalType.RENAME_PAGE; id: string; } | OpenSaveWorkspaceMenuRequest; export type TaskbarIcon = { dark: string; light: string; }; /** * Launch bookmark request payload */ export interface LaunchBookmarkPayload { bookmark: BookmarkNode; sourceIdentity: OpenFin.Identity; sourceEvent: Pick; } export type SearchProviderFilter = { id: string; title: string; icon?: { light: string; dark: string; }; }; /** * Enterprise: Shape of provider for Search Tabs. * @internal */ export interface SearchProvider { id: string; title: string; isTab?: boolean; icon?: string; supportsQueryless?: boolean; supportsPaging?: boolean; filters?: SearchProviderFilter[]; } /** * @internal */ export interface SendUpdateVersionModalResponsePayload { identity: OpenFin.Identity; response: ModalResponseEvent['data']; } /** * Payload for showing the update version modal * @internal */ export interface ShowUpdateVersionModalRequest { /** The title for the update version modal */ title: string; /** The description text for the update version modal */ description: string; } /** * Payload for showing the About page modal * @internal */ export type AboutPageConfig = { logoUrl: string; productTitle: string; productVersion: string; email: string; websiteUrl: string; hereVersion: string; rvmVersion: string; copyrightMessage?: string; }; /** * FDC3 2.0 Context object -> https://fdc3.finos.org/docs/context/spec * @internal */ export interface FDC3Context { type: string; name?: string; id?: Record; [key: string]: any; } /** * Application instance information for intent resolution -> https://fdc3.finos.org/docs/api/ref/Types * @internal */ export interface AppInstance { /** Unique identifier for this instance */ instanceId: string; /** Display name for this instance */ instanceName: string; /** Whether this is a new instance that would be created */ isNewInstance?: boolean; /** Icon URL for the instance */ icon?: string; } /** * Application metadata for intent resolution * @internal */ export interface IntentResolverApp { /** Application identifier */ appId: string; /** Display name of the application */ name: string; /** Optional tooltip or description */ tooltip?: string; /** Icon URL for the application */ icon?: string; /** Available instances of this application */ instances?: AppInstance[]; } /** * Intent information for resolution * @internal */ export interface IntentResolverIntent { /** Intent name -> ViewContact, StartCall */ name: string; /** Display name for the intent -> View Contact, Start a Call, Start a Chat */ displayName: string; /** Apps associated with the intent */ apps: IntentResolverApp[]; } /** * Response from the intents resolver modal * @internal */ export type IntentResolverResponse = { /** Returned when user selects desired intent destination and presses Open */ type: 'open'; data: { /** Selected application ID */ appId?: string; /** Selected instance ID */ instanceId?: string; /** Selected intent name */ intentName?: string; /** Whether user chose to remember this selection */ rememberSelection?: boolean; /** Whether user cancelled the selection */ cancelled?: boolean; }; } | { /** Returned when user cancels the modal or modal timeout */ type: 'cancel'; } | { /** Returned when there are no open browser windows */ type: 'no-target-available'; } | { type: 'error'; error: Error; modalIdentity: OpenFin.Identity; }; type BaseShowIntentsResolverModalRequest = { /** The title for the intents resolver modal */ title: string; /** The context data being passed */ context?: FDC3Context; /** Timeout in milliseconds for user interaction (default: 45000) */ timeoutMs?: number; /** Pre-selected values */ preselected?: { appId?: string; intentName?: string; instanceId?: string; }; }; type RaiseIntentResolverModalRequest = BaseShowIntentsResolverModalRequest & { /** Available applications that can handle the intent */ apps: IntentResolverApp[]; }; type RaiseIntentForContextResolverModalRequest = BaseShowIntentsResolverModalRequest & { /** Available intents (if multiple intents are possible) */ intents: IntentResolverIntent[]; }; /** * Payload for showing the intents resolver modal * @internal */ export type ShowIntentsResolverModalRequest = RaiseIntentResolverModalRequest | RaiseIntentForContextResolverModalRequest; export type ShowIntentsResolverModalRequestInternal = ShowIntentsResolverModalRequest & { identity: OpenFin.Identity; };