@interopio/browser 3.4.5 → 3.4.7
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 +80 -10
- package/changelog.md +10 -0
- package/dist/browser.es.js +214 -39
- package/dist/browser.es.js.map +1 -1
- package/dist/browser.umd.js +214 -39
- package/dist/browser.umd.js.map +1 -1
- package/dist/browser.umd.min.js +1 -1
- package/package.json +5 -5
package/browser.d.ts
CHANGED
|
@@ -99,6 +99,13 @@ export namespace IOConnectBrowser {
|
|
|
99
99
|
*/
|
|
100
100
|
exposeAPI?: boolean;
|
|
101
101
|
|
|
102
|
+
/**
|
|
103
|
+
* If `true`, when the io.Connect API factory function is invoked more than once in the same app,
|
|
104
|
+
* it will return the already initialized API object, instead of throwing an error.
|
|
105
|
+
* @default false
|
|
106
|
+
*/
|
|
107
|
+
memoizeAPI?: boolean;
|
|
108
|
+
|
|
102
109
|
/**
|
|
103
110
|
* A list of io.Connect libraries which will be initiated internally and provide access to specific functionalities
|
|
104
111
|
*/
|
|
@@ -282,6 +289,12 @@ export namespace IOConnectBrowser {
|
|
|
282
289
|
* Retrieves the current Channel of the window, if any.
|
|
283
290
|
*/
|
|
284
291
|
getChannel(): Promise<string>;
|
|
292
|
+
|
|
293
|
+
/**
|
|
294
|
+
* Notifies when the current Channels of the window have changed. Returns a function you can use to unsubscribe from the event.
|
|
295
|
+
* @param callback Callback for handling the event. Receives the names of the current Channels as an argument.
|
|
296
|
+
*/
|
|
297
|
+
onChannelsChanged(callback: (names: string[]) => void): UnsubscribeFunction;
|
|
285
298
|
}
|
|
286
299
|
export interface Settings {
|
|
287
300
|
|
|
@@ -925,17 +938,19 @@ export namespace IOConnectBrowser {
|
|
|
925
938
|
* Tracks the data in the current channel. Persisted after a channel change.
|
|
926
939
|
* The callback isn't called when you publish the data.
|
|
927
940
|
* @param callback Callback function to handle the received data.
|
|
941
|
+
* @param options Settings for subscribing to an FDC3 context published in the io.Connect Channel.
|
|
928
942
|
* @returns Unsubscribe function.
|
|
929
943
|
*/
|
|
930
|
-
subscribe(callback: (data: any, context: ChannelContext, updaterId: string) => void): UnsubscribeFunction;
|
|
944
|
+
subscribe(callback: (data: any, context: ChannelContext, updaterId: string) => void, options?: FDC3Options): UnsubscribeFunction;
|
|
931
945
|
|
|
932
946
|
/**
|
|
933
947
|
* Tracks the data in a given channel.
|
|
934
948
|
* @param name The channel to track.
|
|
935
949
|
* @param callback Callback function to handle the received data.
|
|
950
|
+
* @param options Settings for subscribing to an FDC3 context published in the io.Connect Channel.
|
|
936
951
|
* @returns Promise that resolves with an unsubscribe function.
|
|
937
952
|
*/
|
|
938
|
-
subscribeFor(name: string, callback: (data: any, context: ChannelContext, updaterId: string) => void): Promise<UnsubscribeFunction>;
|
|
953
|
+
subscribeFor(name: string, callback: (data: any, context: ChannelContext, updaterId: string) => void, options?: FDC3Options): Promise<UnsubscribeFunction>;
|
|
939
954
|
|
|
940
955
|
/**
|
|
941
956
|
* Updates the context of the current or a given channel.
|
|
@@ -960,9 +975,10 @@ export namespace IOConnectBrowser {
|
|
|
960
975
|
/**
|
|
961
976
|
* Returns the context of a given channel.
|
|
962
977
|
* @param name The name of the channel whose context to return.
|
|
978
|
+
* @param options Settings for retrieving an FDC3 context published in the io.Connect Channel.
|
|
963
979
|
* @returns Promise that resolves with the context of the given channel.
|
|
964
980
|
*/
|
|
965
|
-
get(name: string): Promise<ChannelContext>;
|
|
981
|
+
get(name: string, options?: FDC3Options): Promise<ChannelContext>;
|
|
966
982
|
|
|
967
983
|
/**
|
|
968
984
|
* Joins a new channel by name. Leaves the current channel.
|
|
@@ -973,10 +989,11 @@ export namespace IOConnectBrowser {
|
|
|
973
989
|
join(name: string, windowId?: string): Promise<void>;
|
|
974
990
|
|
|
975
991
|
/**
|
|
976
|
-
* Leaves the current
|
|
977
|
-
* @
|
|
992
|
+
* Leaves the current channels.
|
|
993
|
+
* @param config Settings for leaving channels.
|
|
994
|
+
* @returns Promise that resolves when the channels has been left.
|
|
978
995
|
*/
|
|
979
|
-
leave(): Promise<void>;
|
|
996
|
+
leave(config?: ChannelsLeaveConfig): Promise<void>;
|
|
980
997
|
|
|
981
998
|
/**
|
|
982
999
|
* Returns the name of the current channel.
|
|
@@ -1010,7 +1027,7 @@ export namespace IOConnectBrowser {
|
|
|
1010
1027
|
* Adds a new Channel.
|
|
1011
1028
|
* @param info Initial Channel context.
|
|
1012
1029
|
*/
|
|
1013
|
-
add(info:
|
|
1030
|
+
add(info: ChannelDefinition): Promise<ChannelContext>;
|
|
1014
1031
|
|
|
1015
1032
|
/**
|
|
1016
1033
|
* Removes a Channel.
|
|
@@ -1020,9 +1037,10 @@ export namespace IOConnectBrowser {
|
|
|
1020
1037
|
|
|
1021
1038
|
/**
|
|
1022
1039
|
* Retrieves the context of the current Channel.
|
|
1040
|
+
* @param options Settings for retrieving an FDC3 context published in the io.Connect Channel.
|
|
1023
1041
|
* @returns Promise that resolves with the context of the current Channel.
|
|
1024
1042
|
*/
|
|
1025
|
-
getMy(): Promise<ChannelContext | undefined>;
|
|
1043
|
+
getMy(options?: FDC3Options): Promise<ChannelContext | undefined>;
|
|
1026
1044
|
|
|
1027
1045
|
/**
|
|
1028
1046
|
* Retrieves all windows on a specified Channel.
|
|
@@ -1060,6 +1078,31 @@ export namespace IOConnectBrowser {
|
|
|
1060
1078
|
restrictAll(restrictions: RestrictionsConfig): Promise<void>;
|
|
1061
1079
|
}
|
|
1062
1080
|
|
|
1081
|
+
/**
|
|
1082
|
+
* Settings for retrieving and subscribing for FDC3 contexts published in an io.Connect Channel.
|
|
1083
|
+
*/
|
|
1084
|
+
export interface FDC3Options {
|
|
1085
|
+
/**
|
|
1086
|
+
* Type of the FDC3 context to retrieve or to which to subscribe.
|
|
1087
|
+
*/
|
|
1088
|
+
contextType?: string;
|
|
1089
|
+
}
|
|
1090
|
+
|
|
1091
|
+
/**
|
|
1092
|
+
* Options for leaving the Channels.
|
|
1093
|
+
*/
|
|
1094
|
+
export interface ChannelsLeaveConfig {
|
|
1095
|
+
/**
|
|
1096
|
+
* ID of a window which to leave from a Channel. If not provided, will leave the current window from the current Channel
|
|
1097
|
+
*/
|
|
1098
|
+
windowId?: string;
|
|
1099
|
+
|
|
1100
|
+
/**
|
|
1101
|
+
* Name of a channel which should be left. If not provided, will leave from all current channels.
|
|
1102
|
+
*/
|
|
1103
|
+
channel?: string;
|
|
1104
|
+
}
|
|
1105
|
+
|
|
1063
1106
|
/**
|
|
1064
1107
|
* Options for updating a Channel context with the `publish()` method.
|
|
1065
1108
|
*/
|
|
@@ -1113,6 +1156,18 @@ export namespace IOConnectBrowser {
|
|
|
1113
1156
|
windowId?: string;
|
|
1114
1157
|
}
|
|
1115
1158
|
|
|
1159
|
+
/**
|
|
1160
|
+
* Initial context for creating a channel runtime.
|
|
1161
|
+
*/
|
|
1162
|
+
export interface ChannelDefinition {
|
|
1163
|
+
/** Unique name of the context. */
|
|
1164
|
+
name: string;
|
|
1165
|
+
/** Channel meta data (display name, color, image, etc.) */
|
|
1166
|
+
meta: any;
|
|
1167
|
+
/** Channel data. */
|
|
1168
|
+
data?: any;
|
|
1169
|
+
}
|
|
1170
|
+
|
|
1116
1171
|
/**
|
|
1117
1172
|
* Channel context object.
|
|
1118
1173
|
*/
|
|
@@ -1275,6 +1330,16 @@ export namespace IOConnectBrowser {
|
|
|
1275
1330
|
flags: string;
|
|
1276
1331
|
}
|
|
1277
1332
|
|
|
1333
|
+
/**
|
|
1334
|
+
* Settings for the Channel Selector displayed on an io.Connect Window.
|
|
1335
|
+
*/
|
|
1336
|
+
export interface ChannelSelector {
|
|
1337
|
+
/**
|
|
1338
|
+
* If `true`, the Channel Selector will be enabled for the window.
|
|
1339
|
+
*/
|
|
1340
|
+
enabled: boolean;
|
|
1341
|
+
}
|
|
1342
|
+
|
|
1278
1343
|
/**
|
|
1279
1344
|
* Configuration for the `allow` attribute of the `<iframe>` element in which the app will be started when opened in a Workspace.
|
|
1280
1345
|
*/
|
|
@@ -1318,6 +1383,11 @@ export namespace IOConnectBrowser {
|
|
|
1318
1383
|
workspacesSandbox?: WorkspacesSandbox;
|
|
1319
1384
|
|
|
1320
1385
|
/**
|
|
1386
|
+
* Settings for the Channel Selector displayed on an io.Connect Window.
|
|
1387
|
+
*/
|
|
1388
|
+
channelSelector?: ChannelSelector;
|
|
1389
|
+
|
|
1390
|
+
/**
|
|
1321
1391
|
* Configuration for the `sandbox` attribute of the `<iframe>` element in which the app will be started when opened in a Workspace.
|
|
1322
1392
|
*/
|
|
1323
1393
|
iframePermissionsPolicy?: IFramePermissionsPolicyConfig;
|
|
@@ -1974,7 +2044,7 @@ export namespace IOConnectBrowser {
|
|
|
1974
2044
|
* @param callback Callback function for handling the event.
|
|
1975
2045
|
*/
|
|
1976
2046
|
onHandlerRemoved(callback: (removedHandler: ResolverIntentHandler, intent: IntentInfo) => void): UnsubscribeFunction;
|
|
1977
|
-
|
|
2047
|
+
|
|
1978
2048
|
/**
|
|
1979
2049
|
* Sends the chosen Intent handler to the app which raised the Intent.
|
|
1980
2050
|
* @param response The Intent handler that will be sent to the app which raised the Intent.
|
|
@@ -2032,7 +2102,7 @@ export namespace IOConnectBrowser {
|
|
|
2032
2102
|
/**
|
|
2033
2103
|
* Provides additional information about an Intent (e.g., when an Intent is retrieved with the `getIntents()` method).
|
|
2034
2104
|
*/
|
|
2035
|
-
export interface IntentInfo extends AddIntentListenerRequest {
|
|
2105
|
+
export interface IntentInfo extends AddIntentListenerRequest {}
|
|
2036
2106
|
|
|
2037
2107
|
|
|
2038
2108
|
/**
|
package/changelog.md
CHANGED
|
@@ -1,3 +1,13 @@
|
|
|
1
|
+
3.4.7
|
|
2
|
+
feat: added support for channel leave by windowId
|
|
3
|
+
feat: added support for window.onChannelsChanged
|
|
4
|
+
feat: added support for channels selectors config in appD
|
|
5
|
+
3.4.6
|
|
6
|
+
feat: Enable support for io.CB API Memoization
|
|
7
|
+
feat: Add optional IOConnectBrowser.Channels.Fdc3Options param in get, getMy, subscribe and subscribeFor methods.
|
|
8
|
+
fix: io.channels.add() decoder
|
|
9
|
+
chore: Add try-catch block around saving handler in Prefs API
|
|
10
|
+
chore: Add check if intentRequest.target is passed to ignore saved handler in Prefs API if there's a target
|
|
1
11
|
3.4.5
|
|
2
12
|
feat: update prefs api to support non-existent apps
|
|
3
13
|
3.4.4
|