@interopio/browser 4.5.0 → 5.0.0
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 +349 -87
- package/changelog.md +28 -0
- package/dist/browser.es.js +16252 -11282
- package/dist/browser.es.js.map +1 -1
- package/package.json +16 -12
- package/dist/browser.umd.js +0 -20268
- package/dist/browser.umd.js.map +0 -1
- package/dist/browser.umd.min.js +0 -14
package/browser.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
3
3
|
/* eslint-disable @typescript-eslint/no-empty-interface */
|
|
4
4
|
import { UnsubscribeFunction } from "callback-registry";
|
|
5
|
-
import { IOConnectCore } from "@interopio/core";
|
|
5
|
+
import { IOConnectCore, IOInsights } 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";
|
|
@@ -24,17 +24,18 @@ export default IOConnectBrowserFactory;
|
|
|
24
24
|
*
|
|
25
25
|
* ## Referencing
|
|
26
26
|
*
|
|
27
|
-
* The [`@interopio/browser`](https://www.npmjs.com/package/@interopio/browser) library is available
|
|
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
|
+
* The [`@interopio/browser`](https://www.npmjs.com/package/@interopio/browser) library is available as an ES module, which you can import in your apps:
|
|
29
28
|
*
|
|
30
|
-
* ```
|
|
31
|
-
*
|
|
29
|
+
* ``` javascript
|
|
30
|
+
* import IOBrowser from "@interopio/browser";
|
|
32
31
|
* ```
|
|
33
32
|
*
|
|
34
|
-
*
|
|
33
|
+
* If you don't use a bundler, you can load a hosted copy of `browser.es.js` in a `<script type="module">` tag:
|
|
35
34
|
*
|
|
36
|
-
* ```
|
|
37
|
-
*
|
|
35
|
+
* ```html
|
|
36
|
+
* <script type="module">
|
|
37
|
+
* import IOBrowser from "./browser.es.js";
|
|
38
|
+
* </script>
|
|
38
39
|
* ```
|
|
39
40
|
*
|
|
40
41
|
* ## Initialization
|
|
@@ -186,6 +187,12 @@ export namespace IOConnectBrowser {
|
|
|
186
187
|
* @since io.Connect Browser 4.0
|
|
187
188
|
*/
|
|
188
189
|
intentResolver?: IntentResolverUIConfig;
|
|
190
|
+
|
|
191
|
+
/**
|
|
192
|
+
* Settings for io.Insights.
|
|
193
|
+
* @since io.Connect Browser 5.0
|
|
194
|
+
*/
|
|
195
|
+
insights?: Insights.Config;
|
|
189
196
|
}
|
|
190
197
|
|
|
191
198
|
/**
|
|
@@ -670,9 +677,17 @@ export namespace IOConnectBrowser {
|
|
|
670
677
|
|
|
671
678
|
/**
|
|
672
679
|
* Closes the window
|
|
673
|
-
* @
|
|
680
|
+
* @param options Options for closing the window that can be used to prevent closing the window.
|
|
681
|
+
* @since io.Connect Browser 5.0
|
|
682
|
+
*/
|
|
683
|
+
close(options?: CloseOptions): Promise<boolean>;
|
|
684
|
+
|
|
685
|
+
/**
|
|
686
|
+
* Notifies when the window is about to be closed.
|
|
687
|
+
* @param callback Callback function for handling the event. Returns a `Promise` that will be awaited before the window is closed. A function for preventing the closing is passed to the callback as a parameter.
|
|
688
|
+
* @since io.Connect Browser 5.0
|
|
674
689
|
*/
|
|
675
|
-
|
|
690
|
+
onClosing: (callback: (prevent: () => void) => Promise<void>) => UnsubscribeFunction;
|
|
676
691
|
|
|
677
692
|
/**
|
|
678
693
|
* Returns the title of the window.
|
|
@@ -816,6 +831,27 @@ export namespace IOConnectBrowser {
|
|
|
816
831
|
width: number;
|
|
817
832
|
height: number;
|
|
818
833
|
}
|
|
834
|
+
|
|
835
|
+
/**
|
|
836
|
+
* Options for closing an io.Connect Window.
|
|
837
|
+
* @since io.Connect Browser 5.0
|
|
838
|
+
*/
|
|
839
|
+
export interface CloseOptions {
|
|
840
|
+
/**
|
|
841
|
+
* If `true`, will enable the window to prevent closing.
|
|
842
|
+
* @default false
|
|
843
|
+
*/
|
|
844
|
+
allowPrevent?: boolean;
|
|
845
|
+
|
|
846
|
+
/**
|
|
847
|
+
* If `true`, a confirmation dialog will be shown before closing the window.
|
|
848
|
+
* The dialog will be displayed only if `allowPrevent` is `true` and a closing handler prevents closing.
|
|
849
|
+
* Requires modal windows to be configured in the Main app and dialogs to be enabled in the app displaying the confirmation.
|
|
850
|
+
* The dialog appears in the window being closed or, for a Workspace window, in its containing Workspaces App instance.
|
|
851
|
+
* @default false
|
|
852
|
+
*/
|
|
853
|
+
showDialog?: boolean;
|
|
854
|
+
}
|
|
819
855
|
}
|
|
820
856
|
|
|
821
857
|
/**
|
|
@@ -1263,6 +1299,30 @@ export namespace IOConnectBrowser {
|
|
|
1263
1299
|
* @default 60000
|
|
1264
1300
|
*/
|
|
1265
1301
|
timeout?: number;
|
|
1302
|
+
|
|
1303
|
+
/**
|
|
1304
|
+
* If `true`, the windows and `Frame` instances to be closed will be able to prevent closing via their `onClosing()` handlers.
|
|
1305
|
+
* If `false`, the Layout restore will be forced - the `onClosing()` handlers will still be invoked,
|
|
1306
|
+
* but won't be able to prevent closing the respective instances.
|
|
1307
|
+
* @default true
|
|
1308
|
+
* @since io.Connect Browser 5.0
|
|
1309
|
+
*/
|
|
1310
|
+
allowPrevent?: boolean;
|
|
1311
|
+
|
|
1312
|
+
/**
|
|
1313
|
+
* If `true` and any of the windows or `Frame` instances to be closed prevents closing,
|
|
1314
|
+
* a dialog will be displayed in the window that initiated the Layout restore, asking the user to confirm closing them.
|
|
1315
|
+
* If the initiating app is a Workspace window, the dialog will be displayed in its containing Workspaces App instance instead.
|
|
1316
|
+
* Requires modal windows to be configured in the Main app and dialogs to be enabled in the app displaying the confirmation.
|
|
1317
|
+
* If `false` and any windows or `Frame` instances prevent closing, the Layout restore will be rejected without displaying a dialog.
|
|
1318
|
+
* The Layout restore will also be rejected if the user declines closing the instances or if the dialog can't be displayed.
|
|
1319
|
+
* When `allowPrevent` and `showDialog` are both set to `true`, and either `closeRunningInstances` or `closeMe` is set to `true`,
|
|
1320
|
+
* the timeout specified in the `timeout` property will be ignored and the dialog will use an extended timeout.
|
|
1321
|
+
* Valid only if `allowPrevent` is set to `true`.
|
|
1322
|
+
* @default true
|
|
1323
|
+
* @since io.Connect Browser 5.0
|
|
1324
|
+
*/
|
|
1325
|
+
showDialog?: boolean;
|
|
1266
1326
|
}
|
|
1267
1327
|
|
|
1268
1328
|
/**
|
|
@@ -1363,9 +1423,10 @@ export namespace IOConnectBrowser {
|
|
|
1363
1423
|
/**
|
|
1364
1424
|
* Issues a programmatic click on a notification.
|
|
1365
1425
|
* @param id The id of the notification to click on.
|
|
1366
|
-
* @param
|
|
1426
|
+
* @param action Optional action value to click on.
|
|
1427
|
+
* @param clickOptions Options for controlling the behavior of the notification click. Defaults to `{ close: true }`. *Available since **io.Connect Browser** 5.0.*
|
|
1367
1428
|
*/
|
|
1368
|
-
click(id: string, action?: string): Promise<void>;
|
|
1429
|
+
click(id: string, action?: string, clickOptions?: ClickOptions): Promise<void>;
|
|
1369
1430
|
|
|
1370
1431
|
/**
|
|
1371
1432
|
* Clears a specified notification.
|
|
@@ -1475,6 +1536,18 @@ export namespace IOConnectBrowser {
|
|
|
1475
1536
|
target?: "all" | "best";
|
|
1476
1537
|
}
|
|
1477
1538
|
|
|
1539
|
+
/**
|
|
1540
|
+
* Options for clicking a notification.
|
|
1541
|
+
* @since io.Connect Browser 5.0
|
|
1542
|
+
*/
|
|
1543
|
+
export interface ClickOptions {
|
|
1544
|
+
/**
|
|
1545
|
+
* If `true`, the clicked notification will be closed.
|
|
1546
|
+
* @default true
|
|
1547
|
+
*/
|
|
1548
|
+
close?: boolean;
|
|
1549
|
+
}
|
|
1550
|
+
|
|
1478
1551
|
export type NotificationClickHandler = (io: IOConnectBrowser.API, notificationDefinition: NotificationDefinition) => void;
|
|
1479
1552
|
|
|
1480
1553
|
export interface ActionClickHandler {
|
|
@@ -1615,17 +1688,16 @@ export namespace IOConnectBrowser {
|
|
|
1615
1688
|
leave(options?: string | LeaveOptions): Promise<void>;
|
|
1616
1689
|
|
|
1617
1690
|
/**
|
|
1618
|
-
*
|
|
1691
|
+
* Retrieves the name of the current Channel or returns `undefined` if the window isn't joined to a Channel.
|
|
1619
1692
|
* @ignore
|
|
1620
|
-
* @returns The name of the current channel.
|
|
1621
1693
|
*/
|
|
1622
|
-
current(): string;
|
|
1694
|
+
current(): string | undefined;
|
|
1623
1695
|
|
|
1624
1696
|
/**
|
|
1625
|
-
* Retrieves the name of the current Channel.
|
|
1697
|
+
* Retrieves the name of the current Channel or returns `undefined` if the window isn't joined to a Channel.
|
|
1626
1698
|
* It's recommended to use the `myChannels()` method instead, which can retrieve the names of the currently joined Channels both in single and in multi Channel mode.
|
|
1627
1699
|
*/
|
|
1628
|
-
my(): string;
|
|
1700
|
+
my(): string | undefined;
|
|
1629
1701
|
|
|
1630
1702
|
/**
|
|
1631
1703
|
* Subscribes for the event which fires when a channel is changed.
|
|
@@ -1633,17 +1705,19 @@ export namespace IOConnectBrowser {
|
|
|
1633
1705
|
* @param callback Callback function to handle channel changes.
|
|
1634
1706
|
* @returns Unsubscribe function.
|
|
1635
1707
|
*/
|
|
1636
|
-
changed(callback: (channel: string) => void): UnsubscribeFunction;
|
|
1708
|
+
changed(callback: (channel: string | undefined) => void): UnsubscribeFunction;
|
|
1637
1709
|
|
|
1638
1710
|
/**
|
|
1639
|
-
* Notifies when the current window joins or leaves a Channel.
|
|
1711
|
+
* Notifies when the current window joins or leaves a Channel. If on subscription the window is already joined to a Channel,
|
|
1712
|
+
* the callback will be invoked initially with the name of the current Channel. Returns an unsubscribe function.
|
|
1640
1713
|
* It's recommended to use the `onChannelsChanged()` method instead, which can handle Channel changes both in single and in multi Channel mode.
|
|
1641
1714
|
* @param callback Callback function for handling the event. Receives as an argument the name of the newly joined Channel. If the window leaves a Channel without joining a new one, the argument will be `undefined`.
|
|
1642
1715
|
*/
|
|
1643
|
-
onChanged(callback: (channel: string) => void): UnsubscribeFunction;
|
|
1716
|
+
onChanged(callback: (channel: string | undefined) => void): UnsubscribeFunction;
|
|
1644
1717
|
|
|
1645
1718
|
/**
|
|
1646
1719
|
* Notifies when the current window joins or leaves a Channel. Can be used both in single and in multi Channel mode.
|
|
1720
|
+
* If on subscription the window is already joined to one or more Channels, the callback will be invoked initially with the names of the current Channels.
|
|
1647
1721
|
* If used in single Channel mode, when the window joins a Channel, the array argument passed to the callback for handling the event
|
|
1648
1722
|
* will always contain a single member; when the window leaves the current Channel, the array will be empty. Returns an unsubscribe function.
|
|
1649
1723
|
* @param callback Callback function for handling the event. Receives a list with the names of the currently joined Channels as an argument.
|
|
@@ -1655,7 +1729,7 @@ export namespace IOConnectBrowser {
|
|
|
1655
1729
|
* Adds a new Channel.
|
|
1656
1730
|
* @param info Initial Channel context.
|
|
1657
1731
|
*/
|
|
1658
|
-
add(info:
|
|
1732
|
+
add(info: ChannelContext): Promise<ChannelContext>;
|
|
1659
1733
|
|
|
1660
1734
|
/**
|
|
1661
1735
|
* Removes a Channel.
|
|
@@ -1766,6 +1840,20 @@ export namespace IOConnectBrowser {
|
|
|
1766
1840
|
channel?: string;
|
|
1767
1841
|
}
|
|
1768
1842
|
|
|
1843
|
+
/**
|
|
1844
|
+
* Options for publishing an FDC3 context to a Channel.
|
|
1845
|
+
*/
|
|
1846
|
+
export interface FDC3PublishOptions {
|
|
1847
|
+
/**
|
|
1848
|
+
* Flag indicating whether the published data is an FDC3 context. If so, it must contain a required `type` property.
|
|
1849
|
+
*/
|
|
1850
|
+
enabled: boolean;
|
|
1851
|
+
/**
|
|
1852
|
+
* Optional metadata for the FDC3 context.
|
|
1853
|
+
*/
|
|
1854
|
+
metadata?: Record<string, any>;
|
|
1855
|
+
}
|
|
1856
|
+
|
|
1769
1857
|
/**
|
|
1770
1858
|
* Options for updating a Channel context with the `publish()` method.
|
|
1771
1859
|
*/
|
|
@@ -1776,9 +1864,9 @@ export namespace IOConnectBrowser {
|
|
|
1776
1864
|
name?: string;
|
|
1777
1865
|
|
|
1778
1866
|
/**
|
|
1779
|
-
*
|
|
1867
|
+
* Settings for publishing an FDC3 context to a Channel.
|
|
1780
1868
|
*/
|
|
1781
|
-
fdc3?: boolean;
|
|
1869
|
+
fdc3?: boolean | FDC3PublishOptions;
|
|
1782
1870
|
}
|
|
1783
1871
|
|
|
1784
1872
|
/**
|
|
@@ -1837,30 +1925,26 @@ export namespace IOConnectBrowser {
|
|
|
1837
1925
|
glyph?: string;
|
|
1838
1926
|
}
|
|
1839
1927
|
|
|
1840
|
-
export interface FDC3ChannelMeta {
|
|
1841
|
-
id: string;
|
|
1842
|
-
displayMetadata?: FDC3ChannelDisplayMetadata;
|
|
1843
|
-
}
|
|
1844
|
-
|
|
1845
1928
|
export interface ChannelMeta {
|
|
1846
1929
|
color: string;
|
|
1847
1930
|
/**
|
|
1848
1931
|
* Provide to enable FDC3 channel support.
|
|
1849
1932
|
*/
|
|
1850
|
-
fdc3?:
|
|
1933
|
+
fdc3?: any;
|
|
1851
1934
|
[key: string]: any;
|
|
1852
1935
|
}
|
|
1853
1936
|
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1937
|
+
export interface ChannelData {
|
|
1938
|
+
/**
|
|
1939
|
+
* FDC3 context data. Will be present only if FDC3 context data has been published to the respective Channel.
|
|
1940
|
+
*/
|
|
1941
|
+
fdc3?: FDC3Context;
|
|
1942
|
+
/**
|
|
1943
|
+
* FDC3 metadata for the context data. Will be present only if FDC3 context data has been published with metadata to the respective Channel.
|
|
1944
|
+
* @since io.Connect Browser 5.0
|
|
1945
|
+
*/
|
|
1946
|
+
fdc3Metadata?: any;
|
|
1947
|
+
[key: string]: any
|
|
1864
1948
|
}
|
|
1865
1949
|
|
|
1866
1950
|
export interface FDC3Context {
|
|
@@ -1889,15 +1973,9 @@ export namespace IOConnectBrowser {
|
|
|
1889
1973
|
/** Unique name of the context. */
|
|
1890
1974
|
name: string;
|
|
1891
1975
|
/** Channel meta data (display name, color, image, etc.) */
|
|
1892
|
-
meta:
|
|
1976
|
+
meta: ChannelMeta;
|
|
1893
1977
|
/** Channel data. */
|
|
1894
|
-
data:
|
|
1895
|
-
/**
|
|
1896
|
-
* FDC3 context data. Will be present only if FDC3 context data has been published to the respective Channel.
|
|
1897
|
-
*/
|
|
1898
|
-
fdc3?: FDC3Context;
|
|
1899
|
-
[key: string]: any
|
|
1900
|
-
};
|
|
1978
|
+
data: ChannelData
|
|
1901
1979
|
}
|
|
1902
1980
|
|
|
1903
1981
|
/**
|
|
@@ -2044,16 +2122,6 @@ export namespace IOConnectBrowser {
|
|
|
2044
2122
|
errors: Array<{ app: string; error: string }>;
|
|
2045
2123
|
}
|
|
2046
2124
|
|
|
2047
|
-
/**
|
|
2048
|
-
* Configuration for the `sandbox` attribute of the `<iframe>` element in which the app will be started when opened in a Workspace.
|
|
2049
|
-
*/
|
|
2050
|
-
export interface WorkspacesSandbox {
|
|
2051
|
-
/**
|
|
2052
|
-
* Collection of flags that will be applied to the `<iframe>` element when the app is opened in a Workspace.
|
|
2053
|
-
*/
|
|
2054
|
-
flags: string;
|
|
2055
|
-
}
|
|
2056
|
-
|
|
2057
2125
|
/**
|
|
2058
2126
|
* Settings for the Channel Selector displayed on an io.Connect Window.
|
|
2059
2127
|
*/
|
|
@@ -2075,7 +2143,7 @@ export namespace IOConnectBrowser {
|
|
|
2075
2143
|
*/
|
|
2076
2144
|
flags: string;
|
|
2077
2145
|
}
|
|
2078
|
-
|
|
2146
|
+
|
|
2079
2147
|
/**
|
|
2080
2148
|
* Configuration for the `sandbox` attribute of the `<iframe>` element in which the app will be started.
|
|
2081
2149
|
* This applies when the app is loaded in a Workspace as well as when it's opened as a standalone `<iframe>` via the io.Connect IFrames API.
|
|
@@ -2088,6 +2156,22 @@ export namespace IOConnectBrowser {
|
|
|
2088
2156
|
flags: string;
|
|
2089
2157
|
}
|
|
2090
2158
|
|
|
2159
|
+
/**
|
|
2160
|
+
* Settings for the handlers executed when an io.Connect Window is about to be closed.
|
|
2161
|
+
* @since io.Connect Browser 5.0
|
|
2162
|
+
*/
|
|
2163
|
+
export interface CloseHandlers {
|
|
2164
|
+
/**
|
|
2165
|
+
* If `true`, close handlers will be enabled.
|
|
2166
|
+
*/
|
|
2167
|
+
enabled?: boolean;
|
|
2168
|
+
|
|
2169
|
+
/**
|
|
2170
|
+
* Interval in milliseconds to wait for the close handler to complete its operation.
|
|
2171
|
+
*/
|
|
2172
|
+
timeout?: number;
|
|
2173
|
+
}
|
|
2174
|
+
|
|
2091
2175
|
export interface DefinitionDetails {
|
|
2092
2176
|
url: string;
|
|
2093
2177
|
|
|
@@ -2115,12 +2199,6 @@ export namespace IOConnectBrowser {
|
|
|
2115
2199
|
*/
|
|
2116
2200
|
height?: number;
|
|
2117
2201
|
|
|
2118
|
-
/**
|
|
2119
|
-
* Configuration for the `sandbox` attribute of the `<iframe>` element in which the app will be started when opened in a Workspace.
|
|
2120
|
-
* @deprecated Will be removed in **io.Connect Browser** 5.0. Use the `iframeSandbox` property instead.
|
|
2121
|
-
*/
|
|
2122
|
-
workspacesSandbox?: WorkspacesSandbox;
|
|
2123
|
-
|
|
2124
2202
|
/**
|
|
2125
2203
|
* Settings for the Channel Selector displayed on an io.Connect Window.
|
|
2126
2204
|
*/
|
|
@@ -2138,6 +2216,12 @@ export namespace IOConnectBrowser {
|
|
|
2138
2216
|
* @since io.Connect Browser 4.5
|
|
2139
2217
|
*/
|
|
2140
2218
|
iframeSandbox?: IFrameSandboxConfig;
|
|
2219
|
+
|
|
2220
|
+
/**
|
|
2221
|
+
* Configuration for close handlers.
|
|
2222
|
+
* @since io.Connect Browser 5.0
|
|
2223
|
+
*/
|
|
2224
|
+
closeHandlers?: CloseHandlers;
|
|
2141
2225
|
}
|
|
2142
2226
|
|
|
2143
2227
|
/**
|
|
@@ -2661,21 +2745,6 @@ export namespace IOConnectBrowser {
|
|
|
2661
2745
|
*/
|
|
2662
2746
|
all(): Promise<Intent[]>;
|
|
2663
2747
|
|
|
2664
|
-
/**
|
|
2665
|
-
* @ignore
|
|
2666
|
-
* @deprecated Use register() method instead
|
|
2667
|
-
*
|
|
2668
|
-
* If your application is an intent handler use this method to handle incoming intent requests.
|
|
2669
|
-
* Please note that when a new instance of your application is started as a result of a raised intent with
|
|
2670
|
-
* e.g. `startNew` your application needs to call `addIntentListener()` on startup so that the intent can be resolved.
|
|
2671
|
-
* The handler callback will be invoked whenever an intent is raised and your app was selected as an IntentTarget.
|
|
2672
|
-
* You can also use this method to register new dynamic intents, that will have the the same lifespan as your application instance.
|
|
2673
|
-
* @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.
|
|
2674
|
-
* @param handler The callback that will handle a raised intent. Will be called with an IntentContext if it is provided by the raising application.
|
|
2675
|
-
* @returns An object with an unsubscribe function under the unsubscribe property.
|
|
2676
|
-
*/
|
|
2677
|
-
addIntentListener(intent: string | AddIntentListenerRequest, handler: (context: IntentContext) => any): { unsubscribe: UnsubscribeFunction };
|
|
2678
|
-
|
|
2679
2748
|
/**
|
|
2680
2749
|
* If your application is an intent handler use this method to handle incoming intent requests.
|
|
2681
2750
|
* Please note that when a new instance of your application is started as a result of a raised intent with
|
|
@@ -2683,10 +2752,10 @@ export namespace IOConnectBrowser {
|
|
|
2683
2752
|
* The handler callback will be invoked whenever an intent is raised and your app was selected as an IntentTarget.
|
|
2684
2753
|
* You can also use this method to register new dynamic intents, that will have the the same lifespan as your application instance.
|
|
2685
2754
|
* @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.
|
|
2686
|
-
* @param handler The callback that will handle a raised intent. Will be called with an IntentContext if it is provided by the raising application
|
|
2755
|
+
* @param handler The callback that will handle a raised intent. Will be called with an IntentContext if it is provided by the raising application, caller - the Interop Instance which raised the intent, and optional metadata.
|
|
2687
2756
|
* @returns Promise that resolves to an object with an unsubscribe function under the unsubscribe property.
|
|
2688
2757
|
*/
|
|
2689
|
-
register(intent: string |
|
|
2758
|
+
register(intent: string | RegisterIntentRequest, handler: (context: IntentContext, caller: IOConnectCore.Interop.Instance | undefined, metadata: Record<string, any> | undefined) => any): Promise<{ unsubscribe: UnsubscribeFunction }>;
|
|
2690
2759
|
|
|
2691
2760
|
/**
|
|
2692
2761
|
* Searches for registered intents.
|
|
@@ -2696,7 +2765,7 @@ export namespace IOConnectBrowser {
|
|
|
2696
2765
|
find(intentFilter?: string | IntentFilter): Promise<Intent[]>;
|
|
2697
2766
|
|
|
2698
2767
|
/**
|
|
2699
|
-
* Filters Intent handlers by specified criteria. If
|
|
2768
|
+
* Filters Intent handlers by specified criteria. If the Intents Resolver UI is enabled, it will open when multiple handlers match, or when a single handler matches multiple Intents and no Intent name is specified in the filter. Set `openResolver` to `false` to return matching handlers without opening the UI.
|
|
2700
2769
|
* @param handlerFilter Filter for the list of Intent handlers to return.
|
|
2701
2770
|
*/
|
|
2702
2771
|
filterHandlers(handlerFilter: HandlerFilter): Promise<FilterHandlersResult>;
|
|
@@ -2873,7 +2942,7 @@ export namespace IOConnectBrowser {
|
|
|
2873
2942
|
*
|
|
2874
2943
|
* Use to define dynamic intents, that will have the same lifespan as your application instance
|
|
2875
2944
|
* */
|
|
2876
|
-
export interface
|
|
2945
|
+
export interface RegisterIntentRequest {
|
|
2877
2946
|
intent: string;
|
|
2878
2947
|
contextTypes?: string[];
|
|
2879
2948
|
displayName?: string;
|
|
@@ -2886,7 +2955,7 @@ export namespace IOConnectBrowser {
|
|
|
2886
2955
|
/**
|
|
2887
2956
|
* Provides additional information about an Intent (e.g., when an Intent is retrieved via the `getIntents()` method).
|
|
2888
2957
|
*/
|
|
2889
|
-
export interface IntentInfo extends
|
|
2958
|
+
export interface IntentInfo extends RegisterIntentRequest { }
|
|
2890
2959
|
|
|
2891
2960
|
/**
|
|
2892
2961
|
* Criteria for excluding Intent handlers from the results when using the `filterHandlers()` method.
|
|
@@ -2934,7 +3003,7 @@ export namespace IOConnectBrowser {
|
|
|
2934
3003
|
openResolver?: boolean;
|
|
2935
3004
|
|
|
2936
3005
|
/**
|
|
2937
|
-
* Interval in milliseconds to wait for the `filterHandlers()` method to resolve
|
|
3006
|
+
* Interval in milliseconds to wait for the `filterHandlers()` method to resolve when the Intents Resolver UI opens to choose a handler or Intent.
|
|
2938
3007
|
* @default 90000
|
|
2939
3008
|
*/
|
|
2940
3009
|
timeout?: number;
|
|
@@ -2964,6 +3033,13 @@ export namespace IOConnectBrowser {
|
|
|
2964
3033
|
* @since io.Connect Browser 4.2
|
|
2965
3034
|
*/
|
|
2966
3035
|
excludeList?: HandlerExclusionCriteria[];
|
|
3036
|
+
|
|
3037
|
+
/**
|
|
3038
|
+
* List of Intent handlers to which to apply the filter.
|
|
3039
|
+
* If not provided, the filter will be applied to all available handlers.
|
|
3040
|
+
* @since io.Connect Browser 5.0
|
|
3041
|
+
*/
|
|
3042
|
+
handlers?: IntentHandler[];
|
|
2967
3043
|
}
|
|
2968
3044
|
|
|
2969
3045
|
/**
|
|
@@ -3030,7 +3106,7 @@ export namespace IOConnectBrowser {
|
|
|
3030
3106
|
/**
|
|
3031
3107
|
* The type of the handler.
|
|
3032
3108
|
* "app" - An application that has declared itself as an implementor of the intent inside of its application definition.
|
|
3033
|
-
* "instance" - A running instance of an application that can handle the intent. Also includes dynamically added intents using `
|
|
3109
|
+
* "instance" - A running instance of an application that can handle the intent. Also includes dynamically added intents using `register()`.
|
|
3034
3110
|
*/
|
|
3035
3111
|
type: "app" | "instance";
|
|
3036
3112
|
|
|
@@ -3114,6 +3190,13 @@ export namespace IOConnectBrowser {
|
|
|
3114
3190
|
* @default false
|
|
3115
3191
|
*/
|
|
3116
3192
|
readonly clearSavedHandler?: boolean;
|
|
3193
|
+
|
|
3194
|
+
/**
|
|
3195
|
+
* Optional metadata that can be used to provide additional information about the raised Intent.
|
|
3196
|
+
* Will be provided as an argument to the callback that represents the Intent handler implementation passed to the `register()` method.
|
|
3197
|
+
* @since io.Connect Browser 5.0
|
|
3198
|
+
*/
|
|
3199
|
+
readonly metadata?: Record<string, any>;
|
|
3117
3200
|
}
|
|
3118
3201
|
|
|
3119
3202
|
/**
|
|
@@ -3157,6 +3240,12 @@ export namespace IOConnectBrowser {
|
|
|
3157
3240
|
* List of Intent handlers that satisfy the filter criteria.
|
|
3158
3241
|
*/
|
|
3159
3242
|
handlers: IntentHandler[];
|
|
3243
|
+
|
|
3244
|
+
/**
|
|
3245
|
+
* The name of the Intent that was selected by the user in the Intent Resolver UI.
|
|
3246
|
+
* @since io.Connect Browser 5.0
|
|
3247
|
+
*/
|
|
3248
|
+
intent?: string;
|
|
3160
3249
|
}
|
|
3161
3250
|
|
|
3162
3251
|
/**
|
|
@@ -3337,7 +3426,180 @@ export namespace IOConnectBrowser {
|
|
|
3337
3426
|
/** Object holding the user preferences as key/value pairs. */
|
|
3338
3427
|
data: any;
|
|
3339
3428
|
/** Timestamp of the last update of the user preferences. */
|
|
3340
|
-
lastUpdate?:
|
|
3429
|
+
lastUpdate?: Date;
|
|
3430
|
+
}
|
|
3431
|
+
}
|
|
3432
|
+
|
|
3433
|
+
/**
|
|
3434
|
+
* Configuration for publishing io.Insights data and settings for the published data items.
|
|
3435
|
+
* @since io.Connect Browser 5.0
|
|
3436
|
+
*/
|
|
3437
|
+
export namespace Insights {
|
|
3438
|
+
/**
|
|
3439
|
+
* Types of the metrics published by **io.Connect Browser**.
|
|
3440
|
+
*/
|
|
3441
|
+
export type MetricType =
|
|
3442
|
+
| "custom_counter"
|
|
3443
|
+
| "custom_gauge"
|
|
3444
|
+
| "custom_histogram"
|
|
3445
|
+
| "custom_observable_counter"
|
|
3446
|
+
| "custom_observable_gauge"
|
|
3447
|
+
| "custom_observable_up_down_counter"
|
|
3448
|
+
| "custom_up_down_counter";
|
|
3449
|
+
|
|
3450
|
+
/**
|
|
3451
|
+
* Describes a metric.
|
|
3452
|
+
*/
|
|
3453
|
+
export interface MetricSettings extends Omit<IOInsights.MetricSettings,
|
|
3454
|
+
| "type"
|
|
3455
|
+
| "baseMetricType" // has no effect: @interopio/insights-metrics always uses type to select the custom instrument
|
|
3456
|
+
| "platformVersion" // has no effect: @interopio/insights-metrics always uses insights.platformVersion
|
|
3457
|
+
| "user" // has no effect: @interopio/insights-metrics always uses insights.userId
|
|
3458
|
+
> {
|
|
3459
|
+
/**
|
|
3460
|
+
* Type of the metric.
|
|
3461
|
+
* Observable metrics can be created only via the metrics module of the Insights API.
|
|
3462
|
+
*/
|
|
3463
|
+
type?: Exclude<MetricType, `custom_observable_${string}`>;
|
|
3464
|
+
}
|
|
3465
|
+
|
|
3466
|
+
/**
|
|
3467
|
+
* Metric filters that can be specified as part of a specific metric.
|
|
3468
|
+
*/
|
|
3469
|
+
export interface MetricFilter extends Omit<NonNullable<IOInsights.MetricsSettings["filters"]>[number], "type"> {
|
|
3470
|
+
/**
|
|
3471
|
+
* The type of the metric to match.
|
|
3472
|
+
*/
|
|
3473
|
+
type?: MetricType;
|
|
3474
|
+
}
|
|
3475
|
+
|
|
3476
|
+
/**
|
|
3477
|
+
* Settings for publishing io.Insights metrics.
|
|
3478
|
+
*/
|
|
3479
|
+
export interface MetricsSettings extends Pick<IOInsights.MetricsSettings,
|
|
3480
|
+
| "enabled"
|
|
3481
|
+
| "url"
|
|
3482
|
+
| "publishInterval"
|
|
3483
|
+
| "concurrencyLimit"
|
|
3484
|
+
| "timeoutMillis"
|
|
3485
|
+
| "headers"
|
|
3486
|
+
| "addResourceAttributesToAttributes"
|
|
3487
|
+
| "additionalAttributes"
|
|
3488
|
+
| "additionalResourceAttributes"
|
|
3489
|
+
| "useDefaultFilters"
|
|
3490
|
+
| "defaultPublishingSettings"
|
|
3491
|
+
| "maxAttributeDepth"
|
|
3492
|
+
| "exporterSettings"
|
|
3493
|
+
| "readerSettings"
|
|
3494
|
+
| "meterProviderSettings"
|
|
3495
|
+
| "meterProvider"
|
|
3496
|
+
| "metricExporters"
|
|
3497
|
+
| "metricReaders"
|
|
3498
|
+
> {
|
|
3499
|
+
/**
|
|
3500
|
+
* Array of objects, each describing a metric.
|
|
3501
|
+
* Use this property to specify settings for your custom metrics.
|
|
3502
|
+
*/
|
|
3503
|
+
metrics?: MetricSettings[];
|
|
3504
|
+
|
|
3505
|
+
/**
|
|
3506
|
+
* Array of objects, each describing a metric filter.
|
|
3507
|
+
* Use this property to specify which metrics to be collected and exported by the Browser Client app.
|
|
3508
|
+
*/
|
|
3509
|
+
filters?: MetricFilter[];
|
|
3510
|
+
}
|
|
3511
|
+
|
|
3512
|
+
/**
|
|
3513
|
+
* Settings for publishing io.Insights traces.
|
|
3514
|
+
*/
|
|
3515
|
+
export interface TracesSettings extends Pick<IOInsights.TracesSettings,
|
|
3516
|
+
| "enabled"
|
|
3517
|
+
| "attributeSettings"
|
|
3518
|
+
| "attributeSettingsMode"
|
|
3519
|
+
| "url"
|
|
3520
|
+
| "filters"
|
|
3521
|
+
| "useDefaultFilters"
|
|
3522
|
+
| "sampling"
|
|
3523
|
+
| "defaults"
|
|
3524
|
+
| "countMetric"
|
|
3525
|
+
| "durationMetric"
|
|
3526
|
+
| "resultMetric"
|
|
3527
|
+
| "useOTELContextManager"
|
|
3528
|
+
| "parentFromOTELContext"
|
|
3529
|
+
| "restoreCurrentTracingState"
|
|
3530
|
+
| "concurrencyLimit"
|
|
3531
|
+
| "timeoutMillis"
|
|
3532
|
+
| "instrumentAppStartup"
|
|
3533
|
+
| "instrumentRequests"
|
|
3534
|
+
| "instrumentErrors"
|
|
3535
|
+
| "instrumentResources"
|
|
3536
|
+
| "instrumentNavigation"
|
|
3537
|
+
| "instrumentEventLoop"
|
|
3538
|
+
| "instrumentWebSockets"
|
|
3539
|
+
| "instrumentWebVitals"
|
|
3540
|
+
| "processorSettings"
|
|
3541
|
+
| "parentNameLimit"
|
|
3542
|
+
| "console"
|
|
3543
|
+
| "headers"
|
|
3544
|
+
| "addResourceAttributesToAttributes"
|
|
3545
|
+
| "additionalAttributes"
|
|
3546
|
+
| "additionalResourceAttributes"
|
|
3547
|
+
| "tracerProvider"
|
|
3548
|
+
| "sampler"
|
|
3549
|
+
| "spanProcessors"
|
|
3550
|
+
| "spanExporters"
|
|
3551
|
+
| "propagator"
|
|
3552
|
+
| "contextManager"
|
|
3553
|
+
> {
|
|
3554
|
+
/**
|
|
3555
|
+
* Controls the capturing of DOM events as spans in a Click Stream trace.
|
|
3556
|
+
* Set to `true` or `"sibling"` to record event spans under a common starting span.
|
|
3557
|
+
* Set to `"nested"` to record the first event span under the starting span and each subsequent event span under the previous event span.
|
|
3558
|
+
* Set to `false` to disable Click Stream tracing.
|
|
3559
|
+
* Use a `ClickstreamTraceConfig` object as a value to provide detailed event and span settings.
|
|
3560
|
+
*
|
|
3561
|
+
* Capturing starts after the `@interopio/browser` library has been initialized. By default, only click events are captured.
|
|
3562
|
+
* Each captured click event is recorded as a `click` span (e.g., `interopio.api.clickstream.<app_name>.click`).
|
|
3563
|
+
* For invoked click event listeners to be captured, they must be registered via `addEventListener()` after the library initialization has completed.
|
|
3564
|
+
* These event listeners will be captured as separate `listener` child spans (e.g., `interopio.api.clickstream.<app_name>.click.listener`)
|
|
3565
|
+
* under the corresponding `click` span.
|
|
3566
|
+
* If the event doesn't have listeners, or only listeners registered before library initialization,
|
|
3567
|
+
* the `click` span won't contain child spans for the listeners.
|
|
3568
|
+
*
|
|
3569
|
+
* @default true
|
|
3570
|
+
*/
|
|
3571
|
+
clickstream?: IOInsights.TracesSettings["clickstream"];
|
|
3572
|
+
}
|
|
3573
|
+
|
|
3574
|
+
/**
|
|
3575
|
+
* Configuration for publishing io.Insights data.
|
|
3576
|
+
*/
|
|
3577
|
+
export interface Config extends Pick<IOInsights.Settings,
|
|
3578
|
+
| "enabled"
|
|
3579
|
+
| "useExistingOTELSDK"
|
|
3580
|
+
| "registerGlobalOTELObjects"
|
|
3581
|
+
| "applicationName"
|
|
3582
|
+
| "errorlessMode"
|
|
3583
|
+
| "failOnInitError"
|
|
3584
|
+
| "platformVersion"
|
|
3585
|
+
| "serviceName"
|
|
3586
|
+
| "serviceId"
|
|
3587
|
+
| "serviceVersion"
|
|
3588
|
+
| "userId"
|
|
3589
|
+
| "headers"
|
|
3590
|
+
| "addResourceAttributesToAttributes"
|
|
3591
|
+
| "additionalAttributes"
|
|
3592
|
+
| "additionalResourceAttributes"
|
|
3593
|
+
> {
|
|
3594
|
+
/**
|
|
3595
|
+
* Settings for publishing io.Insights metrics.
|
|
3596
|
+
*/
|
|
3597
|
+
metrics?: MetricsSettings;
|
|
3598
|
+
|
|
3599
|
+
/**
|
|
3600
|
+
* Settings for publishing io.Insights traces.
|
|
3601
|
+
*/
|
|
3602
|
+
traces?: TracesSettings;
|
|
3341
3603
|
}
|
|
3342
3604
|
}
|
|
3343
3605
|
}
|