@openfin/workspace-platform 1.0.0 → 4.4.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 (97) hide show
  1. package/client-api/src/shapes.d.ts +596 -0
  2. package/{index.ts → client-api-platform/index.d.ts} +0 -0
  3. package/client-api-platform/src/api/app-directory.d.ts +7 -0
  4. package/client-api-platform/src/api/browser/browser-module.d.ts +13 -0
  5. package/client-api-platform/src/api/browser/index.d.ts +22 -0
  6. package/client-api-platform/src/api/pages/helper.d.ts +22 -0
  7. package/client-api-platform/src/api/pages/index.d.ts +30 -0
  8. package/client-api-platform/src/api/protocol.d.ts +47 -0
  9. package/client-api-platform/src/api/storage.d.ts +10 -0
  10. package/client-api-platform/src/api/workspace-module.d.ts +3 -0
  11. package/client-api-platform/src/index.d.ts +6 -0
  12. package/client-api-platform/src/init/browser-window-focus.d.ts +19 -0
  13. package/client-api-platform/src/init/cleanup.d.ts +1 -0
  14. package/client-api-platform/src/init/index.d.ts +5 -0
  15. package/client-api-platform/src/init/override-callback.d.ts +3 -0
  16. package/client-api-platform/src/init/utils.d.ts +39 -0
  17. package/{src/shapes.ts → client-api-platform/src/shapes.d.ts} +2 -29
  18. package/client-api-platform/src/umd.d.ts +1 -0
  19. package/common/src/api/pages/attached.d.ts +101 -0
  20. package/common/src/api/pages/idb.d.ts +12 -0
  21. package/common/src/api/pages/index.d.ts +16 -0
  22. package/common/src/api/pages/legacy.d.ts +16 -0
  23. package/common/src/api/pages/shapes.d.ts +77 -0
  24. package/common/src/api/protocol.d.ts +63 -0
  25. package/common/src/api/workspaces/index.d.ts +7 -0
  26. package/common/src/utils/application.d.ts +38 -0
  27. package/common/src/utils/channels.d.ts +8 -0
  28. package/common/src/utils/debounce.d.ts +16 -0
  29. package/common/src/utils/env.d.ts +30 -0
  30. package/common/src/utils/layout.d.ts +52 -0
  31. package/common/src/utils/local-storage-key.d.ts +8 -0
  32. package/common/src/utils/logger/index.d.ts +26 -0
  33. package/common/src/utils/logger/manager.d.ts +35 -0
  34. package/common/src/utils/logger/shapes.d.ts +27 -0
  35. package/common/src/utils/route.d.ts +55 -0
  36. package/common/src/utils/shared-emitter.d.ts +10 -0
  37. package/common/src/utils/snapshot.d.ts +33 -0
  38. package/common/src/utils/strings.d.ts +5 -0
  39. package/common/src/utils/umd.d.ts +2 -0
  40. package/common/src/utils/window.d.ts +146 -0
  41. package/index.d.ts +1 -0
  42. package/index.js +2 -0
  43. package/index.js.map +1 -0
  44. package/package.json +1 -34
  45. package/search-api/src/client/index.d.ts +6 -0
  46. package/search-api/src/client/internal.d.ts +38 -0
  47. package/search-api/src/client/remote/channel-client-factory.d.ts +2 -0
  48. package/search-api/src/client/remote/channel-client.d.ts +9 -0
  49. package/search-api/src/client/remote/data.d.ts +16 -0
  50. package/search-api/src/client/remote/disconnect.d.ts +7 -0
  51. package/search-api/src/client/remote/dispatch.d.ts +9 -0
  52. package/search-api/src/client/remote/requests.d.ts +5 -0
  53. package/search-api/src/client/remote/search-close.d.ts +14 -0
  54. package/search-api/src/common.d.ts +104 -0
  55. package/search-api/src/errors.d.ts +5 -0
  56. package/search-api/src/fin/index.d.ts +6 -0
  57. package/search-api/src/fin/shapes.d.ts +23 -0
  58. package/search-api/src/index.d.ts +7 -0
  59. package/search-api/src/internal-shapes.d.ts +134 -0
  60. package/search-api/src/logger.d.ts +1 -0
  61. package/search-api/src/provider/index.d.ts +8 -0
  62. package/search-api/src/provider/internal.d.ts +33 -0
  63. package/search-api/src/provider/remote/channel-factory.d.ts +6 -0
  64. package/search-api/src/provider/remote/channel.d.ts +23 -0
  65. package/search-api/src/provider/remote/connection.d.ts +20 -0
  66. package/search-api/src/provider/remote/data.d.ts +23 -0
  67. package/search-api/src/provider/remote/deregistration.d.ts +5 -0
  68. package/search-api/src/provider/remote/disconnect.d.ts +1 -0
  69. package/search-api/src/provider/remote/disconnection.d.ts +9 -0
  70. package/search-api/src/provider/remote/dispatch.d.ts +7 -0
  71. package/search-api/src/provider/remote/info.d.ts +5 -0
  72. package/search-api/src/provider/remote/registration.d.ts +23 -0
  73. package/search-api/src/provider/remote/search-close.d.ts +14 -0
  74. package/search-api/src/provider/remote/search.d.ts +8 -0
  75. package/search-api/src/shapes.d.ts +541 -0
  76. package/.eslintignore +0 -1
  77. package/.eslintrc.js +0 -2
  78. package/.prettierrc.js +0 -2
  79. package/babel.config.js +0 -2
  80. package/jest.config.js +0 -2
  81. package/src/api/app-directory.ts +0 -45
  82. package/src/api/browser/browser-module.ts +0 -65
  83. package/src/api/browser/index.ts +0 -46
  84. package/src/api/pages/helper.ts +0 -113
  85. package/src/api/pages/index.ts +0 -164
  86. package/src/api/protocol.ts +0 -60
  87. package/src/api/storage.ts +0 -32
  88. package/src/api/workspace-module.ts +0 -36
  89. package/src/index.ts +0 -35
  90. package/src/init/browser-window-focus.ts +0 -59
  91. package/src/init/cleanup.ts +0 -87
  92. package/src/init/index.ts +0 -42
  93. package/src/init/override-callback.ts +0 -159
  94. package/src/init/utils.ts +0 -164
  95. package/src/umd.ts +0 -5
  96. package/tsconfig.json +0 -13
  97. package/webpack.common.config.js +0 -1
@@ -0,0 +1,47 @@
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
+ SetActivePageForWindow = "setActivePageForWindow",
29
+ GetOpenPages = "getOpenPages",
30
+ GetActivePageIdForWindow = "getActivePageIdForWindow",
31
+ GetPagesForWindow = "getPagesForWindow",
32
+ GetPageForWindow = "getPageForWindow",
33
+ GetSavedPageMetadata = "getSavedPageMetadata",
34
+ GetUniquePageTitle = "getUniquePageTitle",
35
+ GetLastFocusedBrowserWindow = "getLastFocusedBrowserWindow"
36
+ }
37
+ /**
38
+ * Get a channel client for a specific Workspace platform.
39
+ *
40
+ * The channel client can execute remote procedures on the platform via its `dispatch` function.
41
+ * A call to the `dispatch` function will block until the channel action has concluded execution
42
+ * in the Workspace platform's address space.
43
+ * For a list of supported procedures, see the `ChannelAction` enum.
44
+ *
45
+ * @returns the channel client for the Workspace platform.
46
+ */
47
+ export declare const getChannelClient: (identity: OpenFin.Identity) => Promise<import("openfin-adapter").ChannelClient>;
@@ -0,0 +1,10 @@
1
+ import { Page } from '@common/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,3 @@
1
+ /// <reference types="openfin-adapter/fin" />
2
+ import type { WorkspacePlatformModule } from '../shapes';
3
+ export declare const getWorkspacePlatformModule: (identity: OpenFin.Identity) => WorkspacePlatformModule;
@@ -0,0 +1,6 @@
1
+ /// <reference types="openfin-adapter/fin" />
2
+ import type { WorkspacePlatformInitConfig, WorkspacePlatformModule } from './shapes';
3
+ export * from './shapes';
4
+ export declare const init: (options: WorkspacePlatformInitConfig) => Promise<void>;
5
+ export declare const wrapSync: (identity: OpenFin.Identity) => WorkspacePlatformModule;
6
+ 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-platform/shapes';
3
+ export declare const getOverrideCallback: (initOptions: BrowserInitConfig) => OpenFin.OverrideCallback<OpenFin.PlatformProvider>;
@@ -0,0 +1,39 @@
1
+ /// <reference types="openfin-adapter/fin" />
2
+ export declare function overrideViewOptions(options: Partial<OpenFin.ViewOptions>): void;
3
+ export declare const filterSnapshotWindows: (win: OpenFin.WindowOptions) => boolean;
4
+ /**
5
+ * fitToMonitor()
6
+ * Function to determine if window size is too large
7
+ * for available rectangle area.
8
+ *
9
+ * - Checks monitor data for available rectangle coords
10
+ * - Defines max width/height for current monitor
11
+ * - Defines default width/height if property is not set
12
+ * - Updates options object default width/height if they exceed max values
13
+ *
14
+ * Ticket: WRK-1084
15
+ *
16
+ * @param options - Object passed into createWindow -> contains height and width
17
+ * @returns unprocessed or processed options object
18
+ */
19
+ export declare const fitToMonitor: (options: any) => Promise<any>;
20
+ declare type LegacyWindowOptions = Omit<OpenFin.PlatformWindowCreationOptions, 'workspacePlatform'> & {
21
+ pages?: OpenFin.Page[];
22
+ workstacks?: OpenFin.Page[];
23
+ };
24
+ export declare const initWorkspacePlatformOptions: (options: LegacyWindowOptions | OpenFin.PlatformWindowCreationOptions) => OpenFin.PlatformWindowCreationOptions;
25
+ /**
26
+ * hasLayout()
27
+ * Function to force layout settings
28
+ * - Check if layout property exists if so process data, else return as is
29
+ * - Define behavior settings
30
+ * - Force dimension options
31
+ * - Validate icon
32
+ *
33
+ * Ticket: WRK-???
34
+ *
35
+ * @param options - options used to handle layout settings
36
+ * @returns processed or unprocesseed options
37
+ */
38
+ export declare const applyBrowserDefaults: (options: OpenFin.PlatformWindowCreationOptions) => OpenFin.PlatformWindowCreationOptions;
39
+ export {};
@@ -1,40 +1,30 @@
1
+ /// <reference types="openfin-adapter/fin" />
1
2
  import type { InteropBroker } from 'openfin-adapter/src/api/interop';
2
-
3
3
  import type { App } from '../../client-api/src/shapes';
4
4
  import type { AttachedPage, Page, PageWithUpdatableRuntimeAttribs } from '../../common/src/api/pages/shapes';
5
-
6
5
  export type { App, Image, AppIntent } from '../../client-api/src/shapes';
7
6
  export { AppManifestType } from '../../client-api/src/shapes';
8
-
9
7
  export interface CreateSavedPageRequest {
10
8
  page: Page;
11
9
  }
12
-
13
10
  export interface UpdateSavedPageRequest {
14
11
  /** The ID of the page to update. */
15
12
  pageId: string;
16
-
17
13
  /** The updated page. */
18
14
  page: Page;
19
15
  }
20
-
21
16
  export interface ReorderPagesRequest {
22
17
  /** The ordered ids of the attached pages. */
23
18
  pageIds: string[];
24
19
  }
25
-
26
20
  export interface UpdateOpenPageRequest {
27
21
  /** The ID of the page to update. */
28
22
  pageId: string;
29
-
30
23
  /** The updated page. */
31
24
  page: Partial<PageWithUpdatableRuntimeAttribs>;
32
25
  }
33
-
34
26
  export type { Page, PageLayout, PageLayoutDetails } from '../../common/src/api/pages/shapes';
35
-
36
- export type BrowserCreateWindowRequestInternal = BrowserCreateWindowRequest & OpenFin.WindowCreationOptions;
37
-
27
+ export declare type BrowserCreateWindowRequestInternal = BrowserCreateWindowRequest & OpenFin.WindowCreationOptions;
38
28
  export interface BrowserCreateWindowRequest extends Omit<OpenFin.PlatformWindowCreationOptions, 'workspacePlatform'> {
39
29
  workspacePlatform: {
40
30
  pages: Page[];
@@ -44,7 +34,6 @@ export interface BrowserCreateWindowRequest extends Omit<OpenFin.PlatformWindowC
44
34
  newPageUrl?: string;
45
35
  };
46
36
  }
47
-
48
37
  export interface BrowserWindowModule {
49
38
  identity: OpenFin.Identity;
50
39
  openfinWindow: OpenFin.Window;
@@ -53,9 +42,7 @@ export interface BrowserWindowModule {
53
42
  * Return all the pages that are attached to a browser window.
54
43
  */
55
44
  getPages(): Promise<AttachedPage[]>;
56
-
57
45
  setActivePage(id: string): Promise<void>;
58
-
59
46
  /**
60
47
  * Attach a page to a browser window.
61
48
  * If a page with same id or title is attached to an existing browser window, an error will be thrown.
@@ -67,7 +54,6 @@ export interface BrowserWindowModule {
67
54
  updatePage(req: UpdateOpenPageRequest): Promise<void>;
68
55
  reorderPages(req: ReorderPagesRequest): Promise<void>;
69
56
  }
70
-
71
57
  export interface BrowserWindowFactory {
72
58
  /**
73
59
  * Synchronously returns a Browser Window object that represents an existing window
@@ -84,26 +70,22 @@ export interface BrowserWindowFactory {
84
70
  *
85
71
  */
86
72
  getAllWindows(): Promise<BrowserWindowModule[]>;
87
- // Overrideable execution APIs - WILL BE PART OF OVERRIDECALLBACK - TOP LEVEL, NOT NESTED
88
73
  /**
89
74
  * Create a new browser window.
90
75
  *
91
76
  * @param options the browser window creation options
92
77
  */
93
78
  createWindow: (options: BrowserCreateWindowRequest) => Promise<BrowserWindowModule>;
94
-
95
79
  /**
96
80
  * Get a unique title for a page.
97
81
  * @param title a prefix for the title.
98
82
  */
99
83
  getUniquePageTitle(title?: string): Promise<string>;
100
-
101
84
  /**
102
85
  * Get the identity of the last focused Browser window.
103
86
  */
104
87
  getLastFocusedWindow(): Promise<OpenFin.Identity>;
105
88
  }
106
-
107
89
  export interface WorkspacePlatformStorage {
108
90
  getPages(): Promise<Page[]>;
109
91
  getPage(id: string): Promise<Page>;
@@ -112,12 +94,10 @@ export interface WorkspacePlatformStorage {
112
94
  deletePage(id: string): Promise<void>;
113
95
  savePage(page: Page): Promise<void>;
114
96
  }
115
-
116
97
  export interface LaunchAppPayload {
117
98
  target?: OpenFin.EntityInfo;
118
99
  app: App;
119
100
  }
120
-
121
101
  export interface WorkspacePlatformModule extends OpenFin.Platform {
122
102
  /**
123
103
  * Launch a browser snapshot that contains windows with pages.
@@ -125,28 +105,21 @@ export interface WorkspacePlatformModule extends OpenFin.Platform {
125
105
  * @param snapshot the browser snapshot to launch or a url or filepath to retrieve a JSON snapshot.
126
106
  */
127
107
  applySnapshot(snapshot: BrowserSnapshot | string): Promise<OpenFin.Platform>;
128
-
129
108
  getSnapshot(): Promise<BrowserSnapshot>;
130
-
131
109
  launchApp: (payload: LaunchAppPayload) => Promise<void>;
132
-
133
110
  Browser: BrowserWindowFactory;
134
-
135
111
  Storage: WorkspacePlatformStorage;
136
112
  }
137
-
138
113
  export interface BrowserSnapshot {
139
114
  windows: BrowserCreateWindowRequestInternal[];
140
115
  }
141
116
  export interface WorkspacePlatformProvider extends OpenFin.PlatformProvider {
142
- // Storage Overrides
143
117
  getSavedPages(query?: string): Promise<Page[]>;
144
118
  getSavedPage(id: string): Promise<Page>;
145
119
  createSavedPage(req: CreateSavedPageRequest): Promise<void>;
146
120
  updateSavedPage(req: UpdateSavedPageRequest): Promise<void>;
147
121
  deleteSavedPage(id: string): Promise<void>;
148
122
  }
149
-
150
123
  export interface WorkspacePlatformInitConfig {
151
124
  browser: BrowserInitConfig;
152
125
  licenseKey: string;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,101 @@
1
+ /// <reference types="openfin-adapter/fin" />
2
+ import type { AttachedPage, AttachPagesToWindowPayload, DetachPagesFromWindowPayload, ReorderPagesForWindowPayload, SetActivePageForWindowPayload, UpdatePageForWindowPayload } from './shapes';
3
+ /**
4
+ * All of the remote procedures that can be called in the
5
+ * platform window's address space regarding attached pages.
6
+ */
7
+ export declare enum ChannelAction {
8
+ GetPages = "get-pages",
9
+ GetActivePageForWindow = "get-active-page-for-window",
10
+ AttachPagesToWindow = "attach-pages-to-window",
11
+ DetachPagesFromWindow = "detach-pages-from-window",
12
+ SetActivePageForWindow = "set-active-page-for-window",
13
+ RenamePage = "rename-page",
14
+ ReorderPagesForWindow = "reorder-pages-for-window",
15
+ UpdatePageForWindow = "update-page-for-window",
16
+ UpdatePagesWindowOptions = "update-pages-window-options",
17
+ IsDetachingPages = "is-detaching-pages",
18
+ IsActivePageChanging = "is-active-page-changing"
19
+ }
20
+ export declare enum EventType {
21
+ AttachedPagesToWindow = "attached-pages-to-window",
22
+ DetachedPagesFromWindow = "detached-pages-from-window"
23
+ }
24
+ export declare const getWindowChannelId: (identity: OpenFin.Identity) => string;
25
+ export declare const getEventEmitter: (identity: OpenFin.Identity) => {
26
+ emit: (event: string | number, ...payload: any[]) => Promise<void>;
27
+ addListener: (event: string | number, listener: import("@common/utils/shared-emitter").Listener) => void;
28
+ removeListener: (event: string | number, listener: import("@common/utils/shared-emitter").Listener) => void;
29
+ once: (event: string | number, listener: import("@common/utils/shared-emitter").Listener) => void;
30
+ };
31
+ /**
32
+ * Get the pages attached to a window.
33
+ * @param identity the identity of the window to get the attached pages of.
34
+ * @returns the pages attached to the window.
35
+ */
36
+ export declare const getPages: (identity: OpenFin.Identity) => Promise<AttachedPage[]>;
37
+ /**
38
+ * Get the active attached page for the specified window.
39
+ * @param identity the window identity to get the active attached page of.
40
+ * @returns the active attached page for the window.
41
+ */
42
+ export declare const getActivePageForWindow: (identity: OpenFin.Identity) => Promise<AttachedPage>;
43
+ /**
44
+ * Set the active attached page for the specified window.
45
+ * @param identity the window identity to set the active attached page of.
46
+ */
47
+ export declare const setActivePageForWindow: (payload: SetActivePageForWindowPayload) => Promise<void>;
48
+ /**
49
+ * Attach a page to an open window.
50
+ * If the page is already attached to a window, an error will be thrown.
51
+ *
52
+ * @param payload the attach pages to window payload.
53
+ */
54
+ export declare const attachPagesToWindow: (payload: AttachPagesToWindowPayload) => Promise<void>;
55
+ /**
56
+ * Detach pages from the window they are currently attached to.
57
+ * A detached page will not have its views cleaned up.
58
+ *
59
+ * @param payload the detach pages from window payload.
60
+ */
61
+ export declare const detachPagesFromWindow: (payload: DetachPagesFromWindowPayload) => Promise<void>;
62
+ export interface RenamePagePayload {
63
+ /** The OF window identity the page is attached to. */
64
+ identity: OpenFin.Identity;
65
+ /** The id of the page to change the name of. */
66
+ pageId: string;
67
+ /** The new title of the page. */
68
+ newTitle: string;
69
+ }
70
+ /**
71
+ * Rename an attached page.
72
+ * The page must be attached to the specified window.
73
+ *
74
+ * @param page the page to rename.
75
+ */
76
+ export declare const renamePage: (payload: RenamePagePayload) => Promise<void>;
77
+ /**
78
+ * Reorder pages attached to an open window.
79
+ * @param payload the reorder pages for window payload.
80
+ */
81
+ export declare const reorderPagesForWindow: (payload: ReorderPagesForWindowPayload) => Promise<void>;
82
+ /**
83
+ * Update a page attached to a window.
84
+ * @param payload the update page for window payload.
85
+ */
86
+ export declare const updatePageForWindow: (payload: UpdatePageForWindowPayload) => Promise<void>;
87
+ /**
88
+ * Forces a window to save its attached page state to window options.
89
+ * @param identity the identity of the window to save the pages of in window options.
90
+ */
91
+ export declare const updatePagesWindowOptions: (identity: OpenFin.Identity) => Promise<void>;
92
+ /**
93
+ * Check if the window identity is currently detaching pages.
94
+ * @param identity the OF window identity to check.
95
+ */
96
+ export declare const isDetachingPages: (identity: OpenFin.Identity) => Promise<boolean>;
97
+ /**
98
+ * Check if the window identity is in the middle of changing active pages.
99
+ * @param identity the OF window identity to check.
100
+ */
101
+ export declare const isActivePageChanging: (identity: OpenFin.Identity) => Promise<boolean>;
@@ -0,0 +1,12 @@
1
+ import type { Page } from '@common/api/pages/shapes';
2
+ export declare const store: import("idb-keyval").UseStore;
3
+ export declare function getPage(id: string): Promise<Page>;
4
+ export declare function getPageList(filter?: string): Promise<Page[]>;
5
+ export declare function createPage({ page }: {
6
+ page: any;
7
+ }): Promise<void>;
8
+ export declare function deletePage(id: string): Promise<void>;
9
+ export declare function updatePage({ pageId, page }: {
10
+ pageId: any;
11
+ page: any;
12
+ }): Promise<boolean>;
@@ -0,0 +1,16 @@
1
+ import { LayoutExtended } from '@common/utils/layout';
2
+ import type { AttachedPage, Page, PageLayout, PageWithUpdatableRuntimeAttribs } from './shapes';
3
+ export declare function getLegacyPages(): Promise<Page[]>;
4
+ export declare function cleanPage(page: AttachedPage): Page;
5
+ /**
6
+ * Get a page layout.
7
+ * @param layout the layout to add details to.
8
+ * @returns the layout with extra details.
9
+ */
10
+ export declare const getPageLayout: (layout: any) => Promise<PageLayout>;
11
+ /**
12
+ * Generates a Page object which represents a page.
13
+ * @param title the title for the page.
14
+ * @param layout the layout for the page.
15
+ */
16
+ export declare const makePage: (title: string, layout: LayoutExtended) => Promise<PageWithUpdatableRuntimeAttribs>;
@@ -0,0 +1,16 @@
1
+ import type { AttachedPage, PageLayout } from '@common/api/pages/shapes';
2
+ interface Workstack {
3
+ id: string;
4
+ name: string;
5
+ isReadOnly: boolean;
6
+ layout: PageLayout;
7
+ isActive: boolean;
8
+ }
9
+ export declare function convertWorkstackToAttachedPage(workstack: Workstack & AttachedPage): AttachedPage;
10
+ /**
11
+ * Attempts to fix any misconfigurations in a list of attached pages.
12
+ * @param pages the pages to fix.
13
+ * @returns the fixed pages.
14
+ */
15
+ export declare const fixAttachedPages: (pages: AttachedPage[]) => AttachedPage[];
16
+ export {};
@@ -0,0 +1,77 @@
1
+ /// <reference types="openfin-adapter/fin" />
2
+ import type { LayoutExtended } from '../../utils/layout';
3
+ export interface PageLayoutDetails {
4
+ /** The id of the machine that created the page. */
5
+ machineId: string;
6
+ /** The name of the machine that created the page. */
7
+ machineName?: string;
8
+ }
9
+ export declare type PageLayout = LayoutExtended & {
10
+ layoutDetails?: PageLayoutDetails;
11
+ };
12
+ export interface Page {
13
+ /** A UI friendly title for the page. */
14
+ title: string;
15
+ /** The unique ID of the page. */
16
+ pageId: string;
17
+ /** An optional UI friendly description of the page. */
18
+ description?: string;
19
+ /** A optional UI friendly tooltip for the page. */
20
+ tooltip?: string;
21
+ /** True if the page is read only. In this state, the page is locked and cannot be unlocked. */
22
+ isReadOnly?: boolean;
23
+ /** The layout of the page. */
24
+ layout: PageLayout;
25
+ }
26
+ declare type AttachedPageMetadata = {
27
+ /** The window the page is currently attached to. */
28
+ parentIdentity?: OpenFin.Identity;
29
+ /** True if the page is the currently active page for its parent window. */
30
+ isActive?: boolean;
31
+ /** True if the page has unsaved changes. */
32
+ hasUnsavedChanges?: boolean;
33
+ };
34
+ export declare type AttachedPage = Page & AttachedPageMetadata;
35
+ export declare type PageWithUpdatableRuntimeAttribs = Page & Pick<AttachedPage, 'hasUnsavedChanges'>;
36
+ export interface DetachPagesFromWindowPayload {
37
+ /** The OF window identity to detach the pages from. */
38
+ identity: OpenFin.Identity;
39
+ /** The ids of the pages to detach. */
40
+ pageIds: string[];
41
+ }
42
+ export interface SetActivePageForWindowPayload {
43
+ /** The OF window identity to set the active page of. */
44
+ identity: OpenFin.Identity;
45
+ /**
46
+ * The id of the page to set as active.
47
+ * The page must be attached to the target window.
48
+ */
49
+ pageId: string;
50
+ }
51
+ export interface ReorderPagesForWindowPayload {
52
+ /** The OF window identity the pages to change the order of. */
53
+ identity: OpenFin.Identity;
54
+ /** The ordered ids of the attached pages. */
55
+ pageIds: string[];
56
+ }
57
+ export interface UpdatePageForWindowPayload {
58
+ /** The OF window identity the pages to change the order of. */
59
+ identity: OpenFin.Identity;
60
+ /** The id of the attached page to update. */
61
+ pageId: string;
62
+ /** The partial updated state of the page. */
63
+ page: Partial<PageWithUpdatableRuntimeAttribs>;
64
+ }
65
+ export interface AttachPagesToWindowPayload {
66
+ /** The OF window identity to attach the pages to. */
67
+ identity: OpenFin.Identity;
68
+ /** The pages to attach. */
69
+ pages: PageWithUpdatableRuntimeAttribs[];
70
+ }
71
+ export interface GetSavedPageMetadataPayload {
72
+ /** The OF window identity to attach the pages to. */
73
+ identity: OpenFin.Identity;
74
+ /** The id of the page to get the save state of. */
75
+ pageId: string;
76
+ }
77
+ export {};
@@ -0,0 +1,63 @@
1
+ /// <reference types="openfin-adapter/fin" />
2
+ /** The name of the channel for the centralized workspace protocol. */
3
+ export declare const channelName = "__of_workspace_protocol__";
4
+ /**
5
+ * All of the remote procedures that can be called in the
6
+ * Workspace Provider's address space.
7
+ *
8
+ * When adding a new channel action make sure to register a
9
+ * handler for the remote procedure in the Workspace Provider.
10
+ * All of the registered channel action handlers can be found here:
11
+ * @see link: [Provider Protocol Handlers](https://github.com/openfin/workspace/provider/src/api/protocol.ts)
12
+ */
13
+ export declare enum ChannelAction {
14
+ RegisterStorefrontProvider = "register-storefront-provider",
15
+ DeregisterStorefrontProvider = "deregister-storefront-provider",
16
+ GetStorefrontProviders = "get-storefront-providers",
17
+ HideStorefront = "hide-storefront",
18
+ GetStorefrontProviderApps = "get-storefront-provider-apps",
19
+ GetStorefrontProviderLandingPage = "get-storefront-provider-landing-page",
20
+ GetStorefrontProviderFooter = "get-storefront-provider-footer",
21
+ GetStorefrontProviderNavigation = "get-storefront-provider-navigation",
22
+ LaunchStorefrontProviderApp = "launch-storefront-provider-app",
23
+ ShowStorefront = "show-storefront",
24
+ CreateStorefrontWindow = "create-storefront-window",
25
+ ShowHome = "show-home",
26
+ HideHome = "hide-home",
27
+ AssignHomeSearchContext = "assign-home-search-context",
28
+ GetLegacyPages = "get-legacy-pages",
29
+ GetLegacyWorkspaces = "get-legacy-workspaces"
30
+ }
31
+ export interface ChannelClient extends OpenFin.ChannelClient {
32
+ dispatch: (action: ChannelAction, payload: any) => Promise<any>;
33
+ }
34
+ /**
35
+ * Get a channel client for the centralized Workspace protocol.
36
+ *
37
+ * The channel client is automatically connected to the Workspace Provider,
38
+ * in which acts as a centralized location for executing Workspace API logic.
39
+ *
40
+ * The channel client can execute remote procedures on the provider via its `dispatch` function.
41
+ * A call to the `dispatch` function will block until the channel action has concluded execution
42
+ * in the Workspace Provider's address space.
43
+ * For a list of supported procedures, see the `ChannelAction` enum.
44
+ *
45
+ * @returns the channel client for the centralized workspace protocol.
46
+ */
47
+ export declare const getChannelClient: () => Promise<ChannelClient>;
48
+ /**
49
+ * Returns true if the current application was launched via a library (such as the Client APIs).
50
+ * Otherwise, returns false.
51
+ */
52
+ export declare const isLaunchedViaLib: () => Promise<boolean>;
53
+ /**
54
+ * Launches the Workspace Provider.
55
+ * If the Workspace Provider is already running, does nothing.
56
+ */
57
+ export declare const launchProvider: () => Promise<void>;
58
+ /**
59
+ * Launches the Workspace provider if it is not running.
60
+ * Then gets a Channel Client that is connected to the Workspace Provider.
61
+ * @returns the Channel Client that is connected to the Workspace Provider.
62
+ */
63
+ export declare const getChannelClientAndLaunchProvider: () => Promise<ChannelClient>;
@@ -0,0 +1,7 @@
1
+ /// <reference types="openfin-adapter/fin" />
2
+ export interface Workspace {
3
+ workspaceId: string;
4
+ title: string;
5
+ snapshot: OpenFin.Snapshot;
6
+ }
7
+ export declare const getLegacyWorkspaces: () => Promise<Workspace[]>;
@@ -0,0 +1,38 @@
1
+ /// <reference types="openfin-adapter/fin" />
2
+ export declare enum ApplicationUUID {
3
+ /**
4
+ * The UUID of workspace.
5
+ * Home is a part of this application.
6
+ */
7
+ Workspace = "openfin-browser"
8
+ }
9
+ export interface ApplicationEvent {
10
+ viewIdentity?: OpenFin.Identity;
11
+ name?: string;
12
+ uuid?: string;
13
+ }
14
+ export declare type ApplicationListener = (ev: ApplicationEvent) => void;
15
+ export declare enum ApplicationEventType {
16
+ RunRequested = "run-requested",
17
+ WindowOptionsChanged = "window-options-changed",
18
+ WindowClosed = "window-closed",
19
+ WindowCreated = "window-created"
20
+ }
21
+ export declare enum LaunchModeType {
22
+ FinProtocol = "fin-protocol"
23
+ }
24
+ export declare type ApplicationInfoExtended = OpenFin.ApplicationInfo & {
25
+ initialOptions: OpenFin.ApplicationInfo['initialOptions'] & {
26
+ userAppConfigArgs: any;
27
+ };
28
+ };
29
+ export declare const currentOFAppIdentity: {
30
+ uuid: string;
31
+ name: string;
32
+ };
33
+ export declare const workspaceOFAppIdentity: {
34
+ name: ApplicationUUID;
35
+ uuid: ApplicationUUID;
36
+ };
37
+ export declare const getCurrentOFApplication: () => import("openfin-adapter").Application;
38
+ export declare const getWorkspaceOFApplication: () => import("openfin-adapter").Application;
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Make a function that connects to a channel.
3
+ * If already connected to the channel, will return the channel connection.
4
+ * If disconnected from the channel, will automatically reconnect.
5
+ * @param channelName the name of the channel to connect to.
6
+ * @returns the function to connect to the channel.
7
+ */
8
+ export default function makeGetChannelClient(channelName: string): () => Promise<import("openfin-adapter").ChannelClient>;
@@ -0,0 +1,16 @@
1
+ declare const makeDebouncedFunc: <T extends (...args: any[]) => Promise<any>>(func: T, debounceTimeout?: number) => T;
2
+ /**
3
+ * Debounce a specified function.
4
+ *
5
+ * When the debounced function is called, the underlying wrapped function
6
+ * will be called.
7
+ *
8
+ * If the function is called again while the promise returned by the wrapped
9
+ * function is still resolving, the call will be blocked until the promise has
10
+ * resolved.
11
+ *
12
+ * Once the promise has been resolved, the wrapped function will be called again
13
+ * after a specified debounce timeout.
14
+ *
15
+ */
16
+ export default makeDebouncedFunc;