@openfin/workspace-platform 4.3.0 → 4.7.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 (102) 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 +48 -0
  9. package/client-api-platform/src/api/storage.d.ts +10 -0
  10. package/client-api-platform/src/api/theming.d.ts +5 -0
  11. package/client-api-platform/src/api/workspace-module.d.ts +3 -0
  12. package/client-api-platform/src/index.d.ts +6 -0
  13. package/client-api-platform/src/init/browser-window-focus.d.ts +19 -0
  14. package/client-api-platform/src/init/cleanup.d.ts +1 -0
  15. package/client-api-platform/src/init/index.d.ts +5 -0
  16. package/client-api-platform/src/init/override-callback.d.ts +3 -0
  17. package/client-api-platform/src/init/theming.d.ts +9 -0
  18. package/client-api-platform/src/init/utils.d.ts +39 -0
  19. package/client-api-platform/src/shapes.d.ts +278 -0
  20. package/client-api-platform/src/umd.d.ts +1 -0
  21. package/common/src/api/pages/attached.d.ts +101 -0
  22. package/common/src/api/pages/idb.d.ts +12 -0
  23. package/common/src/api/pages/index.d.ts +16 -0
  24. package/common/src/api/pages/legacy.d.ts +16 -0
  25. package/common/src/api/pages/shapes.d.ts +77 -0
  26. package/common/src/api/protocol.d.ts +63 -0
  27. package/common/src/api/theming.d.ts +60 -0
  28. package/common/src/api/workspaces/index.d.ts +7 -0
  29. package/common/src/utils/application.d.ts +38 -0
  30. package/common/src/utils/channels.d.ts +8 -0
  31. package/common/src/utils/debounce.d.ts +16 -0
  32. package/common/src/utils/env.d.ts +30 -0
  33. package/common/src/utils/layout.d.ts +52 -0
  34. package/common/src/utils/local-storage-key.d.ts +8 -0
  35. package/common/src/utils/logger/index.d.ts +26 -0
  36. package/common/src/utils/logger/manager.d.ts +35 -0
  37. package/common/src/utils/logger/shapes.d.ts +27 -0
  38. package/common/src/utils/route.d.ts +55 -0
  39. package/common/src/utils/shared-emitter.d.ts +10 -0
  40. package/common/src/utils/snapshot.d.ts +33 -0
  41. package/common/src/utils/strings.d.ts +5 -0
  42. package/common/src/utils/theming.d.ts +57 -0
  43. package/common/src/utils/umd.d.ts +2 -0
  44. package/common/src/utils/window.d.ts +146 -0
  45. package/index.d.ts +1 -0
  46. package/index.js +2 -0
  47. package/index.js.map +1 -0
  48. package/package.json +1 -34
  49. package/search-api/src/client/index.d.ts +6 -0
  50. package/search-api/src/client/internal.d.ts +38 -0
  51. package/search-api/src/client/remote/channel-client-factory.d.ts +2 -0
  52. package/search-api/src/client/remote/channel-client.d.ts +9 -0
  53. package/search-api/src/client/remote/data.d.ts +16 -0
  54. package/search-api/src/client/remote/disconnect.d.ts +7 -0
  55. package/search-api/src/client/remote/dispatch.d.ts +9 -0
  56. package/search-api/src/client/remote/requests.d.ts +5 -0
  57. package/search-api/src/client/remote/search-close.d.ts +14 -0
  58. package/search-api/src/common.d.ts +104 -0
  59. package/search-api/src/errors.d.ts +5 -0
  60. package/search-api/src/fin/index.d.ts +6 -0
  61. package/search-api/src/fin/shapes.d.ts +23 -0
  62. package/search-api/src/index.d.ts +7 -0
  63. package/search-api/src/internal-shapes.d.ts +134 -0
  64. package/search-api/src/logger.d.ts +1 -0
  65. package/search-api/src/provider/index.d.ts +8 -0
  66. package/search-api/src/provider/internal.d.ts +33 -0
  67. package/search-api/src/provider/remote/channel-factory.d.ts +6 -0
  68. package/search-api/src/provider/remote/channel.d.ts +23 -0
  69. package/search-api/src/provider/remote/connection.d.ts +20 -0
  70. package/search-api/src/provider/remote/data.d.ts +23 -0
  71. package/search-api/src/provider/remote/deregistration.d.ts +5 -0
  72. package/search-api/src/provider/remote/disconnect.d.ts +1 -0
  73. package/search-api/src/provider/remote/disconnection.d.ts +9 -0
  74. package/search-api/src/provider/remote/dispatch.d.ts +7 -0
  75. package/search-api/src/provider/remote/info.d.ts +5 -0
  76. package/search-api/src/provider/remote/registration.d.ts +23 -0
  77. package/search-api/src/provider/remote/search-close.d.ts +14 -0
  78. package/search-api/src/provider/remote/search.d.ts +8 -0
  79. package/search-api/src/shapes.d.ts +541 -0
  80. package/.eslintignore +0 -1
  81. package/.eslintrc.js +0 -2
  82. package/.prettierrc.js +0 -2
  83. package/babel.config.js +0 -2
  84. package/jest.config.js +0 -2
  85. package/src/api/app-directory.ts +0 -45
  86. package/src/api/browser/browser-module.ts +0 -65
  87. package/src/api/browser/index.ts +0 -46
  88. package/src/api/pages/helper.ts +0 -113
  89. package/src/api/pages/index.ts +0 -164
  90. package/src/api/protocol.ts +0 -60
  91. package/src/api/storage.ts +0 -32
  92. package/src/api/workspace-module.ts +0 -36
  93. package/src/index.ts +0 -35
  94. package/src/init/browser-window-focus.ts +0 -59
  95. package/src/init/cleanup.ts +0 -87
  96. package/src/init/index.ts +0 -42
  97. package/src/init/override-callback.ts +0 -159
  98. package/src/init/utils.ts +0 -164
  99. package/src/shapes.ts +0 -160
  100. package/src/umd.ts +0 -5
  101. package/tsconfig.json +0 -13
  102. package/webpack.common.config.js +0 -1
@@ -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
+ SetActivePageForWindow = "setActivePageForWindow",
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/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/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,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.ApplicationIdentity) => 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,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,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 {};
@@ -0,0 +1,278 @@
1
+ /// <reference types="openfin-adapter/fin" />
2
+ import type { InteropBroker } from 'openfin-adapter/src/api/interop';
3
+ import type { App } from '../../client-api/src/shapes';
4
+ import type { AttachedPage, Page, PageWithUpdatableRuntimeAttribs } from '../../common/src/api/pages/shapes';
5
+ import type { CustomThemes } from '../../common/src/api/theming';
6
+ export type { CustomThemes } from '../../common/src/api/theming';
7
+ export type { App, Image, AppIntent } from '../../client-api/src/shapes';
8
+ export { AppManifestType } from '../../client-api/src/shapes';
9
+ export type { AttachedPage, Page, PageWithUpdatableRuntimeAttribs, PageLayout, PageLayoutDetails } from '../../common/src/api/pages/shapes';
10
+ /**
11
+ * Request for creating a saved page in persistent storage.
12
+ */
13
+ export interface CreateSavedPageRequest {
14
+ /** The page to create. */
15
+ page: Page;
16
+ }
17
+ /**
18
+ * Request for updating a saved page in persistent storage.
19
+ */
20
+ export interface UpdateSavedPageRequest {
21
+ /** The ID of the page to update. */
22
+ pageId: string;
23
+ /** The updated page. */
24
+ page: Page;
25
+ }
26
+ /**
27
+ * Request for reordering the pages attached to a window.
28
+ */
29
+ export interface ReorderPagesRequest {
30
+ /** An array of page ids that specify the order of the pages attached to the window. */
31
+ pageIds: string[];
32
+ }
33
+ /**
34
+ * Request to update the attributes of a page in which is attached to a running browser window.
35
+ */
36
+ export interface UpdateAttachedPageRequest {
37
+ /** The ID of the page to update. */
38
+ pageId: string;
39
+ /** The updated page. */
40
+ page: Partial<PageWithUpdatableRuntimeAttribs>;
41
+ }
42
+ /**
43
+ * Request for creating a browser window.
44
+ */
45
+ export interface BrowserCreateWindowRequest extends Omit<OpenFin.PlatformWindowCreationOptions, 'workspacePlatform'> {
46
+ workspacePlatform: {
47
+ /** The initial set of pages to add to the created browser window. */
48
+ pages: Page[];
49
+ /** The favicon to display on the top right of the created browser window. */
50
+ favicon?: string;
51
+ /** A UI friendly title for the created browser window. */
52
+ title?: string;
53
+ /** A URL to use when creating a new tab. */
54
+ newTabUrl?: string;
55
+ /** A URL to use when creating the initial tab in a new page. */
56
+ newPageUrl?: string;
57
+ };
58
+ }
59
+ /**
60
+ * A window that is part of a browser snapshot.
61
+ */
62
+ export declare type BrowserSnapshotWindow = OpenFin.WindowCreationOptions & BrowserCreateWindowRequest;
63
+ /**
64
+ * A browser snapshot.
65
+ */
66
+ export interface BrowserSnapshot {
67
+ /** The state of the windows that were running at the time the snapshot was taken. */
68
+ windows: BrowserSnapshotWindow[];
69
+ }
70
+ /**
71
+ * Controller for interacting with a browser window.
72
+ */
73
+ export interface BrowserWindowModule {
74
+ /** The identity of the browser window. */
75
+ identity: OpenFin.Identity;
76
+ /** Underlying OpenFin window Controller. */
77
+ openfinWindow: OpenFin.Window;
78
+ /**
79
+ * Get a page that is attached to the browser window.
80
+ * @param id the id of the page to get.
81
+ */
82
+ getPage(id: string): Promise<AttachedPage>;
83
+ /**
84
+ * Return all the pages that are attached to a browser window.
85
+ */
86
+ getPages(): Promise<AttachedPage[]>;
87
+ /**
88
+ * Set the active page for the browser window.
89
+ * @param id the id of the attached page to set as active.
90
+ */
91
+ setActivePage(id: string): Promise<void>;
92
+ /**
93
+ * Attach a page to a browser window.
94
+ * If a page with same id or title is attached to an existing browser window, an error will be thrown.
95
+ *
96
+ * @param page the attach page to a browser window.
97
+ */
98
+ addPage(page: PageWithUpdatableRuntimeAttribs): Promise<void>;
99
+ /**
100
+ * Remove an attached page from the browser window.
101
+ * @param id the id of the attached page to remove from the browser window.
102
+ */
103
+ removePage(id: string): Promise<void>;
104
+ /**
105
+ * Update a page in which is attached to the browser window.
106
+ * @param req the update request.
107
+ */
108
+ updatePage(req: UpdateAttachedPageRequest): Promise<void>;
109
+ /**
110
+ * Reorder pages attached to the browser window.
111
+ * @param req the reorder pages request.
112
+ */
113
+ reorderPages(req: ReorderPagesRequest): Promise<void>;
114
+ }
115
+ /**
116
+ * Factory for wrapping browser windows and global operations.
117
+ */
118
+ export interface BrowserWindowFactory {
119
+ /**
120
+ * Synchronously returns a Browser Window object that represents an existing window
121
+ *
122
+ * @param identity of the window
123
+ */
124
+ wrapSync: (identity: OpenFin.Identity) => BrowserWindowModule;
125
+ /**
126
+ * Get a list of all pages that are attached to any running browser window.
127
+ */
128
+ getAllAttachedPages(): Promise<AttachedPage[]>;
129
+ /**
130
+ * Get all the Browser Windows that are running in the Workspace Platform.
131
+ */
132
+ getAllWindows(): Promise<BrowserWindowModule[]>;
133
+ /**
134
+ * Create a new browser window.
135
+ * @param options the browser window creation options
136
+ */
137
+ createWindow(options: BrowserCreateWindowRequest): Promise<BrowserWindowModule>;
138
+ /**
139
+ * Get a unique title for a page.
140
+ * @param title a prefix for the title.
141
+ */
142
+ getUniquePageTitle(title?: string): Promise<string>;
143
+ /**
144
+ * Get the identity of the last focused Browser window.
145
+ */
146
+ getLastFocusedWindow(): Promise<OpenFin.Identity>;
147
+ }
148
+ /**
149
+ * API for interacting with persistent storage.
150
+ */
151
+ export interface WorkspacePlatformStorage {
152
+ /**
153
+ * Get all pages that are saved in persistent storage.
154
+ */
155
+ getPages(): Promise<Page[]>;
156
+ /**
157
+ * Get a specific page in persistent storage.
158
+ * @param id the id of the page to get.
159
+ */
160
+ getPage(id: string): Promise<Page>;
161
+ /**
162
+ * Create a page in persistent storage.
163
+ * @param page the page to create in persistent storage.
164
+ */
165
+ createPage(page: CreateSavedPageRequest): Promise<void>;
166
+ /**
167
+ * Update a page in persistent storage.
168
+ * @param req the update saved page request.
169
+ */
170
+ updatePage(req: UpdateSavedPageRequest): Promise<void>;
171
+ /**
172
+ * Delete a page from persistent storage.
173
+ * @param id the id of the page to delete.
174
+ */
175
+ deletePage(id: string): Promise<void>;
176
+ /**
177
+ * Save a page in persistent storage.
178
+ *
179
+ * This is a helper function that will call `getPage` to determine if a page is already in storage.
180
+ * If the page is already in storage, it will call `updatePage`.
181
+ * If it does not exist in storage, the function will call `createPage` instead.
182
+ * @param page the page to save.
183
+ */
184
+ savePage(page: Page): Promise<void>;
185
+ }
186
+ /**
187
+ * Request for launching an application.
188
+ */
189
+ export interface LaunchAppRequest {
190
+ target?: OpenFin.EntityInfo;
191
+ app: App;
192
+ }
193
+ /**
194
+ * Get Themes from API
195
+ */
196
+ export interface ThemeApi {
197
+ getThemes(): Promise<CustomThemes>;
198
+ }
199
+ /**
200
+ * Controller for a Workspace Platform.
201
+ */
202
+ export interface WorkspacePlatformModule extends OpenFin.Platform {
203
+ /**
204
+ * Launch a browser snapshot that contains windows with pages.
205
+ *
206
+ * @param snapshot the browser snapshot to launch or a url or filepath to retrieve a JSON snapshot.
207
+ */
208
+ applySnapshot(snapshot: BrowserSnapshot | string): Promise<OpenFin.Platform>;
209
+ /**
210
+ * Get a snapshot that contains browser windows with pages.
211
+ */
212
+ getSnapshot(): Promise<BrowserSnapshot>;
213
+ /**
214
+ * Launch an application.
215
+ * @param req the launch app request.
216
+ */
217
+ launchApp(req: LaunchAppRequest): Promise<void>;
218
+ /**
219
+ * The browser window factory for the Workspace Platform.
220
+ */
221
+ Browser: BrowserWindowFactory;
222
+ /**
223
+ * The storage API for the Workspace Platform.
224
+ */
225
+ Storage: WorkspacePlatformStorage;
226
+ Theme: ThemeApi;
227
+ }
228
+ export interface WorkspacePlatformProvider extends OpenFin.PlatformProvider {
229
+ /**
230
+ * Implementation for getting a list of saved pages from persistent storage.
231
+ * @param query an optional query.
232
+ */
233
+ getSavedPages(query?: string): Promise<Page[]>;
234
+ /**
235
+ * Implementation for getting a single page in persistent storage.
236
+ * @param id
237
+ */
238
+ getSavedPage(id: string): Promise<Page>;
239
+ /**
240
+ * Implementation for creating a saved page in persistent storage.
241
+ * @param req the create saved page request.
242
+ */
243
+ createSavedPage(req: CreateSavedPageRequest): Promise<void>;
244
+ /**
245
+ * Implementation for updating a saved page in persistent storage.
246
+ * @param req the update saved page request.
247
+ */
248
+ updateSavedPage(req: UpdateSavedPageRequest): Promise<void>;
249
+ /**
250
+ * Implementation for deleting a saved page in persistent storage.
251
+ * @param id of the id of the page to delete.
252
+ */
253
+ deleteSavedPage(id: string): Promise<void>;
254
+ }
255
+ /**
256
+ * Configuration for initializing a Workspace platform.
257
+ */
258
+ export interface WorkspacePlatformInitConfig {
259
+ /** Config for overriding browser options and behavior. */
260
+ browser?: BrowserInitConfig;
261
+ /** License key for Workspace Platform. */
262
+ licenseKey: string;
263
+ /** Custom Themes object */
264
+ theme?: CustomThemes;
265
+ }
266
+ /**
267
+ * Callback for overriding a Workspace Platform Provider.
268
+ */
269
+ export declare type BrowserOverrideCallback = OpenFin.OverrideCallback<WorkspacePlatformProvider>;
270
+ /**
271
+ * Configuration for initializing a Browser.
272
+ */
273
+ export interface BrowserInitConfig {
274
+ defaultWindowOptions?: BrowserCreateWindowRequest;
275
+ defaultViewOptions?: OpenFin.ViewOptions;
276
+ overrideCallback?: BrowserOverrideCallback;
277
+ interopOverride?: OpenFin.OverrideCallback<InteropBroker, InteropBroker>;
278
+ }
@@ -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<void>;
@@ -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 {};