@openfin/workspace-platform 12.6.6 → 13.0.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.
Files changed (37) hide show
  1. package/client-api/src/dock.d.ts +13 -7
  2. package/client-api/src/shapes/dock.d.ts +112 -8
  3. package/client-api/src/shapes/store.d.ts +6 -100
  4. package/client-api/src/store.d.ts +66 -10
  5. package/client-api-platform/src/api/context-menu/browser-viewtab-handler.test.d.ts +1 -0
  6. package/client-api-platform/src/api/dock/idb.d.ts +4 -0
  7. package/client-api-platform/src/api/name-collisions.d.ts +14 -0
  8. package/client-api-platform/src/api/name-collisions.test.d.ts +1 -0
  9. package/client-api-platform/src/api/pages/helper.d.ts +0 -13
  10. package/client-api-platform/src/api/pages/index.d.ts +4 -2
  11. package/client-api-platform/src/api/storage.d.ts +2 -16
  12. package/client-api-platform/src/api/utils.d.ts +0 -1
  13. package/client-api-platform/src/init/browser-defaults.d.ts +7 -0
  14. package/client-api-platform/src/init/browser-defaults.test.d.ts +1 -0
  15. package/client-api-platform/src/init/override-callback.d.ts +1 -1
  16. package/client-api-platform/src/init/page-defaults.d.ts +3 -0
  17. package/client-api-platform/src/init/page-defaults.test.d.ts +1 -0
  18. package/client-api-platform/src/init/panels.test.d.ts +1 -0
  19. package/client-api-platform/src/init/utils.d.ts +4 -12
  20. package/client-api-platform/src/shapes.d.ts +28 -4
  21. package/common/src/api/pages/legacy.d.ts +1 -1
  22. package/common/src/api/protocol/workspace-platform.d.ts +3 -1
  23. package/common/src/api/protocol/workspace.d.ts +2 -0
  24. package/common/src/api/provider.d.ts +72 -23
  25. package/common/src/api/search.d.ts +1 -1
  26. package/common/src/api/storefront.d.ts +8 -25
  27. package/common/src/utils/create-and-migrate-ibd-store.d.ts +1 -0
  28. package/common/src/utils/env.d.ts +1 -0
  29. package/common/src/utils/layout.d.ts +22 -10
  30. package/common/src/utils/route.d.ts +0 -2
  31. package/common/src/utils/types.d.ts +22 -0
  32. package/common/src/utils/unique-toolbar-options.d.ts +1 -1
  33. package/common/src/utils/window.d.ts +0 -2
  34. package/index.js +5 -5
  35. package/index.js.map +1 -1
  36. package/package.json +7 -5
  37. package/search-api/src/logger.d.ts +0 -1
@@ -1,5 +1,5 @@
1
1
  import type { DockProvider } from './shapes/dock';
2
- import { RegistrationMetaInfo } from './shapes';
2
+ import { DockProviderRegistration } from './shapes/dock';
3
3
  export * from './shapes/dock';
4
4
  /**
5
5
  * Registers a Dock provider
@@ -23,10 +23,12 @@ export * from './shapes/dock';
23
23
  * await Dock.register(provider)
24
24
  * ```
25
25
  */
26
- export declare const register: (provider: DockProvider) => Promise<RegistrationMetaInfo>;
26
+ export declare const register: (provider: DockProvider) => Promise<DockProviderRegistration>;
27
27
  /**
28
- * Deregister a Dock provider
29
- * @returns promise - invokes action
28
+ * API function to Deregister a Dock provider
29
+ *
30
+ * @returns a promise that resolves once the dock is deregistered
31
+ *
30
32
  * ```ts
31
33
  * await Dock.deregister();
32
34
  * ```
@@ -34,15 +36,19 @@ export declare const register: (provider: DockProvider) => Promise<RegistrationM
34
36
  export declare const deregister: () => Promise<void>;
35
37
  /**
36
38
  * API function to minimize Dock
37
- * @returns promise - invokes action
39
+ *
40
+ * @returns a promise that resolves once the dock is minimized
41
+ *
38
42
  * ```ts
39
43
  * await Dock.minimize();
40
44
  * ```
41
45
  */
42
46
  export declare const minimize: () => Promise<void>;
43
47
  /**
44
- * Shows Dock window if enabled & registered
45
- * @returns promise - invokes action
48
+ * API function to show Dock
49
+ *
50
+ * @returns a promise that resolves once the dock is shown
51
+ *
46
52
  * ```ts
47
53
  * await Dock.show();
48
54
  * ```
@@ -1,8 +1,13 @@
1
1
  import { CustomButtonConfig, CustomDropdownConfig } from '../../../common/src/api/action';
2
+ import { RegistrationMetaInfo } from '../../../client-api/src/shapes/common';
2
3
  import { ProviderInfo } from './provider';
3
4
  /**
4
5
  * Allows you to hide buttons for different Workspace components in the Dock UI.
5
6
  * By default, all components are shown.
7
+ *
8
+ * @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.
9
+ *
10
+ * @example
6
11
  * ```ts
7
12
  * const workspaceComponentButtonOptions: WorkspaceComponentButtonOptions = {
8
13
  * hideHomeButton: true,
@@ -96,7 +101,70 @@ export interface DockDropdownConfig extends CustomDropdownConfig {
96
101
  /**
97
102
  * Dock button types
98
103
  */
99
- export declare type DockButton = DockButtonConfig | DockDropdownConfig;
104
+ export declare type DockButton = {
105
+ /** Optional button identifier, if not provided will be automatically generated by the provider */ id?: string;
106
+ } & (DockButtonConfig | DockDropdownConfig);
107
+ /**
108
+ * The names of the buttons for the workspace components on the Dock.
109
+ *
110
+ * Used in {@link WorkspaceButtonsConfig}.
111
+ */
112
+ export declare type WorkspaceButton = 'switchWorkspace' | 'home' | 'notifications' | 'store';
113
+ /**
114
+ * Controls the visibility as well as the order of buttons for workspace components on the Dock.
115
+ *
116
+ * To hide a button, remove it from the array.
117
+ *
118
+ * The array should not contain duplicate values.
119
+ *
120
+ * @example - Hide the Home button and move the Notifications button to the first position.
121
+ * ```ts
122
+ * const workspaceButtonsConfig: WorkspaceButtonsConfig = [
123
+ * 'notifications',
124
+ * 'switchWorkspace',
125
+ * 'store'
126
+ * ];
127
+ * ```
128
+ *
129
+ * @example - Hide all of the workspace buttons.
130
+ *
131
+ * ```ts
132
+ * const workspaceButtonsConfig: WorkspaceButtonsConfig = [];
133
+ * ```
134
+ */
135
+ export declare type WorkspaceButtonsConfig = WorkspaceButton[];
136
+ /**
137
+ * Configuration for the Dock provider.
138
+ */
139
+ export interface DockProviderConfig {
140
+ /**
141
+ * Controls the visibility of buttons for workspace components on the Dock.
142
+ * All components are visible by default, but you can hide any of them.
143
+ *
144
+ * @default - All components are visible. (['switchWorkspace', 'home', 'notifications', 'store'])
145
+ */
146
+ workspaceComponents?: WorkspaceComponentButtonOptions | WorkspaceButtonsConfig;
147
+ /**
148
+ * Buttons for platform-specific custom actions to display on the Dock.
149
+ */
150
+ buttons?: DockButton[];
151
+ /**
152
+ * If true, the user will not be able to rearrange the buttons on the Dock.
153
+ *
154
+ * @default false
155
+ */
156
+ disableUserRearrangement?: boolean;
157
+ /**
158
+ * A UI friendly title for the provider platform.
159
+ */
160
+ title: string;
161
+ /**
162
+ * Icon for the provider.
163
+ */
164
+ icon: string;
165
+ }
166
+ export interface DockProviderConfigWithIdentity extends ProviderInfo, DockProviderConfig {
167
+ }
100
168
  /**
101
169
  * <h3>Sample DockProvider definition.</h3>
102
170
  *
@@ -166,7 +234,7 @@ export declare type DockButton = DockButtonConfig | DockDropdownConfig;
166
234
  * });
167
235
  *```
168
236
  *
169
- * Register dock ``provider`` object.
237
+ * Register Dock ``provider`` object.
170
238
  * ```ts
171
239
  * await Dock.register(provider);
172
240
  * ```
@@ -175,14 +243,50 @@ export declare type DockButton = DockButtonConfig | DockDropdownConfig;
175
243
  * await Dock.show();
176
244
  * ```
177
245
  */
178
- export interface DockProvider extends ProviderInfo {
246
+ export interface DockProvider extends DockProviderConfigWithIdentity {
179
247
  /**
180
- * Controls the visibility of buttons for workspace components on the Dock.
181
- * All components are visible by default, but you can hide any of them.
248
+ * Function that is invoked when the configuration of the Dock changes.
249
+ *
250
+ * This may be triggered by users reordering the buttons;
251
+ *
252
+ * @param config The new Dock configuration.
253
+ * @returns Promise that resolves when the callback completes.
182
254
  */
183
- workspaceComponents?: WorkspaceComponentButtonOptions;
255
+ onDockProviderConfigChanged?: (config: DockProviderConfig) => Promise<void> | void;
184
256
  /**
185
- * Buttons for platform-specific custom actions to display on the Dock.
257
+ * By default, the Dock will save the user's configuration and restore it on the next launch.
258
+ *
259
+ * If true, the currently stored configuration will be ignored and the Dock will use the configuration provided by the provider.
260
+ *
261
+ * @default false
186
262
  */
187
- buttons?: DockButton[];
263
+ skipSavedDockProviderConfig?: boolean;
264
+ }
265
+ /**
266
+ * Return type from the Dock registration call.
267
+ */
268
+ export interface DockProviderRegistration extends RegistrationMetaInfo {
269
+ /**
270
+ * Updates the Dock configuration.
271
+ *
272
+ * @param request The new Dock configuration.
273
+ * @returns Promise that resolves when the update completes.
274
+ *
275
+ * @example
276
+ * ```ts
277
+ * const newConfig: DockProviderConfig = {
278
+ * buttons: [{
279
+ * tooltip: 'Sample Button 1',
280
+ * iconUrl: 'https://www.openfin.co/favicon-32x32.png',
281
+ * action: {
282
+ * id: 'sampleButton1'
283
+ * }
284
+ * }]
285
+ * };
286
+ *
287
+ * await dockProviderRegistration.updateDockProviderConfig(newConfig);
288
+ * ```
289
+ *
290
+ */
291
+ updateDockProviderConfig: (request: DockProviderConfig) => Promise<void>;
188
292
  }
@@ -3,7 +3,6 @@
3
3
  * up the packaged typing files. When writing code examples,
4
4
  * for documentation, please use async/await syntax over .then()!
5
5
  */
6
- import { UpdateButtonConfigRequest } from '../../../client-api/src/store';
7
6
  import { CustomButtonConfig, RegistrationMetaInfo } from './common';
8
7
  import { ProviderInfo } from './provider';
9
8
  /**
@@ -226,6 +225,11 @@ export interface StorefrontNavigationItemAppGrid extends StorefrontNavigationIte
226
225
  */
227
226
  templateData: StorefrontAppGrid;
228
227
  }
228
+ export interface UpdateButtonConfigRequest {
229
+ appId: string;
230
+ primaryButton: StoreButtonConfig;
231
+ secondaryButtons: StoreButtonConfig[];
232
+ }
229
233
  /**
230
234
  * Response from store registration which includes metadata and a function to update app cards buttons.
231
235
  */
@@ -306,8 +310,6 @@ export declare type StorefrontNavigationItem = StorefrontNavigationItemAppGrid |
306
310
  * Render an item in the navigation bar of Storefront with a description and image.
307
311
  */
308
312
  export declare type StorefrontDetailedNavigationItem = StorefrontNavigationItem & StorefrontNavigationItemDetails;
309
- export interface StorefrontProviderInfo extends ProviderInfo {
310
- }
311
313
  /**
312
314
  * Describes a Storefront provided by a platform.
313
315
  * A platform must provide an object that satisfies this interface in order to register with the Storefront.
@@ -339,7 +341,7 @@ export interface StorefrontProviderInfo extends ProviderInfo {
339
341
  * await Storefront.register(provider);
340
342
  * ```
341
343
  */
342
- export interface StorefrontProvider extends StorefrontProviderInfo {
344
+ export interface StorefrontProvider extends ProviderInfo {
343
345
  /**
344
346
  * Get a list of apps to populate the platform's Storefront with.
345
347
  *
@@ -482,99 +484,3 @@ export interface StorefrontProvider extends StorefrontProviderInfo {
482
484
  */
483
485
  launchApp(app: App): Promise<void>;
484
486
  }
485
- /**
486
- * Interface that contains functions for integrating with Storefront.
487
- */
488
- export interface StorefrontAPI {
489
- /**
490
- * Registers a [[`StorefrontProvider`]]. Upon registering a provider,
491
- * the title of your provider appears in the menu of the Storefront UI.
492
- * When a user selects your Storefront, the methods on the provider
493
- * object are called to populate the UI. Throws an error if a provider with
494
- * the same `id` already exists.
495
- *
496
- * ```ts
497
- * import { Storefront, StorefrontProvider } from "@openfin/workspace";
498
- *
499
- * //Declare a provider
500
- * const myStorefrontProvider: StorefrontProvider = {
501
- * id: "my-storefront-id"
502
- * title: "My StorefrontProvider"
503
- * icon: "https://cdn.openfin.co/demos/notifications/generator/images/icon-blue.png",
504
- * getApps: () => {...},
505
- * getNavigation: () => {...},
506
- * getLandingPage: () => {...},
507
- * getFooter: () => {...},
508
- * launchApp: () => {...}
509
- * };
510
- *
511
- * const registerProvider = async () => {
512
- * await Storefront.register(myStorefrontProvider);
513
- * }
514
- * ```
515
- * @param provider the implementation of a Storefront provider.
516
-
517
- */
518
- register(provider: StorefrontProvider): Promise<RegistrationMetaInfo>;
519
- /**
520
- * Deregister a [[StorefrontProvider]].
521
- *
522
- * ```ts
523
- * import { Storefront, StorefrontProvider } from "@openfin/workspace";
524
- *
525
- * //Instantiate a StorefrontProvider
526
- * const myStorefrontProvider: StorefrontProvider = {
527
- * id: "my-storefront-id"
528
- * title: "My StoreFrontProvider"
529
- * icon: "https://cdn.openfin.co/demos/notifications/generator/images/icon-blue.png",
530
- * getApps: () => {...},
531
- * getNavigation: () => {...},
532
- * getLandingPage: () => {...},
533
- * getFooter: () => {...},
534
- * launchApp: () => {...}
535
- * };
536
- *
537
- * const register = async () => {
538
- * await Storefront.register(myStorefrontProvider);
539
- * }
540
- *
541
- * //Do work with myStorefrontProvider
542
- *
543
- * const deregister = async () => {
544
- * await Storefront.deregister("my-storefront-id");
545
- * }
546
- * ```
547
- * @param id the id of the provider.
548
- */
549
- deregister(id: string): Promise<void>;
550
- /**
551
- * Shows the Storefront window. Awaits for the latest [[`Storefront.register()`]]
552
- * internally, so you don't have to. Throws an error if a [[StorefrontProvider]]
553
- * doesn't exist (i.e., because `register()` not called previously).
554
- *
555
- * ```ts
556
- * import { Storefront } from "@openfin/workspace";
557
- *
558
- * const show = async () => {
559
- * await Storefront.show();
560
- * //Do thing after show
561
- * }
562
- * ```
563
- */
564
- show(): Promise<void>;
565
- /**
566
- * Hides the Storefront window. Awaits for the latest [[`Storefront.register()`]]
567
- * internally, so you don't have to. Throws an error if a [[StorefrontProvider]]
568
- * doesn't exist (i.e., because `register()` was not called previously).
569
- *
570
- * ```ts
571
- * import { Storefront } from "@openfin/workspace";
572
- *
573
- * const hide = async () => {
574
- * await Storefront.hidef();
575
- * //Do thing after show
576
- * }
577
- * ```
578
- */
579
- hide(): Promise<void>;
580
- }
@@ -1,25 +1,81 @@
1
1
  import type { StorefrontProvider, StoreRegistration } from './shapes/store';
2
2
  export * from './shapes/store';
3
- import { StoreButtonConfig } from './shapes/store';
4
3
  /**
5
- * Registers a Storefront provider
4
+ * Registers a {@link StorefrontProvider}.
5
+ *
6
+ * Throws an error if a provider with the same `id` already exists.
7
+ *
8
+ * @param provider the implementation of a Storefront provider.
9
+ *
10
+ * @example
11
+ * ```ts
12
+ * import { Storefront, StorefrontProvider } from "@openfin/workspace";
13
+ *
14
+ * const myStorefrontProvider: StorefrontProvider = {
15
+ * id: "my-storefront-id"
16
+ * title: "My StorefrontProvider"
17
+ * icon: "https://cdn.openfin.co/demos/notifications/generator/images/icon-blue.png",
18
+ * getApps: () => {...},
19
+ * getNavigation: () => {...},
20
+ * getLandingPage: () => {...},
21
+ * getFooter: () => {...},
22
+ * launchApp: () => {...}
23
+ * };
24
+ *
25
+ * await Storefront.register(myStorefrontProvider);
26
+ *
27
+ * ```
6
28
  */
7
29
  export declare const register: (provider: StorefrontProvider) => Promise<StoreRegistration>;
8
- export interface UpdateButtonConfigRequest {
9
- appId: string;
10
- primaryButton: StoreButtonConfig;
11
- secondaryButtons: StoreButtonConfig[];
12
- }
13
30
  /**
14
- * Deregister a Storefront provider
31
+ * API function to deregister a Storefront provider.
32
+ *
33
+ * @param id the id of the provider to deregister.
34
+ * @returns promise - resolves once the provider is deregistered.
35
+ *
36
+ * @example
37
+ * ```ts
38
+ * import { Storefront, StorefrontProvider } from "@openfin/workspace";
39
+ *
40
+ * const myStorefrontProvider: StorefrontProvider = {
41
+ * id: "my-storefront-id"
42
+ * title: "My StoreFrontProvider"
43
+ * icon: "https://cdn.openfin.co/demos/notifications/generator/images/icon-blue.png",
44
+ * getApps: () => {...},
45
+ * getNavigation: () => {...},
46
+ * getLandingPage: () => {...},
47
+ * getFooter: () => {...},
48
+ * launchApp: () => {...}
49
+ * };
50
+ *
51
+ * await Storefront.register(myStorefrontProvider);
52
+ *
53
+ * await Storefront.deregister("my-storefront-id");
54
+ *
55
+ * ```
15
56
  */
16
57
  export declare const deregister: (providerId: string) => Promise<void>;
17
58
  /**
18
- * API function to hide Storefront
59
+ * API function to hide the Storefront window.
19
60
  * @returns promise - invokes hide action
61
+ *
62
+ * @example
63
+ * ```ts
64
+ * import { Storefront } from "@openfin/workspace";
65
+ *
66
+ * await Storefront.hide();
67
+ * ```
20
68
  */
21
69
  export declare const hide: () => Promise<void>;
22
70
  /**
23
- * Shows Storefront window if enabled & registered
71
+ * API function to show the Storefront window.
72
+ * @returns promise - invokes show action
73
+ *
74
+ * @example
75
+ * ```ts
76
+ * import { Storefront } from "@openfin/workspace";
77
+ *
78
+ * await Storefront.show();
79
+ * ```
24
80
  */
25
81
  export declare const show: () => Promise<void>;
@@ -0,0 +1 @@
1
+ import '@common/test/fin-mocks';
@@ -0,0 +1,4 @@
1
+ import { DockProviderConfigWithIdentity } from '../../../../client-api/src/shapes';
2
+ export declare const store: import("idb-keyval").UseStore;
3
+ export declare function getDockProviderConfig(providerId: string): Promise<DockProviderConfigWithIdentity | undefined>;
4
+ export declare function saveDockProviderConfig(config: DockProviderConfigWithIdentity): Promise<void>;
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Handles a name collision (if required) by appending a progressive number to the name
3
+ *
4
+ * @param initialName The initial name to test
5
+ * @param existingNames The list of existing names
6
+ * @returns a unique name
7
+ *
8
+ * @example
9
+ *
10
+ * ```ts
11
+ * handleNameCollision('test', ['test', 'test (1)']) // returns 'test (2)'
12
+ * ```
13
+ */
14
+ export declare const handleNameCollision: (initialName: string, existingNames: string[]) => string;
@@ -1,4 +1,3 @@
1
- import type OpenFin from '@openfin/core';
2
1
  import { SnapshotExtended } from '../../../../common/src/utils/snapshot';
3
2
  /**
4
3
  * Get a snapshot with pages.
@@ -9,15 +8,3 @@ import { SnapshotExtended } from '../../../../common/src/utils/snapshot';
9
8
  * @returns a snapshot with windows that contain pages.
10
9
  */
11
10
  export declare function getSnapshotWithPages(superGetSnapshot?: () => Promise<SnapshotExtended>): Promise<SnapshotExtended>;
12
- /**
13
- * Launch a snapshot that contains windows with pages.
14
- *
15
- * If a page with the same ID is already launched in the platform,
16
- * focus and set it as the active page.
17
- *
18
- * If there is no page on the desktop with the same ID, launch
19
- * the new window with the page.
20
- *
21
- * @param snapshot the snapshot to launch.
22
- */
23
- export declare function applySnapshotWithPages(snapshot: OpenFin.Snapshot, superApplySnapshot?: (superSnapshot: OpenFin.Snapshot) => Promise<void>): Promise<void>;
@@ -22,8 +22,10 @@ export declare const getPageForWindow: ({ identity, pageId }: {
22
22
  export declare const reorderPagesForWindow: (payload: ReorderPagesForWindowPayload) => Promise<void>;
23
23
  export declare const getActivePageIdForWindow: (identity: OpenFin.Identity) => Promise<string>;
24
24
  /**
25
- * Checks if a given page name is unique
26
- * If not, add a progressive number to it
25
+ * Checks if a given page name is unique.
26
+ *
27
+ * If the name is not unique, it will append a number to the end of the name.
28
+ *
27
29
  * @param initialName The initial name to test
28
30
  * @returns string: a unique page name
29
31
  */
@@ -1,17 +1,3 @@
1
1
  import type OpenFin from '@openfin/core';
2
- import { Page } from '../../../common/src/api/pages/shapes';
3
- import type { CreateSavedPageRequest, CreateSavedWorkspaceRequest, UpdateSavedPageRequest, UpdateSavedWorkspaceRequest, Workspace } from '../shapes';
4
- export declare const getStorageApi: (identity: OpenFin.ApplicationIdentity) => {
5
- createPage: (req: CreateSavedPageRequest) => Promise<any>;
6
- deletePage: (id: string) => Promise<any>;
7
- updatePage: (req: UpdateSavedPageRequest) => Promise<any>;
8
- getPage: (id: string) => Promise<any>;
9
- getPages: (query?: string) => Promise<Page[]>;
10
- savePage: (page: Page) => Promise<any>;
11
- createWorkspace: (req: CreateSavedWorkspaceRequest) => Promise<any>;
12
- deleteWorkspace: (id: string) => Promise<any>;
13
- updateWorkspace: (req: UpdateSavedWorkspaceRequest) => Promise<any>;
14
- getWorkspace: (id: string) => Promise<any>;
15
- getWorkspaces: (query?: string) => Promise<Workspace[]>;
16
- saveWorkspace: (workspace: Workspace) => Promise<any>;
17
- };
2
+ import type { WorkspacePlatformStorage } from '../shapes';
3
+ export declare const getStorageApi: (identity: OpenFin.ApplicationIdentity) => WorkspacePlatformStorage;
@@ -1,2 +1 @@
1
- export declare const handleNameCollision: (initialName: string, existingNames: string[]) => string;
2
1
  export declare const listenForStoreClose: () => void;
@@ -0,0 +1,7 @@
1
+ import type OpenFin from '@openfin/core';
2
+ import type { CustomThemeOptions, CustomThemeOptionsWithScheme } from '../../../common/src/api/theming';
3
+ import type { BrowserInitConfig } from '..';
4
+ /**
5
+ * Applies default options to the creation of browser windows.
6
+ */
7
+ export declare const applyBrowserDefaults: (options: OpenFin.PlatformWindowCreationOptions, initOptions: Pick<BrowserInitConfig, 'defaultWindowOptions' | 'defaultPageOptions'> | undefined, theme?: CustomThemeOptions | CustomThemeOptionsWithScheme) => Promise<OpenFin.PlatformWindowCreationOptions>;
@@ -1,4 +1,4 @@
1
1
  import type OpenFin from '@openfin/core';
2
2
  import type { BrowserInitConfig } from '../../../client-api-platform/src/shapes';
3
3
  import { WorkspacePlatformOverrideCallback, WorkspacePlatformProvider } from '..';
4
- export declare const getOverrideCallback: (browserInitOptions: BrowserInitConfig, overrideCallback?: WorkspacePlatformOverrideCallback) => OpenFin.OverrideCallback<WorkspacePlatformProvider>;
4
+ export declare const getOverrideCallback: (browserInitOptions: BrowserInitConfig | null, overrideCallback?: WorkspacePlatformOverrideCallback) => OpenFin.OverrideCallback<WorkspacePlatformProvider>;
@@ -0,0 +1,3 @@
1
+ import type { AttachedPage } from '../../../common/src/api/pages/shapes';
2
+ import type { BrowserInitConfig } from '..';
3
+ export declare const applyPageDefaults: (pages: AttachedPage[], defaultPageOptions?: BrowserInitConfig['defaultPageOptions']) => Promise<AttachedPage[]>;
@@ -0,0 +1 @@
1
+ export {};
@@ -1,7 +1,6 @@
1
1
  import type OpenFin from '@openfin/core';
2
- import type { AttachedPage, Page } from '../../../common/src/api/pages/shapes';
3
- import type { CustomThemeOptions, CustomThemeOptionsWithScheme } from '../../../common/src/api/theming';
4
- import type { BrowserInitConfig, BrowserSnapshot } from '..';
2
+ import type { Page } from '../../../common/src/api/pages/shapes';
3
+ import type { BrowserSnapshot } from '..';
5
4
  export declare function overrideViewOptions(options: Partial<OpenFin.ViewOptions>, initOptions: OpenFin.ViewOptions): any;
6
5
  export declare function preserveInteropIfManifestConflict(opts: Partial<OpenFin.ViewOptions>, fetchManifest: ({ manifestUrl }: {
7
6
  manifestUrl: string;
@@ -28,14 +27,7 @@ declare type LegacyWindowOptions = Omit<OpenFin.PlatformWindowCreationOptions, '
28
27
  workstacks?: Page[];
29
28
  };
30
29
  export declare const initWorkspacePlatformOptions: (options: LegacyWindowOptions | OpenFin.PlatformWindowCreationOptions) => OpenFin.PlatformWindowCreationOptions;
31
- export declare const applyPageDefaults: (pages: Page[], defaultPageOptions?: BrowserInitConfig['defaultPageOptions']) => Promise<AttachedPage[]>;
32
- export declare const applyBrowserDefaults: (options: OpenFin.PlatformWindowCreationOptions, initOptions: Pick<BrowserInitConfig, 'title' | 'defaultWindowOptions' | 'defaultPageOptions'>, theme: CustomThemeOptions | CustomThemeOptionsWithScheme) => Promise<OpenFin.PlatformWindowCreationOptions>;
33
- export declare enum WindowType {
34
- Browser = "browser",
35
- Platform = "platform",
36
- Classic = "classic",
37
- Mixed = "mixed"
38
- }
30
+ export declare type WindowType = 'browser' | 'platform' | 'classic' | 'mixed';
39
31
  /**
40
32
  * checkSnapshotWindowTypes
41
33
  * Determines what type of windows are contained within a snapshot.
@@ -44,5 +36,5 @@ export declare enum WindowType {
44
36
  *
45
37
  * @returns - The type of windows contained within the snapshot.
46
38
  */
47
- export declare function checkSnapshotWindowTypes(snapshot: BrowserSnapshot): WindowType;
39
+ export declare function checkSnapshotWindowTypes(snapshot: BrowserSnapshot): WindowType | null;
48
40
  export {};
@@ -4,7 +4,7 @@ import type { AnalyticsEvent, AnalyticsEventInternal } from '../../common/src/ut
4
4
  import { CustomActionSpecifier, CustomButtonConfig } from '../../common/src/api/action';
5
5
  import type { AttachedPage, Page, PageWithUpdatableRuntimeAttribs } from '../../common/src/api/pages/shapes';
6
6
  import type { CustomThemes } from '../../common/src/api/theming';
7
- import type { App, StoreButtonConfig } from '../../client-api/src/shapes';
7
+ import type { App, DockProviderConfigWithIdentity, StoreButtonConfig } from '../../client-api/src/shapes';
8
8
  export { AppManifestType } from '../../client-api/src/shapes';
9
9
  export type { App, AppIntent, Image } from '../../client-api/src/shapes';
10
10
  export type { CustomActionSpecifier, CustomButtonConfig } from '../../common/src/api/action';
@@ -1083,6 +1083,18 @@ export interface WorkspacePlatformStorage {
1083
1083
  * @param workspace the workspace to save.
1084
1084
  */
1085
1085
  saveWorkspace(workspace: Workspace): Promise<void>;
1086
+ /**
1087
+ * Implementation for getting the dock provider from persistent storage.
1088
+ *
1089
+ * @param id The id of the dock provider to get.
1090
+ */
1091
+ getDockProviderConfig(id: string): Promise<DockProviderConfigWithIdentity | undefined>;
1092
+ /**
1093
+ * Implementation for saving a dock provider config to persistent storage.
1094
+ *
1095
+ * @param config The new dock config to save to persistent storage.
1096
+ */
1097
+ saveDockProviderConfig(config: DockProviderConfigWithIdentity): Promise<void>;
1086
1098
  }
1087
1099
  /**
1088
1100
  * Request for launching an application.
@@ -1241,6 +1253,18 @@ export interface WorkspacePlatformProvider extends OpenFin.PlatformProvider {
1241
1253
  * @param req the update saved workspace request.
1242
1254
  */
1243
1255
  updateSavedWorkspace(req: UpdateSavedWorkspaceRequest): Promise<void>;
1256
+ /**
1257
+ * Implementation for getting the dock provider from persistent storage.
1258
+ *
1259
+ * @param id The id of the dock provider to get.
1260
+ */
1261
+ getDockProviderConfig(id: string): Promise<DockProviderConfigWithIdentity | undefined>;
1262
+ /**
1263
+ * Implementation for saving a dock provider config to persistent storage.
1264
+ *
1265
+ * @param config The new dock config to save to persistent storage.
1266
+ */
1267
+ saveDockProviderConfig(config: DockProviderConfigWithIdentity): Promise<void>;
1244
1268
  /**
1245
1269
  * Implementation for deleting a saved workspace in persistent storage.
1246
1270
  * @param id of the id of the workspace to delete.
@@ -1375,7 +1399,7 @@ export interface WorkspacePlatformInitConfig {
1375
1399
  /** Config for overriding browser options and behavior.
1376
1400
  * Set to null to initalize the platform without the browser
1377
1401
  */
1378
- browser?: BrowserInitConfig;
1402
+ browser?: BrowserInitConfig | null;
1379
1403
  /** Custom Themes object
1380
1404
  *
1381
1405
  * ```ts
@@ -1578,8 +1602,8 @@ export interface BrowserInitConfig {
1578
1602
  * Default options for creating a new browser window. Any option not included in WorkspacePlatform.getCurrentSync().Browser.createWindow(options) call will default to the value provided in this field.
1579
1603
  */
1580
1604
  defaultWindowOptions?: Partial<BrowserCreateWindowRequest>;
1581
- /** Default options when creating a new page. If `iconUrl`, `unsavedIconUrl` or `closeButton` are not defined when creating a page, setting will default to `defaultPageOptions`. */
1582
- defaultPageOptions?: Pick<Page, 'iconUrl' | 'unsavedIconUrl' | 'closeButton'>;
1605
+ /** Default options when creating a new page. If `iconUrl`, `unsavedIconUrl`, `panels` or `closeButton` are not defined when creating a page, setting will default to `defaultPageOptions`. */
1606
+ defaultPageOptions?: Pick<Page, 'iconUrl' | 'unsavedIconUrl' | 'closeButton' | 'panels'>;
1583
1607
  /**
1584
1608
  * The default options when creating a new browser window. Any option not included in WorkspacePlatform.getCurrentSync().Browser.createView(options) call will default to the value provided in this field.
1585
1609
  */
@@ -12,5 +12,5 @@ export declare function convertWorkstackToAttachedPage({ id, name, ...rest }: Wo
12
12
  * @param pages the pages to fix.
13
13
  * @returns the fixed pages.
14
14
  */
15
- export declare const fixAttachedPages: (pages: AttachedPage[]) => AttachedPage[];
15
+ export declare const fixAttachedPages: (pages?: AttachedPage[]) => AttachedPage[];
16
16
  export {};
@@ -51,7 +51,9 @@ export declare enum WorkspacePlatformChannelAction {
51
51
  ApplyWorkspace = "applyWorkspace",
52
52
  SetActiveWorkspace = "setActiveWorkspace",
53
53
  IsBrowserInitialized = "isBrowserInitialized",
54
- Analytics = "analyticsInternal"
54
+ Analytics = "analyticsInternal",
55
+ GetDockProviderConfig = "getDockProviderConfig",
56
+ SaveDockProviderConfig = "saveDockProviderConfig"
55
57
  }
56
58
  export declare type PlatFormSupportedFeatures = boolean | {
57
59
  isWorkspacePlatform: boolean;