@openfin/core 25.68.26

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 (227) hide show
  1. package/LICENSE +13 -0
  2. package/NOTICE +16 -0
  3. package/OpenFin.d.ts +1340 -0
  4. package/README.md +41 -0
  5. package/docs.README(OLD).md +82 -0
  6. package/fin.d.ts +4 -0
  7. package/package.json +33 -0
  8. package/resources/win/OpenFinRVM.exe +0 -0
  9. package/src/api/application/Factory.d.ts +145 -0
  10. package/src/api/application/Factory.js +229 -0
  11. package/src/api/application/Instance.d.ts +302 -0
  12. package/src/api/application/Instance.js +412 -0
  13. package/src/api/application/index.d.ts +3 -0
  14. package/src/api/application/index.js +15 -0
  15. package/src/api/base.d.ts +43 -0
  16. package/src/api/base.js +177 -0
  17. package/src/api/clipboard/index.d.ts +69 -0
  18. package/src/api/clipboard/index.js +88 -0
  19. package/src/api/events/application.d.ts +69 -0
  20. package/src/api/events/application.js +2 -0
  21. package/src/api/events/base.d.ts +17 -0
  22. package/src/api/events/base.js +2 -0
  23. package/src/api/events/channel.d.ts +10 -0
  24. package/src/api/events/channel.js +2 -0
  25. package/src/api/events/emitterMap.d.ts +11 -0
  26. package/src/api/events/emitterMap.js +35 -0
  27. package/src/api/events/eventAggregator.d.ts +5 -0
  28. package/src/api/events/eventAggregator.js +43 -0
  29. package/src/api/events/externalApplication.d.ts +5 -0
  30. package/src/api/events/externalApplication.js +2 -0
  31. package/src/api/events/frame.d.ts +9 -0
  32. package/src/api/events/frame.js +2 -0
  33. package/src/api/events/globalHotkey.d.ts +10 -0
  34. package/src/api/events/globalHotkey.js +2 -0
  35. package/src/api/events/platform.d.ts +18 -0
  36. package/src/api/events/platform.js +2 -0
  37. package/src/api/events/system.d.ts +22 -0
  38. package/src/api/events/system.js +2 -0
  39. package/src/api/events/view.d.ts +56 -0
  40. package/src/api/events/view.js +2 -0
  41. package/src/api/events/webcontents.d.ts +48 -0
  42. package/src/api/events/webcontents.js +2 -0
  43. package/src/api/events/window.d.ts +169 -0
  44. package/src/api/events/window.js +2 -0
  45. package/src/api/external-application/Factory.d.ts +26 -0
  46. package/src/api/external-application/Factory.js +40 -0
  47. package/src/api/external-application/Instance.d.ts +102 -0
  48. package/src/api/external-application/Instance.js +109 -0
  49. package/src/api/external-application/index.d.ts +3 -0
  50. package/src/api/external-application/index.js +15 -0
  51. package/src/api/fin.d.ts +49 -0
  52. package/src/api/fin.js +43 -0
  53. package/src/api/frame/Factory.d.ts +36 -0
  54. package/src/api/frame/Factory.js +69 -0
  55. package/src/api/frame/Instance.d.ts +121 -0
  56. package/src/api/frame/Instance.js +130 -0
  57. package/src/api/frame/index.d.ts +3 -0
  58. package/src/api/frame/index.js +15 -0
  59. package/src/api/global-hotkey/index.d.ts +38 -0
  60. package/src/api/global-hotkey/index.js +58 -0
  61. package/src/api/interappbus/channel/channel.d.ts +26 -0
  62. package/src/api/interappbus/channel/channel.js +77 -0
  63. package/src/api/interappbus/channel/channels-docs.d.ts +318 -0
  64. package/src/api/interappbus/channel/channels-docs.js +376 -0
  65. package/src/api/interappbus/channel/client.d.ts +22 -0
  66. package/src/api/interappbus/channel/client.js +84 -0
  67. package/src/api/interappbus/channel/connection-manager.d.ts +28 -0
  68. package/src/api/interappbus/channel/connection-manager.js +244 -0
  69. package/src/api/interappbus/channel/index.d.ts +22 -0
  70. package/src/api/interappbus/channel/index.js +121 -0
  71. package/src/api/interappbus/channel/protocols/classic/message-receiver.d.ts +13 -0
  72. package/src/api/interappbus/channel/protocols/classic/message-receiver.js +73 -0
  73. package/src/api/interappbus/channel/protocols/classic/strategy.d.ts +22 -0
  74. package/src/api/interappbus/channel/protocols/classic/strategy.js +84 -0
  75. package/src/api/interappbus/channel/protocols/combined/strategy.d.ts +20 -0
  76. package/src/api/interappbus/channel/protocols/combined/strategy.js +58 -0
  77. package/src/api/interappbus/channel/protocols/index.d.ts +44 -0
  78. package/src/api/interappbus/channel/protocols/index.js +2 -0
  79. package/src/api/interappbus/channel/protocols/protocol-manager.d.ts +10 -0
  80. package/src/api/interappbus/channel/protocols/protocol-manager.js +43 -0
  81. package/src/api/interappbus/channel/protocols/rtc/endpoint.d.ts +23 -0
  82. package/src/api/interappbus/channel/protocols/rtc/endpoint.js +135 -0
  83. package/src/api/interappbus/channel/protocols/rtc/ice-manager.d.ts +30 -0
  84. package/src/api/interappbus/channel/protocols/rtc/ice-manager.js +131 -0
  85. package/src/api/interappbus/channel/protocols/rtc/strategy.d.ts +22 -0
  86. package/src/api/interappbus/channel/protocols/rtc/strategy.js +87 -0
  87. package/src/api/interappbus/channel/protocols/strategy-types.d.ts +13 -0
  88. package/src/api/interappbus/channel/protocols/strategy-types.js +2 -0
  89. package/src/api/interappbus/channel/protocols/strategy.d.ts +15 -0
  90. package/src/api/interappbus/channel/protocols/strategy.js +2 -0
  91. package/src/api/interappbus/channel/provider.d.ts +31 -0
  92. package/src/api/interappbus/channel/provider.js +165 -0
  93. package/src/api/interappbus/index.d.ts +85 -0
  94. package/src/api/interappbus/index.js +175 -0
  95. package/src/api/interop/Factory.d.ts +37 -0
  96. package/src/api/interop/Factory.js +54 -0
  97. package/src/api/interop/InteropBroker.d.ts +363 -0
  98. package/src/api/interop/InteropBroker.js +914 -0
  99. package/src/api/interop/InteropClient.d.ts +268 -0
  100. package/src/api/interop/InteropClient.js +450 -0
  101. package/src/api/interop/SessionContextGroupBroker.d.ts +26 -0
  102. package/src/api/interop/SessionContextGroupBroker.js +107 -0
  103. package/src/api/interop/SessionContextGroupClient.d.ts +20 -0
  104. package/src/api/interop/SessionContextGroupClient.js +85 -0
  105. package/src/api/interop/fdc3/fdc3-1.2.d.ts +187 -0
  106. package/src/api/interop/fdc3/fdc3-1.2.js +385 -0
  107. package/src/api/interop/fdc3/fdc3.js +17 -0
  108. package/src/api/interop/fdc3/utils.d.ts +6 -0
  109. package/src/api/interop/fdc3/utils.js +17 -0
  110. package/src/api/interop/index.d.ts +4 -0
  111. package/src/api/interop/index.js +16 -0
  112. package/src/api/interop/utils.d.ts +11 -0
  113. package/src/api/interop/utils.js +36 -0
  114. package/src/api/me.d.ts +35 -0
  115. package/src/api/me.js +60 -0
  116. package/src/api/platform/Factory.d.ts +109 -0
  117. package/src/api/platform/Factory.js +188 -0
  118. package/src/api/platform/Instance.d.ts +122 -0
  119. package/src/api/platform/Instance.js +299 -0
  120. package/src/api/platform/common-utils.d.ts +6 -0
  121. package/src/api/platform/common-utils.js +16 -0
  122. package/src/api/platform/index.d.ts +3 -0
  123. package/src/api/platform/index.js +15 -0
  124. package/src/api/platform/layout/Factory.d.ts +108 -0
  125. package/src/api/platform/layout/Factory.js +189 -0
  126. package/src/api/platform/layout/Instance.d.ts +48 -0
  127. package/src/api/platform/layout/Instance.js +99 -0
  128. package/src/api/platform/layout/index.d.ts +3 -0
  129. package/src/api/platform/layout/index.js +15 -0
  130. package/src/api/platform/layout/shapes.d.ts +11 -0
  131. package/src/api/platform/layout/shapes.js +2 -0
  132. package/src/api/snapshot-source/Factory.d.ts +36 -0
  133. package/src/api/snapshot-source/Factory.js +65 -0
  134. package/src/api/snapshot-source/Instance.d.ts +30 -0
  135. package/src/api/snapshot-source/Instance.js +134 -0
  136. package/src/api/snapshot-source/index.d.ts +3 -0
  137. package/src/api/snapshot-source/index.js +15 -0
  138. package/src/api/snapshot-source/utils.d.ts +1 -0
  139. package/src/api/snapshot-source/utils.js +5 -0
  140. package/src/api/system/application.d.ts +6 -0
  141. package/src/api/system/application.js +2 -0
  142. package/src/api/system/entity.d.ts +11 -0
  143. package/src/api/system/entity.js +2 -0
  144. package/src/api/system/index.d.ts +957 -0
  145. package/src/api/system/index.js +1241 -0
  146. package/src/api/system/installedApps.d.ts +6 -0
  147. package/src/api/system/installedApps.js +2 -0
  148. package/src/api/system/log.d.ts +11 -0
  149. package/src/api/system/log.js +2 -0
  150. package/src/api/system/process.d.ts +15 -0
  151. package/src/api/system/process.js +2 -0
  152. package/src/api/system/proxy.d.ts +15 -0
  153. package/src/api/system/proxy.js +2 -0
  154. package/src/api/system/queryPermissionTypes.d.ts +1 -0
  155. package/src/api/system/queryPermissionTypes.js +2 -0
  156. package/src/api/system/registry-info.d.ts +7 -0
  157. package/src/api/system/registry-info.js +2 -0
  158. package/src/api/system/window.d.ts +16 -0
  159. package/src/api/system/window.js +2 -0
  160. package/src/api/view/Factory.d.ts +49 -0
  161. package/src/api/view/Factory.js +103 -0
  162. package/src/api/view/Instance.d.ts +379 -0
  163. package/src/api/view/Instance.js +415 -0
  164. package/src/api/view/index.d.ts +3 -0
  165. package/src/api/view/index.js +15 -0
  166. package/src/api/webcontents/main.d.ts +36 -0
  167. package/src/api/webcontents/main.js +82 -0
  168. package/src/api/window/Factory.d.ts +44 -0
  169. package/src/api/window/Factory.js +91 -0
  170. package/src/api/window/Instance.d.ts +966 -0
  171. package/src/api/window/Instance.js +1202 -0
  172. package/src/api/window/bounds-changed.d.ts +10 -0
  173. package/src/api/window/bounds-changed.js +6 -0
  174. package/src/api/window/index.d.ts +5 -0
  175. package/src/api/window/index.js +17 -0
  176. package/src/api/window/shapes.d.ts +13 -0
  177. package/src/api/window/shapes.js +2 -0
  178. package/src/environment/environment.d.ts +28 -0
  179. package/src/environment/environment.js +4 -0
  180. package/src/environment/node-env.d.ts +25 -0
  181. package/src/environment/node-env.js +64 -0
  182. package/src/environment/openfin-env.d.ts +29 -0
  183. package/src/environment/openfin-env.js +105 -0
  184. package/src/mock.d.ts +4 -0
  185. package/src/mock.js +91 -0
  186. package/src/shapes/ERROR_BOX_TYPES.d.ts +6 -0
  187. package/src/shapes/ERROR_BOX_TYPES.js +10 -0
  188. package/src/shapes/EntityType.d.ts +1 -0
  189. package/src/shapes/EntityType.js +2 -0
  190. package/src/shapes/LayoutPresetType.d.ts +1 -0
  191. package/src/shapes/LayoutPresetType.js +2 -0
  192. package/src/shapes/Platform.d.ts +112 -0
  193. package/src/shapes/Platform.js +16 -0
  194. package/src/shapes/WebOptions.d.ts +12 -0
  195. package/src/shapes/WebOptions.js +2 -0
  196. package/src/shapes/WindowOptions.d.ts +42 -0
  197. package/src/shapes/WindowOptions.js +2 -0
  198. package/src/shapes/protocol.d.ts +178 -0
  199. package/src/shapes/protocol.js +2 -0
  200. package/src/transport/fin_store.d.ts +4 -0
  201. package/src/transport/fin_store.js +16 -0
  202. package/src/transport/transport-errors.d.ts +17 -0
  203. package/src/transport/transport-errors.js +39 -0
  204. package/src/transport/transport.d.ts +57 -0
  205. package/src/transport/transport.js +195 -0
  206. package/src/transport/wire.d.ts +76 -0
  207. package/src/transport/wire.js +39 -0
  208. package/src/util/asyncFilter.d.ts +1 -0
  209. package/src/util/asyncFilter.js +7 -0
  210. package/src/util/errors.d.ts +9 -0
  211. package/src/util/errors.js +14 -0
  212. package/src/util/exhaustive.d.ts +1 -0
  213. package/src/util/exhaustive.js +7 -0
  214. package/src/util/http.d.ts +11 -0
  215. package/src/util/http.js +83 -0
  216. package/src/util/normalize-config.d.ts +3 -0
  217. package/src/util/normalize-config.js +47 -0
  218. package/src/util/promises.d.ts +5 -0
  219. package/src/util/promises.js +27 -0
  220. package/src/util/ref-counter.d.ts +7 -0
  221. package/src/util/ref-counter.js +51 -0
  222. package/src/util/runtimeVersioning.d.ts +3 -0
  223. package/src/util/runtimeVersioning.js +25 -0
  224. package/src/util/utilTypes.d.ts +8 -0
  225. package/src/util/utilTypes.js +2 -0
  226. package/src/util/validate.d.ts +3 -0
  227. package/src/util/validate.js +11 -0
@@ -0,0 +1,966 @@
1
+ import Transport from '../../transport/transport';
2
+ import { WindowEvents } from '../events/window';
3
+ import { WebContents } from '../webcontents/main';
4
+ import { WindowInfo } from './shapes';
5
+ /**
6
+ * @typedef { object } Margins
7
+ * @property { string } [marginType]
8
+ * Can be `default`, `none`, `printableArea`, or `custom`. If `custom` is chosen,
9
+ * you will also need to specify `top`, `bottom`, `left`, and `right`.
10
+ *
11
+ * @property { number } [top] The top margin of the printed web page, in pixels.
12
+ * @property { number } [bottom] The bottom margin of the printed web page, in pixels.
13
+ * @property { number } [left] The left margin of the printed web page, in pixels.
14
+ * @property { number } [right] The right margin of the printed web page, in pixels.
15
+ */
16
+ /**
17
+ * @typedef { object } Dpi
18
+ * @property { number } [horizontal] The horizontal dpi
19
+ * @property { number } [vertical] The vertical dpi
20
+ */
21
+ /**
22
+ * @typedef { object } PrintOptions
23
+ * @property { boolean } [silent=false] Don't ask user for print settings.
24
+ * @property { boolean } [printBackground=false] Prints the background color and image of the web page.
25
+ * @property { string } [deviceName=''] Set the printer device name to use.
26
+ * @property { boolean } [color=true] Set whether the printed web page will be in color or grayscale.
27
+ * @property { Margins } [margins] Set margins for the printed web page
28
+ * @property { boolean } [landscape=false] Whether the web page should be printed in landscape mode.
29
+ * @property { number } [scaleFactor] The scale factor of the web page.
30
+ * @property { number } [pagesPerSheet] The number of pages to print per page sheet.
31
+ * @property { boolean } [collate] Whether the web page should be collated.
32
+ * @property { number } [copies] The number of copies of the web page to print.
33
+ * @property { Record<string, number> } [pageRanges] The page range to print. Should have two keys: from and to.
34
+ * @property { string } [duplexMode] Set the duplex mode of the printed web page. Can be simplex, shortEdge, or longEdge.
35
+ * @property { Dpi } [dpi] Set dpi for the printed web page
36
+ */
37
+ /**
38
+ * PrinterInfo interface
39
+ * @typedef { object } PrinterInfo
40
+ * @property { string } name Printer Name
41
+ * @property { string } description Printer Description
42
+ * @property { number } status Printer Status
43
+ * @property { boolean } isDefault Indicates that system's default printer
44
+ */
45
+ /**
46
+ * SharedWorkerInfo interface
47
+ * @typedef { object } SharedWorkerInfo
48
+ * @property { string } id The unique id of the shared worker.
49
+ * @property { string } url The url of the shared worker.
50
+ */
51
+ /**
52
+ * ContentCreationRule interface
53
+ * @typedef { object } ContentCreationRule
54
+ * @property { string } behavior 'view' | 'window' | 'browser' | 'block'
55
+ * @property { string[] } match List of [match patterns](https://developer.chrome.com/extensions/match_patterns).
56
+ * @property { object } options Window creation options or View creation options.
57
+ */
58
+ /**
59
+ * @typedef {object} Window~options
60
+ * @summary Window creation options.
61
+ * @desc This is the options object required by {@link Window.create Window.create}.
62
+ *
63
+ * Note that `name` is the only required property — albeit the `url` property is usually provided as well
64
+ * (defaults to `"about:blank"` when omitted).
65
+ *
66
+ * _This jsdoc typedef mirrors the `WindowOptions` TypeScript interface in `@types/openfin`._
67
+ *
68
+ * @property {object} [accelerator]
69
+ * Enable keyboard shortcuts for devtools, zoom, reload, and reload ignoring cache.
70
+ *
71
+ * @property {boolean} [accelerator.devtools=false]
72
+ * If `true`, enables the devtools keyboard shortcut:<br>
73
+ * `Ctrl` + `Shift` + `I` _(Toggles Devtools)_
74
+ *
75
+ * @property {boolean} [accelerator.reload=false]
76
+ * If `true`, enables the reload keyboard shortcuts:<br>
77
+ * `Ctrl` + `R` _(Windows)_<br>
78
+ * `F5` _(Windows)_<br>
79
+ * `Command` + `R` _(Mac)_
80
+ *
81
+ * @property {boolean} [accelerator.reloadIgnoringCache=false]
82
+ * If `true`, enables the reload-from-source keyboard shortcuts:<br>
83
+ * `Ctrl` + `Shift` + `R` _(Windows)_<br>
84
+ * `Shift` + `F5` _(Windows)_<br>
85
+ * `Command` + `Shift` + `R` _(Mac)_
86
+ *
87
+ * @property {boolean} [accelerator.zoom=false]
88
+ * If `true`, enables the zoom keyboard shortcuts:<br>
89
+ * `Ctrl` + `+` _(Zoom In)_<br>
90
+ * `Ctrl` + `Shift` + `+` _(Zoom In)_<br>
91
+ * `Ctrl` + `NumPad+` _(Zoom In)_<br>
92
+ * `Ctrl` + `-` _(Zoom Out)_<br>
93
+ * `Ctrl` + `Shift` + `-` _(Zoom Out)_<br>
94
+ * `Ctrl` + `NumPad-` _(Zoom Out)_<br>
95
+ * `Ctrl` + `Scroll` _(Zoom In & Out)_<br>
96
+ * `Ctrl` + `0` _(Restore to 100%)_
97
+ *
98
+ * @property {object} [alphaMask] - _Experimental._ _Updatable._
99
+ * <br>
100
+ * alphaMask turns anything of matching RGB value transparent.
101
+ * <br>
102
+ * Caveats:
103
+ * * runtime key --disable-gpu is required. Note: Unclear behavior on remote Desktop support
104
+ * * User cannot click-through transparent regions
105
+ * * Not supported on Mac
106
+ * * Windows Aero must be enabled
107
+ * * Won't make visual sense on Pixel-pushed environments such as Citrix
108
+ * * Not supported on rounded corner windows
109
+ * @property {number} [alphaMask.red=-1] 0-255
110
+ * @property {number} [alphaMask.green=-1] 0-255
111
+ * @property {number} [alphaMask.blue=-1] 0-255
112
+ *
113
+ * @property {boolean} [alwaysOnTop=false] - _Updatable._
114
+ * A flag to always position the window at the top of the window stack.
115
+ *
116
+ * @property {object} [api]
117
+ * Configurations for API injection.
118
+ *
119
+ * @property {object} [api.iframe] Configure if the the API should be injected into iframes based on domain.
120
+ *
121
+ * @property {boolean} [api.iframe.crossOriginInjection=false] Controls if the `fin` API object is present for cross origin iframes.
122
+ * @property {boolean} [api.iframe.sameOriginInjection=true] Controls if the `fin` API object is present for same origin iframes.
123
+ *
124
+ * @property {string} [applicationIcon = ""] - _Deprecated_ - use `icon` instead.
125
+ *
126
+ * @property {number} [aspectRatio=0] - _Updatable._
127
+ * The aspect ratio of width to height to enforce for the window. If this value is equal to or less than zero,
128
+ * an aspect ratio will not be enforced.
129
+ *
130
+ * @property {boolean} [autoShow=true]
131
+ * A flag to automatically show the window when it is created.
132
+ *
133
+ * @property {string} [backgroundColor="#FFF"]
134
+ * The window’s _backfill_ color as a hexadecimal value. Not to be confused with the content background color
135
+ * (`document.body.style.backgroundColor`),
136
+ * this color briefly fills a window’s (a) content area before its content is loaded as well as (b) newly exposed
137
+ * areas when growing a window. Setting
138
+ * this value to the anticipated content background color can help improve user experience.
139
+ * Default is white.
140
+ *
141
+ * @property {object} [contentCreation]
142
+ * Apply rules that determine how user interaction (`window.open` and links) creates content.
143
+ * @property {ContentCreationRule[]} [contentCreation.rules = []] List of content creation rules.
144
+ *
145
+ * @property {object} [contentNavigation]
146
+ * Restrict navigation to URLs that match a whitelisted pattern.
147
+ * In the lack of a whitelist, navigation to URLs that match a blacklisted pattern would be prohibited.
148
+ * See [here](https://developer.chrome.com/extensions/match_patterns) for more details.
149
+ * @property {string[]} [contentNavigation.whitelist=[]] List of whitelisted URLs.
150
+ * @property {string[]} [contentNavigation.blacklist=[]] List of blacklisted URLs.
151
+
152
+ * @property {boolean} [contextMenu=true] - _Updatable._
153
+ * A flag to show the context menu when right-clicking on a window.
154
+ * Gives access to the devtools for the window.
155
+ *
156
+ * @property {object} [contextMenuSettings] - _Updatable._
157
+ * Configure the context menu when right-clicking on a window.
158
+ * @property {boolean} [contextMenuSettings.enable=true] Should the context menu display on right click.
159
+ * @property {boolean} [contextMenuSettings.devtools=true] Should the context menu contain a button for opening devtools.
160
+ * @property {boolean} [contextMenuSettings.reload=true] Should the context menu contain a button for reloading the page.
161
+ *
162
+ * @property {object} [cornerRounding] - _Updatable._
163
+ * Defines and applies rounded corners for a frameless window. **NOTE:** On macOS corner is not ellipse but circle rounded by the
164
+ * average of _height_ and _width_.
165
+ * @property {number} [cornerRounding.height=0] The height in pixels.
166
+ * @property {number} [cornerRounding.width=0] The width in pixels.
167
+ *
168
+ * @property {any} [customContext=""] - _Updatable._
169
+ * A field that the user can use to attach serializable data that will be saved when {@link Platform#getSnapshot Platform.getSnapshot}
170
+ * is called. If a window in a Platform is trying to update or retrieve its own context, it can use the
171
+ * {@link Platform#setWindowContext Platform.setWindowContext} and {@link Platform#getWindowContext Platform.getWindowContext} calls.
172
+ * When omitted, the default value of this property is the empty string (`""`).
173
+ * As opposed to customData this is meant for frequent updates and sharing with other contexts. [Example]{@tutorial customContext}
174
+ *
175
+ * @property {any} [customData=""] - _Updatable._
176
+ * A field that the user can attach serializable data to to be ferried around with the window options.
177
+ * _When omitted, the default value of this property is the empty string (`""`)._
178
+ *
179
+ * @property {object[]} [customRequestHeaders]
180
+ * Defines list of custom headers for requests sent by the window.
181
+ * @property {string[]} [customRequestHeaders.urlPatterns=[]] The URL patterns for which the headers will be applied
182
+ * @property {object[]} [customRequestHeaders.headers=[]] Objects representing headers and their values,
183
+ * where the object key is the name of header and value at key is the value of the header
184
+ *
185
+ * @property {boolean} [closeOnLastViewRemoved=true] - _Experimental._ _Updatable._
186
+ * Toggling off would keep the Window alive even if all its Views were closed.
187
+ * This is meant for advanced users and should be used with caution.
188
+ * Limitations - Once a Layout has been emptied out of all views it's not usable anymore, and certain API calls will fail.
189
+ * Use `layout.replace` to create a fresh Layout instance in case you want to populate it with Views again.
190
+ * ** note ** - This option is ignored in non-Platforms apps.
191
+ *
192
+ * @property {boolean} [defaultCentered=false]
193
+ * Centers the window in the primary monitor. This option overrides `defaultLeft` and `defaultTop`. When `saveWindowState` is `true`,
194
+ * this value will be ignored for subsequent launches in favor of the cached value. **NOTE:** On macOS _defaultCenter_ is
195
+ * somewhat above center vertically.
196
+ *
197
+ * @property {number} [defaultHeight=500]
198
+ * The default height of the window. When `saveWindowState` is `true`, this value will be ignored for subsequent launches
199
+ * in favor of the cached value.
200
+ *
201
+ * @property {number} [defaultLeft=100]
202
+ * The default left position of the window. When `saveWindowState` is `true`, this value will be ignored for subsequent
203
+ * launches in favor of the cached value.
204
+ *
205
+ * @property {number} [defaultTop=100]
206
+ * The default top position of the window. When `saveWindowState` is `true`, this value will be ignored for subsequent
207
+ * launches in favor of the cached value.
208
+ *
209
+ * @property {number} [defaultWidth=800]
210
+ * The default width of the window. When `saveWindowState` is `true`, this value will be ignored for subsequent
211
+ * launches in favor of the cached value.
212
+ *
213
+ * @property {boolean} [includeInSnapshots=true] - _Updatable._
214
+ * When true, the window will be be included in snapshots returned by Platform.getSnapshot(). Turning this off may be desirable when dealing with
215
+ * inherently temporary windows whose state shouldn't be preserved, such as modals, menus, or popups.
216
+ *
217
+ * @property {boolean} [frame=true] - _Updatable._
218
+ * A flag to show the frame.
219
+ *
220
+ * @hidden-property {boolean} [hideOnClose=false] - A flag to allow a window to be hidden when the close button is clicked.
221
+ *
222
+ * @property {object[]} [hotkeys=[]] - _Updatable._
223
+ * Defines the list of hotkeys that will be emitted as a `hotkey` event on the window. For usage example see [example]{@tutorial hotkeys}.
224
+ * Within Platform, OpenFin also implements a set of pre-defined actions called
225
+ * [keyboard commands]{@link https://developers.openfin.co/docs/platform-api#section-5-3-using-keyboard-commands}
226
+ * that can be assigned to a specific hotkey in the platform manifest.
227
+ * @property {string} hotkeys.keys The key combination of the hotkey, i.e. "Ctrl+T"
228
+ * @property {boolean} [hotkeys.preventDefault=false] Whether or not to prevent default key handling before emitting the event
229
+ *
230
+ * @property {string} [icon] - _Updatable. Inheritable._
231
+ * A URL for the icon to be shown in the window title bar and the taskbar.
232
+ * _When omitted, inherits from the parent application._
233
+ * note: Window OS caches taskbar icons, therefore an icon change might only be visible after the cache is removed or the uuid is changed.
234
+ *
235
+ * @property {number} [maxHeight=-1] - _Updatable._
236
+ * The maximum height of a window. Will default to the OS defined value if set to -1.
237
+ *
238
+ * @property {boolean} [maximizable=true] - _Updatable._
239
+ * A flag that lets the window be maximized.
240
+ *
241
+ * @property {number} [maxWidth=-1] - _Updatable._
242
+ * The maximum width of a window. Will default to the OS defined value if set to -1.
243
+ *
244
+ * @property {number} [minHeight=0] - _Updatable._
245
+ * The minimum height of a window.
246
+ *
247
+ * @property {boolean} [minimizable=true] - _Updatable._
248
+ * A flag that lets the window be minimized.
249
+ *
250
+ * @property {number} [minWidth=0] - _Updatable._
251
+ * The minimum width of a window.
252
+ *
253
+ * @property {Identity} [modalParentIdentity]
254
+ * Parent identity of a modal window. It will create a modal child window when this option is set.
255
+ *
256
+ * @property {string} name
257
+ * The name of the window.
258
+ *
259
+ * @property {number} [opacity=1.0] - _Updatable._
260
+ * A flag that specifies how transparent the window will be.
261
+ * Changing opacity doesn't work on Windows 7 without Aero so setting this value will have no effect there.
262
+ * This value is clamped between `0.0` and `1.0`.
263
+ *
264
+ * @property {preloadScript[]} [preloadScripts] - _Inheritable_
265
+ * A list of scripts that are eval'ed before other scripts in the page. When omitted, _inherits_
266
+ * from the parent application.
267
+ *
268
+ * @property {string} [processAffinity]
269
+ * A string to attempt to group renderers together. Will only be used if pages are on the same origin.
270
+ *
271
+ * @property {boolean} [resizable=true] - _Updatable._
272
+ * A flag to allow the user to resize the window.
273
+ *
274
+ * @property {object} [resizeRegion] - _Updatable._
275
+ * Defines a region in pixels that will respond to user mouse interaction for resizing a frameless window.
276
+ * @property {number} [resizeRegion.bottomRightCorner=9]
277
+ * The size in pixels of an additional square resizable region located at the bottom right corner of a frameless window.
278
+ * @property {number} [resizeRegion.size=7]
279
+ * The size in pixels.
280
+ * @property {object} [resizeRegion.sides={top:true,right:true,bottom:true,left:true}]
281
+ * Sides that a window can be resized from.
282
+ *
283
+ * @property {boolean} [saveWindowState=true]
284
+ * A flag to cache the location of the window.
285
+ * ** note ** - This option is ignored in Platforms as it would cause inconsistent {@link Platform#applySnapshot applySnapshot} behavior.
286
+ *
287
+ * @property {boolean} [shadow=false]
288
+ * A flag to display a shadow on frameless windows.
289
+ * `shadow` and `cornerRounding` are mutually exclusive.
290
+ * On Windows 7, Aero theme is required.
291
+ *
292
+ * @property {boolean} [showBackgroundImages=false] - _Updatable._
293
+ * Platforms Only. If true, will show background images in the layout when the Views are hidden.
294
+ * This occurs when the window is resizing or a tab is being dragged within the layout.
295
+ *
296
+ * @property {boolean} [showTaskbarIcon=true] - _Updatable._ _Windows_.
297
+ * A flag to show the window's icon in the taskbar.
298
+ *
299
+ * @property {boolean} [smallWindow=false]
300
+ * A flag to specify a frameless window that can be be created and resized to less than 41x36 px (width x height).
301
+ * _Note: Caveats of small windows are no Aero Snap and drag to/from maximize._
302
+ * _Windows 10: Requires `maximizable` to be false. Resizing with the mouse is only possible down to 38x39 px._
303
+ *
304
+ * @property {string} [state="normal"]
305
+ * The visible state of the window on creation.
306
+ * One of:
307
+ * * `"maximized"`
308
+ * * `"minimized"`
309
+ * * `"normal"`
310
+ *
311
+ * @property {string} [taskbarIcon=string] - Deprecated - use `icon` instead._Windows_.
312
+ *
313
+ * @property {string} [taskbarIconGroup=<application uuid>] - _Windows_.
314
+ * Specify a taskbar group for the window.
315
+ * _If omitted, defaults to app's uuid (`fin.Application.getCurrentSync().identity.uuid`)._
316
+ *
317
+ * @property {string} [url="about:blank"]
318
+ * The URL of the window.
319
+ *
320
+ * @property {string} [uuid=<application uuid>]
321
+ * The `uuid` of the application, unique within the set of all `Application`s running in OpenFin Runtime.
322
+ * If omitted, defaults to the `uuid` of the application spawning the window.
323
+ * If given, must match the `uuid` of the application spawning the window.
324
+ * In other words, the application's `uuid` is the only acceptable value, but is the default, so there's
325
+ * really no need to provide it.
326
+ *
327
+ * @property {boolean} [waitForPageLoad=false]
328
+ * When set to `true`, the window will not appear until the `window` object's `load` event fires.
329
+ * When set to `false`, the window will appear immediately without waiting for content to be loaded.
330
+ */
331
+ /**
332
+ * @typedef {object} CapturePageOptions
333
+ * @property { Area } [area] The area of the window to be captured.
334
+ * @property { string } [format='png'] The format of the captured image. Can be 'png', 'jpg', or 'bmp'.
335
+ * @property { number } [quality=100] Number representing quality of JPEG image only. Between 0 - 100.
336
+ */
337
+ /**
338
+ * @typedef { object } Area
339
+ * @property { number } height Area's height
340
+ * @property { number } width Area's width
341
+ * @property { number } x X coordinate of area's starting point
342
+ * @property { number } y Y coordinate of area's starting point
343
+ */
344
+ /**
345
+ * @typedef {object} FindInPageOptions
346
+ * @property {boolean} [forward=true] Whether to search forward or backward.
347
+ * @property {boolean} [findNext=false] Whether to begin a new text finding session. Should be true for first requests, and false for subsequent requests. Defaults to false.
348
+ * @property {boolean} [matchCase=false] Whether search should be case-sensitive.
349
+ * @property {boolean} [wordStart=false] Whether to look only at the start of words.
350
+ * @property {boolean} [medialCapitalAsWordStart=false]
351
+ * When combined with wordStart, accepts a match in the middle of a word if the match begins with an uppercase letter followed by a<br>
352
+ * lowercase or non-letter. Accepts several other intra-word matches.
353
+ */
354
+ /**
355
+ * @typedef {object} Transition
356
+ * @property {Opacity} opacity - The Opacity transition
357
+ * @property {Position} position - The Position transition
358
+ * @property {Size} size - The Size transition
359
+ */
360
+ /**
361
+ * @typedef {object} TransitionOptions
362
+ * @property {boolean} interrupt - This option interrupts the current animation. When false it pushes
363
+ this animation onto the end of the animation queue.
364
+ * @property {boolean} relative - Treat 'opacity' as absolute or as a delta. Defaults to false.
365
+ */
366
+ /**
367
+ * @typedef {object} Size
368
+ * @property {number} duration - The total time in milliseconds this transition should take.
369
+ * @property {boolean} relative - Treat 'opacity' as absolute or as a delta. Defaults to false.
370
+ * @property {number} width - Optional if height is present. Defaults to the window's current width.
371
+ * @property {number} height - Optional if width is present. Defaults to the window's current height.
372
+ */
373
+ /**
374
+ * @typedef {object} Position
375
+ * @property {number} duration - The total time in milliseconds this transition should take.
376
+ * @property {boolean} relative - Treat 'opacity' as absolute or as a delta. Defaults to false.
377
+ * @property {number} left - Defaults to the window's current left position in virtual screen coordinates.
378
+ * @property {number} top - Defaults to the window's current top position in virtual screen coordinates.
379
+ */
380
+ /**
381
+ * @typedef {object} Opacity
382
+ * @property {number} duration - The total time in milliseconds this transition should take.
383
+ * @property {boolean} relative - Treat 'opacity' as absolute or as a delta. Defaults to false.
384
+ * @property {number} opacity - This value is clamped from 0.0 to 1.0.
385
+ */
386
+ /**
387
+ * Bounds is a interface that has the properties of height,
388
+ * width, left, top which are all numbers
389
+ * @typedef { object } Bounds
390
+ * @property { number } height Get the application height bound
391
+ * @property { number } width Get the application width bound
392
+ * @property { number } top Get the application top bound
393
+ * @property { number } left Get the application left bound
394
+ * @property { number } right Get the application right bound
395
+ * @property { number } bottom Get the application bottom bound
396
+ */
397
+ /**
398
+ * @classdesc A basic window that wraps a native HTML window. Provides more fine-grained
399
+ * control over the window state such as the ability to minimize, maximize, restore, etc.
400
+ * By default a window does not show upon instantiation; instead the window's show() method
401
+ * must be invoked manually. The new window appears in the same process as the parent window.
402
+ * It has the ability to listen for <a href="tutorial-Window.EventEmitter.html">window specific events</a>.
403
+ * @class
404
+ * @alias Window
405
+ * @hideconstructor
406
+ */
407
+ export declare class _Window extends WebContents<WindowEvents> {
408
+ identity: OpenFin.Identity;
409
+ constructor(wire: Transport, identity: OpenFin.Identity);
410
+ /**
411
+ * Adds a listener to the end of the listeners array for the specified event.
412
+ * @param { string | symbol } eventType - The type of the event.
413
+ * @param { Function } listener - Called whenever an event of the specified type occurs.
414
+ * @param { SubOptions } [options] - Option to support event timestamps.
415
+ * @return {Promise.<this>}
416
+ * @function addListener
417
+ * @memberof Window
418
+ * @instance
419
+ * @tutorial Window.EventEmitter
420
+ */
421
+ /**
422
+ * Adds a listener to the end of the listeners array for the specified event.
423
+ * @param { string | symbol } eventType - The type of the event.
424
+ * @param { Function } listener - Called whenever an event of the specified type occurs.
425
+ * @param { SubOptions } [options] - Option to support event timestamps.
426
+ * @return {Promise.<this>}
427
+ * @function on
428
+ * @memberof Window
429
+ * @instance
430
+ * @tutorial Window.EventEmitter
431
+ */
432
+ /**
433
+ * Adds a one time listener for the event. The listener is invoked only the first time the event is fired, after which it is removed.
434
+ * @param { string | symbol } eventType - The type of the event.
435
+ * @param { Function } listener - The callback function.
436
+ * @param { SubOptions } [options] - Option to support event timestamps.
437
+ * @return {Promise.<this>}
438
+ * @function once
439
+ * @memberof Window
440
+ * @instance
441
+ * @tutorial Window.EventEmitter
442
+ */
443
+ /**
444
+ * Adds a listener to the beginning of the listeners array for the specified event.
445
+ * @param { string | symbol } eventType - The type of the event.
446
+ * @param { Function } listener - The callback function.
447
+ * @param { SubOptions } [options] - Option to support event timestamps.
448
+ * @return {Promise.<this>}
449
+ * @function prependListener
450
+ * @memberof Window
451
+ * @instance
452
+ * @tutorial Window.EventEmitter
453
+ */
454
+ /**
455
+ * Adds a one time listener for the event. The listener is invoked only the first time the event is fired, after which it is removed.
456
+ * The listener is added to the beginning of the listeners array.
457
+ * @param { string | symbol } eventType - The type of the event.
458
+ * @param { Function } listener - The callback function.
459
+ * @param { SubOptions } [options] - Option to support event timestamps.
460
+ * @return {Promise.<this>}
461
+ * @function prependOnceListener
462
+ * @memberof Window
463
+ * @instance
464
+ * @tutorial Window.EventEmitter
465
+ */
466
+ /**
467
+ * Remove a listener from the listener array for the specified event.
468
+ * Caution: Calling this method changes the array indices in the listener array behind the listener.
469
+ * @param { string | symbol } eventType - The type of the event.
470
+ * @param { Function } listener - The callback function.
471
+ * @param { SubOptions } [options] - Option to support event timestamps.
472
+ * @return {Promise.<this>}
473
+ * @function removeListener
474
+ * @memberof Window
475
+ * @instance
476
+ * @tutorial Window.EventEmitter
477
+ */
478
+ /**
479
+ * Removes all listeners, or those of the specified event.
480
+ * @param { string | symbol } [eventType] - The type of the event.
481
+ * @return {Promise.<this>}
482
+ * @function removeAllListeners
483
+ * @memberof Window
484
+ * @instance
485
+ * @tutorial Window.EventEmitter
486
+ */
487
+ /**
488
+ * Gets a base64 encoded image of the window or a part of it.
489
+ * @function capturePage
490
+ * @param { CapturePageOptions } [options] options for capturePage call.
491
+ * @return {Promise.<string>}
492
+ * @memberof Window
493
+ * @instance
494
+ * @tutorial Window.capturePage
495
+ */
496
+ /**
497
+ * Executes Javascript on the window, restricted to windows you own or windows owned by
498
+ * applications you have created.
499
+ * @param { string } code JavaScript code to be executed on the window.
500
+ * @function executeJavaScript
501
+ * @memberOf Window
502
+ * @instance
503
+ * @return {Promise.<void>}
504
+ * @tutorial Window.executeJavaScript
505
+ */
506
+ /**
507
+ * Gives focus to the window.
508
+ * @return {Promise.<void>}
509
+ * @function focus
510
+ * @emits focused
511
+ * @memberOf Window
512
+ * @instance
513
+ * @tutorial Window.focus
514
+ */
515
+ /**
516
+ * Returns the zoom level of the window.
517
+ * @function getZoomLevel
518
+ * @memberOf Window
519
+ * @instance
520
+ * @return {Promise.<number>}
521
+ * @tutorial Window.getZoomLevel
522
+ */
523
+ /**
524
+ * Sets the zoom level of the window.
525
+ * @param { number } level The zoom level
526
+ * @function setZoomLevel
527
+ * @memberOf Window
528
+ * @instance
529
+ * @return {Promise.<void>}
530
+ * @tutorial Window.setZoomLevel
531
+ */
532
+ /**
533
+ * Find and highlight text on a page.
534
+ * @param { string } searchTerm Term to find in page
535
+ * @param { FindInPageOptions } options Search options
536
+ * @function findInPage
537
+ * @memberOf Window
538
+ * @instance
539
+ * @return {Promise.<number>}
540
+ * @tutorial Window.findInPage
541
+ */
542
+ /**
543
+ * Stops any findInPage call with the provided action.
544
+ * @param {string} action
545
+ * Action to execute when stopping a find in page:<br>
546
+ * "clearSelection" - Clear the selection.<br>
547
+ * "keepSelection" - Translate the selection into a normal selection.<br>
548
+ * "activateSelection" - Focus and click the selection node.<br>
549
+ * @function stopFindInPage
550
+ * @memberOf Window
551
+ * @instance
552
+ * @return {Promise.<void>}
553
+ * @tutorial Window.stopFindInPage
554
+ */
555
+ /**
556
+ * Navigates the window to a specified URL. The url must contain the protocol prefix such as http:// or https://.
557
+ * @param {string} url - The URL to navigate the window to.
558
+ * @function navigate
559
+ * @memberOf Window
560
+ * @instance
561
+ * @return {Promise.<void>}
562
+ * @tutorial Window.navigate
563
+ */
564
+ /**
565
+ * Navigates the window back one page.
566
+ * @function navigateBack
567
+ * @memberOf Window
568
+ * @instance
569
+ * @return {Promise.<void>}
570
+ * @tutorial Window.navigateBack
571
+ */
572
+ /**
573
+ * Navigates the window forward one page.
574
+ * @function navigateForward
575
+ * @memberOf Window
576
+ * @instance
577
+ * @return {Promise.<void>}
578
+ * @tutorial Window.navigateForward
579
+ */
580
+ /**
581
+ * Stops any current navigation the window is performing.
582
+ * @function stopNavigation
583
+ * @memberOf Window
584
+ * @instance
585
+ * @return {Promise.<void>}
586
+ * @tutorial Window.stopNavigation
587
+ */
588
+ /**
589
+ * Reloads the window current page
590
+ * @function reload
591
+ * @memberOf Window
592
+ * @instance
593
+ * @return {Promise.<void>}
594
+ * @tutorial Window.reload
595
+ */
596
+ /**
597
+ * Prints the window's web page
598
+ * @param { PrintOptions } [options] Printer Options
599
+ * @function print
600
+ * @memberOf Window
601
+ * @instance
602
+ * @return {Promise.<void>}
603
+ * @tutorial Window.print
604
+ */
605
+ /**
606
+ * Returns an array with all system printers
607
+ * @function getPrinters
608
+ * @memberOf Window
609
+ * @instance
610
+ * @return { Promise.Array.<PrinterInfo> }
611
+ * @tutorial Window.getPrinters
612
+ */
613
+ /**
614
+ * Retrieves the process information associated with a window.
615
+ * @function getProcessInfo
616
+ * @memberOf Window
617
+ * @instance
618
+ * @return {Promise.<EntityProcessDetails>}
619
+ * @tutorial Window.getProcessInfo
620
+ */
621
+ /**
622
+ * Retrieves information on all Shared Workers.
623
+ * @function getSharedWorkers
624
+ * @memberOf Window
625
+ * @instance
626
+ * @return {Promise.Array.<SharedWorkerInfo>}
627
+ * @tutorial Window.getSharedWorkers
628
+ */
629
+ /**
630
+ * Opens the developer tools for the shared worker context.
631
+ * @function inspectSharedWorker
632
+ * @memberOf Window
633
+ * @instance
634
+ * @return {Promise.<void>}
635
+ * @tutorial Window.inspectSharedWorker
636
+ */
637
+ /**
638
+ * Inspects the shared worker based on its ID.
639
+ * @param { string } workerId - The id of the shared worker.
640
+ * @function inspectSharedWorkerById
641
+ * @memberOf Window
642
+ * @instance
643
+ * @return {Promise.<void>}
644
+ * @tutorial Window.inspectSharedWorkerById
645
+ */
646
+ /**
647
+ * Opens the developer tools for the service worker context.
648
+ * @function inspectServiceWorker
649
+ * @memberOf Window
650
+ * @instance
651
+ * @return {Promise.<void>}
652
+ * @tutorial Window.inspectServiceWorker
653
+ */
654
+ createWindow(options: OpenFin.WindowCreationOptions): Promise<OpenFin.Window>;
655
+ /**
656
+ * Retrieves an array of frame info objects representing the main frame and any
657
+ * iframes that are currently on the page.
658
+ * @return {Promise.<Array<FrameInfo>>}
659
+ * @tutorial Window.getAllFrames
660
+ */
661
+ getAllFrames(): Promise<Array<OpenFin.FrameInfo>>;
662
+ /**
663
+ * Gets the current bounds (top, bottom, right, left, width, height) of the window.
664
+ * @return {Promise.<Bounds>}
665
+ * @tutorial Window.getBounds
666
+ */
667
+ getBounds(): Promise<OpenFin.WindowBounds>;
668
+ /**
669
+ * Centers the window on its current screen.
670
+ * @return {Promise.<void>}
671
+ * @tutorial Window.center
672
+ */
673
+ center(): Promise<void>;
674
+ /**
675
+ * Removes focus from the window.
676
+ * @return {Promise.<void>}
677
+ * @tutorial Window.blur
678
+ */
679
+ blur(): Promise<void>;
680
+ /**
681
+ * Brings the window to the front of the window stack.
682
+ * @return {Promise.<void>}
683
+ * @tutorial Window.bringToFront
684
+ */
685
+ bringToFront(): Promise<void>;
686
+ /**
687
+ * Performs the specified window transitions.
688
+ * @param {Transition} transitions - Describes the animations to perform. See the tutorial.
689
+ * @param {TransitionOptions} options - Options for the animation. See the tutorial.
690
+ * @return {Promise.<void>}
691
+ * @tutorial Window.animate
692
+ */
693
+ animate(transitions: OpenFin.Transition, options: OpenFin.TransitionOptions): Promise<void>;
694
+ /**
695
+ * Hides the window.
696
+ * @return {Promise.<void>}
697
+ * @tutorial Window.hide
698
+ */
699
+ hide(): Promise<void>;
700
+ /**
701
+ * closes the window application
702
+ * @param { boolean } [force = false] Close will be prevented from closing when force is false and
703
+ * ‘close-requested’ has been subscribed to for application’s main window.
704
+ * @return {Promise.<void>}
705
+ * @tutorial Window.close
706
+ */
707
+ close(force?: boolean): Promise<void>;
708
+ focusedWebViewWasChanged(): Promise<void>;
709
+ /**
710
+ * Returns the native OS level Id.
711
+ * In Windows, it will return the Windows [handle](https://docs.microsoft.com/en-us/windows/desktop/WinProg/windows-data-types#HWND).
712
+ * @return {Promise.<string>}
713
+ * @tutorial Window.getNativeId
714
+ */
715
+ getNativeId(): Promise<string>;
716
+ /**
717
+ * Retrieves window's attached views.
718
+ * @experimental
719
+ * @return {Promise.Array.<View>}
720
+ * @tutorial Window.getCurrentViews
721
+ */
722
+ getCurrentViews(): Promise<OpenFin.View[]>;
723
+ disableFrame(): Promise<void>;
724
+ /**
725
+ * Prevents a user from changing a window's size/position when using the window's frame.
726
+ * @return {Promise.<void>}
727
+ * @tutorial Window.disableUserMovement
728
+ */
729
+ disableUserMovement(): Promise<void>;
730
+ enableFrame(): Promise<void>;
731
+ /**
732
+ * Re-enables user changes to a window's size/position when using the window's frame.
733
+ * @return {Promise.<void>}
734
+ * @tutorial Window.enableUserMovement
735
+ */
736
+ enableUserMovement(): Promise<void>;
737
+ /**
738
+ * Flashes the window’s frame and taskbar icon until stopFlashing is called or until a focus event is fired.
739
+ * @return {Promise.<void>}
740
+ * @tutorial Window.flash
741
+ */
742
+ flash(): Promise<void>;
743
+ /**
744
+ * Stops the taskbar icon from flashing.
745
+ * @return {Promise.<void>}
746
+ * @tutorial Window.stopFlashing
747
+ */
748
+ stopFlashing(): Promise<void>;
749
+ /**
750
+ * Gets an information object for the window.
751
+ * @return {Promise.<WindowInfo>}
752
+ * @tutorial Window.getInfo
753
+ */
754
+ getInfo(): Promise<WindowInfo>;
755
+ /**
756
+ * Retrieves the window's Layout
757
+ * @return {Promise.<Layout>}
758
+ * @tutorial Window.getLayout
759
+ * @experimental
760
+ */
761
+ getLayout(): Promise<OpenFin.Layout>;
762
+ /**
763
+ * Gets the current settings of the window.
764
+ * @return {Promise.<any>}
765
+ * @tutorial Window.getOptions
766
+ */
767
+ getOptions(): Promise<OpenFin.WindowOptions>;
768
+ /**
769
+ * Gets the parent application.
770
+ * @return {Promise.<Application>}
771
+ * @tutorial Window.getParentApplication
772
+ */
773
+ getParentApplication(): Promise<OpenFin.Application>;
774
+ /**
775
+ * Gets the parent window.
776
+ * @return {Promise.<_Window>}
777
+ * @tutorial Window.getParentWindow
778
+ */
779
+ getParentWindow(): Promise<OpenFin.Window>;
780
+ /**
781
+ * ***DEPRECATED - please use Window.capturePage.***
782
+ * Gets a base64 encoded PNG image of the window or just part a of it.
783
+ * @param { Area } [area] The area of the window to be captured.
784
+ * Omitting it will capture the whole visible window.
785
+ * @return {Promise.<string>}
786
+ * @tutorial Window.capturePage
787
+ */
788
+ getSnapshot(area?: OpenFin.Rectangle): Promise<string>;
789
+ /**
790
+ * Gets the current state ("minimized", "maximized", or "restored") of the window.
791
+ * @return {Promise.<string>}
792
+ * @tutorial Window.getState
793
+ */
794
+ getState(): Promise<'minimized' | 'maximized' | 'normal'>;
795
+ /**
796
+ * Previously called getNativeWindow.
797
+ * Returns the [Window Object](https://developer.mozilla.org/en-US/docs/Web/API/Window)
798
+ * that represents the web context of the target window. This is the same object that
799
+ * you would get from calling [window.open()](https://developer.mozilla.org/en-US/docs/Web/API/Window/open) in a standard web context.
800
+ * The target window needs to be in the same application as the requesting window
801
+ * as well as comply with [same-origin](https://developer.mozilla.org/en-US/docs/Web/Security/Same-origin_policy) policy requirements.
802
+ * @return {object}
803
+ * @tutorial Window.getWebWindow
804
+ */
805
+ getWebWindow(): Window;
806
+ /**
807
+ * Determines if the window is a main window.
808
+ * @return {boolean}
809
+ * @tutorial Window.isMainWindow
810
+ */
811
+ isMainWindow(): boolean;
812
+ /**
813
+ * Determines if the window is currently showing.
814
+ * @return {Promise.<boolean>}
815
+ * @tutorial Window.isShowing
816
+ */
817
+ isShowing(): Promise<boolean>;
818
+ /**
819
+ * Maximizes the window
820
+ * @return {Promise.<void>}
821
+ * @tutorial Window.maximize
822
+ */
823
+ maximize(): Promise<void>;
824
+ /**
825
+ * Minimizes the window.
826
+ * @return {Promise.<void>}
827
+ * @tutorial Window.minimize
828
+ */
829
+ minimize(): Promise<void>;
830
+ /**
831
+ * Moves the window by a specified amount.
832
+ * @param { number } deltaLeft The change in the left position of the window
833
+ * @param { number } deltaTop The change in the top position of the window
834
+ * @return {Promise.<void>}
835
+ * @tutorial Window.moveBy
836
+ */
837
+ moveBy(deltaLeft: number, deltaTop: number): Promise<void>;
838
+ /**
839
+ * Moves the window to a specified location.
840
+ * @param { number } left The left position of the window
841
+ * @param { number } top The top position of the window
842
+ * @return {Promise.<void>}
843
+ * @tutorial Window.moveTo
844
+ */
845
+ moveTo(left: number, top: number): Promise<void>;
846
+ /**
847
+ * Resizes the window by a specified amount.
848
+ * @param { number } deltaWidth The change in the width of the window
849
+ * @param { number } deltaHeight The change in the height of the window
850
+ * @param { AnchorType } anchor Specifies a corner to remain fixed during the resize.
851
+ * Can take the values: "top-left", "top-right", "bottom-left", or "bottom-right".
852
+ * If undefined, the default is "top-left"
853
+ * @return {Promise.<void>}
854
+ * @tutorial Window.resizeBy
855
+ */
856
+ resizeBy(deltaWidth: number, deltaHeight: number, anchor: OpenFin.AnchorType): Promise<void>;
857
+ /**
858
+ * Resizes the window to the specified dimensions.
859
+ * @param { number } width The change in the width of the window
860
+ * @param { number } height The change in the height of the window
861
+ * @param { AnchorType } anchor Specifies a corner to remain fixed during the resize.
862
+ * Can take the values: "top-left", "top-right", "bottom-left", or "bottom-right".
863
+ * If undefined, the default is "top-left"
864
+ * @return {Promise.<void>}
865
+ * @tutorial Window.resizeTo
866
+ */
867
+ resizeTo(width: number, height: number, anchor: OpenFin.AnchorType): Promise<void>;
868
+ /**
869
+ * Restores the window to its normal state (i.e., unminimized, unmaximized).
870
+ * @return {Promise.<void>}
871
+ * @tutorial Window.restore
872
+ */
873
+ restore(): Promise<void>;
874
+ /**
875
+ * Will bring the window to the front of the entire stack and give it focus.
876
+ * @return {Promise.<void>}
877
+ * @tutorial Window.setAsForeground
878
+ */
879
+ setAsForeground(): Promise<void>;
880
+ /**
881
+ * Sets the window's size and position.
882
+ * @property { Bounds } bounds This is a * @type {string} name - name of the window.object that holds the propertys of
883
+ * @return {Promise.<void>}
884
+ * @tutorial Window.setBounds
885
+ */
886
+ setBounds(bounds: Partial<OpenFin.Bounds>): Promise<void>;
887
+ /**
888
+ * Shows the window if it is hidden.
889
+ * @param { boolean } [force = false] Show will be prevented from showing when force is false and
890
+ * ‘show-requested’ has been subscribed to for application’s main window.
891
+ * @return {Promise.<void>}
892
+ * @tutorial Window.show
893
+ */
894
+ show(force?: boolean): Promise<void>;
895
+ /**
896
+ * Shows the window if it is hidden at the specified location.
897
+ * If the toggle parameter is set to true, the window will
898
+ * alternate between showing and hiding.
899
+ * @param { number } left The left position of the window
900
+ * @param { number } top The right position of the window
901
+ * @param { boolean } force Show will be prevented from closing when force is false and
902
+ * ‘show-requested’ has been subscribed to for application’s main window
903
+ * @return {Promise.<void>}
904
+ * @tutorial Window.showAt
905
+ */
906
+ showAt(left: number, top: number, force?: boolean): Promise<void>;
907
+ /**
908
+ * Shows the Chromium Developer Tools
909
+ * @return {Promise.<void>}
910
+ * @tutorial Window.showDeveloperTools
911
+ */
912
+ /**
913
+ * Updates the window using the passed options.
914
+ * Values that are objects are deep-merged, overwriting only the values that are provided.
915
+ * @param {*} options Changes a window's options that were defined upon creation. See tutorial
916
+ * @return {Promise.<void>}
917
+ * @tutorial Window.updateOptions
918
+ */
919
+ updateOptions(options: Partial<OpenFin.WindowUpdatableOptions>): Promise<void>;
920
+ /**
921
+ * Provides credentials to authentication requests
922
+ * @param { string } userName userName to provide to the authentication challenge
923
+ * @param { string } password password to provide to the authentication challenge
924
+ * @return {Promise.<void>}
925
+ * @tutorial Window.authenticate
926
+ */
927
+ authenticate(userName: string, password: string): Promise<void>;
928
+ /**
929
+ * @typedef {object} ShowPopupMenuOptions
930
+ * @property {Array<MenuItemTemplate>} template - An array describing the menu to show.
931
+ * @property {number} [x] - The window x coordinate where to show the menu. Defaults to mouse position. If using must also use `y`.
932
+ * @property {number} [y] - The window y coordinate where to show the menu. Defaults to mouse position. If using must also use `x`
933
+ */
934
+ /**
935
+ * @typedef {object} MenuItemTemplate
936
+ * @property {*} data Data to be returned if the user selects the element. Must be serializable. Large objects can have a performance impact.
937
+ * @property {'normal' | 'separator' | 'submenu' | 'checkbox'} [type] - Defaults to 'normal' unless a 'submenu' key exists
938
+ * @property {string} [label] - The text to show on the menu item. Should be left undefined for `type: 'separator'`
939
+ * @property {boolean} [enabled] - If false, the menu item will be greyed out and unclickable.
940
+ * @property {boolean} [visible] - If false, the menu item will be entirely hidden.
941
+ * @property {boolean} [checked] - Should only be specified for `checkbox` type menu items.
942
+ * @property {Array<MenuItemTemplate>} [submenu] Should be specified for `submenu` type menu items. If `submenu` is specified, the `type: 'submenu'` can be omitted.
943
+ */
944
+ /**
945
+ * @typedef {object} MenuResult
946
+ * @property {'clicked' | 'closed'} result - Whether the user clicked on a menu item or the menu was closed (user clicked elsewhere).
947
+ * @property {* | undefined} [data] - The data property of the menu item clicked by the user. Only defined if result was `clicked`.
948
+ */
949
+ /**
950
+ * Shows a menu on the window. Returns a promise that resolves when the user has either selected an item or closed the menu. (This may take longer than other apis).
951
+ * Resolves to an object with `{result: 'clicked', data }` where data is the data field on the menu item clicked, or `{result 'closed'}` when the user doesn't select anything.
952
+ * Calling this method will close previously opened menus.
953
+ * @experimental
954
+ * @param {ShowPopupMenuOptions} options
955
+ * @return {Promise<MenuResult>}
956
+ * @tutorial Window.showPopupMenu
957
+ */
958
+ showPopupMenu(options: OpenFin.ShowPopupMenuOptions): Promise<OpenFin.MenuResult>;
959
+ /**
960
+ * Closes the window's popup menu, if one exists.
961
+ * @experimental
962
+ * @return {Promise<void>}
963
+ * @tutorial Window.closePopupMenu
964
+ */
965
+ closePopupMenu(): Promise<void>;
966
+ }