@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
@@ -3,57 +3,15 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const base_1 = require("../base");
4
4
  const Instance_1 = require("./Instance");
5
5
  const index_1 = require("./layout/index");
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
  class PlatformModule extends base_1.Base {
7
+ /**
8
+ * @internal
9
+ */
52
10
  constructor(wire, channel) {
53
11
  super(wire);
54
12
  this._channel = channel;
55
13
  /**
56
- * @namespace
14
+ *
57
15
  * @desc Layouts give app providers the ability to embed multiple views in a single window. The Layout namespace
58
16
  * enables the initialization and manipulation of a window's Layout. A Layout will
59
17
  * <a href="tutorial-Layout.DOMEvents.html">emit events locally</a> on the DOM element representing the layout-container.
@@ -62,10 +20,53 @@ class PlatformModule extends base_1.Base {
62
20
  }
63
21
  /**
64
22
  * Initializes a Platform. Must be called from the Provider when using a custom provider.
65
- * @param { InitPlatformOptions } [options] - platform options including a callback function that can be used to extend or replace
23
+ * @param options - platform options including a callback function that can be used to extend or replace
66
24
  * default Provider behavior.
67
- * @return {Promise.<void>}
68
- * @tutorial Platform.init
25
+ *
26
+ * @remarks Must be called from the Provider when using a custom provider.
27
+ *
28
+ * @example
29
+ *
30
+ * ```js
31
+ * // From Provider context
32
+ * await fin.Platform.init();
33
+ * // Platform API is now hooked up and windows contained in the manifest snapshot are open.
34
+ * ```
35
+ *
36
+ * `Platform.init` accepts an options object that can contain a callback function which can be used to extend or
37
+ * replace default Provider behavior. As an argument, this function will receive the `Provider` class, which is
38
+ * used to handle Platform actions. The function must return an object with methods to handle Platform API actions.
39
+ * The recommended approach is to extend the `Provider` class, overriding the methods you wish to alter, and return an
40
+ * instance of your subclass:
41
+ *
42
+ * ```js
43
+ * const overrideCallback = async (PlatformProvider) => {
44
+ * // Actions can be performed before initialization.
45
+ * // e.g. we might authenticate a user, set up a Channel, etc before initializing the Platform.
46
+ * const { manifestUrl } = await fin.Application.getCurrentSync().getInfo();
47
+ *
48
+ * // Extend or replace default PlatformProvider behavior by extending the PlatformProvider class.
49
+ * class MyOverride extends PlatformProvider {
50
+ * // Default behavior can be changed by implementing methods with the same names as those used by the default PlatformProvider.
51
+ * async getSnapshot() {
52
+ * // Since we are extending the class, we can call `super` methods to access default behavior.
53
+ * const snapshot = await super.getSnapshot();
54
+ * // But we can modify return values.
55
+ * return { ...snapshot, answer: 42, manifestUrl };
56
+ * }
57
+ * async replaceLayout({ opts, target }) {
58
+ * // To disable an API method, overwrite with a noop function.
59
+ * return;
60
+ * }
61
+ * }
62
+ * // Return instance with methods to be consumed by Platform.
63
+ * // The returned object must implement all methods of the PlatformProvider class.
64
+ * // By extending the class, we can simply inherit methods we do not wish to alter.
65
+ * return new MyOverride();
66
+ * };
67
+ *
68
+ * fin.Platform.init({overrideCallback});
69
+ * ```
69
70
  * @experimental
70
71
  * @static
71
72
  */
@@ -74,9 +75,15 @@ class PlatformModule extends base_1.Base {
74
75
  }
75
76
  /**
76
77
  * Asynchronously returns a Platform object that represents an existing platform.
77
- * @param { Identity } identity
78
- * @return {Promise.<Platform>}
79
- * @tutorial Platform.wrap
78
+ * @param identity
79
+ *
80
+ * @example
81
+ * ```js
82
+ * const { identity } = fin.me;
83
+ * const platform = await fin.Platform.wrap(identity);
84
+ * // Use wrapped instance to control layout, e.g.:
85
+ * const snapshot = await platform.getSnapshot();
86
+ * ```
80
87
  * @static
81
88
  */
82
89
  async wrap(identity) {
@@ -87,9 +94,15 @@ class PlatformModule extends base_1.Base {
87
94
  }
88
95
  /**
89
96
  * Synchronously returns a Platform object that represents an existing platform.
90
- * @param { Identity } identity
91
- * @return {Platform}
92
- * @tutorial Platform.wrapSync
97
+ * @param identity
98
+ *
99
+ * @example
100
+ * ```js
101
+ * const { identity } = fin.me;
102
+ * const platform = fin.Platform.wrapSync(identity);
103
+ * // Use wrapped instance to control layout, e.g.:
104
+ * const snapshot = await platform.getSnapshot();
105
+ * ```
93
106
  * @static
94
107
  */
95
108
  wrapSync(identity) {
@@ -100,8 +113,13 @@ class PlatformModule extends base_1.Base {
100
113
  }
101
114
  /**
102
115
  * Asynchronously returns a Platform object that represents the current platform.
103
- * @return {Promise.<Platform>}
104
- * @tutorial Platform.getCurrent
116
+ *
117
+ * @example
118
+ * ```js
119
+ * const platform = await fin.Platform.getCurrent();
120
+ * // Use wrapped instance to control layout, e.g.:
121
+ * const snapshot = await platform.getSnapshot();
122
+ * ```
105
123
  * @static
106
124
  */
107
125
  async getCurrent() {
@@ -112,8 +130,13 @@ class PlatformModule extends base_1.Base {
112
130
  }
113
131
  /**
114
132
  * Synchronously returns a Platform object that represents the current platform.
115
- * @return {Platform}
116
- * @tutorial Platform.getCurrentSync
133
+ *
134
+ * @example
135
+ * ```js
136
+ * const platform = fin.Platform.getCurrentSync();
137
+ * // Use wrapped instance to control layout, e.g.:
138
+ * const snapshot = await platform.getSnapshot();
139
+ * ```
117
140
  * @static
118
141
  */
119
142
  getCurrentSync() {
@@ -125,9 +148,27 @@ class PlatformModule extends base_1.Base {
125
148
  /**
126
149
  * Creates and starts a Platform and returns a wrapped and running Platform instance. The wrapped Platform methods can
127
150
  * be used to launch content into the platform. Promise will reject if the platform is already running.
128
- * @param { PlatformOptions } platformOptions
129
- * @return {Promise.<Platform>}
130
- * @tutorial Platform.start
151
+ * @param platformOptions
152
+ *
153
+ * @example
154
+ * ```js
155
+ * try {
156
+ * const platform = await fin.Platform.start({
157
+ * uuid: 'platform-1',
158
+ * autoShow: false,
159
+ * defaultWindowOptions: {
160
+ * stylesheetUrl: 'css-sheet-url',
161
+ * cornerRounding: {
162
+ * height: 10,
163
+ * width: 10
164
+ * }
165
+ * }
166
+ * });
167
+ * console.log('Platform is running', platform);
168
+ * } catch(e) {
169
+ * console.error(e);
170
+ * }
171
+ * ```
131
172
  * @static
132
173
  */
133
174
  start(platformOptions) {
@@ -154,10 +195,25 @@ class PlatformModule extends base_1.Base {
154
195
  /**
155
196
  * Retrieves platforms's manifest and returns a wrapped and running Platform. If there is a snapshot in the manifest,
156
197
  * it will be launched into the platform.
157
- * @param {string} manifestUrl - The URL of platform's manifest.
158
- * @param {RvmLaunchOptions} [opts] - Parameters that the RVM will use.
159
- * @return {Promise.<Platform>}
160
- * @tutorial Platform.startFromManifest
198
+ * @param manifestUrl - The URL of platform's manifest.
199
+ * @param opts - Parameters that the RVM will use.
200
+ *
201
+ * @example
202
+ * ```js
203
+ * try {
204
+ * const platform = await fin.Platform.startFromManifest('https://openfin.github.io/golden-prototype/public.json');
205
+ * console.log('Platform is running, wrapped platform: ', platform);
206
+ * } catch(e) {
207
+ * console.error(e);
208
+ * }
209
+ * // For a local manifest file:
210
+ * try {
211
+ * const platform = await fin.Platform.startFromManifest('file:///C:/somefolder/app.json');
212
+ * console.log('Platform is running, wrapped platform: ', platform);
213
+ * } catch(e) {
214
+ * console.error(e);
215
+ * }
216
+ * ```
161
217
  * @static
162
218
  */
163
219
  startFromManifest(manifestUrl, opts) {