@openfin/workspace 13.1.5 → 14.0.14

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 (71) hide show
  1. package/README.md +14 -14
  2. package/client-api/src/dock.d.ts +46 -10
  3. package/client-api/src/home.d.ts +76 -5
  4. package/client-api/src/home.test.d.ts +1 -1
  5. package/client-api/src/index.d.ts +10 -10
  6. package/client-api/src/integrations/microsoft.shapes.d.ts +9 -9
  7. package/client-api/src/internal/home/handlers/data.d.ts +3 -0
  8. package/client-api/src/internal/home/handlers/data.test.d.ts +1 -0
  9. package/client-api/src/internal/home/handlers/disconnect.d.ts +1 -0
  10. package/client-api/src/internal/home/handlers/disconnect.test.d.ts +1 -0
  11. package/client-api/src/internal/home/handlers/index.d.ts +6 -0
  12. package/client-api/src/internal/home/handlers/index.test.d.ts +1 -0
  13. package/client-api/src/internal/home/handlers/result-dispatch.d.ts +3 -0
  14. package/client-api/src/internal/home/handlers/result-dispatch.test.d.ts +1 -0
  15. package/client-api/src/internal/home/handlers/search-close.d.ts +5 -0
  16. package/client-api/src/internal/home/handlers/search-close.test.d.ts +1 -0
  17. package/client-api/src/internal/home/index.d.ts +4 -0
  18. package/client-api/src/internal/home/requests.d.ts +5 -0
  19. package/client-api/src/internal/providers.d.ts +63 -0
  20. package/client-api/src/internal/providers.test.d.ts +1 -0
  21. package/client-api/src/internal/storefront/handlers.d.ts +9 -0
  22. package/client-api/src/internal/storefront/index.d.ts +4 -0
  23. package/client-api/src/{internal.d.ts → internal/try-dispatch.d.ts} +1 -1
  24. package/client-api/src/legacy.d.ts +4 -3
  25. package/client-api/src/shapes/common.d.ts +20 -3
  26. package/client-api/src/shapes/dock.d.ts +97 -85
  27. package/client-api/src/shapes/home.d.ts +49 -138
  28. package/client-api/src/shapes/notifications.d.ts +2 -2
  29. package/client-api/src/shapes/store.d.ts +31 -14
  30. package/client-api/src/shapes/templates.d.ts +11 -11
  31. package/client-api/src/store.d.ts +31 -15
  32. package/client-api-platform/src/init/utils.d.ts +2 -2
  33. package/client-api-platform/src/shapes.d.ts +46 -39
  34. package/common/src/api/action.d.ts +1 -1
  35. package/common/src/api/home.d.ts +25 -0
  36. package/common/src/api/pages/shapes.d.ts +6 -6
  37. package/common/src/api/protocol/browser.d.ts +1 -1
  38. package/common/src/api/protocol/shapes/search.d.ts +96 -0
  39. package/common/src/api/protocol/shapes/workspace.d.ts +13 -13
  40. package/common/src/api/protocol/workspace-platform.d.ts +1 -1
  41. package/common/src/api/protocol/workspace.d.ts +2 -0
  42. package/common/src/api/provider.d.ts +24 -9
  43. package/common/src/api/search/aggregate-search-results.d.ts +10 -0
  44. package/common/src/api/search/common.d.ts +15 -0
  45. package/common/src/api/shapes/home.d.ts +186 -0
  46. package/common/src/api/theming.d.ts +18 -6
  47. package/common/src/utils/a11y/search.a11y.d.ts +10 -10
  48. package/common/src/utils/application.d.ts +2 -2
  49. package/common/src/utils/context-menu.d.ts +1 -1
  50. package/common/src/utils/layout.d.ts +3 -3
  51. package/common/src/utils/menu-window-provider.d.ts +2 -2
  52. package/common/src/utils/route.d.ts +0 -1
  53. package/common/src/utils/snapshot.d.ts +3 -3
  54. package/common/src/utils/types.d.ts +7 -7
  55. package/common/src/utils/usage-register.d.ts +2 -2
  56. package/home.js +128 -23
  57. package/home.js.map +1 -1
  58. package/index.js +127 -22
  59. package/index.js.map +1 -1
  60. package/notifications.js +124 -19
  61. package/notifications.js.map +1 -1
  62. package/package.json +3 -3
  63. package/search-api/src/fin/shapes.d.ts +2 -2
  64. package/search-api/src/internal-shapes.d.ts +2 -0
  65. package/search-api/src/provider/remote/deregistration.d.ts +2 -1
  66. package/search-api/src/provider/remote/info.d.ts +1 -1
  67. package/search-api/src/provider/remote/registration.d.ts +1 -1
  68. package/search-api/src/shapes.d.ts +16 -21
  69. package/store.js +130 -25
  70. package/store.js.map +1 -1
  71. package/common/src/api/search.d.ts +0 -18
@@ -1,41 +1,41 @@
1
- import { CustomButtonConfig, CustomDropdownConfig } from '../../../common/src/api/action';
2
- import { RegistrationMetaInfo } from '../../../client-api/src/shapes/common';
3
- import { ProviderInfo } from './provider';
1
+ import { type CustomButtonConfig, type CustomDropdownConfig } from '../../../common/src/api/action';
2
+ import { type RegistrationMetaInfo } from '../../../client-api/src/shapes/common';
3
+ import { type ProviderInfo } from './provider';
4
4
  /**
5
5
  * Allows you to hide buttons for different Workspace components in the Dock UI.
6
6
  * By default, all components are shown.
7
7
  *
8
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
9
  *
10
- * @example
10
+ * @example Hide all Workspace component buttons in the Dock UI.
11
11
  * ```ts
12
12
  * const workspaceComponentButtonOptions: WorkspaceComponentButtonOptions = {
13
- * hideHomeButton: true,
14
- * hideWorkspacesButton: true,
15
- * hideNotificationsButton: true,
16
- * hideStorefrontButton: true
13
+ * hideHomeButton: true,
14
+ * hideWorkspacesButton: true,
15
+ * hideNotificationsButton: true,
16
+ * hideStorefrontButton: true
17
17
  * }
18
18
  * ```
19
19
  */
20
20
  export interface WorkspaceComponentButtonOptions {
21
21
  /**
22
22
  * Set to true to hide the Workspaces button from the Dock UI.
23
- * Default value false.
23
+ * @default false.
24
24
  */
25
25
  hideWorkspacesButton?: boolean;
26
26
  /**
27
27
  * Set to true to hide the Home button from the Dock UI.
28
- * Default value false.
28
+ * @default false.
29
29
  */
30
30
  hideHomeButton?: boolean;
31
31
  /**
32
32
  * Set to true to hide the Notifications button from the Dock UI.
33
- * Default value false.
33
+ * @default false.
34
34
  */
35
35
  hideNotificationsButton?: boolean;
36
36
  /**
37
37
  * Set to true to hide the Storefront button from the Dock UI.
38
- * Default value false.
38
+ * @default false.
39
39
  */
40
40
  hideStorefrontButton?: boolean;
41
41
  }
@@ -71,28 +71,28 @@ export interface DockButtonConfig extends CustomButtonConfig {
71
71
  *
72
72
  * ```ts
73
73
  * const sampleDropdownButton1: DockDropdownConfig = {
74
- * type: DockButtonNames.DropdownButton,
75
- * tooltip: 'Sample Dropdown Button',
76
- * iconUrl: 'https://www.openfin.co/favicon-32x32.png',
77
- * options: [
78
- * {
79
- * tooltip: 'Dropdown Button 1',
80
- * iconUrl: 'https://www.openfin.co/favicon-32x32.png',
81
- * action: {
82
- * id: 'dropdownButton1',
83
- * customData: "dropdownButton1 clicked"
84
- * }
85
- * },
86
- * {
87
- * tooltip: 'Dropdown Button 2',
88
- * iconUrl: 'https://www.openfin.co/favicon-32x32.png',
89
- * action: {
90
- * id: 'dropdownButton2',
91
- * customData: "dropdownButton2 clicked"
92
- * }
93
- * }
94
- * ]
95
- * }
74
+ * type: DockButtonNames.DropdownButton,
75
+ * tooltip: "Sample Dropdown Button",
76
+ * iconUrl: "https://www.openfin.co/favicon-32x32.png",
77
+ * options: [
78
+ * {
79
+ * tooltip: "Dropdown Button 1",
80
+ * iconUrl: "https://www.openfin.co/favicon-32x32.png",
81
+ * action: {
82
+ * id: "dropdownButton1",
83
+ * customData: "dropdownButton1 clicked",
84
+ * },
85
+ * },
86
+ * {
87
+ * tooltip: "Dropdown Button 2",
88
+ * iconUrl: "https://www.openfin.co/favicon-32x32.png",
89
+ * action: {
90
+ * id: "dropdownButton2",
91
+ * customData: "dropdownButton2 clicked",
92
+ * },
93
+ * },
94
+ * ],
95
+ * };
96
96
  * ```
97
97
  */
98
98
  export interface DockDropdownConfig extends CustomDropdownConfig {
@@ -101,23 +101,26 @@ export interface DockDropdownConfig extends CustomDropdownConfig {
101
101
  /**
102
102
  * Dock button types
103
103
  */
104
- export declare type DockButton = {
105
- /** Optional button identifier, if not provided will be automatically generated by the provider */ id?: string;
104
+ export type DockButton = {
105
+ /**
106
+ * Optional button identifier, if not provided will be automatically generated by the provider
107
+ */
108
+ id?: string;
106
109
  } & (DockButtonConfig | DockDropdownConfig);
107
110
  /**
108
111
  * The names of the buttons for the workspace components on the Dock.
109
112
  *
110
113
  * Used in {@link WorkspaceButtonsConfig}.
111
114
  */
112
- export declare type WorkspaceButton = 'switchWorkspace' | 'home' | 'notifications' | 'store';
115
+ export type WorkspaceButton = 'switchWorkspace' | 'home' | 'notifications' | 'store';
113
116
  /**
114
117
  * Controls the visibility as well as the order of buttons for workspace components on the Dock.
115
118
  *
116
- * To hide a button, remove it from the array.
119
+ * To omit a button from the Dock UI, simply omit it from the array.
117
120
  *
118
- * The array should not contain duplicate values.
121
+ * The array must not contain duplicate values. Any duplicate values will be removed.
119
122
  *
120
- * @example - Hide the Home button and move the Notifications button to the first position.
123
+ * @example Hide the Home button and move the Notifications button to the first position.
121
124
  * ```ts
122
125
  * const workspaceButtonsConfig: WorkspaceButtonsConfig = [
123
126
  * 'notifications',
@@ -126,13 +129,13 @@ export declare type WorkspaceButton = 'switchWorkspace' | 'home' | 'notification
126
129
  * ];
127
130
  * ```
128
131
  *
129
- * @example - Hide all of the workspace buttons.
132
+ * @example Hide all of the workspace buttons.
130
133
  *
131
134
  * ```ts
132
135
  * const workspaceButtonsConfig: WorkspaceButtonsConfig = [];
133
136
  * ```
134
137
  */
135
- export declare type WorkspaceButtonsConfig = WorkspaceButton[];
138
+ export type WorkspaceButtonsConfig = WorkspaceButton[];
136
139
  /**
137
140
  * Configuration for the Dock provider.
138
141
  */
@@ -141,7 +144,7 @@ export interface DockProviderConfig {
141
144
  * Controls the visibility of buttons for workspace components on the Dock.
142
145
  * All components are visible by default, but you can hide any of them.
143
146
  *
144
- * @default - All components are visible. (['switchWorkspace', 'home', 'notifications', 'store'])
147
+ * @default - All components are visible. `['switchWorkspace', 'home', 'notifications', 'store']`
145
148
  */
146
149
  workspaceComponents?: WorkspaceComponentButtonOptions | WorkspaceButtonsConfig;
147
150
  /**
@@ -172,54 +175,56 @@ export interface DockProviderConfigWithIdentity extends ProviderInfo, DockProvid
172
175
  *
173
176
  * Import required dependencies.
174
177
  * ```ts
175
- * import { Dock, DockProvider, DockButtonNames } from '@openfin/workspace';
176
178
  * import { CustomDropdownItemActionPayload, init } from "@openfin/workspace-platform";
179
+ * import { Dock, type DockProvider, DockButtonNames } from '@openfin/workspace';
177
180
  * ```
178
181
  *
179
182
  * Create provider object to pass to the static `register` function of the `Dock` type.
180
183
  *
181
184
  * ```ts
182
185
  * const provider: DockProvider = {
183
- * id: 'provider-id',
184
- * title: 'Sample Dock',
185
- * icon: 'https://www.openfin.co/favicon-32x32.png',
186
- * buttons: [
187
- * {
188
- * tooltip: 'Sample Button 1',
189
- * iconUrl: 'https://www.openfin.co/favicon-32x32.png',
190
- * action: {
191
- * id: 'sampleButton1'
192
- * }
193
- * },
194
- * {
195
- * type: DockButtonNames.DropdownButton,
196
- * tooltip: 'Sample Dropdown Button',
197
- * iconUrl: 'https://www.openfin.co/favicon-32x32.png',
198
- * options: [
186
+ * id: "provider-id",
187
+ * title: "Sample Dock",
188
+ * icon: "https://www.openfin.co/favicon-32x32.png",
189
+ * buttons: [
199
190
  * {
200
- * tooltip: 'Dropdown Button 1',
201
- * iconUrl: 'https://www.openfin.co/favicon-32x32.png',
202
- * action: {
203
- * id: 'dropdownButton1',
204
- * customData: "dropdownButton1 clicked"
205
- * }
191
+ * tooltip: "Sample Button 1",
192
+ * iconUrl: "https://www.openfin.co/favicon-32x32.png",
193
+ * action: {
194
+ * id: "sampleButton1",
195
+ * },
206
196
  * },
207
197
  * {
208
- * tooltip: 'Dropdown Button 2',
209
- * iconUrl: 'https://www.openfin.co/favicon-32x32.png',
210
- * action: {
211
- * id: 'dropdownButton2',
212
- * customData: "dropdownButton2 clicked"
213
- * }
214
- * }
215
- * ]
216
- * }
217
- * ]
198
+ * type: DockButtonNames.DropdownButton,
199
+ * tooltip: "Sample Dropdown Button",
200
+ * iconUrl: "https://www.openfin.co/favicon-32x32.png",
201
+ * options: [
202
+ * {
203
+ * tooltip: "Dropdown Button 1",
204
+ * iconUrl: "https://www.openfin.co/favicon-32x32.png",
205
+ * action: {
206
+ * id: "dropdownButton1",
207
+ * customData: "dropdownButton1 clicked",
208
+ * },
209
+ * },
210
+ * {
211
+ * tooltip: "Dropdown Button 2",
212
+ * iconUrl: "https://www.openfin.co/favicon-32x32.png",
213
+ * action: {
214
+ * id: "dropdownButton2",
215
+ * customData: "dropdownButton2 clicked",
216
+ * },
217
+ * },
218
+ * ],
219
+ * },
220
+ * ],
218
221
  * };
219
222
  * ```
220
223
  *
224
+ * When a Dock button is clicked, the `action` object is passed to the `customActions` function defined as defined in the Workspace Platform `init` function.
225
+ *
226
+ * Initialize your Workspace Platform with ``customActions`` to be invoked by dock dropdown.
221
227
  *
222
- * Initialize ``workspace`` with ``customActions`` to be invoked by dock dropdown.
223
228
  *```ts
224
229
  * await init({
225
230
  * browser: {},
@@ -235,10 +240,12 @@ export interface DockProviderConfigWithIdentity extends ProviderInfo, DockProvid
235
240
  *```
236
241
  *
237
242
  * Register Dock ``provider`` object.
243
+ *
238
244
  * ```ts
239
245
  * await Dock.register(provider);
240
246
  * ```
241
247
  * Show Dock.
248
+ *
242
249
  * ```ts
243
250
  * await Dock.show();
244
251
  * ```
@@ -263,16 +270,21 @@ export interface DockProviderRegistration extends RegistrationMetaInfo {
263
270
  * @param request The new Dock configuration.
264
271
  * @returns Promise that resolves when the update completes.
265
272
  *
266
- * @example
273
+ * @example Update the Dock configuration. This example requires that you have already registered a Dock provider.
274
+ *
267
275
  * ```ts
276
+ * import { Dock, type DockProviderConfig } from '@openfin/workspace';
277
+ *
268
278
  * const newConfig: DockProviderConfig = {
269
- * buttons: [{
270
- * tooltip: 'Sample Button 1',
271
- * iconUrl: 'https://www.openfin.co/favicon-32x32.png',
272
- * action: {
273
- * id: 'sampleButton1'
274
- * }
275
- * }]
279
+ * buttons: [
280
+ * {
281
+ * tooltip: "Sample Button 1",
282
+ * iconUrl: "https://www.openfin.co/favicon-32x32.png",
283
+ * action: {
284
+ * id: "sampleButton1",
285
+ * },
286
+ * },
287
+ * ],
276
288
  * };
277
289
  *
278
290
  * await dockProviderRegistration.updateDockProviderConfig(newConfig);
@@ -3,12 +3,10 @@
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 type { Page } from '../../../common/src/api/pages/shapes';
7
- import type { Workspace } from '../../../common/src/api/workspaces';
8
6
  import type { Action, DispatchedSearchResult, SearchListenerRequest, SearchListenerResponse, SearchProvider, SearchResult } from '../../../search-api/src/index';
9
7
  import { RegistrationMetaInfo } from './common';
10
8
  import { CustomTemplate, ListPairs } from './templates';
11
- export declare type CLISearchListenerRequest = SearchListenerRequest;
9
+ export type CLISearchListenerRequest = SearchListenerRequest;
12
10
  /**
13
11
  * Representation of a search request from a specific invocation of a {@link HomeProvider | HomeProvider's} `onUserInput` listener function.
14
12
  */
@@ -22,6 +20,8 @@ export interface HomeSearchListenerRequest extends CLISearchListenerRequest {
22
20
  /**
23
21
  * Denotes that this search request should return search results
24
22
  * that represent content that a user has saved. (Workspaces, Pages)
23
+ *
24
+ * @deprecated This is no longer used.
25
25
  */
26
26
  isSaved: boolean;
27
27
  /**
@@ -29,30 +29,40 @@ export interface HomeSearchListenerRequest extends CLISearchListenerRequest {
29
29
  * that represents content that is stored in the platform.
30
30
  * This should exclude content that the user has saved.
31
31
  * (Workspaces, Pages, Views, Apps)
32
+ *
33
+ * @deprecated This is no longer used.
32
34
  */
33
35
  isStore: boolean;
34
36
  /**
35
37
  * Denotes that this search request should return search results
36
38
  * that represent other Home search providers. If the user chooses to
37
39
  * launch one of these apps, they should register a Home provider.
40
+ *
41
+ * @deprecated This is no longer used.
38
42
  */
39
43
  isSearchEngines: boolean;
40
44
  /**
41
45
  * any user-selected filters will be populated here
42
- * e.g [{
43
- * title: 'Currency Pairs',
44
- * type: FilterOptionType.MultiSelect,
45
- * options: [{ value: 'GBPUSD', isSelected: true}]
46
+ *
47
+ * @example
48
+ * ```ts
49
+ * [{
50
+ * title: 'Currency Pairs',
51
+ * type: FilterOptionType.MultiSelect,
52
+ * options: [{ value: 'GBPUSD', isSelected: true}]
46
53
  * }]
54
+ * ```
47
55
  */
48
56
  selectedFilters?: CLIFilter[];
49
57
  };
50
58
  }
51
- export declare type CLISearchListenerResponse = SearchListenerResponse;
59
+ export type CLISearchListenerResponse = SearchListenerResponse;
52
60
  /**
53
61
  * Representation of a search response from a specific invocation of a {@link HomeProvider | HomeProvider's} `onUserInput` listener function.
54
62
  * Can optionally be used to push search results to the Home UI.
55
63
  *
64
+ * @example
65
+ *
56
66
  * ```ts
57
67
  * function onUserInput(req: HomeSearchListenerRequest, res: HomeSearchListenerResponse) {
58
68
  * searchListenerResponse.open();
@@ -65,11 +75,18 @@ export declare type CLISearchListenerResponse = SearchListenerResponse;
65
75
  * searchListenerRequest.onClose(() => {
66
76
  * myLongRunningQuery.close();
67
77
  * });
78
+ *
79
+ * // return any search results that are immediately available
80
+ * return quickQuery.getResults();
68
81
  * }
69
82
  * ```
70
83
  */
71
- export declare type HomeSearchListenerResponse = Omit<CLISearchListenerResponse, 'respond'> & {
84
+ export type HomeSearchListenerResponse = Omit<CLISearchListenerResponse, 'respond' | 'updateContext'> & {
72
85
  respond(results: HomeSearchResult[]): void;
86
+ /**
87
+ * Pushes a new context to the Home UI. This can be used to update the search filters
88
+ */
89
+ updateContext(context: HomeSearchResponse['context']): void;
73
90
  };
74
91
  /**
75
92
  * Enumerator for different types of actions that are built into the Home API.
@@ -95,11 +112,11 @@ export interface CLISuggestion extends CLIBuiltInAction<CLIAction.Suggestion> {
95
112
  /**
96
113
  * Union type that includes Home's built in search result actions.
97
114
  */
98
- export declare type HomeAction = CLISuggestion | Action;
115
+ export type HomeAction = CLISuggestion | Action;
99
116
  /**
100
117
  * A search result that can be rendered by a Workspace component.
101
118
  */
102
- export declare type CLISearchResult<A extends Action> = SearchResult<A>;
119
+ export type CLISearchResult<A extends Action> = SearchResult<A>;
103
120
  /**
104
121
  * A list of template types that determine how a search result is rendered.
105
122
  */
@@ -173,7 +190,7 @@ export interface ContactInfo {
173
190
  */
174
191
  buttons?: ContactInfoButtons[];
175
192
  }
176
- export declare type ButtonIcon =
193
+ export type ButtonIcon =
177
194
  /**
178
195
  * The icon used for the button.
179
196
  */
@@ -187,7 +204,7 @@ string | {
187
204
  */
188
205
  dark: string;
189
206
  };
190
- export declare type ContactInfoButtons = {
207
+ export type ContactInfoButtons = {
191
208
  type: 'button';
192
209
  /**
193
210
  * The icon to display on the button.
@@ -271,7 +288,7 @@ export interface CLISearchResultError<A extends Action = Action> extends CLISear
271
288
  /**
272
289
  * A search result that can be rendered by Home UI.
273
290
  */
274
- export declare type HomeSearchResult = CLISearchResultContact<HomeAction> | CLISearchResultSimpleText<HomeAction> | CLISearchResultList<HomeAction> | CLISearchResultPlain<HomeAction> | CLISearchResultCustom<HomeAction> | CLISearchResultLoading<HomeAction> | CLISearchResultError<HomeAction>;
291
+ export type HomeSearchResult = CLISearchResultContact<HomeAction> | CLISearchResultSimpleText<HomeAction> | CLISearchResultList<HomeAction> | CLISearchResultPlain<HomeAction> | CLISearchResultCustom<HomeAction> | CLISearchResultLoading<HomeAction> | CLISearchResultError<HomeAction>;
275
292
  export declare enum CLIFilterOptionType {
276
293
  /**
277
294
  * Display a multi-select drop down for the options
@@ -325,7 +342,7 @@ export interface HomeSearchResponse extends CLISearchResponse {
325
342
  /**
326
343
  * A rendered search result that has been actioned by a user.
327
344
  */
328
- export declare type CLIDispatchedSearchResult = DispatchedSearchResult;
345
+ export type CLIDispatchedSearchResult = DispatchedSearchResult;
329
346
  /**
330
347
  * A CLI provider responds to search requests from Workspace components.
331
348
  * Upon receiving a search request, a CLI provider can return search results that can be rendered and interacted with
@@ -386,9 +403,11 @@ export interface CLIProvider extends SearchProvider {
386
403
  *
387
404
  * <h3>Sample HomeProvider definition.</h3>
388
405
  *
406
+ * @example **Sample HomeProvider definition.*
407
+ *
389
408
  * Import required dependencies.
390
409
  * ```ts
391
- * import { Home, HomeProvider } from '@openfin/workspace';
410
+ * import { Home, type HomeProvider } from '@openfin/workspace';
392
411
  * ```
393
412
  *
394
413
  * Create provider object to configure `Home`.
@@ -404,10 +423,11 @@ export interface CLIProvider extends SearchProvider {
404
423
  * };
405
424
  * ```
406
425
  *
407
- * Register home ``provider`` object.
426
+ * Register home `provider` object.
408
427
  * ```ts
409
428
  * await Home.register(provider);
410
429
  * ```
430
+ *
411
431
  * Show Home.
412
432
  * ```ts
413
433
  * await Home.show();
@@ -419,22 +439,26 @@ export interface HomeProvider extends CLIProvider {
419
439
  /**
420
440
  * A rendered Home search result that has been actioned by a user.
421
441
  */
422
- export declare type HomeDispatchedSearchResult = HomeSearchResult & DispatchedSearchResult;
423
- export interface SearchQueryWithProviderID {
424
- providerID: string;
425
- query: string;
426
- }
442
+ export type HomeDispatchedSearchResult = HomeSearchResult & DispatchedSearchResult;
427
443
  /**
428
444
  * Response from home registration which includes metadata and a function to inject search string into home search
429
445
  */
430
446
  export interface HomeRegistration extends RegistrationMetaInfo {
431
447
  /**
432
448
  * Function to inject search string into home search
449
+ *
450
+ * @remarks Calling this will switch the active provider within Home to the provider that was registered with this HomeRegistration.
451
+ *
452
+ * @throws An error if the Home Provider is no longer registered.
453
+ *
433
454
  * @param query search string
434
- * @returns Promise<void>
455
+ *
456
+ * @returns A promise that resolves when the search string has been injected into home search
457
+ *
458
+ * @example Injecting a search string into Home search
435
459
  *
436
460
  * ```ts
437
- * import Home, CLIProvider from '@openfin/workspace';
461
+ * import { Home, type CLIProvider } from '@openfin/workspace';
438
462
  *
439
463
  * import { fetchMySearchResults } from "./my-fetch-implementation";
440
464
  *
@@ -460,123 +484,10 @@ export interface HomeRegistration extends RegistrationMetaInfo {
460
484
  * document.body.appendChild(searchButton);
461
485
  *
462
486
  * searchButton.addEventListener('click', () => {
463
- * searchQueryMap.get('my-cli-provider')('my search string');
487
+ * searchQueryMap.get('my-cli-provider')?.('my search string');
464
488
  * });
465
489
  *
466
490
  * ```
467
491
  */
468
492
  setSearchQuery(query: string): Promise<void>;
469
493
  }
470
- /**
471
- * Interface that contains functions for integrating with Home.
472
- */
473
- export interface HomeAPI {
474
- /**
475
- * Register a provider that can return search results to Home.
476
- *
477
- * ```ts
478
- * import { Home, CLIProvider } from "@openfin/workspace";
479
- *
480
- * import { fetchMySearchResults } from "./my-fetch-implementation";
481
- *
482
- * const myCLIProvider: CLIProvider = {
483
- * id: "my-cli-provider",
484
- * title: "My CLI Provider",
485
- * icon: "https://google.com/favicon.ico",
486
- * onUserInput: (req) => fetchMySearchResults(req.query)
487
- * };
488
- *
489
- * const register = async () => {
490
- * await Home.register(myCLIProvider);
491
- * }
492
- * ```
493
- *
494
- * @param provider the provider implementation.
495
- */
496
- register(provider: HomeProvider | CLIProvider): Promise<HomeRegistration>;
497
- /**
498
- * Deregister a provider.
499
- *
500
- * ```ts
501
- * import { Home , CLIProvider } from "@openfin/workspace";
502
- *
503
- * import { fetchMySearchResults } from "./my-fetch-implementation";
504
- *
505
- * const myCLIProvider: CLIProvider = {
506
- * id: "my-cli-provider",
507
- * title: "My CLI Provider",
508
- * icon: "https://google.com/favicon.ico",
509
- * onUserInput: (req) => fetchMySearchResults(req.query)
510
- * };
511
- *
512
- * // Register and do some work with the provider
513
- *
514
- * const deregister = async () => {
515
- * await Home.deregister("my-cli-provider");
516
- * }
517
- * ```
518
- * @param providerId the name of the provider.
519
- */
520
- deregister(providerId: string): Promise<void>;
521
- /**
522
- * Show the Home UI.
523
- *
524
- * ```ts
525
- * import { Home } from './home'
526
- *
527
- * const show = async () => {
528
- * await Home.show();
529
- * // Do thing after show
530
- * }
531
- * ```
532
- */
533
- show(): Promise<void>;
534
- /**
535
- * Hide the Home UI.
536
- *
537
- * ```ts
538
- * import { Home } from './home'
539
- *
540
- * const hide = async () => {
541
- * await Home.hide();
542
- * // Do thing after hide
543
- * }
544
- * ```
545
- */
546
- hide(): Promise<void>;
547
- }
548
- /**
549
- * Interface that contains functions that aid in recovering legacy features of Workspace.
550
- */
551
- export interface LegacyAPI {
552
- /**
553
- * Get the pages that a user had saved in a legacy version of Workspace. (pre 5.0.0)
554
- *
555
- * ```ts
556
- * import { Legacy } from "@openfin/workspace";
557
- *
558
- * async logPages() {
559
- * const pages = await Legacy.getPages();
560
- * console.log(pages);
561
- * }
562
- *
563
- * logPages();
564
- * ```
565
- */
566
- getPages(): Promise<Page[]>;
567
- /**
568
- * Get the workspaces that a user had saved in a legacy version of Workspace. (pre 5.0.0)
569
- *
570
- * ```ts
571
- * import { Legacy } from "@openfin/workspace";
572
- *
573
- * async logWorkspaces() {
574
- * const workspaces = await Legacy.getWorkspaces();
575
- * console.log(workspaces);
576
- * }
577
- *
578
- * logWorkspaces();
579
- * ```
580
- */
581
- getWorkspaces(): Promise<Workspace[]>;
582
- }
@@ -17,11 +17,11 @@ import type { NotificationPlatform as NotificationsPlatformInternal } from 'open
17
17
  * await register(platform);
18
18
  * ```
19
19
  */
20
- export declare type NotificationsPlatform = Omit<NotificationsPlatformInternal, 'theme'>;
20
+ export type NotificationsPlatform = Omit<NotificationsPlatformInternal, 'theme'>;
21
21
  /**
22
22
  * Registration meta info returned by {@link register}
23
23
  */
24
- export declare type NotificationsRegistration = {
24
+ export type NotificationsRegistration = {
25
25
  clientAPIVersion: string;
26
26
  notificationsVersion: string;
27
27
  };