@openfin/workspace-platform 22.0.7 → 22.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -8,7 +8,7 @@ export declare const navigateContentMenu: (id: string) => Promise<void>;
8
8
  export declare const launchDockEntry: (payload: LaunchDockEntryPayload) => Promise<void>;
9
9
  export declare const setDockFavoritesOrder: (favorites: DockEntry[]) => Promise<void>;
10
10
  export declare const setDefaultDockButtonsOrder: (defaultDockButtons: DockCompanionButton[]) => Promise<void>;
11
- export declare const getDockWorkspacesContextMenu: () => Promise<import("@client/index").BaseCustomDropdownItem[]>;
11
+ export declare const getDockWorkspacesContextMenu: () => Promise<import("@client/index").BaseCustomDropdownItem<any>[]>;
12
12
  export declare const handleDockWorkspacesMenuResponse: (payload: any) => Promise<void>;
13
13
  export declare const removeFavoriteEntry: (entry: DockEntry) => Promise<void>;
14
14
  export declare const addFavoriteEntry: (entry: DockEntry) => Promise<void>;
@@ -1,11 +1,12 @@
1
- import type { ApplyWorkspacePayload, CreateSavedWorkspaceRequest, Workspace } from '../../../../client-api-platform/src/shapes';
1
+ import type { ApplyWorkspacePayload, CreateSavedWorkspaceRequest, RestoreLastSavedWorkspacePayload, RestoreLastSavedWorkspaceResult, Workspace } from '../../../../client-api-platform/src/shapes';
2
2
  /**
3
3
  * Apply the given workspace and set it as active.
4
4
  * @param payload, the workspace to apply and the options to apply it with.
5
5
  *
6
6
  * @returns true if the workspace was applied, false if the user cancelled the switch or an error occurred.
7
7
  */
8
- export declare function applyWorkspace({ options, ...workspace }: ApplyWorkspacePayload): Promise<boolean>;
8
+ export declare function applyWorkspace(payload: ApplyWorkspacePayload): Promise<boolean>;
9
+ export declare function restoreLastSavedWorkspaceInternal(options?: RestoreLastSavedWorkspacePayload): Promise<RestoreLastSavedWorkspaceResult>;
9
10
  /**
10
11
  * Set the current active workspace.
11
12
  */
@@ -1,5 +1,8 @@
1
1
  import type OpenFin from '@openfin/core';
2
2
  import { AttachedPage, ExtendedPanelConfig, PanelConfig } from '../../../common/src/api/pages/shapes';
3
- export declare function convertPanelViewOpts(panels: PanelConfig[]): ExtendedPanelConfig[];
3
+ export declare function convertPanelViewOpts(panels: PanelConfig[], updatePageRequest?: {
4
+ identity: OpenFin.Identity;
5
+ pageId: string;
6
+ }): Promise<ExtendedPanelConfig[]>;
4
7
  export declare function createPanelViewsForPages(pages: AttachedPage[]): Promise<void>;
5
8
  export declare function createPanelViews(panels: PanelConfig[]): Promise<(void | OpenFin.View)[]>;
@@ -1521,6 +1521,13 @@ export interface WorkspacePlatformModule extends OpenFin.Platform {
1521
1521
  * ```
1522
1522
  */
1523
1523
  applyWorkspace(workspace: Workspace, options?: ApplyWorkspaceOptions): Promise<boolean>;
1524
+ /**
1525
+ * Applies last saved version of current workspace.
1526
+ * @param options see {@link ApplyWorkspaceOptions}.
1527
+ * @returns String indicating the outcome of the API call, one of: 'success', 'not-saved-workspace', 'user-declined'.
1528
+ * See {@link RestoreLastSavedWorkspaceResult} for detailed description.
1529
+ */
1530
+ restoreLastSavedWorkspace(options?: ApplyWorkspaceOptions): Promise<RestoreLastSavedWorkspaceResult>;
1524
1531
  /**
1525
1532
  * Returns ISO language code of current set language
1526
1533
  *
@@ -1894,6 +1901,13 @@ export interface ApplySnapshotOptions extends OpenFin.ApplySnapshotOptions {
1894
1901
  export type ApplyWorkspacePayload = Workspace & {
1895
1902
  options?: ApplyWorkspaceOptions;
1896
1903
  };
1904
+ /**
1905
+ * Variants of results returned by restoreLastSavedWorkspace method.
1906
+ * * 'success' - workspace was successfully applied
1907
+ * * 'not-saved-workspace' - currently active workspace has never been saved, hence no changes were applied
1908
+ * * 'user-declined' - confirmation modal was shown and user declined to apply last saved workspace (only relevant when skipPrompt==false)
1909
+ */
1910
+ export type RestoreLastSavedWorkspaceResult = 'success' | 'not-saved-workspace' | 'user-declined';
1897
1911
  /**
1898
1912
  * Defines custom action map where the key is the custom action ID and value is the action handler
1899
1913
  */
@@ -19,12 +19,12 @@ export interface BaseCustomButtonConfig {
19
19
  iconUrl?: string;
20
20
  parentHover?: boolean;
21
21
  }
22
- export interface BaseCustomDropdownItem extends Omit<BaseCustomButtonConfig, 'tooltip'> {
22
+ export interface BaseCustomDropdownItem<Action = any> extends Omit<BaseCustomButtonConfig, 'tooltip'> {
23
23
  tooltip?: string;
24
24
  /** Is this dropdown item checked? Any value other than undefined will decorate the dropdown option as a checkbox option. */
25
25
  checked?: boolean;
26
26
  /** icon URL for icon image */
27
- action?: any;
27
+ action?: Action;
28
28
  options?: (BaseCustomDropdownItem | BaseCustomDropdownConfig)[];
29
29
  separator?: boolean;
30
30
  }
@@ -51,6 +51,7 @@ export declare enum WorkspacePlatformChannelAction {
51
51
  SaveWorkspace = "saveWorkspace",
52
52
  GetCurrentWorkspace = "getCurrentWorkspace",
53
53
  ApplyWorkspace = "applyWorkspace",
54
+ RestoreLastSavedWorkspaceInternal = "restoreLastSavedWorkspaceInternal",
54
55
  SetActiveWorkspace = "setActiveWorkspace",
55
56
  IsBrowserInitialized = "isBrowserInitialized",
56
57
  Analytics = "analyticsInternal",
@@ -35,6 +35,7 @@ export type LayoutDOMEvent = {
35
35
  type: Extract<LayoutDOMEventType, 'tabs-list-resized'>;
36
36
  };
37
37
  export type LayoutDOMEventListener = (ev: LayoutDOMEvent) => void;
38
+ export declare const VIEW_NAME_PREFIX: "internal-generated-view-";
38
39
  export declare const getFirstActiveViewFromLayout: (identity: OpenFin.LayoutIdentity) => Promise<OpenFin.Identity>;
39
40
  /**
40
41
  * Recursively clones a layout object, calling a passed callback on each `componentState` in the tree.