@interopio/browser 3.0.2 → 3.0.4
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 +55 -42
- package/changelog.md +6 -0
- package/dist/browser.es.js +2 -2
- package/dist/browser.es.js.map +1 -1
- package/dist/browser.umd.js +2 -2
- package/dist/browser.umd.js.map +1 -1
- package/dist/browser.umd.min.js +1 -1
- package/package.json +6 -6
package/browser.d.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
/* eslint-disable @typescript-eslint/no-empty-interface */
|
|
4
4
|
import { UnsubscribeFunction } from "callback-registry";
|
|
5
5
|
import { IOConnectCore } from "@interopio/core";
|
|
6
|
-
import {
|
|
6
|
+
import { IOConnectDesktop } from "@interopio/desktop";
|
|
7
7
|
import { IOConnectWorkspaces } from "@interopio/workspaces-api";
|
|
8
8
|
import { IOConnectSearch } from "@interopio/search-api";
|
|
9
9
|
|
|
@@ -11,18 +11,19 @@ import { IOConnectSearch } from "@interopio/search-api";
|
|
|
11
11
|
* Factory function that creates a new ioconnect instance.
|
|
12
12
|
* If your application is running in IOConnect Desktop this will return a Glue42.Glue API, which is a super-set of the IOConnectBrowser.API.
|
|
13
13
|
*/
|
|
14
|
-
export type IOConnectBrowserFactoryFunction = (config?: IOConnectBrowser.Config) => Promise<IOConnectBrowser.API |
|
|
14
|
+
export type IOConnectBrowserFactoryFunction = (config?: IOConnectBrowser.Config) => Promise<IOConnectBrowser.API | IOConnectDesktop.API>;
|
|
15
15
|
declare const IOConnectBrowserFactory: IOConnectBrowserFactoryFunction;
|
|
16
16
|
export default IOConnectBrowserFactory;
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
|
-
* @docname
|
|
19
|
+
* @docname io.Connect Browser
|
|
20
20
|
* @intro
|
|
21
|
-
*
|
|
21
|
+
* **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.
|
|
22
23
|
*
|
|
23
24
|
* ## Referencing
|
|
24
25
|
*
|
|
25
|
-
*
|
|
26
|
+
* The [`@interopio/browser`](https://www.npmjs.com/package/@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:
|
|
26
27
|
*
|
|
27
28
|
* ```html
|
|
28
29
|
* <script type="text/javascript" src="browser.umd.js"></script>
|
|
@@ -34,7 +35,7 @@ export default IOConnectBrowserFactory;
|
|
|
34
35
|
* import IOBrowser from "@interopio/browser";
|
|
35
36
|
* ```
|
|
36
37
|
*
|
|
37
|
-
* When deploying your
|
|
38
|
+
* When deploying your app in production, it's recommended to always reference a specific minified version:
|
|
38
39
|
*
|
|
39
40
|
* ```html
|
|
40
41
|
* <script type="text/javascript" src="browser.umd.min.js"></script>
|
|
@@ -42,7 +43,8 @@ export default IOConnectBrowserFactory;
|
|
|
42
43
|
*
|
|
43
44
|
* ## Initialization
|
|
44
45
|
*
|
|
45
|
-
*
|
|
46
|
+
* The [`@interopio/browser`](https://www.npmjs.com/package/@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:
|
|
46
48
|
*
|
|
47
49
|
* ```javascript
|
|
48
50
|
* const initializeIOConnect = async () => {
|
|
@@ -56,7 +58,7 @@ export default IOConnectBrowserFactory;
|
|
|
56
58
|
* // to access the IOConnect Browser APIs.
|
|
57
59
|
* const io = await IOBrowser(initOptions);
|
|
58
60
|
*
|
|
59
|
-
* // Here
|
|
61
|
+
* // Here the library is initialized and you can access all io.Connect Browser APIs.
|
|
60
62
|
* };
|
|
61
63
|
*
|
|
62
64
|
* initializeIOConnect().catch(console.error);
|
|
@@ -90,14 +92,15 @@ export namespace IOConnectBrowser {
|
|
|
90
92
|
contexts?: IOConnectCore.ContextsConfig;
|
|
91
93
|
|
|
92
94
|
/**
|
|
93
|
-
* Configures whether the
|
|
95
|
+
* Configures whether the library will share the initialized API object upon request via a custom web event.
|
|
96
|
+
* @default true
|
|
94
97
|
*/
|
|
95
98
|
exposeAPI?: boolean;
|
|
96
99
|
|
|
97
100
|
/**
|
|
98
|
-
* A list of
|
|
101
|
+
* A list of io.Connect libraries which will be initiated internally and provide access to specific functionalities
|
|
99
102
|
*/
|
|
100
|
-
libraries?: Array<(io: IOConnectBrowser.API, config?: IOConnectBrowser.Config |
|
|
103
|
+
libraries?: Array<(io: IOConnectBrowser.API, config?: IOConnectBrowser.Config | IOConnectDesktop.Config) => Promise<void>>;
|
|
101
104
|
|
|
102
105
|
/* Enable and configure Intents Resolver UI */
|
|
103
106
|
intents?: IOConnectBrowser.Intents.Config;
|
|
@@ -123,7 +126,6 @@ export namespace IOConnectBrowser {
|
|
|
123
126
|
|
|
124
127
|
/**
|
|
125
128
|
* @intro
|
|
126
|
-
*
|
|
127
129
|
* Using the Window Management API, your application can easily open and manipulate browser windows.
|
|
128
130
|
* This allows you to transform your traditional single-window web app into a multi-window native-like web application.
|
|
129
131
|
* The Window Management API enables applications to:
|
|
@@ -329,7 +331,7 @@ export namespace IOConnectBrowser {
|
|
|
329
331
|
* The Layouts library has the following capabilities:
|
|
330
332
|
*
|
|
331
333
|
* - importing, exporting, removing and getting Layouts;
|
|
332
|
-
* - saving and restoring Layouts
|
|
334
|
+
* - saving and restoring Layouts;
|
|
333
335
|
* - events related to adding, removing, changing or saving Layouts;
|
|
334
336
|
* - requesting browser permission for the Multi-Screen Window Placement API;
|
|
335
337
|
*
|
|
@@ -427,18 +429,18 @@ export namespace IOConnectBrowser {
|
|
|
427
429
|
onSaveRequested(callback: (info?: SaveRequestContext) => SaveRequestResponse): () => void;
|
|
428
430
|
|
|
429
431
|
/**
|
|
430
|
-
* Retrieves the browser Multi-Screen Window Placement permission state for the
|
|
432
|
+
* Retrieves the browser Multi-Screen Window Placement permission state for the **io.Connect Browser** environment.
|
|
431
433
|
*/
|
|
432
434
|
getMultiScreenPermissionState(): Promise<{ state: "prompt" | "granted" | "denied" }>;
|
|
433
435
|
|
|
434
436
|
/**
|
|
435
|
-
* Opens the browser permission prompt requesting Multi-Screen Window Placement permission from the user for the
|
|
437
|
+
* Opens the browser permission prompt requesting Multi-Screen Window Placement permission from the user for the **io.Connect Browser** environment.
|
|
436
438
|
* This can only be requested from the Main app (Web Platform) due to the transient activation restrictions of the browsers.
|
|
437
439
|
*/
|
|
438
440
|
requestMultiScreenPermission(): Promise<{ permissionGranted: boolean }>;
|
|
439
441
|
|
|
440
442
|
/**
|
|
441
|
-
* Checks whether Global Layouts are activated in the
|
|
443
|
+
* Checks whether Global Layouts are activated in the **io.Connect Browser** environment.
|
|
442
444
|
*/
|
|
443
445
|
getGlobalTypeState(): Promise<{ activated: boolean }>;
|
|
444
446
|
|
|
@@ -663,9 +665,9 @@ export namespace IOConnectBrowser {
|
|
|
663
665
|
/**
|
|
664
666
|
* @intro
|
|
665
667
|
* The Notifications API provides a way to display native notifications with actions and to handle notification and action clicks.
|
|
666
|
-
* **
|
|
668
|
+
* **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).
|
|
667
669
|
*
|
|
668
|
-
* The **
|
|
670
|
+
* The **io.Connect Browser** Notifications API extends the DOM Notifications API with the option to handle notification and action clicks using Interop methods.
|
|
669
671
|
*
|
|
670
672
|
* The Notifications API is accessible through the `io.notifications` object.
|
|
671
673
|
*/
|
|
@@ -677,10 +679,14 @@ export namespace IOConnectBrowser {
|
|
|
677
679
|
*/
|
|
678
680
|
raise(notification: RaiseOptions): Promise<Notification>;
|
|
679
681
|
|
|
680
|
-
/**
|
|
682
|
+
/**
|
|
683
|
+
* **io.Connect Browser** only. Retrieves the state of the native browser notification permission for the platform.
|
|
684
|
+
*/
|
|
681
685
|
getPermission?(): Promise<"default" | "granted" | "denied">;
|
|
682
686
|
|
|
683
|
-
/**
|
|
687
|
+
/**
|
|
688
|
+
* **io.Connect Browser** only. Triggers the native browser permission dialog. Must only be called from within a platform.
|
|
689
|
+
*/
|
|
684
690
|
requestPermission?(): Promise<boolean>;
|
|
685
691
|
|
|
686
692
|
/** Returns a list of all known notifications. */
|
|
@@ -732,13 +738,13 @@ export namespace IOConnectBrowser {
|
|
|
732
738
|
}
|
|
733
739
|
|
|
734
740
|
export interface RaiseOptions extends NotificationDefinition {
|
|
735
|
-
/**
|
|
741
|
+
/** The title of the notification */
|
|
736
742
|
title: string;
|
|
737
|
-
/**
|
|
743
|
+
/** Set to make the notification click invoke an interop method with specific arguments */
|
|
738
744
|
clickInterop?: InteropActionSettings;
|
|
739
745
|
/** List of action attached to the notification. Those will appear as buttons in the notification UI */
|
|
740
746
|
actions?: NotificationAction[];
|
|
741
|
-
/**
|
|
747
|
+
/** **io.Connect Browser** only. If set to true, the platform app will be focused when the user clicks on the notification. Defaults to false. */
|
|
742
748
|
focusPlatformOnDefaultClick?: boolean;
|
|
743
749
|
/** Severity of the alert */
|
|
744
750
|
severity?: "Low" | "Medium" | "High" | "Critical" | "None";
|
|
@@ -786,12 +792,12 @@ export namespace IOConnectBrowser {
|
|
|
786
792
|
|
|
787
793
|
/**
|
|
788
794
|
* @intro
|
|
789
|
-
*
|
|
795
|
+
* Channels are globally accessed named contexts that allow users to dynamically group apps, instructing them to work over the same shared data object.
|
|
790
796
|
* The Channels API enables you to:
|
|
791
797
|
*
|
|
792
798
|
* - discover Channels - get the names and contexts of all Channels;
|
|
793
799
|
* - navigate through Channels - get the current Channel, join and leave Channels, subscribe for the event which fires when the current Channel has changed;
|
|
794
|
-
* - publish and subscribe - publish data to other
|
|
800
|
+
* - 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;
|
|
795
801
|
*
|
|
796
802
|
* The Channels API is accessible through the `io.channels` object.
|
|
797
803
|
*/
|
|
@@ -907,14 +913,16 @@ export namespace IOConnectBrowser {
|
|
|
907
913
|
}
|
|
908
914
|
|
|
909
915
|
/**
|
|
916
|
+
* @docname App Management
|
|
910
917
|
* @intro
|
|
911
|
-
* The
|
|
918
|
+
* The App Management API provides a way to manage **io.Connect Browser** apps. It offers abstractions for:
|
|
912
919
|
*
|
|
913
|
-
* - **Application** - a web app as a logical entity, registered in **
|
|
920
|
+
* - **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.
|
|
921
|
+
* The App Management API provides facilities for retrieving app metadata and for detecting when an application has been started;
|
|
914
922
|
*
|
|
915
|
-
* - **Instance** - a running copy of an
|
|
923
|
+
* - **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;
|
|
916
924
|
*
|
|
917
|
-
* The
|
|
925
|
+
* The App Management API is accessible through the `io.appManager` object.
|
|
918
926
|
*/
|
|
919
927
|
namespace AppManager {
|
|
920
928
|
/**
|
|
@@ -1077,12 +1085,12 @@ export namespace IOConnectBrowser {
|
|
|
1077
1085
|
name: string;
|
|
1078
1086
|
|
|
1079
1087
|
/**
|
|
1080
|
-
|
|
1081
|
-
|
|
1088
|
+
* Type of the application - the only supported type in **io.Connect Browser** is "window". More complex types are available in **io.Connect Desktop**.
|
|
1089
|
+
*/
|
|
1082
1090
|
type: string;
|
|
1083
1091
|
|
|
1084
1092
|
/**
|
|
1085
|
-
* The title of the
|
|
1093
|
+
* The title of the app. Sets the window's title.
|
|
1086
1094
|
*/
|
|
1087
1095
|
title?: string;
|
|
1088
1096
|
|
|
@@ -1117,12 +1125,12 @@ export namespace IOConnectBrowser {
|
|
|
1117
1125
|
intents?: Intent[];
|
|
1118
1126
|
|
|
1119
1127
|
/**
|
|
1120
|
-
* If set to true, the application will not be listed in the
|
|
1128
|
+
* If set to true, the application will not be listed in the **io.Connect Browser** Launchpad. Defaults to false.
|
|
1121
1129
|
*/
|
|
1122
1130
|
hidden?: boolean;
|
|
1123
1131
|
}
|
|
1124
1132
|
|
|
1125
|
-
/** Object describing an
|
|
1133
|
+
/** Object describing an app. */
|
|
1126
1134
|
export interface Application {
|
|
1127
1135
|
/** Application name. */
|
|
1128
1136
|
name: string;
|
|
@@ -1270,7 +1278,8 @@ export namespace IOConnectBrowser {
|
|
|
1270
1278
|
* @deprecated Use register() method instead
|
|
1271
1279
|
*
|
|
1272
1280
|
* If your application is an intent handler use this method to handle incoming intent requests.
|
|
1273
|
-
* Please note that when a new instance of your application is started as a result of a raised intent with
|
|
1281
|
+
* Please note that when a new instance of your application is started as a result of a raised intent with
|
|
1282
|
+
* e.g. `startNew` your application needs to call `addIntentListener()` on startup so that the intent can be resolved.
|
|
1274
1283
|
* The handler callback will be invoked whenever an intent is raised and your app was selected as an IntentTarget.
|
|
1275
1284
|
* You can also use this method to register new dynamic intents, that will have the the same lifespan as your application instance.
|
|
1276
1285
|
* @param intent The intent to be handled. The intent name of an object containing the intent, contextTypes that the intent can handle and a display name.
|
|
@@ -1281,7 +1290,8 @@ export namespace IOConnectBrowser {
|
|
|
1281
1290
|
|
|
1282
1291
|
/**
|
|
1283
1292
|
* If your application is an intent handler use this method to handle incoming intent requests.
|
|
1284
|
-
* Please note that when a new instance of your application is started as a result of a raised intent with
|
|
1293
|
+
* Please note that when a new instance of your application is started as a result of a raised intent with
|
|
1294
|
+
* e.g. `startNew` your application needs to call `register()` on startup so that the intent can be resolved.
|
|
1285
1295
|
* The handler callback will be invoked whenever an intent is raised and your app was selected as an IntentTarget.
|
|
1286
1296
|
* You can also use this method to register new dynamic intents, that will have the the same lifespan as your application instance.
|
|
1287
1297
|
* @param intent The intent to be handled. The intent name of an object containing the intent, contextTypes that the intent can handle and a display name.
|
|
@@ -1453,7 +1463,8 @@ export namespace IOConnectBrowser {
|
|
|
1453
1463
|
instanceTitle?: string;
|
|
1454
1464
|
|
|
1455
1465
|
/**
|
|
1456
|
-
* Result type may be a type name, the string "channel" (which indicates that the app will return a channel)
|
|
1466
|
+
* Result type may be a type name, the string "channel" (which indicates that the app will return a channel)
|
|
1467
|
+
* or a string indicating a channel that returns a specific type, e.g. "channel<fdc3.instrument>"
|
|
1457
1468
|
*/
|
|
1458
1469
|
resultType?: string;
|
|
1459
1470
|
}
|
|
@@ -1482,10 +1493,10 @@ export namespace IOConnectBrowser {
|
|
|
1482
1493
|
* Start up options that will be used when a new instance of an application needs to be started to handle the intent request.
|
|
1483
1494
|
*/
|
|
1484
1495
|
readonly options?: AppManager.ApplicationStartOptions;
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1496
|
+
/**
|
|
1497
|
+
* List of Intent Handlers which will be provided to the user via Intents Resolver UI. If the Resolver is disabled or there's only one handler
|
|
1498
|
+
* in the array, raise() will resolve with the first application or instance in the collection.
|
|
1499
|
+
*/
|
|
1489
1500
|
readonly handlers?: IOConnectBrowser.Intents.IntentHandler[];
|
|
1490
1501
|
/**
|
|
1491
1502
|
* Timeout to wait for 'raise' method to resolve.
|
|
@@ -1537,7 +1548,9 @@ export namespace IOConnectBrowser {
|
|
|
1537
1548
|
|
|
1538
1549
|
/**
|
|
1539
1550
|
* @intro
|
|
1540
|
-
*
|
|
1551
|
+
* **io.Connect Browser** has two built-in themes - "Day" and "Night". You can control the themes programmatically by using the Themes API.
|
|
1552
|
+
*
|
|
1553
|
+
* The Themes API is accessible through the `io.themes` object.
|
|
1541
1554
|
*/
|
|
1542
1555
|
namespace Themes {
|
|
1543
1556
|
export interface API {
|
package/changelog.md
CHANGED
package/dist/browser.es.js
CHANGED
|
@@ -4774,7 +4774,7 @@ class IoC {
|
|
|
4774
4774
|
}
|
|
4775
4775
|
}
|
|
4776
4776
|
|
|
4777
|
-
var version$2 = "3.0.
|
|
4777
|
+
var version$2 = "3.0.4";
|
|
4778
4778
|
|
|
4779
4779
|
const createFactoryFunction = (coreFactoryFunction) => {
|
|
4780
4780
|
return (userConfig) => __awaiter$1(void 0, void 0, void 0, function* () {
|
|
@@ -8416,7 +8416,7 @@ var ContextMessageReplaySpec = {
|
|
|
8416
8416
|
}
|
|
8417
8417
|
};
|
|
8418
8418
|
|
|
8419
|
-
var version = "6.0.
|
|
8419
|
+
var version = "6.0.3";
|
|
8420
8420
|
|
|
8421
8421
|
function prepareConfig (configuration, ext, glue42gd) {
|
|
8422
8422
|
var _a, _b, _c, _d;
|