@openfin/core 25.68.30 → 25.70.2

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 (199) hide show
  1. package/OpenFin.d.ts +30 -826
  2. package/README.md +12 -2
  3. package/package.json +1 -1
  4. package/src/api/application/Factory.d.ts +145 -145
  5. package/src/api/application/Factory.js +229 -229
  6. package/src/api/application/Instance.d.ts +301 -302
  7. package/src/api/application/Instance.js +412 -412
  8. package/src/api/application/index.d.ts +3 -3
  9. package/src/api/application/index.js +15 -15
  10. package/src/api/base.d.ts +43 -43
  11. package/src/api/base.js +177 -177
  12. package/src/api/clipboard/index.d.ts +69 -69
  13. package/src/api/clipboard/index.js +88 -88
  14. package/src/api/events/application.d.ts +69 -0
  15. package/src/api/events/application.js +2 -0
  16. package/src/api/events/base.d.ts +17 -0
  17. package/src/api/events/base.js +2 -0
  18. package/src/api/events/channel.d.ts +10 -11
  19. package/src/api/events/channel.js +2 -2
  20. package/src/api/events/emitterMap.d.ts +11 -11
  21. package/src/api/events/emitterMap.js +35 -35
  22. package/src/api/events/eventAggregator.d.ts +5 -5
  23. package/src/api/events/eventAggregator.js +43 -43
  24. package/src/api/events/externalApplication.d.ts +5 -0
  25. package/src/api/events/externalApplication.js +2 -0
  26. package/src/api/events/frame.d.ts +9 -0
  27. package/src/api/events/frame.js +2 -0
  28. package/src/api/events/globalHotkey.d.ts +10 -0
  29. package/src/api/events/globalHotkey.js +2 -0
  30. package/src/api/events/platform.d.ts +18 -0
  31. package/src/api/events/platform.js +2 -0
  32. package/src/api/events/system.d.ts +22 -0
  33. package/src/api/events/system.js +2 -0
  34. package/src/api/events/view.d.ts +56 -0
  35. package/src/api/events/view.js +2 -0
  36. package/src/api/events/webcontents.d.ts +48 -0
  37. package/src/api/events/webcontents.js +2 -0
  38. package/src/api/events/window.d.ts +176 -0
  39. package/src/api/events/window.js +2 -0
  40. package/src/api/external-application/Factory.d.ts +26 -26
  41. package/src/api/external-application/Factory.js +40 -40
  42. package/src/api/external-application/Instance.d.ts +101 -102
  43. package/src/api/external-application/Instance.js +109 -109
  44. package/src/api/external-application/index.d.ts +3 -3
  45. package/src/api/external-application/index.js +15 -15
  46. package/src/api/fin.d.ts +49 -49
  47. package/src/api/fin.js +43 -43
  48. package/src/api/frame/Factory.d.ts +36 -36
  49. package/src/api/frame/Factory.js +69 -69
  50. package/src/api/frame/Instance.d.ts +121 -121
  51. package/src/api/frame/Instance.js +130 -130
  52. package/src/api/frame/index.d.ts +3 -3
  53. package/src/api/frame/index.js +15 -15
  54. package/src/api/global-hotkey/index.d.ts +38 -38
  55. package/src/api/global-hotkey/index.js +58 -58
  56. package/src/api/interappbus/channel/channel.d.ts +26 -26
  57. package/src/api/interappbus/channel/channel.js +77 -77
  58. package/src/api/interappbus/channel/channels-docs.d.ts +318 -318
  59. package/src/api/interappbus/channel/channels-docs.js +376 -376
  60. package/src/api/interappbus/channel/client.d.ts +22 -22
  61. package/src/api/interappbus/channel/client.js +84 -84
  62. package/src/api/interappbus/channel/connection-manager.d.ts +28 -28
  63. package/src/api/interappbus/channel/connection-manager.js +244 -244
  64. package/src/api/interappbus/channel/index.d.ts +22 -23
  65. package/src/api/interappbus/channel/index.js +121 -121
  66. package/src/api/interappbus/channel/protocols/classic/message-receiver.d.ts +13 -13
  67. package/src/api/interappbus/channel/protocols/classic/message-receiver.js +73 -73
  68. package/src/api/interappbus/channel/protocols/classic/strategy.d.ts +22 -22
  69. package/src/api/interappbus/channel/protocols/classic/strategy.js +84 -84
  70. package/src/api/interappbus/channel/protocols/combined/strategy.d.ts +20 -20
  71. package/src/api/interappbus/channel/protocols/combined/strategy.js +58 -58
  72. package/src/api/interappbus/channel/protocols/index.d.ts +44 -44
  73. package/src/api/interappbus/channel/protocols/index.js +2 -2
  74. package/src/api/interappbus/channel/protocols/protocol-manager.d.ts +10 -10
  75. package/src/api/interappbus/channel/protocols/protocol-manager.js +43 -43
  76. package/src/api/interappbus/channel/protocols/rtc/endpoint.d.ts +23 -23
  77. package/src/api/interappbus/channel/protocols/rtc/endpoint.js +135 -135
  78. package/src/api/interappbus/channel/protocols/rtc/ice-manager.d.ts +30 -30
  79. package/src/api/interappbus/channel/protocols/rtc/ice-manager.js +131 -131
  80. package/src/api/interappbus/channel/protocols/rtc/strategy.d.ts +22 -22
  81. package/src/api/interappbus/channel/protocols/rtc/strategy.js +87 -87
  82. package/src/api/interappbus/channel/protocols/strategy-types.d.ts +13 -13
  83. package/src/api/interappbus/channel/protocols/strategy-types.js +2 -2
  84. package/src/api/interappbus/channel/protocols/strategy.d.ts +15 -15
  85. package/src/api/interappbus/channel/protocols/strategy.js +2 -2
  86. package/src/api/interappbus/channel/provider.d.ts +31 -31
  87. package/src/api/interappbus/channel/provider.js +160 -160
  88. package/src/api/interappbus/index.d.ts +85 -86
  89. package/src/api/interappbus/index.js +175 -175
  90. package/src/api/interop/Factory.d.ts +37 -37
  91. package/src/api/interop/Factory.js +54 -54
  92. package/src/api/interop/InteropBroker.d.ts +363 -363
  93. package/src/api/interop/InteropBroker.js +914 -914
  94. package/src/api/interop/InteropClient.d.ts +268 -268
  95. package/src/api/interop/InteropClient.js +450 -450
  96. package/src/api/interop/SessionContextGroupBroker.d.ts +26 -26
  97. package/src/api/interop/SessionContextGroupBroker.js +107 -107
  98. package/src/api/interop/SessionContextGroupClient.d.ts +20 -20
  99. package/src/api/interop/SessionContextGroupClient.js +85 -85
  100. package/src/api/interop/fdc3/fdc3-1.2.d.ts +187 -187
  101. package/src/api/interop/fdc3/fdc3-1.2.js +385 -385
  102. package/src/api/interop/fdc3/fdc3.js +17 -17
  103. package/src/api/interop/fdc3/utils.d.ts +6 -6
  104. package/src/api/interop/fdc3/utils.js +17 -17
  105. package/src/api/interop/index.d.ts +4 -4
  106. package/src/api/interop/index.js +16 -16
  107. package/src/api/interop/utils.d.ts +11 -11
  108. package/src/api/interop/utils.js +36 -36
  109. package/src/api/me.d.ts +38 -35
  110. package/src/api/me.js +128 -60
  111. package/src/api/platform/Factory.d.ts +109 -109
  112. package/src/api/platform/Factory.js +188 -188
  113. package/src/api/platform/Instance.d.ts +122 -122
  114. package/src/api/platform/Instance.js +298 -298
  115. package/src/api/platform/common-utils.d.ts +6 -6
  116. package/src/api/platform/common-utils.js +16 -16
  117. package/src/api/platform/index.d.ts +3 -3
  118. package/src/api/platform/index.js +15 -15
  119. package/src/api/platform/layout/Factory.d.ts +108 -108
  120. package/src/api/platform/layout/Factory.js +189 -189
  121. package/src/api/platform/layout/Instance.d.ts +49 -49
  122. package/src/api/platform/layout/Instance.js +99 -99
  123. package/src/api/platform/layout/index.d.ts +2 -2
  124. package/src/api/platform/layout/index.js +14 -14
  125. package/src/api/platform/layout/shapes.d.ts +11 -0
  126. package/src/api/{window → platform/layout}/shapes.js +2 -2
  127. package/src/api/snapshot-source/Factory.d.ts +36 -36
  128. package/src/api/snapshot-source/Factory.js +65 -65
  129. package/src/api/snapshot-source/Instance.d.ts +30 -30
  130. package/src/api/snapshot-source/Instance.js +134 -134
  131. package/src/api/snapshot-source/index.d.ts +3 -3
  132. package/src/api/snapshot-source/index.js +15 -15
  133. package/src/api/snapshot-source/utils.d.ts +1 -1
  134. package/src/api/snapshot-source/utils.js +5 -5
  135. package/src/api/system/index.d.ts +960 -961
  136. package/src/api/system/index.js +1241 -1241
  137. package/src/api/view/Factory.d.ts +49 -49
  138. package/src/api/view/Factory.js +103 -103
  139. package/src/api/view/Instance.d.ts +387 -380
  140. package/src/api/view/Instance.js +422 -415
  141. package/src/api/view/index.d.ts +3 -3
  142. package/src/api/view/index.js +15 -15
  143. package/src/api/webcontents/main.d.ts +36 -36
  144. package/src/api/webcontents/main.js +82 -82
  145. package/src/api/window/Factory.d.ts +44 -44
  146. package/src/api/window/Factory.js +91 -91
  147. package/src/api/window/Instance.d.ts +972 -966
  148. package/src/api/window/Instance.js +1209 -1202
  149. package/src/api/window/index.d.ts +3 -5
  150. package/src/api/window/index.js +15 -17
  151. package/src/environment/environment.d.ts +28 -25
  152. package/src/environment/environment.js +4 -4
  153. package/src/environment/node-env.d.ts +25 -26
  154. package/src/environment/node-env.js +64 -64
  155. package/src/environment/openfin-env.d.ts +29 -30
  156. package/src/environment/openfin-env.js +107 -107
  157. package/src/mock.d.ts +3 -3
  158. package/src/mock.js +91 -90
  159. package/src/shapes/ERROR_BOX_TYPES.d.ts +1 -0
  160. package/src/shapes/ERROR_BOX_TYPES.js +2 -0
  161. package/src/shapes/WebOptions.d.ts +12 -0
  162. package/src/shapes/WebOptions.js +2 -0
  163. package/src/shapes/WindowOptions.d.ts +42 -0
  164. package/src/shapes/WindowOptions.js +2 -0
  165. package/src/shapes/protocol.d.ts +178 -0
  166. package/src/shapes/protocol.js +2 -0
  167. package/src/transport/fin_store.d.ts +4 -4
  168. package/src/transport/fin_store.js +16 -16
  169. package/src/transport/transport-errors.d.ts +18 -18
  170. package/src/transport/transport-errors.js +37 -37
  171. package/src/transport/transport.d.ts +56 -43
  172. package/src/transport/transport.js +181 -181
  173. package/src/transport/wire.d.ts +71 -11
  174. package/src/transport/wire.js +32 -32
  175. package/src/util/asyncFilter.d.ts +1 -1
  176. package/src/util/asyncFilter.js +7 -7
  177. package/src/util/errors.d.ts +9 -5
  178. package/src/util/errors.js +11 -11
  179. package/src/util/exhaustive.d.ts +1 -1
  180. package/src/util/exhaustive.js +7 -7
  181. package/src/util/http.d.ts +11 -11
  182. package/src/util/http.js +83 -83
  183. package/src/util/normalize-config.d.ts +3 -5
  184. package/src/util/normalize-config.js +47 -47
  185. package/src/util/promises.d.ts +5 -5
  186. package/src/util/promises.js +27 -27
  187. package/src/util/ref-counter.d.ts +7 -7
  188. package/src/util/ref-counter.js +51 -51
  189. package/src/util/runtimeVersioning.d.ts +3 -3
  190. package/src/util/runtimeVersioning.js +25 -25
  191. package/src/util/utilTypes.d.ts +8 -8
  192. package/src/util/utilTypes.js +2 -2
  193. package/src/util/validate.d.ts +3 -3
  194. package/src/util/validate.js +11 -11
  195. package/docs.README(OLD).md +0 -82
  196. package/resources/win/OpenFinRVM.exe +0 -0
  197. package/src/api/window/bounds-changed.d.ts +0 -10
  198. package/src/api/window/bounds-changed.js +0 -6
  199. package/src/api/window/shapes.d.ts +0 -13
@@ -1,380 +1,387 @@
1
- import { WebContents } from '../webcontents/main';
2
- import Transport from '../../transport/transport';
3
- import { Layout } from '../platform/layout';
4
- import ViewEvents = OpenFin.ViewEvents;
5
- import UpdatableViewOptions = OpenFin.UpdatableViewOptions;
6
- /**
7
- * @typedef {object} View~options
8
- * @summary View creation options.
9
- * @desc This is the options object required by {@link View.create View.create}.
10
- *
11
- * Note that `name` and `target` are the only required properties — albeit the `url` property is usually provided as well
12
- * (defaults to `"about:blank"` when omitted).
13
- *
14
- * @property {object} [experimental]
15
- * Configurations for API injection.
16
- *
17
- * @property {boolean} [experimental.childWindows] Configure if the runtime should enable child windows for views.
18
- *
19
- * @property {object} [api]
20
- * Configurations for API injection.
21
- *
22
- * @property {object} [api.iframe] Configure if the the API should be injected into iframes based on domain.
23
- *
24
- * @property {boolean} [api.iframe.crossOriginInjection=false] Controls if the `fin` API object is present for cross origin iframes.
25
- * @property {boolean} [api.iframe.sameOriginInjection=true] Controls if the `fin` API object is present for same origin iframes.
26
- *
27
- * @property {object} [autoResize] AutoResize options
28
- *
29
- * @property {object} [bounds] initial bounds given relative to the window.
30
- *
31
- * @property {string} [backgroundColor="#FFF"] - _Updatable._
32
- * The view’s _backfill_ color as a hexadecimal value. Not to be confused with the content background color
33
- * (`document.body.style.backgroundColor`),
34
- * this color briefly fills a view’s (a) content area before its content is loaded as well as (b) newly exposed
35
- * areas when growing a window. Setting
36
- * this value to the anticipated content background color can help improve user experience.
37
- * Default is white.
38
- *
39
- * @property {object} [contentNavigation]
40
- * Restrict navigation to URLs that match a whitelisted pattern.
41
- * In the lack of a whitelist, navigation to URLs that match a blacklisted pattern would be prohibited.
42
- * See [here](https://developer.chrome.com/extensions/match_patterns) for more details.
43
- * @property {string[]} [contentNavigation.whitelist=[]] List of whitelisted URLs.
44
- * @property {string[]} [contentNavigation.blacklist=[]] List of blacklisted URLs.
45
- *
46
- * @property {object} [contextMenuSettings] - _Updatable._
47
- * Configure the context menu when right-clicking on a view.
48
- * @property {boolean} [contextMenuSettings.enable=true] Should the context menu display on right click.
49
- * @property {boolean} [contextMenuSettings.devtools=true] Should the context menu contain a button for opening devtools.
50
- * @property {boolean} [contextMenuSettings.reload=true] Should the context menu contain a button for reloading the page.
51
- *
52
- * @property {any} [customData=""] - _Updatable._
53
- * A field that the user can attach serializable data to to be ferried around with the view options.
54
- * _When omitted, the default value of this property is the empty string (`""`)._
55
- *
56
- * When omitted, the default value of this property is the empty string (`""`).
57
- * As opposed to customData this is meant for frequent updates and sharing with other contexts. [Example]{@tutorial customContext}
58
- *
59
- * @property {object[]} [hotkeys=[]] - _Updatable._
60
- * Defines the list of hotkeys that will be emitted as a `hotkey` event on the view. For usage example see [example]{@tutorial hotkeys}.
61
- * Within Platform, OpenFin also implements a set of pre-defined actions called
62
- * [keyboard commands]{@link https://developers.openfin.co/docs/platform-api#section-5-3-using-keyboard-commands}
63
- * that can be assigned to a specific hotkey in the platform manifest.
64
- * @property {string} hotkeys.keys The key combination of the hotkey, i.e. "Ctrl+T"
65
- * @property {boolean} [hotkeys.preventDefault=false] preventDefault will prevent the page keydown/keyup events from being emitted.
66
- *
67
- * @property {boolean} [isClosable=true] **Platforms Only.** If false, the view will be persistent and can't be closed through
68
- * either UI or `Platform.closeView`. Note that the view will still be closed if the host window is closed or
69
- * if the view isn't part of the new layout when running `Layout.replace`.
70
- *
71
- * @property {string} name
72
- * The name of the view.
73
- *
74
- * @property {boolean} [detachOnClose=false] - _Updatable._
75
- * Platforms Only. If true, will hide and detach the View from the window for later use instead of closing,
76
- * allowing the state of the View to be saved and the View to be immediately shown in a new Layout.
77
- *
78
- * @property {string} [manifestUrl] **Platforms Only.** Url to a manifest that contains View Options. Properties other than manifestUrl can still be used
79
- * but the properties in the manifest will take precedence if there is any collision.
80
- *
81
- * @property {preloadScript[]} [preloadScripts] - _Inheritable_
82
- * A list of scripts that are eval'ed before other scripts in the page. When omitted, _inherits_
83
- * from the parent application.
84
- *
85
- * @property {boolean} [preventDragOut=false] **Platforms Only.** If true, the tab of the view can't be dragged out of its host window.
86
- *
87
- * @property {string} [processAffinity=<application uuid>]
88
- * A string to attempt to group renderers together. Will only be used if pages are on the same origin.
89
- *
90
- * @property {Identity} [target]
91
- * The identity of the window this view should be attached to.
92
- *
93
- * @property {string} [url="about:blank"]
94
- * The URL of the view.
95
- *
96
- * @property {string} [uuid=<application uuid>]
97
- * The `uuid` of the application, unique within the set of all `Application`s running in OpenFin Runtime.
98
- * If omitted, defaults to the `uuid` of the application spawning the view.
99
- * If given, must match the `uuid` of the application spawning the view.
100
- * In other words, the application's `uuid` is the only acceptable value, but is the default, so there's
101
- * really no need to provide it.
102
- */
103
- /**
104
- * @classdesc a View can be used to embed additional web content into a Window.
105
- * It is like a child window, except it is positioned relative to its owning window.
106
- * It has the ability to listen for <a href="tutorial-View.EventEmitter.html">View-specific events</a>.
107
- *
108
- * By default, a View will try to share the same renderer process as other Views owned by its parent Application.
109
- * To change that behavior, see the processAffinity {@link View~options view option}.
110
- *
111
- * A View's lifecycle is tied to its owning window and can be re-attached to a different window at any point during its lifecycle.
112
- * @class
113
- * @alias View
114
- * @hideconstructor
115
- */
116
- export declare class View extends WebContents<ViewEvents> {
117
- identity: OpenFin.Identity;
118
- constructor(wire: Transport, identity: OpenFin.Identity);
119
- /**
120
- * Gets a base64 encoded image of the view or a part of it.
121
- * @function capturePage
122
- * @param { CapturePageOptions } [options] Options for the capturePage call.
123
- * @memberOf View
124
- * @instance
125
- * @return {Promise.<string>}
126
- * @tutorial View.capturePage
127
- */
128
- /**
129
- * Executes Javascript on the view, restricted to contents you own or contents owned by
130
- * applications you have created.
131
- * @param { string } code JavaScript code to be executed on the view.
132
- * @function executeJavaScript
133
- * @memberOf View
134
- * @instance
135
- * @return {Promise.<void>}
136
- * @tutorial View.executeJavaScript
137
- */
138
- /**
139
- * Focuses the view
140
- * @return {Promise.<void>}
141
- * @function focus
142
- * @memberof View
143
- * @emits focused
144
- * @instance
145
- * @tutorial View.focus
146
- * @experimental
147
- */
148
- focus({ emitSynthFocused }?: {
149
- emitSynthFocused: boolean;
150
- }): Promise<void>;
151
- /**
152
- * Returns the zoom level of the view.
153
- * @function getZoomLevel
154
- * @memberOf View
155
- * @instance
156
- * @return {Promise.<number>}
157
- * @tutorial View.getZoomLevel
158
- */
159
- /**
160
- * Sets the zoom level of the view.
161
- * @param { number } level The zoom level
162
- * @function setZoomLevel
163
- * @memberOf View
164
- * @instance
165
- * @return {Promise.<void>}
166
- * @tutorial View.setZoomLevel
167
- */
168
- /**
169
- * Find and highlight text on a page.
170
- * @param { string } searchTerm Term to find in page
171
- * @param { FindInPageOptions } options Search options
172
- * @function findInPage
173
- * @memberOf View
174
- * @instance
175
- * @return {Promise.<number>}
176
- * @tutorial View.findInPage
177
- */
178
- /**
179
- * Stops any findInPage call with the provided action.
180
- * @param {string} action
181
- * Action to execute when stopping a find in page:<br>
182
- * "clearSelection" - Clear the selection.<br>
183
- * "keepSelection" - Translate the selection into a normal selection.<br>
184
- * "activateSelection" - Focus and click the selection node.<br>
185
- * @function stopFindInPage
186
- * @memberOf View
187
- * @instance
188
- * @return {Promise.<void>}
189
- * @tutorial View.stopFindInPage
190
- */
191
- /**
192
- * Navigates the view to a specified URL. The url must contain the protocol prefix such as http:// or https://.
193
- * @param { string } url - The URL to navigate the view to.
194
- * @return {Promise.<void>}
195
- * @function navigate
196
- * @memberof View
197
- * @instance
198
- * @tutorial View.navigate
199
- * @experimental
200
- */
201
- /**
202
- * Navigates the view back one page.
203
- * @function navigateBack
204
- * @memberOf View
205
- * @instance
206
- * @return {Promise.<void>}
207
- * @tutorial View.navigateBack
208
- */
209
- /**
210
- * Navigates the view forward one page.
211
- * @function navigateForward
212
- * @memberOf View
213
- * @instance
214
- * @return {Promise.<void>}
215
- * @tutorial View.navigateForward
216
- */
217
- /**
218
- * Stops any current navigation the view is performing.
219
- * @function stopNavigation
220
- * @memberOf View
221
- * @instance
222
- * @return {Promise.<void>}
223
- * @tutorial View.stopNavigation
224
- */
225
- /**
226
- * Reloads the view current page
227
- * @function reload
228
- * @memberOf View
229
- * @instance
230
- * @return {Promise.<void>}
231
- * @tutorial View.reload
232
- */
233
- /**
234
- * Prints the view's web page
235
- * @param { PrintOptions } [options] Printer Options
236
- * @function print
237
- * @memberOf View
238
- * @instance
239
- * @return {Promise.<void>}
240
- * @tutorial View.print
241
- */
242
- /**
243
- * Returns an array with all system printers
244
- * @function getPrinters
245
- * @memberOf View
246
- * @instance
247
- * @return { Promise.Array.<PrinterInfo> }
248
- * @tutorial View.getPrinters
249
- */
250
- /**
251
- * Shows the Chromium Developer Tools
252
- * @function showDeveloperTools
253
- * @memberOf View
254
- * @instance
255
- * @return {Promise.<void>}
256
- * @tutorial View.showDeveloperTools
257
- */
258
- /**
259
- * Retrieves the process information associated with a view.
260
- * @function getProcessInfo
261
- * @memberOf View
262
- * @instance
263
- * @return {Promise.<EntityProcessDetails>}
264
- * @tutorial View.getProcessInfo
265
- */
266
- /**
267
- * Retrieves information on all Shared Workers.
268
- * @function getSharedWorkers
269
- * @memberOf View
270
- * @instance
271
- * @return {Promise.Array.<SharedWorkerInfo>}
272
- * @tutorial View.getSharedWorkers
273
- */
274
- /**
275
- * Opens the developer tools for the shared worker context.
276
- * @function inspectSharedWorker
277
- * @memberOf View
278
- * @instance
279
- * @return {Promise.<void>}
280
- * @tutorial View.inspectSharedWorker
281
- */
282
- /**
283
- * Inspects the shared worker based on its ID.
284
- * @param { string } workerId - The id of the shared worker.
285
- * @function inspectSharedWorkerById
286
- * @memberOf View
287
- * @instance
288
- * @return {Promise.<void>}
289
- * @tutorial View.inspectSharedWorkerById
290
- */
291
- /**
292
- * Opens the developer tools for the service worker context.
293
- * @function inspectServiceWorker
294
- * @memberOf View
295
- * @instance
296
- * @return {Promise.<void>}
297
- * @tutorial View.inspectServiceWorker
298
- */
299
- /**
300
- * Attaches the current view to a the given window identity.
301
- * Identity must be the identity of a window in the same application.
302
- * This detaches the view from its current window, and sets the view to be destroyed when its new window closes.
303
- * @param target {Identity}
304
- * @return {Promise.<void>}
305
- * @tutorial View.attach
306
- * @experimental
307
- */
308
- attach: (target: OpenFin.Identity) => Promise<void>;
309
- /**
310
- * Destroys the current view
311
- * @return {Promise.<void>}
312
- * @tutorial View.destroy
313
- * @experimental
314
- */
315
- destroy: () => Promise<void>;
316
- /**
317
- * Shows the current view if it is currently hidden.
318
- * @return {Promise.<void>}
319
- * @tutorial View.show
320
- * @experimental
321
- */
322
- show: () => Promise<void>;
323
- /**
324
- * Hides the current view if it is currently visible.
325
- * @return {Promise.<void>}
326
- * @tutorial View.hide
327
- * @experimental
328
- */
329
- hide: () => Promise<void>;
330
- /**
331
- * Sets the bounds (top, left, width, height) of the view relative to its window.
332
- * @param bounds {ViewBounds}
333
- * @return {Promise.<void>}
334
- * @tutorial View.setBounds
335
- * @experimental
336
- */
337
- setBounds: (bounds: OpenFin.Bounds) => Promise<void>;
338
- /**
339
- * Gets the bounds (top, left, width, height) of the view relative to its window.
340
- * @return {Promise.<ViewBounds>}
341
- * @tutorial View.getBounds
342
- * @experimental
343
- */
344
- getBounds: () => Promise<OpenFin.Bounds>;
345
- /**
346
- * Gets the View's info.
347
- * @return {Promise.<ViewInfo>}
348
- * @tutorial View.getInfo
349
- * @experimental
350
- */
351
- getInfo: () => Promise<OpenFin.ViewInfo>;
352
- /**
353
- * Retrieves the layout for the window the view is attached to.
354
- * @return {Promise.<Layout>}
355
- * @tutorial View.getParentLayout
356
- * @experimental
357
- */
358
- getParentLayout: () => Promise<OpenFin.Layout>;
359
- /**
360
- * Gets the View's options.
361
- * @return {Promise<ViewOptions>}
362
- * @tutorial View.getOptions
363
- * @experimental
364
- */
365
- getOptions: () => Promise<OpenFin.ViewOptions>;
366
- /**
367
- * Updates the view's options.
368
- * @param { Partial<ViewOptions> } options
369
- * @return {Promise.<void>}
370
- * @tutorial View.updateOptions
371
- * @experimental
372
- */
373
- updateOptions: (options: UpdatableViewOptions) => Promise<void>;
374
- /**
375
- * Retrieves the window the view is currently attached to.
376
- * @return {Promise.<_Window>}
377
- * @experimental
378
- */
379
- getCurrentWindow: () => Promise<OpenFin.Window>;
380
- }
1
+ import { WebContents } from '../webcontents/main';
2
+ import Transport from '../../transport/transport';
3
+ import { Layout } from '../platform/layout';
4
+ import ViewEvents = OpenFin.ViewEvents;
5
+ import UpdatableViewOptions = OpenFin.UpdatableViewOptions;
6
+ /**
7
+ * @typedef {object} View~options
8
+ * @summary View creation options.
9
+ * @desc This is the options object required by {@link View.create View.create}.
10
+ *
11
+ * Note that `name` and `target` are the only required properties — albeit the `url` property is usually provided as well
12
+ * (defaults to `"about:blank"` when omitted).
13
+ *
14
+ * @property {object} [experimental]
15
+ * Configurations for API injection.
16
+ *
17
+ * @property {boolean} [experimental.childWindows] Configure if the runtime should enable child windows for views.
18
+ *
19
+ * @property {object} [api]
20
+ * Configurations for API injection.
21
+ *
22
+ * @property {object} [api.iframe] Configure if the the API should be injected into iframes based on domain.
23
+ *
24
+ * @property {boolean} [api.iframe.crossOriginInjection=false] Controls if the `fin` API object is present for cross origin iframes.
25
+ * @property {boolean} [api.iframe.sameOriginInjection=true] Controls if the `fin` API object is present for same origin iframes.
26
+ *
27
+ * @property {object} [autoResize] AutoResize options
28
+ *
29
+ * @property {object} [bounds] initial bounds given relative to the window.
30
+ *
31
+ * @property {string} [backgroundColor="#FFF"] - _Updatable._
32
+ * The view’s _backfill_ color as a hexadecimal value. Not to be confused with the content background color
33
+ * (`document.body.style.backgroundColor`),
34
+ * this color briefly fills a view’s (a) content area before its content is loaded as well as (b) newly exposed
35
+ * areas when growing a window. Setting
36
+ * this value to the anticipated content background color can help improve user experience.
37
+ * Default is white.
38
+ *
39
+ * @property {object} [contentNavigation]
40
+ * Restrict navigation to URLs that match a whitelisted pattern.
41
+ * In the lack of a whitelist, navigation to URLs that match a blacklisted pattern would be prohibited.
42
+ * See [here](https://developer.chrome.com/extensions/match_patterns) for more details.
43
+ * @property {string[]} [contentNavigation.whitelist=[]] List of whitelisted URLs.
44
+ * @property {string[]} [contentNavigation.blacklist=[]] List of blacklisted URLs.
45
+ *
46
+ * @property {object} [contentRedirect]
47
+ * Restrict redirects to URLs that match a whitelisted pattern.
48
+ * In the lack of a whitelist, redirects to URLs that match a blacklisted pattern would be prohibited.
49
+ * See [here](https://developer.chrome.com/extensions/match_patterns) for more details.
50
+ * @property {string[]} [contentRedirect.whitelist=[]] List of whitelisted URLs.
51
+ * @property {string[]} [contentRedirect.blacklist=[]] List of blacklisted URLs.
52
+ *
53
+ * @property {object} [contextMenuSettings] - _Updatable._
54
+ * Configure the context menu when right-clicking on a view.
55
+ * @property {boolean} [contextMenuSettings.enable=true] Should the context menu display on right click.
56
+ * @property {boolean} [contextMenuSettings.devtools=true] Should the context menu contain a button for opening devtools.
57
+ * @property {boolean} [contextMenuSettings.reload=true] Should the context menu contain a button for reloading the page.
58
+ *
59
+ * @property {any} [customData=""] - _Updatable._
60
+ * A field that the user can attach serializable data to to be ferried around with the view options.
61
+ * _When omitted, the default value of this property is the empty string (`""`)._
62
+ *
63
+ * When omitted, the default value of this property is the empty string (`""`).
64
+ * As opposed to customData this is meant for frequent updates and sharing with other contexts. [Example]{@tutorial customContext}
65
+ *
66
+ * @property {object[]} [hotkeys=[]] - _Updatable._
67
+ * Defines the list of hotkeys that will be emitted as a `hotkey` event on the view. For usage example see [example]{@tutorial hotkeys}.
68
+ * Within Platform, OpenFin also implements a set of pre-defined actions called
69
+ * [keyboard commands]{@link https://developers.openfin.co/docs/platform-api#section-5-3-using-keyboard-commands}
70
+ * that can be assigned to a specific hotkey in the platform manifest.
71
+ * @property {string} hotkeys.keys The key combination of the hotkey, i.e. "Ctrl+T"
72
+ * @property {boolean} [hotkeys.preventDefault=false] preventDefault will prevent the page keydown/keyup events from being emitted.
73
+ *
74
+ * @property {boolean} [isClosable=true] **Platforms Only.** If false, the view will be persistent and can't be closed through
75
+ * either UI or `Platform.closeView`. Note that the view will still be closed if the host window is closed or
76
+ * if the view isn't part of the new layout when running `Layout.replace`.
77
+ *
78
+ * @property {string} name
79
+ * The name of the view.
80
+ *
81
+ * @property {boolean} [detachOnClose=false] - _Updatable._
82
+ * Platforms Only. If true, will hide and detach the View from the window for later use instead of closing,
83
+ * allowing the state of the View to be saved and the View to be immediately shown in a new Layout.
84
+ *
85
+ * @property {string} [manifestUrl] **Platforms Only.** Url to a manifest that contains View Options. Properties other than manifestUrl can still be used
86
+ * but the properties in the manifest will take precedence if there is any collision.
87
+ *
88
+ * @property {preloadScript[]} [preloadScripts] - _Inheritable_
89
+ * A list of scripts that are eval'ed before other scripts in the page. When omitted, _inherits_
90
+ * from the parent application.
91
+ *
92
+ * @property {boolean} [preventDragOut=false] **Platforms Only.** If true, the tab of the view can't be dragged out of its host window.
93
+ *
94
+ * @property {string} [processAffinity=<application uuid>]
95
+ * A string to attempt to group renderers together. Will only be used if pages are on the same origin.
96
+ *
97
+ * @property {Identity} [target]
98
+ * The identity of the window this view should be attached to.
99
+ *
100
+ * @property {string} [url="about:blank"]
101
+ * The URL of the view.
102
+ *
103
+ * @property {string} [uuid=<application uuid>]
104
+ * The `uuid` of the application, unique within the set of all `Application`s running in OpenFin Runtime.
105
+ * If omitted, defaults to the `uuid` of the application spawning the view.
106
+ * If given, must match the `uuid` of the application spawning the view.
107
+ * In other words, the application's `uuid` is the only acceptable value, but is the default, so there's
108
+ * really no need to provide it.
109
+ */
110
+ /**
111
+ * @classdesc a View can be used to embed additional web content into a Window.
112
+ * It is like a child window, except it is positioned relative to its owning window.
113
+ * It has the ability to listen for <a href="tutorial-View.EventEmitter.html">View-specific events</a>.
114
+ *
115
+ * By default, a View will try to share the same renderer process as other Views owned by its parent Application.
116
+ * To change that behavior, see the processAffinity {@link View~options view option}.
117
+ *
118
+ * A View's lifecycle is tied to its owning window and can be re-attached to a different window at any point during its lifecycle.
119
+ * @class
120
+ * @alias View
121
+ * @hideconstructor
122
+ */
123
+ export declare class View extends WebContents<ViewEvents> {
124
+ identity: OpenFin.Identity;
125
+ constructor(wire: Transport, identity: OpenFin.Identity);
126
+ /**
127
+ * Gets a base64 encoded image of the view or a part of it.
128
+ * @function capturePage
129
+ * @param { CapturePageOptions } [options] Options for the capturePage call.
130
+ * @memberOf View
131
+ * @instance
132
+ * @return {Promise.<string>}
133
+ * @tutorial View.capturePage
134
+ */
135
+ /**
136
+ * Executes Javascript on the view, restricted to contents you own or contents owned by
137
+ * applications you have created.
138
+ * @param { string } code JavaScript code to be executed on the view.
139
+ * @function executeJavaScript
140
+ * @memberOf View
141
+ * @instance
142
+ * @return {Promise.<void>}
143
+ * @tutorial View.executeJavaScript
144
+ */
145
+ /**
146
+ * Focuses the view
147
+ * @return {Promise.<void>}
148
+ * @function focus
149
+ * @memberof View
150
+ * @emits focused
151
+ * @instance
152
+ * @tutorial View.focus
153
+ * @experimental
154
+ */
155
+ focus({ emitSynthFocused }?: {
156
+ emitSynthFocused: boolean;
157
+ }): Promise<void>;
158
+ /**
159
+ * Returns the zoom level of the view.
160
+ * @function getZoomLevel
161
+ * @memberOf View
162
+ * @instance
163
+ * @return {Promise.<number>}
164
+ * @tutorial View.getZoomLevel
165
+ */
166
+ /**
167
+ * Sets the zoom level of the view.
168
+ * @param { number } level The zoom level
169
+ * @function setZoomLevel
170
+ * @memberOf View
171
+ * @instance
172
+ * @return {Promise.<void>}
173
+ * @tutorial View.setZoomLevel
174
+ */
175
+ /**
176
+ * Find and highlight text on a page.
177
+ * @param { string } searchTerm Term to find in page
178
+ * @param { FindInPageOptions } options Search options
179
+ * @function findInPage
180
+ * @memberOf View
181
+ * @instance
182
+ * @return {Promise.<number>}
183
+ * @tutorial View.findInPage
184
+ */
185
+ /**
186
+ * Stops any findInPage call with the provided action.
187
+ * @param {string} action
188
+ * Action to execute when stopping a find in page:<br>
189
+ * "clearSelection" - Clear the selection.<br>
190
+ * "keepSelection" - Translate the selection into a normal selection.<br>
191
+ * "activateSelection" - Focus and click the selection node.<br>
192
+ * @function stopFindInPage
193
+ * @memberOf View
194
+ * @instance
195
+ * @return {Promise.<void>}
196
+ * @tutorial View.stopFindInPage
197
+ */
198
+ /**
199
+ * Navigates the view to a specified URL. The url must contain the protocol prefix such as http:// or https://.
200
+ * @param { string } url - The URL to navigate the view to.
201
+ * @return {Promise.<void>}
202
+ * @function navigate
203
+ * @memberof View
204
+ * @instance
205
+ * @tutorial View.navigate
206
+ * @experimental
207
+ */
208
+ /**
209
+ * Navigates the view back one page.
210
+ * @function navigateBack
211
+ * @memberOf View
212
+ * @instance
213
+ * @return {Promise.<void>}
214
+ * @tutorial View.navigateBack
215
+ */
216
+ /**
217
+ * Navigates the view forward one page.
218
+ * @function navigateForward
219
+ * @memberOf View
220
+ * @instance
221
+ * @return {Promise.<void>}
222
+ * @tutorial View.navigateForward
223
+ */
224
+ /**
225
+ * Stops any current navigation the view is performing.
226
+ * @function stopNavigation
227
+ * @memberOf View
228
+ * @instance
229
+ * @return {Promise.<void>}
230
+ * @tutorial View.stopNavigation
231
+ */
232
+ /**
233
+ * Reloads the view current page
234
+ * @function reload
235
+ * @memberOf View
236
+ * @instance
237
+ * @return {Promise.<void>}
238
+ * @tutorial View.reload
239
+ */
240
+ /**
241
+ * Prints the view's web page
242
+ * @param { PrintOptions } [options] Printer Options
243
+ * @function print
244
+ * @memberOf View
245
+ * @instance
246
+ * @return {Promise.<void>}
247
+ * @tutorial View.print
248
+ */
249
+ /**
250
+ * Returns an array with all system printers
251
+ * @function getPrinters
252
+ * @memberOf View
253
+ * @instance
254
+ * @return { Promise.Array.<PrinterInfo> }
255
+ * @tutorial View.getPrinters
256
+ */
257
+ /**
258
+ * Shows the Chromium Developer Tools
259
+ * @function showDeveloperTools
260
+ * @memberOf View
261
+ * @instance
262
+ * @return {Promise.<void>}
263
+ * @tutorial View.showDeveloperTools
264
+ */
265
+ /**
266
+ * Retrieves the process information associated with a view.
267
+ * @function getProcessInfo
268
+ * @memberOf View
269
+ * @instance
270
+ * @return {Promise.<EntityProcessDetails>}
271
+ * @tutorial View.getProcessInfo
272
+ */
273
+ /**
274
+ * Retrieves information on all Shared Workers.
275
+ * @function getSharedWorkers
276
+ * @memberOf View
277
+ * @instance
278
+ * @return {Promise.Array.<SharedWorkerInfo>}
279
+ * @tutorial View.getSharedWorkers
280
+ */
281
+ /**
282
+ * Opens the developer tools for the shared worker context.
283
+ * @function inspectSharedWorker
284
+ * @memberOf View
285
+ * @instance
286
+ * @return {Promise.<void>}
287
+ * @tutorial View.inspectSharedWorker
288
+ */
289
+ /**
290
+ * Inspects the shared worker based on its ID.
291
+ * @param { string } workerId - The id of the shared worker.
292
+ * @function inspectSharedWorkerById
293
+ * @memberOf View
294
+ * @instance
295
+ * @return {Promise.<void>}
296
+ * @tutorial View.inspectSharedWorkerById
297
+ */
298
+ /**
299
+ * Opens the developer tools for the service worker context.
300
+ * @function inspectServiceWorker
301
+ * @memberOf View
302
+ * @instance
303
+ * @return {Promise.<void>}
304
+ * @tutorial View.inspectServiceWorker
305
+ */
306
+ /**
307
+ * Attaches the current view to a the given window identity.
308
+ * Identity must be the identity of a window in the same application.
309
+ * This detaches the view from its current window, and sets the view to be destroyed when its new window closes.
310
+ * @param target {Identity}
311
+ * @return {Promise.<void>}
312
+ * @tutorial View.attach
313
+ * @experimental
314
+ */
315
+ attach: (target: OpenFin.Identity) => Promise<void>;
316
+ /**
317
+ * Destroys the current view
318
+ * @return {Promise.<void>}
319
+ * @tutorial View.destroy
320
+ * @experimental
321
+ */
322
+ destroy: () => Promise<void>;
323
+ /**
324
+ * Shows the current view if it is currently hidden.
325
+ * @return {Promise.<void>}
326
+ * @tutorial View.show
327
+ * @experimental
328
+ */
329
+ show: () => Promise<void>;
330
+ /**
331
+ * Hides the current view if it is currently visible.
332
+ * @return {Promise.<void>}
333
+ * @tutorial View.hide
334
+ * @experimental
335
+ */
336
+ hide: () => Promise<void>;
337
+ /**
338
+ * Sets the bounds (top, left, width, height) of the view relative to its window.
339
+ * @param bounds {ViewBounds}
340
+ * @return {Promise.<void>}
341
+ * @tutorial View.setBounds
342
+ * @experimental
343
+ */
344
+ setBounds: (bounds: OpenFin.Bounds) => Promise<void>;
345
+ /**
346
+ * Gets the bounds (top, left, width, height) of the view relative to its window.
347
+ * @return {Promise.<ViewBounds>}
348
+ * @tutorial View.getBounds
349
+ * @experimental
350
+ */
351
+ getBounds: () => Promise<OpenFin.Bounds>;
352
+ /**
353
+ * Gets the View's info.
354
+ * @return {Promise.<ViewInfo>}
355
+ * @tutorial View.getInfo
356
+ * @experimental
357
+ */
358
+ getInfo: () => Promise<OpenFin.ViewInfo>;
359
+ /**
360
+ * Retrieves the layout for the window the view is attached to.
361
+ * @return {Promise.<Layout>}
362
+ * @tutorial View.getParentLayout
363
+ * @experimental
364
+ */
365
+ getParentLayout: () => Promise<OpenFin.Layout>;
366
+ /**
367
+ * Gets the View's options.
368
+ * @return {Promise<ViewOptions>}
369
+ * @tutorial View.getOptions
370
+ * @experimental
371
+ */
372
+ getOptions: () => Promise<OpenFin.ViewOptions>;
373
+ /**
374
+ * Updates the view's options.
375
+ * @param { Partial<ViewOptions> } options
376
+ * @return {Promise.<void>}
377
+ * @tutorial View.updateOptions
378
+ * @experimental
379
+ */
380
+ updateOptions: (options: UpdatableViewOptions) => Promise<void>;
381
+ /**
382
+ * Retrieves the window the view is currently attached to.
383
+ * @return {Promise.<_Window>}
384
+ * @experimental
385
+ */
386
+ getCurrentWindow: () => Promise<OpenFin.Window>;
387
+ }