@openfin/core 31.74.1 → 31.74.6

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.
Files changed (63) hide show
  1. package/package.json +1 -1
  2. package/src/OpenFin.d.ts +238 -238
  3. package/src/OpenFin.js +0 -2
  4. package/src/api/base.d.ts +2 -2
  5. package/src/api/events/application.d.ts +22 -22
  6. package/src/api/events/base.d.ts +6 -6
  7. package/src/api/events/channel.d.ts +5 -5
  8. package/src/api/events/emitterMap.d.ts +1 -1
  9. package/src/api/events/externalApplication.d.ts +3 -3
  10. package/src/api/events/frame.d.ts +5 -5
  11. package/src/api/events/globalHotkey.d.ts +3 -3
  12. package/src/api/events/platform.d.ts +3 -3
  13. package/src/api/events/system.d.ts +17 -17
  14. package/src/api/events/typedEventEmitter.d.ts +1 -1
  15. package/src/api/events/view.d.ts +13 -13
  16. package/src/api/events/webcontents.d.ts +22 -22
  17. package/src/api/events/window.d.ts +49 -49
  18. package/src/api/fin.d.ts +1 -1
  19. package/src/api/frame/Instance.d.ts +1 -1
  20. package/src/api/interappbus/channel/channel.d.ts +4 -4
  21. package/src/api/interappbus/channel/channel.js +3 -3
  22. package/src/api/interappbus/channel/client.d.ts +2 -2
  23. package/src/api/interappbus/channel/client.js +20 -20
  24. package/src/api/interappbus/channel/connection-manager.d.ts +1 -1
  25. package/src/api/interappbus/channel/connection-manager.js +12 -12
  26. package/src/api/interappbus/channel/index.d.ts +2 -2
  27. package/src/api/interappbus/channel/protocols/classic/strategy.d.ts +1 -1
  28. package/src/api/interappbus/channel/protocols/combined/strategy.d.ts +2 -2
  29. package/src/api/interappbus/channel/protocols/combined/strategy.js +5 -5
  30. package/src/api/interappbus/channel/protocols/index.d.ts +4 -4
  31. package/src/api/interappbus/channel/protocols/rtc/endpoint.d.ts +1 -1
  32. package/src/api/interappbus/channel/protocols/rtc/strategy.d.ts +1 -1
  33. package/src/api/interappbus/channel/protocols/strategy-types.d.ts +4 -4
  34. package/src/api/interappbus/channel/protocols/strategy.d.ts +3 -3
  35. package/src/api/interappbus/channel/provider.d.ts +5 -5
  36. package/src/api/interappbus/channel/provider.js +24 -24
  37. package/src/api/interop/InteropBroker.d.ts +1 -1
  38. package/src/api/interop/fdc3/PrivateChannelClient.d.ts +1 -1
  39. package/src/api/interop/fdc3/PrivateChannelProvider.d.ts +1 -1
  40. package/src/api/interop/fdc3/shapes/fdc3v1.d.ts +3 -3
  41. package/src/api/interop/fdc3/shapes/fdc3v2.d.ts +4 -4
  42. package/src/api/interop/fdc3/versions.d.ts +1 -1
  43. package/src/api/me.d.ts +3 -3
  44. package/src/api/platform/common-utils.d.ts +1 -1
  45. package/src/api/platform/layout/Factory.d.ts +1 -1
  46. package/src/api/platform/layout/Instance.d.ts +3 -3
  47. package/src/api/platform/layout/controllers/splitter-controller.d.ts +1 -1
  48. package/src/api/platform/layout/shapes.d.ts +1 -1
  49. package/src/api/system/index.d.ts +13 -13
  50. package/src/api/view/Instance.d.ts +1 -1
  51. package/src/environment/browser.d.ts +1 -1
  52. package/src/environment/environment.d.ts +1 -1
  53. package/src/environment/node-env.d.ts +1 -1
  54. package/src/environment/openfin-env.d.ts +1 -1
  55. package/src/shapes/ERROR_BOX_TYPES.d.ts +1 -1
  56. package/src/shapes/protocol.d.ts +3 -3
  57. package/src/transport/transport-errors.d.ts +2 -2
  58. package/src/transport/transport.d.ts +3 -3
  59. package/src/transport/wire.d.ts +13 -13
  60. package/src/util/errors.d.ts +2 -2
  61. package/src/util/http.js +4 -2
  62. package/src/util/promises.d.ts +1 -1
  63. package/src/util/utilTypes.d.ts +1 -1
@@ -2,12 +2,12 @@ import type * as OpenFin from '../../OpenFin';
2
2
  import { NamedEvent, PropagatedEvent } from './base';
3
3
  import { PropagatedViewEvent } from './view';
4
4
  import { NonPropagatedWebContentsEvent, WillPropagateWebContentsEvent } from './webcontents';
5
- export declare type AlertRequestedEvent = NamedEvent & {
5
+ export type AlertRequestedEvent = NamedEvent & {
6
6
  type: 'alert-requested';
7
7
  message: string;
8
8
  url: string;
9
9
  };
10
- export declare type AuthRequestedEvent = NamedEvent & {
10
+ export type AuthRequestedEvent = NamedEvent & {
11
11
  type: 'auth-requested';
12
12
  authInfo: {
13
13
  host: string;
@@ -17,56 +17,56 @@ export declare type AuthRequestedEvent = NamedEvent & {
17
17
  scheme: string;
18
18
  };
19
19
  };
20
- export declare type EndLoadEvent = NamedEvent & {
20
+ export type EndLoadEvent = NamedEvent & {
21
21
  type: 'end-load';
22
22
  documentName: string;
23
23
  isMain: boolean;
24
24
  };
25
- export declare type WillRedirectEvent = NamedEvent & {
25
+ export type WillRedirectEvent = NamedEvent & {
26
26
  type: 'will-redirect';
27
27
  blocked: boolean;
28
28
  isInPlace: boolean;
29
29
  url: string;
30
30
  };
31
- export declare type ReloadedEvent = NamedEvent & {
31
+ export type ReloadedEvent = NamedEvent & {
32
32
  type: 'reloaded';
33
33
  url: string;
34
34
  };
35
- export declare type WindowOptionsChangedEvent = NamedEvent & {
35
+ export type WindowOptionsChangedEvent = NamedEvent & {
36
36
  type: 'options-changed';
37
37
  options: OpenFin.WindowOptions;
38
38
  diff: OpenFin.WindowOptionDiff;
39
39
  };
40
- export declare type ExternalProcessExitedEvent = NamedEvent & {
40
+ export type ExternalProcessExitedEvent = NamedEvent & {
41
41
  type: 'external-process-exited';
42
42
  processUuid: string;
43
43
  exitCode: number;
44
44
  };
45
- export declare type ExternalProcessStartedEvent = NamedEvent & {
45
+ export type ExternalProcessStartedEvent = NamedEvent & {
46
46
  type: 'external-process-started';
47
47
  processUuid: string;
48
48
  };
49
- export declare type HiddenEvent = NamedEvent & {
49
+ export type HiddenEvent = NamedEvent & {
50
50
  type: 'hidden';
51
51
  reason: 'closing' | 'hide' | 'hide-on-close';
52
52
  };
53
- export declare type PreloadScriptInfoRunning = {
53
+ export type PreloadScriptInfoRunning = {
54
54
  state: 'load-started' | 'load-failed' | 'load-succeeded' | 'failed' | 'succeeded';
55
55
  };
56
- export declare type PreloadScriptInfo = {
56
+ export type PreloadScriptInfo = {
57
57
  state: 'load-failed' | 'failed' | 'succeeded';
58
58
  };
59
- export declare type PreloadScriptsStateChangeEvent = NamedEvent & {
59
+ export type PreloadScriptsStateChangeEvent = NamedEvent & {
60
60
  preloadScripts: (PreloadScriptInfoRunning & any)[];
61
61
  };
62
- export declare type UserBoundsChangeEvent = NamedEvent & {
62
+ export type UserBoundsChangeEvent = NamedEvent & {
63
63
  height: number;
64
64
  left: number;
65
65
  top: number;
66
66
  width: number;
67
67
  windowState: 'minimized' | 'normal' | 'maximized';
68
68
  };
69
- export declare type BoundsChangeEvent = NamedEvent & {
69
+ export type BoundsChangeEvent = NamedEvent & {
70
70
  changeType: 0 | 1 | 2;
71
71
  deferred: boolean;
72
72
  height: number;
@@ -74,23 +74,23 @@ export declare type BoundsChangeEvent = NamedEvent & {
74
74
  top: number;
75
75
  width: number;
76
76
  };
77
- export declare type WillMoveOrResizeEvent = NamedEvent & {
77
+ export type WillMoveOrResizeEvent = NamedEvent & {
78
78
  height: number;
79
79
  left: number;
80
80
  top: number;
81
81
  width: number;
82
82
  monitorScaleFactor: number;
83
83
  };
84
- export declare type PerformanceReportEvent = Performance & NamedEvent & {
84
+ export type PerformanceReportEvent = Performance & NamedEvent & {
85
85
  type: 'performance-report';
86
86
  };
87
- export declare type ViewDetachedEvent = NamedEvent & {
87
+ export type ViewDetachedEvent = NamedEvent & {
88
88
  type: 'view-detached';
89
89
  previousTarget: OpenFin.Identity;
90
90
  target: OpenFin.Identity;
91
91
  viewIdentity: OpenFin.Identity;
92
92
  };
93
- export declare type InputEvent = {
93
+ export type InputEvent = {
94
94
  inputType: 'keyUp' | 'keyDown';
95
95
  ctrlKey: boolean;
96
96
  shiftKey: boolean;
@@ -104,89 +104,89 @@ export declare type InputEvent = {
104
104
  /**
105
105
  * A Window event that does not propagate to (republish on) parent topics.
106
106
  */
107
- export declare type NonPropagatedWindowEvent = NonPropagatedWebContentsEvent;
108
- export declare type BeginUserBoundsChangingEvent = UserBoundsChangeEvent & {
107
+ export type NonPropagatedWindowEvent = NonPropagatedWebContentsEvent;
108
+ export type BeginUserBoundsChangingEvent = UserBoundsChangeEvent & {
109
109
  type: 'begin-user-bounds-changing';
110
110
  };
111
- export declare type BoundsChangedEvent = BoundsChangeEvent & {
111
+ export type BoundsChangedEvent = BoundsChangeEvent & {
112
112
  type: 'bounds-changed';
113
113
  };
114
- export declare type BoundsChangingEvent = BoundsChangeEvent & {
114
+ export type BoundsChangingEvent = BoundsChangeEvent & {
115
115
  type: 'bounds-changing';
116
116
  };
117
- export declare type WindowCloseRequestedEvent = NamedEvent & {
117
+ export type WindowCloseRequestedEvent = NamedEvent & {
118
118
  type: 'close-requested';
119
119
  };
120
- export declare type WindowClosedEvent = NamedEvent & {
120
+ export type WindowClosedEvent = NamedEvent & {
121
121
  type: 'closed';
122
122
  };
123
- export declare type WindowClosingEvent = NamedEvent & {
123
+ export type WindowClosingEvent = NamedEvent & {
124
124
  type: 'closing';
125
125
  };
126
- export declare type DisabledMovementBoundsChangedEvent = BoundsChangeEvent & {
126
+ export type DisabledMovementBoundsChangedEvent = BoundsChangeEvent & {
127
127
  type: 'disabled-movement-bounds-changed';
128
128
  };
129
- export declare type DisabledMovementBoundsChangingEvent = BoundsChangeEvent & {
129
+ export type DisabledMovementBoundsChangingEvent = BoundsChangeEvent & {
130
130
  type: 'disabled-movement-bounds-changing';
131
131
  };
132
- export declare type EmbeddedEvent = NamedEvent & {
132
+ export type EmbeddedEvent = NamedEvent & {
133
133
  type: 'embedded';
134
134
  };
135
- export declare type EndUserBoundsChangingEvent = UserBoundsChangeEvent & {
135
+ export type EndUserBoundsChangingEvent = UserBoundsChangeEvent & {
136
136
  type: 'end-user-bounds-changing';
137
137
  };
138
- export declare type WindowHotkeyEvent = InputEvent & NamedEvent & {
138
+ export type WindowHotkeyEvent = InputEvent & NamedEvent & {
139
139
  type: 'hotkey';
140
140
  };
141
- export declare type WindowInitializedEvent = NamedEvent & {
141
+ export type WindowInitializedEvent = NamedEvent & {
142
142
  type: 'initialized';
143
143
  };
144
- export declare type LayoutInitializedEvent = NamedEvent & {
144
+ export type LayoutInitializedEvent = NamedEvent & {
145
145
  type: 'layout-initialized';
146
146
  };
147
- export declare type LayoutReadyEvent = NamedEvent & {
147
+ export type LayoutReadyEvent = NamedEvent & {
148
148
  type: 'layout-ready';
149
149
  };
150
- export declare type MaximizedEvent = NamedEvent & {
150
+ export type MaximizedEvent = NamedEvent & {
151
151
  type: 'maximized';
152
152
  };
153
- export declare type MinimizedEvent = NamedEvent & {
153
+ export type MinimizedEvent = NamedEvent & {
154
154
  type: 'minimized';
155
155
  };
156
- export declare type PreloadScriptsStateChangedEvent = PreloadScriptsStateChangeEvent & {
156
+ export type PreloadScriptsStateChangedEvent = PreloadScriptsStateChangeEvent & {
157
157
  type: 'preload-script-state-changed';
158
158
  };
159
- export declare type PreloadScriptsStateChangingEvent = PreloadScriptsStateChangeEvent & {
159
+ export type PreloadScriptsStateChangingEvent = PreloadScriptsStateChangeEvent & {
160
160
  type: 'preload-script-state-changing';
161
161
  };
162
- export declare type WindowRestoredEvent = NamedEvent & {
162
+ export type WindowRestoredEvent = NamedEvent & {
163
163
  type: 'restored';
164
164
  };
165
- export declare type WindowShowRequestedEvent = NamedEvent & {
165
+ export type WindowShowRequestedEvent = NamedEvent & {
166
166
  type: 'show-requested';
167
167
  };
168
- export declare type WindowShownEvent = NamedEvent & {
168
+ export type WindowShownEvent = NamedEvent & {
169
169
  type: 'shown';
170
170
  };
171
- export declare type UserMovementEnabledEvent = NamedEvent & {
171
+ export type UserMovementEnabledEvent = NamedEvent & {
172
172
  type: 'user-movement-enabled';
173
173
  };
174
- export declare type UserMovementDisabledEvent = NamedEvent & {
174
+ export type UserMovementDisabledEvent = NamedEvent & {
175
175
  type: 'user-movement-disabled';
176
176
  };
177
- export declare type WillMoveEvent = WillMoveOrResizeEvent & {
177
+ export type WillMoveEvent = WillMoveOrResizeEvent & {
178
178
  type: 'will-move';
179
179
  };
180
- export declare type WillResizeEvent = WillMoveOrResizeEvent & {
180
+ export type WillResizeEvent = WillMoveOrResizeEvent & {
181
181
  type: 'will-resize';
182
182
  };
183
183
  /**
184
184
  * A Window event that does propagate to (republish on) parent topics.
185
185
  */
186
- export declare type WillPropagateWindowEvent = WillPropagateWebContentsEvent | PropagatedViewEvent | ViewDetachedEvent | AuthRequestedEvent | BeginUserBoundsChangingEvent | BoundsChangedEvent | BoundsChangingEvent | WindowCloseRequestedEvent | WindowClosedEvent | WindowClosingEvent | DisabledMovementBoundsChangedEvent | DisabledMovementBoundsChangingEvent | EmbeddedEvent | EndUserBoundsChangingEvent | ExternalProcessExitedEvent | ExternalProcessStartedEvent | HiddenEvent | WindowHotkeyEvent | WindowInitializedEvent | LayoutInitializedEvent | LayoutReadyEvent | MaximizedEvent | MinimizedEvent | WindowOptionsChangedEvent | PerformanceReportEvent | PreloadScriptsStateChangedEvent | PreloadScriptsStateChangingEvent | ReloadedEvent | WindowRestoredEvent | WindowShowRequestedEvent | WindowShownEvent | UserMovementDisabledEvent | UserMovementEnabledEvent | WillMoveEvent | WillRedirectEvent | WillResizeEvent;
187
- export declare type WindowEvent = {
186
+ export type WillPropagateWindowEvent = WillPropagateWebContentsEvent | PropagatedViewEvent | ViewDetachedEvent | AuthRequestedEvent | BeginUserBoundsChangingEvent | BoundsChangedEvent | BoundsChangingEvent | WindowCloseRequestedEvent | WindowClosedEvent | WindowClosingEvent | DisabledMovementBoundsChangedEvent | DisabledMovementBoundsChangingEvent | EmbeddedEvent | EndUserBoundsChangingEvent | ExternalProcessExitedEvent | ExternalProcessStartedEvent | HiddenEvent | WindowHotkeyEvent | WindowInitializedEvent | LayoutInitializedEvent | LayoutReadyEvent | MaximizedEvent | MinimizedEvent | WindowOptionsChangedEvent | PerformanceReportEvent | PreloadScriptsStateChangedEvent | PreloadScriptsStateChangingEvent | ReloadedEvent | WindowRestoredEvent | WindowShowRequestedEvent | WindowShownEvent | UserMovementDisabledEvent | UserMovementEnabledEvent | WillMoveEvent | WillRedirectEvent | WillResizeEvent;
187
+ export type WindowEvent = {
188
188
  topic: 'window';
189
189
  } & (WillPropagateWindowEvent | NonPropagatedWindowEvent);
190
- export declare type WindowEventType = WindowEvent['type'];
191
- export declare type PropagatedWindowEvent = PropagatedEvent<'window', WillPropagateWindowEvent>;
192
- export declare type PropagatedWindowEventType = PropagatedWindowEvent['type'];
190
+ export type WindowEventType = WindowEvent['type'];
191
+ export type PropagatedWindowEvent = PropagatedEvent<'window', WillPropagateWindowEvent>;
192
+ export type PropagatedWindowEventType = PropagatedWindowEvent['type'];
package/src/api/fin.d.ts CHANGED
@@ -15,7 +15,7 @@ import PlatformModule from './platform/index';
15
15
  import { Me } from './me';
16
16
  import InteropModule from './interop';
17
17
  import SnapshotSourceModule from './snapshot-source';
18
- declare type EntityType = OpenFin.EntityType;
18
+ type EntityType = OpenFin.EntityType;
19
19
  export interface FinApi<MeType extends EntityType> {
20
20
  readonly System: System;
21
21
  readonly Window: _WindowModule;
@@ -1,7 +1,7 @@
1
1
  import type * as OpenFin from '../../OpenFin';
2
2
  import { EmitterBase } from '../base';
3
3
  import { Transport } from '../../transport/transport';
4
- declare type FrameEvents = OpenFin.FrameEvent;
4
+ type FrameEvents = OpenFin.FrameEvent;
5
5
  /**
6
6
  * @classdesc
7
7
  * An iframe represents an embedded HTML page within a parent HTML page. Because this embedded page
@@ -1,9 +1,9 @@
1
1
  import type * as OpenFin from '../../../OpenFin';
2
2
  import { Transport } from '../../../transport/transport';
3
- declare type ProviderIdentity = OpenFin.ProviderIdentity;
4
- declare type ChannelMiddleware = OpenFin.ChannelMiddleware;
5
- declare type ErrorMiddleware = OpenFin.ErrorMiddleware;
6
- declare type ChannelAction = OpenFin.ChannelAction;
3
+ type ProviderIdentity = OpenFin.ProviderIdentity;
4
+ type ChannelMiddleware = OpenFin.ChannelMiddleware;
5
+ type ErrorMiddleware = OpenFin.ErrorMiddleware;
6
+ type ChannelAction = OpenFin.ChannelAction;
7
7
  export declare class ProtectedItems {
8
8
  providerIdentity: ProviderIdentity;
9
9
  wire: Transport;
@@ -13,12 +13,12 @@ class ProtectedItems {
13
13
  }
14
14
  exports.ProtectedItems = ProtectedItems;
15
15
  class ChannelBase {
16
- constructor() {
17
- this.subscriptions = new Map();
18
- }
19
16
  static defaultAction(topic) {
20
17
  throw new Error(`No action registered at target for ${topic}`);
21
18
  }
19
+ constructor() {
20
+ this.subscriptions = new Map();
21
+ }
22
22
  async processAction(topic, payload, senderIdentity) {
23
23
  try {
24
24
  const mainAction = this.subscriptions.has(topic)
@@ -2,8 +2,8 @@ import type * as OpenFin from '../../../OpenFin';
2
2
  import { ChannelBase } from './channel';
3
3
  import { Transport } from '../../../transport/transport';
4
4
  import { AnyStrategy } from './protocols/strategy-types';
5
- declare type ProviderIdentity = OpenFin.ProviderIdentity;
6
- declare type DisconnectionListener = (providerIdentity: ProviderIdentity) => any;
5
+ type ProviderIdentity = OpenFin.ProviderIdentity;
6
+ type DisconnectionListener = (providerIdentity: ProviderIdentity) => any;
7
7
  interface RoutingInfo extends ProviderIdentity {
8
8
  endpointId: string;
9
9
  }
@@ -1,20 +1,35 @@
1
1
  "use strict";
2
+ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
3
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
4
+ 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");
5
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
6
+ };
2
7
  var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
3
8
  if (kind === "m") throw new TypeError("Private method is not writable");
4
9
  if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
5
10
  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");
6
11
  return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
7
12
  };
8
- var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
9
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
10
- 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");
11
- return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
12
- };
13
13
  var _ChannelClient_protectedObj, _ChannelClient_strategy, _ChannelClient_close;
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
15
  const channel_1 = require("./channel");
16
16
  const channelClientsByEndpointId = new Map();
17
17
  class ChannelClient extends channel_1.ChannelBase {
18
+ static closeChannelByEndpointId(id) {
19
+ const channel = channelClientsByEndpointId.get(id);
20
+ if (channel) {
21
+ __classPrivateFieldGet(channel, _ChannelClient_close, "f").call(channel);
22
+ }
23
+ }
24
+ // closes the corresponding channel and invokes the disconnect listener if an event payload is passed.
25
+ static handleProviderDisconnect(eventPayload) {
26
+ for (const channelClient of channelClientsByEndpointId.values()) {
27
+ if (channelClient.providerIdentity.channelId === eventPayload.channelId) {
28
+ channelClient.disconnectListener(eventPayload);
29
+ __classPrivateFieldGet(channelClient, _ChannelClient_close, "f").call(channelClient);
30
+ }
31
+ }
32
+ }
18
33
  constructor(routingInfo, wire, strategy) {
19
34
  super();
20
35
  _ChannelClient_protectedObj.set(this, void 0);
@@ -32,21 +47,6 @@ class ChannelClient extends channel_1.ChannelBase {
32
47
  channelClientsByEndpointId.set(this.endpointId, this);
33
48
  strategy.receive(this.processAction);
34
49
  }
35
- static closeChannelByEndpointId(id) {
36
- const channel = channelClientsByEndpointId.get(id);
37
- if (channel) {
38
- __classPrivateFieldGet(channel, _ChannelClient_close, "f").call(channel);
39
- }
40
- }
41
- // closes the corresponding channel and invokes the disconnect listener if an event payload is passed.
42
- static handleProviderDisconnect(eventPayload) {
43
- for (const channelClient of channelClientsByEndpointId.values()) {
44
- if (channelClient.providerIdentity.channelId === eventPayload.channelId) {
45
- channelClient.disconnectListener(eventPayload);
46
- __classPrivateFieldGet(channelClient, _ChannelClient_close, "f").call(channelClient);
47
- }
48
- }
49
- }
50
50
  get providerIdentity() {
51
51
  const protectedObj = __classPrivateFieldGet(this, _ChannelClient_protectedObj, "f");
52
52
  return protectedObj.providerIdentity;
@@ -6,7 +6,7 @@ import { ClientOffer, LocalSupportedProtocol } from './protocols/index';
6
6
  import { RTCPacket } from './protocols/rtc/endpoint';
7
7
  import { ChannelProvider } from './provider';
8
8
  import { AnyStrategy } from './protocols/strategy-types';
9
- export declare type ProviderEntry = {
9
+ export type ProviderEntry = {
10
10
  provider: ChannelProvider;
11
11
  strategy: AnyStrategy;
12
12
  supportedProtocols: LocalSupportedProtocol[];
@@ -23,6 +23,18 @@ const message_receiver_1 = require("./protocols/classic/message-receiver");
23
23
  const protocol_manager_1 = require("./protocols/protocol-manager");
24
24
  const strategy_3 = require("./protocols/combined/strategy");
25
25
  class ConnectionManager extends base_1.Base {
26
+ static getProtocolOptionsFromStrings(protocols) {
27
+ return protocols.map((protocol) => {
28
+ switch (protocol) {
29
+ case 'rtc':
30
+ return strategy_2.RTCInfo;
31
+ case 'classic':
32
+ return strategy_1.ClassicInfo;
33
+ default:
34
+ return (0, exhaustive_1.exhaustiveCheck)(protocol, ['rtc', 'classic']);
35
+ }
36
+ });
37
+ }
26
38
  constructor(wire) {
27
39
  super(wire);
28
40
  _ConnectionManager_messageReceiver.set(this, void 0);
@@ -43,18 +55,6 @@ class ConnectionManager extends base_1.Base {
43
55
  __classPrivateFieldSet(this, _ConnectionManager_rtcConnectionManager, new ice_manager_1.RTCICEManager(wire), "f");
44
56
  wire.registerMessageHandler(this.onmessage.bind(this));
45
57
  }
46
- static getProtocolOptionsFromStrings(protocols) {
47
- return protocols.map((protocol) => {
48
- switch (protocol) {
49
- case 'rtc':
50
- return strategy_2.RTCInfo;
51
- case 'classic':
52
- return strategy_1.ClassicInfo;
53
- default:
54
- return (0, exhaustive_1.exhaustiveCheck)(protocol, ['rtc', 'classic']);
55
- }
56
- });
57
- }
58
58
  createProvider(options, providerIdentity) {
59
59
  const opts = Object.assign(this.wire.environment.getDefaultChannelOptions().create, options || {});
60
60
  const protocols = this.protocolManager.getProviderProtocols(opts === null || opts === void 0 ? void 0 : opts.protocols);
@@ -4,8 +4,8 @@ import { ChannelProvider } from './provider';
4
4
  import { EmitterBase } from '../../base';
5
5
  import { Transport, Message } from '../../../transport/transport';
6
6
  import { ChannelEvent } from '../../events/channel';
7
- declare type ProviderIdentity = OpenFin.ProviderIdentity;
8
- declare type Identity = OpenFin.Identity;
7
+ type ProviderIdentity = OpenFin.ProviderIdentity;
8
+ type Identity = OpenFin.Identity;
9
9
  export interface ChannelMessage extends Message<any> {
10
10
  senderIdentity: Identity;
11
11
  ackToSender: any;
@@ -3,7 +3,7 @@ import { Transport } from '../../../../../transport/transport';
3
3
  import { MessageReceiver } from './message-receiver';
4
4
  import { ChannelStrategy, EndpointPayload } from '../strategy';
5
5
  import { LocalSupportedProtocol } from '..';
6
- declare type ProviderIdentity = OpenFin.ProviderIdentity;
6
+ type ProviderIdentity = OpenFin.ProviderIdentity;
7
7
  export declare class ClassicStrategy implements ChannelStrategy<EndpointPayload> {
8
8
  #private;
9
9
  private messageReceiver;
@@ -1,8 +1,8 @@
1
1
  import { ChannelStrategy } from '../strategy';
2
- declare type OverlapsOnlyIfMatching<T, U> = {
2
+ type OverlapsOnlyIfMatching<T, U> = {
3
3
  [K in Extract<keyof T, keyof U>]: U[K] extends T[K] ? U[K] : T[K] extends U[K] ? T[K] : never;
4
4
  };
5
- declare type OnlyIfCompatible<A, B, D = OverlapsOnlyIfMatching<A, B>> = D extends Record<any, never> ? keyof D extends never ? A | B : never : A | B;
5
+ type OnlyIfCompatible<A, B, D = OverlapsOnlyIfMatching<A, B>> = D extends Record<any, never> ? keyof D extends never ? A | B : never : A | B;
6
6
  export default class CombinedStrategy<A, B> implements ChannelStrategy<OnlyIfCompatible<A, B>> {
7
7
  private primary;
8
8
  private secondary;
@@ -1,16 +1,16 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  class CombinedStrategy {
4
- // eslint-disable-next-line no-useless-constructor
5
- constructor(primary, secondary) {
6
- this.primary = primary;
7
- this.secondary = secondary;
8
- }
9
4
  // Making this a static method because the constructor can't be typed.
10
5
  // Otherwise it will error when calling addEndpoint but I'd rather the whole instance be typed as never.
11
6
  static combine(a, b) {
12
7
  return new CombinedStrategy(a, b);
13
8
  }
9
+ // eslint-disable-next-line no-useless-constructor
10
+ constructor(primary, secondary) {
11
+ this.primary = primary;
12
+ this.secondary = secondary;
13
+ }
14
14
  onEndpointDisconnect(endpointId, listener) {
15
15
  this.primary.onEndpointDisconnect(endpointId, () => {
16
16
  if (!this.secondary.isEndpointConnected(endpointId)) {
@@ -14,12 +14,12 @@ export interface RTCProtocolOffer extends ProtocolPacketBase {
14
14
  rtcConnectionId: string;
15
15
  };
16
16
  }
17
- export declare type ProtocolOffer = ClassicProtocolOffer | RTCProtocolOffer;
17
+ export type ProtocolOffer = ClassicProtocolOffer | RTCProtocolOffer;
18
18
  /**
19
19
  * Protocol values for determining channel messaging strategy.
20
20
  */
21
- export declare type MessagingProtocols = ProtocolOffer['type'];
22
- export declare type LocalSupportedProtocol = {
21
+ export type MessagingProtocols = ProtocolOffer['type'];
22
+ export type LocalSupportedProtocol = {
23
23
  type: MessagingProtocols;
24
24
  minimumVersion: number;
25
25
  version: number;
@@ -41,7 +41,7 @@ export interface RTCProtocolAnswer extends ProtocolPacketBase {
41
41
  answer: RTCSessionDescriptionInit;
42
42
  };
43
43
  }
44
- export declare type ProtocolAnswer = ClassicProtocolAnswer | RTCProtocolAnswer;
44
+ export type ProtocolAnswer = ClassicProtocolAnswer | RTCProtocolAnswer;
45
45
  export interface ClientAnswer {
46
46
  supportedProtocols: ProtocolAnswer[];
47
47
  }
@@ -1,5 +1,5 @@
1
1
  import type * as OpenFin from '../../../../../OpenFin';
2
- declare type ProviderIdentity = OpenFin.ProviderIdentity;
2
+ type ProviderIdentity = OpenFin.ProviderIdentity;
3
3
  export interface RTCEndpointChannels {
4
4
  request: RTCDataChannel;
5
5
  response: RTCDataChannel;
@@ -2,7 +2,7 @@ import type * as OpenFin from '../../../../../OpenFin';
2
2
  import { ChannelStrategy } from '../strategy';
3
3
  import { RTCPacket } from './endpoint';
4
4
  import { LocalSupportedProtocol } from '..';
5
- declare type ProviderIdentity = OpenFin.ProviderIdentity;
5
+ type ProviderIdentity = OpenFin.ProviderIdentity;
6
6
  export interface RTCStrategyEndpointPayload {
7
7
  endpointIdentity: OpenFin.ClientIdentity | ProviderIdentity;
8
8
  rtc: RTCPacket;
@@ -3,11 +3,11 @@ import { ClassicStrategy } from './classic/strategy';
3
3
  import CombinedStrategy from './combined/strategy';
4
4
  import { RTCStrategy } from './rtc/strategy';
5
5
  import { ChannelStrategy } from './strategy';
6
- declare type StrategyMap = {
6
+ type StrategyMap = {
7
7
  rtc: RTCStrategy;
8
8
  classic: ClassicStrategy;
9
9
  };
10
- export declare type StrategyByProtocol<T extends MessagingProtocols> = StrategyMap[T];
11
- export declare type PayloadTypeByStrategy<T extends ChannelStrategy<unknown>> = T extends ChannelStrategy<infer U> ? U : never;
12
- export declare type AnyStrategy = ClassicStrategy | RTCStrategy | CombinedStrategy<PayloadTypeByStrategy<RTCStrategy>, PayloadTypeByStrategy<ClassicStrategy>>;
10
+ export type StrategyByProtocol<T extends MessagingProtocols> = StrategyMap[T];
11
+ export type PayloadTypeByStrategy<T extends ChannelStrategy<unknown>> = T extends ChannelStrategy<infer U> ? U : never;
12
+ export type AnyStrategy = ClassicStrategy | RTCStrategy | CombinedStrategy<PayloadTypeByStrategy<RTCStrategy>, PayloadTypeByStrategy<ClassicStrategy>>;
13
13
  export {};
@@ -1,5 +1,5 @@
1
1
  import type * as OpenFin from '../../../../OpenFin';
2
- declare type ProviderIdentity = OpenFin.ProviderIdentity;
2
+ type ProviderIdentity = OpenFin.ProviderIdentity;
3
3
  export interface ChannelStrategy<T extends unknown> {
4
4
  onEndpointDisconnect(endpointId: string, listener: () => void): void;
5
5
  receive(listener: (action: string, payload: any, identity: any) => Promise<any>): void;
@@ -10,8 +10,8 @@ export interface ChannelStrategy<T extends unknown> {
10
10
  addEndpoint(endpointId: string, payload: T): void;
11
11
  isValidEndpointPayload(payload: unknown): payload is T;
12
12
  }
13
- export declare type EndpointIdentity = OpenFin.ClientIdentity | ProviderIdentity;
14
- export declare type EndpointPayload = {
13
+ export type EndpointIdentity = OpenFin.ClientIdentity | ProviderIdentity;
14
+ export type EndpointPayload = {
15
15
  endpointIdentity: EndpointIdentity;
16
16
  };
17
17
  export {};
@@ -2,11 +2,11 @@ import type * as OpenFin from '../../../OpenFin';
2
2
  import { ChannelBase } from './channel';
3
3
  import { Transport } from '../../../transport/transport';
4
4
  import { AnyStrategy } from './protocols/strategy-types';
5
- declare type ProviderIdentity = OpenFin.ProviderIdentity;
6
- declare type ClientIdentity = OpenFin.ClientIdentity;
7
- export declare type ConnectionListener = (identity: ClientIdentity, connectionMessage?: any) => Promise<any> | any;
8
- export declare type DisconnectionListener = (identity: ClientIdentity) => any;
9
- declare type ClientConnectionPayload = OpenFin.ClientIdentity & OpenFin.ClientInfo;
5
+ type ProviderIdentity = OpenFin.ProviderIdentity;
6
+ type ClientIdentity = OpenFin.ClientIdentity;
7
+ export type ConnectionListener = (identity: ClientIdentity, connectionMessage?: any) => Promise<any> | any;
8
+ export type DisconnectionListener = (identity: ClientIdentity) => any;
9
+ type ClientConnectionPayload = OpenFin.ClientIdentity & OpenFin.ClientInfo;
10
10
  export declare class ChannelProvider extends ChannelBase {
11
11
  #private;
12
12
  private static removalMap;
@@ -1,21 +1,40 @@
1
1
  "use strict";
2
+ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
3
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
4
+ 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");
5
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
6
+ };
2
7
  var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
3
8
  if (kind === "m") throw new TypeError("Private method is not writable");
4
9
  if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
5
10
  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");
6
11
  return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
7
12
  };
8
- var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
9
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
10
- 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");
11
- return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
12
- };
13
13
  var _ChannelProvider_connections, _ChannelProvider_protectedObj, _ChannelProvider_strategy, _ChannelProvider_removeEndpoint, _ChannelProvider_close;
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
15
  exports.ChannelProvider = void 0;
16
16
  const channel_1 = require("./channel");
17
17
  const runtimeVersioning_1 = require("../../../util/runtimeVersioning");
18
18
  class ChannelProvider extends channel_1.ChannelBase {
19
+ get connections() {
20
+ return [...__classPrivateFieldGet(this, _ChannelProvider_connections, "f")];
21
+ }
22
+ static handleClientDisconnection(channel, payload) {
23
+ const removeById = channel.connections.find((identity) => identity.endpointId === payload.endpointId);
24
+ if (removeById) {
25
+ __classPrivateFieldGet(channel, _ChannelProvider_removeEndpoint, "f").call(channel, removeById);
26
+ }
27
+ else {
28
+ const multipleRemoves = channel.connections.filter((identity) => {
29
+ return identity.uuid === payload.uuid && identity.name === payload.name;
30
+ });
31
+ multipleRemoves.forEach(__classPrivateFieldGet(channel, _ChannelProvider_removeEndpoint, "f"));
32
+ }
33
+ channel.disconnectListener(payload);
34
+ }
35
+ static setProviderRemoval(provider, remove) {
36
+ ChannelProvider.removalMap.set(provider, remove);
37
+ }
19
38
  constructor(providerIdentity, wire, strategy) {
20
39
  super();
21
40
  _ChannelProvider_connections.set(this, void 0);
@@ -51,25 +70,6 @@ class ChannelProvider extends channel_1.ChannelBase {
51
70
  __classPrivateFieldSet(this, _ChannelProvider_strategy, strategy, "f");
52
71
  strategy.receive(this.processAction);
53
72
  }
54
- get connections() {
55
- return [...__classPrivateFieldGet(this, _ChannelProvider_connections, "f")];
56
- }
57
- static handleClientDisconnection(channel, payload) {
58
- const removeById = channel.connections.find((identity) => identity.endpointId === payload.endpointId);
59
- if (removeById) {
60
- __classPrivateFieldGet(channel, _ChannelProvider_removeEndpoint, "f").call(channel, removeById);
61
- }
62
- else {
63
- const multipleRemoves = channel.connections.filter((identity) => {
64
- return identity.uuid === payload.uuid && identity.name === payload.name;
65
- });
66
- multipleRemoves.forEach(__classPrivateFieldGet(channel, _ChannelProvider_removeEndpoint, "f"));
67
- }
68
- channel.disconnectListener(payload);
69
- }
70
- static setProviderRemoval(provider, remove) {
71
- ChannelProvider.removalMap.set(provider, remove);
72
- }
73
73
  dispatch(to, action, payload) {
74
74
  var _a;
75
75
  const endpointId = (_a = to.endpointId) !== null && _a !== void 0 ? _a : this.getEndpointIdForOpenFinId(to, action);
@@ -3,7 +3,7 @@ import { AppIdentifier } from './fdc3/shapes/fdc3v2';
3
3
  import type * as OpenFin from '../../OpenFin';
4
4
  import { Base } from '../base';
5
5
  import type { Transport } from '../../transport/transport';
6
- declare type Identity = OpenFin.Identity;
6
+ type Identity = OpenFin.Identity;
7
7
  /**
8
8
  * {@link https://developers.openfin.co/of-docs/docs/enable-color-linking}
9
9
  *