@openfin/core 33.76.31 → 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.31.tgz +0 -0
@@ -74,21 +74,21 @@ import { Base } from '../base';
74
74
  /**
75
75
  * @typedef {function} setContext
76
76
  * @summary A SessionContextGroup instance method for setting a context in the SessionContextGroup.
77
- * @param {Context} context The Context to be set.
78
- * @return {Promise<void>}
77
+ * @param context The Context to be set.
78
+ *
79
79
  */
80
80
  /**
81
81
  * @typedef {function} getCurrentContext
82
82
  * @summary A SessionContextGroup instance method for getting the current context of a certain type.
83
- * @param {string} [contextType] The Context Type to get. If not specified the last contextType set would get used.
84
- * @return {Promise<Context>}
83
+ * @param contextType The Context Type to get. If not specified the last contextType set would get used.
84
+ *
85
85
  */
86
86
  /**
87
87
  * @typedef {function} addContextHandler
88
88
  * @summary A SessionContextGroup instance method for adding a handler for context change.
89
- * @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.
90
- * @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.
91
- * @return {Promise<Subscription>}
89
+ * @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.
90
+ * @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.
91
+ *
92
92
  */
93
93
  /**
94
94
  * {@link https://developers.openfin.co/of-docs/docs/enable-color-linking}
@@ -140,27 +140,91 @@ import { Base } from '../base';
140
140
  * * {@link InteropClient#getInfoForContextGroup getInfoForContextGroup(contextGroupId)}
141
141
  * * {@link InteropClient#getAllClientsInContextGroup getAllClientsInContextGroup(contextGroupId)}
142
142
  *
143
-
144
- *
145
- * @hideconstructor
146
- * @class
147
143
  */
148
144
  export declare class InteropClient extends Base {
149
145
  #private;
146
+ /**
147
+ * @internal
148
+ */
150
149
  constructor(wire: Transport, name: string, interopConfig?: OpenFin.InteropConfig);
151
150
  /**
152
151
  * Sets a context for the context group of the current entity.
153
- * @param { Context } context - New context to set.
154
- * @return { Promise<void> }
155
- * @tutorial interop.setContext
152
+ *
153
+ * @remarks The entity must be part of a context group in order set a context.
154
+ *
155
+ * @param context - New context to set.
156
+ *
157
+ * @example
158
+ * ```js
159
+ * setInstrumentContext = async (ticker) => {
160
+ * fin.me.interop.setContext({type: 'instrument', id: {ticker}})
161
+ * }
162
+ *
163
+ * // 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
164
+ * instrumentElement.on('click', (evt) => {
165
+ * setInstrumentContext(evt.ticker)
166
+ * })
167
+ * ```
156
168
  */
157
169
  setContext(context: OpenFin.Context): Promise<void>;
158
170
  /**
159
- * 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.
160
- * @param { ContextHandler } handler - Handler for incoming context.
161
- * @param { string } [contextType] - The type of context you wish to handle.
162
- * @return { Promise<Subscription> }
163
- * @tutorial interop.addContextHandler
171
+ * Add a context handler for incoming context. If an entity is part of a context group, and then sets its context handler,
172
+ * it will receive all of its declared contexts.
173
+ *
174
+ * @param handler - Handler for incoming context.
175
+ * @param contextType - The type of context you wish to handle.
176
+ *
177
+ * @example
178
+ * ```js
179
+ * function handleIncomingContext(contextInfo) {
180
+ * const { type, id } = contextInfo;
181
+ * switch (type) {
182
+ * case 'instrument':
183
+ * handleInstrumentContext(contextInfo);
184
+ * break;
185
+ * case 'country':
186
+ * handleCountryContext(contextInfo);
187
+ * break;
188
+ *
189
+ * default:
190
+ * break;
191
+ * }
192
+ * }
193
+ *
194
+ *
195
+ * function handleInstrumentContext(contextInfo) {
196
+ * const { type, id } = contextInfo;
197
+ * console.log('contextInfo for instrument', contextInfo)
198
+ * }
199
+ *
200
+ * function handleCountryContext(contextInfo) {
201
+ * const { type, id } = contextInfo;
202
+ * console.log('contextInfo for country', contextInfo)
203
+ * }
204
+ *
205
+ * fin.me.interop.addContextHandler(handleIncomingContext);
206
+ * ```
207
+ *
208
+ *
209
+ * We are also testing the ability to add a context handler for specific contexts. If you would like to use
210
+ * this, please make sure you add your context handlers at the top level of your application, on a page that
211
+ * does not navigate/reload/re-render, to avoid memory leaks. This feature is experimental:
212
+ *
213
+ * ```js
214
+ * function handleInstrumentContext(contextInfo) {
215
+ * const { type, id } = contextInfo;
216
+ * console.log('contextInfo for instrument', contextInfo)
217
+ * }
218
+ *
219
+ * function handleCountryContext(contextInfo) {
220
+ * const { type, id } = contextInfo;
221
+ * console.log('contextInfo for country', contextInfo)
222
+ * }
223
+ *
224
+ *
225
+ * fin.me.interop.addContextHandler(handleInstrumentContext, 'instrument')
226
+ * fin.me.interop.addContextHandler(handleCountryContext, 'country')
227
+ * ```
164
228
  */
165
229
  addContextHandler(handler: OpenFin.ContextHandler, contextType?: string): Promise<{
166
230
  unsubscribe: () => void;
@@ -168,61 +232,135 @@ export declare class InteropClient extends Base {
168
232
  /**
169
233
  * Returns the Interop-Broker-defined context groups available for an entity to join.
170
234
  * Used by Platform Windows.
171
- * @return { Promise<ContextGroupInfo[]>}
172
- * @tutorial interop.getContextGroups
235
+ *
236
+ * @example
237
+ * ```js
238
+ * fin.me.interop.getContextGroups()
239
+ * .then(contextGroups => {
240
+ * contextGroups.forEach(contextGroup => {
241
+ * console.log(contextGroup.displayMetadata.name)
242
+ * console.log(contextGroup.displayMetadata.color)
243
+ * })
244
+ * })
245
+ * ```
173
246
  */
174
247
  getContextGroups(): Promise<OpenFin.ContextGroupInfo[]>;
175
248
  /**
176
249
  * Join all Interop Clients at the given identity to context group `contextGroupId`.
177
250
  * If no target is specified, it adds the sender to the context group.
178
- * 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.
251
+ *
252
+ * @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.
179
253
  * 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.
180
254
  * 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.
181
255
  * Used by Platform Windows.
182
- * @param { string } contextGroupId - Id of the context group.
183
- * @param { Identity } [target] - Identity of the entity you wish to join to a context group.
184
- * @return { Promise<void>}
185
- * @tutorial interop.joinContextGroup
256
+ *
257
+ * @param contextGroupId - Id of the context group.
258
+ * @param target - Identity of the entity you wish to join to a context group.
259
+ *
260
+ * @example
261
+ * ```js
262
+ * joinViewToContextGroup = async (contextGroupId, view) => {
263
+ * await fin.me.interop.joinContextGroup(contextGroupId, view);
264
+ * }
265
+ *
266
+ * getLastFocusedView()
267
+ * .then(lastFocusedViewIdentity => {
268
+ * joinViewToContextGroup('red', lastFocusedViewIdentity)
269
+ * })
270
+ * ```
186
271
  */
187
272
  joinContextGroup(contextGroupId: string, target?: OpenFin.Identity): Promise<void>;
188
273
  /**
189
274
  * Removes the specified target from a context group.
190
275
  * If no target is specified, it removes the sender from their context group.
191
276
  * Used by Platform Windows.
192
- * @param { Identity } [target] - Identity of the entity you wish to join to a context group.
193
- * @return { Promise<void>}
194
- * @tutorial interop.removeFromContextGroup
277
+ *
278
+ * @param target - Identity of the entity you wish to join to a context group.
279
+ *
280
+ * @example
281
+ * ```js
282
+ * removeViewFromContextGroup = async (view) => {
283
+ * await fin.me.interop.removeFromContextGroup(view);
284
+ * }
285
+ *
286
+ * getLastFocusedView()
287
+ * .then(lastFocusedViewIdentity => {
288
+ * removeViewFromContextGroup(lastFocusedViewIdentity)
289
+ * })
290
+ * ```
195
291
  */
196
292
  removeFromContextGroup(target?: OpenFin.Identity): Promise<void>;
197
293
  /**
198
294
  * Gets all clients for a context group.
199
- * Used by Platform Windows.
200
- * @param { string } contextGroupId - The id of context group you wish to get clients for.
201
- * @return { Promise<ClientIdentity[]>}
202
- * @tutorial interop.getAllClientsInContextGroup
295
+ *
296
+ * @remarks **This is primarily used for platform windows. Views within a platform should not have to use this API.**
297
+ *
298
+ * Returns the Interop-Broker-defined context groups available for an entity to join.
299
+ * @param contextGroupId - The id of context group you wish to get clients for.
300
+ *
301
+ * @example
302
+ * ```js
303
+ * fin.me.interop.getAllClientsInContextGroup('red')
304
+ * .then(clientsInContextGroup => {
305
+ * console.log(clientsInContextGroup)
306
+ * })
307
+ * ```
203
308
  */
204
309
  getAllClientsInContextGroup(contextGroupId: string): Promise<OpenFin.ClientIdentity[]>;
205
310
  /**
206
311
  * Gets display info for a context group
207
- * Used by Platform Windows.
208
- * @param { string } contextGroupId - The id of context group you wish to get display info for.
209
- * @return { Promise<ContextGroupInfo>}
210
- * @tutorial interop.getInfoForContextGroup
312
+ *
313
+ * @remarks Used by Platform Windows.
314
+ * @param contextGroupId - The id of context group you wish to get display info for.
315
+ *
316
+ * @example
317
+ * ```js
318
+ * fin.me.interop.getInfoForContextGroup('red')
319
+ * .then(contextGroupInfo => {
320
+ * console.log(contextGroupInfo.displayMetadata.name)
321
+ * console.log(contextGroupInfo.displayMetadata.color)
322
+ * })
323
+ * ```
211
324
  */
212
325
  getInfoForContextGroup(contextGroupId: string): Promise<OpenFin.ContextGroupInfo | undefined>;
213
326
  /**
214
327
  * Sends an intent to the Interop Broker to resolve.
215
- * @param { Intent } intent - The combination of an action and a context that is passed to an application for resolution.
216
- * @return { Promise<unknown>}
217
- * @tutorial interop.fireIntent
328
+ * @param intent - The combination of an action and a context that is passed to an application for resolution.
329
+ *
330
+ * @example
331
+ * ```js
332
+ * // View wants to fire an Intent after a user clicks on a ticker
333
+ * tickerElement.on('click', (element) => {
334
+ * const ticker = element.innerText;
335
+ * const intent = {
336
+ * name: 'ViewChart',
337
+ * context: {type: 'fdc3.instrument', id: { ticker }}
338
+ * }
339
+ *
340
+ * fin.me.interop.fireIntent(intent);
341
+ * })
342
+ * ```
218
343
  */
219
344
  fireIntent<T = unknown>(intent: OpenFin.Intent): Promise<T>;
220
345
  /**
221
346
  * Adds an intent handler for incoming intents. The last intent sent of the name subscribed to will be received.
222
- * @param { IntentHandler } handler - Registered function meant to handle a specific intent type.
223
- * @param { string } intentName - The name of an intent.
224
- * @return { Promise<Subscription> }
225
- * @tutorial interop.registerIntentHandler
347
+ * @param handler - Registered function meant to handle a specific intent type.
348
+ * @param intentName - The name of an intent.
349
+ *
350
+ * @example
351
+ * ```js
352
+ * const intentHandler = (intent) => {
353
+ * const { context } = intent;
354
+ * myViewChartHandler(context);
355
+ * };
356
+ *
357
+ * const subscription = await fin.me.interop.registerIntentHandler(intentHandler, 'ViewChart');
358
+ *
359
+ * function myAppCloseSequence() {
360
+ * // to unsubscribe the handler, simply call:
361
+ * subscription.unsubscribe();
362
+ * }
363
+ * ```
226
364
  */
227
365
  registerIntentHandler(handler: OpenFin.IntentHandler, intentName: string, options?: any): Promise<{
228
366
  unsubscribe: () => Promise<void>;
@@ -230,48 +368,134 @@ export declare class InteropClient extends Base {
230
368
  /**
231
369
  * Gets the last context of the Context Group currently subscribed to. It takes an optional Context Type and returns the
232
370
  * last context of that type.
233
- * @param { string } [contextType]
234
- * @return { Promise<Context> }
235
- * @tutorial interop.getCurrentContext
371
+ * @param contextType
372
+ *
373
+ * @example
374
+ * ```js
375
+ * await fin.me.interop.joinContextGroup('yellow');
376
+ * await fin.me.interop.setContext({ type: 'instrument', id: { ticker: 'FOO' }});
377
+ * const currentContext = await fin.me.interop.getCurrentContext();
378
+ *
379
+ * // with a specific context
380
+ * await fin.me.interop.joinContextGroup('yellow');
381
+ * await fin.me.interop.setContext({ type: 'country', id: { ISOALPHA3: 'US' }});
382
+ * await fin.me.interop.setContext({ type: 'instrument', id: { ticker: 'FOO' }});
383
+ * const currentContext = await fin.me.interop.getCurrentContext('country');
384
+ * ```
236
385
  */
237
386
  getCurrentContext(contextType?: string): Promise<OpenFin.Context>;
238
387
  /**
239
388
  * Get information for a particular Intent from the Interop Broker.
240
- * @param { InfoForIntentOptions } options
241
- * @return { Promise<unknown> }
242
- * @tutorial interop.getInfoForIntent
389
+ *
390
+ * @remarks To resolve this info, the function handleInfoForIntent is meant to be overridden in the Interop Broker.
391
+ * The format for the response will be determined by the App Provider overriding the function.
392
+ *
393
+ * @param options
394
+ *
395
+ * @example
396
+ * ```js
397
+ * const intentInfo = await fin.me.interop.getInfoForIntent('ViewChart');
398
+ * ```
243
399
  */
244
400
  getInfoForIntent<T = unknown>(options: OpenFin.InfoForIntentOptions): Promise<T>;
245
401
  /**
246
402
  * Get information from the Interop Broker on all Intents that are meant to handle a particular context.
247
- * @param { Context } context
248
- * @return { Promise<unknown> }
249
- * @tutorial interop.getInfoForIntentsByContext
403
+ *
404
+ * @remarks To resolve this info, the function handleInfoForIntentsByContext is meant to be overridden in the Interop Broker.
405
+ * The format for the response will be determined by the App Provider overriding the function.
406
+ *
407
+ * @param context
408
+ *
409
+ * @example
410
+ * ```js
411
+ * tickerElement.on('click', (element) => {
412
+ * const ticker = element.innerText;
413
+ *
414
+ * const context = {
415
+ * type: 'fdc3.instrument',
416
+ * id: {
417
+ * ticker
418
+ * }
419
+ * }
420
+ *
421
+ * const intentsInfo = await fin.me.interop.getInfoForIntentByContext(context);
422
+ * })
423
+ * ```
250
424
  */
251
425
  getInfoForIntentsByContext<T = unknown>(context: OpenFin.Context): Promise<T>;
252
426
  /**
253
427
  * Sends a Context that will be resolved to an Intent by the Interop Broker.
254
428
  * This context accepts a metadata property.
255
- * @param { ContextForIntent } context
256
- * @return { Promise<unknown> }
257
- * @tutorial interop.fireIntentForContext
429
+ *
430
+ * @remarks To resolve this info, the function handleFiredIntentByContext is meant to be overridden in the Interop Broker.
431
+ * The format for the response will be determined by the App Provider overriding the function.
432
+ *
433
+ * @param context
434
+ *
435
+ * @example
436
+ * ```js
437
+ * tickerElement.on('click', (element) => {
438
+ * const ticker = element.innerText;
439
+ *
440
+ * const context = {
441
+ * type: 'fdc3.instrument',
442
+ * id: {
443
+ * ticker
444
+ * }
445
+ * }
446
+ *
447
+ * const intentResolution = await fin.me.interop.fireIntentForContext(context);
448
+ * })
449
+ * ```
258
450
  */
259
451
  fireIntentForContext<T = unknown>(context: OpenFin.ContextForIntent): Promise<T>;
260
452
  /**
261
453
  * Join the current entity to session context group `sessionContextGroupId` and return a sessionContextGroup instance.
262
454
  * If the sessionContextGroup doesn't exist, one will get created.
263
- * Session Context Groups do not persist between runs and aren't present on snapshots.
264
- * @param { string } sessionContextGroupId - Id of the context group.
265
- * @return { Promise<SessionContextGroup>}
266
- * @tutorial interop.joinSessionContextGroup
455
+ *
456
+ * @remarks Session Context Groups do not persist between runs and aren't present on snapshots.
457
+ * @param sessionContextGroupId - Id of the context group.
458
+ *
459
+ * @example
460
+ * Say we want to have a Session Context Group that holds UI theme information for all apps to consume:
461
+ *
462
+ * My color-picker View:
463
+ * ```js
464
+ * const themeSessionContextGroup = await fin.me.interop.joinSessionContextGroup('theme');
465
+ *
466
+ * const myColorPickerElement = document.getElementById('color-palette-picker');
467
+ * myColorPickerElement.addEventListener('change', event => {
468
+ * themeSessionContextGroup.setContext({ type: 'color-palette', selection: event.value });
469
+ * });
470
+ * ```
471
+ *
472
+ * In other views:
473
+ * ```js
474
+ * const themeSessionContextGroup = await fin.me.interop.joinSessionContextGroup('theme');
475
+ *
476
+ * const changeColorPalette = ({ selection }) => {
477
+ * // change the color palette to the selection
478
+ * };
479
+ *
480
+ * // If the context is already set by the time the handler was set, the handler will get invoked immediately with the current context.
481
+ * themeSessionContextGroup.addContextHandler(changeColorPalette, 'color-palette');
482
+ * ```
267
483
  */
268
484
  joinSessionContextGroup(sessionContextGroupId: string): Promise<OpenFin.SessionContextGroup>;
269
485
  /**
270
486
  * Register a listener that is called when the Interop Client has been disconnected from the Interop Broker.
271
487
  * Only one listener per Interop Client can be set.
272
488
  * @param listener
273
- * @return { Promise<void> }
274
- * @tutorial interop.onDisconnection
489
+ *
490
+ * @example
491
+ * ```js
492
+ * const listener = (event) => {
493
+ * const { type, topic, brokerName} = event;
494
+ * console.log(`Disconnected from Interop Broker ${brokerName} `);
495
+ * }
496
+ *
497
+ * await fin.me.interop.onDisconnection(listener);
498
+ * ```
275
499
  */
276
500
  onDisconnection(listener: OpenFin.InteropClientOnDisconnectionListener): Promise<void>;
277
501
  static ferryFdc3Call(interopClient: OpenFin.InteropClient, action: string, payload?: any): Promise<any>;