@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
@@ -70,16 +70,16 @@ const PrivateChannelClient_1 = require("./PrivateChannelClient");
70
70
  /**
71
71
  * @callback ContextHandler
72
72
  * @variation 2
73
- * @param { Context } context
74
- * @param { ContextMetadata } [contextMetadata]
75
- * @returns { void }
73
+ * @param context
74
+ * @param contextMetadata
75
+ *
76
76
  */
77
77
  /**
78
78
  * @callback IntentHandler
79
79
  * @variation 2
80
- * @param { Context } context
81
- * @param { ContextMetadata } [contextMetadata]
82
- * @returns { Promise<IntentResult> | void }
80
+ * @param context
81
+ * @param contextMetadata
82
+ *
83
83
  */
84
84
  /**
85
85
  * @typedef { object } IntentMetadata
@@ -97,7 +97,7 @@ const PrivateChannelClient_1 = require("./PrivateChannelClient");
97
97
  /**
98
98
  * @name getResult
99
99
  * @function
100
- * @returns { Promise<IntentResult> }
100
+ *
101
101
  */
102
102
  /**
103
103
  * @typedef { object } IntentResolution
@@ -123,11 +123,8 @@ const PrivateChannelClient_1 = require("./PrivateChannelClient");
123
123
  * @property { function } disconnect
124
124
  */
125
125
  /**
126
- * @class
127
- * @alias fdc3v2
128
126
  * @version 2.0
129
- * @hideconstructor
130
- * @desc The FDC3 Client Library provides a set APIs to be used for FDC3 compliance,
127
+ * The FDC3 Client Library provides a set APIs to be used for FDC3 compliance,
131
128
  * while using our Interop API under the hood. In order to use this set of APIs
132
129
  * you will need to set up your own {@link InteropBroker InteropBroker} or use a Platform application, which does the setup for you. Refer to our documentation on
133
130
  * our {@link https://developers.openfin.co/of-docs/docs/enable-context-sharing Interop API}.
@@ -168,9 +165,9 @@ class Fdc3Module2 extends base_1.Base {
168
165
  }
169
166
  /**
170
167
  * Launches an app, specified via an AppIdentifier object.
171
- * @param { AppIdentifier | TargetApp } app
172
- * @param { Context } [context]
173
- * @returns { Promise<AppIdentifier> }
168
+ * @param app
169
+ * @param context
170
+ *
174
171
  * @tutorial fdc3.open
175
172
  */
176
173
  async open(app, context) {
@@ -181,8 +178,8 @@ class Fdc3Module2 extends base_1.Base {
181
178
  }
182
179
  /**
183
180
  * Find all the available instances for a particular application.
184
- * @param { AppIdentifier } app
185
- * @returns { Promise<Array<AppIdentifier>> }
181
+ * @param app
182
+ *
186
183
  * @tutorial fdc3v2.findInstances
187
184
  */
188
185
  async findInstances(app) {
@@ -199,8 +196,8 @@ class Fdc3Module2 extends base_1.Base {
199
196
  }
200
197
  /**
201
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.
202
- * @param { AppIdentifier } app
203
- * @returns { Promise<AppMetadata(2)> }
199
+ * @param app
200
+ *
204
201
  * @tutorial fdc3v2.getAppMetadata
205
202
  */
206
203
  async getAppMetadata(app) {
@@ -217,8 +214,8 @@ class Fdc3Module2 extends base_1.Base {
217
214
  }
218
215
  /**
219
216
  * Broadcasts a context for the channel of the current entity.
220
- * @param { Context } context - New context to set.
221
- * @returns { Promise<void> }
217
+ * @param context - New context to set.
218
+ *
222
219
  * @tutorial fdc3.broadcast
223
220
  */
224
221
  async broadcast(context) {
@@ -226,9 +223,9 @@ class Fdc3Module2 extends base_1.Base {
226
223
  }
227
224
  /**
228
225
  * 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. If you wish to listen for all incoming contexts, pass `null` for the contextType argument.
229
- * @param { string | null } contextType
230
- * @param { ContextHandler(2) } handler
231
- * @returns { Listener }
226
+ * @param contextType
227
+ * @param handler
228
+ *
232
229
  * @tutorial fdc3.addContextListener
233
230
  */
234
231
  async addContextListener(contextType, handler) {
@@ -256,10 +253,10 @@ class Fdc3Module2 extends base_1.Base {
256
253
  }
257
254
  /**
258
255
  * Find out more information about a particular intent by passing its name, and optionally its context and resultType.
259
- * @param { string } intent Name of the Intent
260
- * @param { Context } [context] Context
261
- * @param { string } [resultType] The type of result returned for any intent specified during resolution.
262
- * @returns { Promise<AppIntent(2)> }
256
+ * @param intent Name of the Intent
257
+ * @param context Context
258
+ * @param resultType The type of result returned for any intent specified during resolution.
259
+ *
263
260
  * @tutorial fdc3.findIntent
264
261
  */
265
262
  async findIntent(intent, context, resultType) {
@@ -276,9 +273,9 @@ class Fdc3Module2 extends base_1.Base {
276
273
  }
277
274
  /**
278
275
  * Find all the available intents for a particular context.
279
- * @param { Context } context
280
- * @param { string } [resultType] The type of result returned for any intent specified during resolution.
281
- * @returns { Promise<Array<AppIntent(2)>> }
276
+ * @param context
277
+ * @param resultType The type of result returned for any intent specified during resolution.
278
+ *
282
279
  * @tutorial fdc3v2.findIntentsByContext
283
280
  */
284
281
  async findIntentsByContext(context, resultType) {
@@ -296,10 +293,10 @@ class Fdc3Module2 extends base_1.Base {
296
293
  }
297
294
  /**
298
295
  * Raises a specific intent for resolution against apps registered with the desktop agent.
299
- * @param { string } intent Name of the Intent
300
- * @param { Context } context Context associated with the Intent
301
- * @param { AppIdentifier | TargetApp } [app]
302
- * @returns { Promise<IntentResolution(2)> }
296
+ * @param intent Name of the Intent
297
+ * @param context Context associated with the Intent
298
+ * @param app
299
+ *
303
300
  * @tutorial fdc3v2.raiseIntent
304
301
  */
305
302
  async raiseIntent(intent, context, app) {
@@ -319,9 +316,9 @@ class Fdc3Module2 extends base_1.Base {
319
316
  }
320
317
  /**
321
318
  * Finds and raises an intent against apps registered with the desktop agent based purely on the type of the context data.
322
- * @param { Context } context Context associated with the Intent
323
- * @param { AppIdentifier | TargetApp } [app]
324
- * @returns { Promise<IntentResolution(2)> }
319
+ * @param context Context associated with the Intent
320
+ * @param app
321
+ *
325
322
  * @tutorial fdc3v2.raiseIntentForContext
326
323
  */
327
324
  async raiseIntentForContext(context, app) {
@@ -342,9 +339,9 @@ class Fdc3Module2 extends base_1.Base {
342
339
  }
343
340
  /**
344
341
  * Adds a listener for incoming intents.
345
- * @param { string } intent Name of the Intent
346
- * @param { IntentHandler(2) } handler A callback that handles a context event and may return a promise of a Context or Channel object to be returned to the application that raised the intent.
347
- * @returns { Promise<Listener> }
342
+ * @param intent Name of the Intent
343
+ * @param handler A callback that handles a context event and may return a promise of a Context or Channel object to be returned to the application that raised the intent.
344
+ *
348
345
  * @tutorial fdc3.addIntentListener
349
346
  */
350
347
  async addIntentListener(intent, handler) {
@@ -384,7 +381,7 @@ class Fdc3Module2 extends base_1.Base {
384
381
  /**
385
382
  * Returns a Channel object for the specified channel, creating it as an App Channel if it does not exist.
386
383
  * @param channelId
387
- * @returns { Promise<Channel> }
384
+ *
388
385
  * @tutorial fdc3.getOrCreateChannel
389
386
  */
390
387
  async getOrCreateChannel(channelId) {
@@ -392,7 +389,7 @@ class Fdc3Module2 extends base_1.Base {
392
389
  }
393
390
  /**
394
391
  * 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.
395
- * @returns { Promise<PrivateChannel> }
392
+ *
396
393
  * @tutorial fdc3v2.createPrivateChannel
397
394
  */
398
395
  async createPrivateChannel() {
@@ -404,7 +401,7 @@ class Fdc3Module2 extends base_1.Base {
404
401
  }
405
402
  /**
406
403
  * Retrieves a list of the User Channels available for the app to join.
407
- * @returns { Promise<Channel[]>}
404
+ *
408
405
  * @tutorial fdc3v2.getUserChannels
409
406
  */
410
407
  async getUserChannels() {
@@ -417,7 +414,7 @@ class Fdc3Module2 extends base_1.Base {
417
414
  }
418
415
  /**
419
416
  * Retrieves a list of the User Channels available for the app to join.
420
- * @returns { Promise<Channel[]>}
417
+ *
421
418
  * @deprecated Please use {@link fdc3.getUserChannels fdc3.getUserChannels} instead
422
419
  * @tutorial fdc3.getSystemChannels
423
420
  */
@@ -427,8 +424,8 @@ class Fdc3Module2 extends base_1.Base {
427
424
  }
428
425
  /**
429
426
  * Join an app to a specified User channel.
430
- * @param { string } channelId Channel name
431
- * @returns { Promise<void> }
427
+ * @param channelId Channel name
428
+ *
432
429
  * @tutorial fdc3v2.joinUserChannel
433
430
  */
434
431
  async joinUserChannel(channelId) {
@@ -436,9 +433,9 @@ class Fdc3Module2 extends base_1.Base {
436
433
  }
437
434
  /**
438
435
  * Join an app to a specified User channel.
439
- * @param { string } channelId Channel name
436
+ * @param channelId Channel name
440
437
  * @deprecated Please use {@link fdc3.joinUserChannel fdc3.joinUserChannel} instead
441
- * @returns { Promise<void> }
438
+ *
442
439
  * @tutorial fdc3.joinChannel
443
440
  */
444
441
  async joinChannel(channelId) {
@@ -447,7 +444,7 @@ class Fdc3Module2 extends base_1.Base {
447
444
  }
448
445
  /**
449
446
  * Returns the Channel object for the current User channel membership
450
- * @returns { Promise<FDC3.Channel | null> }
447
+ *
451
448
  * @tutorial fdc3.getCurrentChannel
452
449
  */
453
450
  async getCurrentChannel() {
@@ -463,7 +460,7 @@ class Fdc3Module2 extends base_1.Base {
463
460
  }
464
461
  /**
465
462
  * Removes the app from any User channel membership.
466
- * @returns { Promise<void> }
463
+ *
467
464
  * @tutorial fdc3.leaveCurrentChannel
468
465
  */
469
466
  async leaveCurrentChannel() {
@@ -472,7 +469,7 @@ class Fdc3Module2 extends base_1.Base {
472
469
  /**
473
470
  * 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.
474
471
  * fdc3HandleGetInfo must be overridden in the InteropBroker so that the ImplementationMetadata will have the appMetadata info.
475
- * @returns { Promise<ImplementationMetadata(2)> }
472
+ *
476
473
  * @tutorial fdc3v2.getInfo
477
474
  */
478
475
  async getInfo() {
@@ -1,3 +1,11 @@
1
+ /**
2
+ * Entry point for the OpenFin Interop namespace.
3
+ *
4
+ * "InteropModule" contains static members of the `Interop` namespace (available under `fin.Interop`), while `InteropClient` and
5
+ * `InteropBroker` document instances of their respective classes.
6
+ *
7
+ * @packageDocumentation
8
+ */
1
9
  import InteropModule from './Factory';
2
10
  export default InteropModule;
3
11
  export * from './InteropClient';
@@ -1,4 +1,12 @@
1
1
  "use strict";
2
+ /**
3
+ * Entry point for the OpenFin Interop namespace.
4
+ *
5
+ * "InteropModule" contains static members of the `Interop` namespace (available under `fin.Interop`), while `InteropClient` and
6
+ * `InteropBroker` document instances of their respective classes.
7
+ *
8
+ * @packageDocumentation
9
+ */
2
10
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
11
  if (k2 === undefined) k2 = k;
4
12
  var desc = Object.getOwnPropertyDescriptor(m, k);
@@ -3,111 +3,167 @@ import { Transport } from '../../transport/transport';
3
3
  import { Base } from '../base';
4
4
  import { LayoutModule } from './layout/index';
5
5
  type Channel = OpenFin.Fin['InterApplicationBus']['Channel'];
6
- /**
7
- * @PORTED
8
- * InitPlatformOptions interface
9
- * @typedef { object } InitPlatformOptions
10
- * @property { OverrideCallback } [overrideCallback] a callback function that can be used to extend or replace default Provider behavior.
11
- */
12
- /**
13
- * @PORTED
14
- * @typedef { same | different } ProcessAffinityStrategy
15
- * @summary Strategy to place views that share a domain into different process affinities or the same process affinity.
16
- * @property { string } same views in the same domain will have the same process affinity.
17
- * @property { string } different views in the same domain will have different process affinities.
18
- */
19
- /**
20
- * @PORTED
21
- * @typedef { object } PlatformOptions
22
- * @summary The options object required by {@link Platform#start Platform.start}
23
- * Any {@link ApplicationOptions Application option} is also a valid platform option
24
- * @property {Array.<Object>} [commands] Configuration for keyboard commands.
25
- * For details and usage, see [Using Keyboard Commands]{@link https://developers.openfin.co/docs/platform-api#section-5-3-using-keyboard-commands}.
26
- * @property {DefaultWindowOptions} [defaultWindowOptions] Default window options apply to all platform windows.
27
- * @property {View~options} [defaultViewOptions] Default view options apply to all platform views.
28
- * @property {ProcessAffinityStrategy} [viewProcessAffinityStrategy] 'same' | 'different'.
29
- */
30
- /**
31
- * @PORTED
32
- * @typedef { object } DefaultWindowOptions
33
- * @summary Default window options apply to all platform windows.
34
- * Any {@link Window~options Window option} is also a valid Default Window option
35
- * used by default in any window that is created in the current platform's scope.
36
- * Individual window options will override these defaults.
37
- * @property {string} [stylesheetUrl]
38
- * Specify a path of a custom CSS file to be injected to all of the platform's windows.
39
- * _note_: this option is only applied to windows that use the Default OpenFin Window.
40
- * Windows with a specified url (Custom Windows) will not be affected by this option.
41
- */
42
- /**
43
- * @DELETED
44
- * Snapshot interface
45
- * @typedef { object } Snapshot
46
- * @property { WindowOption[] } windows The array of window options objects
47
- */
48
- /**
49
- * @lends Platform
50
- */
51
6
  export default class PlatformModule extends Base {
52
7
  private _channel;
53
8
  Layout: LayoutModule;
9
+ /**
10
+ * @internal
11
+ */
54
12
  constructor(wire: Transport, channel: Channel);
55
13
  /**
56
14
  * Initializes a Platform. Must be called from the Provider when using a custom provider.
57
- * @param { InitPlatformOptions } [options] - platform options including a callback function that can be used to extend or replace
15
+ * @param options - platform options including a callback function that can be used to extend or replace
58
16
  * default Provider behavior.
59
- * @return {Promise.<void>}
60
- * @tutorial Platform.init
17
+ *
18
+ * @remarks Must be called from the Provider when using a custom provider.
19
+ *
20
+ * @example
21
+ *
22
+ * ```js
23
+ * // From Provider context
24
+ * await fin.Platform.init();
25
+ * // Platform API is now hooked up and windows contained in the manifest snapshot are open.
26
+ * ```
27
+ *
28
+ * `Platform.init` accepts an options object that can contain a callback function which can be used to extend or
29
+ * replace default Provider behavior. As an argument, this function will receive the `Provider` class, which is
30
+ * used to handle Platform actions. The function must return an object with methods to handle Platform API actions.
31
+ * The recommended approach is to extend the `Provider` class, overriding the methods you wish to alter, and return an
32
+ * instance of your subclass:
33
+ *
34
+ * ```js
35
+ * const overrideCallback = async (PlatformProvider) => {
36
+ * // Actions can be performed before initialization.
37
+ * // e.g. we might authenticate a user, set up a Channel, etc before initializing the Platform.
38
+ * const { manifestUrl } = await fin.Application.getCurrentSync().getInfo();
39
+ *
40
+ * // Extend or replace default PlatformProvider behavior by extending the PlatformProvider class.
41
+ * class MyOverride extends PlatformProvider {
42
+ * // Default behavior can be changed by implementing methods with the same names as those used by the default PlatformProvider.
43
+ * async getSnapshot() {
44
+ * // Since we are extending the class, we can call `super` methods to access default behavior.
45
+ * const snapshot = await super.getSnapshot();
46
+ * // But we can modify return values.
47
+ * return { ...snapshot, answer: 42, manifestUrl };
48
+ * }
49
+ * async replaceLayout({ opts, target }) {
50
+ * // To disable an API method, overwrite with a noop function.
51
+ * return;
52
+ * }
53
+ * }
54
+ * // Return instance with methods to be consumed by Platform.
55
+ * // The returned object must implement all methods of the PlatformProvider class.
56
+ * // By extending the class, we can simply inherit methods we do not wish to alter.
57
+ * return new MyOverride();
58
+ * };
59
+ *
60
+ * fin.Platform.init({overrideCallback});
61
+ * ```
61
62
  * @experimental
62
63
  * @static
63
64
  */
64
65
  init(options?: OpenFin.InitPlatformOptions): Promise<void>;
65
66
  /**
66
67
  * Asynchronously returns a Platform object that represents an existing platform.
67
- * @param { Identity } identity
68
- * @return {Promise.<Platform>}
69
- * @tutorial Platform.wrap
68
+ * @param identity
69
+ *
70
+ * @example
71
+ * ```js
72
+ * const { identity } = fin.me;
73
+ * const platform = await fin.Platform.wrap(identity);
74
+ * // Use wrapped instance to control layout, e.g.:
75
+ * const snapshot = await platform.getSnapshot();
76
+ * ```
70
77
  * @static
71
78
  */
72
79
  wrap(identity: OpenFin.ApplicationIdentity): Promise<OpenFin.Platform>;
73
80
  /**
74
81
  * Synchronously returns a Platform object that represents an existing platform.
75
- * @param { Identity } identity
76
- * @return {Platform}
77
- * @tutorial Platform.wrapSync
82
+ * @param identity
83
+ *
84
+ * @example
85
+ * ```js
86
+ * const { identity } = fin.me;
87
+ * const platform = fin.Platform.wrapSync(identity);
88
+ * // Use wrapped instance to control layout, e.g.:
89
+ * const snapshot = await platform.getSnapshot();
90
+ * ```
78
91
  * @static
79
92
  */
80
93
  wrapSync(identity: OpenFin.ApplicationIdentity): OpenFin.Platform;
81
94
  /**
82
95
  * Asynchronously returns a Platform object that represents the current platform.
83
- * @return {Promise.<Platform>}
84
- * @tutorial Platform.getCurrent
96
+ *
97
+ * @example
98
+ * ```js
99
+ * const platform = await fin.Platform.getCurrent();
100
+ * // Use wrapped instance to control layout, e.g.:
101
+ * const snapshot = await platform.getSnapshot();
102
+ * ```
85
103
  * @static
86
104
  */
87
105
  getCurrent(): Promise<OpenFin.Platform>;
88
106
  /**
89
107
  * Synchronously returns a Platform object that represents the current platform.
90
- * @return {Platform}
91
- * @tutorial Platform.getCurrentSync
108
+ *
109
+ * @example
110
+ * ```js
111
+ * const platform = fin.Platform.getCurrentSync();
112
+ * // Use wrapped instance to control layout, e.g.:
113
+ * const snapshot = await platform.getSnapshot();
114
+ * ```
92
115
  * @static
93
116
  */
94
117
  getCurrentSync(): OpenFin.Platform;
95
118
  /**
96
119
  * Creates and starts a Platform and returns a wrapped and running Platform instance. The wrapped Platform methods can
97
120
  * be used to launch content into the platform. Promise will reject if the platform is already running.
98
- * @param { PlatformOptions } platformOptions
99
- * @return {Promise.<Platform>}
100
- * @tutorial Platform.start
121
+ * @param platformOptions
122
+ *
123
+ * @example
124
+ * ```js
125
+ * try {
126
+ * const platform = await fin.Platform.start({
127
+ * uuid: 'platform-1',
128
+ * autoShow: false,
129
+ * defaultWindowOptions: {
130
+ * stylesheetUrl: 'css-sheet-url',
131
+ * cornerRounding: {
132
+ * height: 10,
133
+ * width: 10
134
+ * }
135
+ * }
136
+ * });
137
+ * console.log('Platform is running', platform);
138
+ * } catch(e) {
139
+ * console.error(e);
140
+ * }
141
+ * ```
101
142
  * @static
102
143
  */
103
144
  start(platformOptions: OpenFin.PlatformOptions): Promise<OpenFin.Platform>;
104
145
  /**
105
146
  * Retrieves platforms's manifest and returns a wrapped and running Platform. If there is a snapshot in the manifest,
106
147
  * it will be launched into the platform.
107
- * @param {string} manifestUrl - The URL of platform's manifest.
108
- * @param {RvmLaunchOptions} [opts] - Parameters that the RVM will use.
109
- * @return {Promise.<Platform>}
110
- * @tutorial Platform.startFromManifest
148
+ * @param manifestUrl - The URL of platform's manifest.
149
+ * @param opts - Parameters that the RVM will use.
150
+ *
151
+ * @example
152
+ * ```js
153
+ * try {
154
+ * const platform = await fin.Platform.startFromManifest('https://openfin.github.io/golden-prototype/public.json');
155
+ * console.log('Platform is running, wrapped platform: ', platform);
156
+ * } catch(e) {
157
+ * console.error(e);
158
+ * }
159
+ * // For a local manifest file:
160
+ * try {
161
+ * const platform = await fin.Platform.startFromManifest('file:///C:/somefolder/app.json');
162
+ * console.log('Platform is running, wrapped platform: ', platform);
163
+ * } catch(e) {
164
+ * console.error(e);
165
+ * }
166
+ * ```
111
167
  * @static
112
168
  */
113
169
  startFromManifest(manifestUrl: string, opts?: OpenFin.RvmLaunchOptions): Promise<OpenFin.Platform>;