@openfin/workspace-platform 12.6.1 → 12.6.2
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.
|
@@ -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
|
*/
|
|
@@ -482,99 +486,3 @@ export interface StorefrontProvider extends StorefrontProviderInfo {
|
|
|
482
486
|
*/
|
|
483
487
|
launchApp(app: App): Promise<void>;
|
|
484
488
|
}
|
|
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
|
|
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
|
-
*
|
|
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
|
-
*
|
|
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>;
|
|
@@ -335,16 +335,38 @@ export interface PreDefinedButtonConfig {
|
|
|
335
335
|
iconProps?: IconProps;
|
|
336
336
|
disabled?: boolean;
|
|
337
337
|
}
|
|
338
|
-
|
|
338
|
+
/**
|
|
339
|
+
* Configuration Object for the show/hide tabs button within the browser toolbar
|
|
340
|
+
*
|
|
341
|
+
* @example
|
|
342
|
+
* ```ts
|
|
343
|
+
* const showHideTabsConfig: ShowHideTabsConfig = {
|
|
344
|
+
* type: BrowserButtonType.ShowHideTabs,
|
|
345
|
+
* disabled: false
|
|
346
|
+
* };
|
|
347
|
+
* ```
|
|
348
|
+
*/
|
|
349
|
+
export declare type ShowHideTabsConfig = {
|
|
339
350
|
type: BrowserButtonType.ShowHideTabs;
|
|
340
351
|
disabled?: boolean;
|
|
341
352
|
};
|
|
342
|
-
|
|
353
|
+
/**
|
|
354
|
+
* Configuration Object for the page lock/unlock button within the browser toolbar
|
|
355
|
+
*
|
|
356
|
+
* @example
|
|
357
|
+
* ```ts
|
|
358
|
+
* const lockUnlockPageConfig: LockUnlockPageConfig = {
|
|
359
|
+
* type: BrowserButtonType.LockUnlockPage,
|
|
360
|
+
* disabled: false
|
|
361
|
+
* };
|
|
362
|
+
* ```
|
|
363
|
+
*/
|
|
364
|
+
export declare type LockUnlockPageConfig = {
|
|
343
365
|
type: BrowserButtonType.LockUnlockPage;
|
|
344
366
|
disabled?: boolean;
|
|
345
367
|
};
|
|
346
368
|
/**
|
|
347
|
-
*
|
|
369
|
+
* Buttons on the left of WindowStateButtonOptions
|
|
348
370
|
*/
|
|
349
371
|
export declare type ToolbarButton = ShowHideTabsConfig | LockUnlockPageConfig | CustomBrowserButtonConfig | PreDefinedButtonConfig;
|
|
350
372
|
export interface ToolbarOptions {
|
|
@@ -54,11 +54,6 @@ export interface ChannelClient extends OpenFin.ChannelClient {
|
|
|
54
54
|
* @returns the channel client for the centralized workspace protocol.
|
|
55
55
|
*/
|
|
56
56
|
export declare const getChannelClient: () => Promise<ChannelClient>;
|
|
57
|
-
/**
|
|
58
|
-
* Returns true if the current application was launched via a library (such as the Client APIs).
|
|
59
|
-
* Otherwise, returns false.
|
|
60
|
-
*/
|
|
61
|
-
export declare const isLaunchedViaLib: () => Promise<boolean>;
|
|
62
57
|
/**
|
|
63
58
|
* Launches the Workspace Provider.
|
|
64
59
|
* If the Workspace Provider is already running, does nothing.
|