@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
@@ -3,87 +3,20 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const base_1 = require("../base");
4
4
  const validate_1 = require("../../util/validate");
5
5
  const Instance_1 = require("./Instance");
6
- /**
7
- * @PORTED
8
- * @typedef {object} ApplicationOptions
9
- * @summary Application creation options.
10
- * @desc This is the options object required by {@link Application.start Application.start}.
11
- *
12
- * The following options are required:
13
- * * `uuid` is required in the app manifest as well as by {@link Application.start Application.start}
14
- * * `name` is optional in the app manifest but required by {@link Application.start Application.start}
15
- * * `url` is optional in both the app manifest {@link Application.start Application.start} and but is usually given
16
- * (defaults to `"about:blank"` when omitted).
17
- *
18
- * _This jsdoc typedef mirrors the `ApplicationOption` TypeScript interface in `@types/openfin`._
19
- *
20
- * **IMPORTANT NOTE:**
21
- * This object inherits all the properties of the window creation {@link Window~options options} object,
22
- * which will take priority over those of the same name that may be provided in `mainWindowOptions`.
23
- *
24
- * @property {boolean} [disableIabSecureLogging=false]
25
- * When set to `true` it will disable IAB secure logging for the app.
26
- *
27
- * @property {string} [loadErrorMessage="There was an error loading the application."]
28
- * An error message to display when the application (launched via manifest) fails to load.
29
- * A dialog box will be launched with the error message just before the runtime exits.
30
- * Load fails such as failed DNS resolutions or aborted connections as well as cancellations, _e.g.,_ `window.stop()`,
31
- * will trigger this dialog.
32
- * Client response codes such as `404 Not Found` are not treated as fails as they are valid server responses.
33
- *
34
- * @property {Window~options} [mainWindowOptions]
35
- * The options of the main window of the application.
36
- * For a description of these options, click the link (in the Type column).
37
- *
38
- * @property {number} [maxViewPoolSize=1000]
39
- * Platforms Only. The maximum number of "detached" or "pooled" Views that can exist in the Platform before being closed.
40
- * If you do not wish for views to be pooled on your platform, set this property to zero.
41
- *
42
- * @property {boolean} [preventQuitOnLastWindowClosed=false]
43
- * Platforms Only. Prevent the Platform Provider from quitting automatically when the last Platform Window is closed.
44
- * Note: if the Platform Provider is showing, it won't close automatically.
45
- * If you want a hidden Platform Provider to remain open after the last Platform Window has been closed, set this property to true.
46
- *
47
- * @property {string} [name]
48
- * The name of the application (and the application's main window).
49
- *
50
- * If provided, _must_ match `uuid`.
51
- *
52
- * @property {boolean} [nonPersistent=false]
53
- * A flag to configure the application as non-persistent.
54
- * Runtime exits when there are no persistent apps running.
55
- *
56
- * @property {boolean} [plugins=false]
57
- * Enable Flash at the application level.
58
- *
59
- * @property {boolean} [spellCheck=false]
60
- * Enable spell check at the application level.
61
- *
62
- * @property {string} [url="about:blank"]
63
- * The url to the application (specifically the application's main window).
64
- *
65
- * @property {boolean} [enableJumpList=false]
66
- * Enables the use of the Jumplists API and the 'pin to taskbar' functionality.
67
- * Only relevant in Windows.
68
- *
69
- * @property {string} uuid
70
- * The _Unique Universal Identifier_ (UUID) of the application, unique within the set of all other applications
71
- * running in the OpenFin Runtime.
72
- *
73
- * Note that `name` and `uuid` must match.
74
- *
75
- * @property {boolean} [webSecurity=true]
76
- * When set to `false` it will disable the same-origin policy for the app.
77
- */
78
- /**
79
- * @lends Application
80
- */
81
6
  class ApplicationModule extends base_1.Base {
82
7
  /**
83
8
  * Asynchronously returns an Application object that represents an existing application.
84
- * @param { Identity } identity
85
- * @return {Promise.<Application>}
86
- * @tutorial Application.wrap
9
+ * @param identity
10
+ *
11
+ * @example
12
+ *
13
+ * ```js
14
+ * fin.Application.wrap({ uuid: 'testapp' })
15
+ * .then(app => app.isRunning())
16
+ * .then(running => console.log('Application is running: ' + running))
17
+ * .catch(err => console.log(err));
18
+ * ```
19
+ *
87
20
  * @static
88
21
  */
89
22
  async wrap(identity) {
@@ -98,9 +31,15 @@ class ApplicationModule extends base_1.Base {
98
31
  }
99
32
  /**
100
33
  * Synchronously returns an Application object that represents an existing application.
101
- * @param { Identity } identity
102
- * @return {Application}
103
- * @tutorial Application.wrapSync
34
+ * @param identity
35
+ *
36
+ * @example
37
+ *
38
+ * ```js
39
+ * const app = fin.Application.wrapSync({ uuid: 'testapp' });
40
+ * await app.close();
41
+ * ```
42
+ *
104
43
  * @static
105
44
  */
106
45
  wrapSync(identity) {
@@ -125,10 +64,26 @@ class ApplicationModule extends base_1.Base {
125
64
  return this.wrap({ uuid: appOptions.uuid });
126
65
  }
127
66
  /**
128
- * DEPRECATED method to create a new Application. Use {@link Application.start} instead.
129
- * @param { ApplicationOptions } appOptions
130
- * @return {Promise.<Application>}
131
- * @tutorial Application.create
67
+ * DEPRECATED method to create a new Application. Use {@link Application.ApplicationModule.start Application.start} instead.
68
+ * @param appOptions
69
+ *
70
+ *
71
+ * @example
72
+ *
73
+ * ```js
74
+ * async function createApp() {
75
+ * const app = await fin.Application.create({
76
+ * name: 'myApp',
77
+ * uuid: 'app-3',
78
+ * url: 'https://cdn.openfin.co/docs/javascript/stable/tutorial-Application.create.html',
79
+ * autoShow: true
80
+ * });
81
+ * await app.run();
82
+ * }
83
+ *
84
+ * createApp().then(() => console.log('Application is created')).catch(err => console.log(err));
85
+ * ```
86
+ *
132
87
  * @ignore
133
88
  */
134
89
  create(appOptions) {
@@ -140,9 +95,23 @@ class ApplicationModule extends base_1.Base {
140
95
  }
141
96
  /**
142
97
  * Creates and starts a new Application.
143
- * @param { ApplicationOptions } appOptions
144
- * @return {Promise.<Application>}
145
- * @tutorial Application.start
98
+ * @param appOptions
99
+ *
100
+ * @example
101
+ *
102
+ * ```js
103
+ * async function start() {
104
+ * return fin.Application.start({
105
+ * name: 'app-1',
106
+ * uuid: 'app-1',
107
+ * url: 'https://cdn.openfin.co/docs/javascript/stable/tutorial-Application.start.html',
108
+ * autoShow: true
109
+ * });
110
+ * }
111
+ * start().then(() => console.log('Application is running')).catch(err => console.log(err));
112
+ * ```
113
+ *
114
+ *
146
115
  * @static
147
116
  */
148
117
  async start(appOptions) {
@@ -156,11 +125,38 @@ class ApplicationModule extends base_1.Base {
156
125
  /**
157
126
  * Asynchronously starts a batch of applications given an array of application identifiers and manifestUrls.
158
127
  * Returns once the RVM is finished attempting to launch the applications.
159
- * @param { Array.<ManifestInfo> } applications
160
- * @param {RvmLaunchOptions} [opts] - Parameters that the RVM will use.
161
- * @return {Promise.<void>}
128
+ * @param applications
129
+ * @param opts - Parameters that the RVM will use.
130
+ *
162
131
  * @static
163
- * @tutorial Application.startManyManifests
132
+ * @example
133
+ *
134
+ * ```js
135
+ *
136
+ * const applicationInfoArray = [
137
+ * {
138
+ * "uuid": 'App-1',
139
+ * "manifestUrl": 'http://localhost:5555/app1.json',
140
+ * },
141
+ * {
142
+ * "uuid": 'App-2',
143
+ * "manifestUrl": 'http://localhost:5555/app2.json',
144
+ * },
145
+ * {
146
+ * "uuid": 'App-3',
147
+ * "manifestUrl": 'http://localhost:5555/app3.json',
148
+ * }
149
+ * ]
150
+ *
151
+ * fin.Application.startManyManifests(applicationInfoArray)
152
+ * .then(() => {
153
+ * console.log('RVM has finished launching the application list.');
154
+ * })
155
+ * .catch((err) => {
156
+ * console.log(err);
157
+ * })
158
+ * ```
159
+ *
164
160
  * @experimental
165
161
  */
166
162
  async startManyManifests(applications, opts) {
@@ -168,8 +164,23 @@ class ApplicationModule extends base_1.Base {
168
164
  }
169
165
  /**
170
166
  * Asynchronously returns an Application object that represents the current application
171
- * @return {Promise.<Application>}
172
- * @tutorial Application.getCurrent
167
+ *
168
+ * @example
169
+ *
170
+ * ```js
171
+ * async function isCurrentAppRunning () {
172
+ * const app = await fin.Application.getCurrent();
173
+ * return app.isRunning();
174
+ * }
175
+ *
176
+ * isCurrentAppRunning().then(running => {
177
+ * console.log(`Current app is running: ${running}`);
178
+ * }).catch(err => {
179
+ * console.error(err);
180
+ * });
181
+ *
182
+ * ```
183
+ *
173
184
  * @static
174
185
  */
175
186
  getCurrent() {
@@ -180,8 +191,23 @@ class ApplicationModule extends base_1.Base {
180
191
  }
181
192
  /**
182
193
  * Synchronously returns an Application object that represents the current application
183
- * @return {Application}
184
- * @tutorial Application.getCurrentSync
194
+ *
195
+ * @example
196
+ *
197
+ * ```js
198
+ * async function isCurrentAppRunning () {
199
+ * const app = fin.Application.getCurrentSync();
200
+ * return app.isRunning();
201
+ * }
202
+ *
203
+ * isCurrentAppRunning().then(running => {
204
+ * console.log(`Current app is running: ${running}`);
205
+ * }).catch(err => {
206
+ * console.error(err);
207
+ * });
208
+ *
209
+ * ```
210
+ *
185
211
  * @static
186
212
  */
187
213
  getCurrentSync() {
@@ -192,10 +218,18 @@ class ApplicationModule extends base_1.Base {
192
218
  }
193
219
  /**
194
220
  * Retrieves application's manifest and returns a running instance of the application.
195
- * @param {string} manifestUrl - The URL of app's manifest.
196
- * @param {RvmLaunchOptions} [opts] - Parameters that the RVM will use.
197
- * @return {Promise.<Application>}
198
- * @tutorial Application.startFromManifest
221
+ * @param manifestUrl - The URL of app's manifest.
222
+ * @param opts - Parameters that the RVM will use.
223
+ *
224
+ * @example
225
+ *
226
+ * ```js
227
+ * fin.Application.startFromManifest('http://localhost:5555/app.json').then(app => console.log('App is running')).catch(err => console.log(err));
228
+ *
229
+ * // For a local manifest file:
230
+ * fin.Application.startFromManifest('file:///C:/somefolder/app.json').then(app => console.log('App is running')).catch(err => console.log(err));
231
+ * ```
232
+ *
199
233
  * @static
200
234
  */
201
235
  async startFromManifest(manifestUrl, opts) {
@@ -207,6 +241,20 @@ class ApplicationModule extends base_1.Base {
207
241
  await app._run(opts); // eslint-disable-line no-underscore-dangle
208
242
  return app;
209
243
  }
244
+ /**
245
+ * @deprecated Use {@link Application.ApplicationModule.startFromManifest Application.startFromManifest} instead.
246
+ * Retrieves application's manifest and returns a wrapped application.
247
+ * @param manifestUrl - The URL of app's manifest.
248
+ * @param callback - called if the method succeeds.
249
+ * @param errorCallback - called if the method fails. The reason for failure is passed as an argument.
250
+ *
251
+ * @example
252
+ *
253
+ * ```js
254
+ * fin.Application.createFromManifest('http://localhost:5555/app.json').then(app => console.log(app)).catch(err => console.log(err));
255
+ * ```
256
+ * @ignore
257
+ */
210
258
  createFromManifest(manifestUrl) {
211
259
  console.warn('Deprecation Warning: fin.Application.createFromManifest is deprecated. Please use fin.Application.startFromManifest');
212
260
  this.wire.sendAction('application-create-from-manifest').catch((e) => {