@openfin/fdc3-api 43.101.4 → 43.102.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/out/fdc3-api-alpha.d.ts +70 -1
- package/out/fdc3-api-beta.d.ts +70 -1
- package/out/fdc3-api-public.d.ts +70 -1
- package/out/fdc3-api.d.ts +70 -1
- package/out/fdc3-api.js +186 -22
- package/package.json +1 -1
package/out/fdc3-api-alpha.d.ts
CHANGED
|
@@ -3126,6 +3126,25 @@ declare type ClickedMenuResult<Data extends unknown = unknown> = {
|
|
|
3126
3126
|
data: Data;
|
|
3127
3127
|
};
|
|
3128
3128
|
|
|
3129
|
+
/**
|
|
3130
|
+
* client-changed-context-group is emitted whenever a client connected to the same InteropBroker
|
|
3131
|
+
* (including the current client) change or leave a context group.
|
|
3132
|
+
*/
|
|
3133
|
+
declare type ClientChangedContextGroup = InteropClientEvent<'client-changed-context-group', {
|
|
3134
|
+
/**
|
|
3135
|
+
* The identity of the affected InteropClient
|
|
3136
|
+
*/
|
|
3137
|
+
identity: ClientIdentity;
|
|
3138
|
+
/**
|
|
3139
|
+
* The new context group id, or null if removed from a group.
|
|
3140
|
+
*/
|
|
3141
|
+
contextGroupId: string | null;
|
|
3142
|
+
/**
|
|
3143
|
+
* The previous context group id, or null if none exists.
|
|
3144
|
+
*/
|
|
3145
|
+
previousContextGroupId: string | null;
|
|
3146
|
+
}>;
|
|
3147
|
+
|
|
3129
3148
|
/**
|
|
3130
3149
|
* @interface
|
|
3131
3150
|
*/
|
|
@@ -5145,7 +5164,7 @@ declare type Event_3 = ViewEvents.PropagatedEvent<'application'> | WindowEvents.
|
|
|
5145
5164
|
*/
|
|
5146
5165
|
declare type Event_4 = (WebContentsEvents.Event<'view'> & {
|
|
5147
5166
|
target: OpenFin.Identity;
|
|
5148
|
-
}) | CreatedEvent | DestroyedEvent | HiddenEvent | HotkeyEvent | ShownEvent | TargetChangedEvent | HostContextChangedEvent | AddedToLayoutEvent | RemovedFromLayoutEvent;
|
|
5167
|
+
}) | CreatedEvent | DestroyedEvent | HiddenEvent | HotkeyEvent | ShownEvent | TargetChangedEvent | HostContextChangedEvent | AddedToLayoutEvent | RemovedFromLayoutEvent | ViewOptionsChangedEvent;
|
|
5149
5168
|
|
|
5150
5169
|
/**
|
|
5151
5170
|
* [Union](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#union-types) containing events shared by all WebContents elements
|
|
@@ -7708,6 +7727,20 @@ declare type InteropBrokerOptions = {
|
|
|
7708
7727
|
declare class InteropClient extends Base {
|
|
7709
7728
|
#private;
|
|
7710
7729
|
/* Excluded from this release type: __constructor */
|
|
7730
|
+
/**
|
|
7731
|
+
* `addListener` allows the InteropClient to subscribe to events emitted by the connected InteropBroker.
|
|
7732
|
+
* @param type The event type to subscribe to.
|
|
7733
|
+
* @param listener Callback invoked whenever the event occurs.
|
|
7734
|
+
* @returns Promise resolving with void once the listener is registered.
|
|
7735
|
+
*/
|
|
7736
|
+
addListener: (type: OpenFin.InteropClientEvents['type'], listener: (event: OpenFin.InteropClientEvents['event']) => void) => Promise<void>;
|
|
7737
|
+
/**
|
|
7738
|
+
* `removeListener` removes a registered event listener.
|
|
7739
|
+
* @param type The event type to subscribe to.
|
|
7740
|
+
* @param listener Callback to be removed.
|
|
7741
|
+
* @returns Promise resolving with void even if no callback was found.
|
|
7742
|
+
*/
|
|
7743
|
+
removeListener: (type: OpenFin.InteropClientEvents['type'], listener: (event: OpenFin.InteropClientEvents['event']) => void) => Promise<void>;
|
|
7711
7744
|
/**
|
|
7712
7745
|
* Sets a context for the context group of the current entity.
|
|
7713
7746
|
*
|
|
@@ -8077,6 +8110,16 @@ declare class InteropClient extends Base {
|
|
|
8077
8110
|
/* Excluded from this release type: ferryFdc3Call */
|
|
8078
8111
|
}
|
|
8079
8112
|
|
|
8113
|
+
/**
|
|
8114
|
+
* Interop Client Events
|
|
8115
|
+
*/
|
|
8116
|
+
declare type InteropClientEvent<TName, TEventType = void> = {
|
|
8117
|
+
type: TName;
|
|
8118
|
+
event: TEventType;
|
|
8119
|
+
};
|
|
8120
|
+
|
|
8121
|
+
declare type InteropClientEvents = ClientChangedContextGroup;
|
|
8122
|
+
|
|
8080
8123
|
/**
|
|
8081
8124
|
* @interface
|
|
8082
8125
|
*/
|
|
@@ -10762,6 +10805,9 @@ declare namespace OpenFin {
|
|
|
10762
10805
|
ServeAssetOptions,
|
|
10763
10806
|
ServedAssetInfo,
|
|
10764
10807
|
ResolvedDomainSettings,
|
|
10808
|
+
InteropClientEvent,
|
|
10809
|
+
ClientChangedContextGroup,
|
|
10810
|
+
InteropClientEvents,
|
|
10765
10811
|
ApplicationEvents,
|
|
10766
10812
|
BaseEvents,
|
|
10767
10813
|
ExternalApplicationEvents,
|
|
@@ -15298,6 +15344,11 @@ declare class System extends EmitterBase<OpenFin.SystemEvent> {
|
|
|
15298
15344
|
/**
|
|
15299
15345
|
* Returns a unique identifier (UUID) provided by the machine.
|
|
15300
15346
|
*
|
|
15347
|
+
* On Windows, the machine ID is the `MachineGuid` value located in the Windows Registry at:
|
|
15348
|
+
* `HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Cryptography`.
|
|
15349
|
+
*
|
|
15350
|
+
* On macOS, the machine ID is the hardware UUID of the machine, obtained via native OS APIs.
|
|
15351
|
+
*
|
|
15301
15352
|
* @example
|
|
15302
15353
|
* ```js
|
|
15303
15354
|
* fin.System.getMachineId().then(id => console.log(id)).catch(err => console.log(err));
|
|
@@ -17956,6 +18007,7 @@ declare namespace ViewEvents {
|
|
|
17956
18007
|
HotkeyEvent,
|
|
17957
18008
|
ShownEvent,
|
|
17958
18009
|
HostContextChangedEvent,
|
|
18010
|
+
ViewOptionsChangedEvent,
|
|
17959
18011
|
Event_4 as Event,
|
|
17960
18012
|
ViewEvent,
|
|
17961
18013
|
WillPropagateViewEvent,
|
|
@@ -18084,6 +18136,23 @@ declare class ViewModule extends Base {
|
|
|
18084
18136
|
*/
|
|
18085
18137
|
declare type ViewOptions = ConstViewOptions & MutableViewOptions;
|
|
18086
18138
|
|
|
18139
|
+
/**
|
|
18140
|
+
* Generated whenever a view's options are changed.
|
|
18141
|
+
* @remarks Will not emit if an updateOptions call does not result in a new diff.
|
|
18142
|
+
* @interface
|
|
18143
|
+
*/
|
|
18144
|
+
declare type ViewOptionsChangedEvent = BaseEvent_4 & {
|
|
18145
|
+
type: 'options-changed';
|
|
18146
|
+
/**
|
|
18147
|
+
* The new state of the view's options.
|
|
18148
|
+
*/
|
|
18149
|
+
options: OpenFin.ViewOptions;
|
|
18150
|
+
/**
|
|
18151
|
+
* Diff between the previous value of options and new.
|
|
18152
|
+
*/
|
|
18153
|
+
diff: OpenFin.ViewOptions;
|
|
18154
|
+
};
|
|
18155
|
+
|
|
18087
18156
|
/**
|
|
18088
18157
|
* @interface
|
|
18089
18158
|
*/
|
package/out/fdc3-api-beta.d.ts
CHANGED
|
@@ -3126,6 +3126,25 @@ declare type ClickedMenuResult<Data extends unknown = unknown> = {
|
|
|
3126
3126
|
data: Data;
|
|
3127
3127
|
};
|
|
3128
3128
|
|
|
3129
|
+
/**
|
|
3130
|
+
* client-changed-context-group is emitted whenever a client connected to the same InteropBroker
|
|
3131
|
+
* (including the current client) change or leave a context group.
|
|
3132
|
+
*/
|
|
3133
|
+
declare type ClientChangedContextGroup = InteropClientEvent<'client-changed-context-group', {
|
|
3134
|
+
/**
|
|
3135
|
+
* The identity of the affected InteropClient
|
|
3136
|
+
*/
|
|
3137
|
+
identity: ClientIdentity;
|
|
3138
|
+
/**
|
|
3139
|
+
* The new context group id, or null if removed from a group.
|
|
3140
|
+
*/
|
|
3141
|
+
contextGroupId: string | null;
|
|
3142
|
+
/**
|
|
3143
|
+
* The previous context group id, or null if none exists.
|
|
3144
|
+
*/
|
|
3145
|
+
previousContextGroupId: string | null;
|
|
3146
|
+
}>;
|
|
3147
|
+
|
|
3129
3148
|
/**
|
|
3130
3149
|
* @interface
|
|
3131
3150
|
*/
|
|
@@ -5145,7 +5164,7 @@ declare type Event_3 = ViewEvents.PropagatedEvent<'application'> | WindowEvents.
|
|
|
5145
5164
|
*/
|
|
5146
5165
|
declare type Event_4 = (WebContentsEvents.Event<'view'> & {
|
|
5147
5166
|
target: OpenFin.Identity;
|
|
5148
|
-
}) | CreatedEvent | DestroyedEvent | HiddenEvent | HotkeyEvent | ShownEvent | TargetChangedEvent | HostContextChangedEvent | AddedToLayoutEvent | RemovedFromLayoutEvent;
|
|
5167
|
+
}) | CreatedEvent | DestroyedEvent | HiddenEvent | HotkeyEvent | ShownEvent | TargetChangedEvent | HostContextChangedEvent | AddedToLayoutEvent | RemovedFromLayoutEvent | ViewOptionsChangedEvent;
|
|
5149
5168
|
|
|
5150
5169
|
/**
|
|
5151
5170
|
* [Union](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#union-types) containing events shared by all WebContents elements
|
|
@@ -7708,6 +7727,20 @@ declare type InteropBrokerOptions = {
|
|
|
7708
7727
|
declare class InteropClient extends Base {
|
|
7709
7728
|
#private;
|
|
7710
7729
|
/* Excluded from this release type: __constructor */
|
|
7730
|
+
/**
|
|
7731
|
+
* `addListener` allows the InteropClient to subscribe to events emitted by the connected InteropBroker.
|
|
7732
|
+
* @param type The event type to subscribe to.
|
|
7733
|
+
* @param listener Callback invoked whenever the event occurs.
|
|
7734
|
+
* @returns Promise resolving with void once the listener is registered.
|
|
7735
|
+
*/
|
|
7736
|
+
addListener: (type: OpenFin.InteropClientEvents['type'], listener: (event: OpenFin.InteropClientEvents['event']) => void) => Promise<void>;
|
|
7737
|
+
/**
|
|
7738
|
+
* `removeListener` removes a registered event listener.
|
|
7739
|
+
* @param type The event type to subscribe to.
|
|
7740
|
+
* @param listener Callback to be removed.
|
|
7741
|
+
* @returns Promise resolving with void even if no callback was found.
|
|
7742
|
+
*/
|
|
7743
|
+
removeListener: (type: OpenFin.InteropClientEvents['type'], listener: (event: OpenFin.InteropClientEvents['event']) => void) => Promise<void>;
|
|
7711
7744
|
/**
|
|
7712
7745
|
* Sets a context for the context group of the current entity.
|
|
7713
7746
|
*
|
|
@@ -8077,6 +8110,16 @@ declare class InteropClient extends Base {
|
|
|
8077
8110
|
/* Excluded from this release type: ferryFdc3Call */
|
|
8078
8111
|
}
|
|
8079
8112
|
|
|
8113
|
+
/**
|
|
8114
|
+
* Interop Client Events
|
|
8115
|
+
*/
|
|
8116
|
+
declare type InteropClientEvent<TName, TEventType = void> = {
|
|
8117
|
+
type: TName;
|
|
8118
|
+
event: TEventType;
|
|
8119
|
+
};
|
|
8120
|
+
|
|
8121
|
+
declare type InteropClientEvents = ClientChangedContextGroup;
|
|
8122
|
+
|
|
8080
8123
|
/**
|
|
8081
8124
|
* @interface
|
|
8082
8125
|
*/
|
|
@@ -10762,6 +10805,9 @@ declare namespace OpenFin {
|
|
|
10762
10805
|
ServeAssetOptions,
|
|
10763
10806
|
ServedAssetInfo,
|
|
10764
10807
|
ResolvedDomainSettings,
|
|
10808
|
+
InteropClientEvent,
|
|
10809
|
+
ClientChangedContextGroup,
|
|
10810
|
+
InteropClientEvents,
|
|
10765
10811
|
ApplicationEvents,
|
|
10766
10812
|
BaseEvents,
|
|
10767
10813
|
ExternalApplicationEvents,
|
|
@@ -15298,6 +15344,11 @@ declare class System extends EmitterBase<OpenFin.SystemEvent> {
|
|
|
15298
15344
|
/**
|
|
15299
15345
|
* Returns a unique identifier (UUID) provided by the machine.
|
|
15300
15346
|
*
|
|
15347
|
+
* On Windows, the machine ID is the `MachineGuid` value located in the Windows Registry at:
|
|
15348
|
+
* `HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Cryptography`.
|
|
15349
|
+
*
|
|
15350
|
+
* On macOS, the machine ID is the hardware UUID of the machine, obtained via native OS APIs.
|
|
15351
|
+
*
|
|
15301
15352
|
* @example
|
|
15302
15353
|
* ```js
|
|
15303
15354
|
* fin.System.getMachineId().then(id => console.log(id)).catch(err => console.log(err));
|
|
@@ -17956,6 +18007,7 @@ declare namespace ViewEvents {
|
|
|
17956
18007
|
HotkeyEvent,
|
|
17957
18008
|
ShownEvent,
|
|
17958
18009
|
HostContextChangedEvent,
|
|
18010
|
+
ViewOptionsChangedEvent,
|
|
17959
18011
|
Event_4 as Event,
|
|
17960
18012
|
ViewEvent,
|
|
17961
18013
|
WillPropagateViewEvent,
|
|
@@ -18084,6 +18136,23 @@ declare class ViewModule extends Base {
|
|
|
18084
18136
|
*/
|
|
18085
18137
|
declare type ViewOptions = ConstViewOptions & MutableViewOptions;
|
|
18086
18138
|
|
|
18139
|
+
/**
|
|
18140
|
+
* Generated whenever a view's options are changed.
|
|
18141
|
+
* @remarks Will not emit if an updateOptions call does not result in a new diff.
|
|
18142
|
+
* @interface
|
|
18143
|
+
*/
|
|
18144
|
+
declare type ViewOptionsChangedEvent = BaseEvent_4 & {
|
|
18145
|
+
type: 'options-changed';
|
|
18146
|
+
/**
|
|
18147
|
+
* The new state of the view's options.
|
|
18148
|
+
*/
|
|
18149
|
+
options: OpenFin.ViewOptions;
|
|
18150
|
+
/**
|
|
18151
|
+
* Diff between the previous value of options and new.
|
|
18152
|
+
*/
|
|
18153
|
+
diff: OpenFin.ViewOptions;
|
|
18154
|
+
};
|
|
18155
|
+
|
|
18087
18156
|
/**
|
|
18088
18157
|
* @interface
|
|
18089
18158
|
*/
|
package/out/fdc3-api-public.d.ts
CHANGED
|
@@ -3126,6 +3126,25 @@ declare type ClickedMenuResult<Data extends unknown = unknown> = {
|
|
|
3126
3126
|
data: Data;
|
|
3127
3127
|
};
|
|
3128
3128
|
|
|
3129
|
+
/**
|
|
3130
|
+
* client-changed-context-group is emitted whenever a client connected to the same InteropBroker
|
|
3131
|
+
* (including the current client) change or leave a context group.
|
|
3132
|
+
*/
|
|
3133
|
+
declare type ClientChangedContextGroup = InteropClientEvent<'client-changed-context-group', {
|
|
3134
|
+
/**
|
|
3135
|
+
* The identity of the affected InteropClient
|
|
3136
|
+
*/
|
|
3137
|
+
identity: ClientIdentity;
|
|
3138
|
+
/**
|
|
3139
|
+
* The new context group id, or null if removed from a group.
|
|
3140
|
+
*/
|
|
3141
|
+
contextGroupId: string | null;
|
|
3142
|
+
/**
|
|
3143
|
+
* The previous context group id, or null if none exists.
|
|
3144
|
+
*/
|
|
3145
|
+
previousContextGroupId: string | null;
|
|
3146
|
+
}>;
|
|
3147
|
+
|
|
3129
3148
|
/**
|
|
3130
3149
|
* @interface
|
|
3131
3150
|
*/
|
|
@@ -5145,7 +5164,7 @@ declare type Event_3 = ViewEvents.PropagatedEvent<'application'> | WindowEvents.
|
|
|
5145
5164
|
*/
|
|
5146
5165
|
declare type Event_4 = (WebContentsEvents.Event<'view'> & {
|
|
5147
5166
|
target: OpenFin.Identity;
|
|
5148
|
-
}) | CreatedEvent | DestroyedEvent | HiddenEvent | HotkeyEvent | ShownEvent | TargetChangedEvent | HostContextChangedEvent | AddedToLayoutEvent | RemovedFromLayoutEvent;
|
|
5167
|
+
}) | CreatedEvent | DestroyedEvent | HiddenEvent | HotkeyEvent | ShownEvent | TargetChangedEvent | HostContextChangedEvent | AddedToLayoutEvent | RemovedFromLayoutEvent | ViewOptionsChangedEvent;
|
|
5149
5168
|
|
|
5150
5169
|
/**
|
|
5151
5170
|
* [Union](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#union-types) containing events shared by all WebContents elements
|
|
@@ -7708,6 +7727,20 @@ declare type InteropBrokerOptions = {
|
|
|
7708
7727
|
declare class InteropClient extends Base {
|
|
7709
7728
|
#private;
|
|
7710
7729
|
/* Excluded from this release type: __constructor */
|
|
7730
|
+
/**
|
|
7731
|
+
* `addListener` allows the InteropClient to subscribe to events emitted by the connected InteropBroker.
|
|
7732
|
+
* @param type The event type to subscribe to.
|
|
7733
|
+
* @param listener Callback invoked whenever the event occurs.
|
|
7734
|
+
* @returns Promise resolving with void once the listener is registered.
|
|
7735
|
+
*/
|
|
7736
|
+
addListener: (type: OpenFin.InteropClientEvents['type'], listener: (event: OpenFin.InteropClientEvents['event']) => void) => Promise<void>;
|
|
7737
|
+
/**
|
|
7738
|
+
* `removeListener` removes a registered event listener.
|
|
7739
|
+
* @param type The event type to subscribe to.
|
|
7740
|
+
* @param listener Callback to be removed.
|
|
7741
|
+
* @returns Promise resolving with void even if no callback was found.
|
|
7742
|
+
*/
|
|
7743
|
+
removeListener: (type: OpenFin.InteropClientEvents['type'], listener: (event: OpenFin.InteropClientEvents['event']) => void) => Promise<void>;
|
|
7711
7744
|
/**
|
|
7712
7745
|
* Sets a context for the context group of the current entity.
|
|
7713
7746
|
*
|
|
@@ -8077,6 +8110,16 @@ declare class InteropClient extends Base {
|
|
|
8077
8110
|
/* Excluded from this release type: ferryFdc3Call */
|
|
8078
8111
|
}
|
|
8079
8112
|
|
|
8113
|
+
/**
|
|
8114
|
+
* Interop Client Events
|
|
8115
|
+
*/
|
|
8116
|
+
declare type InteropClientEvent<TName, TEventType = void> = {
|
|
8117
|
+
type: TName;
|
|
8118
|
+
event: TEventType;
|
|
8119
|
+
};
|
|
8120
|
+
|
|
8121
|
+
declare type InteropClientEvents = ClientChangedContextGroup;
|
|
8122
|
+
|
|
8080
8123
|
/**
|
|
8081
8124
|
* @interface
|
|
8082
8125
|
*/
|
|
@@ -10762,6 +10805,9 @@ declare namespace OpenFin {
|
|
|
10762
10805
|
ServeAssetOptions,
|
|
10763
10806
|
ServedAssetInfo,
|
|
10764
10807
|
ResolvedDomainSettings,
|
|
10808
|
+
InteropClientEvent,
|
|
10809
|
+
ClientChangedContextGroup,
|
|
10810
|
+
InteropClientEvents,
|
|
10765
10811
|
ApplicationEvents,
|
|
10766
10812
|
BaseEvents,
|
|
10767
10813
|
ExternalApplicationEvents,
|
|
@@ -15298,6 +15344,11 @@ declare class System extends EmitterBase<OpenFin.SystemEvent> {
|
|
|
15298
15344
|
/**
|
|
15299
15345
|
* Returns a unique identifier (UUID) provided by the machine.
|
|
15300
15346
|
*
|
|
15347
|
+
* On Windows, the machine ID is the `MachineGuid` value located in the Windows Registry at:
|
|
15348
|
+
* `HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Cryptography`.
|
|
15349
|
+
*
|
|
15350
|
+
* On macOS, the machine ID is the hardware UUID of the machine, obtained via native OS APIs.
|
|
15351
|
+
*
|
|
15301
15352
|
* @example
|
|
15302
15353
|
* ```js
|
|
15303
15354
|
* fin.System.getMachineId().then(id => console.log(id)).catch(err => console.log(err));
|
|
@@ -17956,6 +18007,7 @@ declare namespace ViewEvents {
|
|
|
17956
18007
|
HotkeyEvent,
|
|
17957
18008
|
ShownEvent,
|
|
17958
18009
|
HostContextChangedEvent,
|
|
18010
|
+
ViewOptionsChangedEvent,
|
|
17959
18011
|
Event_4 as Event,
|
|
17960
18012
|
ViewEvent,
|
|
17961
18013
|
WillPropagateViewEvent,
|
|
@@ -18084,6 +18136,23 @@ declare class ViewModule extends Base {
|
|
|
18084
18136
|
*/
|
|
18085
18137
|
declare type ViewOptions = ConstViewOptions & MutableViewOptions;
|
|
18086
18138
|
|
|
18139
|
+
/**
|
|
18140
|
+
* Generated whenever a view's options are changed.
|
|
18141
|
+
* @remarks Will not emit if an updateOptions call does not result in a new diff.
|
|
18142
|
+
* @interface
|
|
18143
|
+
*/
|
|
18144
|
+
declare type ViewOptionsChangedEvent = BaseEvent_4 & {
|
|
18145
|
+
type: 'options-changed';
|
|
18146
|
+
/**
|
|
18147
|
+
* The new state of the view's options.
|
|
18148
|
+
*/
|
|
18149
|
+
options: OpenFin.ViewOptions;
|
|
18150
|
+
/**
|
|
18151
|
+
* Diff between the previous value of options and new.
|
|
18152
|
+
*/
|
|
18153
|
+
diff: OpenFin.ViewOptions;
|
|
18154
|
+
};
|
|
18155
|
+
|
|
18087
18156
|
/**
|
|
18088
18157
|
* @interface
|
|
18089
18158
|
*/
|
package/out/fdc3-api.d.ts
CHANGED
|
@@ -3182,6 +3182,25 @@ declare type ClickedMenuResult<Data extends unknown = unknown> = {
|
|
|
3182
3182
|
data: Data;
|
|
3183
3183
|
};
|
|
3184
3184
|
|
|
3185
|
+
/**
|
|
3186
|
+
* client-changed-context-group is emitted whenever a client connected to the same InteropBroker
|
|
3187
|
+
* (including the current client) change or leave a context group.
|
|
3188
|
+
*/
|
|
3189
|
+
declare type ClientChangedContextGroup = InteropClientEvent<'client-changed-context-group', {
|
|
3190
|
+
/**
|
|
3191
|
+
* The identity of the affected InteropClient
|
|
3192
|
+
*/
|
|
3193
|
+
identity: ClientIdentity;
|
|
3194
|
+
/**
|
|
3195
|
+
* The new context group id, or null if removed from a group.
|
|
3196
|
+
*/
|
|
3197
|
+
contextGroupId: string | null;
|
|
3198
|
+
/**
|
|
3199
|
+
* The previous context group id, or null if none exists.
|
|
3200
|
+
*/
|
|
3201
|
+
previousContextGroupId: string | null;
|
|
3202
|
+
}>;
|
|
3203
|
+
|
|
3185
3204
|
/**
|
|
3186
3205
|
* @interface
|
|
3187
3206
|
*/
|
|
@@ -5209,7 +5228,7 @@ declare type Event_3 = ViewEvents.PropagatedEvent<'application'> | WindowEvents.
|
|
|
5209
5228
|
*/
|
|
5210
5229
|
declare type Event_4 = (WebContentsEvents.Event<'view'> & {
|
|
5211
5230
|
target: OpenFin.Identity;
|
|
5212
|
-
}) | CreatedEvent | DestroyedEvent | HiddenEvent | HotkeyEvent | ShownEvent | TargetChangedEvent | HostContextChangedEvent | AddedToLayoutEvent | RemovedFromLayoutEvent;
|
|
5231
|
+
}) | CreatedEvent | DestroyedEvent | HiddenEvent | HotkeyEvent | ShownEvent | TargetChangedEvent | HostContextChangedEvent | AddedToLayoutEvent | RemovedFromLayoutEvent | ViewOptionsChangedEvent;
|
|
5213
5232
|
|
|
5214
5233
|
/**
|
|
5215
5234
|
* [Union](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#union-types) containing events shared by all WebContents elements
|
|
@@ -7820,6 +7839,20 @@ declare class InteropClient extends Base {
|
|
|
7820
7839
|
* @internal
|
|
7821
7840
|
*/
|
|
7822
7841
|
constructor(wire: Transport, clientPromise: Promise<OpenFin.ChannelClient>, fdc3Factory: FDC3Factory);
|
|
7842
|
+
/**
|
|
7843
|
+
* `addListener` allows the InteropClient to subscribe to events emitted by the connected InteropBroker.
|
|
7844
|
+
* @param type The event type to subscribe to.
|
|
7845
|
+
* @param listener Callback invoked whenever the event occurs.
|
|
7846
|
+
* @returns Promise resolving with void once the listener is registered.
|
|
7847
|
+
*/
|
|
7848
|
+
addListener: (type: OpenFin.InteropClientEvents['type'], listener: (event: OpenFin.InteropClientEvents['event']) => void) => Promise<void>;
|
|
7849
|
+
/**
|
|
7850
|
+
* `removeListener` removes a registered event listener.
|
|
7851
|
+
* @param type The event type to subscribe to.
|
|
7852
|
+
* @param listener Callback to be removed.
|
|
7853
|
+
* @returns Promise resolving with void even if no callback was found.
|
|
7854
|
+
*/
|
|
7855
|
+
removeListener: (type: OpenFin.InteropClientEvents['type'], listener: (event: OpenFin.InteropClientEvents['event']) => void) => Promise<void>;
|
|
7823
7856
|
/**
|
|
7824
7857
|
* Sets a context for the context group of the current entity.
|
|
7825
7858
|
*
|
|
@@ -8194,6 +8227,16 @@ declare class InteropClient extends Base {
|
|
|
8194
8227
|
static ferryFdc3Call(interopClient: OpenFin.InteropClient, action: string, payload?: any): Promise<any>;
|
|
8195
8228
|
}
|
|
8196
8229
|
|
|
8230
|
+
/**
|
|
8231
|
+
* Interop Client Events
|
|
8232
|
+
*/
|
|
8233
|
+
declare type InteropClientEvent<TName, TEventType = void> = {
|
|
8234
|
+
type: TName;
|
|
8235
|
+
event: TEventType;
|
|
8236
|
+
};
|
|
8237
|
+
|
|
8238
|
+
declare type InteropClientEvents = ClientChangedContextGroup;
|
|
8239
|
+
|
|
8197
8240
|
/**
|
|
8198
8241
|
* @interface
|
|
8199
8242
|
*/
|
|
@@ -11096,6 +11139,9 @@ declare namespace OpenFin {
|
|
|
11096
11139
|
ServeAssetOptions,
|
|
11097
11140
|
ServedAssetInfo,
|
|
11098
11141
|
ResolvedDomainSettings,
|
|
11142
|
+
InteropClientEvent,
|
|
11143
|
+
ClientChangedContextGroup,
|
|
11144
|
+
InteropClientEvents,
|
|
11099
11145
|
ApplicationEvents,
|
|
11100
11146
|
BaseEvents,
|
|
11101
11147
|
ExternalApplicationEvents,
|
|
@@ -15721,6 +15767,11 @@ declare class System extends EmitterBase<OpenFin.SystemEvent> {
|
|
|
15721
15767
|
/**
|
|
15722
15768
|
* Returns a unique identifier (UUID) provided by the machine.
|
|
15723
15769
|
*
|
|
15770
|
+
* On Windows, the machine ID is the `MachineGuid` value located in the Windows Registry at:
|
|
15771
|
+
* `HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Cryptography`.
|
|
15772
|
+
*
|
|
15773
|
+
* On macOS, the machine ID is the hardware UUID of the machine, obtained via native OS APIs.
|
|
15774
|
+
*
|
|
15724
15775
|
* @example
|
|
15725
15776
|
* ```js
|
|
15726
15777
|
* fin.System.getMachineId().then(id => console.log(id)).catch(err => console.log(err));
|
|
@@ -18423,6 +18474,7 @@ declare namespace ViewEvents {
|
|
|
18423
18474
|
HotkeyEvent,
|
|
18424
18475
|
ShownEvent,
|
|
18425
18476
|
HostContextChangedEvent,
|
|
18477
|
+
ViewOptionsChangedEvent,
|
|
18426
18478
|
Event_4 as Event,
|
|
18427
18479
|
ViewEvent,
|
|
18428
18480
|
WillPropagateViewEvent,
|
|
@@ -18551,6 +18603,23 @@ declare class ViewModule extends Base {
|
|
|
18551
18603
|
*/
|
|
18552
18604
|
declare type ViewOptions = ConstViewOptions & MutableViewOptions;
|
|
18553
18605
|
|
|
18606
|
+
/**
|
|
18607
|
+
* Generated whenever a view's options are changed.
|
|
18608
|
+
* @remarks Will not emit if an updateOptions call does not result in a new diff.
|
|
18609
|
+
* @interface
|
|
18610
|
+
*/
|
|
18611
|
+
declare type ViewOptionsChangedEvent = BaseEvent_4 & {
|
|
18612
|
+
type: 'options-changed';
|
|
18613
|
+
/**
|
|
18614
|
+
* The new state of the view's options.
|
|
18615
|
+
*/
|
|
18616
|
+
options: OpenFin.ViewOptions;
|
|
18617
|
+
/**
|
|
18618
|
+
* Diff between the previous value of options and new.
|
|
18619
|
+
*/
|
|
18620
|
+
diff: OpenFin.ViewOptions;
|
|
18621
|
+
};
|
|
18622
|
+
|
|
18554
18623
|
/**
|
|
18555
18624
|
* @interface
|
|
18556
18625
|
*/
|
package/out/fdc3-api.js
CHANGED
|
@@ -495,13 +495,13 @@ var InteropClient$1 = {};
|
|
|
495
495
|
|
|
496
496
|
var base = {};
|
|
497
497
|
|
|
498
|
-
var __classPrivateFieldSet$
|
|
498
|
+
var __classPrivateFieldSet$4 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
499
499
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
500
500
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
501
501
|
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
502
502
|
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
503
503
|
};
|
|
504
|
-
var __classPrivateFieldGet$
|
|
504
|
+
var __classPrivateFieldGet$4 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
505
505
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
506
506
|
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
507
507
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
@@ -585,9 +585,9 @@ class EmitterBase extends Base {
|
|
|
585
585
|
this.emit = (eventType, payload, ...args) => {
|
|
586
586
|
return this.hasEmitter() ? this.getOrCreateEmitter().emit(eventType, payload, ...args) : false;
|
|
587
587
|
};
|
|
588
|
-
this.hasEmitter = () => this.wire.eventAggregator.has(__classPrivateFieldGet$
|
|
588
|
+
this.hasEmitter = () => this.wire.eventAggregator.has(__classPrivateFieldGet$4(this, _EmitterBase_emitterAccessor, "f"));
|
|
589
589
|
this.getOrCreateEmitter = () => {
|
|
590
|
-
return this.wire.eventAggregator.getOrCreate(__classPrivateFieldGet$
|
|
590
|
+
return this.wire.eventAggregator.getOrCreate(__classPrivateFieldGet$4(this, _EmitterBase_emitterAccessor, "f"));
|
|
591
591
|
};
|
|
592
592
|
this.listeners = (type) => this.hasEmitter() ? this.getOrCreateEmitter().listeners(type) : [];
|
|
593
593
|
this.listenerCount = (type) => this.hasEmitter() ? this.getOrCreateEmitter().listenerCount(type) : 0;
|
|
@@ -625,8 +625,8 @@ class EmitterBase extends Base {
|
|
|
625
625
|
// This will only be reached if unsubscribe from event that does not exist but do not want to error here
|
|
626
626
|
return Promise.resolve();
|
|
627
627
|
};
|
|
628
|
-
__classPrivateFieldSet$
|
|
629
|
-
__classPrivateFieldSet$
|
|
628
|
+
__classPrivateFieldSet$4(this, _EmitterBase_emitterAccessor, [topic, ...additionalAccessors], "f");
|
|
629
|
+
__classPrivateFieldSet$4(this, _EmitterBase_deregisterOnceListeners, new WeakMap(), "f");
|
|
630
630
|
}
|
|
631
631
|
/**
|
|
632
632
|
* Adds a listener to the end of the listeners array for the specified event.
|
|
@@ -654,7 +654,7 @@ class EmitterBase extends Base {
|
|
|
654
654
|
*/
|
|
655
655
|
async once(eventType, listener, options) {
|
|
656
656
|
const deregister = () => this.deregisterEventListener(eventType);
|
|
657
|
-
__classPrivateFieldGet$
|
|
657
|
+
__classPrivateFieldGet$4(this, _EmitterBase_deregisterOnceListeners, "f").set(listener, deregister);
|
|
658
658
|
await this.registerEventListener(eventType, options, (emitter) => {
|
|
659
659
|
emitter.once(eventType, deregister);
|
|
660
660
|
emitter.once(eventType, listener);
|
|
@@ -685,7 +685,7 @@ class EmitterBase extends Base {
|
|
|
685
685
|
*/
|
|
686
686
|
async prependOnceListener(eventType, listener, options) {
|
|
687
687
|
const deregister = () => this.deregisterEventListener(eventType);
|
|
688
|
-
__classPrivateFieldGet$
|
|
688
|
+
__classPrivateFieldGet$4(this, _EmitterBase_deregisterOnceListeners, "f").set(listener, deregister);
|
|
689
689
|
await this.registerEventListener(eventType, options, (emitter) => {
|
|
690
690
|
emitter.prependOnceListener(eventType, listener);
|
|
691
691
|
emitter.once(eventType, deregister);
|
|
@@ -704,7 +704,7 @@ class EmitterBase extends Base {
|
|
|
704
704
|
const emitter = await this.deregisterEventListener(eventType, options);
|
|
705
705
|
if (emitter) {
|
|
706
706
|
emitter.removeListener(eventType, listener);
|
|
707
|
-
const deregister = __classPrivateFieldGet$
|
|
707
|
+
const deregister = __classPrivateFieldGet$4(this, _EmitterBase_deregisterOnceListeners, "f").get(listener);
|
|
708
708
|
if (deregister) {
|
|
709
709
|
emitter.removeListener(eventType, deregister);
|
|
710
710
|
}
|
|
@@ -750,7 +750,7 @@ class EmitterBase extends Base {
|
|
|
750
750
|
deleteEmitterIfNothingRegistered(emitter) {
|
|
751
751
|
// TODO: maybe emitterMap should clean up itself..
|
|
752
752
|
if (emitter.eventNames().length === 0) {
|
|
753
|
-
this.wire.eventAggregator.delete(__classPrivateFieldGet$
|
|
753
|
+
this.wire.eventAggregator.delete(__classPrivateFieldGet$4(this, _EmitterBase_emitterAccessor, "f"));
|
|
754
754
|
}
|
|
755
755
|
}
|
|
756
756
|
}
|
|
@@ -762,13 +762,13 @@ base.Reply = Reply;
|
|
|
762
762
|
|
|
763
763
|
var SessionContextGroupClient$1 = {};
|
|
764
764
|
|
|
765
|
-
var __classPrivateFieldSet$
|
|
765
|
+
var __classPrivateFieldSet$3 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
766
766
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
767
767
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
768
768
|
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
769
769
|
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
770
770
|
};
|
|
771
|
-
var __classPrivateFieldGet$
|
|
771
|
+
var __classPrivateFieldGet$3 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
772
772
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
773
773
|
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
774
774
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
@@ -782,7 +782,7 @@ class SessionContextGroupClient extends base_1$1.Base {
|
|
|
782
782
|
super(wire);
|
|
783
783
|
_SessionContextGroupClient_clientPromise.set(this, void 0);
|
|
784
784
|
this.id = id;
|
|
785
|
-
__classPrivateFieldSet$
|
|
785
|
+
__classPrivateFieldSet$3(this, _SessionContextGroupClient_clientPromise, client, "f");
|
|
786
786
|
}
|
|
787
787
|
/**
|
|
788
788
|
* Sets a context for the session context group.
|
|
@@ -794,7 +794,7 @@ class SessionContextGroupClient extends base_1$1.Base {
|
|
|
794
794
|
this.wire.sendAction('interop-session-context-group-set-context').catch((e) => {
|
|
795
795
|
// don't expose, analytics-only call
|
|
796
796
|
});
|
|
797
|
-
const client = await __classPrivateFieldGet$
|
|
797
|
+
const client = await __classPrivateFieldGet$3(this, _SessionContextGroupClient_clientPromise, "f");
|
|
798
798
|
return client.dispatch(`sessionContextGroup:setContext-${this.id}`, {
|
|
799
799
|
sessionContextGroupId: this.id,
|
|
800
800
|
context
|
|
@@ -804,7 +804,7 @@ class SessionContextGroupClient extends base_1$1.Base {
|
|
|
804
804
|
this.wire.sendAction('interop-session-context-group-get-context').catch((e) => {
|
|
805
805
|
// don't expose, analytics-only call
|
|
806
806
|
});
|
|
807
|
-
const client = await __classPrivateFieldGet$
|
|
807
|
+
const client = await __classPrivateFieldGet$3(this, _SessionContextGroupClient_clientPromise, "f");
|
|
808
808
|
return client.dispatch(`sessionContextGroup:getContext-${this.id}`, {
|
|
809
809
|
sessionContextGroupId: this.id,
|
|
810
810
|
type
|
|
@@ -817,7 +817,7 @@ class SessionContextGroupClient extends base_1$1.Base {
|
|
|
817
817
|
if (typeof contextHandler !== 'function') {
|
|
818
818
|
throw new Error("Non-function argument passed to the first parameter 'handler'. Be aware that the argument order does not match the FDC3 standard.");
|
|
819
819
|
}
|
|
820
|
-
const client = await __classPrivateFieldGet$
|
|
820
|
+
const client = await __classPrivateFieldGet$3(this, _SessionContextGroupClient_clientPromise, "f");
|
|
821
821
|
let handlerId;
|
|
822
822
|
if (contextType) {
|
|
823
823
|
handlerId = `sessionContextHandler:invoke-${this.id}-${contextType}-${(0, utils_1$4.generateId)()}`;
|
|
@@ -830,7 +830,7 @@ class SessionContextGroupClient extends base_1$1.Base {
|
|
|
830
830
|
return { unsubscribe: await this.createUnsubscribeCb(handlerId) };
|
|
831
831
|
}
|
|
832
832
|
async createUnsubscribeCb(handlerId) {
|
|
833
|
-
const client = await __classPrivateFieldGet$
|
|
833
|
+
const client = await __classPrivateFieldGet$3(this, _SessionContextGroupClient_clientPromise, "f");
|
|
834
834
|
return async () => {
|
|
835
835
|
client.remove(handlerId);
|
|
836
836
|
await client.dispatch(`sessionContextGroup:handlerRemoved-${this.id}`, { handlerId });
|
|
@@ -848,6 +848,139 @@ class SessionContextGroupClient extends base_1$1.Base {
|
|
|
848
848
|
SessionContextGroupClient$1.default = SessionContextGroupClient;
|
|
849
849
|
_SessionContextGroupClient_clientPromise = new WeakMap();
|
|
850
850
|
|
|
851
|
+
var channelEvents = {};
|
|
852
|
+
|
|
853
|
+
var __classPrivateFieldSet$2 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
854
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
855
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
856
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
857
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
858
|
+
};
|
|
859
|
+
var __classPrivateFieldGet$2 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
860
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
861
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
862
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
863
|
+
};
|
|
864
|
+
var _a, _ChannelEvents_channelClient, _ChannelEvents_isChannelReady, _ChannelEvents_actionsByClient, _ChannelEvents_getActions, _ChannelEvents_createRegistration, _ChannelEvents_getRegistration, _ChannelEvents_getOrCreateRegistration;
|
|
865
|
+
Object.defineProperty(channelEvents, "__esModule", { value: true });
|
|
866
|
+
channelEvents.ChannelEvents = void 0;
|
|
867
|
+
/**
|
|
868
|
+
* Channel events creates a event like syntax out of a channel action, allowing multiple events to be triggered
|
|
869
|
+
* from a single action (normally only one callback can be created per action).
|
|
870
|
+
*
|
|
871
|
+
* This Class essentially allows us to multiplex channel actions to multiple callbacks.
|
|
872
|
+
*/
|
|
873
|
+
class ChannelEvents {
|
|
874
|
+
constructor(channelClient) {
|
|
875
|
+
// eslint-disable-next-line
|
|
876
|
+
_ChannelEvents_channelClient.set(this, void 0);
|
|
877
|
+
_ChannelEvents_isChannelReady.set(this, false);
|
|
878
|
+
_ChannelEvents_getActions.set(this, async () => {
|
|
879
|
+
const channelClient = await __classPrivateFieldGet$2(this, _ChannelEvents_channelClient, "f");
|
|
880
|
+
let actions = __classPrivateFieldGet$2(ChannelEvents, _a, "f", _ChannelEvents_actionsByClient).get(channelClient);
|
|
881
|
+
if (!actions) {
|
|
882
|
+
actions = {};
|
|
883
|
+
__classPrivateFieldGet$2(ChannelEvents, _a, "f", _ChannelEvents_actionsByClient).set(channelClient, actions);
|
|
884
|
+
}
|
|
885
|
+
return actions;
|
|
886
|
+
});
|
|
887
|
+
_ChannelEvents_createRegistration.set(this, (actionId) => {
|
|
888
|
+
const callbacks = [];
|
|
889
|
+
let registrationPromise;
|
|
890
|
+
const onChannelAction = (data) => {
|
|
891
|
+
callbacks.forEach((callback) => callback(data));
|
|
892
|
+
};
|
|
893
|
+
return {
|
|
894
|
+
callbacks,
|
|
895
|
+
dispose: async (callback) => {
|
|
896
|
+
const index = callbacks.indexOf(callback);
|
|
897
|
+
if (index >= 0) {
|
|
898
|
+
callbacks.splice(index, 1);
|
|
899
|
+
if (callbacks.length === 0) {
|
|
900
|
+
const client = await __classPrivateFieldGet$2(this, _ChannelEvents_channelClient, "f");
|
|
901
|
+
client.remove(actionId);
|
|
902
|
+
}
|
|
903
|
+
}
|
|
904
|
+
},
|
|
905
|
+
waitForRegistration: async () => {
|
|
906
|
+
// Use lazy eval to only setup and register the channel on first attempt.
|
|
907
|
+
if (!registrationPromise) {
|
|
908
|
+
registrationPromise = (async () => {
|
|
909
|
+
const client = await __classPrivateFieldGet$2(this, _ChannelEvents_channelClient, "f");
|
|
910
|
+
await client.register(actionId, onChannelAction);
|
|
911
|
+
})();
|
|
912
|
+
}
|
|
913
|
+
await registrationPromise;
|
|
914
|
+
}
|
|
915
|
+
};
|
|
916
|
+
});
|
|
917
|
+
_ChannelEvents_getRegistration.set(this, async (actionId) => {
|
|
918
|
+
const actions = await __classPrivateFieldGet$2(this, _ChannelEvents_getActions, "f").call(this);
|
|
919
|
+
return actions[actionId];
|
|
920
|
+
});
|
|
921
|
+
_ChannelEvents_getOrCreateRegistration.set(this, async (actionId) => {
|
|
922
|
+
const actions = await __classPrivateFieldGet$2(this, _ChannelEvents_getActions, "f").call(this);
|
|
923
|
+
const registration = await __classPrivateFieldGet$2(this, _ChannelEvents_getRegistration, "f").call(this, actionId);
|
|
924
|
+
if (!registration) {
|
|
925
|
+
actions[actionId] = __classPrivateFieldGet$2(this, _ChannelEvents_createRegistration, "f").call(this, actionId);
|
|
926
|
+
}
|
|
927
|
+
return actions[actionId];
|
|
928
|
+
});
|
|
929
|
+
/**
|
|
930
|
+
* Add a listener for the given channel action.
|
|
931
|
+
*
|
|
932
|
+
* This will register a handler for the specified channel action if this is the first time we have requested one, or reuse an existing one if it exists.
|
|
933
|
+
*
|
|
934
|
+
* Note, only void channel actions are currently supported.
|
|
935
|
+
*
|
|
936
|
+
* @param action Action ID, must match the underlying channel action.
|
|
937
|
+
* @param callback Callback to be called whenever the action is dispatched.
|
|
938
|
+
*/
|
|
939
|
+
this.addListener = async (action, callback) => {
|
|
940
|
+
const event = await __classPrivateFieldGet$2(this, _ChannelEvents_getOrCreateRegistration, "f").call(this, action);
|
|
941
|
+
event.callbacks.push(callback);
|
|
942
|
+
// This ensures we only resolve the subscription once the action is registered
|
|
943
|
+
await event.waitForRegistration();
|
|
944
|
+
};
|
|
945
|
+
/**
|
|
946
|
+
* Removes a callback associated with a given action if it exists.
|
|
947
|
+
*
|
|
948
|
+
* If this callback is the last one associated with the specified action, the underlying channel action registration is
|
|
949
|
+
* also removed.
|
|
950
|
+
* @param action Action ID to remove
|
|
951
|
+
* @param callback Callback to remove.
|
|
952
|
+
*/
|
|
953
|
+
this.removeListener = async (action, callback) => {
|
|
954
|
+
if (!__classPrivateFieldGet$2(this, _ChannelEvents_isChannelReady, "f")) {
|
|
955
|
+
return;
|
|
956
|
+
}
|
|
957
|
+
const registration = await __classPrivateFieldGet$2(this, _ChannelEvents_getRegistration, "f").call(this, action);
|
|
958
|
+
if (registration) {
|
|
959
|
+
const event = await __classPrivateFieldGet$2(this, _ChannelEvents_getOrCreateRegistration, "f").call(this, action);
|
|
960
|
+
await event.dispose(callback);
|
|
961
|
+
}
|
|
962
|
+
};
|
|
963
|
+
__classPrivateFieldSet$2(this, _ChannelEvents_channelClient, channelClient, "f");
|
|
964
|
+
Promise.resolve(channelClient)
|
|
965
|
+
.then(() => {
|
|
966
|
+
__classPrivateFieldSet$2(this, _ChannelEvents_isChannelReady, true, "f");
|
|
967
|
+
})
|
|
968
|
+
.catch(() => {
|
|
969
|
+
// eslint-disable-next-line
|
|
970
|
+
console.warn('Channel Connection error occurred in channel client. Channel-events registrations will fail.');
|
|
971
|
+
});
|
|
972
|
+
}
|
|
973
|
+
}
|
|
974
|
+
channelEvents.ChannelEvents = ChannelEvents;
|
|
975
|
+
_a = ChannelEvents, _ChannelEvents_channelClient = new WeakMap(), _ChannelEvents_isChannelReady = new WeakMap(), _ChannelEvents_getActions = new WeakMap(), _ChannelEvents_createRegistration = new WeakMap(), _ChannelEvents_getRegistration = new WeakMap(), _ChannelEvents_getOrCreateRegistration = new WeakMap();
|
|
976
|
+
/**
|
|
977
|
+
* Static map of actions by channel client. This ensures we can reuse the same event and keep track of all its callbacks.
|
|
978
|
+
*
|
|
979
|
+
* Weak map will also ensure that when a channel is GC'ed we also tear down the actions/callbacks associated
|
|
980
|
+
* with it.
|
|
981
|
+
*/
|
|
982
|
+
_ChannelEvents_actionsByClient = { value: new WeakMap() };
|
|
983
|
+
|
|
851
984
|
var __classPrivateFieldSet$1 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
852
985
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
853
986
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
@@ -862,12 +995,13 @@ var __classPrivateFieldGet$1 = (commonjsGlobal && commonjsGlobal.__classPrivateF
|
|
|
862
995
|
var __importDefault$1 = (commonjsGlobal && commonjsGlobal.__importDefault) || function (mod) {
|
|
863
996
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
864
997
|
};
|
|
865
|
-
var _InteropClient_clientPromise, _InteropClient_sessionContextGroups, _InteropClient_fdc3Factory;
|
|
998
|
+
var _InteropClient_clientPromise, _InteropClient_sessionContextGroups, _InteropClient_fdc3Factory, _InteropClient_channelEvents;
|
|
866
999
|
Object.defineProperty(InteropClient$1, "__esModule", { value: true });
|
|
867
1000
|
InteropClient$1.InteropClient = void 0;
|
|
868
1001
|
const base_1 = base;
|
|
869
1002
|
const SessionContextGroupClient_1 = __importDefault$1(SessionContextGroupClient$1);
|
|
870
1003
|
const utils_1$3 = utils$2;
|
|
1004
|
+
const channel_events_1 = channelEvents;
|
|
871
1005
|
/**
|
|
872
1006
|
* The Interop Client API is broken up into two groups:
|
|
873
1007
|
*
|
|
@@ -926,13 +1060,43 @@ class InteropClient extends base_1.Base {
|
|
|
926
1060
|
_InteropClient_clientPromise.set(this, void 0);
|
|
927
1061
|
_InteropClient_sessionContextGroups.set(this, void 0);
|
|
928
1062
|
_InteropClient_fdc3Factory.set(this, void 0);
|
|
1063
|
+
_InteropClient_channelEvents.set(this, void 0);
|
|
1064
|
+
/*
|
|
1065
|
+
Client APIs
|
|
1066
|
+
*/
|
|
1067
|
+
/**
|
|
1068
|
+
* `addListener` allows the InteropClient to subscribe to events emitted by the connected InteropBroker.
|
|
1069
|
+
* @param type The event type to subscribe to.
|
|
1070
|
+
* @param listener Callback invoked whenever the event occurs.
|
|
1071
|
+
* @returns Promise resolving with void once the listener is registered.
|
|
1072
|
+
*/
|
|
1073
|
+
this.addListener = async (type, listener) => {
|
|
1074
|
+
try {
|
|
1075
|
+
await __classPrivateFieldGet$1(this, _InteropClient_channelEvents, "f").addListener(type, listener);
|
|
1076
|
+
}
|
|
1077
|
+
catch (error) {
|
|
1078
|
+
throw new Error(`An unexpected error occurred when adding a listener to the event ${type}. \n${error.stack}.`);
|
|
1079
|
+
}
|
|
1080
|
+
};
|
|
1081
|
+
/**
|
|
1082
|
+
* `removeListener` removes a registered event listener.
|
|
1083
|
+
* @param type The event type to subscribe to.
|
|
1084
|
+
* @param listener Callback to be removed.
|
|
1085
|
+
* @returns Promise resolving with void even if no callback was found.
|
|
1086
|
+
*/
|
|
1087
|
+
this.removeListener = async (type, listener) => {
|
|
1088
|
+
try {
|
|
1089
|
+
await __classPrivateFieldGet$1(this, _InteropClient_channelEvents, "f").removeListener(type, listener);
|
|
1090
|
+
}
|
|
1091
|
+
catch (error) {
|
|
1092
|
+
throw new Error(`An unexpected error occurred when removing a listener for the event ${type}. \n${error.stack}.`);
|
|
1093
|
+
}
|
|
1094
|
+
};
|
|
929
1095
|
__classPrivateFieldSet$1(this, _InteropClient_sessionContextGroups, new Map(), "f");
|
|
930
1096
|
__classPrivateFieldSet$1(this, _InteropClient_clientPromise, clientPromise, "f");
|
|
931
1097
|
__classPrivateFieldSet$1(this, _InteropClient_fdc3Factory, fdc3Factory, "f");
|
|
1098
|
+
__classPrivateFieldSet$1(this, _InteropClient_channelEvents, new channel_events_1.ChannelEvents(clientPromise), "f");
|
|
932
1099
|
}
|
|
933
|
-
/*
|
|
934
|
-
Client APIs
|
|
935
|
-
*/
|
|
936
1100
|
/**
|
|
937
1101
|
* Sets a context for the context group of the current entity.
|
|
938
1102
|
*
|
|
@@ -1446,7 +1610,7 @@ class InteropClient extends base_1.Base {
|
|
|
1446
1610
|
}
|
|
1447
1611
|
}
|
|
1448
1612
|
InteropClient$1.InteropClient = InteropClient;
|
|
1449
|
-
_InteropClient_clientPromise = new WeakMap(), _InteropClient_sessionContextGroups = new WeakMap(), _InteropClient_fdc3Factory = new WeakMap();
|
|
1613
|
+
_InteropClient_clientPromise = new WeakMap(), _InteropClient_sessionContextGroups = new WeakMap(), _InteropClient_fdc3Factory = new WeakMap(), _InteropClient_channelEvents = new WeakMap();
|
|
1450
1614
|
|
|
1451
1615
|
var __classPrivateFieldGet = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
1452
1616
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|