import type { OpenFin } from '@openfin/core'; import { BaseCustomDropdownItem } from '../../../client-api/src/shapes'; import { BookmarkDockEntryPayload, DockEntry, LaunchDockEntryPayload, Collection } from '../../../client-api-platform/src/shapes'; import { WorkspaceIndicatorConfig } from '../../../common/src/utils/indicators/workspace-indicators'; import { Dock3Config, DockCompanionButton } from '../../../dock3/src/shapes'; /** * Payload for more menu custom option actions */ export interface MoreMenuCustomOptionPayload { action: string; customData?: any; } type ChannelActionMap = { [action: string]: (...args: any[]) => any; }; type TypedChannelClient = Omit & { dispatch: (action: T, payload: Parameters[0]) => Promise>>; register: (action: T, handler: (payload: Parameters[0], id: OpenFin.ProviderIdentity | OpenFin.ClientIdentity) => Promise>>) => boolean; }; type TypedChannelProvider = Omit & { dispatch: (to: OpenFin.ClientIdentity, action: T, payload: Parameters[0]) => Promise>>; register: (action: T, handler: (payload: Parameters[0], id: OpenFin.ProviderIdentity | OpenFin.ClientIdentity) => Promise>>) => boolean; }; /** * @internal */ export type Dock3ChannelProviderChannelActions = { 'launch-entry': (payload: LaunchDockEntryPayload) => void; 'ready': () => void; 'save-config': (payload: { config: Dock3Config; }) => Promise; 'bookmark-content-menu-entry': (payload: BookmarkDockEntryPayload) => Promise; 'more-menu-custom-option-clicked': (payload: MoreMenuCustomOptionPayload) => Promise; }; /** * @internal */ export type Dock3ChannelClientChannelActions = { 'handle-dock-config-updated': (payload: Dock3Config) => void; 'navigate-content-menu': (payload: { targetId: string; }) => void; 'handle-indicator-config': (payload: WorkspaceIndicatorConfig) => void; }; /** * @internal */ export type Dock3ChannelProvider = TypedChannelProvider; /** * @internal */ export type Dock3ChannelClient = TypedChannelClient; /** * These are channel actions registered by the platform. * * @internal */ export type EnterpriseDockChannelProviderChannelActions = Dock3ChannelProviderChannelActions & { 'set-dock-favorites-order': (newFavorites: DockEntry[]) => void; 'set-default-dock-buttons-order': (newFavorites: DockCompanionButton[]) => void; 'get-dock-workspaces-context-menu': () => BaseCustomDropdownItem[]; 'handle-dock-workspaces-menu-response': (payload: any) => void; 'remove-favorite-entry': (entry: DockEntry) => void; 'add-favorite-entry': (entry: DockEntry) => void; 'more-menu-custom-option-clicked': (payload: MoreMenuCustomOptionPayload) => Promise; 'refresh-dock-collection-menu': (collections: Collection[]) => Promise; 'launch-collection': (collection: Collection) => void; }; /** * These are channel actions registered by the client (enterprise dock) * @internal */ export type EnterpriseDockChannelClientChannelActions = Dock3ChannelClientChannelActions & { 'update-favorite-entries': () => void; 'update-content-menu': () => void; 'navigate-content-menu': () => void; }; /** * Used by Enterprise Dock for communication with the platform. * @internal */ export type EnterpriseDockChannelClient = TypedChannelClient; /** * Used by the platform for communication with Enterprise Dock. * @internal */ export type EnterpriseDockChannelProvider = TypedChannelProvider; export {};