@openfin/core 33.76.27 → 33.76.36

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 (116) hide show
  1. package/openfin-core-33.76.36.tgz +0 -0
  2. package/package.json +1 -1
  3. package/src/OpenFin.d.ts +27 -16
  4. package/src/api/application/Factory.d.ts +148 -100
  5. package/src/api/application/Factory.js +148 -100
  6. package/src/api/application/Instance.d.ts +477 -106
  7. package/src/api/application/Instance.js +474 -106
  8. package/src/api/application/index.d.ts +9 -0
  9. package/src/api/application/index.js +9 -0
  10. package/src/api/base.d.ts +69 -0
  11. package/src/api/base.js +69 -0
  12. package/src/api/clipboard/index.d.ts +111 -31
  13. package/src/api/clipboard/index.js +111 -31
  14. package/src/api/events/application.d.ts +12 -0
  15. package/src/api/events/application.js +12 -0
  16. package/src/api/events/channel.d.ts +5 -0
  17. package/src/api/events/channel.js +5 -0
  18. package/src/api/events/externalApplication.d.ts +5 -0
  19. package/src/api/events/externalApplication.js +5 -0
  20. package/src/api/events/frame.d.ts +5 -0
  21. package/src/api/events/globalHotkey.d.ts +5 -0
  22. package/src/api/events/platform.d.ts +9 -1
  23. package/src/api/events/platform.js +8 -0
  24. package/src/api/events/system.d.ts +13 -0
  25. package/src/api/events/system.js +13 -0
  26. package/src/api/events/view.d.ts +19 -9
  27. package/src/api/events/view.js +10 -0
  28. package/src/api/events/webcontents.d.ts +21 -10
  29. package/src/api/events/webcontents.js +11 -0
  30. package/src/api/events/window.d.ts +70 -1
  31. package/src/api/events/window.js +10 -0
  32. package/src/api/external-application/Factory.d.ts +16 -9
  33. package/src/api/external-application/Factory.js +16 -9
  34. package/src/api/external-application/Instance.d.ts +40 -32
  35. package/src/api/external-application/Instance.js +40 -32
  36. package/src/api/external-application/index.d.ts +9 -0
  37. package/src/api/external-application/index.js +9 -0
  38. package/src/api/fin.d.ts +3 -0
  39. package/src/api/fin.js +3 -0
  40. package/src/api/frame/Factory.d.ts +30 -13
  41. package/src/api/frame/Factory.js +30 -13
  42. package/src/api/frame/Instance.d.ts +51 -38
  43. package/src/api/frame/Instance.js +51 -38
  44. package/src/api/frame/index.d.ts +11 -0
  45. package/src/api/frame/index.js +11 -0
  46. package/src/api/global-hotkey/index.d.ts +81 -13
  47. package/src/api/global-hotkey/index.js +81 -13
  48. package/src/api/interappbus/channel/channel.d.ts +257 -0
  49. package/src/api/interappbus/channel/channel.js +257 -0
  50. package/src/api/interappbus/channel/channels-docs.d.ts +59 -57
  51. package/src/api/interappbus/channel/channels-docs.js +71 -68
  52. package/src/api/interappbus/channel/client.d.ts +93 -0
  53. package/src/api/interappbus/channel/client.js +93 -1
  54. package/src/api/interappbus/channel/index.d.ts +164 -0
  55. package/src/api/interappbus/channel/index.js +165 -1
  56. package/src/api/interappbus/channel/provider.d.ts +172 -0
  57. package/src/api/interappbus/channel/provider.js +172 -0
  58. package/src/api/interappbus/index.d.ts +55 -20
  59. package/src/api/interappbus/index.js +55 -20
  60. package/src/api/interop/Factory.d.ts +30 -10
  61. package/src/api/interop/Factory.js +30 -10
  62. package/src/api/interop/InteropBroker.d.ts +298 -70
  63. package/src/api/interop/InteropBroker.js +298 -70
  64. package/src/api/interop/InteropClient.d.ts +286 -62
  65. package/src/api/interop/InteropClient.js +286 -62
  66. package/src/api/interop/SessionContextGroupClient.d.ts +2 -2
  67. package/src/api/interop/SessionContextGroupClient.js +2 -2
  68. package/src/api/interop/fdc3/documentationStub.d.ts +14 -0
  69. package/src/api/interop/fdc3/documentationStub.js +17 -0
  70. package/src/api/interop/fdc3/fdc3-1.2.d.ts +31 -34
  71. package/src/api/interop/fdc3/fdc3-1.2.js +31 -34
  72. package/src/api/interop/fdc3/fdc3-2.0.d.ts +48 -51
  73. package/src/api/interop/fdc3/fdc3-2.0.js +48 -51
  74. package/src/api/interop/index.d.ts +8 -0
  75. package/src/api/interop/index.js +8 -0
  76. package/src/api/platform/Factory.d.ts +121 -65
  77. package/src/api/platform/Factory.js +122 -66
  78. package/src/api/platform/Instance.d.ts +551 -48
  79. package/src/api/platform/Instance.js +551 -49
  80. package/src/api/platform/index.d.ts +9 -0
  81. package/src/api/platform/index.js +9 -0
  82. package/src/api/platform/layout/Factory.d.ts +53 -76
  83. package/src/api/platform/layout/Factory.js +53 -76
  84. package/src/api/platform/layout/Instance.d.ts +158 -23
  85. package/src/api/platform/layout/Instance.js +118 -20
  86. package/src/api/platform/layout/entities/layout-entities.d.ts +222 -30
  87. package/src/api/platform/layout/entities/layout-entities.js +222 -30
  88. package/src/api/platform/layout/index.d.ts +9 -0
  89. package/src/api/platform/layout/index.js +9 -0
  90. package/src/api/platform/provider.d.ts +398 -51
  91. package/src/api/snapshot-source/Factory.d.ts +33 -18
  92. package/src/api/snapshot-source/Factory.js +33 -18
  93. package/src/api/snapshot-source/Instance.d.ts +30 -8
  94. package/src/api/snapshot-source/Instance.js +30 -8
  95. package/src/api/snapshot-source/index.d.ts +9 -0
  96. package/src/api/snapshot-source/index.js +9 -0
  97. package/src/api/system/index.d.ts +1137 -186
  98. package/src/api/system/index.js +1142 -186
  99. package/src/api/view/Factory.d.ts +54 -16
  100. package/src/api/view/Factory.js +54 -16
  101. package/src/api/view/Instance.d.ts +330 -216
  102. package/src/api/view/Instance.js +331 -217
  103. package/src/api/view/index.d.ts +9 -0
  104. package/src/api/view/index.js +9 -0
  105. package/src/api/webcontents/main.d.ts +890 -0
  106. package/src/api/webcontents/main.js +890 -0
  107. package/src/api/window/Factory.d.ts +67 -16
  108. package/src/api/window/Factory.js +67 -16
  109. package/src/api/window/Instance.d.ts +824 -316
  110. package/src/api/window/Instance.js +822 -320
  111. package/src/api/window/index.d.ts +11 -0
  112. package/src/api/window/index.js +11 -0
  113. package/src/namespaces.d.ts +1 -0
  114. package/src/namespaces.js +3 -1
  115. package/src/shapes/protocol.d.ts +4 -0
  116. package/openfin-core-33.76.27.tgz +0 -0
@@ -89,21 +89,21 @@ const utils_1 = require("./utils");
89
89
  /**
90
90
  * @typedef {function} setContext
91
91
  * @summary A SessionContextGroup instance method for setting a context in the SessionContextGroup.
92
- * @param {Context} context The Context to be set.
93
- * @return {Promise<void>}
92
+ * @param context The Context to be set.
93
+ *
94
94
  */
95
95
  /**
96
96
  * @typedef {function} getCurrentContext
97
97
  * @summary A SessionContextGroup instance method for getting the current context of a certain type.
98
- * @param {string} [contextType] The Context Type to get. If not specified the last contextType set would get used.
99
- * @return {Promise<Context>}
98
+ * @param contextType The Context Type to get. If not specified the last contextType set would get used.
99
+ *
100
100
  */
101
101
  /**
102
102
  * @typedef {function} addContextHandler
103
103
  * @summary A SessionContextGroup instance method for adding a handler for context change.
104
- * @param {ContextHandler} contextHandler The callback to be invoked. Is invoked when (a) the context changes or (b) immediately after getting created if the context is already set.
105
- * @param {string} [contextType] The context type this handler should listen to. If not specified, a global handler for all context types will get created. Only one global handler is allowed per SessionContextGroup.
106
- * @return {Promise<Subscription>}
104
+ * @param contextHandler The callback to be invoked. Is invoked when (a) the context changes or (b) immediately after getting created if the context is already set.
105
+ * @param contextType The context type this handler should listen to. If not specified, a global handler for all context types will get created. Only one global handler is allowed per SessionContextGroup.
106
+ *
107
107
  */
108
108
  /**
109
109
  * {@link https://developers.openfin.co/of-docs/docs/enable-color-linking}
@@ -155,12 +155,11 @@ const utils_1 = require("./utils");
155
155
  * * {@link InteropClient#getInfoForContextGroup getInfoForContextGroup(contextGroupId)}
156
156
  * * {@link InteropClient#getAllClientsInContextGroup getAllClientsInContextGroup(contextGroupId)}
157
157
  *
158
-
159
- *
160
- * @hideconstructor
161
- * @class
162
158
  */
163
159
  class InteropClient extends base_1.Base {
160
+ /**
161
+ * @internal
162
+ */
164
163
  constructor(wire, name, interopConfig = {}) {
165
164
  super(wire);
166
165
  _InteropClient_clientPromise.set(this, void 0);
@@ -177,9 +176,22 @@ class InteropClient extends base_1.Base {
177
176
  */
178
177
  /**
179
178
  * Sets a context for the context group of the current entity.
180
- * @param { Context } context - New context to set.
181
- * @return { Promise<void> }
182
- * @tutorial interop.setContext
179
+ *
180
+ * @remarks The entity must be part of a context group in order set a context.
181
+ *
182
+ * @param context - New context to set.
183
+ *
184
+ * @example
185
+ * ```js
186
+ * setInstrumentContext = async (ticker) => {
187
+ * fin.me.interop.setContext({type: 'instrument', id: {ticker}})
188
+ * }
189
+ *
190
+ * // The user clicks an instrument of interest. We want to set that Instrument context so that the rest of our workflow updates with information for that instrument
191
+ * instrumentElement.on('click', (evt) => {
192
+ * setInstrumentContext(evt.ticker)
193
+ * })
194
+ * ```
183
195
  */
184
196
  async setContext(context) {
185
197
  this.wire.sendAction('interop-client-set-context').catch((e) => {
@@ -189,11 +201,63 @@ class InteropClient extends base_1.Base {
189
201
  return client.dispatch('setContext', { context });
190
202
  }
191
203
  /**
192
- * Add a context handler for incoming context. If an entity is part of a context group, and then sets its context handler, it will receive all of its declared contexts.
193
- * @param { ContextHandler } handler - Handler for incoming context.
194
- * @param { string } [contextType] - The type of context you wish to handle.
195
- * @return { Promise<Subscription> }
196
- * @tutorial interop.addContextHandler
204
+ * Add a context handler for incoming context. If an entity is part of a context group, and then sets its context handler,
205
+ * it will receive all of its declared contexts.
206
+ *
207
+ * @param handler - Handler for incoming context.
208
+ * @param contextType - The type of context you wish to handle.
209
+ *
210
+ * @example
211
+ * ```js
212
+ * function handleIncomingContext(contextInfo) {
213
+ * const { type, id } = contextInfo;
214
+ * switch (type) {
215
+ * case 'instrument':
216
+ * handleInstrumentContext(contextInfo);
217
+ * break;
218
+ * case 'country':
219
+ * handleCountryContext(contextInfo);
220
+ * break;
221
+ *
222
+ * default:
223
+ * break;
224
+ * }
225
+ * }
226
+ *
227
+ *
228
+ * function handleInstrumentContext(contextInfo) {
229
+ * const { type, id } = contextInfo;
230
+ * console.log('contextInfo for instrument', contextInfo)
231
+ * }
232
+ *
233
+ * function handleCountryContext(contextInfo) {
234
+ * const { type, id } = contextInfo;
235
+ * console.log('contextInfo for country', contextInfo)
236
+ * }
237
+ *
238
+ * fin.me.interop.addContextHandler(handleIncomingContext);
239
+ * ```
240
+ *
241
+ *
242
+ * We are also testing the ability to add a context handler for specific contexts. If you would like to use
243
+ * this, please make sure you add your context handlers at the top level of your application, on a page that
244
+ * does not navigate/reload/re-render, to avoid memory leaks. This feature is experimental:
245
+ *
246
+ * ```js
247
+ * function handleInstrumentContext(contextInfo) {
248
+ * const { type, id } = contextInfo;
249
+ * console.log('contextInfo for instrument', contextInfo)
250
+ * }
251
+ *
252
+ * function handleCountryContext(contextInfo) {
253
+ * const { type, id } = contextInfo;
254
+ * console.log('contextInfo for country', contextInfo)
255
+ * }
256
+ *
257
+ *
258
+ * fin.me.interop.addContextHandler(handleInstrumentContext, 'instrument')
259
+ * fin.me.interop.addContextHandler(handleCountryContext, 'country')
260
+ * ```
197
261
  */
198
262
  async addContextHandler(handler, contextType) {
199
263
  this.wire.sendAction('interop-client-add-context-handler').catch((e) => {
@@ -227,8 +291,17 @@ class InteropClient extends base_1.Base {
227
291
  /**
228
292
  * Returns the Interop-Broker-defined context groups available for an entity to join.
229
293
  * Used by Platform Windows.
230
- * @return { Promise<ContextGroupInfo[]>}
231
- * @tutorial interop.getContextGroups
294
+ *
295
+ * @example
296
+ * ```js
297
+ * fin.me.interop.getContextGroups()
298
+ * .then(contextGroups => {
299
+ * contextGroups.forEach(contextGroup => {
300
+ * console.log(contextGroup.displayMetadata.name)
301
+ * console.log(contextGroup.displayMetadata.color)
302
+ * })
303
+ * })
304
+ * ```
232
305
  */
233
306
  async getContextGroups() {
234
307
  this.wire.sendAction('interop-client-get-context-groups').catch((e) => {
@@ -240,14 +313,26 @@ class InteropClient extends base_1.Base {
240
313
  /**
241
314
  * Join all Interop Clients at the given identity to context group `contextGroupId`.
242
315
  * If no target is specified, it adds the sender to the context group.
243
- * Because multiple Channel connections/Interop Clients can potentially exist at a `uuid`/`name` combo, we currently join all Channel connections/Interop Clients at the given identity to the context group.
316
+ *
317
+ * @remarks Because multiple Channel connections/Interop Clients can potentially exist at a `uuid`/`name` combo, we currently join all Channel connections/Interop Clients at the given identity to the context group.
244
318
  * If an `endpointId` is provided (which is unlikely, unless the call is coming from an external adapter), then we only join that single connection to the context group.
245
319
  * For all intents and purposes, there will only be 1 connection present in Platform and Browser implmentations, so this point is more-or-less moot.
246
320
  * Used by Platform Windows.
247
- * @param { string } contextGroupId - Id of the context group.
248
- * @param { Identity } [target] - Identity of the entity you wish to join to a context group.
249
- * @return { Promise<void>}
250
- * @tutorial interop.joinContextGroup
321
+ *
322
+ * @param contextGroupId - Id of the context group.
323
+ * @param target - Identity of the entity you wish to join to a context group.
324
+ *
325
+ * @example
326
+ * ```js
327
+ * joinViewToContextGroup = async (contextGroupId, view) => {
328
+ * await fin.me.interop.joinContextGroup(contextGroupId, view);
329
+ * }
330
+ *
331
+ * getLastFocusedView()
332
+ * .then(lastFocusedViewIdentity => {
333
+ * joinViewToContextGroup('red', lastFocusedViewIdentity)
334
+ * })
335
+ * ```
251
336
  */
252
337
  async joinContextGroup(contextGroupId, target) {
253
338
  this.wire.sendAction('interop-client-join-context-group').catch((e) => {
@@ -263,9 +348,20 @@ class InteropClient extends base_1.Base {
263
348
  * Removes the specified target from a context group.
264
349
  * If no target is specified, it removes the sender from their context group.
265
350
  * Used by Platform Windows.
266
- * @param { Identity } [target] - Identity of the entity you wish to join to a context group.
267
- * @return { Promise<void>}
268
- * @tutorial interop.removeFromContextGroup
351
+ *
352
+ * @param target - Identity of the entity you wish to join to a context group.
353
+ *
354
+ * @example
355
+ * ```js
356
+ * removeViewFromContextGroup = async (view) => {
357
+ * await fin.me.interop.removeFromContextGroup(view);
358
+ * }
359
+ *
360
+ * getLastFocusedView()
361
+ * .then(lastFocusedViewIdentity => {
362
+ * removeViewFromContextGroup(lastFocusedViewIdentity)
363
+ * })
364
+ * ```
269
365
  */
270
366
  async removeFromContextGroup(target) {
271
367
  this.wire.sendAction('interop-client-remove-from-context-group').catch((e) => {
@@ -276,10 +372,19 @@ class InteropClient extends base_1.Base {
276
372
  }
277
373
  /**
278
374
  * Gets all clients for a context group.
279
- * Used by Platform Windows.
280
- * @param { string } contextGroupId - The id of context group you wish to get clients for.
281
- * @return { Promise<ClientIdentity[]>}
282
- * @tutorial interop.getAllClientsInContextGroup
375
+ *
376
+ * @remarks **This is primarily used for platform windows. Views within a platform should not have to use this API.**
377
+ *
378
+ * Returns the Interop-Broker-defined context groups available for an entity to join.
379
+ * @param contextGroupId - The id of context group you wish to get clients for.
380
+ *
381
+ * @example
382
+ * ```js
383
+ * fin.me.interop.getAllClientsInContextGroup('red')
384
+ * .then(clientsInContextGroup => {
385
+ * console.log(clientsInContextGroup)
386
+ * })
387
+ * ```
283
388
  */
284
389
  async getAllClientsInContextGroup(contextGroupId) {
285
390
  this.wire.sendAction('interop-client-get-all-clients-in-context-group').catch((e) => {
@@ -293,10 +398,18 @@ class InteropClient extends base_1.Base {
293
398
  }
294
399
  /**
295
400
  * Gets display info for a context group
296
- * Used by Platform Windows.
297
- * @param { string } contextGroupId - The id of context group you wish to get display info for.
298
- * @return { Promise<ContextGroupInfo>}
299
- * @tutorial interop.getInfoForContextGroup
401
+ *
402
+ * @remarks Used by Platform Windows.
403
+ * @param contextGroupId - The id of context group you wish to get display info for.
404
+ *
405
+ * @example
406
+ * ```js
407
+ * fin.me.interop.getInfoForContextGroup('red')
408
+ * .then(contextGroupInfo => {
409
+ * console.log(contextGroupInfo.displayMetadata.name)
410
+ * console.log(contextGroupInfo.displayMetadata.color)
411
+ * })
412
+ * ```
300
413
  */
301
414
  async getInfoForContextGroup(contextGroupId) {
302
415
  this.wire.sendAction('interop-client-get-info-for-context-group').catch((e) => {
@@ -310,9 +423,21 @@ class InteropClient extends base_1.Base {
310
423
  }
311
424
  /**
312
425
  * Sends an intent to the Interop Broker to resolve.
313
- * @param { Intent } intent - The combination of an action and a context that is passed to an application for resolution.
314
- * @return { Promise<unknown>}
315
- * @tutorial interop.fireIntent
426
+ * @param intent - The combination of an action and a context that is passed to an application for resolution.
427
+ *
428
+ * @example
429
+ * ```js
430
+ * // View wants to fire an Intent after a user clicks on a ticker
431
+ * tickerElement.on('click', (element) => {
432
+ * const ticker = element.innerText;
433
+ * const intent = {
434
+ * name: 'ViewChart',
435
+ * context: {type: 'fdc3.instrument', id: { ticker }}
436
+ * }
437
+ *
438
+ * fin.me.interop.fireIntent(intent);
439
+ * })
440
+ * ```
316
441
  */
317
442
  async fireIntent(intent) {
318
443
  this.wire.sendAction('interop-client-fire-intent').catch((e) => {
@@ -323,10 +448,23 @@ class InteropClient extends base_1.Base {
323
448
  }
324
449
  /**
325
450
  * Adds an intent handler for incoming intents. The last intent sent of the name subscribed to will be received.
326
- * @param { IntentHandler } handler - Registered function meant to handle a specific intent type.
327
- * @param { string } intentName - The name of an intent.
328
- * @return { Promise<Subscription> }
329
- * @tutorial interop.registerIntentHandler
451
+ * @param handler - Registered function meant to handle a specific intent type.
452
+ * @param intentName - The name of an intent.
453
+ *
454
+ * @example
455
+ * ```js
456
+ * const intentHandler = (intent) => {
457
+ * const { context } = intent;
458
+ * myViewChartHandler(context);
459
+ * };
460
+ *
461
+ * const subscription = await fin.me.interop.registerIntentHandler(intentHandler, 'ViewChart');
462
+ *
463
+ * function myAppCloseSequence() {
464
+ * // to unsubscribe the handler, simply call:
465
+ * subscription.unsubscribe();
466
+ * }
467
+ * ```
330
468
  */
331
469
  async registerIntentHandler(handler, intentName, options) {
332
470
  this.wire.sendAction('interop-client-register-intent-handler').catch((e) => {
@@ -351,9 +489,20 @@ class InteropClient extends base_1.Base {
351
489
  /**
352
490
  * Gets the last context of the Context Group currently subscribed to. It takes an optional Context Type and returns the
353
491
  * last context of that type.
354
- * @param { string } [contextType]
355
- * @return { Promise<Context> }
356
- * @tutorial interop.getCurrentContext
492
+ * @param contextType
493
+ *
494
+ * @example
495
+ * ```js
496
+ * await fin.me.interop.joinContextGroup('yellow');
497
+ * await fin.me.interop.setContext({ type: 'instrument', id: { ticker: 'FOO' }});
498
+ * const currentContext = await fin.me.interop.getCurrentContext();
499
+ *
500
+ * // with a specific context
501
+ * await fin.me.interop.joinContextGroup('yellow');
502
+ * await fin.me.interop.setContext({ type: 'country', id: { ISOALPHA3: 'US' }});
503
+ * await fin.me.interop.setContext({ type: 'instrument', id: { ticker: 'FOO' }});
504
+ * const currentContext = await fin.me.interop.getCurrentContext('country');
505
+ * ```
357
506
  */
358
507
  async getCurrentContext(contextType) {
359
508
  this.wire.sendAction('interop-client-get-current-context').catch((e) => {
@@ -364,9 +513,16 @@ class InteropClient extends base_1.Base {
364
513
  }
365
514
  /**
366
515
  * Get information for a particular Intent from the Interop Broker.
367
- * @param { InfoForIntentOptions } options
368
- * @return { Promise<unknown> }
369
- * @tutorial interop.getInfoForIntent
516
+ *
517
+ * @remarks To resolve this info, the function handleInfoForIntent is meant to be overridden in the Interop Broker.
518
+ * The format for the response will be determined by the App Provider overriding the function.
519
+ *
520
+ * @param options
521
+ *
522
+ * @example
523
+ * ```js
524
+ * const intentInfo = await fin.me.interop.getInfoForIntent('ViewChart');
525
+ * ```
370
526
  */
371
527
  async getInfoForIntent(options) {
372
528
  this.wire.sendAction('interop-client-get-info-for-intent').catch((e) => {
@@ -377,9 +533,27 @@ class InteropClient extends base_1.Base {
377
533
  }
378
534
  /**
379
535
  * Get information from the Interop Broker on all Intents that are meant to handle a particular context.
380
- * @param { Context } context
381
- * @return { Promise<unknown> }
382
- * @tutorial interop.getInfoForIntentsByContext
536
+ *
537
+ * @remarks To resolve this info, the function handleInfoForIntentsByContext is meant to be overridden in the Interop Broker.
538
+ * The format for the response will be determined by the App Provider overriding the function.
539
+ *
540
+ * @param context
541
+ *
542
+ * @example
543
+ * ```js
544
+ * tickerElement.on('click', (element) => {
545
+ * const ticker = element.innerText;
546
+ *
547
+ * const context = {
548
+ * type: 'fdc3.instrument',
549
+ * id: {
550
+ * ticker
551
+ * }
552
+ * }
553
+ *
554
+ * const intentsInfo = await fin.me.interop.getInfoForIntentByContext(context);
555
+ * })
556
+ * ```
383
557
  */
384
558
  async getInfoForIntentsByContext(context) {
385
559
  this.wire.sendAction('interop-client-get-info-for-intents-by-context').catch((e) => {
@@ -391,9 +565,27 @@ class InteropClient extends base_1.Base {
391
565
  /**
392
566
  * Sends a Context that will be resolved to an Intent by the Interop Broker.
393
567
  * This context accepts a metadata property.
394
- * @param { ContextForIntent } context
395
- * @return { Promise<unknown> }
396
- * @tutorial interop.fireIntentForContext
568
+ *
569
+ * @remarks To resolve this info, the function handleFiredIntentByContext is meant to be overridden in the Interop Broker.
570
+ * The format for the response will be determined by the App Provider overriding the function.
571
+ *
572
+ * @param context
573
+ *
574
+ * @example
575
+ * ```js
576
+ * tickerElement.on('click', (element) => {
577
+ * const ticker = element.innerText;
578
+ *
579
+ * const context = {
580
+ * type: 'fdc3.instrument',
581
+ * id: {
582
+ * ticker
583
+ * }
584
+ * }
585
+ *
586
+ * const intentResolution = await fin.me.interop.fireIntentForContext(context);
587
+ * })
588
+ * ```
397
589
  */
398
590
  async fireIntentForContext(context) {
399
591
  this.wire.sendAction('interop-client-fire-intent-for-context').catch((e) => {
@@ -405,10 +597,34 @@ class InteropClient extends base_1.Base {
405
597
  /**
406
598
  * Join the current entity to session context group `sessionContextGroupId` and return a sessionContextGroup instance.
407
599
  * If the sessionContextGroup doesn't exist, one will get created.
408
- * Session Context Groups do not persist between runs and aren't present on snapshots.
409
- * @param { string } sessionContextGroupId - Id of the context group.
410
- * @return { Promise<SessionContextGroup>}
411
- * @tutorial interop.joinSessionContextGroup
600
+ *
601
+ * @remarks Session Context Groups do not persist between runs and aren't present on snapshots.
602
+ * @param sessionContextGroupId - Id of the context group.
603
+ *
604
+ * @example
605
+ * Say we want to have a Session Context Group that holds UI theme information for all apps to consume:
606
+ *
607
+ * My color-picker View:
608
+ * ```js
609
+ * const themeSessionContextGroup = await fin.me.interop.joinSessionContextGroup('theme');
610
+ *
611
+ * const myColorPickerElement = document.getElementById('color-palette-picker');
612
+ * myColorPickerElement.addEventListener('change', event => {
613
+ * themeSessionContextGroup.setContext({ type: 'color-palette', selection: event.value });
614
+ * });
615
+ * ```
616
+ *
617
+ * In other views:
618
+ * ```js
619
+ * const themeSessionContextGroup = await fin.me.interop.joinSessionContextGroup('theme');
620
+ *
621
+ * const changeColorPalette = ({ selection }) => {
622
+ * // change the color palette to the selection
623
+ * };
624
+ *
625
+ * // If the context is already set by the time the handler was set, the handler will get invoked immediately with the current context.
626
+ * themeSessionContextGroup.addContextHandler(changeColorPalette, 'color-palette');
627
+ * ```
412
628
  */
413
629
  async joinSessionContextGroup(sessionContextGroupId) {
414
630
  try {
@@ -436,8 +652,16 @@ class InteropClient extends base_1.Base {
436
652
  * Register a listener that is called when the Interop Client has been disconnected from the Interop Broker.
437
653
  * Only one listener per Interop Client can be set.
438
654
  * @param listener
439
- * @return { Promise<void> }
440
- * @tutorial interop.onDisconnection
655
+ *
656
+ * @example
657
+ * ```js
658
+ * const listener = (event) => {
659
+ * const { type, topic, brokerName} = event;
660
+ * console.log(`Disconnected from Interop Broker ${brokerName} `);
661
+ * }
662
+ *
663
+ * await fin.me.interop.onDisconnection(listener);
664
+ * ```
441
665
  */
442
666
  async onDisconnection(listener) {
443
667
  this.wire.sendAction('interop-client-add-ondisconnection-listener').catch((e) => {
@@ -7,8 +7,8 @@ export default class SessionContextGroupClient extends Base {
7
7
  constructor(wire: Transport, client: Promise<OpenFin.ChannelClient>, id: string);
8
8
  /**
9
9
  * Sets a context for the session context group.
10
- * @param { Context } context - New context to set.
11
- * @return { Promise<void> }
10
+ * @param context - New context to set.
11
+ *
12
12
  * @tutorial interop.setContext
13
13
  */
14
14
  setContext(context: OpenFin.Context): Promise<void>;
@@ -23,8 +23,8 @@ class SessionContextGroupClient extends base_1.Base {
23
23
  }
24
24
  /**
25
25
  * Sets a context for the session context group.
26
- * @param { Context } context - New context to set.
27
- * @return { Promise<void> }
26
+ * @param context - New context to set.
27
+ *
28
28
  * @tutorial interop.setContext
29
29
  */
30
30
  async setContext(context) {
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Prior to the move to TypeDoc, OpenFin maintained a copy of the FDC3 documentation under this namespace. To avoid
3
+ * duplication, these types have been removed from the OpenFin documentation.
4
+ *
5
+ * These types can be found in the official FDC3 documentation at https://fdc3.finos.org/docs/api/ref/Types.
6
+ *
7
+ * @packageDocumentation
8
+ */
9
+ /**
10
+ * @hidden
11
+ *
12
+ * Export required to allow import into typedoc entry point.
13
+ */
14
+ export declare const placeholder = "placeholder";
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ /**
3
+ * Prior to the move to TypeDoc, OpenFin maintained a copy of the FDC3 documentation under this namespace. To avoid
4
+ * duplication, these types have been removed from the OpenFin documentation.
5
+ *
6
+ * These types can be found in the official FDC3 documentation at https://fdc3.finos.org/docs/api/ref/Types.
7
+ *
8
+ * @packageDocumentation
9
+ */
10
+ Object.defineProperty(exports, "__esModule", { value: true });
11
+ exports.placeholder = void 0;
12
+ /**
13
+ * @hidden
14
+ *
15
+ * Export required to allow import into typedoc entry point.
16
+ */
17
+ exports.placeholder = 'placeholder';