@interopio/browser 3.5.10 → 4.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.
package/browser.d.ts CHANGED
@@ -6,6 +6,7 @@ import { IOConnectCore } from "@interopio/core";
6
6
  import { IOConnectDesktop } from "@interopio/desktop";
7
7
  import { IOConnectWorkspaces } from "@interopio/workspaces-api";
8
8
  import { IOConnectSearch } from "@interopio/search-api";
9
+ import { IOConnectModals } from "@interopio/modals-api";
9
10
 
10
11
  /**
11
12
  * Factory function that creates a new ioconnect instance.
@@ -19,11 +20,12 @@ export default IOConnectBrowserFactory;
19
20
  * @docname io.Connect Browser
20
21
  * @intro
21
22
  * **io.Connect Browser** allows web apps to integrate with other apps that are part of the same **io.Connect Browser** project via a set of APIs.
22
- * **io.Connect Browser** enables you to share data between apps, expose functionality, manage windows and notifications.
23
+ * **io.Connect Browser** enables you to share data between apps, expose functionality, manage windows, notifications, and more.
23
24
  *
24
25
  * ## Referencing
25
26
  *
26
- * The [`&commat;interopio/browser`](https://www.npmjs.com/package/&commat;interopio/browser) library is available both as a single JavaScript file, which you can include in your web apps using a `<script>` tag, and as a Node.js module:
27
+ * The [`&commat;interopio/browser`](https://www.npmjs.com/package/&commat;interopio/browser) library is available both as a single JavaScript file,
28
+ * which you can include in your web apps using a `<script>` tag, and also as a module, which you can import in your apps:
27
29
  *
28
30
  * ```html
29
31
  * <script type="text/javascript" src="browser.umd.js"></script>
@@ -35,30 +37,30 @@ export default IOConnectBrowserFactory;
35
37
  * import IOBrowser from "&commat;interopio/browser";
36
38
  * ```
37
39
  *
38
- * When deploying your app in production, it's recommended to always reference a specific minified version:
39
- *
40
- * ```html
41
- * <script type="text/javascript" src="browser.umd.min.js"></script>
42
- * ```
43
- *
44
40
  * ## Initialization
45
41
  *
46
- * The [`&commat;interopio/browser`](https://www.npmjs.com/package/&commat;interopio/browser) library attaches a factory function to the global `window` object at runtime - `IOBrowser()`.
47
- * It can be invoked with an optional configuration object to initialize the library and connect to the **io.Connect Browser** environment. The factory function resolves with the `io` API object:
42
+ * The [`&commat;interopio/browser`](https://www.npmjs.com/package/&commat;interopio/browser) library attaches the `IOBrowser()` factory function
43
+ * to the global `window` object. Invoke this function to initialize the library and connect to the **io.Connect Browser** environment.
44
+ * The `IOBrowser()` factory function accepts an optional `Config` object as an argument, which you can use to provide settings for the library
45
+ * (e.g., initialize additional io.Connect libraries, configure the library behavior or some of its APIs).
46
+ * The factory function resolves with the initialized io.Connect API object, which you can use to access all available io.Connect APIs:
48
47
  *
49
48
  * ```javascript
49
+ * import IOBrowser from "&commat;interopio/browser";
50
+ * import IOWorkspaces from "&commat;interopio/workspaces-api";
51
+ *
50
52
  * const initializeIOConnect = async () => {
51
53
  *
52
- * // Initializing the Workspaces library.
54
+ * // Initializing the Workspaces API.
53
55
  * const initOptions = {
54
56
  * libraries: [IOWorkspaces]
55
57
  * };
56
58
  *
57
- * // Use the object returned from the factory function
58
- * // to access the IOConnect Browser APIs.
59
+ * // Use the initialized API object to access the io.Connect APIs.
59
60
  * const io = await IOBrowser(initOptions);
60
61
  *
61
- * // Here the library is initialized and you can access all io.Connect Browser APIs.
62
+ * // Here, the library is already initialized and you can access all available io.Connect APIs.
63
+ * const myWorkspace = await io.workspaces.restoreWorkspace("My Workspace");
62
64
  * };
63
65
  *
64
66
  * initializeIOConnect().catch(console.error);
@@ -70,9 +72,58 @@ export namespace IOConnectBrowser {
70
72
  export import Contexts = IOConnectCore.Contexts;
71
73
  export import Logger = IOConnectCore.Logger;
72
74
 
75
+ /**
76
+ * @ignore
77
+ */
78
+ export interface ProfileData {
79
+ license: {
80
+ type: "trial" | "paid";
81
+ expiration: number;
82
+ },
83
+ productsInfo: {
84
+ platform: {
85
+ apiVersion: string;
86
+ },
87
+ client: {
88
+ apiVersion: string;
89
+ },
90
+ workspaces?: {
91
+ apiVersion: string;
92
+ container?: {
93
+ type: string,
94
+ version: string;
95
+ }
96
+ },
97
+ home?: {
98
+ version: string
99
+ },
100
+ search?: {
101
+ apiVersion: string;
102
+ },
103
+ modals?: {
104
+ apiVersion: string;
105
+ }
106
+ },
107
+ plugins: Array<{ name: string, version: string }>,
108
+ user?: {
109
+ id: string;
110
+ username?: string;
111
+ firstName?: string;
112
+ lastName?: string;
113
+ email?: string;
114
+ type?: string;
115
+ role?: string;
116
+ meta?: any;
117
+ }
118
+ }
119
+
120
+ /**
121
+ * Describes the configuration for the `IOBrowser()` factory function.
122
+ */
73
123
  export interface Config {
124
+
74
125
  /**
75
- * Configure the system logger. Used mostly for during development.
126
+ * Configures the system logger. Used mostly during development.
76
127
  */
77
128
  systemLogger?: SystemLogger;
78
129
 
@@ -84,11 +135,13 @@ export namespace IOConnectBrowser {
84
135
  inproc?: IOConnectCore.InprocGWSettings;
85
136
 
86
137
  /**
87
- * Configure the system logger. Used mostly for during development.
138
+ * Settings for the Notifications API.
88
139
  */
89
140
  notifications?: Notifications.Settings;
90
141
 
91
- /** Enable, disable and configure the Contexts API. Enabled by default */
142
+ /**
143
+ * Settings for the Contexts API.
144
+ */
92
145
  contexts?: IOConnectCore.ContextsConfig;
93
146
 
94
147
  /**
@@ -99,121 +152,416 @@ export namespace IOConnectBrowser {
99
152
 
100
153
  /**
101
154
  * If `true`, when the io.Connect API factory function is invoked more than once in the same app,
102
- * it will return the already initialized API object, instead of throwing an error.
155
+ * it will return the already initialized API object instead of throwing an error.
103
156
  * @default false
157
+ * @since io.Connect Browser 3.5
104
158
  */
105
159
  memoizeAPI?: boolean;
106
160
 
107
161
  /**
108
- * A list of io.Connect libraries which will be initiated internally and provide access to specific functionalities
162
+ * List of references to the factory functions of additional io.Connect libraries to be initialized internally (e.g., `&commat;interopio/workspaces-api`, `&commat;interopio/search-api`).
163
+ * The APIs provided by these libraries can then be accessed via the initialized io.Connect API object (e.g., `io.workspaces`, `io.search`).
109
164
  */
110
165
  libraries?: Array<(io: IOConnectBrowser.API, config?: IOConnectBrowser.Config | IOConnectDesktop.Config) => Promise<void>>;
111
166
 
112
- /* Enable and configure Intents Resolver UI */
167
+ /**
168
+ * Deprecated. Settings for the legacy Intents Resolver UI in **io.Connect Browser**.
169
+ * @ignore
170
+ */
113
171
  intents?: IOConnectBrowser.Intents.Config;
114
172
 
115
- /* Configure widget */
116
- widget?: Widget;
173
+ /**
174
+ * Settings for the io.Connect widget.
175
+ * @since io.Connect Browser 3.5
176
+ */
177
+ widget?: WidgetConfig;
178
+
179
+ /**
180
+ * Settings for the io.Connect modals.
181
+ * @since io.Connect Browser 4.0
182
+ */
183
+ modals?: ModalsUIConfig;
184
+
185
+ /**
186
+ * Settings for the Intents Resolver UI.
187
+ * @since io.Connect Browser 4.0
188
+ */
189
+ intentResolver?: IntentResolverUIConfig;
117
190
  }
118
191
 
119
- export namespace Widget {
120
- export type ChannelSelectorType = "directional" | "default";
192
+ /**
193
+ * Type of the Channel Selector to use in the widget.
194
+ */
195
+ export type WidgetChannelSelectorType = "directional" | "default";
121
196
 
122
- export type ChannelsDisplayMode = "all" | "fdc3";
197
+ /**
198
+ * Determines which of the available Channels to display (all or only FDC3 ones).
199
+ */
200
+ export type WidgetChannelsDisplayMode = "all" | "fdc3";
123
201
 
124
- export type Position = "top" | "bottom" | "left" | "right";
202
+ /**
203
+ * Initial position for the widget within the window.
204
+ */
205
+ export type WidgetPosition = "top" | "bottom" | "left" | "right";
125
206
 
126
- export type Mode = "compact" | "default";
207
+ /**
208
+ * Mode for displaying the widget.
209
+ */
210
+ export type WidgetMode = "compact" | "default";
127
211
 
128
- export interface ChannelSelectorConfig {
129
- /**
130
- * Configure whether Channel Selector will be added to the Widget component
131
- * @default true
132
- */
133
- enable?: boolean;
134
-
135
- type?: ChannelSelectorType;
212
+ /**
213
+ * Settings for the Widget Channel Selector UI.
214
+ */
215
+ export interface WidgetChannelSelectorConfig {
216
+ /**
217
+ * If `true`, will enable the Channel Selector UI in the widget.
218
+ * @default true
219
+ */
220
+ enable?: boolean;
221
+
222
+ /**
223
+ * Type of the Channel Selector UI.
224
+ * @default "default"
225
+ */
226
+ type?: WidgetChannelSelectorType;
227
+ }
228
+
229
+ /**
230
+ * Settings for the Channel Selector UI.
231
+ */
232
+ export interface WidgetChannels {
233
+
234
+ /**
235
+ * Settings for the Channel Selector UI.
236
+ */
237
+ selector?: WidgetChannelSelectorConfig;
238
+
239
+ /**
240
+ * Determines which of the available Channels to display (all or only FDC3 ones).
241
+ * @default "all"
242
+ */
243
+ displayMode?: WidgetChannelsDisplayMode;
244
+ }
245
+
246
+ /**
247
+ * Describes the configuration for the io.Connect widget.
248
+ */
249
+ export interface WidgetConfig {
250
+ /**
251
+ * If `true`, will enable the widget for the Browser Client unless the app origin has been blocked in the Main app configuration.
252
+ */
253
+ enable: boolean;
254
+
255
+ /**
256
+ * Settings for the Channel Selector UI.
257
+ */
258
+ channels?: WidgetChannels;
259
+
260
+ /**
261
+ * Initial position for the widget within the window.
262
+ * @default "bottom"
263
+ */
264
+ position?: WidgetPosition;
265
+
266
+ /**
267
+ * Mode for displaying the widget.
268
+ * @default "default"
269
+ */
270
+ mode?: WidgetMode;
271
+
272
+ /**
273
+ * If `true`, the widget will be visible in the app even if the app is currently in a Workspace.
274
+ * @default false
275
+ */
276
+ displayInWorkspace?: boolean;
277
+
278
+ /**
279
+ * If `true`, the `&commat;interopio/browser` library will wait for the `IOBrowserWidget()` factory function to resolve before completing its initialization.
280
+ * @default true
281
+ */
282
+ awaitFactory?: boolean;
283
+
284
+ /**
285
+ * Interval in milliseconds to wait for the `IOBrowserWidget()` factory function to be fetched from the remote source.
286
+ * @default 5000
287
+ */
288
+ timeout?: number;
289
+ }
290
+
291
+ /**
292
+ * Settings for the Intents Resolver UI.
293
+ */
294
+ export interface IntentResolverUIConfig {
295
+
296
+ /**
297
+ * If `true`, will enable the Intents Resolver UI for the Browser Client unless the app origin has been blocked in the Main app configuration.
298
+ */
299
+ enable: boolean;
300
+
301
+ /**
302
+ * If `true`, the `&commat;interopio/browser` library will wait for the `IOBrowserIntentResolverUI()` factory function
303
+ * to resolve before completing its initialization.
304
+ * @default true
305
+ */
306
+ awaitFactory?: boolean;
307
+
308
+ /**
309
+ * Interval in milliseconds to wait for the `IOBrowserIntentResolverUI()` factory function to be fetched from the remote source.
310
+ * @default 5000
311
+ */
312
+ timeout?: number;
313
+ }
314
+
315
+ /**
316
+ * @ignore
317
+ */
318
+ export namespace IntentResolverUI {
319
+ export interface API {
320
+ open: (config: OpenConfig) => OpenResult;
321
+ close: (config: CloseConfig) => void;
136
322
  }
137
323
 
138
- export interface Channels {
139
- selector?: ChannelSelectorConfig;
140
- /**
141
- * Configure whether to show only fdc3-enabled channels or all
142
- * @default all
143
- */
144
- displayMode?: ChannelsDisplayMode;
324
+ export interface OpenConfigWithIntentRequest {
325
+ intentRequest: IOConnectBrowser.Intents.IntentRequest;
326
+ handlerFilter?: never;
145
327
  }
146
328
 
147
- export interface DefaultConfig {
148
- enable: boolean;
329
+ export interface OpenConfigWithHandlerFilter {
330
+ handlerFilter: IOConnectBrowser.Intents.HandlerFilter;
331
+ intentRequest?: never;
332
+ }
149
333
 
150
- channels?: Channels;
334
+ export interface UISettings {
335
+ showCloseButton?: boolean;
336
+ }
151
337
 
152
- /**
153
- * Starting position
154
- * @default bottom
155
- */
156
- position?: Position;
338
+ export type OpenConfig = (OpenConfigWithIntentRequest | OpenConfigWithHandlerFilter) & { onUserResponse: (response: { response: IntentResolverResponse }) => void, uiSettings?: UISettings };
339
+
340
+ export interface UserSettings {
341
+ preserveChoice: boolean;
342
+ }
343
+
344
+ export interface UserChoiceResponse {
345
+ intent: string;
346
+ handler: IOConnectBrowser.Intents.IntentHandler;
347
+ userSettings: UserSettings;
348
+ }
349
+ export interface IntentResolverResponse {
350
+ isExpired?: boolean;
351
+ isClosed?: boolean;
352
+ userChoice?: UserChoiceResponse;
353
+ }
354
+
355
+ export interface OpenResult {
356
+ id: string;
357
+ }
358
+
359
+ export interface CloseConfig {
360
+ id: string;
361
+ }
362
+ }
363
+
364
+ /**
365
+ * The [`&commat;interopio/modals-ui`](https://www.npmjs.com/package/&commat;interopio/modals-ui) library provides components and APIs used
366
+ * in **io.Connect Browser** for displaying dialogs and alerts. When initializing the [`&commat;interopio/browser`](https://www.npmjs.com/package/&commat;interopio/browser) library,
367
+ * you can provide configuration for the Modals UI library (e.g., disable alerts and/or dialogs, and more).
368
+ */
369
+ export interface ModalsUIConfig {
370
+
371
+ /**
372
+ * Settings for the io.Connect alerts.
373
+ */
374
+ alerts?: {
157
375
 
158
376
  /**
159
- * Widget mode
160
- * @default default
377
+ * If `true`, will enable the io.Connect alerts.
161
378
  */
162
- mode?: Mode;
379
+ enabled: boolean;
380
+ };
381
+
382
+ /**
383
+ * Settings for the io.Connect dialogs.
384
+ */
385
+ dialogs?: {
163
386
 
164
387
  /**
165
- * If `true`, the widget will be visible in the app even if the app is currently in a Workspace.
166
- * @default false
388
+ * If `true`, will enable the io.Connect dialogs.
167
389
  */
168
- displayInWorkspace?: boolean;
169
- }
170
- }
171
-
390
+ enabled: boolean;
391
+ };
172
392
 
173
- export interface Widget extends Widget.DefaultConfig {
174
393
  /**
175
- * Whether to wait for IOBrowserWidget factory to resolve
394
+ * If `true`, the `&commat;interopio/browser` library will wait for the `IOBrowserModalsUI()` factory function to resolve before completing its initialization.
176
395
  * @default true
177
396
  */
178
397
  awaitFactory?: boolean;
398
+
179
399
  /**
180
- * Timeout to wait for the IOBrowserWidget factory to be fetched from the remote source
400
+ * Interval in milliseconds to wait for the `IOBrowserModalsUI()` factory function to be fetched from the remote source.
181
401
  * @default 5000
182
402
  */
183
403
  timeout?: number;
184
404
  }
185
405
 
406
+ /**
407
+ * @ignore
408
+ */
409
+ export namespace ModalsUI {
410
+
411
+ /**
412
+ * @ignore
413
+ */
414
+ export interface API {
415
+ alerts: Alerts.API;
416
+ dialogs: Dialogs.API;
417
+ }
418
+
419
+ /**
420
+ * @ignore
421
+ */
422
+ export namespace Alerts {
423
+ export interface API {
424
+ open: (config: OpenConfig) => OpenResult;
425
+ close: (config: CloseConfig) => void;
426
+ }
427
+
428
+ export interface InteropAction {
429
+ name: string;
430
+ settings: IOConnectModals.InteropSettings;
431
+ }
432
+
433
+ export type OpenConfig = Omit<IOConnectModals.AlertRequestConfig, "target" | "ttl"> & {
434
+ onClose: () => void;
435
+ onClick: (config: OnClickConfig) => void;
436
+ }
437
+
438
+ export interface OpenResult {
439
+ id: string;
440
+ }
441
+
442
+ export interface CloseConfig {
443
+ id: string;
444
+ }
445
+
446
+ export interface OnClickConfig {
447
+ interopAction: InteropAction;
448
+ }
449
+ }
450
+
451
+ /**
452
+ * @ignore
453
+ */
454
+ export namespace Dialogs {
455
+ export interface API {
456
+ open: (config: OpenConfig) => OpenResult;
457
+ close: (config: CloseConfig) => void;
458
+ }
459
+
460
+ export interface OpenConfig<Name extends string = string, Variables = any> {
461
+ templateName: Name;
462
+ onCompletion: (config: OnCompletionConfig) => void;
463
+ size?: IOConnectModals.DialogRequestConfig["size"];
464
+ variables: Variables;
465
+ }
466
+
467
+ export interface OpenResult {
468
+ id: string;
469
+ }
470
+
471
+ export interface CloseConfig {
472
+ id: string;
473
+ }
474
+
475
+ export interface OnCompletionConfig {
476
+ response: IOConnectModals.DialogResponse;
477
+ }
478
+ }
479
+ }
480
+
186
481
  export interface SystemLogger {
187
482
  level?: IOConnectCore.Logger.LogLevel;
188
483
  callback?: (logInfo: any) => void;
189
484
  }
190
485
 
486
+ /**
487
+ * Describes an instance of the initialized io.Connect library.
488
+ */
191
489
  export interface API extends IOConnectCore.API {
490
+
491
+ /**
492
+ * Window Management API.
493
+ */
192
494
  windows: IOConnectBrowser.Windows.API;
495
+
496
+ /**
497
+ * Layouts API.
498
+ */
193
499
  layouts: IOConnectBrowser.Layouts.API;
500
+
501
+ /**
502
+ * Notifications API.
503
+ */
194
504
  notifications: IOConnectBrowser.Notifications.API;
505
+
506
+ /**
507
+ * Channels API.
508
+ */
195
509
  channels: IOConnectBrowser.Channels.API;
510
+
511
+ /**
512
+ * App Management API.
513
+ */
196
514
  appManager: IOConnectBrowser.AppManager.API;
515
+
516
+ /**
517
+ * Intents API.
518
+ */
197
519
  intents: IOConnectBrowser.Intents.API;
520
+
521
+ /**
522
+ * Themes API.
523
+ */
198
524
  themes?: IOConnectBrowser.Themes.API;
525
+
526
+ /**
527
+ * Workspaces API.
528
+ */
199
529
  workspaces?: IOConnectWorkspaces.API;
530
+
531
+ /**
532
+ * Search API.
533
+ */
200
534
  search?: IOConnectSearch.API;
535
+
536
+ /**
537
+ * @ignore
538
+ */
201
539
  webPlatform?: IOConnectBrowser.WebPlatform.API;
540
+
541
+ /**
542
+ * App Preferences API.
543
+ */
202
544
  prefs: IOConnectBrowser.Prefs.API;
545
+
546
+ /**
547
+ * Modals API.
548
+ * @since io.Connect Browser 4.0
549
+ */
550
+ modals?: IOConnectModals.API;
203
551
  }
204
552
 
205
553
  /**
206
554
  * @intro
207
- * Using the Window Management API, your application can easily open and manipulate browser windows.
555
+ * Using the Window Management API, your app can easily open and manipulate browser windows.
208
556
  * This allows you to transform your traditional single-window web app into a multi-window native-like web application.
209
- * The Window Management API enables applications to:
557
+ * The Window Management API enables apps to:
210
558
  *
211
559
  * - open multiple windows;
212
560
  * - manipulate the position and size of opened windows;
213
561
  * - pass context data upon opening new windows;
214
562
  * - listen for and handle events related to opening and closing windows;
215
563
  *
216
- * The Window Management API is accessible through the `io.windows` object.
564
+ * The Window Management API is accessible via the [`io.windows`](#API) object.
217
565
  */
218
566
  export namespace Windows {
219
567
  export interface API {
@@ -417,14 +765,17 @@ export namespace IOConnectBrowser {
417
765
 
418
766
  /**
419
767
  * @intro
420
- * The Layouts library has the following capabilities:
768
+ * **io.Connect Browser** enables you to to save and later restore the exact arrangement and context of your environment
769
+ * - windows, apps, Workspaces, and their respective bounds and context.
770
+ *
771
+ * The Layouts API offers the following features:
421
772
  *
422
- * - importing, exporting, removing and getting Layouts;
773
+ * - importing, exporting, removing. and retrieving Layouts;
423
774
  * - saving and restoring Layouts;
424
- * - events related to adding, removing, changing or saving Layouts;
775
+ * - events related to adding, removing, changing, or saving Layouts;
425
776
  * - requesting browser permission for the Multi-Screen Window Placement API;
426
777
  *
427
- * The Layouts API is accessible through the `io.layouts` object.
778
+ * The Layouts API is accessible via the [`io.layouts`](#API) object.
428
779
  */
429
780
  namespace Layouts {
430
781
 
@@ -453,6 +804,12 @@ export namespace IOConnectBrowser {
453
804
  */
454
805
  get(name: string, type: LayoutType): Promise<Layout | undefined>;
455
806
 
807
+ /**
808
+ * Retrieves the last restored Global Layout (if any).
809
+ * @since io.Connect Browser 4.0
810
+ */
811
+ getCurrentLayout(): Promise<Layout | undefined>;
812
+
456
813
  /**
457
814
  * Returns a lightweight description of all Layouts of the provided type, without the extensive objects describing the Layout components.
458
815
  * @param type Type of the Layouts to fetch.
@@ -503,6 +860,14 @@ export namespace IOConnectBrowser {
503
860
  */
504
861
  onChanged(callback: (layout: Layout) => void): () => void;
505
862
 
863
+ /**
864
+ * Notifies when a new default Global Layout has been selected or when the current one has been cleared.
865
+ * @param callback Callback function for handling the event. Receives as an argument an object with a `name` property
866
+ * holding the name of the newly selected default Global Layout. If the default Global Layout has been cleared, the argument will be `undefined`.
867
+ * @since io.Connect Browser 4.0
868
+ */
869
+ onDefaultGlobalChanged(callback: (layout?: { name: string }) => void): () => void;
870
+
506
871
  /**
507
872
  * Notifies when a Layout is removed.
508
873
  * @param callback Callback function to handle the event. Receives the `Layout` object as an argument and returns an unsubscribe function.
@@ -557,10 +922,18 @@ export namespace IOConnectBrowser {
557
922
  rename(layout: Layout, newName: string): Promise<LayoutResult>;
558
923
 
559
924
  /**
560
- * Notifies when a Layout is renamed.
561
- * @param callback Callback function to handle the event. Receives the `Layout` object as an argument and returns an unsubscribe function.
925
+ * Notifies when a Layout is renamed. Returns an unsubscribe function.
926
+ * @param callback Callback function for handling the event. Receives as a first argument the `Layout` object describing the renamed Layout.
927
+ * Receives as a second argument an object with a `name` property holding the previous Layout name.
562
928
  */
563
- onRenamed(callback: (layout: Layout) => void): () => void;
929
+ onRenamed(callback: (layout: Layout, previous: { name: string }) => void): () => void;
930
+
931
+ /**
932
+ * Notifies when a Layout is restored.
933
+ * @param callback Callback function for handling the event. Receives as an argument the `Layout` object that was restored.
934
+ * @since io.Connect Browser 4.0
935
+ */
936
+ onRestored(callback: (layout: Layout) => void): () => void;
564
937
 
565
938
  /**
566
939
  * Updates the metadata of a Layout.
@@ -583,8 +956,8 @@ export namespace IOConnectBrowser {
583
956
  components: Array<WindowComponent | WorkspaceFrameComponent | IOConnectWorkspaces.WorkspaceComponent>;
584
957
 
585
958
  /**
586
- * Used internally to audit operations.
587
- * @ignore
959
+ * Used internally to audit operations.
960
+ * @ignore
588
961
  */
589
962
  token?: string;
590
963
 
@@ -787,11 +1160,11 @@ export namespace IOConnectBrowser {
787
1160
  /**
788
1161
  * @intro
789
1162
  * The Notifications API provides a way to display native notifications with actions and to handle notification and action clicks.
790
- * **io.Connect Browser** supports all available `Notification` settings as defined in the [DOM Notifications API](https://developer.mozilla.org/en-US/docs/Web/API/Notifications_API).
1163
+ * **io.Connect Browser** supports all available notification settings as defined in the [DOM Notifications API](https://developer.mozilla.org/en-US/docs/Web/API/Notifications_API).
791
1164
  *
792
1165
  * The **io.Connect Browser** Notifications API extends the DOM Notifications API with the option to handle notification and action clicks using Interop methods.
793
1166
  *
794
- * The Notifications API is accessible through the `io.notifications` object.
1167
+ * The Notifications API is accessible via the [`io.notifications`](#API) object.
795
1168
  */
796
1169
  export namespace Notifications {
797
1170
  export interface API {
@@ -826,19 +1199,26 @@ export namespace IOConnectBrowser {
826
1199
  */
827
1200
  onClosed(callback: (notification: { id: string }) => void): UnsubscribeFunction;
828
1201
 
829
- /**
830
- * Notifies when the global notification settings are changed.
1202
+ /**
1203
+ * Notifies when the global notification settings are changed.
831
1204
  * @param callback Callback function for handling the event.
832
1205
  */
833
1206
  onConfigurationChanged(callback: (configuration: Configuration) => void): UnsubscribeFunction;
834
1207
 
835
- /**
836
- * Notifies when the number of active notification is changed.
1208
+ /**
1209
+ * Notifies when the number of active notification is changed.
837
1210
  * @param callback Callback function for handling the event.
838
1211
  */
839
1212
  onActiveCountChanged(callback: (info: { count: number; }) => void): UnsubscribeFunction;
840
1213
 
841
- /** Notifies when the state of a notification is changed.
1214
+ /**
1215
+ * Alias for `onActiveCountChanged()` for compatibility with **io.Connect Desktop**.
1216
+ * @param callback Callback function for handling the event.
1217
+ * @since io.Connect Browser 4.0
1218
+ */
1219
+ onCounterChanged(callback: (info: { count: number; }) => void): UnsubscribeFunction;
1220
+
1221
+ /** Notifies when the state of a notification is changed.
842
1222
  * @param callback Callback function for handling the event.
843
1223
  */
844
1224
  onStateChanged(callback: (notification: { id: string; }, state: State) => void): UnsubscribeFunction;
@@ -978,6 +1358,12 @@ export namespace IOConnectBrowser {
978
1358
  enableToasts?: boolean;
979
1359
  /** Filter with names of apps that are allowed or not allowed to raise notifications. */
980
1360
  sourceFilter?: NotificationFilter;
1361
+ /**
1362
+ * If `true`, will enable showing a notification badge in the io.Connect Home App.
1363
+ * @default true
1364
+ * @since io.Connect Browser 4.0
1365
+ */
1366
+ showNotificationBadge?: boolean;
981
1367
  }
982
1368
 
983
1369
  /** Filter with names of apps that are allowed or not allowed to raise notifications. */
@@ -992,13 +1378,14 @@ export namespace IOConnectBrowser {
992
1378
  /**
993
1379
  * @intro
994
1380
  * Channels are globally accessed named contexts that allow users to dynamically group apps, instructing them to work over the same shared data object.
1381
+ *
995
1382
  * The Channels API enables you to:
996
1383
  *
997
- * - discover Channels - get the names and contexts of all Channels;
998
- * - navigate through Channels - get the current Channel, join and leave Channels, subscribe for the event which fires when the current Channel has changed;
999
- * - publish and subscribe - publish data to other apps on the same Channel and subscribe for Channel updates to react to data published by other apps;
1384
+ * - retrieve the names and contexts of all Channels;
1385
+ * - retrieve the current Channel, join and leave Channels, subscribe for the event which fires when the current Channel has changed;
1386
+ * - publish data to other apps on the same Channel and subscribe for Channel updates to react to data published by other apps;
1000
1387
  *
1001
- * The Channels API is accessible through the `io.channels` object.
1388
+ * The Channels API is accessible via the [`io.channels`](#API) object.
1002
1389
  */
1003
1390
  namespace Channels {
1004
1391
  /**
@@ -1115,7 +1502,7 @@ export namespace IOConnectBrowser {
1115
1502
  onChanged(callback: (channel: string) => void): UnsubscribeFunction;
1116
1503
 
1117
1504
  /**
1118
- * Notifies when the current window joins or leaves a Channel. Can be used both in single and in multi Channel mode.
1505
+ * Notifies when the current window joins or leaves a Channel. Can be used both in single and in multi Channel mode.
1119
1506
  * If used in single Channel mode, when the window joins a Channel, the array argument passed to the callback for handling the event
1120
1507
  * will always contain a single member; when the window leaves the current Channel, the array will be empty. Returns an unsubscribe function.
1121
1508
  * @param callback Callback function for handling the event. Receives a list with the names of the currently joined Channels as an argument.
@@ -1176,6 +1563,30 @@ export namespace IOConnectBrowser {
1176
1563
  * @since io.Connect Browser 3.3
1177
1564
  */
1178
1565
  restrictAll(restrictions: RestrictionsConfig): Promise<void>;
1566
+
1567
+ /**
1568
+ * Clears the context data of the current Channel. The `data` property of the Channel context is set to an empty object.
1569
+ * Pass a Channel name as an argument to clear the data of a specific Channel.
1570
+ * @param name Name of the Channel whose context data to clear.
1571
+ * @since io.Connect Browser 4.0
1572
+ */
1573
+ clearChannelData(name?: string): Promise<void>;
1574
+
1575
+ /**
1576
+ * Sets a specified path within the Channel context to the provided value. If the path doesn't exist, it will be created.
1577
+ * @param path Object containing the path to update and the value with which to update it. The path must be specified as a dot-separated string (e.g., `"prop1.prop2"`).
1578
+ * @param name Name of the Channel to update. If not specified, will update the current Channel.
1579
+ * @since io.Connect Browser 4.0
1580
+ */
1581
+ setPath(path: IOConnectBrowser.Contexts.PathValue, name?: string): Promise<void>;
1582
+
1583
+ /**
1584
+ * Sets a list of specified paths within the Channel context to the provided values. If a path doesn't exist, it will be created.
1585
+ * @param paths List of objects each containing a path to update and the value with which to update it. The path must be specified as a dot-separated string (e.g., `"prop1.prop2"`).
1586
+ * @param name Name of the Channel to update. If not specified, will update the current Channel.
1587
+ * @since io.Connect Browser 4.0
1588
+ */
1589
+ setPaths(paths: IOConnectBrowser.Contexts.PathValue[], name?: string): Promise<void>;
1179
1590
  }
1180
1591
 
1181
1592
  /**
@@ -1221,7 +1632,7 @@ export namespace IOConnectBrowser {
1221
1632
  */
1222
1633
  export interface PublishOptions {
1223
1634
  /**
1224
- * The name of the Channel to update. If not provided, the current Channel will be updated.
1635
+ * The name of the Channel to update. If not provided, the current Channel will be updated.
1225
1636
  */
1226
1637
  name?: string;
1227
1638
 
@@ -1281,11 +1692,11 @@ export namespace IOConnectBrowser {
1281
1692
  * this channel in a UI, e.g: `#FF0000`. May be any color value supported by
1282
1693
  * CSS, e.g. name, hex, rgba, etc.. */
1283
1694
  color?: string;
1284
-
1695
+
1285
1696
  /**
1286
1697
  * A URL of an image that can be used to display this channel. */
1287
1698
  glyph?: string;
1288
- }
1699
+ }
1289
1700
 
1290
1701
  export interface FDC3ChannelMeta {
1291
1702
  id: string;
@@ -1381,12 +1792,14 @@ export namespace IOConnectBrowser {
1381
1792
  * @intro
1382
1793
  * The App Management API provides a way to manage **io.Connect Browser** apps. It offers abstractions for:
1383
1794
  *
1384
- * - **Application** - a web app as a logical entity, registered in **io.Connect Browser** with some metadata (name, title, version, etc.) and with all the configuration needed to spawn one or more instances of it.
1385
- * The App Management API provides facilities for retrieving app metadata and for detecting when an application has been started;
1795
+ * - **Application** - a web app as a logical entity, registered in **io.Connect Browser** with some metadata (name, title, version, etc.)
1796
+ * and with all the configuration needed to spawn one or more instances of it.
1797
+ * The App Management API provides facilities for retrieving app metadata and for detecting when an app has been added or removed.
1386
1798
  *
1387
- * - **Instance** - a running copy of an app. The App Management API provides facilities for starting/stopping app instances and tracking app and instance related events;
1799
+ * - **Instance** - a running copy of a web app hosted in an io.Connect Window. The App Management API provides facilities for
1800
+ * starting and stopping app instances and tracking app and instance related events.
1388
1801
  *
1389
- * The App Management API is accessible through the `io.appManager` object.
1802
+ * The App Management API is accessible via the [`io.appManager`](#API) object.
1390
1803
  */
1391
1804
  namespace AppManager {
1392
1805
  /**
@@ -1551,7 +1964,7 @@ export namespace IOConnectBrowser {
1551
1964
  */
1552
1965
  channelSelector?: ChannelSelector;
1553
1966
 
1554
- /**
1967
+ /**
1555
1968
  * Configuration for the `sandbox` attribute of the `<iframe>` element in which the app will be started when opened in a Workspace.
1556
1969
  */
1557
1970
  iframePermissionsPolicy?: IFramePermissionsPolicyConfig;
@@ -1770,14 +2183,14 @@ export namespace IOConnectBrowser {
1770
2183
  appId: string;
1771
2184
 
1772
2185
  /**
1773
- * The name of the application. The name should be unique within an FDC3 App Directory instance.
1774
- * The exception to the uniqueness constraint is that an App Directory can hold definitions for multiple versions of the same app.
2186
+ * The name of the application. The name should be unique within an FDC3 App Directory instance.
2187
+ * The exception to the uniqueness constraint is that an App Directory can hold definitions for multiple versions of the same app.
1775
2188
  * The same appName could occur in other directories. We are not currently specifying app name conventions in the document.
1776
2189
  */
1777
- name: string;
2190
+ name?: string;
1778
2191
 
1779
2192
  /**
1780
- * Enum: "web" "native" "citrix" "onlineNative" "other".
2193
+ * Enum: "web" "native" "citrix" "onlineNative" "other".
1781
2194
  * The technology type that is used to launch and run the application. Each application type implies a particular set of launch details
1782
2195
  */
1783
2196
  type: FDC3DefinitionV2Types;
@@ -1816,7 +2229,7 @@ export namespace IOConnectBrowser {
1816
2229
  description?: string;
1817
2230
 
1818
2231
  /**
1819
- * An array of string categories that describe the application.
2232
+ * An array of string categories that describe the application.
1820
2233
  * These are meant as a hint to catalogs or stores listing FDC3-enabled apps and it is expected that these will make a best effort to find appropriate categories (or category) under which to list the app.
1821
2234
  */
1822
2235
  categories?: string[];
@@ -1857,14 +2270,14 @@ export namespace IOConnectBrowser {
1857
2270
  customConfig?: PropertiesObject[];
1858
2271
 
1859
2272
  /**
1860
- * A mapping from host name to a host-specific application manifest object or URI from which that manifest can be retrieved.
1861
- * The manifest should provide details required to launch and use the application within the specified host.
2273
+ * A mapping from host name to a host-specific application manifest object or URI from which that manifest can be retrieved.
2274
+ * The manifest should provide details required to launch and use the application within the specified host.
1862
2275
  * The manifest MAY duplicate or override information provided in the details field.
1863
2276
  */
1864
2277
  hostManifests?: any;
1865
2278
 
1866
2279
  /**
1867
- * Metadata that describes how the application uses FDC3 APIs. This metadata serves multiple purposes:
2280
+ * Metadata that describes how the application uses FDC3 APIs. This metadata serves multiple purposes:
1868
2281
  * - It supports intent resolution by a desktop agent, by declaring what intents an app listens for.
1869
2282
  * - It may be used, for example in an app catalog UI, to find apps that 'interoperate with' other apps.\
1870
2283
  * - It provides a standard location to document how the app interacts with user channels, app channels, and intents, for use by other app developers and desktop assemblers.
@@ -1872,7 +2285,7 @@ export namespace IOConnectBrowser {
1872
2285
  interop?: InteropV2;
1873
2286
 
1874
2287
  /**
1875
- * Provides localized alternatives to any field of the AppD record, which may also refer to an alternative version of the application that is also localized
2288
+ * Provides localized alternatives to any field of the AppD record, which may also refer to an alternative version of the application that is also localized
1876
2289
  * (e.g. by providing an alternative URL). The keys to this object should be language tags as defined by IETF RFC 5646, e.g. en, en-GB or fr-FR.
1877
2290
  */
1878
2291
  localizedVersions?: { [languageTag: string]: LocalizedVersionDefinition };
@@ -2041,17 +2454,22 @@ export namespace IOConnectBrowser {
2041
2454
 
2042
2455
  /**
2043
2456
  * @intro
2044
- * In certain workflow scenarios, your application may need to start (or activate) a specific application.
2045
- * For instance, you may have an application showing client portfolios with financial instruments.
2046
- * When the user clicks on an instrument, you want to start an application which shows a chart for that instrument.
2047
- * In other cases, you may want to present the user with several options for executing an action or handling data from the current application.
2457
+ * In certain workflow scenarios, your app may need to start (or activate) a specific app.
2458
+ * For instance, you may have an app showing client portfolios with financial instruments.
2459
+ * When the user clicks on an instrument, you want to start an app which shows a chart for that instrument.
2460
+ * In other cases, you may want to present the user with several options for executing an action or handling data from the current app.
2048
2461
  *
2049
- * The Intents API makes all that possible by enabling applications to register, find and raise Intents.
2462
+ * The Intents API makes all that possible by enabling apps to register, find, and raise Intents.
2050
2463
  *
2051
- * The Intents API is accessible through the `io.intents` object.
2464
+ * The Intents API is accessible via the [`io.intents`](#API) object.
2052
2465
  */
2053
2466
  namespace Intents {
2467
+
2468
+ /**
2469
+ * Intents API.
2470
+ */
2054
2471
  export interface API {
2472
+
2055
2473
  /**
2056
2474
  * Raises an intent, optionally passing context to the intent handlers, and optionally targeting specific intent handlers.
2057
2475
  * If no handlers are matching the targeting conditions the promise will be rejected.
@@ -2069,7 +2487,7 @@ export namespace IOConnectBrowser {
2069
2487
  /**
2070
2488
  * @ignore
2071
2489
  * @deprecated Use register() method instead
2072
- *
2490
+ *
2073
2491
  * If your application is an intent handler use this method to handle incoming intent requests.
2074
2492
  * Please note that when a new instance of your application is started as a result of a raised intent with
2075
2493
  * e.g. `startNew` your application needs to call `addIntentListener()` on startup so that the intent can be resolved.
@@ -2132,13 +2550,19 @@ export namespace IOConnectBrowser {
2132
2550
  onHandlerRemoved(callback: (handler: IntentHandler, intentName: string) => void): UnsubscribeFunction;
2133
2551
 
2134
2552
  /**
2135
- * An object, which exposes the Intents Resolver API.
2553
+ * Deprecated for **io.Connect Browser**. Intents Resolver API.
2554
+ * @ignore
2136
2555
  */
2137
2556
  resolver?: Resolver;
2138
2557
  }
2558
+
2559
+ /**
2560
+ * Deprecated. Settings for the legacy Intents Resolver UI for **io.Connect Browser**.
2561
+ * @ignore
2562
+ */
2139
2563
  export interface Config {
2140
2564
  /**
2141
- * Whether to use Intents Resolver UI to handle raising an intent.
2565
+ * Whether to use Intents Resolver UI to handle raising an intent.
2142
2566
  * The UI provides the user with a list of all available applications and running instances which can handle the raised intent.
2143
2567
  * Default value: true
2144
2568
  */
@@ -2151,7 +2575,7 @@ export namespace IOConnectBrowser {
2151
2575
  intentsResolverAppName?: string;
2152
2576
 
2153
2577
  /**
2154
- * Timeout to wait for response from Intents Resolver UI
2578
+ * Timeout to wait for response from Intents Resolver UI
2155
2579
  * @default 60000
2156
2580
  */
2157
2581
  methodResponseTimeoutMs?: number;
@@ -2159,6 +2583,7 @@ export namespace IOConnectBrowser {
2159
2583
 
2160
2584
  /**
2161
2585
  * Describes an Intent handler app within the Intents Resolver API.
2586
+ * @ignore
2162
2587
  */
2163
2588
  interface ResolverIntentHandler {
2164
2589
  /**
@@ -2183,7 +2608,8 @@ export namespace IOConnectBrowser {
2183
2608
  }
2184
2609
 
2185
2610
  /**
2186
- * API for controlling the Intents Resolver UI app.
2611
+ * Deprecated for **io.Connect Browser**. API for controlling the Intents Resolver UI app.
2612
+ * @ignore
2187
2613
  */
2188
2614
  export interface Resolver {
2189
2615
  /**
@@ -2233,6 +2659,7 @@ export namespace IOConnectBrowser {
2233
2659
 
2234
2660
  /**
2235
2661
  * Describes the app instance that opened the Intents Resolver UI.
2662
+ * @ignore
2236
2663
  */
2237
2664
  export interface ResolverCaller {
2238
2665
  /**
@@ -2251,6 +2678,7 @@ export namespace IOConnectBrowser {
2251
2678
 
2252
2679
  /**
2253
2680
  * Options for sending the chosen Intent handler to the app that raised the Intent.
2681
+ * @ignore
2254
2682
  */
2255
2683
  export interface SendResolverResponseOptions {
2256
2684
  /**
@@ -2265,8 +2693,8 @@ export namespace IOConnectBrowser {
2265
2693
  }
2266
2694
 
2267
2695
  /**
2268
- *
2269
- * Use to define dynamic intents, that will have the same lifespan as your application instance
2696
+ *
2697
+ * Use to define dynamic intents, that will have the same lifespan as your application instance
2270
2698
  * */
2271
2699
  export interface AddIntentListenerRequest {
2272
2700
  intent: string;
@@ -2278,7 +2706,7 @@ export namespace IOConnectBrowser {
2278
2706
  }
2279
2707
 
2280
2708
  /**
2281
- * Provides additional information about an Intent (e.g., when an Intent is retrieved with the `getIntents()` method).
2709
+ * Provides additional information about an Intent (e.g., when an Intent is retrieved via the `getIntents()` method).
2282
2710
  */
2283
2711
  export interface IntentInfo extends AddIntentListenerRequest {}
2284
2712
 
@@ -2294,7 +2722,7 @@ export namespace IOConnectBrowser {
2294
2722
 
2295
2723
  /**
2296
2724
  * Flag indicating whether the Intents Resolver UI will open to provide the user with the list of valid Intent handlers.
2297
- * @default true
2725
+ * @default true
2298
2726
  */
2299
2727
  openResolver?: boolean;
2300
2728
 
@@ -2455,8 +2883,8 @@ export namespace IOConnectBrowser {
2455
2883
  */
2456
2884
  readonly timeout?: number;
2457
2885
  /**
2458
- * Whether to wait for the Intents Resolver UI to choose a handler for the raised intent.
2459
- * If set to true, the timer starts after there's a chosen handler from the user.
2886
+ * Whether to wait for the Intents Resolver UI to choose a handler for the raised intent.
2887
+ * If set to true, the timer starts after there's a chosen handler from the user.
2460
2888
  * Otherwise, the start point is the beginning of the raise invocation.
2461
2889
  * @default: false
2462
2890
  */
@@ -2527,14 +2955,12 @@ export namespace IOConnectBrowser {
2527
2955
  * @intro
2528
2956
  * **io.Connect Browser** has two built-in themes - "Day" and "Night". You can control the themes programmatically by using the Themes API.
2529
2957
  *
2530
- * The Themes API is accessible through the `io.themes` object.
2958
+ * The Themes API is accessible via the [`io.themes`](#API) object.
2531
2959
  */
2532
2960
  namespace Themes {
2533
2961
  export interface API {
2534
2962
  /**
2535
2963
  * Returns the current theme.
2536
- * @param request can be the intent's name or an IntentRequest object carrying the intent, and its optional target, context and start options (see "startNew").
2537
- * @returns Promise that resolves with IntentResult.
2538
2964
  */
2539
2965
  getCurrent(): Promise<Theme>;
2540
2966
 
@@ -2589,11 +3015,13 @@ export namespace IOConnectBrowser {
2589
3015
  /**
2590
3016
  * @docname App Preferences
2591
3017
  * @intro
2592
- * The App Preferences API enables apps to store custom user-specific data and retrieve it when necessary. This allows you to enhance the UX of your apps by instrumenting them to preserve specific user settings and apply them when the app is relaunched.
2593
- *
2594
- * The App Preferences API provides methods for updating, replacing and clearing user settings stored for the current or a specific app, as well as for all apps of the current user.
2595
- *
2596
- * The App Preferences API is accessible through the `io.prefs` object.
3018
+ * The App Preferences API enables apps to store custom user-specific data and retrieve it when necessary.
3019
+ * This allows you to enhance the UX of your apps by instrumenting them to preserve specific user settings and apply them when the app is relaunched.
3020
+ *
3021
+ * The App Preferences API provides methods for updating, replacing and clearing user settings stored for the current or a specific app,
3022
+ * as well as for all apps of the current user.
3023
+ *
3024
+ * The App Preferences API is accessible via the [`io.prefs`](#API) object.
2597
3025
  */
2598
3026
  namespace Prefs {
2599
3027
  /**