@openfin/core 34.78.7 → 34.78.8

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/mock.js CHANGED
@@ -2,6 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
+ var require$$0 = require('events');
5
6
  var require$$3 = require('lodash');
6
7
 
7
8
  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
@@ -10,489 +11,253 @@ var mock = {};
10
11
 
11
12
  var OpenFin$1 = {};
12
13
 
13
- Object.defineProperty(OpenFin$1, "__esModule", { value: true });
14
+ var events = {};
14
15
 
15
- var fin = {};
16
-
17
- var eventsExports = {};
18
- var events = {
19
- get exports(){ return eventsExports; },
20
- set exports(v){ eventsExports = v; },
21
- };
22
-
23
- var R = typeof Reflect === 'object' ? Reflect : null;
24
- var ReflectApply = R && typeof R.apply === 'function'
25
- ? R.apply
26
- : function ReflectApply(target, receiver, args) {
27
- return Function.prototype.apply.call(target, receiver, args);
28
- };
29
-
30
- var ReflectOwnKeys;
31
- if (R && typeof R.ownKeys === 'function') {
32
- ReflectOwnKeys = R.ownKeys;
33
- } else if (Object.getOwnPropertySymbols) {
34
- ReflectOwnKeys = function ReflectOwnKeys(target) {
35
- return Object.getOwnPropertyNames(target)
36
- .concat(Object.getOwnPropertySymbols(target));
37
- };
38
- } else {
39
- ReflectOwnKeys = function ReflectOwnKeys(target) {
40
- return Object.getOwnPropertyNames(target);
41
- };
42
- }
43
-
44
- function ProcessEmitWarning(warning) {
45
- if (console && console.warn) console.warn(warning);
46
- }
47
-
48
- var NumberIsNaN = Number.isNaN || function NumberIsNaN(value) {
49
- return value !== value;
50
- };
51
-
52
- function EventEmitter() {
53
- EventEmitter.init.call(this);
54
- }
55
- events.exports = EventEmitter;
56
- eventsExports.once = once;
57
-
58
- // Backwards-compat with node 0.10.x
59
- EventEmitter.EventEmitter = EventEmitter;
60
-
61
- EventEmitter.prototype._events = undefined;
62
- EventEmitter.prototype._eventsCount = 0;
63
- EventEmitter.prototype._maxListeners = undefined;
64
-
65
- // By default EventEmitters will print a warning if more than 10 listeners are
66
- // added to it. This is a useful default which helps finding memory leaks.
67
- var defaultMaxListeners = 10;
68
-
69
- function checkListener(listener) {
70
- if (typeof listener !== 'function') {
71
- throw new TypeError('The "listener" argument must be of type Function. Received type ' + typeof listener);
72
- }
73
- }
74
-
75
- Object.defineProperty(EventEmitter, 'defaultMaxListeners', {
76
- enumerable: true,
77
- get: function() {
78
- return defaultMaxListeners;
79
- },
80
- set: function(arg) {
81
- if (typeof arg !== 'number' || arg < 0 || NumberIsNaN(arg)) {
82
- throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received ' + arg + '.');
83
- }
84
- defaultMaxListeners = arg;
85
- }
86
- });
87
-
88
- EventEmitter.init = function() {
89
-
90
- if (this._events === undefined ||
91
- this._events === Object.getPrototypeOf(this)._events) {
92
- this._events = Object.create(null);
93
- this._eventsCount = 0;
94
- }
95
-
96
- this._maxListeners = this._maxListeners || undefined;
97
- };
98
-
99
- // Obviously not all Emitters should be limited to 10. This function allows
100
- // that to be increased. Set to zero for unlimited.
101
- EventEmitter.prototype.setMaxListeners = function setMaxListeners(n) {
102
- if (typeof n !== 'number' || n < 0 || NumberIsNaN(n)) {
103
- throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received ' + n + '.');
104
- }
105
- this._maxListeners = n;
106
- return this;
107
- };
108
-
109
- function _getMaxListeners(that) {
110
- if (that._maxListeners === undefined)
111
- return EventEmitter.defaultMaxListeners;
112
- return that._maxListeners;
113
- }
114
-
115
- EventEmitter.prototype.getMaxListeners = function getMaxListeners() {
116
- return _getMaxListeners(this);
117
- };
118
-
119
- EventEmitter.prototype.emit = function emit(type) {
120
- var args = [];
121
- for (var i = 1; i < arguments.length; i++) args.push(arguments[i]);
122
- var doError = (type === 'error');
123
-
124
- var events = this._events;
125
- if (events !== undefined)
126
- doError = (doError && events.error === undefined);
127
- else if (!doError)
128
- return false;
129
-
130
- // If there is no 'error' event listener then throw.
131
- if (doError) {
132
- var er;
133
- if (args.length > 0)
134
- er = args[0];
135
- if (er instanceof Error) {
136
- // Note: The comments on the `throw` lines are intentional, they show
137
- // up in Node's output if this results in an unhandled exception.
138
- throw er; // Unhandled 'error' event
139
- }
140
- // At least give some kind of context to the user
141
- var err = new Error('Unhandled error.' + (er ? ' (' + er.message + ')' : ''));
142
- err.context = er;
143
- throw err; // Unhandled 'error' event
144
- }
145
-
146
- var handler = events[type];
147
-
148
- if (handler === undefined)
149
- return false;
150
-
151
- if (typeof handler === 'function') {
152
- ReflectApply(handler, this, args);
153
- } else {
154
- var len = handler.length;
155
- var listeners = arrayClone(handler, len);
156
- for (var i = 0; i < len; ++i)
157
- ReflectApply(listeners[i], this, args);
158
- }
159
-
160
- return true;
161
- };
162
-
163
- function _addListener(target, type, listener, prepend) {
164
- var m;
165
- var events;
166
- var existing;
167
-
168
- checkListener(listener);
169
-
170
- events = target._events;
171
- if (events === undefined) {
172
- events = target._events = Object.create(null);
173
- target._eventsCount = 0;
174
- } else {
175
- // To avoid recursion in the case that type === "newListener"! Before
176
- // adding it to the listeners, first emit "newListener".
177
- if (events.newListener !== undefined) {
178
- target.emit('newListener', type,
179
- listener.listener ? listener.listener : listener);
180
-
181
- // Re-assign `events` because a newListener handler could have caused the
182
- // this._events to be assigned to a new object
183
- events = target._events;
184
- }
185
- existing = events[type];
186
- }
187
-
188
- if (existing === undefined) {
189
- // Optimize the case of one listener. Don't need the extra array object.
190
- existing = events[type] = listener;
191
- ++target._eventsCount;
192
- } else {
193
- if (typeof existing === 'function') {
194
- // Adding the second element, need to change to array.
195
- existing = events[type] =
196
- prepend ? [listener, existing] : [existing, listener];
197
- // If we've already got an array, just append.
198
- } else if (prepend) {
199
- existing.unshift(listener);
200
- } else {
201
- existing.push(listener);
202
- }
203
-
204
- // Check for listener leak
205
- m = _getMaxListeners(target);
206
- if (m > 0 && existing.length > m && !existing.warned) {
207
- existing.warned = true;
208
- // No error code for this since it is a Warning
209
- // eslint-disable-next-line no-restricted-syntax
210
- var w = new Error('Possible EventEmitter memory leak detected. ' +
211
- existing.length + ' ' + String(type) + ' listeners ' +
212
- 'added. Use emitter.setMaxListeners() to ' +
213
- 'increase limit');
214
- w.name = 'MaxListenersExceededWarning';
215
- w.emitter = target;
216
- w.type = type;
217
- w.count = existing.length;
218
- ProcessEmitWarning(w);
219
- }
220
- }
221
-
222
- return target;
223
- }
224
-
225
- EventEmitter.prototype.addListener = function addListener(type, listener) {
226
- return _addListener(this, type, listener, false);
227
- };
228
-
229
- EventEmitter.prototype.on = EventEmitter.prototype.addListener;
230
-
231
- EventEmitter.prototype.prependListener =
232
- function prependListener(type, listener) {
233
- return _addListener(this, type, listener, true);
234
- };
235
-
236
- function onceWrapper() {
237
- if (!this.fired) {
238
- this.target.removeListener(this.type, this.wrapFn);
239
- this.fired = true;
240
- if (arguments.length === 0)
241
- return this.listener.call(this.target);
242
- return this.listener.apply(this.target, arguments);
243
- }
244
- }
16
+ var application$1 = {};
245
17
 
246
- function _onceWrap(target, type, listener) {
247
- var state = { fired: false, wrapFn: undefined, target: target, type: type, listener: listener };
248
- var wrapped = onceWrapper.bind(state);
249
- wrapped.listener = listener;
250
- state.wrapFn = wrapped;
251
- return wrapped;
252
- }
253
-
254
- EventEmitter.prototype.once = function once(type, listener) {
255
- checkListener(listener);
256
- this.on(type, _onceWrap(this, type, listener));
257
- return this;
258
- };
259
-
260
- EventEmitter.prototype.prependOnceListener =
261
- function prependOnceListener(type, listener) {
262
- checkListener(listener);
263
- this.prependListener(type, _onceWrap(this, type, listener));
264
- return this;
265
- };
266
-
267
- // Emits a 'removeListener' event if and only if the listener was removed.
268
- EventEmitter.prototype.removeListener =
269
- function removeListener(type, listener) {
270
- var list, events, position, i, originalListener;
271
-
272
- checkListener(listener);
273
-
274
- events = this._events;
275
- if (events === undefined)
276
- return this;
277
-
278
- list = events[type];
279
- if (list === undefined)
280
- return this;
281
-
282
- if (list === listener || list.listener === listener) {
283
- if (--this._eventsCount === 0)
284
- this._events = Object.create(null);
285
- else {
286
- delete events[type];
287
- if (events.removeListener)
288
- this.emit('removeListener', type, list.listener || listener);
289
- }
290
- } else if (typeof list !== 'function') {
291
- position = -1;
292
-
293
- for (i = list.length - 1; i >= 0; i--) {
294
- if (list[i] === listener || list[i].listener === listener) {
295
- originalListener = list[i].listener;
296
- position = i;
297
- break;
298
- }
299
- }
300
-
301
- if (position < 0)
302
- return this;
303
-
304
- if (position === 0)
305
- list.shift();
306
- else {
307
- spliceOne(list, position);
308
- }
309
-
310
- if (list.length === 1)
311
- events[type] = list[0];
312
-
313
- if (events.removeListener !== undefined)
314
- this.emit('removeListener', type, originalListener || listener);
315
- }
316
-
317
- return this;
318
- };
319
-
320
- EventEmitter.prototype.off = EventEmitter.prototype.removeListener;
321
-
322
- EventEmitter.prototype.removeAllListeners =
323
- function removeAllListeners(type) {
324
- var listeners, events, i;
325
-
326
- events = this._events;
327
- if (events === undefined)
328
- return this;
329
-
330
- // not listening for removeListener, no need to emit
331
- if (events.removeListener === undefined) {
332
- if (arguments.length === 0) {
333
- this._events = Object.create(null);
334
- this._eventsCount = 0;
335
- } else if (events[type] !== undefined) {
336
- if (--this._eventsCount === 0)
337
- this._events = Object.create(null);
338
- else
339
- delete events[type];
340
- }
341
- return this;
342
- }
343
-
344
- // emit removeListener for all listeners on all events
345
- if (arguments.length === 0) {
346
- var keys = Object.keys(events);
347
- var key;
348
- for (i = 0; i < keys.length; ++i) {
349
- key = keys[i];
350
- if (key === 'removeListener') continue;
351
- this.removeAllListeners(key);
352
- }
353
- this.removeAllListeners('removeListener');
354
- this._events = Object.create(null);
355
- this._eventsCount = 0;
356
- return this;
357
- }
18
+ /**
19
+ * Namespace for events that can be emitted by an {@link OpenFin.Application}. Includes events
20
+ * re-propagated from the {@link OpenFin.Window} (and, transitively, {@link OpenFin.View}) level, prefixed with `window-` (and also, if applicable, `view-`).
21
+ * For example, a view's "attached" event will fire as 'window-view-attached' at the application level.
22
+ *
23
+ * Event payloads are documented as interfaces, while algebraic helper types and derived types are documented as type aliases.
24
+ *
25
+ * This namespace contains only payload shapes for events that are unique to `Application`. Events that propagate to `Application` from
26
+ * child {@link OpenFin.Window windows} and {@link OpenFin.View views} are defined in the {@link OpenFin.WindowEvents} and
27
+ * {@link OpenFin.ViewEvents} namespaces. For a list of valid string keys for *all* application events, see {@link Application.on Application.on}.
28
+ *
29
+ * {@link ApplicationSourcedEvent Application-sourced events} (i.e. those that have not propagated from {@link OpenFin.ViewEvents Views}
30
+ * or {@link OpenFin.WindowEvents Windows} re-propagate to {@link OpenFin.SystemEvents System} with their type string prefixed with `application-`.
31
+ * {@link ApplicationWindowEvent Application events that are tied to Windows but do not propagate from them}
32
+ * are propagated to `System` without any type string prefixing.
33
+ *
34
+ * "Requested" events (e.g. {@link RunRequestedEvent}) do not propagate.
35
+ *
36
+ * @packageDocumentation
37
+ */
38
+ Object.defineProperty(application$1, "__esModule", { value: true });
358
39
 
359
- listeners = events[type];
40
+ var base$1 = {};
360
41
 
361
- if (typeof listeners === 'function') {
362
- this.removeListener(type, listeners);
363
- } else if (listeners !== undefined) {
364
- // LIFO order
365
- for (i = listeners.length - 1; i >= 0; i--) {
366
- this.removeListener(type, listeners[i]);
367
- }
368
- }
369
-
370
- return this;
371
- };
42
+ /**
43
+ * Namespace for shared event payloads and utility types common to all event emitters.
44
+ *
45
+ * @packageDocumentation
46
+ */
47
+ Object.defineProperty(base$1, "__esModule", { value: true });
372
48
 
373
- function _listeners(target, type, unwrap) {
374
- var events = target._events;
49
+ var externalApplication$1 = {};
375
50
 
376
- if (events === undefined)
377
- return [];
51
+ /**
52
+ * Namespace for events that can be transmitted by an {@link OpenFin.ExternalApplication}.
53
+ *
54
+ * Event payloads are documented as interfaces, while algebraic helper types and derived types are documented as type aliases.
55
+ *
56
+ * For a list of valid string keys for external application events, see {@link ExternalApplication.on ExternalApplication.on}.
57
+ *
58
+ * @packageDocumentation
59
+ */
60
+ Object.defineProperty(externalApplication$1, "__esModule", { value: true });
378
61
 
379
- var evlistener = events[type];
380
- if (evlistener === undefined)
381
- return [];
62
+ var frame$1 = {};
382
63
 
383
- if (typeof evlistener === 'function')
384
- return unwrap ? [evlistener.listener || evlistener] : [evlistener];
64
+ Object.defineProperty(frame$1, "__esModule", { value: true });
385
65
 
386
- return unwrap ?
387
- unwrapListeners(evlistener) : arrayClone(evlistener, evlistener.length);
388
- }
66
+ var globalHotkey$1 = {};
389
67
 
390
- EventEmitter.prototype.listeners = function listeners(type) {
391
- return _listeners(this, type, true);
392
- };
68
+ Object.defineProperty(globalHotkey$1, "__esModule", { value: true });
393
69
 
394
- EventEmitter.prototype.rawListeners = function rawListeners(type) {
395
- return _listeners(this, type, false);
396
- };
70
+ var platform$1 = {};
397
71
 
398
- EventEmitter.listenerCount = function(emitter, type) {
399
- if (typeof emitter.listenerCount === 'function') {
400
- return emitter.listenerCount(type);
401
- } else {
402
- return listenerCount.call(emitter, type);
403
- }
404
- };
405
-
406
- EventEmitter.prototype.listenerCount = listenerCount;
407
- function listenerCount(type) {
408
- var events = this._events;
72
+ /**
73
+ *
74
+ * Namespace for events that can emitted by a {@link OpenFin.Platform}.
75
+ *
76
+ * Event payloads are documented as interfaces, while algebraic helper types and derived types are documented as type aliases.
77
+ *
78
+ * The Platform `EventEmitter` is a superset of the {@link OpenFin.Application} `EventEmitter`,
79
+ * meaning it can listen to all {@link OpenFin.ApplicationEvents Application events} in addition to the
80
+ * Platform-specific events listed here. For a list of valid string keys for *all* platform events, see
81
+ * {@link Platform.on Platform.on}.
82
+ *
83
+ * @packageDocumentation
84
+ */
85
+ Object.defineProperty(platform$1, "__esModule", { value: true });
409
86
 
410
- if (events !== undefined) {
411
- var evlistener = events[type];
87
+ var system$1 = {};
412
88
 
413
- if (typeof evlistener === 'function') {
414
- return 1;
415
- } else if (evlistener !== undefined) {
416
- return evlistener.length;
417
- }
418
- }
89
+ /**
90
+ * Namespace for runtime-wide OpenFin events emitted by {@link System.System}. Includes events
91
+ * re-propagated from {@link OpenFin.Application}, {@link OpenFin.Window}, and {@link OpenFin.View} (prefixed with `application-`, `window-`, and `view-`). All
92
+ * event propagations are visible at the System level. Propagated events from WebContents (windows, views, frames) to the Application level will *not*
93
+ * transitively re-propagate to the System level, because they are already visible at the system level and contain the identity
94
+ * of the application. For example, an application's "closed" event will fire as 'application-closed' at the system level. A view's 'shown' event
95
+ * will be visible as 'view-shown' at the system level, but *not* as `application-window-view-shown`.
96
+ *
97
+ * Event payloads are documented as interfaces, while algebraic helper types and derived types are documented as type aliases.
98
+ *
99
+ * This namespace contains only payload shapes for events that are unique to `System`. Events that propagate to `System` from
100
+ * child {@link OpenFin.Application applications}, {@link OpenFin.Window windows}, and {@link OpenFin.View views} are defined in the
101
+ * {@link OpenFin.ApplicationEvents}, {@link OpenFin.WindowEvents}, and {@link OpenFin.ViewEvents} namespaces. For a list of valid string keys for *all*
102
+ * system events, see {@link System.on System.on}.
103
+ *
104
+ * @packageDocumentation
105
+ */
106
+ Object.defineProperty(system$1, "__esModule", { value: true });
419
107
 
420
- return 0;
421
- }
108
+ var view$1 = {};
422
109
 
423
- EventEmitter.prototype.eventNames = function eventNames() {
424
- return this._eventsCount > 0 ? ReflectOwnKeys(this._events) : [];
425
- };
110
+ /**
111
+ * Namespace for events that can be emitted by a {@link OpenFin.View}.
112
+ *
113
+ * Event payloads are documented as interfaces, while algebraic helper types and derived types are documented as type aliases.
114
+ *
115
+ * This namespace contains only payload shapes for events that are unique to `View`. Events that are shared between all `WebContents`
116
+ * (i.e. {@link OpenFin.Window}, {@link OpenFin.View}) are defined in {@link OpenFin.WebContentsEvents}. For a list
117
+ * of valid string keys for *all* View events, see {@link View.on View.on}.
118
+ *
119
+ * View events propagate to their parent {@link OpenFin.WindowEvents Window}, {@link OpenFin.ApplicationEvents Application},
120
+ * and {@link OpenFin.SystemEvents System} with an added `viewIdentity` property and their event types prefixed with `'view-'`.
121
+ *
122
+ * @packageDocumentation
123
+ */
124
+ Object.defineProperty(view$1, "__esModule", { value: true });
426
125
 
427
- function arrayClone(arr, n) {
428
- var copy = new Array(n);
429
- for (var i = 0; i < n; ++i)
430
- copy[i] = arr[i];
431
- return copy;
432
- }
126
+ var webcontents = {};
433
127
 
434
- function spliceOne(list, index) {
435
- for (; index + 1 < list.length; index++)
436
- list[index] = list[index + 1];
437
- list.pop();
438
- }
128
+ /**
129
+ * Namespace for events shared by all OpenFin WebContents elements (i.e. {@link OpenFin.Window},
130
+ * {@link OpenFin.View}).
131
+ *
132
+ * WebContents events are divided into two groups: {@link WillPropagateWebContentsEvent} and {@link NonPropagatedWebContentsEvent}. Propagating events
133
+ * will re-emit on parent entities - e.g., a propagating event in a view will also be emitted on the view's
134
+ * parent window, and propagating events in a window will also be emitted on the window's parent {@link OpenFin.Application}.
135
+ *
136
+ * Non-propagating events will not re-emit on parent entities.
137
+ *
138
+ * @packageDocumentation
139
+ */
140
+ Object.defineProperty(webcontents, "__esModule", { value: true });
439
141
 
440
- function unwrapListeners(arr) {
441
- var ret = new Array(arr.length);
442
- for (var i = 0; i < ret.length; ++i) {
443
- ret[i] = arr[i].listener || arr[i];
444
- }
445
- return ret;
446
- }
142
+ var window$2 = {};
447
143
 
448
- function once(emitter, name) {
449
- return new Promise(function (resolve, reject) {
450
- function errorListener(err) {
451
- emitter.removeListener(name, resolver);
452
- reject(err);
453
- }
144
+ /**
145
+ * Namespace for events that can be emitted by a {@link OpenFin.Window}.
146
+ *
147
+ * Event payloads are documented as interfaces, while algebraic helper types and derived types are documented as type aliases.
148
+ *
149
+ * This namespace contains only payload shapes for events that are unique to `Window`. Events that are shared between all `WebContents`
150
+ * (i.e. {@link OpenFin.Window}, {@link OpenFin.View}) are defined in {@link OpenFin.WebContentsEvents}. Events that
151
+ * propagate from `View` are defined in {@link OpenFin.ViewEvents}. For a list of valid string keys for *all* Window events, see
152
+ * {@link Window.on Window.on}
153
+ *
154
+ * {@link OpenFin.WindowEvents.WindowSourcedEvent Window-sourced events} (i.e. those that are not propagated from a
155
+ * {@link OpenFin.ViewEvents View}) propagate to their parent {@link OpenFin.ApplicationEvents Application} and
156
+ * {@link OpenFin.SystemEvents System} with their event types prefixed with `'window-'`).
157
+ *
158
+ * "Requested" events (e.g. {@link AuthRequestedEvent}) do not propagate to `System. The {@link OpenFin.WindowEvents.WindowCloseRequestedEvent}
159
+ * does not propagate at all.
160
+ *
161
+ * @packageDocumentation
162
+ */
163
+ Object.defineProperty(window$2, "__esModule", { value: true });
454
164
 
455
- function resolver() {
456
- if (typeof emitter.removeListener === 'function') {
457
- emitter.removeListener('error', errorListener);
458
- }
459
- resolve([].slice.call(arguments));
460
- }
461
- eventTargetAgnosticAddListener(emitter, name, resolver, { once: true });
462
- if (name !== 'error') {
463
- addErrorHandlerIfEventEmitter(emitter, errorListener, { once: true });
464
- }
465
- });
466
- }
165
+ /**
166
+ * Namespace for OpenFin event types. Each entity that emits OpenFin events has its own sub-namespace. Event payloads
167
+ * themselves are documented as interfaces, while algebraic helper types and derived types are documented as type aliases.
168
+ *
169
+ * #### Event emitters
170
+ *
171
+ * The following entities emit OpenFin events, and have corresponding sub-namespaces:
172
+ *
173
+ * * {@link OpenFin.Application}: {@link OpenFin.ApplicationEvents}
174
+ * * {@link OpenFin.ExternalApplication}: {@link OpenFin.ExternalApplicationEvents}
175
+ * * {@link OpenFin.Frame}: {@link OpenFin.FrameEvents}
176
+ * * {@link OpenFin.GlobalHotkey}: {@link OpenFin.GlobalHotkeyEvents}
177
+ * * {@link OpenFin.Platform}: {@link OpenFin.PlatformEvents}
178
+ * * {@link OpenFin.System}: {@link OpenFin.SystemEvents}
179
+ * * {@link OpenFin.View}: {@link OpenFin.ViewEvents}
180
+ * * {@link OpenFin.Window}: {@link OpenFin.WindowEvents}
181
+ *
182
+ * These `EventEmitter` entities share a common set of methods for interacting with the OpenFin event bus, which can be
183
+ * seen on the individual documentation pages for each entity type.
184
+ *
185
+ * Registering event handlers is an asynchronous operation. It is important to ensure that the returned Promises are awaited to reduce the
186
+ * risk of race conditions.
187
+ *
188
+ * When the `EventEmitter` receives an event from the browser process and emits on the renderer, all of the functions attached to that
189
+ * specific event are called synchronously. Any values returned by the called listeners are ignored and will be discarded. If the window document
190
+ * is destroyed by page navigation or reload, its registered event listeners will be removed.
191
+ *
192
+ * We recommend using Arrow Functions for event listeners to ensure the this scope is consistent with the original function context.
193
+ *
194
+ * Events re-propagate from smaller/more-local scopes to larger/more-global scopes. For example, an event emitted on a specific
195
+ * view will propagate to the window in which the view is embedded, and then to the application in which the window is running, and
196
+ * finally to the OpenFin runtime itself at the "system" level. For details on propagation semantics, see the namespace for
197
+ * the propagating (or propagated-to) entity.
198
+ *
199
+ * If you need the payload type for a specific type of event (especially propagated events), use the emitting topic's `Payload` generic
200
+ * (e.g. {@link WindowEvents.Payload}) with the event's `type` string. For example, the payload of
201
+ * a {@link ViewEvents.CreatedEvent} after it has propagated to its parent {@link WindowEvents Window} can be found with
202
+ * `WindowEvents.Payload<'view-created'>`.
203
+ *
204
+ * @packageDocumentation
205
+ */
206
+ Object.defineProperty(events, "__esModule", { value: true });
207
+ events.WindowEvents = events.WebContentsEvents = events.ViewEvents = events.SystemEvents = events.PlatformEvents = events.GlobalHotkeyEvents = events.FrameEvents = events.ExternalApplicationEvents = events.BaseEvents = events.ApplicationEvents = void 0;
208
+ const ApplicationEvents = application$1;
209
+ events.ApplicationEvents = ApplicationEvents;
210
+ const BaseEvents = base$1;
211
+ events.BaseEvents = BaseEvents;
212
+ const ExternalApplicationEvents = externalApplication$1;
213
+ events.ExternalApplicationEvents = ExternalApplicationEvents;
214
+ const FrameEvents = frame$1;
215
+ events.FrameEvents = FrameEvents;
216
+ const GlobalHotkeyEvents = globalHotkey$1;
217
+ events.GlobalHotkeyEvents = GlobalHotkeyEvents;
218
+ const PlatformEvents = platform$1;
219
+ events.PlatformEvents = PlatformEvents;
220
+ const SystemEvents = system$1;
221
+ events.SystemEvents = SystemEvents;
222
+ const ViewEvents = view$1;
223
+ events.ViewEvents = ViewEvents;
224
+ const WebContentsEvents = webcontents;
225
+ events.WebContentsEvents = WebContentsEvents;
226
+ const WindowEvents = window$2;
227
+ events.WindowEvents = WindowEvents;
467
228
 
468
- function addErrorHandlerIfEventEmitter(emitter, handler, flags) {
469
- if (typeof emitter.on === 'function') {
470
- eventTargetAgnosticAddListener(emitter, 'error', handler, flags);
471
- }
472
- }
229
+ (function (exports) {
230
+ /**
231
+ * Top-level namespace for types referenced by the OpenFin API. Contains:
232
+ *
233
+ * * The type of the global `fin` entry point ({@link FinApi})
234
+ * * Classes that act as static namespaces returned from the `fin` global (e.g. {@link ApplicationModule}, accessible via `fin.Application`)
235
+ * * Instance classes that are returned from API calls (e.g. {@link Application}, accessible via `fin.Application.getCurrentSync()`)
236
+ * * Parameter shapes for API methods (e.g. {@link ApplicationOptions}, used in `fin.Application.start()`)
237
+ * * Event namespaces and payload union types (e.g. {@link ApplicationEvents} and {@link ApplicationEvent})
238
+ *
239
+ * @packageDocumentation
240
+ */
241
+ var __createBinding = (commonjsGlobal && commonjsGlobal.__createBinding) || (Object.create ? (function(o, m, k, k2) {
242
+ if (k2 === undefined) k2 = k;
243
+ var desc = Object.getOwnPropertyDescriptor(m, k);
244
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
245
+ desc = { enumerable: true, get: function() { return m[k]; } };
246
+ }
247
+ Object.defineProperty(o, k2, desc);
248
+ }) : (function(o, m, k, k2) {
249
+ if (k2 === undefined) k2 = k;
250
+ o[k2] = m[k];
251
+ }));
252
+ var __exportStar = (commonjsGlobal && commonjsGlobal.__exportStar) || function(m, exports) {
253
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
254
+ };
255
+ Object.defineProperty(exports, "__esModule", { value: true });
256
+ // Deprecated shim to preserve v30 namespace names
257
+ __exportStar(events, exports);
258
+ } (OpenFin$1));
473
259
 
474
- function eventTargetAgnosticAddListener(emitter, name, listener, flags) {
475
- if (typeof emitter.on === 'function') {
476
- if (flags.once) {
477
- emitter.once(name, listener);
478
- } else {
479
- emitter.on(name, listener);
480
- }
481
- } else if (typeof emitter.addEventListener === 'function') {
482
- // EventTarget does not have `error` event semantics like Node
483
- // EventEmitters, we do not listen for `error` events here.
484
- emitter.addEventListener(name, function wrapListener(arg) {
485
- // IE does not have builtin `{ once: true }` support so we
486
- // have to do it manually.
487
- if (flags.once) {
488
- emitter.removeEventListener(name, wrapListener);
489
- }
490
- listener(arg);
491
- });
492
- } else {
493
- throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type ' + typeof emitter);
494
- }
495
- }
260
+ var fin = {};
496
261
 
497
262
  var system = {};
498
263
 
@@ -561,6 +326,13 @@ class Base {
561
326
  get fin() {
562
327
  return this.wire.getFin();
563
328
  }
329
+ /**
330
+ * Provides access to the OpenFin representation of the current code context (usually a document
331
+ * such as a {@link OpenFin.View} or {@link OpenFin.Window}), as well as to the current `Interop` context.
332
+ *
333
+ * Useful for debugging in the devtools console, where this will intelligently type itself based
334
+ * on the context in which the devtools panel was opened.
335
+ */
564
336
  get me() {
565
337
  return this.wire.me;
566
338
  }
@@ -595,6 +367,9 @@ class EmitterBase extends Base {
595
367
  this.topic = topic;
596
368
  _EmitterBase_emitterAccessor.set(this, void 0);
597
369
  this.eventNames = () => (this.hasEmitter() ? this.getOrCreateEmitter().eventNames() : []);
370
+ /**
371
+ * @internal
372
+ */
598
373
  this.emit = (eventType, payload, ...args) => {
599
374
  return this.hasEmitter() ? this.getOrCreateEmitter().emit(eventType, payload, ...args) : false;
600
375
  };
@@ -637,16 +412,13 @@ class EmitterBase extends Base {
637
412
  // This will only be reached if unsubscribe from event that does not exist but do not want to error here
638
413
  return Promise.resolve();
639
414
  };
640
- this.addListener = this.on;
641
415
  __classPrivateFieldSet$d(this, _EmitterBase_emitterAccessor, [topic, ...additionalAccessors], "f");
642
416
  this.listeners = (event) => this.hasEmitter() ? this.getOrCreateEmitter().listeners(event) : [];
643
417
  }
644
418
  /**
645
419
  * Adds a listener to the end of the listeners array for the specified event.
646
420
  *
647
- * @param eventType
648
- * @param listener
649
- * @param options
421
+ * @remarks Event payloads are documented in the {@link OpenFin.Events} namespace.
650
422
  */
651
423
  async on(eventType, listener, options) {
652
424
  await this.registerEventListener(eventType, options, (emitter) => {
@@ -656,12 +428,16 @@ class EmitterBase extends Base {
656
428
  });
657
429
  return this;
658
430
  }
431
+ /**
432
+ * Adds a listener to the end of the listeners array for the specified event.
433
+ */
434
+ async addListener(eventType, listener, options) {
435
+ return this.on(eventType, listener, options);
436
+ }
659
437
  /**
660
438
  * Adds a one time listener for the event. The listener is invoked only the first time the event is fired, after which it is removed.
661
439
  *
662
- * @param eventType
663
- * @param listener
664
- * @param options
440
+ * @remarks Event payloads are documented in the {@link OpenFin.Events} namespace.
665
441
  */
666
442
  async once(eventType, listener, options) {
667
443
  const deregister = () => this.deregisterEventListener(eventType);
@@ -677,9 +453,7 @@ class EmitterBase extends Base {
677
453
  /**
678
454
  * Adds a listener to the beginning of the listeners array for the specified event.
679
455
  *
680
- * @param eventType
681
- * @param listener
682
- * @param options
456
+ * @remarks Event payloads are documented in the {@link OpenFin.Events} namespace.
683
457
  */
684
458
  async prependListener(eventType, listener, options) {
685
459
  await this.registerEventListener(eventType, options, (emitter) => {
@@ -693,9 +467,7 @@ class EmitterBase extends Base {
693
467
  * Adds a one time listener for the event. The listener is invoked only the first time the event is fired,
694
468
  * after which it is removed. The listener is added to the beginning of the listeners array.
695
469
  *
696
- * @param eventType
697
- * @param listener
698
- * @param options
470
+ * @remarks Event payloads are documented in the {@link OpenFin.Events} namespace.
699
471
  */
700
472
  async prependOnceListener(eventType, listener, options) {
701
473
  const deregister = () => this.deregisterEventListener(eventType);
@@ -712,10 +484,6 @@ class EmitterBase extends Base {
712
484
  * Remove a listener from the listener array for the specified event.
713
485
  *
714
486
  * @remarks Caution: Calling this method changes the array indices in the listener array behind the listener.
715
- *
716
- * @param eventType
717
- * @param listener
718
- * @param options
719
487
  */
720
488
  async removeListener(eventType, listener, options) {
721
489
  const emitter = await this.deregisterEventListener(eventType, options);
@@ -742,7 +510,6 @@ class EmitterBase extends Base {
742
510
  /**
743
511
  * Removes all listeners, or those of the specified event.
744
512
  *
745
- * @param eventType
746
513
  */
747
514
  async removeAllListeners(eventType) {
748
515
  const removeByEvent = async (event) => {
@@ -804,7 +571,7 @@ class InternalError extends Error {
804
571
  const { message, name, stack, ...rest } = err;
805
572
  super(message);
806
573
  this.name = name || 'Error';
807
- this.stack = stack !== null && stack !== void 0 ? stack : this.toString();
574
+ this.stack = stack ?? this.toString();
808
575
  Object.keys(rest).forEach(key => {
809
576
  this[key] = rest[key];
810
577
  });
@@ -813,7 +580,6 @@ class InternalError extends Error {
813
580
  // For documentation of the error methods being used see here: https://v8.dev/docs/stack-trace-api
814
581
  class RuntimeError extends Error {
815
582
  static getCallSite(callsToRemove = 0) {
816
- var _a, _b;
817
583
  const length = Error.stackTraceLimit;
818
584
  const realCallsToRemove = callsToRemove + 1; // remove this call;
819
585
  Error.stackTraceLimit = length + realCallsToRemove;
@@ -822,7 +588,7 @@ class RuntimeError extends Error {
822
588
  // This will be called when we access the `stack` property
823
589
  Error.prepareStackTrace = (_, stack) => stack;
824
590
  // stack is optional in non chromium contexts
825
- const stack = (_b = (_a = new Error().stack) === null || _a === void 0 ? void 0 : _a.slice(realCallsToRemove)) !== null && _b !== void 0 ? _b : [];
591
+ const stack = new Error().stack?.slice(realCallsToRemove) ?? [];
826
592
  Error.prepareStackTrace = _prepareStackTrace;
827
593
  Error.stackTraceLimit = length;
828
594
  return stack;
@@ -844,7 +610,7 @@ class RuntimeError extends Error {
844
610
  const { reason, error } = payload;
845
611
  super(reason);
846
612
  this.name = 'RuntimeError';
847
- if (error === null || error === void 0 ? void 0 : error.stack) {
613
+ if (error?.stack) {
848
614
  this.cause = new InternalError(error);
849
615
  }
850
616
  if (callSites) {
@@ -883,6 +649,20 @@ var view = {};
883
649
 
884
650
  var Factory$6 = {};
885
651
 
652
+ var warnings = {};
653
+
654
+ Object.defineProperty(warnings, "__esModule", { value: true });
655
+ warnings.handleDeprecatedWarnings = void 0;
656
+ const handleDeprecatedWarnings = (options) => {
657
+ if (options.contentNavigation?.whitelist ||
658
+ options.contentNavigation?.blacklist ||
659
+ options.contentRedirect?.whitelist ||
660
+ options.contentRedirect?.blacklist) {
661
+ console.warn(`The properties 'whitelist' and 'blacklist' have been marked as deprecated and will be removed in a future version. Please use 'allowlist' and 'denylist'.`);
662
+ }
663
+ };
664
+ warnings.handleDeprecatedWarnings = handleDeprecatedWarnings;
665
+
886
666
  var hasRequiredFactory$3;
887
667
 
888
668
  function requireFactory$3 () {
@@ -893,6 +673,10 @@ function requireFactory$3 () {
893
673
  const base_1 = base;
894
674
  const validate_1 = validate;
895
675
  const index_1 = requireView();
676
+ const warnings_1 = warnings;
677
+ /**
678
+ * Static namespace for OpenFin API methods that interact with the {@link View} class, available under `fin.View`.
679
+ */
896
680
  class ViewModule extends base_1.Base {
897
681
  /**
898
682
  * Creates a new View.
@@ -927,6 +711,7 @@ function requireFactory$3 () {
927
711
  if (!options.name || typeof options.name !== 'string') {
928
712
  throw new Error('Please provide a name property as a string in order to create a View.');
929
713
  }
714
+ (0, warnings_1.handleDeprecatedWarnings)(options);
930
715
  if (this.wire.environment.childViews) {
931
716
  await this.wire.environment.createChildContent({
932
717
  entityType: 'view',
@@ -1214,7 +999,7 @@ class ChannelsExposer {
1214
999
  this.exposeFunction = async (target, config) => {
1215
1000
  const { key, options, meta } = config;
1216
1001
  const { id } = meta;
1217
- const action = `${id}.${(options === null || options === void 0 ? void 0 : options.action) || key}`;
1002
+ const action = `${id}.${options?.action || key}`;
1218
1003
  await this.channelProviderOrClient.register(action, async ({ args }) => {
1219
1004
  return target(...args);
1220
1005
  });
@@ -1245,7 +1030,7 @@ channelsExposer.ChannelsExposer = ChannelsExposer;
1245
1030
  };
1246
1031
  Object.defineProperty(exports, "__esModule", { value: true });
1247
1032
  __exportStar(channelsConsumer, exports);
1248
- __exportStar(channelsExposer, exports);
1033
+ __exportStar(channelsExposer, exports);
1249
1034
  } (openfinChannels));
1250
1035
 
1251
1036
  (function (exports) {
@@ -1264,7 +1049,7 @@ channelsExposer.ChannelsExposer = ChannelsExposer;
1264
1049
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
1265
1050
  };
1266
1051
  Object.defineProperty(exports, "__esModule", { value: true });
1267
- __exportStar(openfinChannels, exports);
1052
+ __exportStar(openfinChannels, exports);
1268
1053
  } (strategies));
1269
1054
 
1270
1055
  (function (exports) {
@@ -1286,7 +1071,7 @@ channelsExposer.ChannelsExposer = ChannelsExposer;
1286
1071
  __exportStar(apiConsumer, exports);
1287
1072
  __exportStar(apiExposer, exports);
1288
1073
  __exportStar(strategies, exports);
1289
- __exportStar(decorators, exports);
1074
+ __exportStar(decorators, exports);
1290
1075
  } (apiExposer$1));
1291
1076
 
1292
1077
  var channelApiRelay = {};
@@ -1527,14 +1312,14 @@ _LayoutNode_client = new WeakMap();
1527
1312
  /**
1528
1313
  * @ignore
1529
1314
  * @internal
1530
- * Encapsulates Api consumption of {@link LayoutEntitiesController} with a relayed dispatch
1315
+ * Encapsulates Api consumption of {@link LayoutEntitiesClient} with a relayed dispatch
1531
1316
  * @param client
1532
1317
  * @param controllerId
1533
1318
  * @param identity
1534
1319
  * @returns a new instance of {@link LayoutEntitiesClient} with bound to the controllerId
1535
1320
  */
1536
1321
  LayoutNode.newLayoutEntitiesClient = async (client, controllerId, identity) => {
1537
- const dispatch = (0, channel_api_relay_1.createRelayedDispatch)(client, identity, 'layout-relay', 'You are trying to interact with a layout component on a window that has been destroyed.');
1322
+ const dispatch = (0, channel_api_relay_1.createRelayedDispatch)(client, identity, 'layout-relay', 'You are trying to interact with a layout component on a window that does not exist or has been destroyed.');
1538
1323
  const consumer = new api_exposer_1.ApiConsumer(new api_exposer_1.ChannelsConsumer({ dispatch }));
1539
1324
  return consumer.consume({ id: controllerId });
1540
1325
  };
@@ -1844,8 +1629,9 @@ _ColumnOrRow_client = new WeakMap();
1844
1629
  var layout_constants = {};
1845
1630
 
1846
1631
  Object.defineProperty(layout_constants, "__esModule", { value: true });
1847
- layout_constants.LAYOUT_CONTROLLER_ID = void 0;
1632
+ layout_constants.DEFAULT_LAYOUT_KEY = layout_constants.LAYOUT_CONTROLLER_ID = void 0;
1848
1633
  layout_constants.LAYOUT_CONTROLLER_ID = 'layout-entities';
1634
+ layout_constants.DEFAULT_LAYOUT_KEY = 'default';
1849
1635
 
1850
1636
  var main = {};
1851
1637
 
@@ -1853,6 +1639,10 @@ Object.defineProperty(main, "__esModule", { value: true });
1853
1639
  main.WebContents = void 0;
1854
1640
  const base_1$k = base;
1855
1641
  class WebContents extends base_1$k.EmitterBase {
1642
+ /**
1643
+ * @param identity The identity of the {@link OpenFin.WebContentsEvents WebContents}.
1644
+ * @param entityType The type of the {@link OpenFin.WebContentsEvents WebContents}.
1645
+ */
1856
1646
  constructor(wire, identity, entityType) {
1857
1647
  super(wire, entityType, identity.uuid, identity.name);
1858
1648
  this.identity = identity;
@@ -1905,6 +1695,11 @@ class WebContents extends base_1$k.EmitterBase {
1905
1695
  * }
1906
1696
  * console.log(await wnd.capturePage(options));
1907
1697
  * ```
1698
+ *
1699
+ * @remarks
1700
+ * `WebContents` refers to shared functionality between {@link OpenFin.Window} and {@link OpenFin.View}.
1701
+ * We do not expose an explicit superclass for this functionality, but it does have its own
1702
+ * {@link OpenFin.WebContentsEvents event namespace}.
1908
1703
  */
1909
1704
  capturePage(options) {
1910
1705
  return this.wire.sendAction('capture-page', { options, ...this.identity }).then(({ payload }) => payload.data);
@@ -1940,6 +1735,10 @@ class WebContents extends base_1$k.EmitterBase {
1940
1735
  *
1941
1736
  * executeJavaScript(`console.log('Hello, Openfin')`).then(() => console.log('Javascript excuted')).catch(err => console.log(err));
1942
1737
  * ```
1738
+ * @remarks
1739
+ * `WebContents` refers to shared functionality between {@link OpenFin.Window} and {@link OpenFin.View}.
1740
+ * We do not expose an explicit superclass for this functionality, but it does have its own
1741
+ * {@link OpenFin.WebContentsEvents event namespace}.
1943
1742
  */
1944
1743
  executeJavaScript(code) {
1945
1744
  return this.wire
@@ -1979,6 +1778,10 @@ class WebContents extends base_1$k.EmitterBase {
1979
1778
  *
1980
1779
  * getZoomLevel().then(zoomLevel => console.log(zoomLevel)).catch(err => console.log(err));
1981
1780
  * ```
1781
+ * @remarks
1782
+ * `WebContents` refers to shared functionality between {@link OpenFin.Window} and {@link OpenFin.View}.
1783
+ * We do not expose an explicit superclass for this functionality, but it does have its own
1784
+ * {@link OpenFin.WebContentsEvents event namespace}.
1982
1785
  */
1983
1786
  getZoomLevel() {
1984
1787
  return this.wire.sendAction('get-zoom-level', this.identity).then(({ payload }) => payload.data);
@@ -2017,6 +1820,10 @@ class WebContents extends base_1$k.EmitterBase {
2017
1820
  *
2018
1821
  * setZoomLevel(4).then(() => console.log('Setting a zoom level')).catch(err => console.log(err));
2019
1822
  * ```
1823
+ * @remarks
1824
+ * `WebContents` refers to shared functionality between {@link OpenFin.Window} and {@link OpenFin.View}.
1825
+ * We do not expose an explicit superclass for this functionality, but it does have its own
1826
+ * {@link OpenFin.WebContentsEvents event namespace}.
2020
1827
  */
2021
1828
  setZoomLevel(level) {
2022
1829
  return this.wire.sendAction('set-zoom-level', { ...this.identity, level }).then(() => undefined);
@@ -2024,7 +1831,7 @@ class WebContents extends base_1$k.EmitterBase {
2024
1831
  /**
2025
1832
  * Navigates the WebContents to a specified URL.
2026
1833
  *
2027
- * @remarks The url must contain the protocol prefix such as http:// or https://.
1834
+ * Note: The url must contain the protocol prefix such as http:// or https://.
2028
1835
  * @param url - The URL to navigate the WebContents to.
2029
1836
  *
2030
1837
  * @example
@@ -2054,6 +1861,10 @@ class WebContents extends base_1$k.EmitterBase {
2054
1861
  * navigate().then(() => console.log('Navigate to tutorial')).catch(err => console.log(err));
2055
1862
  * ```
2056
1863
  * @experimental
1864
+ * @remarks
1865
+ * `WebContents` refers to shared functionality between {@link OpenFin.Window} and {@link OpenFin.View}.
1866
+ * We do not expose an explicit superclass for this functionality, but it does have its own
1867
+ * {@link OpenFin.WebContentsEvents event namespace}.
2057
1868
  */
2058
1869
  navigate(url) {
2059
1870
  return this.wire.sendAction('navigate-window', { ...this.identity, url }).then(() => undefined);
@@ -2081,6 +1892,10 @@ class WebContents extends base_1$k.EmitterBase {
2081
1892
  * }
2082
1893
  * navigateBack().then(() => console.log('Navigated back')).catch(err => console.log(err));
2083
1894
  * ```
1895
+ * @remarks
1896
+ * `WebContents` refers to shared functionality between {@link OpenFin.Window} and {@link OpenFin.View}.
1897
+ * We do not expose an explicit superclass for this functionality, but it does have its own
1898
+ * {@link OpenFin.WebContentsEvents event namespace}.
2084
1899
  */
2085
1900
  navigateBack() {
2086
1901
  return this.wire.sendAction('navigate-window-back', { ...this.identity }).then(() => undefined);
@@ -2110,6 +1925,10 @@ class WebContents extends base_1$k.EmitterBase {
2110
1925
  * }
2111
1926
  * navigateForward().then(() => console.log('Navigated forward')).catch(err => console.log(err));
2112
1927
  * ```
1928
+ * @remarks
1929
+ * `WebContents` refers to shared functionality between {@link OpenFin.Window} and {@link OpenFin.View}.
1930
+ * We do not expose an explicit superclass for this functionality, but it does have its own
1931
+ * {@link OpenFin.WebContentsEvents event namespace}.
2113
1932
  */
2114
1933
  async navigateForward() {
2115
1934
  await this.wire.sendAction('navigate-window-forward', { ...this.identity });
@@ -2137,6 +1956,10 @@ class WebContents extends base_1$k.EmitterBase {
2137
1956
  * }
2138
1957
  * stopNavigation().then(() => console.log('you shall not navigate')).catch(err => console.log(err));
2139
1958
  * ```
1959
+ * @remarks
1960
+ * `WebContents` refers to shared functionality between {@link OpenFin.Window} and {@link OpenFin.View}.
1961
+ * We do not expose an explicit superclass for this functionality, but it does have its own
1962
+ * {@link OpenFin.WebContentsEvents event namespace}.
2140
1963
  */
2141
1964
  stopNavigation() {
2142
1965
  return this.wire.sendAction('stop-window-navigation', { ...this.identity }).then(() => undefined);
@@ -2174,6 +1997,10 @@ class WebContents extends base_1$k.EmitterBase {
2174
1997
  * console.log('Reloaded window')
2175
1998
  * }).catch(err => console.log(err));
2176
1999
  * ```
2000
+ * @remarks
2001
+ * `WebContents` refers to shared functionality between {@link OpenFin.Window} and {@link OpenFin.View}.
2002
+ * We do not expose an explicit superclass for this functionality, but it does have its own
2003
+ * {@link OpenFin.WebContentsEvents event namespace}.
2177
2004
  */
2178
2005
  reload(ignoreCache = false) {
2179
2006
  return this.wire
@@ -2187,7 +2014,7 @@ class WebContents extends base_1$k.EmitterBase {
2187
2014
  * Prints the WebContents.
2188
2015
  * @param options Printer Options
2189
2016
  *
2190
- * @remarks When `silent` is set to `true`, the API will pick the system's default printer if deviceName
2017
+ * Note: When `silent` is set to `true`, the API will pick the system's default printer if deviceName
2191
2018
  * is empty and the default settings for printing.
2192
2019
  *
2193
2020
  * Use the CSS style `page-break-before: always;` to force print to a new page.
@@ -2200,6 +2027,10 @@ class WebContents extends base_1$k.EmitterBase {
2200
2027
  * console.log('print call has been sent to the system');
2201
2028
  * });
2202
2029
  * ```
2030
+ * @remarks
2031
+ * `WebContents` refers to shared functionality between {@link OpenFin.Window} and {@link OpenFin.View}.
2032
+ * We do not expose an explicit superclass for this functionality, but it does have its own
2033
+ * {@link OpenFin.WebContentsEvents event namespace}.
2203
2034
  */
2204
2035
  print(options = {}) {
2205
2036
  return this.wire.sendAction('print', { ...this.identity, options }).then(() => undefined);
@@ -2209,7 +2040,7 @@ class WebContents extends base_1$k.EmitterBase {
2209
2040
  * @param searchTerm Term to find in page
2210
2041
  * @param options Search options
2211
2042
  *
2212
- * @remarks By default, each subsequent call will highlight the next text that matches the search term.
2043
+ * Note: By default, each subsequent call will highlight the next text that matches the search term.
2213
2044
  *
2214
2045
  * Returns a promise with the results for the request. By subscribing to the
2215
2046
  * found-in-page event, you can get the results of this call as well.
@@ -2244,6 +2075,10 @@ class WebContents extends base_1$k.EmitterBase {
2244
2075
  * console.log(result)
2245
2076
  * });
2246
2077
  * ```
2078
+ * @remarks
2079
+ * `WebContents` refers to shared functionality between {@link OpenFin.Window} and {@link OpenFin.View}.
2080
+ * We do not expose an explicit superclass for this functionality, but it does have its own
2081
+ * {@link OpenFin.WebContentsEvents event namespace}.
2247
2082
  */
2248
2083
  findInPage(searchTerm, options) {
2249
2084
  return this.wire
@@ -2287,6 +2122,10 @@ class WebContents extends base_1$k.EmitterBase {
2287
2122
  * console.log(results);
2288
2123
  * });
2289
2124
  * ```
2125
+ * @remarks
2126
+ * `WebContents` refers to shared functionality between {@link OpenFin.Window} and {@link OpenFin.View}.
2127
+ * We do not expose an explicit superclass for this functionality, but it does have its own
2128
+ * {@link OpenFin.WebContentsEvents event namespace}.
2290
2129
  */
2291
2130
  stopFindInPage(action) {
2292
2131
  return this.wire.sendAction('stop-find-in-page', { ...this.identity, action }).then(() => undefined);
@@ -2329,6 +2168,10 @@ class WebContents extends base_1$k.EmitterBase {
2329
2168
  * console.log(err);
2330
2169
  * });
2331
2170
  * ```
2171
+ * @remarks
2172
+ * `WebContents` refers to shared functionality between {@link OpenFin.Window} and {@link OpenFin.View}.
2173
+ * We do not expose an explicit superclass for this functionality, but it does have its own
2174
+ * {@link OpenFin.WebContentsEvents event namespace}.
2332
2175
  */
2333
2176
  getPrinters() {
2334
2177
  return this.wire.sendAction('get-printers', { ...this.identity }).then(({ payload }) => payload.data);
@@ -2351,6 +2194,10 @@ class WebContents extends base_1$k.EmitterBase {
2351
2194
  *
2352
2195
  * focusWindow().then(() => console.log('Window focused')).catch(err => console.log(err));
2353
2196
  * ```
2197
+ * @remarks
2198
+ * `WebContents` refers to shared functionality between {@link OpenFin.Window} and {@link OpenFin.View}.
2199
+ * We do not expose an explicit superclass for this functionality, but it does have its own
2200
+ * {@link OpenFin.WebContentsEvents event namespace}.
2354
2201
  */
2355
2202
  async focus({ emitSynthFocused } = { emitSynthFocused: true }) {
2356
2203
  await this.wire.sendAction('focus-window', { emitSynthFocused, ...this.identity });
@@ -2382,6 +2229,10 @@ class WebContents extends base_1$k.EmitterBase {
2382
2229
  * .then(() => console.log('Showing dev tools'))
2383
2230
  * .catch(err => console.error(err));
2384
2231
  * ```
2232
+ * @remarks
2233
+ * `WebContents` refers to shared functionality between {@link OpenFin.Window} and {@link OpenFin.View}.
2234
+ * We do not expose an explicit superclass for this functionality, but it does have its own
2235
+ * {@link OpenFin.WebContentsEvents event namespace}.
2385
2236
  */
2386
2237
  async showDeveloperTools() {
2387
2238
  // Note this hits the system action map in core state for legacy reasons.
@@ -2390,7 +2241,7 @@ class WebContents extends base_1$k.EmitterBase {
2390
2241
  /**
2391
2242
  * Retrieves the process information associated with a WebContents.
2392
2243
  *
2393
- * @remarks This includes any iframes associated with the WebContents
2244
+ * Note: This includes any iframes associated with the WebContents
2394
2245
  *
2395
2246
  * @example
2396
2247
  * View:
@@ -2404,6 +2255,10 @@ class WebContents extends base_1$k.EmitterBase {
2404
2255
  * const win = await fin.Window.getCurrent();
2405
2256
  * const processInfo = await win.getProcessInfo();
2406
2257
  * ```
2258
+ * @remarks
2259
+ * `WebContents` refers to shared functionality between {@link OpenFin.Window} and {@link OpenFin.View}.
2260
+ * We do not expose an explicit superclass for this functionality, but it does have its own
2261
+ * {@link OpenFin.WebContentsEvents event namespace}.
2407
2262
  */
2408
2263
  async getProcessInfo() {
2409
2264
  const { payload: { data } } = await this.wire.sendAction('get-process-info', this.identity);
@@ -2439,6 +2294,10 @@ class WebContents extends base_1$k.EmitterBase {
2439
2294
  * const win = await fin.Window.create(winOption);
2440
2295
  * const sharedWorkers = await win.getSharedWorkers();
2441
2296
  * ```
2297
+ * @remarks
2298
+ * `WebContents` refers to shared functionality between {@link OpenFin.Window} and {@link OpenFin.View}.
2299
+ * We do not expose an explicit superclass for this functionality, but it does have its own
2300
+ * {@link OpenFin.WebContentsEvents event namespace}.
2442
2301
  */
2443
2302
  async getSharedWorkers() {
2444
2303
  return this.wire.sendAction('get-shared-workers', this.identity).then(({ payload }) => payload.data);
@@ -2473,6 +2332,10 @@ class WebContents extends base_1$k.EmitterBase {
2473
2332
  * const win = await fin.Window.create(winOption);
2474
2333
  * await win.inspectSharedWorker();
2475
2334
  * ```
2335
+ * @remarks
2336
+ * `WebContents` refers to shared functionality between {@link OpenFin.Window} and {@link OpenFin.View}.
2337
+ * We do not expose an explicit superclass for this functionality, but it does have its own
2338
+ * {@link OpenFin.WebContentsEvents event namespace}.
2476
2339
  */
2477
2340
  async inspectSharedWorker() {
2478
2341
  await this.wire.sendAction('inspect-shared-worker', { ...this.identity });
@@ -2510,6 +2373,10 @@ class WebContents extends base_1$k.EmitterBase {
2510
2373
  * const sharedWorkers = await win.getSharedWorkers();
2511
2374
  * await win.inspectSharedWorkerById(sharedWorkers[0].id);
2512
2375
  * ```
2376
+ * @remarks
2377
+ * `WebContents` refers to shared functionality between {@link OpenFin.Window} and {@link OpenFin.View}.
2378
+ * We do not expose an explicit superclass for this functionality, but it does have its own
2379
+ * {@link OpenFin.WebContentsEvents event namespace}.
2513
2380
  */
2514
2381
  async inspectSharedWorkerById(workerId) {
2515
2382
  await this.wire.sendAction('inspect-shared-worker-by-id', { ...this.identity, workerId });
@@ -2544,6 +2411,10 @@ class WebContents extends base_1$k.EmitterBase {
2544
2411
  * const win = await fin.Window.create(winOption);
2545
2412
  * await win.inspectServiceWorker();
2546
2413
  * ```
2414
+ * @remarks
2415
+ * `WebContents` refers to shared functionality between {@link OpenFin.Window} and {@link OpenFin.View}.
2416
+ * We do not expose an explicit superclass for this functionality, but it does have its own
2417
+ * {@link OpenFin.WebContentsEvents event namespace}.
2547
2418
  */
2548
2419
  async inspectServiceWorker() {
2549
2420
  await this.wire.sendAction('inspect-service-worker', { ...this.identity });
@@ -2551,7 +2422,7 @@ class WebContents extends base_1$k.EmitterBase {
2551
2422
  /**
2552
2423
  * Shows a popup window.
2553
2424
  *
2554
- * @remarks If this WebContents is a view and its attached window has a popup open, this will close it.
2425
+ * Note: If this WebContents is a view and its attached window has a popup open, this will close it.
2555
2426
  *
2556
2427
  * Shows a popup window. Including a `name` in `options` will attempt to show an existing window as a popup, if
2557
2428
  * that window doesn't exist or no `name` is included a window will be created. If the caller view or the caller
@@ -2559,7 +2430,7 @@ class WebContents extends base_1$k.EmitterBase {
2559
2430
  * open popup window before showing the new popup window. Also, if the caller view is destroyed or detached, the popup
2560
2431
  * will be dismissed.
2561
2432
  *
2562
- * NOTE: in the case where the window being shown as a popup needs to be created, it is a child of the caller view's parent window.
2433
+ * Note: in the case where the window being shown as a popup needs to be created, it is a child of the caller view's parent window.
2563
2434
  *
2564
2435
  * @example
2565
2436
  *
@@ -2754,12 +2625,16 @@ class WebContents extends base_1$k.EmitterBase {
2754
2625
  * onPopupReady: popupWindowCallback;
2755
2626
  * });
2756
2627
  * ```
2628
+ * @remarks
2629
+ * `WebContents` refers to shared functionality between {@link OpenFin.Window} and {@link OpenFin.View}.
2630
+ * We do not expose an explicit superclass for this functionality, but it does have its own
2631
+ * {@link OpenFin.WebContentsEvents event namespace}.
2757
2632
  */
2758
2633
  async showPopupWindow(options) {
2759
2634
  this.wire.sendAction(`${this.entityType}-show-popup-window`, this.identity).catch(() => {
2760
2635
  // we do not want to expose this error, just continue if this analytics-only call fails
2761
2636
  });
2762
- if (options === null || options === void 0 ? void 0 : options.onPopupReady) {
2637
+ if (options?.onPopupReady) {
2763
2638
  const readyListener = async ({ popupName }) => {
2764
2639
  try {
2765
2640
  const popupWindow = this.fin.Window.wrapSync({ uuid: this.fin.me.uuid, name: popupName });
@@ -2778,8 +2653,8 @@ class WebContents extends base_1$k.EmitterBase {
2778
2653
  ...options,
2779
2654
  // Internal use only.
2780
2655
  // @ts-expect-error
2781
- hasResultCallback: !!(options === null || options === void 0 ? void 0 : options.onPopupResult),
2782
- hasReadyCallback: !!(options === null || options === void 0 ? void 0 : options.onPopupReady)
2656
+ hasResultCallback: !!options?.onPopupResult,
2657
+ hasReadyCallback: !!options?.onPopupReady
2783
2658
  },
2784
2659
  ...this.identity
2785
2660
  });
@@ -2804,7 +2679,7 @@ class WebContents extends base_1$k.EmitterBase {
2804
2679
  }
2805
2680
  return popupResult;
2806
2681
  };
2807
- if (options === null || options === void 0 ? void 0 : options.onPopupResult) {
2682
+ if (options?.onPopupResult) {
2808
2683
  const dispatchResultListener = async (payload) => {
2809
2684
  await options.onPopupResult(normalizePopupResult(payload));
2810
2685
  };
@@ -3130,6 +3005,49 @@ function requireInstance$2 () {
3130
3005
  this.show = async () => {
3131
3006
  await this.wire.sendAction('show-view', { ...this.identity });
3132
3007
  };
3008
+ /**
3009
+ * Sets the bounds (top, left, width, height) of the view relative to its window and shows it if it is hidden.
3010
+ * This method ensures the view is both positioned and showing. It will reposition a visible view and both show and reposition a hidden view.
3011
+ *
3012
+ * @remarks View position is relative to the bounds of the window.
3013
+ * ({top: 0, left: 0} represents the top left corner of the window)
3014
+ *
3015
+ * @example
3016
+ * ```js
3017
+ * let view;
3018
+ * async function createView() {
3019
+ * const me = await fin.Window.getCurrent();
3020
+ * return fin.View.create({
3021
+ * name: 'viewNameSetBounds',
3022
+ * target: me.identity,
3023
+ * bounds: {top: 10, left: 10, width: 200, height: 200}
3024
+ * });
3025
+ * }
3026
+ *
3027
+ * async function showViewAt() {
3028
+ * view = await createView();
3029
+ * console.log('View created.');
3030
+ *
3031
+ * await view.navigate('https://google.com');
3032
+ * console.log('View navigated to given url.');
3033
+ *
3034
+ * await view.showAt({
3035
+ * top: 100,
3036
+ * left: 100,
3037
+ * width: 300,
3038
+ * height: 300
3039
+ * });
3040
+ * }
3041
+ *
3042
+ * showViewAt()
3043
+ * .then(() => console.log('View set to new bounds and shown.'))
3044
+ * .catch(err => console.log(err));
3045
+ * ```
3046
+ * @experimental
3047
+ */
3048
+ this.showAt = async (bounds) => {
3049
+ await this.wire.sendAction('show-view-at', { bounds, ...this.identity });
3050
+ };
3133
3051
  /**
3134
3052
  * Hides the current view if it is currently visible.
3135
3053
  *
@@ -3289,8 +3207,24 @@ function requireInstance$2 () {
3289
3207
  this.wire.sendAction('view-get-parent-layout', { ...this.identity }).catch(() => {
3290
3208
  // don't expose
3291
3209
  });
3292
- const currentWindow = await this.getCurrentWindow();
3293
- return currentWindow.getLayout();
3210
+ const layoutWindow = await this.getCurrentWindow();
3211
+ try {
3212
+ const providerChannelClient = await __classPrivateFieldGet(this, _View_providerChannelClient, "f").getValue();
3213
+ const client = await layout_entities_1.LayoutNode.newLayoutEntitiesClient(providerChannelClient, layout_constants_1.LAYOUT_CONTROLLER_ID, layoutWindow.identity);
3214
+ const layoutIdentity = await client.getLayoutIdentityForViewOrThrow(this.identity);
3215
+ return this.fin.Platform.Layout.wrap(layoutIdentity);
3216
+ }
3217
+ catch (e) {
3218
+ const allowedErrors = [
3219
+ 'No action registered at target for',
3220
+ 'getLayoutIdentityForViewOrThrow is not a function'
3221
+ ];
3222
+ if (!allowedErrors.some((m) => e.message.includes(m))) {
3223
+ throw e;
3224
+ }
3225
+ // fallback logic for missing endpoint
3226
+ return this.fin.Platform.Layout.wrap(layoutWindow.identity);
3227
+ }
3294
3228
  };
3295
3229
  /**
3296
3230
  * Gets the View's options.
@@ -3524,9 +3458,9 @@ function requireView () {
3524
3458
  };
3525
3459
  Object.defineProperty(exports, "__esModule", { value: true });
3526
3460
  /**
3527
- * Entry points for the OpenFin `View` API.
3461
+ * Entry points for the OpenFin `View` API (`fin.View`).
3528
3462
  *
3529
- * * {@link ViewModule} contains static methods relating to the `View` type, accessible through `fin.View`.
3463
+ * * {@link ViewModule} contains static members of the `View` API, accessible through `fin.View`.
3530
3464
  * * {@link View} describes an instance of an OpenFin View, e.g. as returned by `fin.View.getCurrent`.
3531
3465
  *
3532
3466
  * These are separate code entities, and are documented separately. In the [previous version of the API documentation](https://cdn.openfin.co/docs/javascript/canary/index.html),
@@ -3535,8 +3469,8 @@ function requireView () {
3535
3469
  * @packageDocumentation
3536
3470
  */
3537
3471
  __exportStar(requireFactory$3(), exports);
3538
- __exportStar(requireInstance$2(), exports);
3539
- } (view));
3472
+ __exportStar(requireInstance$2(), exports);
3473
+ } (view));
3540
3474
  return view;
3541
3475
  }
3542
3476
 
@@ -4023,6 +3957,7 @@ function requireInstance$1 () {
4023
3957
  /**
4024
3958
  * Sets or removes a custom JumpList for the application. Only applicable in Windows OS.
4025
3959
  * If categories is null the previously set custom JumpList (if any) will be replaced by the standard JumpList for the app (managed by Windows).
3960
+ *
4026
3961
  * Note: If the "name" property is omitted it defaults to "tasks".
4027
3962
  * @param jumpListCategories An array of JumpList Categories to populate. If null, remove any existing JumpList configuration and set to Windows default.
4028
3963
  *
@@ -4323,6 +4258,7 @@ function requireInstance$1 () {
4323
4258
  }
4324
4259
  /**
4325
4260
  * Sets file auto download location. It's only allowed in the same application.
4261
+ *
4326
4262
  * Note: This method is restricted by default and must be enabled via
4327
4263
  * <a href="https://developers.openfin.co/docs/api-security">API security settings</a>.
4328
4264
  * @param downloadLocation file auto download location
@@ -4348,6 +4284,7 @@ function requireInstance$1 () {
4348
4284
  }
4349
4285
  /**
4350
4286
  * Gets file auto download location. It's only allowed in the same application. If file auto download location is not set, it will return the default location.
4287
+ *
4351
4288
  * Note: This method is restricted by default and must be enabled via
4352
4289
  * <a href="https://developers.openfin.co/docs/api-security">API security settings</a>.
4353
4290
  *
@@ -4378,6 +4315,9 @@ function requireFactory$2 () {
4378
4315
  const base_1 = base;
4379
4316
  const validate_1 = validate;
4380
4317
  const Instance_1 = requireInstance$1();
4318
+ /**
4319
+ * Static namespace for OpenFin API methods that interact with the {@link Application} class, available under `fin.Application`.
4320
+ */
4381
4321
  class ApplicationModule extends base_1.Base {
4382
4322
  /**
4383
4323
  * Asynchronously returns an Application object that represents an existing application.
@@ -4659,9 +4599,9 @@ function requireApplication () {
4659
4599
  };
4660
4600
  Object.defineProperty(exports, "__esModule", { value: true });
4661
4601
  /**
4662
- * Entry points for the OpenFin `Application` API.
4602
+ * Entry points for the OpenFin `Application` API (`fin.Application`).
4663
4603
  *
4664
- * * {@link ApplicationModule} contains static methods relating to the `Application` type, accessible through `fin.Application`.
4604
+ * * {@link ApplicationModule} contains static members of the `Application` API, accessible through `fin.Application`.
4665
4605
  * * {@link Application} describes an instance of an OpenFin Application, e.g. as returned by `fin.Application.getCurrent`.
4666
4606
  *
4667
4607
  * These are separate code entities, and are documented separately. In the [previous version of the API documentation](https://cdn.openfin.co/docs/javascript/canary/index.html),
@@ -4670,8 +4610,8 @@ function requireApplication () {
4670
4610
  * @packageDocumentation
4671
4611
  */
4672
4612
  __exportStar(requireFactory$2(), exports);
4673
- __exportStar(requireInstance$1(), exports);
4674
- } (application));
4613
+ __exportStar(requireInstance$1(), exports);
4614
+ } (application));
4675
4615
  return application;
4676
4616
  }
4677
4617
 
@@ -4689,6 +4629,7 @@ function requireInstance () {
4689
4629
  const application_1 = requireApplication();
4690
4630
  const main_1 = main;
4691
4631
  const view_1 = requireView();
4632
+ const warnings_1 = warnings;
4692
4633
  /**
4693
4634
  * @PORTED
4694
4635
  * @typedef { object } Margins
@@ -5173,7 +5114,6 @@ function requireInstance () {
5173
5114
  */
5174
5115
  constructor(wire, identity) {
5175
5116
  super(wire, identity, 'window');
5176
- this.identity = identity;
5177
5117
  }
5178
5118
  /**
5179
5119
  * Adds a listener to the end of the listeners array for the specified event.
@@ -5299,6 +5239,7 @@ function requireInstance () {
5299
5239
  if (options.autoShow === undefined) {
5300
5240
  options.autoShow = true;
5301
5241
  }
5242
+ (0, warnings_1.handleDeprecatedWarnings)(options);
5302
5243
  const windowCreation = this.wire.environment.createChildContent({ entityType: 'window', options });
5303
5244
  Promise.all([pageResponse, windowCreation])
5304
5245
  .then((resolvedArr) => {
@@ -5715,15 +5656,15 @@ function requireInstance () {
5715
5656
  * ```
5716
5657
  * @experimental
5717
5658
  */
5718
- async getLayout() {
5659
+ async getLayout(layoutIdentity) {
5719
5660
  this.wire.sendAction('window-get-layout', this.identity).catch((e) => {
5720
5661
  // don't expose
5721
5662
  });
5722
5663
  const opts = await this.getOptions();
5723
- if (!opts.layout) {
5664
+ if (!opts.layout || !opts.layoutSnapshot) {
5724
5665
  throw new Error('Window does not have a Layout');
5725
5666
  }
5726
- return this.fin.Platform.Layout.wrap(this.identity);
5667
+ return this.fin.Platform.Layout.wrap(layoutIdentity ?? this.identity);
5727
5668
  }
5728
5669
  /**
5729
5670
  * Gets the current settings of the window.
@@ -6004,11 +5945,12 @@ function requireInstance () {
6004
5945
  * moveBy(580, 300).then(() => console.log('Moved')).catch(err => console.log(err));
6005
5946
  * ```
6006
5947
  */
6007
- moveBy(deltaLeft, deltaTop) {
5948
+ moveBy(deltaLeft, deltaTop, positioningOptions) {
6008
5949
  return this.wire
6009
5950
  .sendAction('move-window-by', {
6010
5951
  deltaLeft,
6011
5952
  deltaTop,
5953
+ positioningOptions,
6012
5954
  ...this.identity
6013
5955
  })
6014
5956
  .then(() => undefined);
@@ -6038,11 +5980,12 @@ function requireInstance () {
6038
5980
  * moveTo(580, 300).then(() => console.log('Moved')).catch(err => console.log(err))
6039
5981
  * ```
6040
5982
  */
6041
- moveTo(left, top) {
5983
+ moveTo(left, top, positioningOptions) {
6042
5984
  return this.wire
6043
5985
  .sendAction('move-window', {
6044
5986
  left,
6045
5987
  top,
5988
+ positioningOptions,
6046
5989
  ...this.identity
6047
5990
  })
6048
5991
  .then(() => undefined);
@@ -6075,12 +6018,13 @@ function requireInstance () {
6075
6018
  * resizeBy(580, 300, 'top-right').then(() => console.log('Resized')).catch(err => console.log(err));
6076
6019
  * ```
6077
6020
  */
6078
- resizeBy(deltaWidth, deltaHeight, anchor) {
6021
+ resizeBy(deltaWidth, deltaHeight, anchor, positioningOptions) {
6079
6022
  return this.wire
6080
6023
  .sendAction('resize-window-by', {
6081
6024
  deltaWidth: Math.floor(deltaWidth),
6082
6025
  deltaHeight: Math.floor(deltaHeight),
6083
6026
  anchor,
6027
+ positioningOptions,
6084
6028
  ...this.identity
6085
6029
  })
6086
6030
  .then(() => undefined);
@@ -6113,12 +6057,13 @@ function requireInstance () {
6113
6057
  * resizeTo(580, 300, 'top-left').then(() => console.log('Resized')).catch(err => console.log(err));
6114
6058
  * ```
6115
6059
  */
6116
- resizeTo(width, height, anchor) {
6060
+ resizeTo(width, height, anchor, positioningOptions) {
6117
6061
  return this.wire
6118
6062
  .sendAction('resize-window', {
6119
6063
  width: Math.floor(width),
6120
6064
  height: Math.floor(height),
6121
6065
  anchor,
6066
+ positioningOptions,
6122
6067
  ...this.identity
6123
6068
  })
6124
6069
  .then(() => undefined);
@@ -6177,7 +6122,6 @@ function requireInstance () {
6177
6122
  }
6178
6123
  /**
6179
6124
  * Sets the window's size and position.
6180
- * @property { Bounds } bounds This is a * @type {string} name - name of the window.object that holds the propertys of
6181
6125
  *
6182
6126
  * @example
6183
6127
  * ```js
@@ -6204,8 +6148,10 @@ function requireInstance () {
6204
6148
  * }).then(() => console.log('Bounds set to window')).catch(err => console.log(err));
6205
6149
  * ```
6206
6150
  */
6207
- setBounds(bounds) {
6208
- return this.wire.sendAction('set-window-bounds', { ...bounds, ...this.identity }).then(() => undefined);
6151
+ setBounds(bounds, positioningOptions) {
6152
+ return this.wire
6153
+ .sendAction('set-window-bounds', { ...bounds, ...this.identity, positioningOptions })
6154
+ .then(() => undefined);
6209
6155
  }
6210
6156
  /**
6211
6157
  * Shows the window if it is hidden.
@@ -6347,7 +6293,10 @@ function requireInstance () {
6347
6293
  * Calling this method will close previously opened menus.
6348
6294
  * @experimental
6349
6295
  * @param options
6350
- *
6296
+ * @typeParam Data User-defined shape for data returned upon menu item click. Should be a
6297
+ * [union](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#union-types)
6298
+ * of all possible data shapes for the entire menu, and the click handler should process
6299
+ * these with a "reducer" pattern.
6351
6300
  * @example
6352
6301
  * This could be used to show a drop down menu over views in a platform window:
6353
6302
  * ```js
@@ -6437,6 +6386,7 @@ function requireInstance () {
6437
6386
  return this.wire.sendAction('close-popup-menu', { ...this.identity }).then(() => undefined);
6438
6387
  }
6439
6388
  /**
6389
+ * @PORTED
6440
6390
  * @typedef {object} PopupOptions
6441
6391
  * @property {string} [name] - If a window with this `name` exists, it will be shown as a popup. Otherwise, a new window with this `name` will be created. If this `name` is undefined, `initialOptions.name` will be used. If this `name` and `intialOptions.name` are both undefined, a `name` will be generated.
6442
6392
  * @property {string} [url] - Navigates to this `url` if showing an existing window as a popup, otherwise the newly created window will load this `url`.
@@ -6454,6 +6404,7 @@ function requireInstance () {
6454
6404
  * @property {boolean} [hideOnClose] - Hide the popup window instead of closing whenever `close` is called on it. Note: if this is `true` and `blurBehavior` and/or `resultDispatchBehavior` are set to `close`, the window will be hidden.
6455
6405
  */
6456
6406
  /**
6407
+ * @PORTED
6457
6408
  * @typedef {object} PopupResult
6458
6409
  * @property {Identity} identity - `name` and `uuid` of the popup window that called dispatched this result.
6459
6410
  * @property {'clicked' | 'dismissed'} result - Result of the user interaction with the popup window.
@@ -6547,6 +6498,9 @@ function requireFactory$1 () {
6547
6498
  const base_1 = base;
6548
6499
  const validate_1 = validate;
6549
6500
  const Instance_1 = requireInstance();
6501
+ /**
6502
+ * Static namespace for OpenFin API methods that interact with the {@link _Window} class, available under `fin.Window`.
6503
+ */
6550
6504
  class _WindowModule extends base_1.Base {
6551
6505
  /**
6552
6506
  * Asynchronously returns a Window object that represents an existing window.
@@ -6702,9 +6656,9 @@ function requireWindow () {
6702
6656
  };
6703
6657
  Object.defineProperty(exports, "__esModule", { value: true });
6704
6658
  /**
6705
- * Entry points for the OpenFin `Window` API.
6659
+ * Entry points for the OpenFin `Window` API (`fin.Window`).
6706
6660
  *
6707
- * * {@link _WindowModule} contains static methods relating to the `Window` type, accessible through `fin.Window`.
6661
+ * * {@link _WindowModule} contains static members of the `Window` API, accessible through `fin.Window`.
6708
6662
  * * {@link _Window} describes an instance of an OpenFin Window, e.g. as returned by `fin.Window.getCurrent`.
6709
6663
  *
6710
6664
  * These are separate code entities, and are documented separately. In the [previous version of the API documentation](https://cdn.openfin.co/docs/javascript/canary/index.html),
@@ -6715,17 +6669,24 @@ function requireWindow () {
6715
6669
  * @packageDocumentation
6716
6670
  */
6717
6671
  __exportStar(requireFactory$1(), exports);
6718
- __exportStar(requireInstance(), exports);
6719
- } (window$1));
6672
+ __exportStar(requireInstance(), exports);
6673
+ } (window$1));
6720
6674
  return window$1;
6721
6675
  }
6722
6676
 
6677
+ /**
6678
+ * Entry point for the OpenFin `System` API (`fin.System`).
6679
+ *
6680
+ * * {@link System} contains static members of the `System` API (available under `fin.System`)
6681
+ *
6682
+ * @packageDocumentation
6683
+ */
6723
6684
  Object.defineProperty(system, "__esModule", { value: true });
6724
6685
  system.System = void 0;
6725
6686
  const base_1$j = base;
6726
6687
  const transport_errors_1$1 = transportErrors;
6727
6688
  const window_1 = requireWindow();
6728
- const events_1$6 = eventsExports;
6689
+ const events_1$6 = require$$0;
6729
6690
  /**
6730
6691
  * An object representing the core of OpenFin Runtime. Allows the developer
6731
6692
  * to perform system-level actions, such as accessing logs, viewing processes,
@@ -7695,6 +7656,59 @@ class System extends base_1$j.EmitterBase {
7695
7656
  openUrlWithBrowser(url) {
7696
7657
  return this.wire.sendAction('open-url-with-browser', { url }).then(() => undefined);
7697
7658
  }
7659
+ /**
7660
+ * Creates a new registry entry under the HKCU root Windows registry key if the given custom protocol name doesn't exist or
7661
+ * overwrites the existing registry entry if the given custom protocol name already exists.
7662
+ *
7663
+ * Note: This method is restricted by default and must be enabled via
7664
+ * {@link https://developers.openfin.co/docs/api-security API security settings}. It requires RVM 12 or higher version.
7665
+ *
7666
+ *
7667
+ * @remarks These protocols are reserved and cannot be registered:
7668
+ * - fin
7669
+ * - fins
7670
+ * - openfin
7671
+ * - URI Schemes registered with {@link https://en.wikipedia.org/wiki/List_of_URI_schemes#Official_IANA-registered_schemes IANA}
7672
+ *
7673
+ * @throws if a given custom protocol failed to be registered.
7674
+ * @throws if a manifest URL contains the '%1' string.
7675
+ * @throws if a manifest URL contains a query string parameter which name equals to the Protocol Launch Request Parameter Name.
7676
+ * @throws if the full length of the command string that is to be written to the registry exceeds 2048 bytes.
7677
+ *
7678
+ * @example
7679
+ * ```js
7680
+ * fin.System.registerCustomProtocol({protocolName:'protocol1'}).then(console.log).catch(console.error);
7681
+ * ```
7682
+ */
7683
+ async registerCustomProtocol(options) {
7684
+ if (typeof options !== 'object') {
7685
+ throw new Error('Must provide an object with a `protocolName` property having a string value.');
7686
+ }
7687
+ await this.wire.sendAction('register-custom-protocol', options);
7688
+ }
7689
+ /**
7690
+ * Removes the registry entry for a given custom protocol.
7691
+ *
7692
+ * Note: This method is restricted by default and must be enabled via
7693
+ * {@link https://developers.openfin.co/docs/api-security API security settings}. It requires RVM 12 or higher version.
7694
+ *
7695
+ *
7696
+ * @remarks These protocols are reserved and cannot be unregistered:
7697
+ * - fin
7698
+ * - fins
7699
+ * - openfin
7700
+ * - URI Schemes registered with {@link https://en.wikipedia.org/wiki/List_of_URI_schemes#Official_IANA-registered_schemes IANA}
7701
+ *
7702
+ * @throws if a protocol entry failed to be removed in registry.
7703
+ *
7704
+ * @example
7705
+ * ```js
7706
+ * await fin.System.unregisterCustomProtocol('protocol1');
7707
+ * ```
7708
+ */
7709
+ async unregisterCustomProtocol(protocolName) {
7710
+ await this.wire.sendAction('unregister-custom-protocol', { protocolName });
7711
+ }
7698
7712
  /**
7699
7713
  * Removes the process entry for the passed UUID obtained from a prior call
7700
7714
  * of fin.System.launchExternalProcess().
@@ -7727,7 +7741,8 @@ class System extends base_1$j.EmitterBase {
7727
7741
  }
7728
7742
  /**
7729
7743
  * Attempt to close an external process. The process will be terminated if it
7730
- * has not closed after the elapsed timeout in milliseconds.<br>
7744
+ * has not closed after the elapsed timeout in milliseconds.
7745
+ *
7731
7746
  * Note: This method is restricted by default and must be enabled via
7732
7747
  * <a href="https://developers.openfin.co/docs/api-security">API security settings</a>.
7733
7748
  * @param options A object defined in the TerminateExternalRequestType interface
@@ -7763,7 +7778,8 @@ class System extends base_1$j.EmitterBase {
7763
7778
  return this.wire.sendAction('update-proxy', options).then(() => undefined);
7764
7779
  }
7765
7780
  /**
7766
- * Downloads the given application asset<br>
7781
+ * Downloads the given application asset.
7782
+ *
7767
7783
  * Note: This method is restricted by default and must be enabled via
7768
7784
  * <a href="https://developers.openfin.co/docs/api-security">API security settings</a>.
7769
7785
  * @param appAsset App asset object
@@ -8657,7 +8673,7 @@ class ChannelBase {
8657
8673
  try {
8658
8674
  const mainAction = this.subscriptions.has(topic)
8659
8675
  ? this.subscriptions.get(topic)
8660
- : (currentPayload, id) => { var _a; return ((_a = this.defaultAction) !== null && _a !== void 0 ? _a : ChannelBase.defaultAction)(topic, currentPayload, id); };
8676
+ : (currentPayload, id) => (this.defaultAction ?? ChannelBase.defaultAction)(topic, currentPayload, id);
8661
8677
  const preActionProcessed = this.preAction ? await this.preAction(topic, payload, senderIdentity) : payload;
8662
8678
  const actionProcessed = await mainAction(preActionProcessed, senderIdentity);
8663
8679
  return this.postAction ? await this.postAction(topic, actionProcessed, senderIdentity) : actionProcessed;
@@ -8986,17 +9002,17 @@ const channelClientsByEndpointId = new Map();
8986
9002
  * provider via {@link ChannelClient#dispatch dispatch} and to listen for communication
8987
9003
  * from the provider by registering an action via {@link ChannelClient#register register}.
8988
9004
  *
8989
- * Synchronous Methods:
9005
+ * ### Synchronous Methods:
8990
9006
  * * {@link ChannelClient#onDisconnection onDisconnection(listener)}
8991
9007
  * * {@link ChannelClient#register register(action, listener)}
8992
9008
  * * {@link ChannelClient#remove remove(action)}
8993
9009
  *
8994
- * Asynchronous Methods:
9010
+ * ### Asynchronous Methods:
8995
9011
  * * {@link ChannelClient#disconnect disconnect()}
8996
9012
  * * {@link ChannelClient#dispatch dispatch(action, payload)}
8997
9013
  *
8998
- * Middleware:
8999
- * <br>Middleware functions receive the following arguments: (action, payload, senderId).
9014
+ * ### Middleware:
9015
+ * Middleware functions receive the following arguments: (action, payload, senderId).
9000
9016
  * The return value of the middleware function will be passed on as the payload from beforeAction, to the action listener, to afterAction
9001
9017
  * unless it is undefined, in which case the original payload is used. Middleware can be used for side effects.
9002
9018
  * * {@link ChannelClient#setDefaultAction setDefaultAction(middleware)}
@@ -9190,7 +9206,6 @@ class ClassicStrategy {
9190
9206
  // connection problems occur
9191
9207
  _ClassicStrategy_pendingMessagesByEndpointId.set(this, new Map);
9192
9208
  this.send = async (endpointId, action, payload) => {
9193
- var _a;
9194
9209
  const to = __classPrivateFieldGet$c(this, _ClassicStrategy_endpointIdentityMap, "f").get(endpointId);
9195
9210
  if (!to) {
9196
9211
  throw new Error(`Could not locate routing info for endpoint ${endpointId}`);
@@ -9210,13 +9225,12 @@ class ClassicStrategy {
9210
9225
  action,
9211
9226
  payload
9212
9227
  });
9213
- (_a = __classPrivateFieldGet$c(this, _ClassicStrategy_pendingMessagesByEndpointId, "f").get(endpointId)) === null || _a === void 0 ? void 0 : _a.add(p);
9228
+ __classPrivateFieldGet$c(this, _ClassicStrategy_pendingMessagesByEndpointId, "f").get(endpointId)?.add(p);
9214
9229
  const raw = await p.catch((error) => {
9215
9230
  throw new Error(error.message);
9216
9231
  }).finally(() => {
9217
- var _a;
9218
9232
  // clean up the pending promise
9219
- (_a = __classPrivateFieldGet$c(this, _ClassicStrategy_pendingMessagesByEndpointId, "f").get(endpointId)) === null || _a === void 0 ? void 0 : _a.delete(p);
9233
+ __classPrivateFieldGet$c(this, _ClassicStrategy_pendingMessagesByEndpointId, "f").get(endpointId)?.delete(p);
9220
9234
  });
9221
9235
  return raw.payload.data.result;
9222
9236
  };
@@ -9237,8 +9251,8 @@ class ClassicStrategy {
9237
9251
  const id = __classPrivateFieldGet$c(this, _ClassicStrategy_endpointIdentityMap, "f").get(endpointId);
9238
9252
  __classPrivateFieldGet$c(this, _ClassicStrategy_endpointIdentityMap, "f").delete(endpointId);
9239
9253
  const pendingSet = __classPrivateFieldGet$c(this, _ClassicStrategy_pendingMessagesByEndpointId, "f").get(endpointId);
9240
- pendingSet === null || pendingSet === void 0 ? void 0 : pendingSet.forEach((p) => {
9241
- const errorMsg = `Channel connection with identity uuid: ${id === null || id === void 0 ? void 0 : id.uuid} / name: ${id === null || id === void 0 ? void 0 : id.name} / endpointId: ${endpointId} no longer connected.`;
9254
+ pendingSet?.forEach((p) => {
9255
+ const errorMsg = `Channel connection with identity uuid: ${id?.uuid} / name: ${id?.name} / endpointId: ${endpointId} no longer connected.`;
9242
9256
  p.cancel(new Error(errorMsg));
9243
9257
  });
9244
9258
  }
@@ -9250,9 +9264,8 @@ class ClassicStrategy {
9250
9264
  __classPrivateFieldGet$c(this, _ClassicStrategy_pendingMessagesByEndpointId, "f").set(endpointId, new Set());
9251
9265
  }
9252
9266
  isValidEndpointPayload(payload) {
9253
- var _a, _b;
9254
- return (typeof ((_a = payload === null || payload === void 0 ? void 0 : payload.endpointIdentity) === null || _a === void 0 ? void 0 : _a.endpointId) === 'string' ||
9255
- typeof ((_b = payload === null || payload === void 0 ? void 0 : payload.endpointIdentity) === null || _b === void 0 ? void 0 : _b.channelId) === 'string');
9267
+ return (typeof payload?.endpointIdentity?.endpointId === 'string' ||
9268
+ typeof payload?.endpointIdentity?.channelId === 'string');
9256
9269
  }
9257
9270
  }
9258
9271
  strategy$2.ClassicStrategy = ClassicStrategy;
@@ -9329,13 +9342,12 @@ class RTCEndpoint {
9329
9342
  this.rtc.rtcClient.close();
9330
9343
  };
9331
9344
  this.rtc.channels.response.addEventListener('message', (e) => {
9332
- var _a;
9333
9345
  let { data } = e;
9334
9346
  if (e.data instanceof ArrayBuffer) {
9335
9347
  data = new TextDecoder().decode(e.data);
9336
9348
  }
9337
9349
  const { messageId, payload, success, error } = JSON.parse(data);
9338
- const { resolve, reject } = (_a = this.responseMap.get(messageId)) !== null && _a !== void 0 ? _a : {};
9350
+ const { resolve, reject } = this.responseMap.get(messageId) ?? {};
9339
9351
  if (resolve && reject) {
9340
9352
  this.responseMap.delete(messageId);
9341
9353
  if (success) {
@@ -9584,9 +9596,8 @@ class RTCICEManager extends base_1$i.EmitterBase {
9584
9596
  const rtcConnectionId = Math.random().toString();
9585
9597
  const rtcClient = this.createRtcPeer();
9586
9598
  rtcClient.addEventListener('icecandidate', async (e) => {
9587
- var _a;
9588
9599
  if (e.candidate) {
9589
- await this.raiseClientIce(rtcConnectionId, { candidate: (_a = e.candidate) === null || _a === void 0 ? void 0 : _a.toJSON() });
9600
+ await this.raiseClientIce(rtcConnectionId, { candidate: e.candidate?.toJSON() });
9590
9601
  }
9591
9602
  });
9592
9603
  await this.listenForProviderIce(rtcConnectionId, async (payload) => {
@@ -9611,9 +9622,8 @@ class RTCICEManager extends base_1$i.EmitterBase {
9611
9622
  const requestChannelPromise = RTCICEManager.createDataChannelPromise('request', rtcClient);
9612
9623
  const responseChannelPromise = RTCICEManager.createDataChannelPromise('response', rtcClient);
9613
9624
  rtcClient.addEventListener('icecandidate', async (e) => {
9614
- var _a;
9615
9625
  if (e.candidate) {
9616
- await this.raiseProviderIce(rtcConnectionId, { candidate: (_a = e.candidate) === null || _a === void 0 ? void 0 : _a.toJSON() });
9626
+ await this.raiseProviderIce(rtcConnectionId, { candidate: e.candidate?.toJSON() });
9617
9627
  }
9618
9628
  });
9619
9629
  await this.listenForClientIce(rtcConnectionId, async (payload) => {
@@ -9686,20 +9696,20 @@ const runtimeVersioning_1 = runtimeVersioning;
9686
9696
  * a single client via {@link ChannelProvider#dispatch dispatch} or all clients via {@link ChannelProvider#publish publish}
9687
9697
  * and to listen for communication from clients by registering an action via {@link ChannelProvider#register register}.
9688
9698
  *
9689
- * Synchronous Methods:
9699
+ * ### Synchronous Methods:
9690
9700
  * * {@link ChannelProvider#onConnection onConnection(listener)}
9691
9701
  * * {@link ChannelProvider#onDisconnection onDisconnection(listener)}
9692
9702
  * * {@link ChannelProvider#publish publish(action, payload)}
9693
9703
  * * {@link ChannelProvider#register register(action, listener)}
9694
9704
  * * {@link ChannelProvider#remove remove(action)}
9695
9705
  *
9696
- * Asynchronous Methods:
9706
+ * ### Asynchronous Methods:
9697
9707
  * * {@link ChannelProvider#destroy destroy()}
9698
9708
  * * {@link ChannelProvider#dispatch dispatch(to, action, payload)}
9699
9709
  * * {@link ChannelProvider#getAllClientInfo getAllClientInfo()}
9700
9710
  *
9701
- * Middleware:
9702
- * <br>Middleware functions receive the following arguments: (action, payload, senderId).
9711
+ * ### Middleware:
9712
+ * Middleware functions receive the following arguments: (action, payload, senderId).
9703
9713
  * The return value of the middleware function will be passed on as the payload from beforeAction, to the action listener, to afterAction
9704
9714
  * unless it is undefined, in which case the most recently defined payload is used. Middleware can be used for side effects.
9705
9715
  * * {@link ChannelProvider#setDefaultAction setDefaultAction(middleware)}
@@ -9795,8 +9805,7 @@ class ChannelProvider extends channel_1.ChannelBase {
9795
9805
  * ```
9796
9806
  */
9797
9807
  dispatch(to, action, payload) {
9798
- var _a;
9799
- const endpointId = (_a = to.endpointId) !== null && _a !== void 0 ? _a : this.getEndpointIdForOpenFinId(to, action);
9808
+ const endpointId = to.endpointId ?? this.getEndpointIdForOpenFinId(to, action);
9800
9809
  if (endpointId && __classPrivateFieldGet$9(this, _ChannelProvider_strategy, "f").isEndpointConnected(endpointId)) {
9801
9810
  return __classPrivateFieldGet$9(this, _ChannelProvider_strategy, "f").send(endpointId, action, payload);
9802
9811
  }
@@ -9972,13 +9981,12 @@ class ChannelProvider extends channel_1.ChannelBase {
9972
9981
  }
9973
9982
  }
9974
9983
  getEndpointIdForOpenFinId(clientIdentity, action) {
9975
- var _a;
9976
9984
  const matchingConnections = this.connections.filter((c) => c.name === clientIdentity.name && c.uuid === clientIdentity.uuid);
9977
9985
  if (matchingConnections.length >= 2) {
9978
9986
  const protectedObj = __classPrivateFieldGet$9(this, _ChannelProvider_protectedObj, "f");
9979
9987
  const { uuid, name } = clientIdentity;
9980
- const providerUuid = protectedObj === null || protectedObj === void 0 ? void 0 : protectedObj.providerIdentity.uuid;
9981
- const providerName = protectedObj === null || protectedObj === void 0 ? void 0 : protectedObj.providerIdentity.name;
9988
+ const providerUuid = protectedObj?.providerIdentity.uuid;
9989
+ const providerName = protectedObj?.providerIdentity.name;
9982
9990
  // eslint-disable-next-line no-console
9983
9991
  console.warn(`WARNING: Dispatch call may have unintended results. The "to" argument of your dispatch call is missing the
9984
9992
  "endpointId" parameter. The identity you are dispatching to ({uuid: ${uuid}, name: ${name}})
@@ -9986,7 +9994,7 @@ class ChannelProvider extends channel_1.ChannelBase {
9986
9994
  ({uuid: ${providerUuid}, name: ${providerName}}) will only be processed by the most recently-created client.`);
9987
9995
  }
9988
9996
  // Pop to return the most recently created endpointId.
9989
- return (_a = matchingConnections.pop()) === null || _a === void 0 ? void 0 : _a.endpointId;
9997
+ return matchingConnections.pop()?.endpointId;
9990
9998
  }
9991
9999
  // eslint-disable-next-line class-methods-use-this
9992
10000
  static clientIdentityIncludesEndpointId(subscriptionIdentity) {
@@ -10029,9 +10037,10 @@ class MessageReceiver extends base_1$h.Base {
10029
10037
  wire.registerMessageHandler(this.onmessage.bind(this));
10030
10038
  }
10031
10039
  async processChannelMessage(msg) {
10032
- var _a, _b;
10033
10040
  const { senderIdentity, providerIdentity, action, ackToSender, payload, intendedTargetIdentity } = msg.payload;
10034
- const key = (_b = (_a = intendedTargetIdentity.channelId) !== null && _a !== void 0 ? _a : intendedTargetIdentity.endpointId) !== null && _b !== void 0 ? _b : this.latestEndpointIdByChannelId.get(providerIdentity.channelId); // No endpointId was passed, make best attempt
10041
+ const key = intendedTargetIdentity.channelId ?? // The recipient is a provider
10042
+ intendedTargetIdentity.endpointId ?? // The recipient is a client
10043
+ this.latestEndpointIdByChannelId.get(providerIdentity.channelId); // No endpointId was passed, make best attempt
10035
10044
  const handler = this.endpointMap.get(key);
10036
10045
  if (!handler) {
10037
10046
  ackToSender.payload.success = false;
@@ -10111,12 +10120,9 @@ class ProtocolManager {
10111
10120
  return supported;
10112
10121
  };
10113
10122
  this.getCompatibleProtocols = (providerProtocols, clientOffer) => {
10114
- const supported = clientOffer.supportedProtocols.filter((clientProtocol) => providerProtocols.some((providerProtocol) => {
10115
- var _a;
10116
- return providerProtocol.type === clientProtocol.type &&
10117
- clientProtocol.version >= providerProtocol.minimumVersion &&
10118
- providerProtocol.version >= ((_a = clientProtocol.minimumVersion) !== null && _a !== void 0 ? _a : 0);
10119
- }));
10123
+ const supported = clientOffer.supportedProtocols.filter((clientProtocol) => providerProtocols.some((providerProtocol) => providerProtocol.type === clientProtocol.type &&
10124
+ clientProtocol.version >= providerProtocol.minimumVersion &&
10125
+ providerProtocol.version >= (clientProtocol.minimumVersion ?? 0)));
10120
10126
  return supported.slice(0, clientOffer.maxProtocols);
10121
10127
  };
10122
10128
  }
@@ -10241,7 +10247,7 @@ class ConnectionManager extends base_1$g.Base {
10241
10247
  }
10242
10248
  createProvider(options, providerIdentity) {
10243
10249
  const opts = Object.assign(this.wire.environment.getDefaultChannelOptions().create, options || {});
10244
- const protocols = this.protocolManager.getProviderProtocols(opts === null || opts === void 0 ? void 0 : opts.protocols);
10250
+ const protocols = this.protocolManager.getProviderProtocols(opts?.protocols);
10245
10251
  const createSingleStrategy = (stratType) => {
10246
10252
  switch (stratType) {
10247
10253
  case 'rtc':
@@ -10278,7 +10284,7 @@ class ConnectionManager extends base_1$g.Base {
10278
10284
  return channel;
10279
10285
  }
10280
10286
  async createClientOffer(options) {
10281
- const protocols = this.protocolManager.getClientProtocols(options === null || options === void 0 ? void 0 : options.protocols);
10287
+ const protocols = this.protocolManager.getClientProtocols(options?.protocols);
10282
10288
  let rtcPacket;
10283
10289
  const supportedProtocols = await Promise.all(protocols.map(async (type) => {
10284
10290
  switch (type) {
@@ -10306,14 +10312,13 @@ class ConnectionManager extends base_1$g.Base {
10306
10312
  };
10307
10313
  }
10308
10314
  async createClientStrategy(rtcPacket, routingInfo) {
10309
- var _a;
10310
10315
  if (!routingInfo.endpointId) {
10311
10316
  routingInfo.endpointId = this.wire.environment.getNextMessageId();
10312
10317
  // For New Clients connecting to Old Providers. To prevent multi-dispatching and publishing, we delete previously-connected
10313
10318
  // clients that are in the same context as the newly-connected client.
10314
10319
  __classPrivateFieldGet$8(this, _ConnectionManager_messageReceiver, "f").checkForPreviousClientConnection(routingInfo.channelId);
10315
10320
  }
10316
- const answer = (_a = routingInfo.answer) !== null && _a !== void 0 ? _a : {
10321
+ const answer = routingInfo.answer ?? {
10317
10322
  supportedProtocols: [{ type: 'classic', version: 1 }]
10318
10323
  };
10319
10324
  const createStrategyFromAnswer = async (protocol) => {
@@ -10371,7 +10376,7 @@ class ConnectionManager extends base_1$g.Base {
10371
10376
  if (!(provider instanceof provider_1$1.ChannelProvider)) {
10372
10377
  throw Error('Cannot connect to a channel client');
10373
10378
  }
10374
- const offer = clientOffer !== null && clientOffer !== void 0 ? clientOffer : {
10379
+ const offer = clientOffer ?? {
10375
10380
  supportedProtocols: [{ type: 'classic', version: 1 }],
10376
10381
  maxProtocols: 1
10377
10382
  };
@@ -10429,6 +10434,15 @@ class ConnectionManager extends base_1$g.Base {
10429
10434
  connectionManager.ConnectionManager = ConnectionManager;
10430
10435
  _ConnectionManager_messageReceiver = new WeakMap(), _ConnectionManager_rtcConnectionManager = new WeakMap();
10431
10436
 
10437
+ /**
10438
+ * Entry points for the `Channel` subset of the `InterApplicationBus` API (`fin.InterApplicationBus.Channel`).
10439
+ *
10440
+ * * {@link Channel} contains static members of the `Channel` API, accessible through `fin.InterApplicationBus.Channel`.
10441
+ * * {@link OpenFin.ChannelClient} describes a client of a channel, e.g. as returned by `fin.InterApplicationBus.Channel.connect`.
10442
+ * * {@link OpenFin.ChannelProvider} describes a provider of a channel, e.g. as returned by `fin.InterApplicationBus.Channel.create`.
10443
+ *
10444
+ * @packageDocumentation
10445
+ */
10432
10446
  var __classPrivateFieldSet$5 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
10433
10447
  if (kind === "m") throw new TypeError("Private method is not writable");
10434
10448
  if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
@@ -10444,7 +10458,7 @@ var _Channel_connectionManager, _Channel_internalEmitter, _Channel_readyToConnec
10444
10458
  Object.defineProperty(channel$1, "__esModule", { value: true });
10445
10459
  channel$1.Channel = void 0;
10446
10460
  /* eslint-disable no-console */
10447
- const events_1$5 = eventsExports;
10461
+ const events_1$5 = require$$0;
10448
10462
  const lazy_1$1 = lazy;
10449
10463
  const base_1$f = base;
10450
10464
  const client_1 = client;
@@ -10764,7 +10778,14 @@ _Channel_connectionManager = new WeakMap(), _Channel_internalEmitter = new WeakM
10764
10778
 
10765
10779
  Object.defineProperty(interappbus, "__esModule", { value: true });
10766
10780
  interappbus.InterAppPayload = interappbus.InterApplicationBus = void 0;
10767
- const events_1$4 = eventsExports;
10781
+ /**
10782
+ * Entry point for the OpenFin `InterApplicationBus` API (`fin.InterApplicationBus`).
10783
+ *
10784
+ * * {@link InterApplicationBus} contains static members of the `InterApplicationBus` API, accessible through `fin.InterApplicationBus`.
10785
+ *
10786
+ * @packageDocumentation
10787
+ */
10788
+ const events_1$4 = require$$0;
10768
10789
  const base_1$e = base;
10769
10790
  const ref_counter_1 = refCounter;
10770
10791
  const index_1$2 = channel$1;
@@ -10972,6 +10993,13 @@ function createKey(...toHash) {
10972
10993
 
10973
10994
  var clipboard = {};
10974
10995
 
10996
+ /**
10997
+ * Entry point for the OpenFin `Clipboard` API (`fin.Clipboard`).
10998
+ *
10999
+ * * {@link Clipboard} contains static members of the `Clipboard` API, accessible through `fin.Clipboard`.
11000
+ *
11001
+ * @packageDocumentation
11002
+ */
10975
11003
  Object.defineProperty(clipboard, "__esModule", { value: true });
10976
11004
  clipboard.Clipboard = void 0;
10977
11005
  const base_1$d = base;
@@ -11186,7 +11214,7 @@ const base_1$c = base;
11186
11214
  /**
11187
11215
  * An ExternalApplication object representing native language adapter connections to the runtime. Allows
11188
11216
  * the developer to listen to {@link OpenFin.ExternalApplicationEvents external application events}.
11189
- * Discovery of connections is provided by <a href="tutorial-System.getAllExternalApplications.html">getAllExternalApplications.</a>
11217
+ * Discovery of connections is provided by {@link System.System.getAllExternalApplications getAllExternalApplications}.</a>
11190
11218
  *
11191
11219
  * Processes that can be wrapped as `ExternalApplication`s include the following:
11192
11220
  * - Processes which have connected to an OpenFin runtime via an adapter
@@ -11300,6 +11328,9 @@ Object.defineProperty(Factory$5, "__esModule", { value: true });
11300
11328
  Factory$5.ExternalApplicationModule = void 0;
11301
11329
  const base_1$b = base;
11302
11330
  const Instance_1$4 = Instance$4;
11331
+ /**
11332
+ * Static namespace for OpenFin API methods that interact with the {@link ExternalApplication} class, available under `fin.ExternalApplication`.
11333
+ */
11303
11334
  class ExternalApplicationModule extends base_1$b.Base {
11304
11335
  /**
11305
11336
  * Asynchronously returns an External Application object that represents an external application.
@@ -11359,9 +11390,9 @@ Factory$5.ExternalApplicationModule = ExternalApplicationModule;
11359
11390
  };
11360
11391
  Object.defineProperty(exports, "__esModule", { value: true });
11361
11392
  /**
11362
- * Entry points for the OpenFin `ExternalApplication` API.
11393
+ * Entry points for the OpenFin `ExternalApplication` API (`fin.ExternalApplication`).
11363
11394
  *
11364
- * * {@link ExternalApplicationModule} contains static methods relating to the `ExternalApplication` type, accessible through `fin.ExternalApplication`.
11395
+ * * {@link ExternalApplicationModule} contains static members of the `ExternalApplication` type, accessible through `fin.ExternalApplication`.
11365
11396
  * * {@link ExternalApplication} describes an instance of an OpenFin ExternalApplication, e.g. as returned by `fin.ExternalApplication.getCurrent`.
11366
11397
  *
11367
11398
  * These are separate code entities, and are documented separately. In the [previous version of the API documentation](https://cdn.openfin.co/docs/javascript/canary/index.html),
@@ -11370,7 +11401,7 @@ Factory$5.ExternalApplicationModule = ExternalApplicationModule;
11370
11401
  * @packageDocumentation
11371
11402
  */
11372
11403
  __exportStar(Factory$5, exports);
11373
- __exportStar(Instance$4, exports);
11404
+ __exportStar(Instance$4, exports);
11374
11405
  } (externalApplication));
11375
11406
 
11376
11407
  var frame = {};
@@ -11527,6 +11558,9 @@ Factory$4._FrameModule = void 0;
11527
11558
  const base_1$9 = base;
11528
11559
  const validate_1$2 = validate;
11529
11560
  const Instance_1$3 = Instance$3;
11561
+ /**
11562
+ * Static namespace for OpenFin API methods that interact with the {@link _Frame} class, available under `fin.Frame`.
11563
+ */
11530
11564
  class _FrameModule extends base_1$9.Base {
11531
11565
  /**
11532
11566
  * Asynchronously returns a reference to the specified frame. The frame does not have to exist
@@ -11607,12 +11641,12 @@ Factory$4._FrameModule = _FrameModule;
11607
11641
 
11608
11642
  (function (exports) {
11609
11643
  /**
11610
- * Entry points for the OpenFin `Frame` API.
11644
+ * Entry points for the OpenFin `Frame` API (`fin.Frame`).
11611
11645
  *
11612
- * * {@link _FrameModule} contains static methods relating to the `Frame` type, accessible through `fin.Frame`.
11646
+ * * {@link _FrameModule} contains static members of the `Frame` API, accessible through `fin.Frame`.
11613
11647
  * * {@link _Frame} describes an instance of an OpenFin Frame, e.g. as returned by `fin.Frame.getCurrent`.
11614
11648
  *
11615
- * These are separate code entities, and are documented separately. In the [previous version of the API documentation](https://cdn.openfin.co/docs/javascript/canary/index.html),
11649
+ * These are separate code entities, and are documented separately. In the [previous version of the API documentation](https://cdn.openfin.co/docs/javascript/canary/index.html),
11616
11650
  * both of these were documented on the same page.
11617
11651
  *
11618
11652
  * Underscore prefixing of OpenFin types that alias DOM entities will be fixed in a future version.
@@ -11635,7 +11669,7 @@ Factory$4._FrameModule = _FrameModule;
11635
11669
  };
11636
11670
  Object.defineProperty(exports, "__esModule", { value: true });
11637
11671
  __exportStar(Factory$4, exports);
11638
- __exportStar(Instance$3, exports);
11672
+ __exportStar(Instance$3, exports);
11639
11673
  } (frame));
11640
11674
 
11641
11675
  var globalHotkey = {};
@@ -11658,6 +11692,8 @@ class GlobalHotkey extends base_1$8.EmitterBase {
11658
11692
  * Registers a global hotkey with the operating system.
11659
11693
  * @param hotkey a hotkey string
11660
11694
  * @param listener called when the registered hotkey is pressed by the user.
11695
+ * @throws If the `hotkey` is reserved, see list below.
11696
+ * @throws if the `hotkey` is already registered by another application.
11661
11697
  *
11662
11698
  * @remarks The `hotkey` parameter expects an electron compatible [accelerator](https://github.com/electron/electron/blob/master/docs/api/accelerator.md) and the `listener` will be called if the `hotkey` is pressed by the user.
11663
11699
  * If successfull, the hotkey will be 'claimed' by the application, meaning that this register call can be called multiple times from within the same application but will fail if another application has registered the hotkey.
@@ -11750,7 +11786,7 @@ class GlobalHotkey extends base_1$8.EmitterBase {
11750
11786
  return undefined;
11751
11787
  }
11752
11788
  /**
11753
- * Checks if a given hotkey has been registered
11789
+ * Checks if a given hotkey has been registered by an application within the current runtime.
11754
11790
  * @param hotkey a hotkey string
11755
11791
  *
11756
11792
  * @example
@@ -11794,10 +11830,8 @@ const validate_1$1 = validate;
11794
11830
  const clientMap = new Map();
11795
11831
  /** Manages the life cycle of windows and views in the application.
11796
11832
  *
11797
- * Enables taking snapshots of itself and applyi
11798
- * ng them to restore a previous configuration
11833
+ * Enables taking snapshots of itself and applying them to restore a previous configuration
11799
11834
  * as well as listen to {@link OpenFin.PlatformEvents platform events}.
11800
- *
11801
11835
  */
11802
11836
  class Platform extends base_1$7.EmitterBase {
11803
11837
  /**
@@ -12156,15 +12190,13 @@ class Platform extends base_1$7.EmitterBase {
12156
12190
  });
12157
12191
  }
12158
12192
  /**
12159
- * ***DEPRECATED - please use Platform.createView.***
12193
+ * ***DEPRECATED - please use {@link Platform.createView Platform.createView}.***
12160
12194
  * Reparents a specified view in a new target window.
12161
12195
  * @param viewIdentity View identity
12162
12196
  * @param target new owner window identity
12163
12197
  *
12164
- * @tutorial Platform.createView
12165
12198
  */
12166
12199
  async reparentView(viewIdentity, target) {
12167
- var _a;
12168
12200
  // eslint-disable-next-line no-console
12169
12201
  console.warn('Platform.reparentView has been deprecated, please use Platform.createView');
12170
12202
  this.wire.sendAction('platform-reparent-view', this.identity).catch((e) => {
@@ -12172,7 +12204,7 @@ class Platform extends base_1$7.EmitterBase {
12172
12204
  });
12173
12205
  const normalizedViewIdentity = {
12174
12206
  ...viewIdentity,
12175
- uuid: (_a = viewIdentity.uuid) !== null && _a !== void 0 ? _a : this.identity.uuid
12207
+ uuid: viewIdentity.uuid ?? this.identity.uuid
12176
12208
  };
12177
12209
  const view = await this.fin.View.wrap(normalizedViewIdentity);
12178
12210
  const viewOptions = await view.getOptions();
@@ -12655,6 +12687,138 @@ const base_1$6 = base;
12655
12687
  const common_utils_1 = commonUtils;
12656
12688
  const layout_entities_1 = layoutEntities;
12657
12689
  const layout_constants_1 = layout_constants;
12690
+ /**
12691
+ *
12692
+ * Layouts give app providers the ability to embed multiple views in a single window. The Layout namespace
12693
+ * enables the initialization and manipulation of a window's Layout. A Layout will
12694
+ * emit events locally on the DOM element representing the layout-container.
12695
+ *
12696
+ *
12697
+ * ### Layout.DOMEvents
12698
+ *
12699
+ * When a Layout is created, it emits events onto the DOM element representing the Layout container.
12700
+ * This Layout container is the DOM element referenced by containerId in {@link Layout.LayoutModule#init Layout.init}.
12701
+ * You can use the built-in event emitter to listen to these events using [addEventListener](https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener).
12702
+ * The events are emitted synchronously and only in the process where the Layout exists.
12703
+ * Any values returned by the called listeners are ignored and will be discarded.
12704
+ * If the target DOM element is destroyed, any events that have been set up on that element will be destroyed.
12705
+ *
12706
+ * @remarks The built-in event emitter is not an OpenFin event emitter so it doesn't share propagation semantics.
12707
+ *
12708
+ * #### {@link https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener addEventListener(type, listener [, options]);}
12709
+ * Adds a listener to the end of the listeners array for the specified event.
12710
+ * @example
12711
+ * ```js
12712
+ * const myLayoutContainer = document.getElementById('layout-container');
12713
+ *
12714
+ * myLayoutContainer.addEventListener('tab-created', function(event) {
12715
+ * const { tabSelector } = event.detail;
12716
+ * const tabElement = document.getElementById(tabSelector);
12717
+ * const existingColor = tabElement.style.backgroundColor;
12718
+ * tabElement.style.backgroundColor = "red";
12719
+ * setTimeout(() => {
12720
+ * tabElement.style.backgroundColor = existingColor;
12721
+ * }, 2000);
12722
+ * });
12723
+ * ```
12724
+ *
12725
+ * #### {@link https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/removeEventListener removeEventListener(type, listener [, options]);}
12726
+ * Adds a listener to the end of the listeners array for the specified event.
12727
+ * @example
12728
+ * ```js
12729
+ * const myLayoutContainer = document.getElementById('layout-container');
12730
+ *
12731
+ * const listener = function(event) {
12732
+ * console.log(event.detail);
12733
+ * console.log('container-created event fired once, removing listener');
12734
+ * myLayoutContainer.removeEventListener('container-created', listener);
12735
+ * };
12736
+ *
12737
+ * myLayoutContainer.addEventListener('container-created', listener);
12738
+ * ```
12739
+ *
12740
+ * ### Supported event types are:
12741
+ *
12742
+ * * tab-created
12743
+ * * container-created
12744
+ * * layout-state-changed
12745
+ * * tab-closed
12746
+ * * tab-dropped
12747
+ *
12748
+ * ### Layout DOM Node Events
12749
+ *
12750
+ * #### tab-created
12751
+ * Generated when a tab is created. As a user drags and drops tabs within window, new tabs are created. A single view may have multiple tabs created and destroyed during its lifetime attached to a single window.
12752
+ * ```js
12753
+ * // The response has the following shape in event.detail:
12754
+ * {
12755
+ * containerSelector: "container-component_A",
12756
+ * name: "component_A",
12757
+ * tabSelector: "tab-component_A",
12758
+ * topic: "openfin-DOM-event",
12759
+ * type: "tab-created",
12760
+ * uuid: "OpenFin POC"
12761
+ * }
12762
+ * ```
12763
+ *
12764
+ * #### container-created
12765
+ * Generated when a container is created. A single view will have only one container during its lifetime attached to a single window and the container's lifecycle is tied to the view. To discover when the container is destroyed, please listen to view-detached event.
12766
+ * ```js
12767
+ * // The response has the following shape in event.detail:
12768
+ * {
12769
+ * containerSelector: "container-component_A",
12770
+ * name: "component_A",
12771
+ * tabSelector: "tab-component_A",
12772
+ * topic: "openfin-DOM-event",
12773
+ * type: "container-created",
12774
+ * uuid: "OpenFin POC"
12775
+ * }
12776
+ * ```
12777
+ *
12778
+ * ### layout-state-changed
12779
+ * Generated when the state of the layout changes in any way, such as a view added/removed/replaced. Note that this event can fire frequently as the underlying layout can change multiple components from all kinds of changes (resizing for example). Given this, it is recommended to debounce this event and then you can use the {@link Layout#getConfig Layout.getConfig} API to retrieve the most up-to-date state.
12780
+ * ```js
12781
+ * // The response has the following shape in event.detail
12782
+ * {
12783
+ * containerSelector: "container-component_A",
12784
+ * name: "component_A",
12785
+ * tabSelector: "tab-component_A",
12786
+ * topic: "openfin-DOM-event",
12787
+ * type: "layout-state-changed",
12788
+ * uuid: "OpenFin POC"
12789
+ * }
12790
+ * ```
12791
+ *
12792
+ * #### tab-closed
12793
+ * Generated when a tab is closed.
12794
+ * ```js
12795
+ * // The response has the following shape in event.detail:
12796
+ * {
12797
+ * containerSelector: "container-component_A",
12798
+ * name: "component_A",
12799
+ * tabSelector: "tab-component_A",
12800
+ * topic: "openfin-DOM-event",
12801
+ * type: "tab-closed",
12802
+ * uuid: "OpenFin POC",
12803
+ * url: "http://openfin.co" // The url of the view that was closed.
12804
+ * }
12805
+ * ```
12806
+ *
12807
+ * #### tab-dropped
12808
+ * Generated when a tab is dropped.
12809
+ * ```js
12810
+ * // The response has the following shape in event.detail:
12811
+ * {
12812
+ * containerSelector: "container-component_A",
12813
+ * name: "component_A",
12814
+ * tabSelector: "tab-component_A",
12815
+ * topic: "openfin-DOM-event",
12816
+ * type: "tab-dropped",
12817
+ * uuid: "OpenFin POC",
12818
+ * url: "http://openfin.co" // The url of the view linked to the dropped tab.
12819
+ * }
12820
+ * ```
12821
+ */
12658
12822
  class Layout extends base_1$6.Base {
12659
12823
  /**
12660
12824
  * @internal
@@ -12828,10 +12992,30 @@ class Layout extends base_1$6.Base {
12828
12992
  // don't expose
12829
12993
  });
12830
12994
  const client = await this.platform.getClient();
12995
+ console.log(`Layout::toConfig() called!`);
12831
12996
  return client.dispatch('get-frame-snapshot', {
12832
12997
  target: this.identity
12833
12998
  });
12834
12999
  }
13000
+ /**
13001
+ * Retrieves the attached views in current window layout.
13002
+ *
13003
+ * @example
13004
+ * ```js
13005
+ * const layout = fin.Platform.Layout.getCurrentSync();
13006
+ * const views = await layout.getCurrentViews();
13007
+ * ```
13008
+ */
13009
+ async getCurrentViews() {
13010
+ this.wire.sendAction('layout-get-views').catch((e) => {
13011
+ // don't expose
13012
+ });
13013
+ const client = await this.platform.getClient();
13014
+ const viewIdentities = await client.dispatch('get-layout-views', {
13015
+ target: this.identity
13016
+ });
13017
+ return viewIdentities.map((identity) => this.fin.View.wrapSync(identity));
13018
+ }
12835
13019
  /**
12836
13020
  * Retrieves the top level content item of the layout.
12837
13021
  *
@@ -12858,7 +13042,7 @@ class Layout extends base_1$6.Base {
12858
13042
  // don't expose
12859
13043
  });
12860
13044
  const client = await __classPrivateFieldGet$5(this, _Layout_layoutClient, "f").getValue();
12861
- const root = await client.getRoot();
13045
+ const root = await client.getRoot(this.identity);
12862
13046
  return layout_entities_1.LayoutNode.getEntity(root, client);
12863
13047
  }
12864
13048
  }
@@ -12876,16 +13060,20 @@ var __classPrivateFieldSet$4 = (commonjsGlobal && commonjsGlobal.__classPrivateF
12876
13060
  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");
12877
13061
  return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
12878
13062
  };
12879
- var _LayoutModule_layoutInitializationAttempted;
13063
+ var _LayoutModule_layoutInitializationAttempted, _LayoutModule_layoutManager;
12880
13064
  Object.defineProperty(Factory$2, "__esModule", { value: true });
12881
13065
  Factory$2.LayoutModule = void 0;
12882
13066
  /* eslint-disable no-undef, import/prefer-default-export */
12883
13067
  const base_1$5 = base;
12884
13068
  const Instance_1$2 = Instance$1;
13069
+ /**
13070
+ * Static namespace for OpenFin API methods that interact with the {@link Layout} class, available under `fin.Platform.Layout`.
13071
+ */
12885
13072
  class LayoutModule extends base_1$5.Base {
12886
13073
  constructor() {
12887
13074
  super(...arguments);
12888
13075
  _LayoutModule_layoutInitializationAttempted.set(this, false);
13076
+ _LayoutModule_layoutManager.set(this, null);
12889
13077
  /**
12890
13078
  * Initialize the window's Layout.
12891
13079
  *
@@ -12935,7 +13123,17 @@ class LayoutModule extends base_1$5.Base {
12935
13123
  throw new Error('Layout for this window already initialized, please use Layout.replace call to replace the layout.');
12936
13124
  }
12937
13125
  __classPrivateFieldSet$4(this, _LayoutModule_layoutInitializationAttempted, true, "f");
12938
- return this.wire.environment.initLayout(this.fin, this.wire, options);
13126
+ // TODO: remove this.wire and always use this.fin
13127
+ __classPrivateFieldSet$4(this, _LayoutModule_layoutManager, await this.wire.environment.initLayout(this.fin, this.wire, options), "f");
13128
+ // TODO: if create() wasn't called, warn!! aka, if lm.getLayouts().length === 0
13129
+ const layoutInstance = await __classPrivateFieldGet$4(this, _LayoutModule_layoutManager, "f").resolveLayout();
13130
+ const layout = this.wrapSync(layoutInstance.identity);
13131
+ // Adding this to the returned instance undocumented/typed for Browser
13132
+ // TODO: if not overridden, then return layoutManager: layoutInstance
13133
+ return Object.assign(layout, { layoutManager: layoutInstance });
13134
+ };
13135
+ this.getCurrentLayoutManagerSync = () => {
13136
+ return __classPrivateFieldGet$4(this, _LayoutModule_layoutManager, "f");
12939
13137
  };
12940
13138
  }
12941
13139
  /**
@@ -13033,13 +13231,13 @@ class LayoutModule extends base_1$5.Base {
13033
13231
  }
13034
13232
  }
13035
13233
  Factory$2.LayoutModule = LayoutModule;
13036
- _LayoutModule_layoutInitializationAttempted = new WeakMap();
13234
+ _LayoutModule_layoutInitializationAttempted = new WeakMap(), _LayoutModule_layoutManager = new WeakMap();
13037
13235
 
13038
13236
  (function (exports) {
13039
13237
  /**
13040
- * Entry point for the OpenFin `Layout` namespace.
13238
+ * Entry point for the OpenFin `Layout` subset of the `Platform` API (`fin.Platform.Layout`).
13041
13239
  *
13042
- * * {@link LayoutModule} contains static methods relating to the `Layout` type, accessible through `fin.Platform.Layout`.
13240
+ * * {@link LayoutModule} contains static members of the `Layout` API, accessible through `fin.Platform.Layout`.
13043
13241
  * * {@link Layout} describes an instance of an OpenFin Layout, e.g. as returned by `fin.Platform.Layout.getCurrent`.
13044
13242
  *
13045
13243
  * These are separate code entities, and are documented separately. In the [previous version of the API documentation](https://cdn.openfin.co/docs/javascript/canary/index.html),
@@ -13047,131 +13245,6 @@ _LayoutModule_layoutInitializationAttempted = new WeakMap();
13047
13245
  *
13048
13246
  * @packageDocumentation
13049
13247
  *
13050
- *
13051
- * ### Layout.DOMEvents
13052
- *
13053
- * When a Layout is created, it emits events onto the DOM element representing the Layout container.
13054
- * This Layout container is the DOM element referenced by containerId in {@link Layout.LayoutModule#init Layout.init}.
13055
- * You can use the built-in event emitter to listen to these events using [addEventListener](https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener).
13056
- * The events are emitted synchronously and only in the process where the Layout exists.
13057
- * Any values returned by the called listeners are ignored and will be discarded.
13058
- * If the target DOM element is destroyed, any events that have been set up on that element will be destroyed.
13059
- *
13060
- * @remarks The built-in event emitter is not an OpenFin event emitter so it doesn't share propagation semantics.
13061
- *
13062
- * #### {@link https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener addEventListener(type, listener [, options]);}
13063
- * Adds a listener to the end of the listeners array for the specified event.
13064
- * @example
13065
- * ```js
13066
- * const myLayoutContainer = document.getElementById('layout-container');
13067
- *
13068
- * myLayoutContainer.addEventListener('tab-created', function(event) {
13069
- * const { tabSelector } = event.detail;
13070
- * const tabElement = document.getElementById(tabSelector);
13071
- * const existingColor = tabElement.style.backgroundColor;
13072
- * tabElement.style.backgroundColor = "red";
13073
- * setTimeout(() => {
13074
- * tabElement.style.backgroundColor = existingColor;
13075
- * }, 2000);
13076
- * });
13077
- * ```
13078
- *
13079
- * #### {@link https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/removeEventListener removeEventListener(type, listener [, options]);}
13080
- * Adds a listener to the end of the listeners array for the specified event.
13081
- * @example
13082
- * ```js
13083
- * const myLayoutContainer = document.getElementById('layout-container');
13084
- *
13085
- * const listener = function(event) {
13086
- * console.log(event.detail);
13087
- * console.log('container-created event fired once, removing listener');
13088
- * myLayoutContainer.removeEventListener('container-created', listener);
13089
- * };
13090
- *
13091
- * myLayoutContainer.addEventListener('container-created', listener);
13092
- * ```
13093
- *
13094
- * ### Supported event types are:
13095
- *
13096
- * * tab-created
13097
- * * container-created
13098
- * * layout-state-changed
13099
- * * tab-closed
13100
- * * tab-dropped
13101
- *
13102
- * ### Layout DOM Node Events
13103
- *
13104
- * #### tab-created
13105
- * Generated when a tab is created. As a user drags and drops tabs within window, new tabs are created. A single view may have multiple tabs created and destroyed during its lifetime attached to a single window.
13106
- * ```js
13107
- * // The response has the following shape in event.detail:
13108
- * {
13109
- * containerSelector: "container-component_A",
13110
- * name: "component_A",
13111
- * tabSelector: "tab-component_A",
13112
- * topic: "openfin-DOM-event",
13113
- * type: "tab-created",
13114
- * uuid: "OpenFin POC"
13115
- * }
13116
- * ```
13117
- *
13118
- * #### container-created
13119
- * Generated when a container is created. A single view will have only one container during its lifetime attached to a single window and the container's lifecycle is tied to the view. To discover when the container is destroyed, please listen to view-detached event.
13120
- * ```js
13121
- * // The response has the following shape in event.detail:
13122
- * {
13123
- * containerSelector: "container-component_A",
13124
- * name: "component_A",
13125
- * tabSelector: "tab-component_A",
13126
- * topic: "openfin-DOM-event",
13127
- * type: "container-created",
13128
- * uuid: "OpenFin POC"
13129
- * }
13130
- * ```
13131
- *
13132
- * ### layout-state-changed
13133
- * Generated when the state of the layout changes in any way, such as a view added/removed/replaced. Note that this event can fire frequently as the underlying layout can change multiple components from all kinds of changes (resizing for example). Given this, it is recommended to debounce this event and then you can use the {@link Layout#getConfig Layout.getConfig} API to retrieve the most up-to-date state.
13134
- * ```js
13135
- * // The response has the following shape in event.detail
13136
- * {
13137
- * containerSelector: "container-component_A",
13138
- * name: "component_A",
13139
- * tabSelector: "tab-component_A",
13140
- * topic: "openfin-DOM-event",
13141
- * type: "layout-state-changed",
13142
- * uuid: "OpenFin POC"
13143
- * }
13144
- * ```
13145
- *
13146
- * #### tab-closed
13147
- * Generated when a tab is closed.
13148
- * ```js
13149
- * // The response has the following shape in event.detail:
13150
- * {
13151
- * containerSelector: "container-component_A",
13152
- * name: "component_A",
13153
- * tabSelector: "tab-component_A",
13154
- * topic: "openfin-DOM-event",
13155
- * type: "tab-closed",
13156
- * uuid: "OpenFin POC",
13157
- * url: "http://openfin.co" // The url of the view that was closed.
13158
- * }
13159
- * ```
13160
- *
13161
- * #### tab-dropped
13162
- * Generated when a tab is dropped.
13163
- * ```js
13164
- * // The response has the following shape in event.detail:
13165
- * {
13166
- * containerSelector: "container-component_A",
13167
- * name: "component_A",
13168
- * tabSelector: "tab-component_A",
13169
- * topic: "openfin-DOM-event",
13170
- * type: "tab-dropped",
13171
- * uuid: "OpenFin POC",
13172
- * url: "http://openfin.co" // The url of the view linked to the dropped tab.
13173
- * }
13174
- * ```
13175
13248
  */
13176
13249
  var __createBinding = (commonjsGlobal && commonjsGlobal.__createBinding) || (Object.create ? (function(o, m, k, k2) {
13177
13250
  if (k2 === undefined) k2 = k;
@@ -13189,7 +13262,7 @@ _LayoutModule_layoutInitializationAttempted = new WeakMap();
13189
13262
  };
13190
13263
  Object.defineProperty(exports, "__esModule", { value: true });
13191
13264
  __exportStar(Factory$2, exports);
13192
- __exportStar(Instance$1, exports);
13265
+ __exportStar(Instance$1, exports);
13193
13266
  } (layout));
13194
13267
 
13195
13268
  Object.defineProperty(Factory$3, "__esModule", { value: true });
@@ -13197,6 +13270,9 @@ Factory$3.PlatformModule = void 0;
13197
13270
  const base_1$4 = base;
13198
13271
  const Instance_1$1 = Instance$2;
13199
13272
  const index_1$1 = layout;
13273
+ /**
13274
+ * Static namespace for OpenFin API methods that interact with the {@link Platform} class, available under `fin.Platform`.
13275
+ */
13200
13276
  class PlatformModule extends base_1$4.Base {
13201
13277
  /**
13202
13278
  * @internal
@@ -13440,9 +13516,9 @@ Factory$3.PlatformModule = PlatformModule;
13440
13516
  };
13441
13517
  Object.defineProperty(exports, "__esModule", { value: true });
13442
13518
  /**
13443
- * Entry points for the OpenFin `Platform` API.
13519
+ * Entry points for the OpenFin `Platform` API (`fin.Platform`)
13444
13520
  *
13445
- * * {@link PlatformModule} contains static methods relating to the `Platform` type, accessible through `fin.Platform`.
13521
+ * * {@link PlatformModule} contains static members of the `Platform` API, accessible through `fin.Platform`.
13446
13522
  * * {@link Platform} describes an instance of an OpenFin Platform, e.g. as returned by `fin.Platform.getCurrent`.
13447
13523
  *
13448
13524
  * These are separate code entities, and are documented separately. In the [previous version of the API documentation](https://cdn.openfin.co/docs/javascript/canary/index.html),
@@ -13451,7 +13527,7 @@ Factory$3.PlatformModule = PlatformModule;
13451
13527
  * @packageDocumentation
13452
13528
  */
13453
13529
  __exportStar(Factory$3, exports);
13454
- __exportStar(Instance$2, exports);
13530
+ __exportStar(Instance$2, exports);
13455
13531
  } (platform));
13456
13532
 
13457
13533
  var me = {};
@@ -13589,7 +13665,7 @@ var me = {};
13589
13665
  };
13590
13666
  }
13591
13667
  }
13592
- exports.getMe = getMe;
13668
+ exports.getMe = getMe;
13593
13669
  } (me));
13594
13670
 
13595
13671
  var interop = {};
@@ -13692,9 +13768,8 @@ function requireSessionContextGroupBroker () {
13692
13768
  this.lastContext = context;
13693
13769
  const clientSubscriptionStates = Array.from(this.clients.values());
13694
13770
  clientSubscriptionStates.forEach((client) => {
13695
- var _a;
13696
13771
  // eslint-disable-next-line no-unused-expressions
13697
- (_a = client.contextHandlers.get(context.type)) === null || _a === void 0 ? void 0 : _a.forEach((handlerId) => {
13772
+ client.contextHandlers.get(context.type)?.forEach((handlerId) => {
13698
13773
  this.provider.dispatch(client.clientIdentity, handlerId, context);
13699
13774
  });
13700
13775
  if (client.globalHandler) {
@@ -13828,7 +13903,7 @@ var utils$1 = {};
13828
13903
  }
13829
13904
  };
13830
13905
  };
13831
- exports.wrapIntentHandler = wrapIntentHandler;
13906
+ exports.wrapIntentHandler = wrapIntentHandler;
13832
13907
  } (utils$1));
13833
13908
 
13834
13909
  var PrivateChannelProvider = {};
@@ -14301,10 +14376,10 @@ function requireInteropBroker () {
14301
14376
  this.getProvider = getProvider;
14302
14377
  this.interopClients = new Map();
14303
14378
  this.contextGroupsById = new Map();
14304
- if (options === null || options === void 0 ? void 0 : options.contextGroups) {
14379
+ if (options?.contextGroups) {
14305
14380
  contextGroups = options.contextGroups;
14306
14381
  }
14307
- if (options === null || options === void 0 ? void 0 : options.logging) {
14382
+ if (options?.logging) {
14308
14383
  this.logging = options.logging;
14309
14384
  }
14310
14385
  this.intentClientMap = new Map();
@@ -14439,18 +14514,17 @@ function requireInteropBroker () {
14439
14514
  *
14440
14515
  */
14441
14516
  getCurrentContext(getCurrentContextOptions, clientIdentity) {
14442
- var _a;
14443
14517
  this.wire.sendAction('interop-broker-get-current-context').catch((e) => {
14444
14518
  // don't expose, analytics-only call
14445
14519
  });
14446
14520
  const clientState = this.getClientState(clientIdentity);
14447
- if (!(clientState === null || clientState === void 0 ? void 0 : clientState.contextGroupId)) {
14521
+ if (!clientState?.contextGroupId) {
14448
14522
  throw new Error('You must be a member of a context group to call getCurrentContext');
14449
14523
  }
14450
14524
  const { contextGroupId } = clientState;
14451
14525
  const contextGroupState = this.contextGroupsById.get(contextGroupId);
14452
14526
  const lastContextType = this.lastContextMap.get(contextGroupId);
14453
- const contextType = (_a = getCurrentContextOptions === null || getCurrentContextOptions === void 0 ? void 0 : getCurrentContextOptions.contextType) !== null && _a !== void 0 ? _a : lastContextType;
14527
+ const contextType = getCurrentContextOptions?.contextType ?? lastContextType;
14454
14528
  return contextGroupState && contextType ? contextGroupState.get(contextType) : undefined;
14455
14529
  }
14456
14530
  /*
@@ -15101,10 +15175,9 @@ function requireInteropBroker () {
15101
15175
  }
15102
15176
  // Used to restore interop broker state in snapshots.
15103
15177
  applySnapshot(snapshot, options) {
15104
- var _a;
15105
- const contextGroupStates = (_a = snapshot === null || snapshot === void 0 ? void 0 : snapshot.interopSnapshotDetails) === null || _a === void 0 ? void 0 : _a.contextGroupStates;
15178
+ const contextGroupStates = snapshot?.interopSnapshotDetails?.contextGroupStates;
15106
15179
  if (contextGroupStates) {
15107
- if (!(options === null || options === void 0 ? void 0 : options.closeExistingWindows)) {
15180
+ if (!options?.closeExistingWindows) {
15108
15181
  this.updateExistingClients(contextGroupStates);
15109
15182
  }
15110
15183
  this.rehydrateContextGroupStates(contextGroupStates);
@@ -15155,7 +15228,7 @@ function requireInteropBroker () {
15155
15228
  contextHandlerRegistered({ contextType, handlerId }, clientIdentity) {
15156
15229
  const handlerInfo = { contextType, handlerId };
15157
15230
  const clientState = this.getClientState(clientIdentity);
15158
- clientState === null || clientState === void 0 ? void 0 : clientState.contextHandlers.set(handlerId, handlerInfo);
15231
+ clientState?.contextHandlers.set(handlerId, handlerInfo);
15159
15232
  if (clientState && clientState.contextGroupId) {
15160
15233
  const { contextGroupId } = clientState;
15161
15234
  const contextGroupMap = this.contextGroupsById.get(contextGroupId);
@@ -15177,7 +15250,7 @@ function requireInteropBroker () {
15177
15250
  async intentHandlerRegistered(payload, clientIdentity) {
15178
15251
  const { handlerId } = payload;
15179
15252
  const clientIntentInfo = this.intentClientMap.get(clientIdentity.name);
15180
- const handlerInfo = clientIntentInfo === null || clientIntentInfo === void 0 ? void 0 : clientIntentInfo.get(handlerId);
15253
+ const handlerInfo = clientIntentInfo?.get(handlerId);
15181
15254
  if (!clientIntentInfo) {
15182
15255
  this.intentClientMap.set(clientIdentity.name, new Map());
15183
15256
  const newHandlerInfoMap = this.intentClientMap.get(clientIdentity.name);
@@ -15346,8 +15419,8 @@ function requireInteropBroker () {
15346
15419
  clientIdentity
15347
15420
  };
15348
15421
  // Only allow the client to join a contextGroup that actually exists.
15349
- if ((payload === null || payload === void 0 ? void 0 : payload.currentContextGroup) && this.contextGroupsById.has(payload.currentContextGroup)) {
15350
- clientSubscriptionState.contextGroupId = payload === null || payload === void 0 ? void 0 : payload.currentContextGroup;
15422
+ if (payload?.currentContextGroup && this.contextGroupsById.has(payload.currentContextGroup)) {
15423
+ clientSubscriptionState.contextGroupId = payload?.currentContextGroup;
15351
15424
  }
15352
15425
  this.interopClients.set(clientIdentity.endpointId, clientSubscriptionState);
15353
15426
  });
@@ -15365,17 +15438,15 @@ function requireInteropBroker () {
15365
15438
  this.clientDisconnected(clientIdentity);
15366
15439
  });
15367
15440
  channel.beforeAction(async (action, payload, clientIdentity) => {
15368
- var _a, _b;
15369
15441
  if (!(await this.isActionAuthorized(action, payload, clientIdentity))) {
15370
15442
  throw new Error(`Action (${action}) not authorized for ${clientIdentity.uuid}, ${clientIdentity.name}`);
15371
15443
  }
15372
- if ((_b = (_a = this.logging) === null || _a === void 0 ? void 0 : _a.beforeAction) === null || _b === void 0 ? void 0 : _b.enabled) {
15444
+ if (this.logging?.beforeAction?.enabled) {
15373
15445
  console.log(action, payload, clientIdentity);
15374
15446
  }
15375
15447
  });
15376
15448
  channel.afterAction((action, payload, clientIdentity) => {
15377
- var _a, _b;
15378
- if ((_b = (_a = this.logging) === null || _a === void 0 ? void 0 : _a.afterAction) === null || _b === void 0 ? void 0 : _b.enabled) {
15449
+ if (this.logging?.afterAction?.enabled) {
15379
15450
  console.log(action, payload, clientIdentity);
15380
15451
  }
15381
15452
  });
@@ -16224,9 +16295,8 @@ function requireOverrideCheck () {
16224
16295
  overrideCheck.overrideCheck = overrideCheck.getDefaultViewFdc3VersionFromAppInfo = void 0;
16225
16296
  const InteropBroker_1 = requireInteropBroker();
16226
16297
  function getDefaultViewFdc3VersionFromAppInfo({ manifest, initialOptions }) {
16227
- var _a, _b, _c, _d;
16228
- const setVersion = (_c = (_b = (_a = manifest.platform) === null || _a === void 0 ? void 0 : _a.defaultViewOptions) === null || _b === void 0 ? void 0 : _b.fdc3InteropApi) !== null && _c !== void 0 ? _c : (_d = initialOptions.defaultViewOptions) === null || _d === void 0 ? void 0 : _d.fdc3InteropApi;
16229
- return ['1.2', '2.0'].includes(setVersion !== null && setVersion !== void 0 ? setVersion : '') ? setVersion : undefined;
16298
+ const setVersion = manifest.platform?.defaultViewOptions?.fdc3InteropApi ?? initialOptions.defaultViewOptions?.fdc3InteropApi;
16299
+ return ['1.2', '2.0'].includes(setVersion ?? '') ? setVersion : undefined;
16230
16300
  }
16231
16301
  overrideCheck.getDefaultViewFdc3VersionFromAppInfo = getDefaultViewFdc3VersionFromAppInfo;
16232
16302
  // TODO: Unit test this
@@ -16299,13 +16369,12 @@ function requireFactory () {
16299
16369
  * ```
16300
16370
  */
16301
16371
  async init(name, override = defaultOverride) {
16302
- var _a;
16303
16372
  this.wire.sendAction('interop-init').catch(() => {
16304
16373
  // don't expose, analytics-only call
16305
16374
  });
16306
16375
  // Allows for manifest-level configuration, without having to override. (e.g. specifying custom context groups)
16307
16376
  const options = await this.fin.Application.getCurrentSync().getInfo();
16308
- const opts = (_a = options.initialOptions.interopBrokerConfiguration) !== null && _a !== void 0 ? _a : {};
16377
+ const opts = options.initialOptions.interopBrokerConfiguration ?? {};
16309
16378
  const objectThatThrows = (0, inaccessibleObject_1.createUnusableObject)(BrokerParamAccessError);
16310
16379
  const warningOptsClone = (0, inaccessibleObject_1.createWarningObject)(BrokerParamAccessError, (0, lodash_1.cloneDeep)(opts));
16311
16380
  let provider;
@@ -16373,9 +16442,9 @@ function requireInterop () {
16373
16442
  hasRequiredInterop = 1;
16374
16443
  (function (exports) {
16375
16444
  /**
16376
- * Entry point for the OpenFin Interop namespace.
16445
+ * Entry point for the OpenFin `Interop` API (`fin.Interop`).
16377
16446
  *
16378
- * * {@link InteropModule} contains static members of the `Interop` namespace (available under `fin.Interop`)
16447
+ * * {@link InteropModule} contains static members of the `Interop` API (available under `fin.Interop`)
16379
16448
  * * {@link InteropClient} and {@link InteropBroker} document instances of their respective classes.
16380
16449
  *
16381
16450
  * @packageDocumentation
@@ -16397,8 +16466,8 @@ function requireInterop () {
16397
16466
  Object.defineProperty(exports, "__esModule", { value: true });
16398
16467
  __exportStar(requireFactory(), exports);
16399
16468
  __exportStar(InteropClient$1, exports);
16400
- __exportStar(requireInteropBroker(), exports);
16401
- } (interop));
16469
+ __exportStar(requireInteropBroker(), exports);
16470
+ } (interop));
16402
16471
  return interop;
16403
16472
  }
16404
16473
 
@@ -16437,6 +16506,8 @@ const connectionMap = new Map();
16437
16506
  /**
16438
16507
  * Enables configuring a SnapshotSource with custom getSnapshot and applySnapshot methods.
16439
16508
  *
16509
+ * @typeParam Snapshot Implementation-defined shape of an application snapshot. Allows
16510
+ * custom snapshot implementations for legacy applications to define their own snapshot format.
16440
16511
  */
16441
16512
  class SnapshotSource extends base_1$1.Base {
16442
16513
  /**
@@ -16575,10 +16646,16 @@ Factory.SnapshotSourceModule = void 0;
16575
16646
  const base_1 = base;
16576
16647
  const Instance_1 = Instance;
16577
16648
  const utils_1 = utils;
16649
+ /**
16650
+ * Static namespace for OpenFin API methods that interact with the {@link SnapshotSource} class, available under `fin.SnapshotSource`.
16651
+ */
16578
16652
  class SnapshotSourceModule extends base_1.Base {
16579
16653
  /**
16580
16654
  * Initializes a SnapshotSource with the getSnapshot and applySnapshot methods defined.
16581
16655
  *
16656
+ * @typeParam Snapshot Implementation-defined shape of an application snapshot. Allows
16657
+ * custom snapshot implementations for legacy applications to define their own snapshot format.
16658
+ *
16582
16659
  * @example
16583
16660
  * ```js
16584
16661
  * const snapshotProvider = {
@@ -16594,6 +16671,7 @@ class SnapshotSourceModule extends base_1.Base {
16594
16671
  *
16595
16672
  * await fin.SnapshotSource.init(snapshotProvider);
16596
16673
  * ```
16674
+ *
16597
16675
  */
16598
16676
  async init(provider) {
16599
16677
  this.wire.sendAction('snapshot-source-init').catch((e) => {
@@ -16648,10 +16726,10 @@ Factory.SnapshotSourceModule = SnapshotSourceModule;
16648
16726
 
16649
16727
  (function (exports) {
16650
16728
  /**
16651
- * Entry points for the OpenFin `SnapshotSource` API.
16729
+ * Entry points for the OpenFin `SnapshotSource` API (`fin.SnapshotSource`).
16652
16730
  *
16653
- * * {@link SnapshotSourceModule} contains static methods relating to the `SnapshotSource` type, accessible through `fin.SnapshotSource`.
16654
- * * {@link SnapshotSource} describes an instance of an OpenFin SnapshotSource, e.g. as returned by `fin.SnapshotSource.getCurrent`.
16731
+ * * {@link SnapshotSourceModule} contains static members of the `SnapshotSource` API, accessible through `fin.SnapshotSource`.
16732
+ * * {@link SnapshotSource} describes an instance of an OpenFin SnapshotSource, e.g. as returned by `fin.SnapshotSource.wrap`.
16655
16733
  *
16656
16734
  * These are separate code entities, and are documented separately. In the [previous version of the API documentation](https://cdn.openfin.co/docs/javascript/canary/index.html),
16657
16735
  * both of these were documented on the same page.
@@ -16674,12 +16752,12 @@ Factory.SnapshotSourceModule = SnapshotSourceModule;
16674
16752
  };
16675
16753
  Object.defineProperty(exports, "__esModule", { value: true });
16676
16754
  __exportStar(Factory, exports);
16677
- __exportStar(Instance, exports);
16755
+ __exportStar(Instance, exports);
16678
16756
  } (snapshotSource));
16679
16757
 
16680
16758
  Object.defineProperty(fin, "__esModule", { value: true });
16681
16759
  fin.Fin = void 0;
16682
- const events_1$3 = eventsExports;
16760
+ const events_1$3 = require$$0;
16683
16761
  // Import from the file rather than the directory in case someone consuming types is using module resolution other than "node"
16684
16762
  const index_1 = system;
16685
16763
  const index_2 = requireWindow();
@@ -16694,6 +16772,9 @@ const index_10 = platform;
16694
16772
  const me_1$2 = me;
16695
16773
  const interop_1 = requireInterop();
16696
16774
  const snapshot_source_1 = snapshotSource;
16775
+ /**
16776
+ * @internal
16777
+ */
16697
16778
  class Fin extends events_1$3.EventEmitter {
16698
16779
  /**
16699
16780
  * @internal
@@ -16728,7 +16809,7 @@ var transport = {};
16728
16809
  var wire = {};
16729
16810
 
16730
16811
  Object.defineProperty(wire, "__esModule", { value: true });
16731
- wire.isInternalConnectConfig = wire.isPortDiscoveryConfig = wire.isNewConnectConfig = wire.isRemoteConfig = wire.isExistingConnectConfig = wire.isExternalConfig = void 0;
16812
+ wire.isInternalConnectConfig = wire.isPortDiscoveryConfig = wire.isNewConnectConfig = wire.isConfigWithReceiver = wire.isRemoteConfig = wire.isExistingConnectConfig = wire.isExternalConfig = void 0;
16732
16813
  function isExternalConfig(config) {
16733
16814
  if (typeof config.manifestUrl === 'string') {
16734
16815
  return true;
@@ -16744,6 +16825,10 @@ function isRemoteConfig(config) {
16744
16825
  return isExistingConnectConfig(config) && typeof config.token === 'string';
16745
16826
  }
16746
16827
  wire.isRemoteConfig = isRemoteConfig;
16828
+ function isConfigWithReceiver(config) {
16829
+ return typeof config.receiver === 'object' && isRemoteConfig({ ...config, address: '' });
16830
+ }
16831
+ wire.isConfigWithReceiver = isConfigWithReceiver;
16747
16832
  function hasUuid(config) {
16748
16833
  return typeof config.uuid === 'string';
16749
16834
  }
@@ -16769,7 +16854,7 @@ var emitterMap = {};
16769
16854
 
16770
16855
  Object.defineProperty(emitterMap, "__esModule", { value: true });
16771
16856
  emitterMap.EmitterMap = void 0;
16772
- const events_1$2 = eventsExports;
16857
+ const events_1$2 = require$$0;
16773
16858
  class EmitterMap {
16774
16859
  constructor() {
16775
16860
  this.storage = new Map();
@@ -16851,7 +16936,7 @@ var __classPrivateFieldGet = (commonjsGlobal && commonjsGlobal.__classPrivateFie
16851
16936
  var _Transport_wire, _Transport_fin;
16852
16937
  Object.defineProperty(transport, "__esModule", { value: true });
16853
16938
  transport.Transport = void 0;
16854
- const events_1$1 = eventsExports;
16939
+ const events_1$1 = require$$0;
16855
16940
  const wire_1 = wire;
16856
16941
  const transport_errors_1 = transportErrors;
16857
16942
  const eventAggregator_1 = eventAggregator;
@@ -16893,13 +16978,13 @@ class Transport extends events_1$1.EventEmitter {
16893
16978
  }
16894
16979
  getFin() {
16895
16980
  if (!__classPrivateFieldGet(this, _Transport_fin, "f")) {
16896
- throw new Error("No Fin object registered for this transport");
16981
+ throw new Error('No Fin object registered for this transport');
16897
16982
  }
16898
16983
  return __classPrivateFieldGet(this, _Transport_fin, "f");
16899
16984
  }
16900
16985
  registerFin(_fin) {
16901
16986
  if (__classPrivateFieldGet(this, _Transport_fin, "f")) {
16902
- throw new Error("Fin object has already been registered for this transport");
16987
+ throw new Error('Fin object has already been registered for this transport');
16903
16988
  }
16904
16989
  __classPrivateFieldSet(this, _Transport_fin, _fin, "f");
16905
16990
  }
@@ -16908,6 +16993,10 @@ class Transport extends events_1$1.EventEmitter {
16908
16993
  return wire.shutdown();
16909
16994
  }
16910
16995
  async connect(config) {
16996
+ if ((0, wire_1.isConfigWithReceiver)(config)) {
16997
+ await __classPrivateFieldGet(this, _Transport_wire, "f").connect(config.receiver);
16998
+ return this.authorize(config);
16999
+ }
16911
17000
  if ((0, wire_1.isRemoteConfig)(config)) {
16912
17001
  return this.connectRemote(config);
16913
17002
  }
@@ -16921,14 +17010,14 @@ class Transport extends events_1$1.EventEmitter {
16921
17010
  return undefined;
16922
17011
  }
16923
17012
  async connectRemote(config) {
16924
- await __classPrivateFieldGet(this, _Transport_wire, "f").connect(config.address, this.environment.getWsConstructor());
17013
+ await __classPrivateFieldGet(this, _Transport_wire, "f").connect(new (this.environment.getWsConstructor())(config.address));
16925
17014
  return this.authorize(config);
16926
17015
  }
16927
17016
  async connectByPort(config) {
16928
17017
  const { address, uuid } = config;
16929
17018
  const reqAuthPayload = { ...config, type: 'file-token' };
16930
17019
  const wire = __classPrivateFieldGet(this, _Transport_wire, "f");
16931
- await wire.connect(address, this.environment.getWsConstructor());
17020
+ await wire.connect(new (this.environment.getWsConstructor())(config.address));
16932
17021
  const requestExtAuthRet = await this.sendAction('request-external-authorization', {
16933
17022
  uuid,
16934
17023
  type: 'file-token'
@@ -16948,7 +17037,9 @@ class Transport extends events_1$1.EventEmitter {
16948
17037
  throw new transport_errors_1.RuntimeError(requestAuthRet.payload);
16949
17038
  }
16950
17039
  }
16951
- sendAction(action, payload = {}, uncorrelated = false) {
17040
+ sendAction(action, payload = {}, uncorrelated = false
17041
+ // specialResponse type is only used for 'requestAuthorization'
17042
+ ) {
16952
17043
  // eslint-disable-next-line @typescript-eslint/no-empty-function
16953
17044
  let cancel = () => { };
16954
17045
  // We want the callsite from the caller of this function, not from here.
@@ -16998,7 +17089,10 @@ class Transport extends events_1$1.EventEmitter {
16998
17089
  this.uncorrelatedListener = resolve;
16999
17090
  }
17000
17091
  else if (this.wireListeners.has(id)) {
17001
- handleNack({ reason: 'Duplicate handler id', error: (0, errors_1.errorToPOJO)(new transport_errors_1.DuplicateCorrelationError(String(id))) });
17092
+ handleNack({
17093
+ reason: 'Duplicate handler id',
17094
+ error: (0, errors_1.errorToPOJO)(new transport_errors_1.DuplicateCorrelationError(String(id)))
17095
+ });
17002
17096
  }
17003
17097
  else {
17004
17098
  this.wireListeners.set(id, { resolve, handleNack });
@@ -17123,9 +17217,9 @@ var mockWire = {};
17123
17217
 
17124
17218
  Object.defineProperty(mockWire, "__esModule", { value: true });
17125
17219
  mockWire.MockWire = void 0;
17126
- const events_1 = eventsExports;
17220
+ const events_1 = require$$0;
17127
17221
  class MockWire extends events_1.EventEmitter {
17128
- connect(address) {
17222
+ connect() {
17129
17223
  throw new Error('You are not running in OpenFin.');
17130
17224
  }
17131
17225
  connectSync() {
@@ -17154,7 +17248,7 @@ const fin_1 = fin;
17154
17248
  const transport_1 = transport;
17155
17249
  const mockEnvironment_1 = mockEnvironment;
17156
17250
  const mockWire_1 = mockWire;
17157
- exports.fin = mock.fin = ((typeof window !== 'undefined' && (window === null || window === void 0 ? void 0 : window.fin)) ||
17251
+ exports.fin = mock.fin = ((typeof window !== 'undefined' && window?.fin) ||
17158
17252
  (() => {
17159
17253
  const environment = new mockEnvironment_1.MockEnvironment();
17160
17254
  const transport = new transport_1.Transport(mockWire_1.MockWire, environment, {