@openfin/workspace-platform 5.2.0 → 5.5.0

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.
Files changed (104) hide show
  1. package/README.md +31 -4
  2. package/client-api/src/shapes.d.ts +597 -0
  3. package/{index.ts → client-api-platform/index.d.ts} +0 -0
  4. package/client-api-platform/src/api/app-directory.d.ts +7 -0
  5. package/client-api-platform/src/api/browser/browser-module.d.ts +13 -0
  6. package/client-api-platform/src/api/browser/index.d.ts +22 -0
  7. package/client-api-platform/src/api/pages/helper.d.ts +22 -0
  8. package/client-api-platform/src/api/pages/index.d.ts +30 -0
  9. package/client-api-platform/src/api/protocol.d.ts +48 -0
  10. package/client-api-platform/src/api/storage.d.ts +10 -0
  11. package/client-api-platform/src/api/theming.d.ts +5 -0
  12. package/client-api-platform/src/api/workspace-module.d.ts +3 -0
  13. package/client-api-platform/src/index.d.ts +41 -0
  14. package/client-api-platform/src/init/browser-window-focus.d.ts +19 -0
  15. package/client-api-platform/src/init/cleanup.d.ts +1 -0
  16. package/client-api-platform/src/init/index.d.ts +5 -0
  17. package/client-api-platform/src/init/override-callback.d.ts +3 -0
  18. package/client-api-platform/src/init/theming.d.ts +9 -0
  19. package/client-api-platform/src/init/utils.d.ts +45 -0
  20. package/client-api-platform/src/shapes.d.ts +673 -0
  21. package/client-api-platform/src/umd.d.ts +1 -0
  22. package/common/src/api/pages/attached.d.ts +101 -0
  23. package/common/src/api/pages/idb.d.ts +12 -0
  24. package/common/src/api/pages/index.d.ts +22 -0
  25. package/common/src/api/pages/legacy.d.ts +16 -0
  26. package/common/src/api/pages/shapes.d.ts +77 -0
  27. package/common/src/api/protocol.d.ts +64 -0
  28. package/common/src/api/theming.d.ts +62 -0
  29. package/common/src/api/workspaces/index.d.ts +7 -0
  30. package/common/src/utils/application.d.ts +38 -0
  31. package/common/src/utils/channels.d.ts +8 -0
  32. package/common/src/utils/debounce.d.ts +16 -0
  33. package/common/src/utils/defer-auto-show.d.ts +18 -0
  34. package/common/src/utils/env.d.ts +36 -0
  35. package/common/src/utils/layout.d.ts +52 -0
  36. package/common/src/utils/local-storage-key.d.ts +8 -0
  37. package/common/src/utils/logger/index.d.ts +26 -0
  38. package/common/src/utils/logger/manager.d.ts +35 -0
  39. package/common/src/utils/logger/shapes.d.ts +27 -0
  40. package/common/src/utils/route.d.ts +55 -0
  41. package/common/src/utils/shared-emitter.d.ts +10 -0
  42. package/common/src/utils/snapshot.d.ts +33 -0
  43. package/common/src/utils/strings.d.ts +5 -0
  44. package/common/src/utils/theming.d.ts +57 -0
  45. package/common/src/utils/umd.d.ts +2 -0
  46. package/common/src/utils/window.d.ts +150 -0
  47. package/index.d.ts +1 -0
  48. package/index.js +2 -0
  49. package/index.js.map +1 -0
  50. package/package.json +1 -34
  51. package/search-api/src/client/index.d.ts +6 -0
  52. package/search-api/src/client/internal.d.ts +38 -0
  53. package/search-api/src/client/remote/channel-client-factory.d.ts +2 -0
  54. package/search-api/src/client/remote/channel-client.d.ts +9 -0
  55. package/search-api/src/client/remote/data.d.ts +16 -0
  56. package/search-api/src/client/remote/disconnect.d.ts +7 -0
  57. package/search-api/src/client/remote/dispatch.d.ts +9 -0
  58. package/search-api/src/client/remote/requests.d.ts +5 -0
  59. package/search-api/src/client/remote/search-close.d.ts +14 -0
  60. package/search-api/src/common.d.ts +104 -0
  61. package/search-api/src/errors.d.ts +5 -0
  62. package/search-api/src/fin/index.d.ts +6 -0
  63. package/search-api/src/fin/shapes.d.ts +23 -0
  64. package/search-api/src/index.d.ts +7 -0
  65. package/search-api/src/internal-shapes.d.ts +134 -0
  66. package/search-api/src/logger.d.ts +1 -0
  67. package/search-api/src/provider/index.d.ts +8 -0
  68. package/search-api/src/provider/internal.d.ts +33 -0
  69. package/search-api/src/provider/remote/channel-factory.d.ts +6 -0
  70. package/search-api/src/provider/remote/channel.d.ts +23 -0
  71. package/search-api/src/provider/remote/connection.d.ts +20 -0
  72. package/search-api/src/provider/remote/data.d.ts +23 -0
  73. package/search-api/src/provider/remote/deregistration.d.ts +5 -0
  74. package/search-api/src/provider/remote/disconnect.d.ts +1 -0
  75. package/search-api/src/provider/remote/disconnection.d.ts +9 -0
  76. package/search-api/src/provider/remote/dispatch.d.ts +7 -0
  77. package/search-api/src/provider/remote/info.d.ts +5 -0
  78. package/search-api/src/provider/remote/registration.d.ts +23 -0
  79. package/search-api/src/provider/remote/search-close.d.ts +14 -0
  80. package/search-api/src/provider/remote/search.d.ts +8 -0
  81. package/search-api/src/shapes.d.ts +542 -0
  82. package/.eslintignore +0 -1
  83. package/.eslintrc.js +0 -2
  84. package/.prettierrc.js +0 -2
  85. package/babel.config.js +0 -2
  86. package/jest.config.js +0 -2
  87. package/src/api/app-directory.ts +0 -45
  88. package/src/api/browser/browser-module.ts +0 -65
  89. package/src/api/browser/index.ts +0 -46
  90. package/src/api/pages/helper.ts +0 -113
  91. package/src/api/pages/index.ts +0 -164
  92. package/src/api/protocol.ts +0 -60
  93. package/src/api/storage.ts +0 -32
  94. package/src/api/workspace-module.ts +0 -36
  95. package/src/index.ts +0 -35
  96. package/src/init/browser-window-focus.ts +0 -59
  97. package/src/init/cleanup.ts +0 -87
  98. package/src/init/index.ts +0 -42
  99. package/src/init/override-callback.ts +0 -159
  100. package/src/init/utils.ts +0 -164
  101. package/src/shapes.ts +0 -160
  102. package/src/umd.ts +0 -5
  103. package/tsconfig.json +0 -13
  104. package/webpack.common.config.js +0 -1
@@ -0,0 +1,22 @@
1
+ /// <reference types="openfin-adapter/fin" />
2
+ import { SnapshotExtended } from '../../../../common/src/utils/snapshot';
3
+ /**
4
+ * Get a snapshot with pages.
5
+ *
6
+ * Makes sure that the layout of the page is up to date with the window's layout.
7
+ *
8
+ * @returns a snapshot with windows that contain pages.
9
+ */
10
+ export declare function getSnapshotWithPages(superGetSnapshot?: () => Promise<SnapshotExtended>): Promise<SnapshotExtended>;
11
+ /**
12
+ * Launch a snapshot that contains windows with pages.
13
+ *
14
+ * If a page with the same ID is already launched in the platform,
15
+ * focus and set it as the active page.
16
+ *
17
+ * If there is no page on the desktop with the same ID, launch
18
+ * the new window with the page.
19
+ *
20
+ * @param snapshot the snapshot to launch.
21
+ */
22
+ export declare function applySnapshotWithPages(snapshot: OpenFin.Snapshot, superApplySnapshot?: (superSnapshot: OpenFin.Snapshot) => Promise<void>): Promise<void>;
@@ -0,0 +1,30 @@
1
+ /// <reference types="openfin-adapter/fin" />
2
+ import type { AttachPagesToWindowPayload } from '../../../../common/src/api/pages/shapes';
3
+ import type { CreateSavedPageRequest, Page, UpdateSavedPageRequest } from '../../../../client-api-platform/src/shapes';
4
+ /**
5
+ * Get all open pages in which are attached to a window.
6
+ * @returns the list of attached pages.
7
+ */
8
+ export declare const getAllAttachedPages: () => Promise<import("@client-platform/shapes").AttachedPage[]>;
9
+ export declare const createSavedPageInternal: ({ page }: CreateSavedPageRequest) => Promise<void>;
10
+ export declare const deleteSavedPageInternal: (id: string) => Promise<void>;
11
+ export declare const updateSavedPageInternal: ({ pageId, page }: UpdateSavedPageRequest) => Promise<any>;
12
+ export declare const savePage: (page: Page) => Promise<any>;
13
+ export declare const attachPagesToWindow: (payload: AttachPagesToWindowPayload) => Promise<void>;
14
+ export declare const updatePageForWindow: (payload: any) => Promise<void>;
15
+ export declare const detachPagesFromWindow: (payload: any) => Promise<void>;
16
+ export declare const setActivePage: (payload: any) => Promise<void>;
17
+ export declare const getPagesForWindow: (identity: OpenFin.Identity) => Promise<import("@client-platform/shapes").AttachedPage[]>;
18
+ export declare const getPageForWindow: ({ identity, pageId }: {
19
+ identity: any;
20
+ pageId: any;
21
+ }) => Promise<import("@client-platform/shapes").AttachedPage>;
22
+ export declare const reorderPagesForWindow: (payload: any) => Promise<void>;
23
+ export declare const getActivePageIdForWindow: (identity: any) => Promise<string>;
24
+ /**
25
+ * Checks if a given page name is unique
26
+ * If not, add a progressive number to it
27
+ * @param initialName The initial name to test
28
+ * @returns string: a unique page name
29
+ */
30
+ export declare function getUniquePageTitle(initialName?: string): Promise<string>;
@@ -0,0 +1,48 @@
1
+ /// <reference types="openfin-adapter/fin" />
2
+ /**
3
+ * All of the remote procedures that can be called in the
4
+ * a Workspace Platform's address space.
5
+ *
6
+ * When adding a new channel action make sure to add a function that's name matches
7
+ * the value of the enum for the remote procedure in the Workspace Platform overrides.
8
+ * All of the registered channel action handlers can be found here in the platform's overrides:
9
+ * @see link: [Provider Protocol Handlers](https://github.com/openfin/workspace/client-api-platform/src/init/override-callback.ts)
10
+ */
11
+ export declare enum ChannelAction {
12
+ LaunchApp = "launchApp",
13
+ SavePage = "savePage",
14
+ GetSavedPage = "getSavedPage",
15
+ CreateSavedPage = "createSavedPage",
16
+ UpdateSavedPage = "updateSavedPage",
17
+ DeleteSavedPage = "deleteSavedPage",
18
+ GetSavedPages = "getSavedPages",
19
+ CreateSavedPageInternal = "createSavedPageInternal",
20
+ UpdateSavedPageInternal = "updateSavedPageInternal",
21
+ DeleteSavedPageInternal = "deleteSavedPageInternal",
22
+ SharePage = "sharePage",
23
+ LaunchPage = "launchPage",
24
+ UpdatePageForWindow = "updatePageForWindow",
25
+ AttachPagesToWindow = "attachPagesToWindow",
26
+ DetachPagesFromWindow = "detachPagesFromWindow",
27
+ ReorderPagesForWindow = "reorderPagesForWindow",
28
+ SetActivePage = "setActivePage",
29
+ GetAllAttachedPages = "getAllAttachedPages",
30
+ GetActivePageIdForWindow = "getActivePageIdForWindow",
31
+ GetPagesForWindow = "getPagesForWindow",
32
+ GetPageForWindow = "getPageForWindow",
33
+ GetSavedPageMetadata = "getSavedPageMetadata",
34
+ GetUniquePageTitle = "getUniquePageTitle",
35
+ GetLastFocusedBrowserWindow = "getLastFocusedBrowserWindow",
36
+ GetThemes = "getThemes"
37
+ }
38
+ /**
39
+ * Get a channel client for a specific Workspace platform.
40
+ *
41
+ * The channel client can execute remote procedures on the platform via its `dispatch` function.
42
+ * A call to the `dispatch` function will block until the channel action has concluded execution
43
+ * in the Workspace platform's address space.
44
+ * For a list of supported procedures, see the `ChannelAction` enum.
45
+ *
46
+ * @returns the channel client for the Workspace platform.
47
+ */
48
+ export declare const getChannelClient: (identity: OpenFin.ApplicationIdentity) => Promise<import("openfin-adapter").ChannelClient>;
@@ -0,0 +1,10 @@
1
+ import { Page } from '../../../common/src/api/pages/shapes';
2
+ import type { CreateSavedPageRequest, UpdateSavedPageRequest } from '../shapes';
3
+ export declare const getStorageApi: (identity: any) => {
4
+ createPage: (req: CreateSavedPageRequest) => Promise<any>;
5
+ deletePage: (id: string) => Promise<any>;
6
+ updatePage: (req: UpdateSavedPageRequest) => Promise<any>;
7
+ getPage: (id: string) => Promise<any>;
8
+ getPages: (query?: string) => Promise<Page[]>;
9
+ savePage: (page: Page) => Promise<any>;
10
+ };
@@ -0,0 +1,5 @@
1
+ /// <reference types="openfin-adapter/fin" />
2
+ import type { CustomThemes } from '../../../common/src/api/theming';
3
+ export declare const getThemingApi: (identity: OpenFin.ApplicationIdentity) => {
4
+ getThemes: () => Promise<CustomThemes>;
5
+ };
@@ -0,0 +1,3 @@
1
+ /// <reference types="openfin-adapter/fin" />
2
+ import type { WorkspacePlatformModule } from '../shapes';
3
+ export declare const getWorkspacePlatformModule: (identity: OpenFin.ApplicationIdentity) => WorkspacePlatformModule;
@@ -0,0 +1,41 @@
1
+ /// <reference types="openfin-adapter/fin" />
2
+ import type { WorkspacePlatformInitConfig, WorkspacePlatformModule } from './shapes';
3
+ export * from './shapes';
4
+ /**
5
+ * Initilaize a Workspace Platform.
6
+ *
7
+ * ```ts
8
+ * import * as WorkspacePlatform from '@openfin/workspace-platform';
9
+ *
10
+ * const customThemes: WorkspacePlatform.CustomThemes = [{
11
+ * label: "OpenFin's Custom Theme",
12
+ * palette: {
13
+ * // Required color options
14
+ * brandPrimary: '#F51F63',
15
+ * brandSecondary: '#1FF58A',
16
+ * backgroundPrimary: '#F8E71C', // hex, rgb/rgba, hsl/hsla only - no string colors: 'red'
17
+ * }
18
+ * }
19
+ *
20
+ * const overrideCallback: WorkspacePlatform.BrowserOverrideCallback = async (
21
+ * WorkspacePlatformProvider
22
+ * ) => {
23
+ * class Override extends WorkspacePlatformProvider {
24
+ * async quit(payload, callerIdentity) {
25
+ * return super.quit(payload, callerIdentity);
26
+ * }
27
+ * }
28
+ * return new Override();
29
+ * };
30
+ *
31
+ *
32
+ * await WorkspacePlatform.init({
33
+ * browser: { overrideCallback },
34
+ * theme: customThemes
35
+ * });
36
+ * ```
37
+ * @param options options for configuring the platform.
38
+ */
39
+ export declare const init: (options: WorkspacePlatformInitConfig) => Promise<void>;
40
+ export declare const wrapSync: (identity: OpenFin.ApplicationIdentity) => WorkspacePlatformModule;
41
+ export declare const getCurrentSync: () => WorkspacePlatformModule;
@@ -0,0 +1,19 @@
1
+ /// <reference types="openfin-adapter/fin" />
2
+ /**
3
+ * Get the last focused browser window.
4
+ * @returns the last focused browser window.
5
+ */
6
+ export declare function getLastFocusedBrowserWindow(): Promise<OpenFin.Identity>;
7
+ /**
8
+ * Set the OpenFin identity of the last focused browser window.
9
+ */
10
+ export declare function setLastFocusedBrowserWindow(identity?: OpenFin.Identity): void;
11
+ /**
12
+ * Listen for a browser window to be focused.
13
+ * When a browser window is focused, store it in local storage as the last focused browser window.
14
+ */
15
+ export declare function listenForBrowserWindowFocus(): Promise<void>;
16
+ /**
17
+ * Stop listening for a browser window to be focused.
18
+ */
19
+ export declare function removeBrowserWindowFocusListener(): Promise<void>;
@@ -0,0 +1 @@
1
+ export default function registerViewCleanUp(): void;
@@ -0,0 +1,5 @@
1
+ import { BrowserInitConfig } from '../shapes';
2
+ /**
3
+ * Initializing the Workspace Platform.
4
+ */
5
+ export default function init(options: BrowserInitConfig): Promise<void>;
@@ -0,0 +1,3 @@
1
+ /// <reference types="openfin-adapter/fin" />
2
+ import type { BrowserInitConfig } from '../../../client-api-platform/src/shapes';
3
+ export declare const getOverrideCallback: (initOptions: BrowserInitConfig) => OpenFin.OverrideCallback<OpenFin.PlatformProvider>;
@@ -0,0 +1,9 @@
1
+ import { CustomThemes } from '../shapes';
2
+ export declare const getThemes: () => CustomThemes;
3
+ /**
4
+ * initTheming()
5
+ * Accepts an array of CustomThemes objects and stores it
6
+ * @param customPaletteOptions - optional - array of custom color pallettes
7
+ * @returns array of custom theme objects
8
+ */
9
+ export default function initTheming(customPalettes: CustomThemes): void;
@@ -0,0 +1,45 @@
1
+ /// <reference types="openfin-adapter/fin" />
2
+ import { Identity } from 'openfin-adapter';
3
+ import type { CustomThemeOptions } from '../../../common/src/api/theming';
4
+ import { BrowserCreateWindowRequest } from '..';
5
+ export declare function overrideViewOptions(options: Partial<OpenFin.ViewOptions>, initOptions: OpenFin.ViewOptions): OpenFin.ViewOptions & Partial<OpenFin.ViewOptions>;
6
+ export declare function preserveInteropIfManifestConflict(opts: Partial<OpenFin.ViewOptions>, fetchManifest: ({ manifestUrl: string }: {
7
+ manifestUrl: any;
8
+ }, callerIdentity: Identity) => any, callerIdentity: Identity): Promise<any>;
9
+ export declare const filterSnapshotWindows: (win: OpenFin.WindowOptions) => boolean;
10
+ /**
11
+ * fitToMonitor()
12
+ * Function to determine if window size is too large
13
+ * for available rectangle area.
14
+ *
15
+ * - Checks monitor data for available rectangle coords
16
+ * - Defines max width/height for current monitor
17
+ * - Defines default width/height if property is not set
18
+ * - Updates options object default width/height if they exceed max values
19
+ *
20
+ * Ticket: WRK-1084
21
+ *
22
+ * @param options - Object passed into createWindow -> contains height and width
23
+ * @returns unprocessed or processed options object
24
+ */
25
+ export declare const fitToMonitor: (options: any) => Promise<any>;
26
+ declare type LegacyWindowOptions = Omit<OpenFin.PlatformWindowCreationOptions, 'workspacePlatform'> & {
27
+ pages?: OpenFin.Page[];
28
+ workstacks?: OpenFin.Page[];
29
+ };
30
+ export declare const initWorkspacePlatformOptions: (options: LegacyWindowOptions | OpenFin.PlatformWindowCreationOptions) => OpenFin.PlatformWindowCreationOptions;
31
+ /**
32
+ * hasLayout()
33
+ * Function to force layout settings
34
+ * - Check if layout property exists if so process data, else return as is
35
+ * - Define behavior settings
36
+ * - Force dimension options
37
+ * - Validate icon
38
+ *
39
+ * Ticket: WRK-???
40
+ *
41
+ * @param options - options used to handle layout settings
42
+ * @returns processed or unprocesseed options
43
+ */
44
+ export declare const applyBrowserDefaults: (options: OpenFin.PlatformWindowCreationOptions, initOptions: BrowserCreateWindowRequest, theme: CustomThemeOptions) => OpenFin.PlatformWindowCreationOptions;
45
+ export {};