@openfin/workspace-platform 9.1.8 → 9.1.10

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,18 +3,33 @@ import { RegistrationMetaInfo } from './shapes';
3
3
  export * from './shapes/dock';
4
4
  /**
5
5
  * Registers a Dock provider
6
+ * @returns promise - invokes action
7
+ * ```ts
8
+ * await Dock.register(provider)
9
+ * ```
6
10
  */
7
11
  export declare const register: (provider: DockProvider) => Promise<RegistrationMetaInfo>;
8
12
  /**
9
13
  * Deregister a Dock provider
14
+ * @returns promise - invokes action
15
+ * ```ts
16
+ * await Dock.deregister();
17
+ * ```
10
18
  */
11
19
  export declare const deregister: () => Promise<void>;
12
20
  /**
13
21
  * API function to minimize Dock
14
22
  * @returns promise - invokes action
23
+ * ```ts
24
+ * await Dock.minimize();
25
+ * ```
15
26
  */
16
27
  export declare const minimize: () => Promise<void>;
17
28
  /**
18
29
  * Shows Dock window if enabled & registered
30
+ * @returns promise - invokes action
31
+ * ```ts
32
+ * await Dock.show();
33
+ * ```
19
34
  */
20
35
  export declare const show: () => Promise<void>;
@@ -3,6 +3,14 @@ import { ProviderInfo } from './provider';
3
3
  /**
4
4
  * Allows you to hide buttons for different Workspace components in the Dock UI.
5
5
  * By default, all components are shown.
6
+ * ```ts
7
+ * const workspaceComponentButtonOptions: WorkspaceComponentButtonOptions = {
8
+ * hideHomeButton: true,
9
+ * hideWorkspacesButton: true,
10
+ * hideNotificationsButton: true,
11
+ * hideStorefrontButton: true
12
+ * }
13
+ * ```
6
14
  */
7
15
  export interface WorkspaceComponentButtonOptions {
8
16
  /**
@@ -38,6 +46,15 @@ export declare enum DockButtonNames {
38
46
  /**
39
47
  * Configuration of a dock action button
40
48
  * When you add a custom button to the Dock, you must also provide details about the custom action.
49
+ * ```ts
50
+ * const sampleDockButton: DockButtonConfig = {
51
+ * tooltip: 'Sample Button 1',
52
+ * iconUrl: 'https://www.openfin.co/favicon-32x32.png',
53
+ * action: {
54
+ * id: 'sampleButton1'
55
+ * }
56
+ * }
57
+ * ```
41
58
  */
42
59
  export interface DockButtonConfig extends CustomButtonConfig {
43
60
  type?: DockButtonNames.ActionButton;
@@ -45,6 +62,31 @@ export interface DockButtonConfig extends CustomButtonConfig {
45
62
  /**
46
63
  * Configuration of a dock dropdown button
47
64
  * When you add a dropdown button to the Dock, you must also specify the buttons to display in the dropdown.
65
+ * ```ts
66
+ * const sampleDropdownButton1: DockDropdownConfig = {
67
+ * type: DockButtonNames.DropdownButton,
68
+ * tooltip: 'Sample Dropdown Button',
69
+ * iconUrl: 'https://www.openfin.co/favicon-32x32.png',
70
+ * options: [
71
+ * {
72
+ * tooltip: 'Dropdown Button 1',
73
+ * iconUrl: 'https://www.openfin.co/favicon-32x32.png',
74
+ * action: {
75
+ * id: 'dropdownButton1',
76
+ * customData: "dropdownButton1 clicked"
77
+ * }
78
+ * },
79
+ * {
80
+ * tooltip: 'Dropdown Button 2',
81
+ * iconUrl: 'https://www.openfin.co/favicon-32x32.png',
82
+ * action: {
83
+ * id: 'dropdownButton2',
84
+ * customData: "dropdownButton2 clicked"
85
+ * }
86
+ * }
87
+ * ]
88
+ * }
89
+ * ```
48
90
  */
49
91
  export interface DockDropdownConfig extends CustomDropdownConfig {
50
92
  type: DockButtonNames.DropdownButton;
@@ -53,6 +95,82 @@ export interface DockDropdownConfig extends CustomDropdownConfig {
53
95
  * Dock button types
54
96
  */
55
97
  export declare type DockButton = DockButtonConfig | DockDropdownConfig;
98
+ /**
99
+ * <h3>Sample DockProvider definition.</h3>
100
+ *
101
+ * Import required dependencies.
102
+ * ```ts
103
+ * import { Dock, DockProvider, DockButtonNames } from '@openfin/workspace';
104
+ * import { CustomDropdownItemActionPayload, init } from "@openfin/workspace-platform";
105
+ * ```
106
+ *
107
+ * Create provider object to pass to the static `register` function of the `Dock` type.
108
+ *
109
+ * ```ts
110
+ * const provider: DockProvider = {
111
+ * id: 'provider-id',
112
+ * title: 'Sample Dock',
113
+ * icon: 'https://www.openfin.co/favicon-32x32.png',
114
+ * buttons: [
115
+ * {
116
+ * tooltip: 'Sample Button 1',
117
+ * iconUrl: 'https://www.openfin.co/favicon-32x32.png',
118
+ * action: {
119
+ * id: 'sampleButton1'
120
+ * }
121
+ * },
122
+ * {
123
+ * type: DockButtonNames.DropdownButton,
124
+ * tooltip: 'Sample Dropdown Button',
125
+ * iconUrl: 'https://www.openfin.co/favicon-32x32.png',
126
+ * options: [
127
+ * {
128
+ * tooltip: 'Dropdown Button 1',
129
+ * iconUrl: 'https://www.openfin.co/favicon-32x32.png',
130
+ * action: {
131
+ * id: 'dropdownButton1',
132
+ * customData: "dropdownButton1 clicked"
133
+ * }
134
+ * },
135
+ * {
136
+ * tooltip: 'Dropdown Button 2',
137
+ * iconUrl: 'https://www.openfin.co/favicon-32x32.png',
138
+ * action: {
139
+ * id: 'dropdownButton2',
140
+ * customData: "dropdownButton2 clicked"
141
+ * }
142
+ * }
143
+ * ]
144
+ * }
145
+ * ]
146
+ * };
147
+ * ```
148
+ *
149
+ *
150
+ * Initialize ``workspace`` with ``customActions`` to be invoked by dock dropdown.
151
+ *```ts
152
+ * await init({
153
+ * browser: {},
154
+ * customActions: {
155
+ * "dropdownButton1": async (payload: CustomDropdownItemActionPayload) => {
156
+ * alert(payload.customData)
157
+ * },
158
+ * "dropdownButton2": async (payload: CustomDropdownItemActionPayload) => {
159
+ * alert(payload.customData)
160
+ * }
161
+ * }
162
+ * });
163
+ *```
164
+ *
165
+ * Register dock ``provider`` object.
166
+ * ```ts
167
+ * await Dock.register(provider);
168
+ * ```
169
+ * Show Dock.
170
+ * ```ts
171
+ * await Dock.show();
172
+ * ```
173
+ */
56
174
  export interface DockProvider extends ProviderInfo {
57
175
  /**
58
176
  * Controls the visibility of buttons for workspace components on the Dock.
@@ -1 +1,7 @@
1
- export default function registerViewCleanUp(): void;
1
+ export declare function registerViewCleanUp(): void;
2
+ /**
3
+ * Cleanup browser modals.
4
+ *
5
+ * Once the last OpenFin Browser window is closed, any remaining modals will close.
6
+ */
7
+ export declare const registerBrowserModalsCleanup: () => Promise<void>;