@openfin/core 33.76.36 → 33.76.38

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 +17104 -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,510 +0,0 @@
1
- import * as OpenFin from '../../OpenFin';
2
- type WindowOptionsChangedEvent = OpenFin.WindowEvents.WindowOptionsChangedEvent;
3
- /**
4
- * This class handles Platform actions. It does not need to be used directly by developers.
5
- * However, its methods can be overriden by passing an `overrideCallback` to {@link Platform.PlatformModule.init Platform.init}
6
- * in order to implement custom Platform behavior. (See {@link Platform.PlatformModule.init Platform.init})
7
- *
8
- * For an overview of Provider customization, see
9
- * {@link https://developers.openfin.co/docs/platform-customization#section-customizing-platform-behavior}.
10
- */
11
- export interface PlatformProvider {
12
- /**
13
- * Handles requests to create a window in the current platform.
14
- * @param payload Window options for the window to be created.
15
- * @param identity If {@link Platform.Platform#createWindow Platform.createWindow} was called, the identity of the caller will be here.
16
- *
17
- * @remarks If `createWindow` was called as part of applying a snapshot or creating a view without a target window,
18
- * `identity` will be undefined.
19
- *
20
- * Allows overriding a platform's default window creation behavior. All calls to {@link Platform#createWindow Platform.createWindow}
21
- * will pass through the override.
22
- *
23
- * @example
24
- * ```js
25
- * const overrideCallback = (PlatformProvider) => {
26
- * class Override extends PlatformProvider {
27
- * async createWindow(options, callerIdentity) {
28
- * if (options.reason === 'tearout') {
29
- * // Perhaps in our platform, we want tearout windows to have a certain initial context value
30
- * const customContext = {
31
- * security: 'STOCK',
32
- * currentView: 'detailed'
33
- * }
34
- * return super.createWindow({ ...options, customContext }, callerIdentity);
35
- * }
36
- * // default behavior for all other creation reasons
37
- * return super.createWindow(options, callerIdentity);
38
- * }
39
- * }
40
- * return new Override();
41
- * }
42
- *
43
- * fin.Platform.init({ overrideCallback });
44
- * ```
45
- */
46
- createWindow(options: OpenFin.PlatformWindowCreationOptions, identity?: OpenFin.Identity): Promise<OpenFin.Window>;
47
- /**
48
- * Gets the current state of windows and their views and returns a snapshot object containing that info.
49
- * @param payload Undefined unless you've defined a custom `getSnapshot` protocol.
50
- * @param identity Identity of the entity that called {@link Platform.Platform#getSnapshot Platform.getSnapshot}.
51
- * @returns Snapshot of current platform state.
52
- *
53
- * @remarks Allows overriding a platform's default snapshot behavior. All calls to
54
- * {@link Platform#getSnapshot Platform.getSnapshot} will pass through the override.
55
- *
56
- * @example
57
- * ```js
58
- * const overrideCallback = (PlatformProvider) => {
59
- * // Extend default behavior
60
- * class MyOverride extends PlatformProvider {
61
- * async getSnapshot(payload, callerIdentity) {
62
- * // Call super to access vanilla platform behavior
63
- * const snapshot = await super.getSnapshot();
64
- * // Perform any additional logic needed
65
- * const modifiedSnapshot = { ...snapshot, answer: 42 }
66
- * await saveSnapshotToServer(modifiedSnapshot);
67
- * return modifiedSnapshot;
68
- * }
69
- * }
70
- * // Return instance with methods to be consumed by Platform
71
- * return new MyOverride();
72
- * };
73
- * fin.Platform.init({ overrideCallback });
74
- *
75
- * async function saveSnapshotToServer(snapshot) {
76
- * // Send a snapshot to the server, store it locally somewhere, etc.
77
- * }
78
- * ```
79
- */
80
- getSnapshot(payload: undefined, identity: OpenFin.Identity): Promise<OpenFin.Snapshot>;
81
- /**
82
- * **NOTE**: Internal use only. It is not recommended to manage the state of individual views.
83
- * Gets the current state of a single view and returns an object with the options needed to restore that view as part of a snapshot.
84
- * @param payload Identity of the view.
85
- *
86
- * @internal
87
- * @experimental
88
- *
89
- * @remarks Allows overriding a platform's default `getViewSnapshot` behavior. All calls to
90
- * {@link Platform#getViewSnapshot Platform.getViewSnapshot} will pass through the override.
91
- *
92
- * @example
93
- * ```js
94
- * const overrideCallback = (PlatformProvider) => {
95
- * // Extend default behavior
96
- * class MyOverride extends PlatformProvider {
97
- * async getViewSnapshot(payload) {
98
- * // Call super to access vanilla platform behavior
99
- * const defaultViewSnapshot = await super.getViewSnapshot(payload);
100
- * // Perform any additional logic needed
101
- * const modifiedSnapshot = { ...defaultViewSnapshot, answer: 42 }
102
- * return modifiedSnapshot;
103
- * }
104
- * }
105
- * // Return instance with methods to be consumed by Platform
106
- * return new MyOverride();
107
- * };
108
- *
109
- * fin.Platform.init({ overrideCallback });
110
- * ```
111
- */
112
- getViewSnapshot(payload: {
113
- viewIdentity: OpenFin.Identity;
114
- }): Promise<OpenFin.ViewState>;
115
- /**
116
- * Called when a snapshot is being applied and some windows in that snapshot would be fully or partially off-screen.
117
- * Returns an array of windows with modified positions, such that any off-screen windows are positioned in the top left
118
- * corner of the main monitor.
119
- * @param snapshot The snapshot to be applied.
120
- * @param outOfBoundsWindows An array of WindowOptions for any windows that would be off-screen.
121
- * @returns An array of WindowOptions with their position modified to fit on screen.
122
- *
123
- * @example
124
- * ```js
125
- * const overrideCallback = (PlatformProvider) => {
126
- * class Override extends PlatformProvider {
127
- * async positionOutOfBoundsWindows(
128
- * snapshot, // The snapshot currently being applied
129
- * outOfBoundsWindows // An array of options for all windows that would be fully or partially off-screen.
130
- * ) {
131
- * // By default, this function cascades out-of-bounds windows from the top left of the main monitor.
132
- * // Perhaps we wish to instead position all such windows on the bottom right.
133
- *
134
- * // First, find the coordinates of the bottom right of the primary monitor
135
- * const {
136
- * primaryMonitor: {
137
- * availableRect: { right, bottom }
138
- * }
139
- * } = await fin.System.getMonitorInfo();
140
- *
141
- * // Update the coordinates of each out-of-bounds window to be bottom right
142
- * const newWindows = snapshot.windows.map((windowOptions) => {
143
- * if (outOfBoundsWindows.find(w => w.name === windowOptions.name)) {
144
- * // If the window is out of bounds, set a new initial top and left
145
- * const { defaultHeight, defaultWidth } = windowOptions;
146
- * return {
147
- * ...windowOptions,
148
- * defaultTop: bottom - defaultHeight,
149
- * defaultLeft: right - defaultWidth
150
- * }
151
- * } else {
152
- * return windowOptions;
153
- * }
154
- * })
155
- *
156
- * // Return all windows with desired bounds
157
- * return newWindows;
158
- * }
159
- * }
160
- * return new Override();
161
- * }
162
- *
163
- * fin.Platform.init({ overrideCallback });
164
- * ```
165
- */
166
- positionOutOfBoundsWindows(snapshot: OpenFin.Snapshot, outOfBoundsWindows: OpenFin.WindowCreationOptions[]): Promise<OpenFin.WindowCreationOptions[]>;
167
- /**
168
- * Handles requests to apply a snapshot to the current Platform.
169
- * @param payload Payload containing the snapshot to be applied, as well as any options.
170
- * @param identity Identity of the entity that called {@link Platform.Platform#applySnapshot Platform.applySnapshot}.
171
- * Undefined if called internally (e.g. when opening the initial snapshot).
172
- *
173
- *
174
- * @remarks Allows overriding a platform's default snapshot behavior. All calls to
175
- * {@link Platform#applySnapshot Platform.applySnapshot} will pass through the override.
176
- *
177
- * @example
178
- * ```js
179
- * const overrideCallback = (Provider) => {
180
- * class Override extends Provider {
181
- * async applySnapshot(payload, callerIdentity) {
182
- * const { snapshot, options } = payload;
183
- * // Perhaps in our platform, we wish to always use the closeExistingWindows option
184
- * return super.applySnapshot(
185
- * { snapshot, options: { ...options, closeExistingWindows: true }},
186
- * callerIdentity
187
- * );
188
- * }
189
- * return new Override();
190
- * }
191
- *
192
- * fin.Platform.init({ overrideCallback });
193
- * ```
194
- */
195
- applySnapshot(payload: OpenFin.ApplySnapshotPayload, identity?: OpenFin.Identity): Promise<void>;
196
- /**
197
- * Closes the current Platform and all child windows and views.
198
- * @param payload Undefined unless you have implemented a custom quite protocol.
199
- * @param identity Identity of the entity that called {@link Platform.Platform#quit Platform.quit}.
200
- *
201
- *
202
- * @remarks Allows overriding a platform's default shutdown behavior. All calls to {@link Platform#quit Platform.quit} will
203
- * pass through the override.
204
- *
205
- * @example
206
- * ```js
207
- * const overrideCallback = (PlatformProvider) => {
208
- * class Override extends PlatformProvider {
209
- * async quit(payload, callerIdentity) {
210
- * // Perhaps in our platform, we wish to take a snapshot and save it somewhere before shutting down
211
- * const snapshot = await this.getSnapshot();
212
- * await saveSnapshot(snapshot);
213
- * return super.quit(payload, callerIdentity);
214
- * }
215
- * }
216
- * return new Override();
217
- * }
218
- *
219
- * fin.Platform.init({ overrideCallback });
220
- *
221
- * async function saveSnapshot(snapshot) {
222
- * // Save the snapshot in localstorage, send to a server, etc.
223
- * }
224
- * ```
225
- */
226
- quit(payload: undefined, identity: OpenFin.Identity): Promise<void>;
227
- /**
228
- * Closes a view
229
- * @param payload Specifies the `target` view to be closed.
230
- * @param identity Identity of the entity that called {@link Platform.Platform#closeView Platform.closeView}.
231
- *
232
- * @remarks Allows overriding a platform's default view closing behavior. All calls to
233
- * {@link Platform#closeView Platform.closeView} will pass through the override.
234
- *
235
- * @example
236
- * ```js
237
- * const overrideCallback = (PlatformProvider) => {
238
- * class Override extends PlatformProvider {
239
- * async closeView(payload, callerIdentity) {
240
- * const { view } = payload;
241
- * // Perhaps in our platform, we want to take a snapshot and save it somewhere before closing certain views.
242
- * if (view.name === 'my-special-view') {
243
- * const snapshot = await fin.Platform.getCurrentSync().getSnapshot();
244
- * await saveSnapshot(snapshot);
245
- * }
246
- * return super.closeView(options, callerIdentity);
247
- * }
248
- * }
249
- * return new Override();
250
- * }
251
- *
252
- * fin.Platform.init({ overrideCallback });
253
- *
254
- * async function saveSnapshot(snapshot) {
255
- * // Save the snapshot in localstorage, send to a server, etc.
256
- * }
257
- * ```
258
- */
259
- closeView(payload: OpenFin.CloseViewPayload, identity?: OpenFin.Identity): Promise<any>;
260
- /**
261
- * Creates a new view and attaches it to a specified target window.
262
- * @param payload Creation options for the new view.
263
- * @param identity Identity of the entity that called {@link Platform.Platform#createView Platform.createView}.
264
- *
265
- */
266
- createView(payload: OpenFin.CreateViewPayload, identity: OpenFin.Identity): Promise<OpenFin.View>;
267
- /** Handles requests to fetch manifests in the current platform.
268
- * @param payload Payload containing the manifestUrl to be fetched.
269
- * @param callerIdentity If {@link Platform.Platform#fetchManifest Platform.fetchManifest}
270
- * was called, the identity of the caller will be here.
271
- *
272
- * @remarks If `fetchManifest` was called internally, `callerIdentity` will be the provider's identity.
273
- *
274
- * Allows overriding a platform's default behavior when fetching manifests. Overwriting this call will change how
275
- * {@link Platform#launchContentManifest Platform.launchContentManifest} and
276
- * {@link https://developers.openfin.co/docs/starting-the-platform-and-launching-content#section-deep-linking-fin-or-fins-link fins links}
277
- * fetch manifests. All calls to {@link Platform#fetchManifest Platform.fetchManifest} will also pass through the override.
278
- *
279
- * @example
280
- * ```js
281
- * const overrideCallback = (Provider) => {
282
- * class Override extends Provider {
283
- * async fetchManifest(payload, callerIdentity) {
284
- * const { manifestUrl } = payload;
285
- *
286
- * // I want to fetch certain URLs from the platform provider so that renderer-side cookies will be sent
287
- * if (manifestUrl === 'https://www.my-internal-manifest.com') {
288
- * const manifest = await fetch(manifestUrl);
289
- * return manifest.json();
290
- * }
291
- *
292
- * // Any requests that might be cross-origin should still be sent from the browser process
293
- * return super.fetchManifest(payload);
294
- * }
295
- * }
296
- * return new Override();
297
- * }
298
- *
299
- * fin.Platform.init({ overrideCallback });
300
- * ```
301
- */
302
- fetchManifest(payload: OpenFin.FetchManifestPayload, callerIdentity: OpenFin.Identity): Promise<any>;
303
- /**
304
- * Replaces a Platform window's layout with a new layout. Any views that were in the old layout but not the new layout will be destroyed.
305
- * @param payload Contains the `target` window and an `opts` object with a `layout` property to apply.
306
- * @param identity Identity of the entity that called {@link PlatformProvider#replaceLayout Platform.replaceLayout}.
307
- * Undefined if `replaceLayout` is called internally (e.g. while applying a snapshot).
308
- *
309
- *
310
- * @remarks Allows overriding a platform's default replaceLayout behavior. All calls to
311
- * {@link Platform#replaceLayout Platform.replaceLayout} will pass through the override.
312
- *
313
- * @example
314
- * ```js
315
- * const overrideCallback = (PlatformProvider) => {
316
- * class Override extends PlatformProvider {
317
- * async replaceLayout(payload, callerIdentity) {
318
- * // Perhaps in our platform, we wish to save an updated snapshot each time a layout is replaced
319
- * await super.replaceLayout(payload, callerIdentity);
320
- * const updatedSnapshot = await fin.Platform.getCurrentSync().getSnapshot();
321
- * await saveSnapshot(updatedSnapshot);
322
- * }
323
- * }
324
- * return new Override();
325
- * }
326
- *
327
- * fin.Platform.init({ overrideCallback });
328
- *
329
- * async function saveSnapshot(snapshot) {
330
- * // Save the snapshot in localstorage, send to a server, etc.
331
- * }
332
- * ```
333
- */
334
- replaceLayout(payload: OpenFin.ReplaceLayoutPayload, identity?: OpenFin.Identity): Promise<void>;
335
- replaceView(payload: OpenFin.ReplaceViewPayload, identity?: OpenFin.Identity): Promise<void>;
336
- /**
337
- * @internal
338
- */
339
- launchIntoPlatform(payload: OpenFin.LaunchIntoPlatformPayload): Promise<void>;
340
- /**
341
- * Handles requests to set a window's context. `target` may be a window or a view.
342
- * If it is a window, that window's `customContext` will be updated.
343
- * If it is a view, the `customContext` of that view's current host window will be updated.
344
- * @param payload Object containing the requested `context` update,
345
- * the `target`'s identity, and the target's `entityType`.
346
- * @param identity Identity of the entity that called {@link Platform.Platform#setWindowContext Platform.setWindowContext}.
347
- * Undefined if `setWindowContext` is called internally (e.g. while applying a snapshot).
348
- * @returns The new context.
349
- *
350
- * @remarks Allows overriding a platform's default setWindowContext behavior.
351
- * All calls to {@link Platform#setWindowContext Platform.setWindowContext} will pass through the override.
352
- *
353
- * @example
354
- * ```js
355
- * const overrideCallback = (PlatformProvider) => {
356
- * class Override extends PlatformProvider {
357
- * async setWindowContext(payload, callerIdentity) {
358
- * // Perhaps in our platform, we wish to only take context updates from windows
359
- * // and ignore updates sent from views.
360
- * if (payload.entityType === 'view') {
361
- * throw new Error('Updating window context from a view is not permitted in this platform.');
362
- * }
363
- * return super.setWindowContext(payload, callerIdentity);
364
- * }
365
- * }
366
- * return new Override();
367
- * }
368
- *
369
- * fin.Platform.init({ overrideCallback });
370
- * ```
371
- */
372
- setWindowContext(payload: OpenFin.SetWindowContextPayload, identity?: OpenFin.Identity): Promise<any>;
373
- /**
374
- * Handles requests to get a window's context. `target` may be a window or a view.
375
- * If it is a window, that window's `customContext` will be returned.
376
- * If it is a view, the `customContext` of that view's current host window will be returned.
377
- * @param payload Object containing the requested `context` update,
378
- * the `target`'s identity, and the target's `entityType`.
379
- * @param identity Identity of the entity that called {@link Platform.Platform#getWindowContext Platform.getWindowContext}.
380
- * Undefined when `getWindowContext` is called internally
381
- * (e.g. when getting a window's context for the purpose of raising a "host-context-changed" event on a reparented view).
382
- * @returns The new context.
383
- *
384
- * @remarks Allows overriding a platform's default getWindowContext behavior. All calls to
385
- * {@link Platform#getWindowContext Platform.getWindowContext} will pass through the override.
386
- *
387
- * @example
388
- * ```js
389
- * const overrideCallback = (PlatformProvider) => {
390
- * class Override extends PlatformProvider {
391
- * async getWindowContext(payload, callerIdentity) {
392
- * // Perhaps in our platform, we wish to make window context available only to views from a given domain.
393
- * const { entityType } = callerIdentity;
394
- * if (entityType === 'view') {
395
- * const { url } = await fin.View.wrapSync(callerIdentity).getInfo();
396
- * if (!url.startsWith('https://my.trusted-domain.com')) {
397
- * throw new Error('Only apps from trusted domains may use window context in this platform.');
398
- * }
399
- * }
400
- * return super.getWindowContext(payload, callerIdentity);
401
- * }
402
- * }
403
- * return new Override();
404
- * }
405
- *
406
- * fin.Platform.init({ overrideCallback });
407
- * ```
408
- */
409
- getWindowContext(payload: OpenFin.GetWindowContextPayload, identity?: OpenFin.Identity): Promise<any>;
410
- /**
411
- * Called when a window's `customContext` is updated. Responsible for raising the `host-context-updated` event on that window's child views.
412
- * @param payload The event payload for the window whose context has changed.
413
- * The new context will be contained as `payload.diff.customContext.newVal`.
414
- * @returns The event that it raised.
415
- */
416
- onWindowContextUpdated(payload: WindowOptionsChangedEvent): Promise<OpenFin.HostContextChangedPayload | undefined>;
417
- /**
418
- * Closes a Window.
419
- * By default it will fire any before unload handler set by a View in the Window.
420
- * This can be disabled by setting skipBeforeUnload in the options object of the payload.
421
- * This method is called by {@link Platform.Platform#closeWindow Platform.closeWindow}.
422
- * @param payload Object that contains the Window Identity and related options.
423
- * @param callerIdentity
424
- *
425
- *
426
- * @remarks This method calls a number of Platform Provider methods:
427
- *
428
- * * {@link PlatformProvider#getViewsForWindowClose}
429
- * * {@link PlatformProvider#checkViewsForPreventUnload}
430
- * * {@link PlatformProvider#getUserDecisionForBeforeUnload}
431
- * * {@link PlatformProvider#handleViewsAndWindowClose}
432
- *
433
- *
434
- * @example
435
- *
436
- * ```js
437
- * const overrideCallback = (PlatformProvider) => {
438
- * class Override extends PlatformProvider {
439
- * async closeWindow(payload, callerIdentity) {
440
- * const { windowId: { uuid, name }, options: { skipBeforeUnload } } = payload;
441
- * console.log(`${uuid}/${name} is closing and skipBeforeUnload is set to: ${skipBeforeUnload}`);
442
- * return super.closeWindow(payload, callerIdentity);
443
- * }
444
- * }
445
- * return new Override();
446
- * }
447
- *
448
- * fin.Platform.init({ overrideCallback });
449
- * ```
450
- */
451
- closeWindow(payload: OpenFin.CloseWindowPayload, callerIdentity: OpenFin.Identity): Promise<void>;
452
- /**
453
- * Gets all the Views attached to a Window that should close along with it. This is meant to be overridable
454
- * in the case where you want to return other Views that may not be attached to the Window that is closing.
455
- * @param winId Identity of the Window that is closing
456
- *
457
- */
458
- getViewsForWindowClose(windowId: OpenFin.Identity): Promise<OpenFin.View[]>;
459
- /**
460
- * It takes in an array of Views and returns an object specifying which of them are trying to prevent an unload and which are not.
461
- * @param views Array of Views
462
- *
463
- */
464
- checkViewsForPreventUnload(views: OpenFin.View[]): Promise<OpenFin.ViewStatuses>;
465
- /**
466
- * Handle the decision of whether a Window or specific View should close when trying to prevent an unload. This is meant to be overridden.
467
- * Called in {@link PlatformProvider#closeWindow PlatformProvider.closeWindow}.
468
- * Normally you would use this method to show a dialog indicating that there are Views that are trying to prevent an unload.
469
- * By default it will always return all Views passed into it as meaning to close.
470
- * @param payload
471
- * @example
472
- *
473
- * ```js
474
- * const overrideCallback = (PlatformProvider) => {
475
- * class Override extends PlatformProvider {
476
- * async getUserDecisionForBeforeUnload(payload, callerIdentity) {
477
- * const { windowShouldClose, viewsPreventingUnload, viewsNotPreventingUnload, windowId, closeType } = payload;
478
- *
479
- * // launch dialog and wait for user response
480
- * const continueWithClose = await showDialog(viewsPreventingUnload, windowId, closeType);
481
- *
482
- * if (continueWithClose) {
483
- * return { windowShouldClose, viewsToClose: [...viewsNotPreventingUnload, ...viewsPreventingUnload] };
484
- * } else {
485
- * return { windowShouldClose: false, viewsToClose: [] };
486
- * }
487
- * }
488
- * }
489
- * return new Override();
490
- * }
491
- *
492
- * fin.Platform.init({ overrideCallback });
493
- *
494
- * async function showDialog(viewsPreventingUnload, windowId, closeType) {
495
- * // Show a dialog and await for user response
496
- * }
497
- * ```
498
- *
499
- */
500
- getUserDecisionForBeforeUnload(payload: OpenFin.ViewsPreventingUnloadPayload): Promise<OpenFin.BeforeUnloadUserDecision>;
501
- /**
502
- * Handles the closing of a Window and/or its Views. Called in {@link PlatformProvider#closeWindow PlatformProvider.closeWindow}.
503
- * The return of {@link PlatformProvider#getUserDecisionForBeforeUnload PlatformProvider.getUserDecisionForBeforeUnload} is passed into this method.
504
- * @param winId Identity of the Window
505
- * @param userDecision Decision object
506
- *
507
- */
508
- handleViewsAndWindowClose(windowId: OpenFin.Identity, userDecision: OpenFin.BeforeUnloadUserDecision): Promise<void>;
509
- }
510
- export {};
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,53 +0,0 @@
1
- import type * as OpenFin from '../../OpenFin';
2
- import { Base } from '../base';
3
- import { SnapshotSource } from './Instance';
4
- export default class SnapshotSourceModule extends Base {
5
- /**
6
- * Initializes a SnapshotSource with the getSnapshot and applySnapshot methods defined.
7
- * @param provider
8
- *
9
- * @example
10
- * ```js
11
- * const snapshotProvider = {
12
- * async getSnapshot() {
13
- * const bounds = await fin.me.getBounds();
14
- * return bounds;
15
- * },
16
- * async applySnapshot(snapshot) {
17
- * await fin.me.setBounds(snapshot);
18
- * return undefined;
19
- * }
20
- * }
21
- *
22
- * await fin.SnapshotSource.init(snapshotProvider);
23
- * ```
24
- * @static
25
- */
26
- init<T = any>(provider: OpenFin.SnapshotProvider<T>): Promise<void>;
27
- /**
28
- * Synchronously returns a SnapshotSource object that represents the current SnapshotSource.
29
- * @param identity
30
- *
31
- * @example
32
- * ```js
33
- * const snapshotSource = fin.SnapshotSource.wrapSync(fin.me);
34
- * // Use wrapped instance's getSnapshot method, e.g.:
35
- * const snapshot = await snapshotSource.getSnapshot();
36
- * ```
37
- * @static
38
- */
39
- wrapSync(identity: OpenFin.ApplicationIdentity): SnapshotSource;
40
- /**
41
- * Asynchronously returns a SnapshotSource object that represents the current SnapshotSource.
42
- * @param identity
43
- *
44
- * @example
45
- * ```js
46
- * const snapshotSource = await fin.SnapshotSource.wrap(fin.me);
47
- * // Use wrapped instance's getSnapshot method, e.g.:
48
- * const snapshot = await snapshotSource.getSnapshot();
49
- * ```
50
- * @static
51
- */
52
- wrap(identity: OpenFin.ApplicationIdentity): Promise<SnapshotSource>;
53
- }
@@ -1,81 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const base_1 = require("../base");
4
- const Instance_1 = require("./Instance");
5
- const utils_1 = require("./utils");
6
- class SnapshotSourceModule extends base_1.Base {
7
- /**
8
- * Initializes a SnapshotSource with the getSnapshot and applySnapshot methods defined.
9
- * @param provider
10
- *
11
- * @example
12
- * ```js
13
- * const snapshotProvider = {
14
- * async getSnapshot() {
15
- * const bounds = await fin.me.getBounds();
16
- * return bounds;
17
- * },
18
- * async applySnapshot(snapshot) {
19
- * await fin.me.setBounds(snapshot);
20
- * return undefined;
21
- * }
22
- * }
23
- *
24
- * await fin.SnapshotSource.init(snapshotProvider);
25
- * ```
26
- * @static
27
- */
28
- async init(provider) {
29
- this.wire.sendAction('snapshot-source-init').catch((e) => {
30
- // don't expose, analytics-only call
31
- });
32
- if (typeof provider !== 'object' ||
33
- typeof provider.getSnapshot !== 'function' ||
34
- typeof provider.applySnapshot !== 'function') {
35
- throw new Error('you must pass in a valid SnapshotProvider');
36
- }
37
- const channel = await this.fin.InterApplicationBus.Channel.create((0, utils_1.getSnapshotSourceChannelName)(this.fin.me));
38
- channel.register('get-snapshot', async () => {
39
- const snapshot = await provider.getSnapshot();
40
- return { snapshot };
41
- });
42
- channel.register('apply-snapshot', ({ snapshot }) => provider.applySnapshot(snapshot));
43
- }
44
- /**
45
- * Synchronously returns a SnapshotSource object that represents the current SnapshotSource.
46
- * @param identity
47
- *
48
- * @example
49
- * ```js
50
- * const snapshotSource = fin.SnapshotSource.wrapSync(fin.me);
51
- * // Use wrapped instance's getSnapshot method, e.g.:
52
- * const snapshot = await snapshotSource.getSnapshot();
53
- * ```
54
- * @static
55
- */
56
- wrapSync(identity) {
57
- this.wire.sendAction('snapshot-source-wrap-sync').catch((e) => {
58
- // don't expose, analytics-only call
59
- });
60
- return new Instance_1.SnapshotSource(this.wire, identity);
61
- }
62
- /**
63
- * Asynchronously returns a SnapshotSource object that represents the current SnapshotSource.
64
- * @param identity
65
- *
66
- * @example
67
- * ```js
68
- * const snapshotSource = await fin.SnapshotSource.wrap(fin.me);
69
- * // Use wrapped instance's getSnapshot method, e.g.:
70
- * const snapshot = await snapshotSource.getSnapshot();
71
- * ```
72
- * @static
73
- */
74
- async wrap(identity) {
75
- this.wire.sendAction('snapshot-source-wrap').catch((e) => {
76
- // don't expose, analytics-only call
77
- });
78
- return this.wrapSync(identity);
79
- }
80
- }
81
- exports.default = SnapshotSourceModule;