@openfin/core 33.76.36 → 33.77.1

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 (271) hide show
  1. package/OpenFin.d.ts +1 -1
  2. package/README.md +29 -4
  3. package/fin.d.ts +2 -2
  4. package/{src → out}/GlobalOpenFin.d.ts +1 -1
  5. package/out/mock-alpha.d.ts +16112 -0
  6. package/out/mock-beta.d.ts +16112 -0
  7. package/out/mock-public.d.ts +16112 -0
  8. package/out/mock.d.ts +16797 -0
  9. package/out/mock.js +17111 -0
  10. package/package.json +30 -23
  11. package/LICENSE +0 -13
  12. package/NOTICE +0 -16
  13. package/openfin-core-33.76.36.tgz +0 -0
  14. package/src/OpenFin.d.ts +0 -3091
  15. package/src/OpenFin.js +0 -2
  16. package/src/api/api-exposer/api-consumer.d.ts +0 -28
  17. package/src/api/api-exposer/api-consumer.js +0 -28
  18. package/src/api/api-exposer/api-exposer.d.ts +0 -35
  19. package/src/api/api-exposer/api-exposer.js +0 -38
  20. package/src/api/api-exposer/decorators.d.ts +0 -10
  21. package/src/api/api-exposer/decorators.js +0 -18
  22. package/src/api/api-exposer/index.d.ts +0 -4
  23. package/src/api/api-exposer/index.js +0 -20
  24. package/src/api/api-exposer/strategies/index.d.ts +0 -1
  25. package/src/api/api-exposer/strategies/index.js +0 -17
  26. package/src/api/api-exposer/strategies/openfin-channels/channels-consumer.d.ts +0 -14
  27. package/src/api/api-exposer/strategies/openfin-channels/channels-consumer.js +0 -20
  28. package/src/api/api-exposer/strategies/openfin-channels/channels-exposer.d.ts +0 -20
  29. package/src/api/api-exposer/strategies/openfin-channels/channels-exposer.js +0 -23
  30. package/src/api/api-exposer/strategies/openfin-channels/index.d.ts +0 -2
  31. package/src/api/api-exposer/strategies/openfin-channels/index.js +0 -18
  32. package/src/api/application/Factory.d.ts +0 -196
  33. package/src/api/application/Factory.js +0 -278
  34. package/src/api/application/Instance.d.ts +0 -692
  35. package/src/api/application/Instance.js +0 -821
  36. package/src/api/application/index.d.ts +0 -12
  37. package/src/api/application/index.js +0 -28
  38. package/src/api/base.d.ts +0 -117
  39. package/src/api/base.js +0 -246
  40. package/src/api/clipboard/index.d.ts +0 -172
  41. package/src/api/clipboard/index.js +0 -200
  42. package/src/api/events/application.d.ts +0 -158
  43. package/src/api/events/application.js +0 -14
  44. package/src/api/events/base.d.ts +0 -42
  45. package/src/api/events/base.js +0 -2
  46. package/src/api/events/channel.d.ts +0 -35
  47. package/src/api/events/channel.js +0 -7
  48. package/src/api/events/emitterMap.d.ts +0 -11
  49. package/src/api/events/emitterMap.js +0 -35
  50. package/src/api/events/eventAggregator.d.ts +0 -5
  51. package/src/api/events/eventAggregator.js +0 -35
  52. package/src/api/events/externalApplication.d.ts +0 -24
  53. package/src/api/events/externalApplication.js +0 -7
  54. package/src/api/events/frame.d.ts +0 -35
  55. package/src/api/events/frame.js +0 -2
  56. package/src/api/events/globalHotkey.d.ts +0 -25
  57. package/src/api/events/globalHotkey.js +0 -2
  58. package/src/api/events/platform.d.ts +0 -34
  59. package/src/api/events/platform.js +0 -10
  60. package/src/api/events/system.d.ts +0 -126
  61. package/src/api/events/system.js +0 -15
  62. package/src/api/events/typedEventEmitter.d.ts +0 -20
  63. package/src/api/events/typedEventEmitter.js +0 -2
  64. package/src/api/events/view.d.ts +0 -92
  65. package/src/api/events/view.js +0 -12
  66. package/src/api/events/webcontents.d.ts +0 -277
  67. package/src/api/events/webcontents.js +0 -13
  68. package/src/api/events/window.d.ts +0 -421
  69. package/src/api/events/window.js +0 -12
  70. package/src/api/external-application/Factory.d.ts +0 -34
  71. package/src/api/external-application/Factory.js +0 -47
  72. package/src/api/external-application/Instance.d.ts +0 -110
  73. package/src/api/external-application/Instance.js +0 -117
  74. package/src/api/external-application/index.d.ts +0 -12
  75. package/src/api/external-application/index.js +0 -28
  76. package/src/api/fin.d.ts +0 -54
  77. package/src/api/fin.js +0 -45
  78. package/src/api/frame/Factory.d.ts +0 -54
  79. package/src/api/frame/Factory.js +0 -86
  80. package/src/api/frame/Instance.d.ts +0 -136
  81. package/src/api/frame/Instance.js +0 -143
  82. package/src/api/frame/index.d.ts +0 -14
  83. package/src/api/frame/index.js +0 -30
  84. package/src/api/global-hotkey/index.d.ts +0 -106
  85. package/src/api/global-hotkey/index.js +0 -132
  86. package/src/api/interappbus/channel/channel.d.ts +0 -285
  87. package/src/api/interappbus/channel/channel.js +0 -334
  88. package/src/api/interappbus/channel/channels-docs.d.ts +0 -342
  89. package/src/api/interappbus/channel/channels-docs.js +0 -401
  90. package/src/api/interappbus/channel/client.d.ts +0 -117
  91. package/src/api/interappbus/channel/client.js +0 -181
  92. package/src/api/interappbus/channel/connection-manager.d.ts +0 -29
  93. package/src/api/interappbus/channel/connection-manager.js +0 -246
  94. package/src/api/interappbus/channel/index.d.ts +0 -189
  95. package/src/api/interappbus/channel/index.js +0 -333
  96. package/src/api/interappbus/channel/protocols/classic/message-receiver.d.ts +0 -13
  97. package/src/api/interappbus/channel/protocols/classic/message-receiver.js +0 -73
  98. package/src/api/interappbus/channel/protocols/classic/strategy.d.ts +0 -24
  99. package/src/api/interappbus/channel/protocols/classic/strategy.js +0 -101
  100. package/src/api/interappbus/channel/protocols/combined/strategy.d.ts +0 -20
  101. package/src/api/interappbus/channel/protocols/combined/strategy.js +0 -58
  102. package/src/api/interappbus/channel/protocols/index.d.ts +0 -47
  103. package/src/api/interappbus/channel/protocols/index.js +0 -2
  104. package/src/api/interappbus/channel/protocols/protocol-manager.d.ts +0 -10
  105. package/src/api/interappbus/channel/protocols/protocol-manager.js +0 -43
  106. package/src/api/interappbus/channel/protocols/rtc/endpoint.d.ts +0 -25
  107. package/src/api/interappbus/channel/protocols/rtc/endpoint.js +0 -141
  108. package/src/api/interappbus/channel/protocols/rtc/ice-manager.d.ts +0 -30
  109. package/src/api/interappbus/channel/protocols/rtc/ice-manager.js +0 -130
  110. package/src/api/interappbus/channel/protocols/rtc/strategy.d.ts +0 -24
  111. package/src/api/interappbus/channel/protocols/rtc/strategy.js +0 -85
  112. package/src/api/interappbus/channel/protocols/strategy-types.d.ts +0 -13
  113. package/src/api/interappbus/channel/protocols/strategy-types.js +0 -2
  114. package/src/api/interappbus/channel/protocols/strategy.d.ts +0 -17
  115. package/src/api/interappbus/channel/protocols/strategy.js +0 -2
  116. package/src/api/interappbus/channel/provider.d.ts +0 -206
  117. package/src/api/interappbus/channel/provider.js +0 -338
  118. package/src/api/interappbus/index.d.ts +0 -120
  119. package/src/api/interappbus/index.js +0 -210
  120. package/src/api/interop/Factory.d.ts +0 -57
  121. package/src/api/interop/Factory.js +0 -96
  122. package/src/api/interop/InteropBroker.d.ts +0 -665
  123. package/src/api/interop/InteropBroker.js +0 -1313
  124. package/src/api/interop/InteropClient.d.ts +0 -502
  125. package/src/api/interop/InteropClient.js +0 -683
  126. package/src/api/interop/SessionContextGroupBroker.d.ts +0 -27
  127. package/src/api/interop/SessionContextGroupBroker.js +0 -108
  128. package/src/api/interop/SessionContextGroupClient.d.ts +0 -21
  129. package/src/api/interop/SessionContextGroupClient.js +0 -86
  130. package/src/api/interop/fdc3/PrivateChannelClient.d.ts +0 -20
  131. package/src/api/interop/fdc3/PrivateChannelClient.js +0 -90
  132. package/src/api/interop/fdc3/PrivateChannelProvider.d.ts +0 -55
  133. package/src/api/interop/fdc3/PrivateChannelProvider.js +0 -276
  134. package/src/api/interop/fdc3/documentationStub.d.ts +0 -14
  135. package/src/api/interop/fdc3/documentationStub.js +0 -17
  136. package/src/api/interop/fdc3/fdc3-1.2.d.ts +0 -205
  137. package/src/api/interop/fdc3/fdc3-1.2.js +0 -435
  138. package/src/api/interop/fdc3/fdc3-2.0.d.ts +0 -298
  139. package/src/api/interop/fdc3/fdc3-2.0.js +0 -479
  140. package/src/api/interop/fdc3/fdc3.d.ts +0 -12
  141. package/src/api/interop/fdc3/fdc3.js +0 -35
  142. package/src/api/interop/fdc3/overrideCheck.d.ts +0 -4
  143. package/src/api/interop/fdc3/overrideCheck.js +0 -32
  144. package/src/api/interop/fdc3/shapes/fdc3v1.d.ts +0 -53
  145. package/src/api/interop/fdc3/shapes/fdc3v1.js +0 -4
  146. package/src/api/interop/fdc3/shapes/fdc3v2.d.ts +0 -75
  147. package/src/api/interop/fdc3/shapes/fdc3v2.js +0 -2
  148. package/src/api/interop/fdc3/utils.d.ts +0 -45
  149. package/src/api/interop/fdc3/utils.js +0 -239
  150. package/src/api/interop/fdc3/versions.d.ts +0 -1
  151. package/src/api/interop/fdc3/versions.js +0 -2
  152. package/src/api/interop/index.d.ts +0 -12
  153. package/src/api/interop/index.js +0 -28
  154. package/src/api/interop/utils.d.ts +0 -18
  155. package/src/api/interop/utils.js +0 -61
  156. package/src/api/me.d.ts +0 -40
  157. package/src/api/me.js +0 -134
  158. package/src/api/platform/Factory.d.ts +0 -171
  159. package/src/api/platform/Factory.js +0 -240
  160. package/src/api/platform/Instance.d.ts +0 -653
  161. package/src/api/platform/Instance.js +0 -834
  162. package/src/api/platform/common-utils.d.ts +0 -7
  163. package/src/api/platform/common-utils.js +0 -16
  164. package/src/api/platform/index.d.ts +0 -12
  165. package/src/api/platform/index.js +0 -28
  166. package/src/api/platform/layout/Factory.d.ts +0 -91
  167. package/src/api/platform/layout/Factory.js +0 -151
  168. package/src/api/platform/layout/Instance.d.ts +0 -192
  169. package/src/api/platform/layout/Instance.js +0 -224
  170. package/src/api/platform/layout/controllers/layout-content-cache.d.ts +0 -9
  171. package/src/api/platform/layout/controllers/layout-content-cache.js +0 -54
  172. package/src/api/platform/layout/controllers/layout-entities-controller.d.ts +0 -119
  173. package/src/api/platform/layout/controllers/layout-entities-controller.js +0 -287
  174. package/src/api/platform/layout/entities/layout-entities.d.ts +0 -427
  175. package/src/api/platform/layout/entities/layout-entities.js +0 -504
  176. package/src/api/platform/layout/entities/shapes.d.ts +0 -6
  177. package/src/api/platform/layout/entities/shapes.js +0 -2
  178. package/src/api/platform/layout/index.d.ts +0 -11
  179. package/src/api/platform/layout/index.js +0 -27
  180. package/src/api/platform/layout/layout.constants.d.ts +0 -1
  181. package/src/api/platform/layout/layout.constants.js +0 -4
  182. package/src/api/platform/layout/shapes.d.ts +0 -16
  183. package/src/api/platform/layout/shapes.js +0 -2
  184. package/src/api/platform/layout/utils/layout-traversal.d.ts +0 -4
  185. package/src/api/platform/layout/utils/layout-traversal.js +0 -65
  186. package/src/api/platform/provider.d.ts +0 -510
  187. package/src/api/platform/provider.js +0 -2
  188. package/src/api/snapshot-source/Factory.d.ts +0 -53
  189. package/src/api/snapshot-source/Factory.js +0 -81
  190. package/src/api/snapshot-source/Instance.d.ts +0 -53
  191. package/src/api/snapshot-source/Instance.js +0 -154
  192. package/src/api/snapshot-source/index.d.ts +0 -12
  193. package/src/api/snapshot-source/index.js +0 -28
  194. package/src/api/snapshot-source/utils.d.ts +0 -2
  195. package/src/api/snapshot-source/utils.js +0 -6
  196. package/src/api/system/index.d.ts +0 -1468
  197. package/src/api/system/index.js +0 -1851
  198. package/src/api/view/Factory.d.ts +0 -88
  199. package/src/api/view/Factory.js +0 -141
  200. package/src/api/view/Instance.d.ts +0 -601
  201. package/src/api/view/Instance.js +0 -671
  202. package/src/api/view/index.d.ts +0 -12
  203. package/src/api/view/index.js +0 -28
  204. package/src/api/webcontents/main.d.ts +0 -922
  205. package/src/api/webcontents/main.js +0 -1046
  206. package/src/api/window/Factory.d.ts +0 -96
  207. package/src/api/window/Factory.js +0 -142
  208. package/src/api/window/Instance.d.ts +0 -1598
  209. package/src/api/window/Instance.js +0 -1851
  210. package/src/api/window/index.d.ts +0 -14
  211. package/src/api/window/index.js +0 -30
  212. package/src/browser.d.ts +0 -10
  213. package/src/browser.js +0 -36
  214. package/src/environment/browser.d.ts +0 -29
  215. package/src/environment/browser.js +0 -60
  216. package/src/environment/environment.d.ts +0 -33
  217. package/src/environment/environment.js +0 -4
  218. package/src/environment/mockEnvironment.d.ts +0 -27
  219. package/src/environment/mockEnvironment.js +0 -61
  220. package/src/environment/node-env.d.ts +0 -29
  221. package/src/environment/node-env.js +0 -72
  222. package/src/fdc3.d.ts +0 -3
  223. package/src/fdc3.js +0 -9
  224. package/src/mock.d.ts +0 -3
  225. package/src/mock.js +0 -18
  226. package/src/namespaces.d.ts +0 -22
  227. package/src/namespaces.js +0 -26
  228. package/src/shapes/ERROR_BOX_TYPES.d.ts +0 -1
  229. package/src/shapes/ERROR_BOX_TYPES.js +0 -2
  230. package/src/shapes/WebOptions.d.ts +0 -13
  231. package/src/shapes/WebOptions.js +0 -2
  232. package/src/shapes/WindowOptions.d.ts +0 -43
  233. package/src/shapes/WindowOptions.js +0 -2
  234. package/src/shapes/protocol.d.ts +0 -204
  235. package/src/shapes/protocol.js +0 -2
  236. package/src/transport/mockWire.d.ts +0 -11
  237. package/src/transport/mockWire.js +0 -26
  238. package/src/transport/transport-errors.d.ts +0 -31
  239. package/src/transport/transport-errors.js +0 -79
  240. package/src/transport/transport.d.ts +0 -73
  241. package/src/transport/transport.js +0 -219
  242. package/src/transport/wire.d.ts +0 -77
  243. package/src/transport/wire.js +0 -36
  244. package/src/util/asyncFilter.d.ts +0 -1
  245. package/src/util/asyncFilter.js +0 -7
  246. package/src/util/channel-api-relay.d.ts +0 -13
  247. package/src/util/channel-api-relay.js +0 -47
  248. package/src/util/errors.d.ts +0 -10
  249. package/src/util/errors.js +0 -12
  250. package/src/util/exhaustive.d.ts +0 -1
  251. package/src/util/exhaustive.js +0 -7
  252. package/src/util/http.d.ts +0 -11
  253. package/src/util/http.js +0 -90
  254. package/src/util/inaccessibleObject.d.ts +0 -2
  255. package/src/util/inaccessibleObject.js +0 -49
  256. package/src/util/lazy.d.ts +0 -34
  257. package/src/util/lazy.js +0 -54
  258. package/src/util/normalize-config.d.ts +0 -3
  259. package/src/util/normalize-config.js +0 -52
  260. package/src/util/promises.d.ts +0 -5
  261. package/src/util/promises.js +0 -27
  262. package/src/util/ref-counter.d.ts +0 -7
  263. package/src/util/ref-counter.js +0 -52
  264. package/src/util/reversible-map.d.ts +0 -11
  265. package/src/util/reversible-map.js +0 -49
  266. package/src/util/runtimeVersioning.d.ts +0 -3
  267. package/src/util/runtimeVersioning.js +0 -25
  268. package/src/util/utilTypes.d.ts +0 -8
  269. package/src/util/utilTypes.js +0 -2
  270. package/src/util/validate.d.ts +0 -3
  271. package/src/util/validate.js +0 -11
@@ -1,1598 +0,0 @@
1
- import type * as OpenFin from '../../OpenFin';
2
- import { Transport } from '../../transport/transport';
3
- import { WebContents } from '../webcontents/main';
4
- /**
5
- * @PORTED
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
- * @PORTED
18
- * @typedef { object } Dpi
19
- * @property { number } [horizontal] The horizontal dpi
20
- * @property { number } [vertical] The vertical dpi
21
- */
22
- /**
23
- * @PORTED
24
- * @typedef { object } PrintOptions
25
- * @property { boolean } [silent=false] Don't ask user for print settings.
26
- * @property { boolean } [printBackground=false] Prints the background color and image of the web page.
27
- * @property { string } [deviceName=''] Set the printer device name to use.
28
- * @property { boolean } [color=true] Set whether the printed web page will be in color or grayscale.
29
- * @property { Margins } [margins] Set margins for the printed web page
30
- * @property { boolean } [landscape=false] Whether the web page should be printed in landscape mode.
31
- * @property { number } [scaleFactor] The scale factor of the web page.
32
- * @property { number } [pagesPerSheet] The number of pages to print per page sheet.
33
- * @property { boolean } [collate] Whether the web page should be collated.
34
- * @property { number } [copies] The number of copies of the web page to print.
35
- * @property { Record<string, number> } [pageRanges] The page range to print. Should have two keys: from and to.
36
- * @property { string } [duplexMode] Set the duplex mode of the printed web page. Can be simplex, shortEdge, or longEdge.
37
- * @property { Dpi } [dpi] Set dpi for the printed web page
38
- */
39
- /**
40
- * @REMOVED
41
- * PrinterInfo interface
42
- * @typedef { object } PrinterInfo
43
- * @property { string } name Printer Name
44
- * @property { string } description Printer Description
45
- * @property { number } status Printer Status
46
- * @property { boolean } isDefault Indicates that system's default printer
47
- */
48
- /**
49
- * @REMOVED
50
- * SharedWorkerInfo interface
51
- * @typedef { object } SharedWorkerInfo
52
- * @property { string } id The unique id of the shared worker.
53
- * @property { string } url The url of the shared worker.
54
- */
55
- /**
56
- * @PORTED
57
- * ContentCreationRule interface
58
- * @typedef { object } ContentCreationRule
59
- * @property { string } behavior 'view' | 'window' | 'browser' | 'block'
60
- * @property { string[] } match List of [match patterns](https://developer.chrome.com/extensions/match_patterns).
61
- * @property { object } options Window creation options or View creation options.
62
- */
63
- /**
64
- * @PORTED
65
- * @typedef {object} Window~options
66
- * @summary Window creation options.
67
- * @desc This is the options object required by {@link Window.create Window.create}.
68
- *
69
- * Note that `name` is the only required property — albeit the `url` property is usually provided as well
70
- * (defaults to `"about:blank"` when omitted).
71
- *
72
- * _This jsdoc typedef mirrors the `WindowOptions` TypeScript interface in `@types/openfin`._
73
- *
74
- * @property {object} [accelerator]
75
- * Enable keyboard shortcuts for devtools, zoom, reload, and reload ignoring cache.
76
- *
77
- * @property {boolean} [accelerator.devtools=false]
78
- * If `true`, enables the devtools keyboard shortcut:<br>
79
- * `Ctrl` + `Shift` + `I` _(Toggles Devtools)_
80
- *
81
- * @property {boolean} [accelerator.reload=false]
82
- * If `true`, enables the reload keyboard shortcuts:<br>
83
- * `Ctrl` + `R` _(Windows)_<br>
84
- * `F5` _(Windows)_<br>
85
- * `Command` + `R` _(Mac)_
86
- *
87
- * @property {boolean} [accelerator.reloadIgnoringCache=false]
88
- * If `true`, enables the reload-from-source keyboard shortcuts:<br>
89
- * `Ctrl` + `Shift` + `R` _(Windows)_<br>
90
- * `Shift` + `F5` _(Windows)_<br>
91
- * `Command` + `Shift` + `R` _(Mac)_
92
- *
93
- * @property {boolean} [accelerator.zoom=false]
94
- * NOTE: It is not recommended to set this value to true for Windows in Platforms as that may lead to unexpected visual shifts in layout.
95
- * If `true`, enables the zoom keyboard shortcuts:<br>
96
- * `Ctrl` + `+` _(Zoom In)_<br>
97
- * `Ctrl` + `Shift` + `+` _(Zoom In)_<br>
98
- * `Ctrl` + `NumPad+` _(Zoom In)_<br>
99
- * `Ctrl` + `-` _(Zoom Out)_<br>
100
- * `Ctrl` + `Shift` + `-` _(Zoom Out)_<br>
101
- * `Ctrl` + `NumPad-` _(Zoom Out)_<br>
102
- * `Ctrl` + `Scroll` _(Zoom In & Out)_<br>
103
- * `Ctrl` + `0` _(Restore to 100%)_
104
- *
105
- * @property {object} [alphaMask] - _Experimental._ _Updatable._
106
- * <br>
107
- * alphaMask turns anything of matching RGB value transparent.
108
- * <br>
109
- * Caveats:
110
- * * runtime key --disable-gpu is required. Note: Unclear behavior on remote Desktop support
111
- * * User cannot click-through transparent regions
112
- * * Not supported on Mac
113
- * * Windows Aero must be enabled
114
- * * Won't make visual sense on Pixel-pushed environments such as Citrix
115
- * * Not supported on rounded corner windows
116
- * @property {number} [alphaMask.red=-1] 0-255
117
- * @property {number} [alphaMask.green=-1] 0-255
118
- * @property {number} [alphaMask.blue=-1] 0-255
119
- *
120
- * @property {boolean} [alwaysOnTop=false] - _Updatable._
121
- * A flag to always position the window at the top of the window stack.
122
- *
123
- * @property {object} [api]
124
- * Configurations for API injection.
125
- *
126
- * @property {object} [api.iframe] Configure if the the API should be injected into iframes based on domain.
127
- *
128
- * @property {boolean} [api.iframe.crossOriginInjection=false] Controls if the `fin` API object is present for cross origin iframes.
129
- * @property {boolean} [api.iframe.sameOriginInjection=true] Controls if the `fin` API object is present for same origin iframes.
130
- *
131
- * @property {string} [applicationIcon = ""] - _Deprecated_ - use `icon` instead.
132
- *
133
- * @property {number} [aspectRatio=0] - _Updatable._
134
- * The aspect ratio of width to height to enforce for the window. If this value is equal to or less than zero,
135
- * an aspect ratio will not be enforced.
136
- *
137
- * @property {string} [autoplayPolicy="no-user-gesture-required"]
138
- * Autoplay policy to apply to content in the window, can be
139
- * `no-user-gesture-required`, `user-gesture-required`,
140
- * `document-user-activation-required`. Defaults to `no-user-gesture-required`.
141
- *
142
- * @property {boolean} [autoShow=true]
143
- * A flag to automatically show the window when it is created.
144
- *
145
- * @property {string} [backgroundColor="#FFF"]
146
- * The window’s _backfill_ color as a hexadecimal value. Not to be confused with the content background color
147
- * (`document.body.style.backgroundColor`),
148
- * this color briefly fills a window’s (a) content area before its content is loaded as well as (b) newly exposed
149
- * areas when growing a window. Setting
150
- * this value to the anticipated content background color can help improve user experience.
151
- * Default is white.
152
- *
153
- * @property {object} [contentCreation]
154
- * Apply rules that determine how user interaction (`window.open` and links) creates content.
155
- * @property {ContentCreationRule[]} [contentCreation.rules = []] List of content creation rules.
156
- *
157
- * @property {object} [contentNavigation]
158
- * Restrict navigation to URLs that match an allowed pattern.
159
- * In the lack of an allowlist, navigation to URLs that match a denied pattern would be prohibited.
160
- * See [here](https://developer.chrome.com/extensions/match_patterns) for more details.
161
- * @property {string[]} [contentNavigation.allowlist=[]] List of allowed URLs.
162
- * @property {string[]} [contentNavigation.denylist=[]] List of denied URLs.
163
- *
164
- * @property {object} [contentRedirect]
165
- * Restrict redirects to URLs that match an allowed pattern.
166
- * In the lack of an allowlist, redirects to URLs that match a denied pattern would be prohibited.
167
- * See [here](https://developer.chrome.com/extensions/match_patterns) for more details.
168
- * @property {string[]} [contentRedirect.allowlist=[]] List of allowed URLs.
169
- * @property {string[]} [contentRedirect.denylist=[]] List of denied URLs.
170
- *
171
- * @property {boolean} [contextMenu=true] - _Updatable._
172
- * A flag to show the context menu when right-clicking on a window.
173
- * Gives access to the devtools for the window.
174
- *
175
- * @property {object} [contextMenuSettings] - _Updatable._
176
- * Deprecated - superseded by {@link contextMenuOptions}, which offers a larger feature-set and cleaner syntax.
177
- * Configure the context menu when right-clicking on a window.
178
- * @property {boolean} [contextMenuSettings.enable=true] Should the context menu display on right click.
179
- * @property {boolean} [contextMenuSettings.devtools=true] Should the context menu contain a button for opening devtools.
180
- * @property {boolean} [contextMenuSettings.reload=true] Should the context menu contain a button for reloading the page.
181
- *
182
- * @property {object} [contextMenuOptions] - _Updatable._
183
- * Configure the context menu when right-clicking on a window. Supported menu items:
184
- * 'separator'
185
- * 'cut'
186
- * 'copy'
187
- * 'paste'
188
- * 'spellCheck'
189
- * 'inspect'
190
- * 'reload'
191
- * 'navigateForward'
192
- * 'navigateBack'
193
- * 'print'
194
- * @property {boolean} [contextMenuOptions.enabled = true] Should the context menu display on right click.
195
- * @property {string[]} [contextMenuSettings.template=[]] List of context menu items to display on right-click.
196
- *
197
- * @property {object} [cornerRounding] - _Updatable._
198
- * Defines and applies rounded corners for a frameless window. **NOTE:** On macOS corner is not ellipse but circle rounded by the
199
- * average of _height_ and _width_.
200
- * @property {number} [cornerRounding.height=0] The height in pixels.
201
- * @property {number} [cornerRounding.width=0] The width in pixels.
202
- *
203
- * @property {any} [customContext=""] - _Updatable. Inheritable._
204
- * A field that the user can use to attach serializable data that will be saved when {@link Platform#getSnapshot Platform.getSnapshot}
205
- * is called. If a window in a Platform is trying to update or retrieve its own context, it can use the
206
- * {@link Platform#setWindowContext Platform.setWindowContext} and {@link Platform#getWindowContext Platform.getWindowContext} calls.
207
- * _When omitted, _inherits_ from the parent application._
208
- * As opposed to customData, this is meant for frequent updates and sharing with other contexts. [Example]{@tutorial customContext}
209
- *
210
- * @property {any} [customData=""] - _Updatable. Inheritable._
211
- * A field that the user can attach serializable data to be ferried around with the window options.
212
- * _When omitted, _inherits_ from the parent application._
213
- *
214
- * @property {object[]} [customRequestHeaders]
215
- * Defines list of custom headers for requests sent by the window.
216
- * @property {string[]} [customRequestHeaders.urlPatterns=[]] The URL patterns for which the headers will be applied
217
- * @property {object[]} [customRequestHeaders.headers=[]] Objects representing headers and their values,
218
- * where the object key is the name of header and value at key is the value of the header
219
- *
220
- * @property {boolean} [closeOnLastViewRemoved=true] - _Experimental._ _Updatable._
221
- * Toggling off would keep the Window alive even if all its Views were closed.
222
- * This is meant for advanced users and should be used with caution.
223
- * Limitations - Once a Layout has been emptied out of all views it's not usable anymore, and certain API calls will fail.
224
- * Use `layout.replace` to create a fresh Layout instance in case you want to populate it with Views again.
225
- * ** note ** - This option is ignored in non-Platforms apps.
226
- *
227
- * @property {boolean} [defaultCentered=false]
228
- * Centers the window in the primary monitor. This option overrides `defaultLeft` and `defaultTop`. When `saveWindowState` is `true`,
229
- * this value will be ignored for subsequent launches in favor of the cached value. **NOTE:** On macOS _defaultCenter_ is
230
- * somewhat above center vertically.
231
- *
232
- * @property {number} [defaultHeight=500]
233
- * The default height of the window. When `saveWindowState` is `true`, this value will be ignored for subsequent launches
234
- * in favor of the cached value.
235
- *
236
- * @property {number} [defaultLeft=100]
237
- * The default left position of the window. When `saveWindowState` is `true`, this value will be ignored for subsequent
238
- * launches in favor of the cached value.
239
- *
240
- * @property {number} [defaultTop=100]
241
- * The default top position of the window. When `saveWindowState` is `true`, this value will be ignored for subsequent
242
- * launches in favor of the cached value.
243
- *
244
- * @property {number} [defaultWidth=800]
245
- * The default width of the window. When `saveWindowState` is `true`, this value will be ignored for subsequent
246
- * launches in favor of the cached value.
247
- *
248
- * @property {boolean} [includeInSnapshots=true] - _Updatable._
249
- * When true, the window will be be included in snapshots returned by Platform.getSnapshot(). Turning this off may be desirable when dealing with
250
- * inherently temporary windows whose state shouldn't be preserved, such as modals, menus, or popups.
251
- *
252
- * @property {boolean} [frame=true] - _Updatable._
253
- * A flag to show the frame.
254
- *
255
- * @hidden-property {boolean} [hideOnClose=false] - A flag to allow a window to be hidden when the close button is clicked.
256
- *
257
- * @property {object[]} [hotkeys=[]] - _Updatable._
258
- * Defines the list of hotkeys that will be emitted as a `hotkey` event on the window. For usage example see [example]{@tutorial hotkeys}.
259
- * Within Platform, OpenFin also implements a set of pre-defined actions called
260
- * [keyboard commands]{@link https://developers.openfin.co/docs/platform-api#section-5-3-using-keyboard-commands}
261
- * that can be assigned to a specific hotkey in the platform manifest.
262
- * @property {string} hotkeys.keys The key combination of the hotkey, i.e. "Ctrl+T"
263
- * @property {boolean} [hotkeys.preventDefault=false] Whether or not to prevent default key handling before emitting the event
264
- *
265
- * @property {string} [icon] - _Updatable. Inheritable._
266
- * A URL for the icon to be shown in the window title bar and the taskbar.
267
- * When omitted, inherits from the parent application._
268
- * note: Window OS caches taskbar icons, therefore an icon change might only be visible after the cache is removed or the uuid is changed.
269
- *
270
- * @property {number} [maxHeight=-1] - _Updatable._
271
- * The maximum height of a window. Will default to the OS defined value if set to -1.
272
- *
273
- * @property {boolean} [maximizable=true] - _Updatable._
274
- * A flag that lets the window be maximized.
275
- *
276
- * @property {number} [maxWidth=-1] - _Updatable._
277
- * The maximum width of a window. Will default to the OS defined value if set to -1.
278
- *
279
- * @property {number} [minHeight=0] - _Updatable._
280
- * The minimum height of a window.
281
- *
282
- * @property {boolean} [minimizable=true] - _Updatable._
283
- * A flag that lets the window be minimized.
284
- *
285
- * @property {number} [minWidth=0] - _Updatable._
286
- * The minimum width of a window.
287
- *
288
- * @property {Identity} [modalParentIdentity]
289
- * Parent identity of a modal window. It will create a modal child window when this option is set.
290
- *
291
- * @property {string} name
292
- * The name of the window.
293
- *
294
- * @property {number} [opacity=1.0] - _Updatable._
295
- * A flag that specifies how transparent the window will be.
296
- * Changing opacity doesn't work on Windows 7 without Aero so setting this value will have no effect there.
297
- * This value is clamped between `0.0` and `1.0`.
298
- *
299
- * @property {preloadScript[]} [preloadScripts] - _Inheritable_
300
- * A list of scripts that are eval'ed before other scripts in the page. When omitted, _inherits_
301
- * from the parent application.
302
- *
303
- * @property {string} [processAffinity]
304
- * A string to attempt to group renderers together. Will only be used if pages are on the same origin.
305
- *
306
- * @property {boolean} [resizable=true] - _Updatable._
307
- * A flag to allow the user to resize the window.
308
- *
309
- * @property {object} [resizeRegion] - _Updatable._
310
- * Defines a region in pixels that will respond to user mouse interaction for resizing a frameless window.
311
- * @property {number} [resizeRegion.bottomRightCorner=9]
312
- * The size in pixels of an additional square resizable region located at the bottom right corner of a frameless window.
313
- * @property {number} [resizeRegion.size=7]
314
- * The size in pixels.
315
- * @property {object} [resizeRegion.sides={top:true,right:true,bottom:true,left:true}]
316
- * Sides that a window can be resized from.
317
- *
318
- * @property {boolean} [saveWindowState=true]
319
- * A flag to cache the location of the window.
320
- * ** note ** - This option is ignored in Platforms as it would cause inconsistent {@link Platform#applySnapshot applySnapshot} behavior.
321
- *
322
- * @property {boolean} [ignoreSavedWindowState]
323
- * A flag to ignore previously cached state of the window. It defaults the opposite value of `saveWindowState` to maintain backwards compatibility.
324
- *
325
- * @property {boolean} [shadow=false]
326
- * A flag to display a shadow on frameless windows.
327
- * `shadow` and `cornerRounding` are mutually exclusive.
328
- * On Windows 7, Aero theme is required.
329
- *
330
- * @property {boolean} [showBackgroundImages=false] - _Updatable._
331
- * Platforms Only. If true, will show background images in the layout when the Views are hidden.
332
- * This occurs when the window is resizing or a tab is being dragged within the layout.
333
- *
334
- * @property {boolean} [showTaskbarIcon=true] - _Updatable._ _Windows_.
335
- * A flag to show the window's icon in the taskbar.
336
- *
337
- * @property {boolean} [smallWindow=false]
338
- * A flag to specify a frameless window that can be be created and resized to less than 41x36 px (width x height).
339
- * _Note: Caveats of small windows are no Aero Snap and drag to/from maximize._
340
- * _Windows 10: Requires `maximizable` to be false. Resizing with the mouse is only possible down to 38x39 px._
341
- *
342
- * @property {boolean} [spellCheck=false]
343
- * Enable spell check in input text fields for the window.
344
- *
345
- * @property {string} [state="normal"]
346
- * The visible state of the window on creation.
347
- * One of:
348
- * * `"maximized"`
349
- * * `"minimized"`
350
- * * `"normal"`
351
- *
352
- * @property {string} [taskbarIcon=string] - Deprecated - use `icon` instead._Windows_.
353
- *
354
- * @property {string} [taskbarIconGroup=<application uuid>] - _Windows_.
355
- * Specify a taskbar group for the window.
356
- * _If omitted, defaults to app's uuid (`fin.Application.getCurrentSync().identity.uuid`)._
357
- *
358
- * @property {string} [url="about:blank"]
359
- * The URL of the window.
360
- *
361
- * @property {string} [uuid=<application uuid>]
362
- * The `uuid` of the application, unique within the set of all `Application`s running in OpenFin Runtime.
363
- * If omitted, defaults to the `uuid` of the application spawning the window.
364
- * If given, must match the `uuid` of the application spawning the window.
365
- * In other words, the application's `uuid` is the only acceptable value, but is the default, so there's
366
- * really no need to provide it.
367
- *
368
- * @property {boolean} [waitForPageLoad=false]
369
- * When set to `true`, the window will not appear until the `window` object's `load` event fires.
370
- * When set to `false`, the window will appear immediately without waiting for content to be loaded.
371
- *
372
- * @property {ViewVisibility} [viewVisibility]
373
- * _Platform Windows Only_. Controls behavior for showing views when they are being resized by the user.
374
- */
375
- /**
376
- * @PORTED
377
- * @typedef {Object} ViewVisibility _Platform Windows Only_. Controls behavior for showing views when they are being resized by the user.
378
- * @property {ShowViewsOnWindowResize} [showViewsOnWindowResize] Enables views to be shown when a Platform Window is being resized by the user.
379
- * @property {ShowViewsOnSplitterDrag} [showViewsOnSplitterDrag] Allows views to be shown when they are resized by the user dragging the splitter between layout stacks.
380
- * @property {ShowViewsOnTabDrag} [showViewsOnTabDrag] _Supported on Windows Operating Systems only_. Allows views to be shown when the user is dragging a tab around a layout.
381
- */
382
- /**
383
- * @PORTED
384
- * @typedef {Object} ShowViewsOnWindowResize _Platform Windows Only_. Enables views to be shown when a Platform Window is being resized by the user.
385
- * @property {boolean} [enabled=false] Enables or disables showing Views when a Platform Window is being resized.
386
- * @property {number} [paintIntervalMs=0] Number of miliseconds to wait between view repaints.
387
- */
388
- /**
389
- * @REMOVED
390
- * @typedef {Object} ShowViewsOnSplitterDrag _Platform Windows Only_. Allows views to be shown when they are resized by the user dragging the splitter between layout stacks.
391
- * @property {boolean} [enabled=false] Enables or disables showing views when the layout splitter is being dragged.
392
- */
393
- /**
394
- * @REMOVED
395
- * @typedef {Object} ShowViewsOnTabDrag _Platform Windows Only_. Allows views to be shown when the user is manipulating the layout by repositioning a tab.
396
- * @property {boolean} [enabled=false] Enables or disables showing views when a tab is being dragged.
397
- */
398
- /**
399
- * @PORTED
400
- * @typedef {object} CapturePageOptions
401
- * @property { Area } [area] The area of the window to be captured.
402
- * @property { string } [format='png'] The format of the captured image. Can be 'png', 'jpg', or 'bmp'.
403
- * @property { number } [quality=100] Number representing quality of JPEG image only. Between 0 - 100.
404
- */
405
- /**
406
- * @PORTED
407
- * @typedef { object } Area
408
- * @property { number } height Area's height
409
- * @property { number } width Area's width
410
- * @property { number } x X coordinate of area's starting point
411
- * @property { number } y Y coordinate of area's starting point
412
- */
413
- /**
414
- * @PORTED
415
- * @typedef {object} FindInPageOptions
416
- * @property {boolean} [forward=true] Whether to search forward or backward.
417
- * @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.
418
- * @property {boolean} [matchCase=false] Whether search should be case-sensitive.
419
- * @property {boolean} [wordStart=false] Whether to look only at the start of words.
420
- * @property {boolean} [medialCapitalAsWordStart=false]
421
- * 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>
422
- * lowercase or non-letter. Accepts several other intra-word matches.
423
- */
424
- /**
425
- * @REMOVED
426
- * @typedef {object} Transition
427
- * @property {Opacity} opacity - The Opacity transition
428
- * @property {Position} position - The Position transition
429
- * @property {Size} size - The Size transition
430
- */
431
- /**
432
- * @PORTED
433
- * @typedef {object} TransitionOptions
434
- * @property {boolean} interrupt - This option interrupts the current animation. When false it pushes
435
- this animation onto the end of the animation queue.
436
- * @property {boolean} relative - Treat 'opacity' as absolute or as a delta. Defaults to false.
437
- */
438
- /**
439
- * @PORTED
440
- * @typedef {object} Size
441
- * @property {number} duration - The total time in milliseconds this transition should take.
442
- * @property {boolean} relative - Treat 'opacity' as absolute or as a delta. Defaults to false.
443
- * @property {number} width - Optional if height is present. Defaults to the window's current width.
444
- * @property {number} height - Optional if width is present. Defaults to the window's current height.
445
- */
446
- /**
447
- * @PORTED
448
- * @typedef {object} Position
449
- * @property {number} duration - The total time in milliseconds this transition should take.
450
- * @property {boolean} relative - Treat 'opacity' as absolute or as a delta. Defaults to false.
451
- * @property {number} left - Defaults to the window's current left position in virtual screen coordinates.
452
- * @property {number} top - Defaults to the window's current top position in virtual screen coordinates.
453
- */
454
- /**
455
- * @PORTED
456
- * @typedef {object} Opacity
457
- * @property {number} duration - The total time in milliseconds this transition should take.
458
- * @property {boolean} relative - Treat 'opacity' as absolute or as a delta. Defaults to false.
459
- * @property {number} opacity - This value is clamped from 0.0 to 1.0.
460
- */
461
- /**
462
- * @REMOVED
463
- * Bounds is a interface that has the properties of height,
464
- * width, left, top which are all numbers
465
- * @typedef { object } Bounds
466
- * @property { number } height Get the application height bound
467
- * @property { number } width Get the application width bound
468
- * @property { number } top Get the application top bound
469
- * @property { number } left Get the application left bound
470
- * @property { number } right Get the application right bound
471
- * @property { number } bottom Get the application bottom bound
472
- */
473
- /**
474
- * A basic window that wraps a native HTML window. Provides more fine-grained
475
- * control over the window state such as the ability to minimize, maximize, restore, etc.
476
- * By default a window does not show upon instantiation; instead the window's show() method
477
- * must be invoked manually. The new window appears in the same process as the parent window.
478
- * It has the ability to listen for {@link OpenFin.WindowEvents window specific events}.
479
- */
480
- export declare class _Window extends WebContents<OpenFin.WindowEvent> {
481
- identity: OpenFin.Identity;
482
- /**
483
- * @internal
484
- */
485
- constructor(wire: Transport, identity: OpenFin.Identity);
486
- /**
487
- * Adds a listener to the end of the listeners array for the specified event.
488
- * @param eventType - The type of the event.
489
- * @param listener - Called whenever an event of the specified type occurs.
490
- * @param options - Option to support event timestamps.
491
- *
492
- * @function addListener
493
- * @memberof Window
494
- * @instance
495
- * @tutorial Window.EventEmitter
496
- */
497
- /**
498
- * Adds a listener to the end of the listeners array for the specified event.
499
- * @param eventType - The type of the event.
500
- * @param listener - Called whenever an event of the specified type occurs.
501
- * @param options - Option to support event timestamps.
502
- *
503
- * @function on
504
- * @memberof Window
505
- * @instance
506
- * @tutorial Window.EventEmitter
507
- */
508
- /**
509
- * 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.
510
- * @param eventType - The type of the event.
511
- * @param listener - The callback function.
512
- * @param options - Option to support event timestamps.
513
- *
514
- * @function once
515
- * @memberof Window
516
- * @instance
517
- * @tutorial Window.EventEmitter
518
- */
519
- /**
520
- * Adds a listener to the beginning of the listeners array for the specified event.
521
- * @param eventType - The type of the event.
522
- * @param listener - The callback function.
523
- * @param options - Option to support event timestamps.
524
- *
525
- * @function prependListener
526
- * @memberof Window
527
- * @instance
528
- * @tutorial Window.EventEmitter
529
- */
530
- /**
531
- * 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.
532
- * The listener is added to the beginning of the listeners array.
533
- * @param eventType - The type of the event.
534
- * @param listener - The callback function.
535
- * @param options - Option to support event timestamps.
536
- *
537
- * @function prependOnceListener
538
- * @memberof Window
539
- * @instance
540
- * @tutorial Window.EventEmitter
541
- */
542
- /**
543
- * Remove a listener from the listener array for the specified event.
544
- * Caution: Calling this method changes the array indices in the listener array behind the listener.
545
- * @param eventType - The type of the event.
546
- * @param listener - The callback function.
547
- * @param options - Option to support event timestamps.
548
- *
549
- * @function removeListener
550
- * @memberof Window
551
- * @instance
552
- * @tutorial Window.EventEmitter
553
- */
554
- /**
555
- * Removes all listeners, or those of the specified event.
556
- * @param eventType - The type of the event.
557
- *
558
- * @function removeAllListeners
559
- * @memberof Window
560
- * @instance
561
- * @tutorial Window.EventEmitter
562
- */
563
- createWindow(options: OpenFin.WindowCreationOptions): Promise<OpenFin.Window>;
564
- /**
565
- * Retrieves an array of frame info objects representing the main frame and any
566
- * iframes that are currently on the page.
567
- *
568
- * @example
569
- * ```js
570
- * async function getAllFrames() {
571
- * const app = await fin.Application.start({
572
- * name: 'myApp',
573
- * uuid: 'app-1',
574
- * url: 'https://cdn.openfin.co/docs/javascript/stable/tutorial-Window.getAllFrames.html',
575
- * autoShow: true
576
- * });
577
- * const win = await app.getWindow();
578
- * return await win.getAllFrames();
579
- * }
580
- *
581
- * getAllFrames().then(framesInfo => console.log(framesInfo)).catch(err => console.log(err));
582
- * ```
583
- */
584
- getAllFrames(): Promise<Array<OpenFin.FrameInfo>>;
585
- /**
586
- * Gets the current bounds (top, bottom, right, left, width, height) of the window.
587
- *
588
- * @example
589
- * ```js
590
- * async function getBounds() {
591
- * const app = await fin.Application.start({
592
- * name: 'myApp',
593
- * uuid: 'app-3',
594
- * url: 'https://cdn.openfin.co/docs/javascript/stable/tutorial-Window.getBounds.html',
595
- * autoShow: true
596
- * });
597
- * const win = await app.getWindow();
598
- * return await win.getBounds();
599
- * }
600
- *
601
- * getBounds().then(bounds => console.log(bounds)).catch(err => console.log(err));
602
- * ```
603
- */
604
- getBounds(): Promise<OpenFin.WindowBounds>;
605
- /**
606
- * Centers the window on its current screen.
607
- *
608
- * @remarks Does not have an effect on minimized or maximized windows.
609
- *
610
- * @example
611
- * ```js
612
- * async function centerWindow() {
613
- * const app = await fin.Application.start({
614
- * name: 'myApp',
615
- * uuid: 'app-1',
616
- * url: 'https://cdn.openfin.co/docs/javascript/stable/tutorial-Window.center.html',
617
- * autoShow: true
618
- * });
619
- * const win = await app.getWindow();
620
- * return await win.center();
621
- * }
622
- *
623
- * centerWindow().then(() => console.log('Window centered')).catch(err => console.log(err));
624
- * ```
625
- *
626
- */
627
- center(): Promise<void>;
628
- /**
629
- * Removes focus from the window.
630
- *
631
- * @example
632
- * ```js
633
- * async function blurWindow() {
634
- * const app = await fin.Application.start({
635
- * name: 'myApp',
636
- * uuid: 'app-1',
637
- * url: 'https://cdn.openfin.co/docs/javascript/stable/tutorial-Window.blur.html',
638
- * autoShow: true
639
- * });
640
- * const win = await app.getWindow();
641
- * return await win.blur();
642
- * }
643
- *
644
- * blurWindow().then(() => console.log('Blured Window')).catch(err => console.log(err));
645
- * ```
646
- */
647
- blur(): Promise<void>;
648
- /**
649
- * Brings the window to the front of the window stack.
650
- *
651
- * @example
652
- * ```js
653
- * async function BringWindowToFront() {
654
- * const app = await fin.Application.start({
655
- * name: 'myApp',
656
- * uuid: 'app-1',
657
- * url: 'https://cdn.openfin.co/docs/javascript/stable/tutorial-Window.bringToFront.html',
658
- * autoShow: true
659
- * });
660
- * const win = await app.getWindow();
661
- * return await win.bringToFront();
662
- * }
663
- *
664
- * BringWindowToFront().then(() => console.log('Window is in the front')).catch(err => console.log(err));
665
- * ```
666
- */
667
- bringToFront(): Promise<void>;
668
- /**
669
- * Performs the specified window transitions.
670
- * @param transitions - Describes the animations to perform. See the tutorial.
671
- * @param options - Options for the animation. See the tutorial.
672
- *
673
- * @example
674
- * ```
675
- * async function animateWindow() {
676
- * const transitions = {
677
- * opacity: {
678
- * opacity: 0.7,
679
- * duration: 500
680
- * },
681
- * position: {
682
- * top: 100,
683
- * left: 100,
684
- * duration: 500,
685
- * relative: true
686
- * }
687
- * };
688
- * const options = {
689
- * interrupt: true,
690
- * tween: 'ease-in'
691
- * };
692
- *
693
- * const win = await fin.Window.getCurrent();
694
- * return win.animate(transitions, options);
695
- * }
696
- *
697
- * animateWindow()
698
- * .then(() => console.log('Animation done'))
699
- * .catch(err => console.error(err));
700
- * ```
701
- */
702
- animate(transitions: OpenFin.Transition, options: OpenFin.TransitionOptions): Promise<void>;
703
- /**
704
- * Hides the window.
705
- *
706
- * @example
707
- * ```js
708
- * async function hideWindow() {
709
- * const app = await fin.Application.start({
710
- * name: 'myApp',
711
- * uuid: 'app-1',
712
- * url: 'https://cdn.openfin.co/docs/javascript/stable/tutorial-Window.hide.html',
713
- * autoShow: true
714
- * });
715
- * const win = await app.getWindow();
716
- * return await win.hide();
717
- * }
718
- *
719
- * hideWindow().then(() => console.log('Window is hidden')).catch(err => console.log(err));
720
- * ```
721
- */
722
- hide(): Promise<void>;
723
- /**
724
- * closes the window application
725
- * @param force Close will be prevented from closing when force is false and
726
- * ‘close-requested’ has been subscribed to for application’s main window.
727
- *
728
- * @example
729
- * ```js
730
- * async function closeWindow() {
731
- * const app = await fin.Application.start({
732
- * name: 'myApp',
733
- * uuid: 'app-3',
734
- * url: 'https://cdn.openfin.co/docs/javascript/stable/tutorial-Window.close.html',
735
- * autoShow: true
736
- * });
737
- * const win = await app.getWindow();
738
- * return await win.close();
739
- * }
740
- *
741
- * closeWindow().then(() => console.log('Window closed')).catch(err => console.log(err));
742
- * ```
743
- */
744
- close(force?: boolean): Promise<void>;
745
- focusedWebViewWasChanged(): Promise<void>;
746
- /**
747
- * Returns the native OS level Id.
748
- *
749
- * @remarks In Windows, it will return the Windows [handle](https://docs.microsoft.com/en-us/windows/desktop/WinProg/windows-data-types#HWND).
750
- *
751
- * @example
752
- * ```js
753
- * async function getWindowNativeId() {
754
- * const app = await fin.Application.start({
755
- * name: 'myApp',
756
- * uuid: 'app-3',
757
- * url: 'https://cdn.openfin.co/docs/javascript/stable/tutorial-Window.getNativeId.html',
758
- * autoShow: true
759
- * });
760
- * const win = await app.getWindow();
761
- * return await win.getNativeId();
762
- * }
763
- *
764
- * getWindowNativeId().then(nativeId => console.log(nativeId)).catch(err => console.log(err));
765
- * ```
766
- */
767
- getNativeId(): Promise<string>;
768
- /**
769
- * Retrieves window's attached views.
770
- * @experimental
771
- *
772
- * @example
773
- * ```js
774
- * const win = fin.Window.getCurrentSync();
775
- *
776
- * win.getCurrentViews()
777
- * .then(views => console.log(views))
778
- * .catch(console.error);
779
- * ```
780
- */
781
- getCurrentViews(): Promise<OpenFin.View[]>;
782
- /**
783
- * @deprecated Use {@link Window._Window.disableUserMovement} instead.
784
- */
785
- disableFrame(): Promise<void>;
786
- /**
787
- * Prevents a user from changing a window's size/position when using the window's frame.
788
- *
789
- * @example
790
- * ```js
791
- * async function disableUserMovement() {
792
- * const app = await fin.Application.start({
793
- * name: 'myApp',
794
- * uuid: 'app-3',
795
- * url: 'https://cdn.openfin.co/docs/javascript/stable/tutorial-Window.disableFrame.html',
796
- * autoShow: true
797
- * });
798
- * const win = await app.getWindow();
799
- * return await win.disableUserMovement();
800
- * }
801
- *
802
- * disableUserMovement().then(() => console.log('Window is disabled')).catch(err => console.log(err));
803
- * ```
804
- */
805
- disableUserMovement(): Promise<void>;
806
- /**
807
- * @deprecated Use {@link Window._Window.enableUserMovement} instead.
808
- */
809
- enableFrame(): Promise<void>;
810
- /**
811
- * Re-enables user changes to a window's size/position when using the window's frame.
812
- *
813
- * @example
814
- * ```js
815
- * async function enableUserMovement() {
816
- * const app = await fin.Application.start({
817
- * name: 'myApp',
818
- * uuid: 'app-3',
819
- * url: 'https://cdn.openfin.co/docs/javascript/stable/tutorial-Window.enableFrame.html',
820
- * autoShow: true
821
- * });
822
- * const win = await app.getWindow();
823
- * return await win.enableUserMovement();
824
- * }
825
- *
826
- * enableUserMovement().then(() => console.log('Window is enabled')).catch(err => console.log(err));
827
- * ```
828
- */
829
- enableUserMovement(): Promise<void>;
830
- /**
831
- * Flashes the window’s frame and taskbar icon until stopFlashing is called or until a focus event is fired.
832
- *
833
- * @remarks On macOS flash only works on inactive windows.
834
- * @example
835
- * ```js
836
- * async function windowFlash() {
837
- * const app = await fin.Application.start({
838
- * name: 'myApp',
839
- * uuid: 'app-1',
840
- * url: 'https://cdn.openfin.co/docs/javascript/stable/tutorial-Window.flash.html',
841
- * autoShow: true
842
- * });
843
- * const win = await app.getWindow();
844
- * return await win.flash();
845
- * }
846
- *
847
- * windowFlash().then(() => console.log('Window flashing')).catch(err => console.log(err));
848
- * ```
849
- */
850
- flash(): Promise<void>;
851
- /**
852
- * Stops the taskbar icon from flashing.
853
- *
854
- * @example
855
- * ```js
856
- * async function stopWindowFlashing() {
857
- * const app = await fin.Application.start({
858
- * name: 'myApp',
859
- * uuid: 'app-1',
860
- * url: 'https://cdn.openfin.co/docs/javascript/stable/tutorial-Window.stopFlashing.html',
861
- * autoShow: true
862
- * });
863
- * const win = await app.getWindow();
864
- * return await win.stopFlashing();
865
- * }
866
- *
867
- * stopWindowFlashing().then(() => console.log('Application window flashing')).catch(err => console.log(err));
868
- * ```
869
- */
870
- stopFlashing(): Promise<void>;
871
- /**
872
- * Gets an information object for the window.
873
- *
874
- * @example
875
- * ```js
876
- * async function getInfo() {
877
- * const app = await fin.Application.start({
878
- * name: 'myApp',
879
- * uuid: 'app-1',
880
- * url: 'https://cdn.openfin.co/docs/javascript/stable/tutorial-Window.getInfo.html',
881
- * autoShow: true
882
- * });
883
- * const win = await app.getWindow();
884
- * return await win.getInfo();
885
- * }
886
- *
887
- * getInfo().then(info => console.log(info)).catch(err => console.log(err));
888
- * ```
889
- */
890
- getInfo(): Promise<OpenFin.WindowInfo>;
891
- /**
892
- * Retrieves the window's Layout
893
- *
894
- * @example
895
- * ```js
896
- * //get the current window
897
- * const window = await fin.Window.getCurrent();
898
- *
899
- * //get the layout for the window
900
- * const layout = await window.getLayout();
901
- * ```
902
- * @experimental
903
- */
904
- getLayout(): Promise<OpenFin.Layout>;
905
- /**
906
- * Gets the current settings of the window.
907
- *
908
- * @example
909
- * ```js
910
- * async function getWindowOptions() {
911
- * const app = await fin.Application.start({
912
- * name: 'myApp',
913
- * uuid: 'app-1',
914
- * url: 'https://cdn.openfin.co/docs/javascript/stable/tutorial-Window.getOptions.html',
915
- * autoShow: true
916
- * });
917
- * const win = await app.getWindow();
918
- * return await win.getOptions();
919
- * }
920
- *
921
- * getWindowOptions().then(opts => console.log(opts)).catch(err => console.log(err));
922
- * ```
923
- */
924
- getOptions(): Promise<OpenFin.WindowOptions>;
925
- /**
926
- * Gets the parent application.
927
- *
928
- * @example
929
- * ```js
930
- * async function getParentApplication() {
931
- * const app = await fin.Application.start({
932
- * name: 'myApp',
933
- * uuid: 'app-1',
934
- * url: 'https://cdn.openfin.co/docs/javascript/stable/tutorial-Window.getParentApplication.html',
935
- * autoShow: true
936
- * });
937
- * const win = await app.getWindow();
938
- * return await win.getParentApplication();
939
- * }
940
- *
941
- * getParentApplication().then(parentApplication => console.log(parentApplication)).catch(err => console.log(err));
942
- * ```
943
- */
944
- getParentApplication(): Promise<OpenFin.Application>;
945
- /**
946
- * Gets the parent window.
947
- *
948
- * @example
949
- * ```js
950
- * async function getParentWindow() {
951
- * const app = await fin.Application.start({
952
- * name: 'myApp',
953
- * uuid: 'app-1',
954
- * url: 'https://cdn.openfin.co/docs/javascript/stable/tutorial-Window.getParentWindow.html',
955
- * autoShow: true
956
- * });
957
- * const win = await app.getWindow();
958
- * return await win.getParentWindow();
959
- * }
960
- *
961
- * getParentWindow().then(parentWindow => console.log(parentWindow)).catch(err => console.log(err));
962
- * ```
963
- */
964
- getParentWindow(): Promise<OpenFin.Window>;
965
- /**
966
- * ***DEPRECATED - please use Window.capturePage.***
967
- * Gets a base64 encoded PNG image of the window or just part a of it.
968
- * @param area The area of the window to be captured.
969
- * Omitting it will capture the whole visible window.
970
- *
971
- * @tutorial Window.capturePage
972
- */
973
- getSnapshot(area?: OpenFin.Rectangle): Promise<string>;
974
- /**
975
- * Gets the current state ("minimized", "maximized", or "normal") of the window.
976
- *
977
- * @example
978
- * ```js
979
- * async function getWindowState() {
980
- * const app = await fin.Application.start({
981
- * name: 'myApp',
982
- * uuid: 'app-1',
983
- * url: 'https://cdn.openfin.co/docs/javascript/stable/tutorial-Window.getState.html',
984
- * autoShow: true
985
- * });
986
- * const win = await app.getWindow();
987
- * return await win.getState();
988
- * }
989
- *
990
- * getWindowState().then(winState => console.log(winState)).catch(err => console.log(err));
991
- * ```
992
- */
993
- getState(): Promise<'minimized' | 'maximized' | 'normal'>;
994
- /**
995
- * Previously called getNativeWindow.
996
- * Returns the [Window Object](https://developer.mozilla.org/en-US/docs/Web/API/Window)
997
- * that represents the web context of the target window. This is the same object that
998
- * you would get from calling [window.open()](https://developer.mozilla.org/en-US/docs/Web/API/Window/open) in a standard web context.
999
- * The target window needs to be in the same application as the requesting window
1000
- * as well as comply with [same-origin](https://developer.mozilla.org/en-US/docs/Web/Security/Same-origin_policy) policy requirements.
1001
- *
1002
- * @example
1003
- * Injecting content into an empty window:
1004
- *
1005
- * ```js
1006
- * (async ()=> {
1007
- * try {
1008
- * const winName = `child-window-${Date.now()}`;
1009
- * const win = await fin.Window.create({
1010
- * name: winName,
1011
- * url: 'about:blank'
1012
- * });
1013
- * win.getWebWindow().document.write('<h1>Hello World</h1>');
1014
- * } catch (err) {
1015
- * console.error(err);
1016
- * }
1017
- * })();
1018
- * ```
1019
- *
1020
- * Cloning DOM elements from the parent window (in this example we clone an `h3` element from the parent window):
1021
- * ```js
1022
- * (async ()=> {
1023
- * try {
1024
- * const currentWindow = await fin.Window.getCurrent();
1025
- * const parentWindow = await currentWindow.getParentWindow();
1026
- * const clonedH3 = parentWindow.getWebWindow().document.querySelector('h3').cloneNode(true);
1027
- * document.body.append(clonedH3);
1028
- *
1029
- * } catch (err) {
1030
- * console.error(err);
1031
- * }
1032
- * })();
1033
- * ```
1034
- *
1035
- * Rendering on a child window via a library (in this example we are using the [lit-html](https://lit-html.polymer-project.org/)
1036
- * template library to render content on a blank child window. You are not going to be able to copy paste this example without
1037
- * configuring the project correctly but this would demonstrate some templating options available):
1038
- * ```js
1039
- * (async ()=> {
1040
- * try {
1041
- * const win = await fin.Window.create({
1042
- * name: `child-window-${Date.now()}`,
1043
- * url: 'about:blank'
1044
- * });
1045
- * const template = html`
1046
- * <div>
1047
- * <span>Click here: </span>
1048
- * <button @click=${()=> console.log('Hello World!')}>log to the console</button>
1049
- * </div>`;
1050
- * render(template, win.getWebWindow().document.body);
1051
- *
1052
- * } catch (err) {
1053
- * console.error(err);
1054
- * }
1055
- * })();
1056
- * ```
1057
- */
1058
- getWebWindow(): globalThis.Window;
1059
- /**
1060
- * Determines if the window is a main window.
1061
- *
1062
- * @example
1063
- * ```js
1064
- * const wnd = fin.Window.getCurrentSync();
1065
- * const isMainWnd = wnd.isMainWindow();
1066
- * console.log('Is this a main window? ' + isMainWnd);
1067
- * ```
1068
- */
1069
- isMainWindow(): boolean;
1070
- /**
1071
- * Determines if the window is currently showing.
1072
- *
1073
- * @example
1074
- * ```js
1075
- * async function isWindowShowing() {
1076
- * const app = await fin.Application.start({
1077
- * name: 'myApp',
1078
- * uuid: 'app-1',
1079
- * url: 'https://cdn.openfin.co/docs/javascript/stable/tutorial-Window.isShowing.html',
1080
- * autoShow: true
1081
- * });
1082
- * const win = await app.getWindow();
1083
- * return await win.isShowing();
1084
- * }
1085
- *
1086
- * isWindowShowing().then(bool => console.log(bool)).catch(err => console.log(err));
1087
- * ```
1088
- */
1089
- isShowing(): Promise<boolean>;
1090
- /**
1091
- * Maximizes the window
1092
- *
1093
- * @example
1094
- * ```js
1095
- * async function maxWindow() {
1096
- * const app = await fin.Application.start({
1097
- * name: 'myApp',
1098
- * uuid: 'app-1',
1099
- * url: 'https://cdn.openfin.co/docs/javascript/stable/tutorial-Window.maximize.html',
1100
- * autoShow: true
1101
- * });
1102
- * const win = await app.getWindow();
1103
- * return await win.maximize();
1104
- * }
1105
- *
1106
- * maxWindow().then(() => console.log('Maximized window')).catch(err => console.log(err));
1107
- * ```
1108
- */
1109
- maximize(): Promise<void>;
1110
- /**
1111
- * Minimizes the window.
1112
- *
1113
- * @example
1114
- * ```js
1115
- * async function minWindow() {
1116
- * const win = await fin.Window.getCurrent();
1117
- * return await win.minimize();
1118
- * }
1119
- *
1120
- * minWindow().then(() => console.log('Minimized window')).catch(err => console.log(err));
1121
- * ```
1122
- */
1123
- minimize(): Promise<void>;
1124
- /**
1125
- * Moves the window by a specified amount.
1126
- * @param deltaLeft The change in the left position of the window
1127
- * @param deltaTop The change in the top position of the window
1128
- *
1129
- * @example
1130
- * ```js
1131
- * async function createWin() {
1132
- * const app = await fin.Application.start({
1133
- * name: 'myApp',
1134
- * uuid: 'app-1',
1135
- * url: 'https://cdn.openfin.co/docs/javascript/stable/tutorial-Window.moveBy.html',
1136
- * autoShow: true
1137
- * });
1138
- * return await app.getWindow();
1139
- * }
1140
- *
1141
- * async function moveBy(left, top) {
1142
- * const win = await createWin();
1143
- * return await win.moveBy(left, top);
1144
- * }
1145
- *
1146
- * moveBy(580, 300).then(() => console.log('Moved')).catch(err => console.log(err));
1147
- * ```
1148
- */
1149
- moveBy(deltaLeft: number, deltaTop: number): Promise<void>;
1150
- /**
1151
- * Moves the window to a specified location.
1152
- * @param left The left position of the window
1153
- * @param top The top position of the window
1154
- *
1155
- * @example
1156
- * ```js
1157
- * async function createWin() {
1158
- * const app = await fin.Application.start({
1159
- * name: 'myApp',
1160
- * uuid: 'app-1',
1161
- * url: 'https://cdn.openfin.co/docs/javascript/stable/tutorial-Window.moveTo.html',
1162
- * autoShow: true
1163
- * });
1164
- * return await app.getWindow();
1165
- * }
1166
- *
1167
- * async function moveTo(left, top) {
1168
- * const win = await createWin();
1169
- * return await win.moveTo(left, top)
1170
- * }
1171
- *
1172
- * moveTo(580, 300).then(() => console.log('Moved')).catch(err => console.log(err))
1173
- * ```
1174
- */
1175
- moveTo(left: number, top: number): Promise<void>;
1176
- /**
1177
- * Resizes the window by a specified amount.
1178
- * @param deltaWidth The change in the width of the window
1179
- * @param deltaHeight The change in the height of the window
1180
- * @param anchor Specifies a corner to remain fixed during the resize.
1181
- * Can take the values: "top-left", "top-right", "bottom-left", or "bottom-right".
1182
- * If undefined, the default is "top-left"
1183
- *
1184
- * @example
1185
- * ```js
1186
- * async function createWin() {
1187
- * const app = await fin.Application.start({
1188
- * name: 'myApp',
1189
- * uuid: 'app-1',
1190
- * url: 'https://cdn.openfin.co/docs/javascript/stable/tutorial-Window.resizeBy.html',
1191
- * autoShow: true
1192
- * });
1193
- * return await app.getWindow();
1194
- * }
1195
- *
1196
- * async function resizeBy(left, top, anchor) {
1197
- * const win = await createWin();
1198
- * return await win.resizeBy(left, top, anchor)
1199
- * }
1200
- *
1201
- * resizeBy(580, 300, 'top-right').then(() => console.log('Resized')).catch(err => console.log(err));
1202
- * ```
1203
- */
1204
- resizeBy(deltaWidth: number, deltaHeight: number, anchor: OpenFin.AnchorType): Promise<void>;
1205
- /**
1206
- * Resizes the window to the specified dimensions.
1207
- * @param width The change in the width of the window
1208
- * @param height The change in the height of the window
1209
- * @param anchor Specifies a corner to remain fixed during the resize.
1210
- * Can take the values: "top-left", "top-right", "bottom-left", or "bottom-right".
1211
- * If undefined, the default is "top-left"
1212
- *
1213
- * @example
1214
- * ```js
1215
- * async function createWin() {
1216
- * const app = await fin.Application.start({
1217
- * name: 'myApp',
1218
- * uuid: 'app-1',
1219
- * url: 'https://cdn.openfin.co/docs/javascript/stable/tutorial-Window.resizeTo.html',
1220
- * autoShow: true
1221
- * });
1222
- * return await app.getWindow();
1223
- * }
1224
- *
1225
- * async function resizeTo(left, top, anchor) {
1226
- * const win = await createWin();
1227
- * return await win.resizeTo(left, top, anchor);
1228
- * }
1229
- *
1230
- * resizeTo(580, 300, 'top-left').then(() => console.log('Resized')).catch(err => console.log(err));
1231
- * ```
1232
- */
1233
- resizeTo(width: number, height: number, anchor: OpenFin.AnchorType): Promise<void>;
1234
- /**
1235
- * Restores the window to its normal state (i.e., unminimized, unmaximized).
1236
- *
1237
- * @example
1238
- * ```js
1239
- * async function createWin() {
1240
- * const app = await fin.Application.start({
1241
- * name: 'myApp',
1242
- * uuid: 'app-1',
1243
- * url: 'https://cdn.openfin.co/docs/javascript/stable/tutorial-Window.restore.html',
1244
- * autoShow: true
1245
- * });
1246
- * return await app.getWindow();
1247
- * }
1248
- *
1249
- * async function restore() {
1250
- * const win = await createWin();
1251
- * return await win.restore();
1252
- * }
1253
- *
1254
- * restore().then(() => console.log('Restored')).catch(err => console.log(err));
1255
- * ```
1256
- */
1257
- restore(): Promise<void>;
1258
- /**
1259
- * Will bring the window to the front of the entire stack and give it focus.
1260
- *
1261
- * @example
1262
- * ```js
1263
- * async function createWin() {
1264
- * const app = await fin.Application.start({
1265
- * name: 'myApp',
1266
- * uuid: 'app-1',
1267
- * url: 'https://cdn.openfin.co/docs/javascript/stable/tutorial-Window.setAsForeground.html',
1268
- * autoShow: true
1269
- * });
1270
- * return await app.getWindow();
1271
- * }
1272
- *
1273
- * async function setAsForeground() {
1274
- * const win = await createWin();
1275
- * return await win.setAsForeground()
1276
- * }
1277
- *
1278
- * setAsForeground().then(() => console.log('In the foreground')).catch(err => console.log(err));
1279
- * ```
1280
- */
1281
- setAsForeground(): Promise<void>;
1282
- /**
1283
- * Sets the window's size and position.
1284
- * @property { Bounds } bounds This is a * @type {string} name - name of the window.object that holds the propertys of
1285
- *
1286
- * @example
1287
- * ```js
1288
- * async function createWin() {
1289
- * const app = await fin.Application.start({
1290
- * name: 'myApp',
1291
- * uuid: 'app-1',
1292
- * url: 'https://cdn.openfin.co/docs/javascript/stable/tutorial-Window.setBounds.html',
1293
- * autoShow: true
1294
- * });
1295
- * return await app.getWindow();
1296
- * }
1297
- *
1298
- * async function setBounds(bounds) {
1299
- * const win = await createWin();
1300
- * return await win.setBounds(bounds);
1301
- * }
1302
- *
1303
- * setBounds({
1304
- * height: 100,
1305
- * width: 200,
1306
- * top: 400,
1307
- * left: 400
1308
- * }).then(() => console.log('Bounds set to window')).catch(err => console.log(err));
1309
- * ```
1310
- */
1311
- setBounds(bounds: Partial<OpenFin.Bounds>): Promise<void>;
1312
- /**
1313
- * Shows the window if it is hidden.
1314
- * @param force Show will be prevented from showing when force is false and
1315
- * ‘show-requested’ has been subscribed to for application’s main window.
1316
- *
1317
- * @example
1318
- * ```js
1319
- * async function createWin() {
1320
- * const app = await fin.Application.start({
1321
- * name: 'myApp',
1322
- * uuid: 'app-1',
1323
- * url: 'https://cdn.openfin.co/docs/javascript/stable/tutorial-Window.show.html',
1324
- * autoShow: false
1325
- * });
1326
- * return await app.getWindow();
1327
- * }
1328
- *
1329
- * async function show() {
1330
- * const win = await createWin();
1331
- * return await win.show()
1332
- * }
1333
- *
1334
- * show().then(() => console.log('Showing')).catch(err => console.log(err));
1335
- * ```
1336
- */
1337
- show(force?: boolean): Promise<void>;
1338
- /**
1339
- * Shows the window if it is hidden at the specified location.
1340
- * If the toggle parameter is set to true, the window will
1341
- * alternate between showing and hiding.
1342
- * @param left The left position of the window
1343
- * @param top The right position of the window
1344
- * @param force Show will be prevented from closing when force is false and
1345
- * ‘show-requested’ has been subscribed to for application’s main window
1346
- *
1347
- * @example
1348
- * ```js
1349
- * async function createWin() {
1350
- * const app = await fin.Application.start({
1351
- * name: 'myApp',
1352
- * uuid: 'app-1',
1353
- * url: 'https://cdn.openfin.co/docs/javascript/stable/tutorial-Window.showAt.html',
1354
- * autoShow: true
1355
- * });
1356
- * return await app.getWindow();
1357
- * }
1358
- *
1359
- * async function showAt(left, top) {
1360
- * const win = await createWin();
1361
- * return await win.showAt(left, top)
1362
- * }
1363
- *
1364
- * showAt(580, 300).then(() => console.log('Showing at')).catch(err => console.log(err));
1365
- * ```
1366
- */
1367
- showAt(left: number, top: number, force?: boolean): Promise<void>;
1368
- /**
1369
- * Shows the Chromium Developer Tools
1370
- *
1371
- * @tutorial Window.showDeveloperTools
1372
- */
1373
- /**
1374
- * Updates the window using the passed options.
1375
- *
1376
- * @remarks Values that are objects are deep-merged, overwriting only the values that are provided.
1377
- * @param options Changes a window's options that were defined upon creation. See tutorial
1378
- *
1379
- * @example
1380
- * ```js
1381
- * async function updateOptions() {
1382
- * const win = await fin.Window.getCurrent();
1383
- * return win.updateOptions({maxWidth: 100});
1384
- * }
1385
- * updateOptions().then(() => console.log('options is updated')).catch(err => console.error(err));
1386
- * ```
1387
- */
1388
- updateOptions(options: OpenFin.UpdatableWindowOptions): Promise<void>;
1389
- /**
1390
- * Provides credentials to authentication requests
1391
- * @param userName userName to provide to the authentication challenge
1392
- * @param password password to provide to the authentication challenge
1393
- *
1394
- * @example
1395
- * ```js
1396
- * fin.Application.wrap({uuid: 'OpenfinPOC'}).then(app => {
1397
- * app.on('window-auth-requested', evt => {
1398
- * let win = fin.Window.wrap({ uuid: evt.uuid, name: evt.name});
1399
- * win.authenticate('userName', 'P@assw0rd').then(()=> console.log('authenticated')).catch(err => console.log(err));
1400
- * });
1401
- * });
1402
- * ```
1403
- */
1404
- authenticate(userName: string, password: string): Promise<void>;
1405
- /**
1406
- * @typedef {object} ShowPopupMenuOptions
1407
- * @property {Array<MenuItemTemplate>} template - An array describing the menu to show.
1408
- * @property {number} [x] - The window x coordinate where to show the menu. Defaults to mouse position. If using must also use `y`.
1409
- * @property {number} [y] - The window y coordinate where to show the menu. Defaults to mouse position. If using must also use `x`
1410
- */
1411
- /**
1412
- * @typedef {object} MenuItemTemplate
1413
- * @property {*} data - Data to be returned if the user selects the element. Must be serializable. Large objects can have a performance impact.
1414
- * @property {'normal' | 'separator' | 'submenu' | 'checkbox'} [type] - Defaults to 'normal' unless a 'submenu' key exists
1415
- * @property {string} [label] - The text to show on the menu item. Should be left undefined for `type: 'separator'`
1416
- * @property {boolean} [enabled] - If false, the menu item will be greyed out and unclickable.
1417
- * @property {boolean} [visible] - If false, the menu item will be entirely hidden.
1418
- * @property {boolean} [checked] - Should only be specified for `checkbox` type menu items.
1419
- * @property {string} [icon] - Image Data URI with image dimensions inferred from the encoded string
1420
- * @property {Array<MenuItemTemplate>} [submenu] Should be specified for `submenu` type menu items. If `submenu` is specified, the `type: 'submenu'` can be omitted.
1421
- */
1422
- /**
1423
- * @typedef {object} MenuResult
1424
- * @property {'clicked' | 'closed'} result - Whether the user clicked on a menu item or the menu was closed (user clicked elsewhere).
1425
- * @property {* | undefined} [data] - The data property of the menu item clicked by the user. Only defined if result was `clicked`.
1426
- */
1427
- /**
1428
- * Shows a menu on the window.
1429
- *
1430
- * @remarks Returns a promise that resolves when the user has either selected an item or closed the menu. (This may take longer than other apis).
1431
- * 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.
1432
- * Calling this method will close previously opened menus.
1433
- * @experimental
1434
- * @param options
1435
- *
1436
- * @example
1437
- * This could be used to show a drop down menu over views in a platform window:
1438
- * ```js
1439
- * const template = [
1440
- * {
1441
- * label: 'Menu Item 1',
1442
- * data: 'hello from item 1'
1443
- * },
1444
- * { type: 'separator' },
1445
- * {
1446
- * label: 'Menu Item 2',
1447
- * type: 'checkbox',
1448
- * checked: true,
1449
- * data: 'The user clicked the checkbox'
1450
- * },
1451
- * {
1452
- * label: 'see more',
1453
- * enabled: false,
1454
- * submenu: [
1455
- * { label: 'submenu 1', data: 'hello from submenu' }
1456
- * ]
1457
- * }
1458
- * ]
1459
- * fin.me.showPopupMenu({ template }).then(r => {
1460
- * if (r.result === 'closed') {
1461
- * console.log('nothing happened');
1462
- * } else {
1463
- * console.log(r.data)
1464
- * }
1465
- * })
1466
- * ```
1467
- *
1468
- * Overriding the built in context menu (ote that this can be done per element or document wide):
1469
- * ```js
1470
- * document.addEventListener('contextmenu', e => {
1471
- * e.preventDefault();
1472
- * const template = [
1473
- * {
1474
- * label: 'Menu Item 1',
1475
- * data: 'hello from item 1'
1476
- * },
1477
- * { type: 'separator' },
1478
- * {
1479
- * label: 'Menu Item 2',
1480
- * type: 'checkbox',
1481
- * checked: true,
1482
- * data: 'The user clicked the checkbox'
1483
- * },
1484
- * {
1485
- * label: 'see more',
1486
- * enabled: false,
1487
- * submenu: [
1488
- * { label: 'submenu 1', data: 'hello from submenu' }
1489
- * ]
1490
- * }
1491
- * ]
1492
- * fin.me.showPopupMenu({ template, x: e.x, y: e.y }).then(r => {
1493
- * if (r.result === 'closed') {
1494
- * console.log('nothing happened');
1495
- * } else {
1496
- * console.log(r.data)
1497
- * }
1498
- * })
1499
- * })
1500
- * ```
1501
- */
1502
- showPopupMenu<T>(options: OpenFin.ShowPopupMenuOptions<T>): Promise<OpenFin.MenuResult<T>>;
1503
- /**
1504
- * Closes the window's popup menu, if one exists.
1505
- * @experimental
1506
- *
1507
- * @remarks Only one popup menu will ever be showing at a time. Calling `showPopupMenu` will automatically close
1508
- * any existing popup menu.
1509
- *
1510
- *
1511
- * @example
1512
- * This could be used to close a popup menu if the user's mouse leaves an element for example.
1513
- *
1514
- * ```js
1515
- * await fin.me.closePopupMenu();
1516
- * ```
1517
- */
1518
- closePopupMenu(): Promise<void>;
1519
- /**
1520
- * @typedef {object} PopupOptions
1521
- * @property {string} [name] - If a window with this `name` exists, it will be shown as a popup. Otherwise, a new window with this `name` will be created. If this `name` is undefined, `initialOptions.name` will be used. If this `name` and `intialOptions.name` are both undefined, a `name` will be generated.
1522
- * @property {string} [url] - Navigates to this `url` if showing an existing window as a popup, otherwise the newly created window will load this `url`.
1523
- * @property {Window~options} [initialOptions] - Window creation options when using `showPopupWindow` to create a new window.
1524
- * @property {Window~options} [additionalOptions] - Updatable window options applied to new and existing windows when shown as popups.
1525
- * @property {function} [onPopupResult] - Executed when this window's popup calls `dispatchPopupResult`. Note: if this is defined, `showPopupWindow` will not return a `PopupResult`.
1526
- * @property {function} [onPopupReady] - Executed when the popup window is shown. Provides the popup window to the provided function, and allows for easy access the popup window for additional behavior customization.
1527
- * @property {number} [height] - Height of the popup window (takes priority over `intialOptions` size properties).
1528
- * @property {number} [width] - Width of the popup window (takes priority over `intialOptions` size properties).
1529
- * @property {number} [x] - Left position where the popup window will be shown (relative to the window calling `showPopupWindow`).
1530
- * @property {number} [y] - Top position where the popup window will be shown (relative to the window calling `showPopupWindow`).
1531
- * @property {'modal' | 'hide' | 'close'} [blurBehavior] - Determines what happens if the popup window is blurred. 'modal' restricts resizing and positioning in the caller, 'hide' hides the popup window on blur and 'close' closes the popup window on blur.
1532
- * @property {'none' | 'hide' | 'close'} [resultDispatchBehavior] - Determines what happens when the popup window calls `dispatchPopupResult`. 'none' will do nothing, 'hide' hides the popup window on `dispatchPopupResult` and 'close' closes the popup window on `dispatchPopupResult`.
1533
- * @property {boolean} [focus] - Determines if the popup window should or should not be focused when it is shown.
1534
- * @property {boolean} [hideOnClose] - Hide the popup window instead of closing whenever `close` is called on it. Note: if this is `true` and `blurBehavior` and/or `resultDispatchBehavior` are set to `close`, the window will be hidden.
1535
- */
1536
- /**
1537
- * @typedef {object} PopupResult
1538
- * @property {Identity} identity - `name` and `uuid` of the popup window that called dispatched this result.
1539
- * @property {'clicked' | 'dismissed'} result - Result of the user interaction with the popup window.
1540
- * @property {* | undefined} [data] - Data passed to `dispatchPopupResult`.
1541
- */
1542
- /**
1543
- * Dispatch a result to the caller of `showPopupWindow`.
1544
- *
1545
- * @remarks If this window isn't currently being shown as a popup, this call will silently fail.
1546
- * @param data Serializable data to send to the caller window.
1547
- *
1548
- * @example
1549
- * ```js
1550
- * await fin.me.dispatchPopupResult({
1551
- * foo: 'bar'
1552
- * });
1553
- * ```
1554
- */
1555
- dispatchPopupResult(data: any): Promise<void>;
1556
- /**
1557
- * Prints the contents of the window.
1558
- *
1559
- * @param options Configuration for the print task.
1560
- * @remarks When `silent` is set to `true`, the API will pick the system's default printer if deviceName is empty
1561
- * and the default settings for printing.
1562
- *
1563
- * Use the CSS style `page-break-before: always;` to force print to a new page.
1564
- *
1565
- * @example
1566
- * ```js
1567
- * const win = fin.Window.getCurrentSync();
1568
- *
1569
- * win.print({ silent: false, deviceName: 'system-printer-name' }).then(() => {
1570
- * console.log('print call has been sent to the system');
1571
- * });
1572
- * ```
1573
- *
1574
- * If a window has embedded views, those views will not print by default. To print a window's contents including embedded views,
1575
- * use the `content` option:
1576
- *
1577
- * ```js
1578
- * const win = fin.Window.getCurrentSync();
1579
- *
1580
- * // Print embedded views
1581
- * win.print({ content: 'views' });
1582
- *
1583
- * // Print screenshot of current window
1584
- * win.print({ content: 'screenshot' })
1585
- * ```
1586
- *
1587
- * When `content` is set to `views`, the embedded views in the platform window will be concatenated and printed as
1588
- * individual pages. If `includeSelf` is set to `true`, the platform window itself will be printed as the first
1589
- * page - be aware that this page will *not* include the embedded views - it will only include the contents of
1590
- * the platform window itself (e.g. tab stacks), with blank spaces where the view contents would be embedded.
1591
- *
1592
- * Due to a known issue, view contents that are not visible at the time `print` is called will not appear when
1593
- * printing `contents: views`. This includes views that are obscured behind other active UI elements.
1594
- *
1595
- * To print the views embedded in their page context, set `content` to `screenshot`.
1596
- */
1597
- print(options?: OpenFin.WindowPrintOptions): Promise<void>;
1598
- }