import type OpenFin from '@openfin/core'; import { UserMenuParams } from '../../../common/src/utils/menu'; import { OptionalExceptFor } from '../../../common/src/utils/types'; import { AnchorBehavior } from '../../../client-api-platform/src/api/context-menu'; import { Site, SiteAction } from '../../../client-api-platform/src/shapes'; export type ViewMoreButton = { type: 'view-more-result'; id: string; providerId: string; }; export type SelectableResult = Site | ViewMoreButton; export declare enum SaveMenuType { Save = "Save", SaveAs = "SaveAs" } type SearchViewExpansionState = { method?: 'click' | 'keystroke'; shouldExpand: boolean; }; export declare function showModalWin(params: UserMenuParams[T], windowOpts: OptionalExceptFor): Promise; export type SearchMenuChannelMessage = { selectedViews: OpenFin.Identity[]; openViews: OpenFin.Identity[]; windowId: OpenFin.Identity; searchText?: string; keyboardEvent?: BrowserSearchMenuKeyboardEvent; shouldExpandMenu?: SearchViewExpansionState; offsetLeft?: number; type: 'update-search-menu-state'; } | { type: 'ready'; }; export type BrowserSearchMenuKeyboardEvent = { type: string; options: { key: string; metaKey?: boolean; ctrlKey?: boolean; altKey?: boolean; }; }; export declare enum PopupWindowMenuType { GlobalMenu = "global-menu", ContextMenu = "context-menu", RenameSupertab = "rename-supertab", AddEditBookmark = "add-edit-bookmark", DropdownMenu = "dropdown-menu", TabSearch = "tab-search" } export type BookmarkButtonPayload = { selectedViewIdentity: OpenFin.Identity; }; export type BasePopupMenuChannelMessage = { type: PopupWindowMenuType; /** * The identity of the window the dialog/menu invocation came from. */ parentIdentity: OpenFin.Identity; /** * The identity of the window the dialog/menu should respond to. * * This may differ from the parentIdentity, such as in the case of custom context menus, where the * parent is a browser window but the context menu should respond to the provider window. */ responseIdentity: OpenFin.Identity; anchorBehavior?: AnchorBehavior; x: number; y: number; }; export type ContextMenuChannelMessage = BasePopupMenuChannelMessage & { type: PopupWindowMenuType.ContextMenu | PopupWindowMenuType.GlobalMenu; /** * The unique request ID of the context menu invocation. */ requestId: string; payload: OpenFin.ShowPopupMenuOptions; }; export type BookmarkDialogChannelMessage = BasePopupMenuChannelMessage & { type: PopupWindowMenuType.AddEditBookmark; payload: BookmarkButtonPayload; }; /** Sent from browser to zoom dialog window to position and hydrate UI (initial open or live sync). */ export type ZoomControlsDialogStateMessage = { /** * The identity of the window the dialog/menu invocation came from. */ parentIdentity: OpenFin.Identity; x: number; y: number; payload: { selectedViewIdentity?: OpenFin.Identity; zoomPercent?: number; openedViaMouseClick?: boolean; }; }; export declare const ZOOM_DIALOG_CHANNEL_ACTION: "state"; export type DropdownMenuChannelMessage = BasePopupMenuChannelMessage & { type: PopupWindowMenuType.DropdownMenu; payload: { template: Array; /** * The width of the dropdown element in the DOM to determine the width of the menu window. */ width: number; }; }; export type RenameSupertabChannelMessage = BasePopupMenuChannelMessage & { type: PopupWindowMenuType.RenameSupertab; payload: { /** * The pageId of the page being renamed. */ pageId: string; }; }; /** * A row in the tab search list. {@link showPin} / {@link showUnpin} are optional; when omitted, no row action. */ export type TabSearchListItem = { id: string; title: string; /** When true, show a control to pin (move to the user page group). Core UI + ungrouped only. */ showPin?: boolean; /** When true, show a control to unpin (leave the user page group). */ showUnpin?: boolean; /** * When true, show a non-interactive lock (workspace / platform locked); ungrouped pages only. * Mutually exclusive with {@link showPin} in the browser; does not replace {@link showUnpin}. */ showPlatformLocked?: boolean; }; export type TabSearchModalContent = { variant: 'page' | 'view'; tabs: TabSearchListItem[]; }; /** Channel action: browser → tab-search popup; refreshes list rows after pin/unpin while open. */ export declare const TAB_SEARCH_CHANNEL_ACTION_UPDATE_TABS: "update-tabs"; export type TabSearchUpdateTabsMessage = { requestId: string; tabs: TabSearchListItem[]; }; export type TabSearchChannelMessage = BasePopupMenuChannelMessage & { type: PopupWindowMenuType.TabSearch; requestId: string; payload: TabSearchModalContent; }; export type SearchMenuChannelResponse = { type: 'ready'; } | { type: 'search-response'; selectedSite?: Site; searchText?: string; selectedView: OpenFin.Identity; inputUpdate?: string; trigger?: SiteAction; handled?: boolean; } | { type: 'resize-view'; width: number; } | { type: 'keyboard-event'; keyboardEvent: BrowserSearchMenuKeyboardEvent; } | { type: 'focused-changed'; payload: SelectableResult; } | { type: 'search-provider-changed'; } | { type: 'all-providers-results-announcement'; message: string; } | { type: 'single-provider-results-announcement'; message: string; }; export {};