@openfin/core 29.73.4 → 29.73.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/OpenFin.d.ts +48 -0
  2. package/package.json +1 -1
  3. package/src/OpenFin.d.ts +1455 -0
  4. package/src/OpenFin.js +4 -0
  5. package/src/api/events/system.d.ts +18 -3
  6. package/src/api/events/typedEventEmitter.d.ts +13 -0
  7. package/src/api/events/typedEventEmitter.js +2 -0
  8. package/src/api/interop/Factory.js +4 -1
  9. package/src/api/interop/InteropBroker.d.ts +7 -5
  10. package/src/api/interop/InteropBroker.js +2 -1
  11. package/src/api/interop/fdc3/PrivateChannelClient.d.ts +8 -7
  12. package/src/api/interop/fdc3/fdc3-1.2.d.ts +14 -13
  13. package/src/api/interop/fdc3/fdc3-2.0.d.ts +23 -21
  14. package/src/api/interop/fdc3/fdc3-2.0.js +9 -9
  15. package/src/api/interop/fdc3/fdc3.d.ts +12 -0
  16. package/src/api/interop/fdc3/overrideCheck.d.ts +4 -0
  17. package/src/api/interop/fdc3/overrideCheck.js +32 -0
  18. package/src/api/interop/fdc3/shapes/fdc3v1.d.ts +53 -0
  19. package/src/api/interop/fdc3/shapes/fdc3v1.js +4 -0
  20. package/src/api/interop/fdc3/shapes/fdc3v2.d.ts +74 -0
  21. package/src/api/interop/fdc3/shapes/fdc3v2.js +2 -0
  22. package/src/api/interop/fdc3/utils.d.ts +7 -5
  23. package/src/api/interop/fdc3/utils.js +2 -2
  24. package/src/api/interop/fdc3/versions.d.ts +1 -0
  25. package/src/api/interop/fdc3/versions.js +2 -0
  26. package/src/api/platform/Instance.d.ts +14 -0
  27. package/src/api/platform/Instance.js +17 -0
  28. package/src/api/platform/layout/utils/bounds-observer.d.ts +1 -1
  29. package/src/api/platform/layout/utils/bounds-observer.js +2 -2
  30. package/src/api/system/index.d.ts +0 -469
  31. package/src/api/system/index.js +51 -471
  32. package/src/api/view/Instance.d.ts +11 -0
  33. package/src/api/view/Instance.js +19 -0
  34. package/src/fdc3.d.ts +3 -0
  35. package/src/shapes/protocol.d.ts +3 -1
@@ -3,475 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const base_1 = require("../base");
4
4
  const transport_errors_1 = require("../../transport/transport-errors");
5
5
  const window_1 = require("../window");
6
- /**
7
- * AppAssetInfo interface
8
- * @typedef { object } AppAssetInfo
9
- * @property { string } src The URL to a zip file containing the package files (executables, dlls, etc…)
10
- * @property { string } alias The name of the asset
11
- * @property { string } version The version of the package
12
- * @property { string } target Specify default executable to launch. This option can be overridden in launchExternalProcess
13
- * @property { string } args The default command line arguments for the aforementioned target.
14
- * @property { boolean } mandatory When set to true, the app will fail to load if the asset cannot be downloaded.
15
- * When set to false, the app will continue to load if the asset cannot be downloaded. (Default: true)
16
- */
17
- /**
18
- * AppAssetRequest interface
19
- * @typedef { object } AppAssetRequest
20
- * @property { string } alias The name of the asset
21
- */
22
- /**
23
- * ApplicationState interface
24
- * @typedef { object } ApplicationState
25
- * @property { boolean } isPlatform true when the application is a Platform controller
26
- * @property { boolean } isRunning true when the application is running
27
- * @property { string } uuid uuid of the application
28
- * @property { string } parentUuid uuid of the application that launches this application
29
- */
30
- /**
31
- * @typedef { object } ClearCacheOption
32
- * @summary Clear cache options.
33
- * @desc These are the options required by the clearCache function.
34
- *
35
- * @property {boolean} appcache html5 application cache
36
- * @property {boolean} cache browser data cache for html files and images
37
- * @property {boolean} cookies browser cookies
38
- * @property {boolean} localStorage browser data that can be used across sessions
39
- */
40
- /**
41
- * CookieInfo interface
42
- * @typedef { object } CookieInfo
43
- * @property { string } name The name of the cookie
44
- * @property { string } domain The domain of the cookie
45
- * @property { string } path The path of the cookie
46
- */
47
- /**
48
- * CookieOption interface
49
- * @typedef { object } CookieOption
50
- * @property { string } name The name of the cookie
51
- */
52
- /**
53
- * CpuInfo interface
54
- * @typedef { object } CpuInfo
55
- * @property { string } model The model of the cpu
56
- * @property { number } speed The number in MHz
57
- * @property { Time } times The numbers of milliseconds the CPU has spent in different modes.
58
- */
59
- /**
60
- * CrashReporterState interface
61
- * @typedef { object } CrashReporterState
62
- * @property { boolean } diagnosticsMode In diagnostics mode the crash reporter will send diagnostic logs to
63
- * the OpenFin reporting service on runtime shutdown
64
- * @property { boolean } isRunning check if it's running
65
- */
66
- /**
67
- * CrashReporterOptions interface
68
- * @typedef { object } CrashReporterOptions
69
- * @property { boolean } diagnosticsMode In diagnostics mode the crash reporter will send diagnostic logs to
70
- * the OpenFin reporting service on runtime shutdown
71
- */
72
- /**
73
- * DipRect interface
74
- * @typedef { object } DipRect
75
- * @property { Rect } dipRect The DIP coordinates
76
- * @property { Rect } scaledRect The scale coordinates
77
- */
78
- /**
79
- * DipScaleRects interface
80
- * @typedef { object } DipScaleRects
81
- * @property { Rect } dipRect The DIP coordinates
82
- * @property { Rect } scaledRect The scale coordinates
83
- */
84
- /**
85
- * DownloadPreloadInfo interface
86
- * @typedef { object } DownloadPreloadInfo
87
- * @desc downloadPreloadScripts function return value
88
- * @property { string } url url to the preload script
89
- * @property { string } error error during preload script acquisition
90
- * @property { boolean } succeess download operation success
91
- */
92
- /**
93
- * DownloadPreloadOption interface
94
- * @typedef { object } DownloadPreloadOption
95
- * @desc These are the options object required by the downloadPreloadScripts function
96
- * @property { string } url url to the preload script
97
- */
98
- /**
99
- * ApplicationType interface
100
- * @typedef { object } ApplicationType
101
- * @property { string } type The type of the entity
102
- * @property { string } uuid The uuid of the entity
103
- */
104
- /**
105
- * EntityInfo interface
106
- * @typedef { object } EntityInfo
107
- * @property { string } name The name of the entity
108
- * @property { string } uuid The uuid of the entity
109
- * @property { Identity } parent The parent of the entity
110
- * @property { string } entityType The type of the entity
111
- */
112
- /**
113
- * ExternalApplicationInfo interface
114
- * @typedef { object } ExternalApplicationInfo
115
- * @property { Identity } parent The parent identity
116
- */
117
- /**
118
- * ExternalConnection interface
119
- * @typedef { object } ExternalConnection
120
- * @property { string } token The token to broker an external connection
121
- * @property { string } uuid The uuid of the external connection
122
- */
123
- /**
124
- * ExternalProcessRequestType interface
125
- * @typedef { object } ExternalProcessRequestType
126
- * @property { string } path The file path to where the running application resides
127
- * @property { string } arguments The argument passed to the running application
128
- * @property { LaunchExternalProcessListener } listener This is described in the {LaunchExternalProcessListner} type definition
129
- * @property { string } initialWindowState Initial window state after launching: 'normal' (default), 'minimized', 'maximized'
130
- * @property { string } cwd current working directory
131
- */
132
- /**
133
- * FrameInfo interface
134
- * @typedef { object } FrameInfo
135
- * @property { string } name The name of the frame
136
- * @property { string } uuid The uuid of the frame
137
- * @property { EntityType } entityType The entity type, could be 'window', 'iframe', 'external connection' or 'unknown'
138
- * @property { Identity } parent The parent identity
139
- * @property { string } url URL
140
- */
141
- /**
142
- * GetLogRequestType interface
143
- * @typedef { object } GetLogRequestType
144
- * @property { string } name The name of the running application
145
- * @property { number } endFile The file length of the log file
146
- * @property { number } sizeLimit The set size limit of the log file
147
- */
148
- /**
149
- * GpuInfo interface
150
- * @typedef { object } GpuInfo
151
- * @property { string } name The graphics card name
152
- */
153
- /**
154
- * HostSpecs interface
155
- * @typedef { object } HostSpecs
156
- * @property { boolean } aeroGlassEnabled Value to check if Aero Glass theme is supported on Windows platforms
157
- * @property { string } arch "x86" for 32-bit or "x86_64" for 64-bit
158
- * @property { Array<CpuInfo> } cpus The same payload as Node's os.cpus()
159
- * @property { GpuInfo } gpu The graphics card name
160
- * @property { number } memory The same payload as Node's os.totalmem()
161
- * @property { string } name The OS name and version/edition
162
- * @property { boolean } screenSaver Value to check if screensaver is running. Supported on Windows only
163
- */
164
- /**
165
- * Identity interface
166
- * @typedef { object } Identity
167
- * @property { string } name Optional - the name of the component
168
- * @property { string } uuid Universally unique identifier of the application
169
- */
170
- /**
171
- * LogInfo interface
172
- * @typedef { object } LogInfo
173
- * @property { string } name The filename of the log
174
- * @property { number } size The size of the log in bytes
175
- * @property { string } date The unix time at which the log was created "Thu Jan 08 2015 14:40:30 GMT-0500 (Eastern Standard Time)"
176
- */
177
- /**
178
- * ManifestInfo interface
179
- * @typedef { object } ManifestInfo
180
- * @property { string } uuid The uuid of the application
181
- * @property { string } manifestUrl The runtime manifest URL
182
- */
183
- /**
184
- * MonitorDetails interface
185
- * @typedef { object } MonitorDetails
186
- * @property { DipScaleRects } available The available DIP scale coordinates
187
- * @property { Rect } availableRect The available monitor coordinates
188
- * @property { string } deviceId The device id of the display
189
- * @property { boolean } displayDeviceActive true if the display is active
190
- * @property { number } deviceScaleFactor The device scale factor
191
- * @property { Rect } monitorRect The monitor coordinates
192
- * @property { string } name The name of the display
193
- * @property { Point } dpi The dots per inch
194
- * @property { DipScaleRects } monitor The monitor coordinates
195
- */
196
- /**
197
- * MonitorInfo interface
198
- * @typedef { object } MonitorInfo
199
- * @property { number } deviceScaleFactor The device scale factor
200
- * @property { Point } dpi The dots per inch
201
- * @property { Array<MonitorDetails> } nonPrimaryMonitors The array of monitor details
202
- * @property { MonitorDetails } primaryMonitor The monitor details
203
- * @property { string } reason always "api-query"
204
- * @property { TaskBar } taskBar The taskbar on monitor
205
- * @property { DipRect } virtualScreen The virtual display screen coordinates
206
- */
207
- /**
208
- * @typedef { verbose | info | warning | error | fatal } LogLevel
209
- * @summary Log verbosity levels.
210
- * @desc Describes the minimum level (inclusive) above which logs will be written
211
- *
212
- * @property { string } verbose all logs written
213
- * @property { string } info info and above
214
- * @property { string } warning warning and above
215
- * @property { string } error error and above
216
- * @property { string } fatal fatal only, indicates a crash is imminent
217
- */
218
- /**
219
- * PointTopLeft interface
220
- * @typedef { object } PointTopLeft
221
- * @property { number } top The mouse top position in virtual screen coordinates
222
- * @property { number } left The mouse left position in virtual screen coordinates
223
- */
224
- /**
225
- * Point interface
226
- * @typedef { object } Point
227
- * @property { number } x The mouse x position
228
- * @property { number } y The mouse y position
229
- */
230
- /**
231
- * ProcessInfo interface
232
- * @typedef { object } ProcessInfo
233
- * @property { number } cpuUsage The percentage of total CPU usage
234
- * @property { string } name The application name
235
- * @property { number } nonPagedPoolUsage The current nonpaged pool usage in bytes
236
- * @property { number } pageFaultCount The number of page faults
237
- * @property { number } pagedPoolUsage The current paged pool usage in bytes
238
- * @property { number } pagefileUsage The total amount of memory in bytes that the memory manager has committed
239
- * @property { number } peakNonPagedPoolUsage The peak nonpaged pool usage in bytes
240
- * @property { number } peakPagedPoolUsage The peak paged pool usage in bytes
241
- * @property { number } peakPagefileUsage The peak value in bytes of pagefileUsage during the lifetime of this process
242
- * @property { number } peakWorkingSetSize The peak working set size in bytes
243
- * @property { number } processId The native process identifier
244
- * @property { string } uuid The application UUID
245
- * @property { number } workingSetSize The current working set size (both shared and private data) in bytes
246
- */
247
- /**
248
- * SystemProcessInfo interface
249
- * @typedef { object } SystemProcessInfo
250
- * @property { ProcessDetails } browserProcess Info on browser process
251
- * @property { Array<AppProcessInfo> } apps Array of apps and their process info
252
- */
253
- /**
254
- * AppProcessInfo interface
255
- * @typedef { object } AppProcessInfo
256
- * @property { string } uuid The uuid of the application
257
- * @property { Array<EntityProcessDetails> } entities Array of process info for each window and view for the application
258
- */
259
- /**
260
- * EntityProcessDetails interface
261
- * @typedef { object } EntityProcessDetails
262
- * @property { string } uuid The uuid for the entity
263
- * @property { string } name The name for the entity
264
- * @property { string } url URL associated with the entity
265
- * @property { string } entityType Type for the entity: window or view
266
- * @property { number } cpuUsage The percentage of total CPU usage
267
- * @property { number } nonPagedPoolUsage The current nonpaged pool usage in bytes
268
- * @property { number } pageFaultCount The number of page faults
269
- * @property { number } pagedPoolUsage The current paged pool usage in bytes
270
- * @property { number } pagefileUsage The total amount of memory in bytes that the memory manager has committed
271
- * @property { number } peakNonPagedPoolUsage The peak nonpaged pool usage in bytes
272
- * @property { number } peakPagedPoolUsage The peak paged pool usage in bytes
273
- * @property { number } peakPagefileUsage The peak value in bytes of pagefileUsage during the lifetime of this process
274
- * @property { number } peakWorkingSetSize The peak working set size in bytes
275
- * @property { number } privateSetSize The current working set size (not shared)
276
- * @property { number } workingSetSize The current working set size (both shared and private data) in bytes
277
- * @property { number } pid The native process identifier
278
- * @property { Array<FrameProcessDetails> } frames Array of process info for each iframe corresponeding to the entity
279
- */
280
- /**
281
- * FrameProcessDetails interface
282
- * @typedef { object } FrameProcessDetails
283
- * @property { string } url Current URL associated with the process
284
- * @property { string } entityType Type for the frame
285
- * @property { number } cpuUsage The percentage of total CPU usage
286
- * @property { number } nonPagedPoolUsage The current nonpaged pool usage in bytes
287
- * @property { number } pageFaultCount The number of page faults
288
- * @property { number } pagedPoolUsage The current paged pool usage in bytes
289
- * @property { number } pagefileUsage The total amount of memory in bytes that the memory manager has committed
290
- * @property { number } peakNonPagedPoolUsage The peak nonpaged pool usage in bytes
291
- * @property { number } peakPagedPoolUsage The peak paged pool usage in bytes
292
- * @property { number } peakPagefileUsage The peak value in bytes of pagefileUsage during the lifetime of this process
293
- * @property { number } peakWorkingSetSize The peak working set size in bytes
294
- * @property { number } workingSetSize The current working set size (both shared and private data) in bytes
295
- * @property { number } pid The native process identifier
296
- */
297
- /**
298
- * ProcessDetails interface
299
- * @typedef { object } ProcessDetails
300
- * @property { number } cpuUsage The percentage of total CPU usage
301
- * @property { number } nonPagedPoolUsage The current nonpaged pool usage in bytes
302
- * @property { number } pageFaultCount The number of page faults
303
- * @property { number } pagedPoolUsage The current paged pool usage in bytes
304
- * @property { number } pagefileUsage The total amount of memory in bytes that the memory manager has committed
305
- * @property { number } peakNonPagedPoolUsage The peak nonpaged pool usage in bytes
306
- * @property { number } peakPagedPoolUsage The peak paged pool usage in bytes
307
- * @property { number } peakPagefileUsage The peak value in bytes of pagefileUsage during the lifetime of this process
308
- * @property { number } peakWorkingSetSize The peak working set size in bytes
309
- * @property { number } workingSetSize The current working set size (both shared and private data) in bytes
310
- * @property { number } pid The native process identifier
311
- */
312
- /**
313
- * ProxyConfig interface
314
- * @typedef { object } ProxyConfig
315
- * @property { string } proxyAddress The configured proxy address
316
- * @property { number } proxyPort The configured proxy port
317
- * @property { string } type The proxy Type
318
- */
319
- /**
320
- * ProxyInfo interface
321
- * @typedef { object } ProxyInfo
322
- * @property { ProxyConfig } config The proxy config
323
- * @property { ProxySystemInfo } system The proxy system info
324
- */
325
- /**
326
- * QueryPermissionResult interface
327
- * @typedef { object } QueryPermissionResult
328
- * @property { string } permission The full name of a secured API
329
- * @property { string } state 'granted' | 'denied' | 'unavailable'
330
- * @property { boolean } granted true if permission is granted
331
- * @property { object } [rawValue] The value of permission
332
- */
333
- /**
334
- * ProxySystemInfo interface
335
- * @typedef { object } ProxySystemInfo
336
- * @property { string } autoConfigUrl The auto configuration url
337
- * @property { string } bypass The proxy bypass info
338
- * @property { boolean } enabled Value to check if a proxy is enabled
339
- * @property { string } proxy The proxy info
340
- */
341
- /**
342
- * Rect interface
343
- * @typedef { object } Rect
344
- * @property { number } bottom The bottom-most coordinate
345
- * @property { number } left The left-most coordinate
346
- * @property { number } right The right-most coordinate
347
- * @property { number } top The top-most coordinate
348
- */
349
- /**
350
- * RegistryInfo interface
351
- * @typedef { object } RegistryInfo
352
- * @property { any } data The registry data
353
- * @property { string } rootKey The registry root key
354
- * @property { string } subkey The registry key
355
- * @property { string } type The registry type
356
- * @property { string } value The registry value name
357
- */
358
- /**
359
- * RuntimeDownloadOptions interface
360
- * @typedef { object } RuntimeDownloadOptions
361
- * @desc These are the options object required by the downloadRuntime function.
362
- * @property { string } version The given version to download
363
- */
364
- /**
365
- * RuntimeInfo interface
366
- * @typedef { object } RuntimeInfo
367
- * @property { string } architecture The runtime build architecture
368
- * @property { string } manifestUrl The runtime manifest URL
369
- * @property { number } port The runtime websocket port
370
- * @property { string } securityRealm The runtime security realm
371
- * @property { string } version The runtime version
372
- * @property { object } args the command line argument used to start the Runtime
373
- * @property { string } chromeVersion The chrome version
374
- * @property { string } electronVersion The electron version
375
- */
376
- /**
377
- * RVMInfo interface
378
- * @typedef { object } RVMInfo
379
- * @property { string } action The name of action: "get-rvm-info"
380
- * @property { string } appLogDirectory The app log directory
381
- * @property { string } path The path of OpenfinRVM.exe
382
- * @property { string } 'start-time' The start time of RVM
383
- * @property { string } version The version of RVM
384
- * @property { string } 'working-dir' The working directory
385
- */
386
- /**
387
- * RvmLaunchOptions interface
388
- * @typedef { object } RvmLaunchOptions
389
- * @property { boolean } [noUi] true if no UI when launching
390
- * @property { object } [userAppConfigArgs] The user app configuration args
391
- * @property { number } [timeToLive] Timeout in seconds until RVM launch request expires
392
- */
393
- /**
394
- * ServiceIdentifier interface
395
- * @typedef { object } ServiceIdentifier
396
- * @property { string } name The name of the service
397
- */
398
- /**
399
- * ServiceConfiguration interface
400
- * @typedef { object } ServiceConfiguration
401
- * @property { object } config The service configuration
402
- * @property { string } name The name of the service
403
- */
404
- /**
405
- * ShortCutConfig interface
406
- * @typedef { object } ShortCutConfig
407
- * @property { boolean } desktop true if application has a shortcut on the desktop
408
- * @property { boolean } startMenu true if application has shortcut in the start menu
409
- * @property { boolean } systemStartup true if application will be launched on system startup
410
- */
411
- /**
412
- * SubOptions interface
413
- * @typedef { Object } SubOptions
414
- * @property { number } timestamp The event timestamp
415
- */
416
- /**
417
- * TaskBar interface
418
- * @typedef { object } TaskBar
419
- * @property { string } edge which edge of a monitor the taskbar is on
420
- * @property { Rect } rect The taskbar coordinates
421
- */
422
- /**
423
- * TerminateExternalRequestType interface
424
- * @typedef { object } TerminateExternalRequestType
425
- * @property { string } uuid The uuid of the running application
426
- * @property { number } timeout Time out period before the running application terminates
427
- * @property { boolean } killtree Value to terminate the running application
428
- */
429
- /**
430
- * Time interface
431
- * @typedef { object } Time
432
- * @property { number } user The number of milliseconds the CPU has spent in user mode
433
- * @property { number } nice The number of milliseconds the CPU has spent in nice mode
434
- * @property { number } sys The number of milliseconds the CPU has spent in sys mode
435
- * @property { number } idle The number of milliseconds the CPU has spent in idle mode
436
- * @property { number } irq The number of milliseconds the CPU has spent in irq mode
437
- */
438
- /**
439
- * TrayInfo interface
440
- * @typedef { object } TrayInfo
441
- * @property { Bounds } bounds The bound of tray icon in virtual screen pixels
442
- * @property { MonitorInfo } monitorInfo Please see fin.System.getMonitorInfo for more information
443
- * @property { number } x copy of bounds.x
444
- * @property { number } y copy of bounds.y
445
- */
446
- /**
447
- * WindowDetail interface
448
- * @typedef { object } WindowDetail
449
- * @property { number } bottom The bottom-most coordinate of the window
450
- * @property { number } height The height of the window
451
- * @property { boolean } isShowing Value to check if the window is showing
452
- * @property { number } left The left-most coordinate of the window
453
- * @property { string } name The name of the window
454
- * @property { number } right The right-most coordinate of the window
455
- * @property { string } state The window state
456
- * @property { number } top The top-most coordinate of the window
457
- * @property { number } width The width of the window
458
- */
459
- /**
460
- * ApplicationWindowInfo interface
461
- * @typedef { object } ApplicationWindowInfo
462
- * @property { Array<WindowDetail> } childWindows The array of child windows details
463
- * @property { WindowDetail } mainWindow The main window detail
464
- * @property { string } uuid The uuid of the application
465
- */
466
- /**
467
- * CertifiedAppInfo interface
468
- * @typedef { object } CertifiedAppInfo
469
- * @property { boolean } isRunning true if the app is running
470
- * @property { boolean } [isOptedIntoCertfiedApp] true if the app has opted into certification
471
- * @property { boolean } [isCertified] true if the app is certified
472
- * @property { boolean } [isSSLCertified] true if the app manifest's SSL certificate is valid
473
- * @property { boolean } [isPresentInAppDirectory] true if the app is present in the OpenFin app directory
474
- */
6
+ const events_1 = require("events");
475
7
  /**
476
8
  * An object representing the core of OpenFin Runtime. Allows the developer
477
9
  * to perform system-level actions, such as accessing logs, viewing processes,
@@ -1204,10 +736,58 @@ class System extends base_1.EmitterBase {
1204
736
  * @tutorial System.launchManifest
1205
737
  * @static
1206
738
  */
1207
- async launchManifest(manifestUrl, opts) {
739
+ async launchManifest(manifestUrl, opts = {}) {
740
+ const { subscribe, ..._sendOpts } = opts;
741
+ const sendOpts = _sendOpts;
742
+ if (subscribe) {
743
+ const launchEmitter = new events_1.EventEmitter();
744
+ subscribe(launchEmitter);
745
+ const AppVersionProgressEventName = 'app-version-progress';
746
+ const RuntimeStatusEventName = 'runtime-status';
747
+ const AppVersionCompleteEventName = 'app-version-complete';
748
+ const AppVersionErrorEventName = 'app-version-error';
749
+ // add id to avoid multiple api calls getting duplicated events
750
+ const id = this.wire.environment.getNextMessageId().toString();
751
+ sendOpts.appVersionId = id;
752
+ const supportedEvents = [
753
+ AppVersionCompleteEventName,
754
+ AppVersionProgressEventName,
755
+ RuntimeStatusEventName,
756
+ AppVersionErrorEventName
757
+ ];
758
+ const cleanEventPayload = (payload) => {
759
+ // We need to do type castings below to make sure the return type is correct.
760
+ const { appVersionId, topic, type: typeWithId, ...rest } = payload;
761
+ const type = supportedEvents.find((x) => typeWithId.includes(x));
762
+ return {
763
+ ...rest,
764
+ type
765
+ };
766
+ };
767
+ const appVersionListener = (payload) => {
768
+ const cleanPayload = cleanEventPayload(payload);
769
+ launchEmitter.emit(cleanPayload.type, cleanPayload);
770
+ };
771
+ const removeAllListeners = () => {
772
+ this.removeListener(`${AppVersionProgressEventName}.${id}`, appVersionListener);
773
+ this.removeListener(`${RuntimeStatusEventName}.${id}`, appVersionListener);
774
+ this.removeListener(`${AppVersionCompleteEventName}.${id}`, appVersionListener);
775
+ this.removeListener(`${AppVersionErrorEventName}.${id}`, appVersionListener);
776
+ this.removeListener(`${AppVersionCompleteEventName}.${id}`, removeAllListeners);
777
+ this.removeListener(`${AppVersionErrorEventName}.${id}`, removeAllListeners);
778
+ };
779
+ await Promise.all([
780
+ this.on(`${AppVersionProgressEventName}.${id}`, appVersionListener),
781
+ this.on(`${RuntimeStatusEventName}.${id}`, appVersionListener),
782
+ this.once(`${AppVersionCompleteEventName}.${id}`, appVersionListener),
783
+ this.once(`${AppVersionErrorEventName}.${id}`, appVersionListener),
784
+ this.once(`${AppVersionCompleteEventName}.${id}`, removeAllListeners),
785
+ this.once(`${AppVersionErrorEventName}.${id}`, removeAllListeners)
786
+ ]);
787
+ }
1208
788
  const response = await this.wire.sendAction('launch-manifest', {
1209
789
  manifestUrl,
1210
- opts
790
+ opts: sendOpts
1211
791
  });
1212
792
  return response.payload.data.manifest;
1213
793
  }
@@ -451,4 +451,15 @@ export declare class View extends WebContents<ViewEvents> {
451
451
  * @experimental
452
452
  */
453
453
  triggerBeforeUnload: () => Promise<boolean>;
454
+ /**
455
+ * **NOTE**: Internal use only.
456
+ * Attaches this view to an HTML element in the current context. The view will resize responsively when the element bounds change.
457
+ *
458
+ * @param { string } elementId - id of the HTML element to attach the view to.
459
+ * @return {Function} - Cleanup function that will disconnect the element resize observer.
460
+ * @internal
461
+ * @experimental
462
+ * @tutorial View.bindToElement
463
+ */
464
+ bindToElement: (elementId: string) => Promise<() => void>;
454
465
  }
@@ -6,6 +6,7 @@ exports.View = void 0;
6
6
  /* eslint-disable @typescript-eslint/no-non-null-assertion */
7
7
  const main_1 = require("../webcontents/main");
8
8
  const window_1 = require("../window");
9
+ const bounds_observer_1 = require("../platform/layout/utils/bounds-observer");
9
10
  /**
10
11
  * @typedef {object} View~options
11
12
  * @summary View creation options.
@@ -455,6 +456,24 @@ class View extends main_1.WebContents {
455
456
  const message = await this.wire.sendAction('trigger-before-unload', { ...this.identity });
456
457
  return message.payload.data;
457
458
  };
459
+ /**
460
+ * **NOTE**: Internal use only.
461
+ * Attaches this view to an HTML element in the current context. The view will resize responsively when the element bounds change.
462
+ *
463
+ * @param { string } elementId - id of the HTML element to attach the view to.
464
+ * @return {Function} - Cleanup function that will disconnect the element resize observer.
465
+ * @internal
466
+ * @experimental
467
+ * @tutorial View.bindToElement
468
+ */
469
+ this.bindToElement = async (elementId) => {
470
+ const element = document.getElementById(elementId);
471
+ if (!element) {
472
+ throw new Error(`Element matching id: ${elementId} not found.`);
473
+ }
474
+ const onChange = async (bounds) => this.setBounds(bounds);
475
+ return (0, bounds_observer_1.observeBounds)(element, onChange);
476
+ };
458
477
  }
459
478
  /**
460
479
  * Gets a base64 encoded image of the view or a part of it.
package/src/fdc3.d.ts ADDED
@@ -0,0 +1,3 @@
1
+ import { FinApi } from './api/fin';
2
+ import Fdc3Module from './api/interop/fdc3/fdc3-1.2';
3
+ export declare function fdc3FromFin(fin: FinApi<OpenFin.EntityType>, version?: string): Promise<Fdc3Module>;
@@ -30,7 +30,9 @@ export interface ProtocolMap extends ProtocolMapBase {
30
30
  'launch-manifest': {
31
31
  request: {
32
32
  manifestUrl: string;
33
- opts?: OpenFin.RvmLaunchOptions;
33
+ opts?: Omit<OpenFin.RvmLaunchOptions, 'subscribe'> & {
34
+ appVersionId?: string;
35
+ };
34
36
  };
35
37
  response: {
36
38
  manifest: OpenFin.Manifest;