import { type CustomButtonConfig, type CustomDropdownConfig } from '../../../common/src/api/action'; import { type RegistrationMetaInfo } from '../../../client-api/src/shapes/common'; import { TaskbarIcon } from '../../../client-api-platform/src/shapes'; import { type ProviderInfo } from './provider'; /** * Allows you to hide buttons for different Workspace components in the Dock UI. * By default, all components are shown. * * @deprecated Use {@link WorkspaceButtonsConfig} instead. To migrate to the new configuration, any buttons that you wish to hide should be omitted from the `buttons` array. * * @example Hide all Workspace component buttons in the Dock UI. * ```ts * const workspaceComponentButtonOptions: WorkspaceComponentButtonOptions = { * hideHomeButton: true, * hideWorkspacesButton: true, * hideNotificationsButton: true, * hideStorefrontButton: true * } * ``` */ export interface WorkspaceComponentButtonOptions { /** * Set to true to hide the Workspaces button from the Dock UI. * @default false. */ hideWorkspacesButton?: boolean; /** * Set to true to hide the Home button from the Dock UI. * @default false. */ hideHomeButton?: boolean; /** * Set to true to hide the Notifications button from the Dock UI. * @default false. */ hideNotificationsButton?: boolean; /** * Set to true to hide the Storefront button from the Dock UI. * @default false. */ hideStorefrontButton?: boolean; } /** * The names of the Dock button types you can add and customize. * A dropdown button presents a list of options the user can choose from. * An action button initiates a single task or action only. */ export declare enum DockButtonNames { ActionButton = "ActionButton", DropdownButton = "DropdownButton" } /** * Configuration of a dock action button * When you add a custom button to the Dock, you must also provide details about the custom action. * * ```ts * const sampleDockButton: DockButtonConfig = { * tooltip: 'Sample Button 1', * iconUrl: 'https://www.openfin.co/favicon-32x32.png', * action: { * id: 'sampleButton1' * } * } * ``` */ export interface DockButtonConfig extends CustomButtonConfig { type?: DockButtonNames.ActionButton; } /** * Configuration of a dock dropdown button * When you add a dropdown button to the Dock, you must also specify the buttons to display in the dropdown. * * ```ts * const sampleDropdownButton1: DockDropdownConfig = { * type: DockButtonNames.DropdownButton, * tooltip: 'Sample Dropdown Button', * iconUrl: 'https://www.openfin.co/favicon-32x32.png', * options: [ * { * tooltip: 'Dropdown Button 1', * iconUrl: 'https://www.openfin.co/favicon-32x32.png', * action: { * id: 'dropdownButton1', * customData: 'dropdownButton1 clicked', * }, * }, * { * tooltip: 'Dropdown Button 2', * iconUrl: 'https://www.openfin.co/favicon-32x32.png', * action: { * id: 'dropdownButton2', * customData: 'dropdownButton2 clicked', * }, * }, * { * tooltip: 'Button with sub-options', * options: [ * { * tooltip: 'Nested button 1', * iconUrl: 'https://www.openfin.co/favicon-32x32.png', * action: { * id: 'nestedButton1', * customData: 'nestedButton1 clicked', * }, * }, * ], * }, * ], * }; * ``` */ export interface DockDropdownConfig extends CustomDropdownConfig { type: DockButtonNames.DropdownButton; } /** * Dock button types */ export type DockButton = { /** * Optional button identifier, if not provided will be automatically generated by the provider */ id?: string; /** * Specifies button context menu, if present and has one of the options enabled, the button will have a context menu on right click. */ contextMenu?: { removeOption?: boolean; }; } & (DockButtonConfig | DockDropdownConfig); /** * The names of the buttons for the workspace components on the Dock. * * Used in {@link WorkspaceButtonsConfig}. */ export type WorkspaceButton = 'switchWorkspace' | 'home' | 'notifications' | 'store'; /** * Controls the visibility as well as the order of buttons for workspace components on the Dock. * * To omit a button from the Dock UI, simply omit it from the array. * * The array must not contain duplicate values. Any duplicate values will be removed. * * @example Hide the Home button and move the Notifications button to the first position. * ```ts * const workspaceButtonsConfig: WorkspaceButtonsConfig = [ * 'notifications', * 'switchWorkspace', * 'store' * ]; * ``` * * @example Hide all of the workspace buttons. * * ```ts * const workspaceButtonsConfig: WorkspaceButtonsConfig = []; * ``` */ export type WorkspaceButtonsConfig = WorkspaceButton[]; /** * Configuration for the Dock provider. */ export interface DockProviderConfig { /** * Controls the visibility of buttons for workspace components on the Dock. * All components are visible by default, but you can hide any of them. * * @default - All components are visible. `['switchWorkspace', 'home', 'notifications', 'store']` */ workspaceComponents?: WorkspaceComponentButtonOptions | WorkspaceButtonsConfig; /** * Buttons for platform-specific custom actions to display on the Dock. */ buttons?: DockButton[]; /** * If true, the user will not be able to rearrange the buttons on the Dock. * * @default false */ disableUserRearrangement?: boolean; /** * A UI friendly title for the provider platform. */ title: string; /** * Icon for the provider. */ icon: string | TaskbarIcon; } export interface DockProviderConfigWithIdentity extends ProviderInfo, DockProviderConfig { } /** *