@openfin/core 30.73.28 → 31.74.2

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 (160) hide show
  1. package/LICENSE.md +4 -0
  2. package/package.json +2 -2
  3. package/src/OpenFin.d.ts +1929 -407
  4. package/src/OpenFin.js +0 -2
  5. package/src/api/api-exposer/api-consumer.d.ts +28 -0
  6. package/src/api/api-exposer/api-consumer.js +28 -0
  7. package/src/api/api-exposer/api-exposer.d.ts +35 -0
  8. package/src/api/api-exposer/api-exposer.js +38 -0
  9. package/src/api/api-exposer/decorators.d.ts +10 -0
  10. package/src/api/api-exposer/decorators.js +18 -0
  11. package/src/api/api-exposer/index.d.ts +4 -0
  12. package/src/api/api-exposer/index.js +20 -0
  13. package/src/api/api-exposer/strategies/index.d.ts +1 -0
  14. package/src/api/api-exposer/strategies/index.js +17 -0
  15. package/src/api/api-exposer/strategies/openfin-channels/channels-consumer.d.ts +14 -0
  16. package/src/api/api-exposer/strategies/openfin-channels/channels-consumer.js +20 -0
  17. package/src/api/api-exposer/strategies/openfin-channels/channels-exposer.d.ts +20 -0
  18. package/src/api/api-exposer/strategies/openfin-channels/channels-exposer.js +23 -0
  19. package/src/api/api-exposer/strategies/openfin-channels/index.d.ts +2 -0
  20. package/src/api/api-exposer/strategies/openfin-channels/index.js +18 -0
  21. package/src/api/application/Factory.d.ts +1 -0
  22. package/src/api/application/Factory.js +2 -2
  23. package/src/api/application/Instance.d.ts +2 -1
  24. package/src/api/application/Instance.js +1 -0
  25. package/src/api/base.d.ts +4 -4
  26. package/src/api/clipboard/index.d.ts +1 -0
  27. package/src/api/clipboard/index.js +1 -0
  28. package/src/api/events/application.d.ts +22 -22
  29. package/src/api/events/base.d.ts +6 -9
  30. package/src/api/events/channel.d.ts +5 -5
  31. package/src/api/events/emitterMap.d.ts +1 -1
  32. package/src/api/events/externalApplication.d.ts +3 -3
  33. package/src/api/events/frame.d.ts +5 -5
  34. package/src/api/events/globalHotkey.d.ts +3 -3
  35. package/src/api/events/platform.d.ts +6 -7
  36. package/src/api/events/system.d.ts +20 -21
  37. package/src/api/events/typedEventEmitter.d.ts +1 -1
  38. package/src/api/events/view.d.ts +17 -14
  39. package/src/api/events/webcontents.d.ts +40 -18
  40. package/src/api/events/window.d.ts +65 -57
  41. package/src/api/external-application/Instance.d.ts +1 -1
  42. package/src/api/fin.d.ts +2 -2
  43. package/src/api/frame/Instance.d.ts +2 -2
  44. package/src/api/global-hotkey/index.d.ts +1 -1
  45. package/src/api/interappbus/channel/channel.d.ts +5 -5
  46. package/src/api/interappbus/channel/channel.js +3 -3
  47. package/src/api/interappbus/channel/channels-docs.d.ts +7 -0
  48. package/src/api/interappbus/channel/channels-docs.js +7 -0
  49. package/src/api/interappbus/channel/client.d.ts +5 -4
  50. package/src/api/interappbus/channel/client.js +24 -17
  51. package/src/api/interappbus/channel/connection-manager.d.ts +2 -2
  52. package/src/api/interappbus/channel/connection-manager.js +12 -12
  53. package/src/api/interappbus/channel/index.d.ts +3 -3
  54. package/src/api/interappbus/channel/index.js +6 -8
  55. package/src/api/interappbus/channel/protocols/classic/message-receiver.d.ts +1 -1
  56. package/src/api/interappbus/channel/protocols/classic/strategy.d.ts +2 -2
  57. package/src/api/interappbus/channel/protocols/combined/strategy.d.ts +2 -2
  58. package/src/api/interappbus/channel/protocols/combined/strategy.js +5 -5
  59. package/src/api/interappbus/channel/protocols/index.d.ts +7 -4
  60. package/src/api/interappbus/channel/protocols/rtc/endpoint.d.ts +1 -1
  61. package/src/api/interappbus/channel/protocols/rtc/endpoint.js +10 -2
  62. package/src/api/interappbus/channel/protocols/rtc/ice-manager.d.ts +1 -1
  63. package/src/api/interappbus/channel/protocols/rtc/strategy.d.ts +1 -1
  64. package/src/api/interappbus/channel/protocols/rtc/strategy.js +1 -1
  65. package/src/api/interappbus/channel/protocols/strategy-types.d.ts +4 -4
  66. package/src/api/interappbus/channel/protocols/strategy.d.ts +3 -3
  67. package/src/api/interappbus/channel/provider.d.ts +6 -6
  68. package/src/api/interappbus/channel/provider.js +24 -24
  69. package/src/api/interappbus/index.d.ts +1 -1
  70. package/src/api/interop/Factory.d.ts +1 -2
  71. package/src/api/interop/Factory.js +20 -4
  72. package/src/api/interop/InteropBroker.d.ts +16 -48
  73. package/src/api/interop/InteropBroker.js +38 -48
  74. package/src/api/interop/InteropClient.d.ts +10 -9
  75. package/src/api/interop/InteropClient.js +9 -8
  76. package/src/api/interop/SessionContextGroupClient.d.ts +1 -1
  77. package/src/api/interop/fdc3/PrivateChannelClient.d.ts +2 -1
  78. package/src/api/interop/fdc3/PrivateChannelClient.js +15 -7
  79. package/src/api/interop/fdc3/PrivateChannelProvider.d.ts +16 -2
  80. package/src/api/interop/fdc3/PrivateChannelProvider.js +80 -21
  81. package/src/api/interop/fdc3/fdc3-1.2.js +27 -12
  82. package/src/api/interop/fdc3/fdc3-2.0.d.ts +13 -12
  83. package/src/api/interop/fdc3/fdc3-2.0.js +33 -26
  84. package/src/api/interop/fdc3/fdc3.d.ts +4 -5
  85. package/src/api/interop/fdc3/overrideCheck.d.ts +4 -0
  86. package/src/api/interop/fdc3/overrideCheck.js +32 -0
  87. package/src/api/interop/fdc3/shapes/fdc3v1.d.ts +3 -3
  88. package/src/api/interop/fdc3/shapes/fdc3v2.d.ts +5 -5
  89. package/src/api/interop/fdc3/utils.d.ts +17 -0
  90. package/src/api/interop/fdc3/utils.js +52 -18
  91. package/src/api/interop/fdc3/versions.d.ts +1 -0
  92. package/src/api/interop/fdc3/versions.js +2 -0
  93. package/src/api/interop/utils.d.ts +0 -1
  94. package/src/api/interop/utils.js +1 -9
  95. package/src/api/me.d.ts +4 -4
  96. package/src/api/platform/Factory.d.ts +6 -1
  97. package/src/api/platform/Factory.js +10 -9
  98. package/src/api/platform/Instance.d.ts +5 -3
  99. package/src/api/platform/Instance.js +5 -3
  100. package/src/api/platform/common-utils.d.ts +1 -1
  101. package/src/api/platform/layout/Factory.d.ts +5 -1
  102. package/src/api/platform/layout/Factory.js +15 -3
  103. package/src/api/platform/layout/Instance.d.ts +10 -4
  104. package/src/api/platform/layout/Instance.js +26 -1
  105. package/src/api/platform/layout/controllers/layout-content-cache.d.ts +9 -0
  106. package/src/api/platform/layout/controllers/layout-content-cache.js +54 -0
  107. package/src/api/platform/layout/controllers/layout-entities-controller.d.ts +117 -0
  108. package/src/api/platform/layout/controllers/layout-entities-controller.js +270 -0
  109. package/src/api/platform/layout/controllers/splitter-controller.d.ts +1 -1
  110. package/src/api/platform/layout/entities/layout-entities.d.ts +144 -0
  111. package/src/api/platform/layout/entities/layout-entities.js +216 -0
  112. package/src/api/platform/layout/entities/shapes.d.ts +6 -0
  113. package/src/api/platform/layout/entities/shapes.js +2 -0
  114. package/src/api/platform/layout/layout.constants.d.ts +1 -0
  115. package/src/api/platform/layout/layout.constants.js +4 -0
  116. package/src/api/platform/layout/shapes.d.ts +4 -1
  117. package/src/api/platform/layout/utils/layout-traversal.d.ts +4 -0
  118. package/src/api/platform/layout/utils/layout-traversal.js +65 -0
  119. package/src/api/platform/layout/utils/view-overlay.d.ts +1 -1
  120. package/src/api/platform/provider.d.ts +162 -0
  121. package/src/api/platform/provider.js +2 -0
  122. package/src/api/snapshot-source/Factory.d.ts +1 -0
  123. package/src/api/snapshot-source/Factory.js +1 -0
  124. package/src/api/snapshot-source/Instance.d.ts +1 -1
  125. package/src/api/system/index.d.ts +14 -484
  126. package/src/api/system/index.js +6 -476
  127. package/src/api/view/Instance.d.ts +20 -6
  128. package/src/api/view/Instance.js +48 -8
  129. package/src/api/webcontents/main.d.ts +18 -4
  130. package/src/api/window/Instance.d.ts +21 -1
  131. package/src/api/window/Instance.js +20 -0
  132. package/src/browser.js +1 -1
  133. package/src/environment/browser.d.ts +1 -1
  134. package/src/environment/environment.d.ts +1 -1
  135. package/src/environment/node-env.d.ts +1 -1
  136. package/src/environment/openfin-env.d.ts +1 -1
  137. package/src/mock.d.ts +1 -1
  138. package/src/mock.js +6 -3
  139. package/src/namespaces.d.ts +21 -0
  140. package/src/namespaces.js +24 -0
  141. package/src/shapes/ERROR_BOX_TYPES.d.ts +1 -1
  142. package/src/shapes/protocol.d.ts +3 -3
  143. package/src/transport/fin_store.d.ts +1 -1
  144. package/src/transport/transport-errors.d.ts +7 -2
  145. package/src/transport/transport-errors.js +1 -2
  146. package/src/transport/transport.d.ts +11 -8
  147. package/src/transport/transport.js +12 -6
  148. package/src/transport/wire.d.ts +14 -13
  149. package/src/util/channel-api-relay.d.ts +13 -0
  150. package/src/util/channel-api-relay.js +37 -0
  151. package/src/util/errors.d.ts +2 -2
  152. package/src/util/http.js +4 -2
  153. package/src/util/inaccessibleObject.d.ts +2 -0
  154. package/src/util/inaccessibleObject.js +49 -0
  155. package/src/util/lazy.d.ts +16 -0
  156. package/src/util/lazy.js +26 -0
  157. package/src/util/promises.d.ts +1 -1
  158. package/src/util/reversible-map.d.ts +11 -0
  159. package/src/util/reversible-map.js +49 -0
  160. package/src/util/utilTypes.d.ts +1 -1
@@ -6,7 +6,6 @@ const InteropClient_1 = require("../InteropClient");
6
6
  const utils_2 = require("./utils");
7
7
  const fdc3_1_2_1 = require("./fdc3-1.2");
8
8
  const PrivateChannelClient_1 = require("./PrivateChannelClient");
9
- const PrivateChannelProvider_1 = require("./PrivateChannelProvider");
10
9
  /**
11
10
  * @typedef { object } AppIdentifier
12
11
  * @summary Identifies an application, or instance of an application, and is used to target FDC3 API calls at specific applications.
@@ -181,7 +180,7 @@ class Fdc3Module2 extends base_1.Base {
181
180
  * Find all the available instances for a particular application.
182
181
  * @param { AppIdentifier } app
183
182
  * @returns { Promise<Array<AppIdentifier>> }
184
- * @tutorial findInstances
183
+ * @tutorial fdc3v2.findInstances
185
184
  */
186
185
  async findInstances(app) {
187
186
  this.wire.sendAction('fdc3-find-instances').catch((e) => {
@@ -191,7 +190,7 @@ class Fdc3Module2 extends base_1.Base {
191
190
  return await InteropClient_1.InteropClient.ferryFdc3Call(this.fin.me.interop, 'fdc3FindInstances', app);
192
191
  }
193
192
  catch (error) {
194
- const errorToThrow = error.message === utils_1.BROKER_ERRORS.fdc3FindInstances ? 'ResolverUnavailable' : error;
193
+ const errorToThrow = error.message === utils_1.BROKER_ERRORS.fdc3FindInstances ? 'ResolverUnavailable' : error.message;
195
194
  throw new Error(errorToThrow);
196
195
  }
197
196
  }
@@ -199,7 +198,7 @@ class Fdc3Module2 extends base_1.Base {
199
198
  * Retrieves the AppMetadata for an AppIdentifier, which provides additional metadata (such as icons, a title and description) from the App Directory record for the application, that may be used for display purposes.
200
199
  * @param { AppIdentifier } app
201
200
  * @returns { Promise<AppMetadata(2)> }
202
- * @tutorial getAppMetadata
201
+ * @tutorial fdc3v2.getAppMetadata
203
202
  */
204
203
  async getAppMetadata(app) {
205
204
  this.wire.sendAction('fdc3-get-app-metadata').catch((e) => {
@@ -209,7 +208,7 @@ class Fdc3Module2 extends base_1.Base {
209
208
  return await InteropClient_1.InteropClient.ferryFdc3Call(this.fin.me.interop, 'fdc3GetAppMetadata', app);
210
209
  }
211
210
  catch (error) {
212
- const errorToThrow = error.message === utils_1.BROKER_ERRORS.fdc3GetAppMetadata ? 'ResolverUnavailable' : error;
211
+ const errorToThrow = error.message === utils_1.BROKER_ERRORS.fdc3GetAppMetadata ? 'ResolverUnavailable' : error.message;
213
212
  throw new Error(errorToThrow);
214
213
  }
215
214
  }
@@ -268,7 +267,7 @@ class Fdc3Module2 extends base_1.Base {
268
267
  return await this.fin.me.interop.getInfoForIntent({ name: intent, context, metadata: { resultType } });
269
268
  }
270
269
  catch (error) {
271
- const errorToThrow = error.message === utils_1.BROKER_ERRORS.getInfoForIntent ? 'ResolverUnavailable' : error;
270
+ const errorToThrow = error.message === utils_1.BROKER_ERRORS.getInfoForIntent ? 'ResolverUnavailable' : error.message;
272
271
  throw new Error(errorToThrow);
273
272
  }
274
273
  }
@@ -277,7 +276,7 @@ class Fdc3Module2 extends base_1.Base {
277
276
  * @param { Context } context
278
277
  * @param { string } [resultType] The type of result returned for any intent specified during resolution.
279
278
  * @returns { Promise<Array<AppIntent(2)>> }
280
- * @tutorial findIntentsByContext
279
+ * @tutorial fdc3v2.findIntentsByContext
281
280
  */
282
281
  async findIntentsByContext(context, resultType) {
283
282
  this.wire.sendAction('fdc3-find-intents-by-context').catch((e) => {
@@ -288,7 +287,7 @@ class Fdc3Module2 extends base_1.Base {
288
287
  return await InteropClient_1.InteropClient.ferryFdc3Call(this.fin.me.interop, 'fdc3v2FindIntentsByContext', payload);
289
288
  }
290
289
  catch (error) {
291
- const errorToThrow = error.message === utils_1.BROKER_ERRORS.getInfoForIntentsByContext ? 'ResolverUnavailable' : error;
290
+ const errorToThrow = error.message === utils_1.BROKER_ERRORS.getInfoForIntentsByContext ? 'ResolverUnavailable' : error.message;
292
291
  throw new Error(errorToThrow);
293
292
  }
294
293
  }
@@ -298,7 +297,7 @@ class Fdc3Module2 extends base_1.Base {
298
297
  * @param { Context } context Context associated with the Intent
299
298
  * @param { AppIdentifier | TargetApp } [app]
300
299
  * @returns { Promise<IntentResolution(2)> }
301
- * @tutorial raiseIntent
300
+ * @tutorial fdc3v2.raiseIntent
302
301
  */
303
302
  async raiseIntent(intent, context, app) {
304
303
  this.wire.sendAction('fdc3-raise-intent').catch((e) => {
@@ -308,7 +307,7 @@ class Fdc3Module2 extends base_1.Base {
308
307
  return (0, utils_2.getIntentResolution)(this.fin.me.interop, context, app, intent);
309
308
  }
310
309
  catch (error) {
311
- const errorToThrow = error.message === utils_1.BROKER_ERRORS.fireIntent ? 'ResolverUnavailable' : error;
310
+ const errorToThrow = error.message === utils_1.BROKER_ERRORS.fireIntent ? 'ResolverUnavailable' : error.message;
312
311
  throw new Error(errorToThrow);
313
312
  }
314
313
  }
@@ -317,7 +316,7 @@ class Fdc3Module2 extends base_1.Base {
317
316
  * @param { Context } context Context associated with the Intent
318
317
  * @param { AppIdentifier | TargetApp } [app]
319
318
  * @returns { Promise<IntentResolution(2)> }
320
- * @tutorial raiseIntentForContext
319
+ * @tutorial fdc3v2.raiseIntentForContext
321
320
  */
322
321
  async raiseIntentForContext(context, app) {
323
322
  // TODO: We have to do the same thing we do for raiseIntent here as well.
@@ -328,7 +327,7 @@ class Fdc3Module2 extends base_1.Base {
328
327
  return (0, utils_2.getIntentResolution)(this.fin.me.interop, context, app);
329
328
  }
330
329
  catch (error) {
331
- const errorToThrow = error.message === utils_1.BROKER_ERRORS.fireIntent ? 'ResolverUnavailable' : error;
330
+ const errorToThrow = error.message === utils_1.BROKER_ERRORS.fireIntent ? 'ResolverUnavailable' : error.message;
332
331
  throw new Error(errorToThrow);
333
332
  }
334
333
  }
@@ -349,27 +348,27 @@ class Fdc3Module2 extends base_1.Base {
349
348
  // The FDC3 Intenter handler only expects the context and contextMetadata to be passed to the handler,
350
349
  // so we wrap it here and only pass those paramaters.
351
350
  const contextHandler = async (raisedIntent) => {
351
+ let intentResult;
352
+ let intentResultToSend;
352
353
  const { context, metadata: intentMetadata } = raisedIntent;
353
354
  const { contextMetadata, metadata, ...rest } = context;
354
- let intentResult;
355
+ const intentResolutionResultId = (intentMetadata === null || intentMetadata === void 0 ? void 0 : intentMetadata.intentResolutionResultId) || (metadata === null || metadata === void 0 ? void 0 : metadata.intentResolutionResultId);
355
356
  try {
356
357
  const newContext = metadata ? { metadata, ...rest } : { ...rest };
357
358
  intentResult = await handler(newContext, contextMetadata);
359
+ intentResultToSend = intentResult;
358
360
  }
359
361
  catch (error) {
360
362
  intentResult = error;
363
+ intentResultToSend = { error: true };
361
364
  }
362
- const intentResolutionResultId = (intentMetadata === null || intentMetadata === void 0 ? void 0 : intentMetadata.intentResolutionResultId) || (metadata === null || metadata === void 0 ? void 0 : metadata.intentResolutionResultId);
363
365
  if (intentResolutionResultId) {
364
- // Send whatever the result is.
365
- this.fin.InterApplicationBus.publish(intentResolutionResultId, intentResult);
366
+ this.fin.InterApplicationBus.publish(intentResolutionResultId, intentResultToSend);
366
367
  }
367
368
  if (intentResult instanceof Error) {
368
369
  throw new Error(intentResult.message);
369
370
  }
370
- else {
371
- return intentResult;
372
- }
371
+ return intentResult;
373
372
  };
374
373
  return this.fin.me.interop.registerIntentHandler(contextHandler, intent, { fdc3Version: '2.0' });
375
374
  }
@@ -385,12 +384,11 @@ class Fdc3Module2 extends base_1.Base {
385
384
  /**
386
385
  * Returns a Channel with an auto-generated identity that is intended for private communication between applications. Primarily used to create channels that will be returned to other applications via an IntentResolution for a raised intent.
387
386
  * @returns { Promise<PrivateChannel> }
388
- * @tutorial createPrivateChannel
387
+ * @tutorial fdc3v2.createPrivateChannel
389
388
  */
390
389
  async createPrivateChannel() {
391
390
  const channelId = (0, utils_1.generateId)();
392
- const channelProvider = await this.fin.InterApplicationBus.Channel.create(channelId);
393
- const newPrivateChannelProvider = new PrivateChannelProvider_1.PrivateChannelProvider(channelProvider, channelId);
391
+ await InteropClient_1.InteropClient.ferryFdc3Call(this.fin.me.interop, 'createPrivateChannelProvider', { channelId });
394
392
  const channelClient = await this.fin.InterApplicationBus.Channel.connect(channelId);
395
393
  const newPrivateChannelClient = new PrivateChannelClient_1.PrivateChannelClient(channelClient, channelId);
396
394
  return (0, utils_2.buildPrivateChannelObject)(newPrivateChannelClient);
@@ -398,7 +396,7 @@ class Fdc3Module2 extends base_1.Base {
398
396
  /**
399
397
  * Retrieves a list of the User Channels available for the app to join.
400
398
  * @returns { Promise<Channel[]>}
401
- * @tutorial getUserChannels
399
+ * @tutorial fdc3v2.getUserChannels
402
400
  */
403
401
  async getUserChannels() {
404
402
  const channels = await this.fin.me.interop.getContextGroups();
@@ -422,7 +420,7 @@ class Fdc3Module2 extends base_1.Base {
422
420
  * Join an app to a specified User channel.
423
421
  * @param { string } channelId Channel name
424
422
  * @returns { Promise<void> }
425
- * @tutorial joinUserChannel
423
+ * @tutorial fdc3v2.joinUserChannel
426
424
  */
427
425
  async joinUserChannel(channelId) {
428
426
  return this.fdc3Module.joinChannel(channelId);
@@ -441,9 +439,18 @@ class Fdc3Module2 extends base_1.Base {
441
439
  /**
442
440
  * Returns the Channel object for the current User channel membership
443
441
  * @returns { Promise<FDC3.Channel | null> }
442
+ * @tutorial fdc3.getCurrentChannel
444
443
  */
445
444
  async getCurrentChannel() {
446
- return this.fdc3Module.getCurrentChannel();
445
+ const currentChannel = await this.fdc3Module.getCurrentChannel();
446
+ if (!currentChannel) {
447
+ return null;
448
+ }
449
+ return {
450
+ ...currentChannel,
451
+ type: 'user',
452
+ broadcast: this.broadcast.bind(this)
453
+ };
447
454
  }
448
455
  /**
449
456
  * Removes the app from any User channel membership.
@@ -457,7 +464,7 @@ class Fdc3Module2 extends base_1.Base {
457
464
  * Retrieves information about the FDC3 implementation, including the supported version of the FDC3 specification, the name of the provider of the implementation, its own version number, details of whether optional API features are implemented and the metadata of the calling application according to the desktop agent.
458
465
  * fdc3HandleGetInfo must be overridden in the InteropBroker so that the ImplementationMetadata will have the appMetadata info.
459
466
  * @returns { Promise<ImplementationMetadata(2)> }
460
- * @tutorial getInfo
467
+ * @tutorial fdc3v2.getInfo
461
468
  */
462
469
  async getInfo() {
463
470
  return InteropClient_1.InteropClient.ferryFdc3Call(this.fin.me.interop, 'fdc3v2GetInfo', { fdc3Version: '2.0' });
@@ -1,13 +1,12 @@
1
1
  import Fdc3Module from './fdc3-1.2';
2
2
  import Fdc3Module2 from './fdc3-2.0';
3
- import type Transport from '../../../transport/transport';
3
+ import type { Transport } from '../../../transport/transport';
4
+ import { Fdc3Version } from './versions';
4
5
  declare global {
5
6
  interface Window {
6
7
  fdc3: Fdc3Module | Fdc3Module2;
7
8
  }
8
9
  }
9
- declare type Fdc3Versions = '1.2' | '2.0';
10
- export declare const versionMap: Record<Fdc3Versions, typeof Fdc3Module | typeof Fdc3Module2>;
10
+ export declare const versionMap: Record<Fdc3Version, typeof Fdc3Module | typeof Fdc3Module2>;
11
11
  export declare function registerFdc3Shim(version: string, transport: Transport): void;
12
- export declare function getFdc3(transport: Transport, version?: Fdc3Versions): Fdc3Module | Fdc3Module2;
13
- export {};
12
+ export declare function getFdc3(transport: Transport, version?: Fdc3Version): Fdc3Module | Fdc3Module2;
@@ -0,0 +1,4 @@
1
+ import * as OpenFin from '../../../OpenFin';
2
+ import { Fdc3Version } from './versions';
3
+ export declare function getDefaultViewFdc3VersionFromAppInfo({ manifest, initialOptions }: Awaited<ReturnType<OpenFin.Application['getInfo']>>): Fdc3Version | undefined;
4
+ export declare function overrideCheck(overriddenBroker: OpenFin.InteropBroker, fdc3InteropApi?: Fdc3Version): void;
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.overrideCheck = exports.getDefaultViewFdc3VersionFromAppInfo = void 0;
4
+ const InteropBroker_1 = require("../InteropBroker");
5
+ function getDefaultViewFdc3VersionFromAppInfo({ manifest, initialOptions }) {
6
+ var _a, _b, _c, _d;
7
+ 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;
8
+ return ['1.2', '2.0'].includes(setVersion !== null && setVersion !== void 0 ? setVersion : '') ? setVersion : undefined;
9
+ }
10
+ exports.getDefaultViewFdc3VersionFromAppInfo = getDefaultViewFdc3VersionFromAppInfo;
11
+ // TODO: Unit test this
12
+ function overrideCheck(overriddenBroker, fdc3InteropApi) {
13
+ if (fdc3InteropApi && fdc3InteropApi === '2.0') {
14
+ const mustOverrideAPIs = [
15
+ 'fdc3HandleFindInstances',
16
+ 'handleInfoForIntent',
17
+ 'handleInfoForIntentsByContext',
18
+ 'fdc3HandleGetAppMetadata',
19
+ 'fdc3HandleGetInfo',
20
+ 'fdc3HandleOpen',
21
+ 'handleFiredIntent',
22
+ 'handleFiredIntentForContext'
23
+ ];
24
+ const notOverridden = mustOverrideAPIs.filter((api) => {
25
+ return overriddenBroker[api] === InteropBroker_1.InteropBroker.prototype[api];
26
+ });
27
+ if (notOverridden.length > 0) {
28
+ console.warn(`WARNING: FDC3 2.0 has been set as a default option for Views in this Platform, but the required InteropBroker APIs for FDC3 2.0 compliance have not all been overridden.\nThe following APIs need to be overridden:\n${notOverridden.join('\n')}`);
29
+ }
30
+ }
31
+ }
32
+ exports.overrideCheck = overrideCheck;
@@ -8,8 +8,8 @@ export type { Listener } from 'fdc3v1/src/api/Listener';
8
8
  export type { AppMetadata } from 'fdc3v1/src/api/AppMetadata';
9
9
  export type { AppIntent } from 'fdc3v1/src/api/AppIntent';
10
10
  export type { ImplementationMetadata } from 'fdc3v1/src/api/ImplementationMetadata';
11
- export declare type ContextHandler = (context: Context) => void;
12
- export declare type TargetApp = string | AppMetadata;
11
+ export type ContextHandler = (context: Context) => void;
12
+ export type TargetApp = string | AppMetadata;
13
13
  export interface Context {
14
14
  id?: {
15
15
  [key: string]: string;
@@ -30,7 +30,7 @@ export interface Channel {
30
30
  getCurrentContext(contextType?: string): Promise<Context | null>;
31
31
  addContextListener(contextType: string | null, handler: ContextHandler): Listener & Promise<Listener>;
32
32
  }
33
- export declare type SystemChannel = Omit<Channel, 'addContextListener' | 'broadcast' | 'getCurrentContext'> & {
33
+ export type SystemChannel = Omit<Channel, 'addContextListener' | 'broadcast' | 'getCurrentContext'> & {
34
34
  addContextListener(): Error;
35
35
  broadcast(): Error;
36
36
  getCurrentContext(): Error;
@@ -14,9 +14,9 @@ export type { ContextMetadata } from 'fdc3v2/src/api/ContextMetadata';
14
14
  export type { AppIdentifier } from 'fdc3v2/src/api/AppIdentifier';
15
15
  export type { AppMetadata } from 'fdc3v2/src/api/AppMetadata';
16
16
  export type { DisplayMetadata } from 'fdc3v2/src/api/DisplayMetadata';
17
- export declare type ContextHandler = (context: Context, metadata?: ContextMetadata) => void;
18
- export declare type IntentHandler = (context: Context, metadata?: ContextMetadata) => Promise<IntentResult> | void;
19
- export declare type IntentResult = Context | Channel | PrivateChannel;
17
+ export type ContextHandler = (context: Context, metadata?: ContextMetadata) => void;
18
+ export type IntentHandler = (context: Context, metadata?: ContextMetadata) => Promise<IntentResult> | void;
19
+ export type IntentResult = Context | Channel | PrivateChannel;
20
20
  export interface Context {
21
21
  id?: {
22
22
  [key: string]: string;
@@ -45,7 +45,7 @@ export interface Channel {
45
45
  getCurrentContext(contextType?: string): Promise<Context | null>;
46
46
  addContextListener(contextType: string | null, handler: ContextHandler): Listener & Promise<Listener>;
47
47
  }
48
- export declare type PrivateChannel = Omit<Channel, 'addContextListener'> & {
48
+ export type PrivateChannel = Omit<Channel, 'addContextListener'> & {
49
49
  addContextListener(contextType: string | null, handler: ContextHandler): Promise<Listener>;
50
50
  onAddContextListener(handler: (contextType?: string) => void): Listener;
51
51
  onUnsubscribe(handler: (contextType?: string) => void): Listener;
@@ -64,7 +64,7 @@ export interface DesktopAgent {
64
64
  addContextListener(contextType: string | null, handler: ContextHandler): Promise<Listener>;
65
65
  getUserChannels(): Promise<Array<SystemChannel>>;
66
66
  joinUserChannel(channelId: string): Promise<void>;
67
- getOrCreateChannel(channelId: string): Promise<ChannelV1>;
67
+ getOrCreateChannel(channelId: string): Promise<Channel>;
68
68
  createPrivateChannel(): Promise<PrivateChannel>;
69
69
  getCurrentChannel(): Promise<ChannelV1 | null>;
70
70
  leaveCurrentChannel(): Promise<void>;
@@ -21,8 +21,25 @@ export declare enum ResultError {
21
21
  */
22
22
  IntentHandlerRejected = "IntentHandlerRejected"
23
23
  }
24
+ export declare enum ChannelError {
25
+ /** Returned if the specified channel is not found when attempting to join a
26
+ * channel via the `joinUserChannel` function of the DesktopAgent (`fdc3`).
27
+ */
28
+ NoChannelFound = "NoChannelFound",
29
+ /** SHOULD be returned when a request to join a user channel or to a retrieve
30
+ * a Channel object via the `joinUserChannel` or `getOrCreateChannel` methods
31
+ * of the DesktopAgent (`fdc3`) object is denied.
32
+ */
33
+ AccessDenied = "AccessDenied",
34
+ /** SHOULD be returned when a channel cannot be created or retrieved via the
35
+ * `getOrCreateChannel` method of the DesktopAgent (`fdc3`).
36
+ */
37
+ CreationFailed = "CreationFailed"
38
+ }
24
39
  export declare const buildPrivateChannelObject: (privateChannelClient: PrivateChannelClient) => PrivateChannel;
25
40
  export declare const buildAppChannelObject: (sessionContextGroup: OpenFin.SessionContextGroup) => Channel;
26
41
  export declare const connectPrivateChannel: (channelId: string) => Promise<PrivateChannel>;
42
+ export declare const isContext: (context: unknown) => context is Context;
43
+ export declare const isChannel: (channel: unknown) => channel is Channel;
27
44
  export declare const getIntentResolution: (interopModule: OpenFin.InteropClient, context: Context, app?: AppIdentifier | TargetApp, intent?: string) => Promise<IntentResolution>;
28
45
  export {};
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getIntentResolution = exports.connectPrivateChannel = exports.buildAppChannelObject = exports.buildPrivateChannelObject = exports.ResultError = exports.UnsupportedChannelApiError = exports.getUnsupportedChannelApis = void 0;
3
+ exports.getIntentResolution = exports.isChannel = exports.isContext = exports.connectPrivateChannel = exports.buildAppChannelObject = exports.buildPrivateChannelObject = exports.ChannelError = exports.ResultError = exports.UnsupportedChannelApiError = exports.getUnsupportedChannelApis = void 0;
4
4
  const utils_1 = require("../utils");
5
5
  const PrivateChannelClient_1 = require("./PrivateChannelClient");
6
6
  const getUnsupportedChannelApis = (channelType) => {
@@ -35,6 +35,22 @@ var ResultError;
35
35
  */
36
36
  ResultError["IntentHandlerRejected"] = "IntentHandlerRejected";
37
37
  })(ResultError = exports.ResultError || (exports.ResultError = {}));
38
+ var ChannelError;
39
+ (function (ChannelError) {
40
+ /** Returned if the specified channel is not found when attempting to join a
41
+ * channel via the `joinUserChannel` function of the DesktopAgent (`fdc3`).
42
+ */
43
+ ChannelError["NoChannelFound"] = "NoChannelFound";
44
+ /** SHOULD be returned when a request to join a user channel or to a retrieve
45
+ * a Channel object via the `joinUserChannel` or `getOrCreateChannel` methods
46
+ * of the DesktopAgent (`fdc3`) object is denied.
47
+ */
48
+ ChannelError["AccessDenied"] = "AccessDenied";
49
+ /** SHOULD be returned when a channel cannot be created or retrieved via the
50
+ * `getOrCreateChannel` method of the DesktopAgent (`fdc3`).
51
+ */
52
+ ChannelError["CreationFailed"] = "CreationFailed";
53
+ })(ChannelError = exports.ChannelError || (exports.ChannelError = {}));
38
54
  const buildPrivateChannelObject = (privateChannelClient) => {
39
55
  let clientDisconnected = false;
40
56
  const checkIfClientDisconnected = () => {
@@ -122,6 +138,22 @@ const connectPrivateChannel = async (channelId) => {
122
138
  }
123
139
  };
124
140
  exports.connectPrivateChannel = connectPrivateChannel;
141
+ const isContext = (context) => {
142
+ if (context && typeof context === 'object' && 'type' in context) {
143
+ const { type } = context;
144
+ return typeof type === 'string';
145
+ }
146
+ return false;
147
+ };
148
+ exports.isContext = isContext;
149
+ const isChannel = (channel) => {
150
+ if (channel && typeof channel === 'object' && 'type' in channel && 'id' in channel) {
151
+ const { type, id } = channel;
152
+ return (typeof type === 'string' && typeof id === 'string' && (type === 'app' || type === 'private'));
153
+ }
154
+ return false;
155
+ };
156
+ exports.isChannel = isChannel;
125
157
  const getIntentResolution = async (interopModule, context, app, intent) => {
126
158
  // Generate an ID to make a session context group with. We will pass that ID to the Broker.
127
159
  // The broker will then setContext on that session context group later with our Intent Result,
@@ -138,31 +170,33 @@ const getIntentResolution = async (interopModule, context, app, intent) => {
138
170
  // Set up the getResult call.
139
171
  const getResult = async () => {
140
172
  let intentResult = await getResultPromise;
141
- if (!intentResult) {
173
+ if (!intentResult || typeof intentResult !== 'object') {
142
174
  throw new Error(ResultError.NoResultReturned);
143
175
  }
144
- if (intentResult instanceof Error) {
176
+ const { error } = intentResult;
177
+ if (error) {
145
178
  throw new Error(ResultError.IntentHandlerRejected);
146
179
  }
147
- if (typeof intentResult === 'object') {
180
+ if ((0, exports.isChannel)(intentResult)) {
148
181
  const { id, type } = intentResult;
149
- if (type && id && typeof id === 'string') {
150
- switch (type) {
151
- case 'private': {
152
- intentResult = await (0, exports.connectPrivateChannel)(id);
153
- break;
154
- }
155
- case 'app': {
156
- const sessionContextGroup = await interopModule.joinSessionContextGroup(id);
157
- intentResult = (0, exports.buildAppChannelObject)(sessionContextGroup);
158
- break;
159
- }
160
- default: {
161
- break;
162
- }
182
+ switch (type) {
183
+ case 'private': {
184
+ intentResult = await (0, exports.connectPrivateChannel)(id);
185
+ break;
186
+ }
187
+ case 'app': {
188
+ const sessionContextGroup = await interopModule.joinSessionContextGroup(id);
189
+ intentResult = (0, exports.buildAppChannelObject)(sessionContextGroup);
190
+ break;
191
+ }
192
+ default: {
193
+ break;
163
194
  }
164
195
  }
165
196
  }
197
+ else if (!(0, exports.isContext)(intentResult)) {
198
+ throw new Error(ResultError.NoResultReturned);
199
+ }
166
200
  return intentResult;
167
201
  };
168
202
  // Finally fire the intent.
@@ -0,0 +1 @@
1
+ export type Fdc3Version = '1.2' | '2.0';
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -16,4 +16,3 @@ export declare const BROKER_ERRORS: {
16
16
  fdc3GetInfo: string;
17
17
  };
18
18
  export declare const wrapIntentHandler: (handler: OpenFin.IntentHandler, handlerId: string) => (intent: OpenFin.Intent) => Promise<void>;
19
- export declare const generateDefaultLoggingOptions: () => OpenFin.InteropLoggingOptions;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.generateDefaultLoggingOptions = exports.wrapIntentHandler = exports.BROKER_ERRORS = exports.generateOverrideWarning = exports.generateOverrideError = exports.wrapContextHandler = exports.wrapInTryCatch = exports.generateId = void 0;
3
+ exports.wrapIntentHandler = exports.BROKER_ERRORS = exports.generateOverrideWarning = exports.generateOverrideError = exports.wrapContextHandler = exports.wrapInTryCatch = exports.generateId = void 0;
4
4
  const generateId = () => `${Math.random()}${Date.now()}`;
5
5
  exports.generateId = generateId;
6
6
  const wrapInTryCatch = (f, prefix) => (...args) => {
@@ -59,11 +59,3 @@ const wrapIntentHandler = (handler, handlerId) => {
59
59
  };
60
60
  };
61
61
  exports.wrapIntentHandler = wrapIntentHandler;
62
- const generateDefaultLoggingOptions = () => {
63
- const loggingActions = ['beforeAction', 'afterAction'];
64
- const options = loggingActions.reduce((accumulator, loggingOption) => {
65
- return { ...accumulator, [loggingOption]: { enabled: true } };
66
- }, {});
67
- return options;
68
- };
69
- exports.generateDefaultLoggingOptions = generateDefaultLoggingOptions;
package/src/api/me.d.ts CHANGED
@@ -1,9 +1,9 @@
1
1
  import type * as OpenFin from '../OpenFin';
2
- import type Transport from '../transport/transport';
2
+ import type { Transport } from '../transport/transport';
3
3
  import type { InteropClient } from './interop';
4
4
  export declare const environmentUnsupportedMessage = "You are not running in OpenFin.";
5
- declare type EntityType = OpenFin.EntityType;
6
- export declare type EntityTypeHelpers<T extends EntityType> = T extends 'view' ? {
5
+ type EntityType = OpenFin.EntityType;
6
+ export type EntityTypeHelpers<T extends EntityType> = T extends 'view' ? {
7
7
  isView: true;
8
8
  isWindow: false;
9
9
  isExternal: false;
@@ -33,7 +33,7 @@ export declare function getBaseMe<T extends EntityType = EntityType>(entityType:
33
33
  export interface WithInterop {
34
34
  interop: InteropClient;
35
35
  }
36
- export declare type Me<MeType extends EntityType> = OpenFin.EntityInfo & (MeType extends 'view' ? EntityTypeHelpers<'view'> & OpenFin.View & WithInterop : MeType extends 'window' ? EntityTypeHelpers<'window'> & OpenFin.Window & WithInterop : MeType extends 'iframe' ? EntityTypeHelpers<'iframe'> & OpenFin.Frame & WithInterop : EntityTypeHelpers<MeType> & WithInterop) & {
36
+ export type Me<MeType extends EntityType> = OpenFin.EntityInfo & (MeType extends 'view' ? EntityTypeHelpers<'view'> & OpenFin.View & WithInterop : MeType extends 'window' ? EntityTypeHelpers<'window'> & OpenFin.Window & WithInterop : MeType extends 'iframe' ? EntityTypeHelpers<'iframe'> & OpenFin.Frame & WithInterop : EntityTypeHelpers<MeType> & WithInterop) & {
37
37
  isOpenFin: boolean;
38
38
  };
39
39
  export declare function getMe<MeType extends EntityType>(wire: Transport<MeType>): Me<MeType>;
@@ -1,20 +1,23 @@
1
1
  import type * as OpenFin from '../../OpenFin';
2
2
  import { Base } from '../base';
3
3
  import { Channel } from '../interappbus/channel/index';
4
- import Transport from '../../transport/transport';
4
+ import { Transport } from '../../transport/transport';
5
5
  import { LayoutModule } from './layout/index';
6
6
  /**
7
+ * @PORTED
7
8
  * InitPlatformOptions interface
8
9
  * @typedef { object } InitPlatformOptions
9
10
  * @property { OverrideCallback } [overrideCallback] a callback function that can be used to extend or replace default Provider behavior.
10
11
  */
11
12
  /**
13
+ * @PORTED
12
14
  * @typedef { same | different } ProcessAffinityStrategy
13
15
  * @summary Strategy to place views that share a domain into different process affinities or the same process affinity.
14
16
  * @property { string } same views in the same domain will have the same process affinity.
15
17
  * @property { string } different views in the same domain will have different process affinities.
16
18
  */
17
19
  /**
20
+ * @PORTED
18
21
  * @typedef { object } PlatformOptions
19
22
  * @summary The options object required by {@link Platform#start Platform.start}
20
23
  * Any {@link ApplicationOptions Application option} is also a valid platform option
@@ -25,6 +28,7 @@ import { LayoutModule } from './layout/index';
25
28
  * @property {ProcessAffinityStrategy} [viewProcessAffinityStrategy] 'same' | 'different'.
26
29
  */
27
30
  /**
31
+ * @PORTED
28
32
  * @typedef { object } DefaultWindowOptions
29
33
  * @summary Default window options apply to all platform windows.
30
34
  * Any {@link Window~options Window option} is also a valid Default Window option
@@ -36,6 +40,7 @@ import { LayoutModule } from './layout/index';
36
40
  * Windows with a specified url (Custom Windows) will not be affected by this option.
37
41
  */
38
42
  /**
43
+ * @DELETED
39
44
  * Snapshot interface
40
45
  * @typedef { object } Snapshot
41
46
  * @property { WindowOption[] } windows The array of window options objects
@@ -5,17 +5,20 @@ const base_1 = require("../base");
5
5
  const index_1 = require("./layout/index");
6
6
  const Instance_1 = require("./Instance");
7
7
  /**
8
+ * @PORTED
8
9
  * InitPlatformOptions interface
9
10
  * @typedef { object } InitPlatformOptions
10
11
  * @property { OverrideCallback } [overrideCallback] a callback function that can be used to extend or replace default Provider behavior.
11
12
  */
12
13
  /**
14
+ * @PORTED
13
15
  * @typedef { same | different } ProcessAffinityStrategy
14
16
  * @summary Strategy to place views that share a domain into different process affinities or the same process affinity.
15
17
  * @property { string } same views in the same domain will have the same process affinity.
16
18
  * @property { string } different views in the same domain will have different process affinities.
17
19
  */
18
20
  /**
21
+ * @PORTED
19
22
  * @typedef { object } PlatformOptions
20
23
  * @summary The options object required by {@link Platform#start Platform.start}
21
24
  * Any {@link ApplicationOptions Application option} is also a valid platform option
@@ -26,6 +29,7 @@ const Instance_1 = require("./Instance");
26
29
  * @property {ProcessAffinityStrategy} [viewProcessAffinityStrategy] 'same' | 'different'.
27
30
  */
28
31
  /**
32
+ * @PORTED
29
33
  * @typedef { object } DefaultWindowOptions
30
34
  * @summary Default window options apply to all platform windows.
31
35
  * Any {@link Window~options Window option} is also a valid Default Window option
@@ -37,6 +41,7 @@ const Instance_1 = require("./Instance");
37
41
  * Windows with a specified url (Custom Windows) will not be affected by this option.
38
42
  */
39
43
  /**
44
+ * @DELETED
40
45
  * Snapshot interface
41
46
  * @typedef { object } Snapshot
42
47
  * @property { WindowOption[] } windows The array of window options objects
@@ -72,7 +77,7 @@ class PlatformModule extends base_1.Base {
72
77
  const overrideCallback = options === null || options === void 0 ? void 0 : options.overrideCallback;
73
78
  const interopBroker = await this.fin.Interop.init(this.fin.me.uuid, options === null || options === void 0 ? void 0 : options.interopOverride);
74
79
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
75
- // @ts-ignore debugging purposes
80
+ // @ts-expect-error debugging purposes
76
81
  window.interopBroker = interopBroker;
77
82
  return this._initializer(overrideCallback, interopBroker);
78
83
  }
@@ -142,14 +147,12 @@ class PlatformModule extends base_1.Base {
142
147
  return new Promise(async (resolve, reject) => {
143
148
  try {
144
149
  const { uuid } = platformOptions;
145
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
146
- // @ts-ignore using private variable.
150
+ // @ts-expect-error using private variable.
147
151
  const app = await this.fin.Application._create({ ...platformOptions, isPlatformController: true });
148
152
  // TODO: fix typing (internal)
149
153
  // @ts-expect-error
150
154
  app.once('platform-api-ready', () => resolve(this.wrapSync({ uuid })));
151
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
152
- // @ts-ignore using private variable.
155
+ // @ts-expect-error using private variable.
153
156
  app._run({ uuid });
154
157
  }
155
158
  catch (e) {
@@ -173,14 +176,12 @@ class PlatformModule extends base_1.Base {
173
176
  // eslint-disable-next-line no-async-promise-executor
174
177
  return new Promise(async (resolve, reject) => {
175
178
  try {
176
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
177
- // @ts-ignore using private variable.
179
+ // @ts-expect-error using private variable.
178
180
  const app = await this.fin.Application._createFromManifest(manifestUrl);
179
181
  // TODO: fix typing (internal)
180
182
  // @ts-expect-error
181
183
  app.once('platform-api-ready', () => resolve(this.wrapSync({ uuid: app.identity.uuid })));
182
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
183
- // @ts-ignore using private method without warning.
184
+ // @ts-expect-error using private method without warning.
184
185
  app._run(opts);
185
186
  }
186
187
  catch (e) {
@@ -27,7 +27,7 @@ export declare class Platform extends EmitterBase<OpenFin.PlatformEvent> {
27
27
  * @return { Promise<View> }
28
28
  * @tutorial Platform.createView
29
29
  */
30
- createView(viewOptions: OpenFin.PlatformViewCreationOptions, target?: OpenFin.Identity, targetView?: OpenFin.Identity): Promise<View>;
30
+ createView(viewOptions: OpenFin.PlatformViewCreationOptions, target?: OpenFin.CreateViewTarget, targetView?: OpenFin.Identity): Promise<View>;
31
31
  /**
32
32
  * Creates a new Window.
33
33
  * @param { Window~options } options Window creation options
@@ -66,14 +66,16 @@ export declare class Platform extends EmitterBase<OpenFin.PlatformEvent> {
66
66
  */
67
67
  getSnapshot(): Promise<OpenFin.Snapshot>;
68
68
  /**
69
+ * **NOTE**: Internal use only. It is not recommended to manage the state of individual views.
70
+ *
69
71
  * Returns a snapshot of a single view's options in its current state.
70
72
  *
71
73
  * Can be used to restore a view to a previous state.
72
74
  *
73
- * NOTE: this method is meant for advanced usage only, it is not recommended to manage the state of individual views.
74
- *
75
75
  * @param { Identity } viewIdentity View identity
76
76
  * @returns { Promise<ViewState> }
77
+ * @internal
78
+ * @experimental
77
79
  * @tutorial Platform.getViewSnapshot
78
80
  */
79
81
  getViewSnapshot(viewIdentity: OpenFin.Identity): Promise<OpenFin.ViewState>;