@openfin/core 33.76.31 → 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 (269) 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.31.tgz +0 -0
  14. package/src/OpenFin.d.ts +0 -3080
  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 -148
  33. package/src/api/application/Factory.js +0 -230
  34. package/src/api/application/Instance.d.ts +0 -321
  35. package/src/api/application/Instance.js +0 -453
  36. package/src/api/application/index.d.ts +0 -3
  37. package/src/api/application/index.js +0 -19
  38. package/src/api/base.d.ts +0 -48
  39. package/src/api/base.js +0 -177
  40. package/src/api/clipboard/index.d.ts +0 -92
  41. package/src/api/clipboard/index.js +0 -120
  42. package/src/api/events/application.d.ts +0 -146
  43. package/src/api/events/application.js +0 -2
  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 -30
  47. package/src/api/events/channel.js +0 -2
  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 -19
  53. package/src/api/events/externalApplication.js +0 -2
  54. package/src/api/events/frame.d.ts +0 -30
  55. package/src/api/events/frame.js +0 -2
  56. package/src/api/events/globalHotkey.d.ts +0 -20
  57. package/src/api/events/globalHotkey.js +0 -2
  58. package/src/api/events/platform.d.ts +0 -26
  59. package/src/api/events/platform.js +0 -2
  60. package/src/api/events/system.d.ts +0 -113
  61. package/src/api/events/system.js +0 -2
  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 -82
  65. package/src/api/events/view.js +0 -2
  66. package/src/api/events/webcontents.d.ts +0 -266
  67. package/src/api/events/webcontents.js +0 -2
  68. package/src/api/events/window.d.ts +0 -352
  69. package/src/api/events/window.js +0 -2
  70. package/src/api/external-application/Factory.d.ts +0 -27
  71. package/src/api/external-application/Factory.js +0 -40
  72. package/src/api/external-application/Instance.d.ts +0 -102
  73. package/src/api/external-application/Instance.js +0 -109
  74. package/src/api/external-application/index.d.ts +0 -3
  75. package/src/api/external-application/index.js +0 -19
  76. package/src/api/fin.d.ts +0 -51
  77. package/src/api/fin.js +0 -42
  78. package/src/api/frame/Factory.d.ts +0 -37
  79. package/src/api/frame/Factory.js +0 -69
  80. package/src/api/frame/Instance.d.ts +0 -123
  81. package/src/api/frame/Instance.js +0 -130
  82. package/src/api/frame/index.d.ts +0 -3
  83. package/src/api/frame/index.js +0 -19
  84. package/src/api/global-hotkey/index.d.ts +0 -38
  85. package/src/api/global-hotkey/index.js +0 -64
  86. package/src/api/interappbus/channel/channel.d.ts +0 -28
  87. package/src/api/interappbus/channel/channel.js +0 -77
  88. package/src/api/interappbus/channel/channels-docs.d.ts +0 -340
  89. package/src/api/interappbus/channel/channels-docs.js +0 -398
  90. package/src/api/interappbus/channel/client.d.ts +0 -24
  91. package/src/api/interappbus/channel/client.js +0 -89
  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 -25
  95. package/src/api/interappbus/channel/index.js +0 -169
  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 -34
  117. package/src/api/interappbus/channel/provider.js +0 -166
  118. package/src/api/interappbus/index.d.ts +0 -85
  119. package/src/api/interappbus/index.js +0 -175
  120. package/src/api/interop/Factory.d.ts +0 -37
  121. package/src/api/interop/Factory.js +0 -76
  122. package/src/api/interop/InteropBroker.d.ts +0 -437
  123. package/src/api/interop/InteropBroker.js +0 -1085
  124. package/src/api/interop/InteropClient.d.ts +0 -278
  125. package/src/api/interop/InteropClient.js +0 -459
  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/fdc3-1.2.d.ts +0 -208
  135. package/src/api/interop/fdc3/fdc3-1.2.js +0 -438
  136. package/src/api/interop/fdc3/fdc3-2.0.d.ts +0 -301
  137. package/src/api/interop/fdc3/fdc3-2.0.js +0 -482
  138. package/src/api/interop/fdc3/fdc3.d.ts +0 -12
  139. package/src/api/interop/fdc3/fdc3.js +0 -35
  140. package/src/api/interop/fdc3/overrideCheck.d.ts +0 -4
  141. package/src/api/interop/fdc3/overrideCheck.js +0 -32
  142. package/src/api/interop/fdc3/shapes/fdc3v1.d.ts +0 -53
  143. package/src/api/interop/fdc3/shapes/fdc3v1.js +0 -4
  144. package/src/api/interop/fdc3/shapes/fdc3v2.d.ts +0 -75
  145. package/src/api/interop/fdc3/shapes/fdc3v2.js +0 -2
  146. package/src/api/interop/fdc3/utils.d.ts +0 -45
  147. package/src/api/interop/fdc3/utils.js +0 -239
  148. package/src/api/interop/fdc3/versions.d.ts +0 -1
  149. package/src/api/interop/fdc3/versions.js +0 -2
  150. package/src/api/interop/index.d.ts +0 -4
  151. package/src/api/interop/index.js +0 -20
  152. package/src/api/interop/utils.d.ts +0 -18
  153. package/src/api/interop/utils.js +0 -61
  154. package/src/api/me.d.ts +0 -40
  155. package/src/api/me.js +0 -134
  156. package/src/api/platform/Factory.d.ts +0 -115
  157. package/src/api/platform/Factory.js +0 -184
  158. package/src/api/platform/Instance.d.ts +0 -150
  159. package/src/api/platform/Instance.js +0 -332
  160. package/src/api/platform/common-utils.d.ts +0 -7
  161. package/src/api/platform/common-utils.js +0 -16
  162. package/src/api/platform/index.d.ts +0 -3
  163. package/src/api/platform/index.js +0 -19
  164. package/src/api/platform/layout/Factory.d.ts +0 -114
  165. package/src/api/platform/layout/Factory.js +0 -174
  166. package/src/api/platform/layout/Instance.d.ts +0 -57
  167. package/src/api/platform/layout/Instance.js +0 -126
  168. package/src/api/platform/layout/controllers/layout-content-cache.d.ts +0 -9
  169. package/src/api/platform/layout/controllers/layout-content-cache.js +0 -54
  170. package/src/api/platform/layout/controllers/layout-entities-controller.d.ts +0 -119
  171. package/src/api/platform/layout/controllers/layout-entities-controller.js +0 -287
  172. package/src/api/platform/layout/entities/layout-entities.d.ts +0 -235
  173. package/src/api/platform/layout/entities/layout-entities.js +0 -312
  174. package/src/api/platform/layout/entities/shapes.d.ts +0 -6
  175. package/src/api/platform/layout/entities/shapes.js +0 -2
  176. package/src/api/platform/layout/index.d.ts +0 -2
  177. package/src/api/platform/layout/index.js +0 -18
  178. package/src/api/platform/layout/layout.constants.d.ts +0 -1
  179. package/src/api/platform/layout/layout.constants.js +0 -4
  180. package/src/api/platform/layout/shapes.d.ts +0 -16
  181. package/src/api/platform/layout/shapes.js +0 -2
  182. package/src/api/platform/layout/utils/layout-traversal.d.ts +0 -4
  183. package/src/api/platform/layout/utils/layout-traversal.js +0 -65
  184. package/src/api/platform/provider.d.ts +0 -163
  185. package/src/api/platform/provider.js +0 -2
  186. package/src/api/snapshot-source/Factory.d.ts +0 -38
  187. package/src/api/snapshot-source/Factory.js +0 -66
  188. package/src/api/snapshot-source/Instance.d.ts +0 -31
  189. package/src/api/snapshot-source/Instance.js +0 -132
  190. package/src/api/snapshot-source/index.d.ts +0 -3
  191. package/src/api/snapshot-source/index.js +0 -19
  192. package/src/api/snapshot-source/utils.d.ts +0 -2
  193. package/src/api/snapshot-source/utils.js +0 -6
  194. package/src/api/system/index.d.ts +0 -517
  195. package/src/api/system/index.js +0 -895
  196. package/src/api/view/Factory.d.ts +0 -50
  197. package/src/api/view/Factory.js +0 -103
  198. package/src/api/view/Instance.d.ts +0 -487
  199. package/src/api/view/Instance.js +0 -557
  200. package/src/api/view/index.d.ts +0 -3
  201. package/src/api/view/index.js +0 -19
  202. package/src/api/webcontents/main.d.ts +0 -32
  203. package/src/api/webcontents/main.js +0 -156
  204. package/src/api/window/Factory.d.ts +0 -45
  205. package/src/api/window/Factory.js +0 -91
  206. package/src/api/window/Instance.d.ts +0 -1090
  207. package/src/api/window/Instance.js +0 -1349
  208. package/src/api/window/index.d.ts +0 -3
  209. package/src/api/window/index.js +0 -19
  210. package/src/browser.d.ts +0 -10
  211. package/src/browser.js +0 -36
  212. package/src/environment/browser.d.ts +0 -29
  213. package/src/environment/browser.js +0 -60
  214. package/src/environment/environment.d.ts +0 -33
  215. package/src/environment/environment.js +0 -4
  216. package/src/environment/mockEnvironment.d.ts +0 -27
  217. package/src/environment/mockEnvironment.js +0 -61
  218. package/src/environment/node-env.d.ts +0 -29
  219. package/src/environment/node-env.js +0 -72
  220. package/src/fdc3.d.ts +0 -3
  221. package/src/fdc3.js +0 -9
  222. package/src/mock.d.ts +0 -3
  223. package/src/mock.js +0 -18
  224. package/src/namespaces.d.ts +0 -21
  225. package/src/namespaces.js +0 -24
  226. package/src/shapes/ERROR_BOX_TYPES.d.ts +0 -1
  227. package/src/shapes/ERROR_BOX_TYPES.js +0 -2
  228. package/src/shapes/WebOptions.d.ts +0 -13
  229. package/src/shapes/WebOptions.js +0 -2
  230. package/src/shapes/WindowOptions.d.ts +0 -43
  231. package/src/shapes/WindowOptions.js +0 -2
  232. package/src/shapes/protocol.d.ts +0 -200
  233. package/src/shapes/protocol.js +0 -2
  234. package/src/transport/mockWire.d.ts +0 -11
  235. package/src/transport/mockWire.js +0 -26
  236. package/src/transport/transport-errors.d.ts +0 -31
  237. package/src/transport/transport-errors.js +0 -79
  238. package/src/transport/transport.d.ts +0 -73
  239. package/src/transport/transport.js +0 -219
  240. package/src/transport/wire.d.ts +0 -77
  241. package/src/transport/wire.js +0 -36
  242. package/src/util/asyncFilter.d.ts +0 -1
  243. package/src/util/asyncFilter.js +0 -7
  244. package/src/util/channel-api-relay.d.ts +0 -13
  245. package/src/util/channel-api-relay.js +0 -47
  246. package/src/util/errors.d.ts +0 -10
  247. package/src/util/errors.js +0 -12
  248. package/src/util/exhaustive.d.ts +0 -1
  249. package/src/util/exhaustive.js +0 -7
  250. package/src/util/http.d.ts +0 -11
  251. package/src/util/http.js +0 -90
  252. package/src/util/inaccessibleObject.d.ts +0 -2
  253. package/src/util/inaccessibleObject.js +0 -49
  254. package/src/util/lazy.d.ts +0 -34
  255. package/src/util/lazy.js +0 -54
  256. package/src/util/normalize-config.d.ts +0 -3
  257. package/src/util/normalize-config.js +0 -52
  258. package/src/util/promises.d.ts +0 -5
  259. package/src/util/promises.js +0 -27
  260. package/src/util/ref-counter.d.ts +0 -7
  261. package/src/util/ref-counter.js +0 -52
  262. package/src/util/reversible-map.d.ts +0 -11
  263. package/src/util/reversible-map.js +0 -49
  264. package/src/util/runtimeVersioning.d.ts +0 -3
  265. package/src/util/runtimeVersioning.js +0 -25
  266. package/src/util/utilTypes.d.ts +0 -8
  267. package/src/util/utilTypes.js +0 -2
  268. package/src/util/validate.d.ts +0 -3
  269. package/src/util/validate.js +0 -11
@@ -1,65 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getAdjacentStacks = exports.doShareEdge = exports.getAdjacentItem = void 0;
4
- const getAdjacentItem = (component, edge) => {
5
- const { parent } = component;
6
- if (parent.isRoot) {
7
- return undefined;
8
- }
9
- const targetType = ['top', 'bottom'].includes(edge) ? 'column' : 'row';
10
- const edgeSiblingOffset = ['top', 'left'].includes(edge) ? -1 : 1;
11
- if (parent.type === targetType) {
12
- const componentIndex = parent.contentItems.indexOf(component);
13
- const targetIndex = componentIndex + edgeSiblingOffset;
14
- if (targetIndex >= 0 && targetIndex < parent.contentItems.length) {
15
- return parent.contentItems[targetIndex];
16
- }
17
- }
18
- return (0, exports.getAdjacentItem)(parent, edge);
19
- };
20
- exports.getAdjacentItem = getAdjacentItem;
21
- const doShareEdge = (from, to, edge) => {
22
- var _a, _b;
23
- const boundsFrom = (_a = from.element.get(0)) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
24
- const boundsTo = (_b = to.element.get(0)) === null || _b === void 0 ? void 0 : _b.getBoundingClientRect();
25
- if (!boundsFrom || !boundsTo) {
26
- return false;
27
- }
28
- if (['top', 'bottom'].includes(edge)) {
29
- const horizontallyOutOfBounds = boundsFrom.right < boundsTo.left || boundsFrom.left > boundsTo.right;
30
- return !horizontallyOutOfBounds;
31
- }
32
- const verticallyOutOfBounds = boundsFrom.bottom < boundsTo.top || boundsFrom.top > boundsTo.bottom;
33
- return !verticallyOutOfBounds;
34
- };
35
- exports.doShareEdge = doShareEdge;
36
- const getAdjacentStacks = (item, edge) => {
37
- const targetContainer = ['top', 'bottom'].includes(edge) ? 'row' : 'column';
38
- const findEdgeStacks = (component) => {
39
- if (component.type === 'stack') {
40
- if ((0, exports.doShareEdge)(item, component, edge)) {
41
- return [component];
42
- }
43
- return [];
44
- }
45
- if (component.type === 'root') {
46
- return [];
47
- }
48
- if (component.type === targetContainer) {
49
- return component.contentItems.map((contentItem) => findEdgeStacks(contentItem)).flat();
50
- }
51
- if (component.type !== targetContainer) {
52
- if (['top', 'right'].includes(edge)) {
53
- return findEdgeStacks(component.contentItems[component.contentItems.length - 1]);
54
- }
55
- return findEdgeStacks(component.contentItems[0]);
56
- }
57
- return [];
58
- };
59
- const edgeItem = (0, exports.getAdjacentItem)(item, edge);
60
- if (edgeItem) {
61
- return findEdgeStacks(edgeItem);
62
- }
63
- return [];
64
- };
65
- exports.getAdjacentStacks = getAdjacentStacks;
@@ -1,163 +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#init Platform.init}
6
- * in order to implement custom Platform behavior. (See {@tutorial 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 { WindowOption } payload Window options for the window to be created.
15
- * @param { Identity } [identity] If {@link Platform#createWindow Platform.createWindow} was called, the identity of the caller will be here.
16
- * If `createWindow` was called as part of applying a snapshot or creating a view without a target window, `identity` will be undefined.
17
- */
18
- createWindow(options: OpenFin.PlatformWindowCreationOptions, identity?: OpenFin.Identity): Promise<OpenFin.Window>;
19
- /**
20
- * Gets the current state of windows and their views and returns a snapshot object containing that info.
21
- * @param { undefined } payload Undefined unless you've defined a custom `getSnapshot` protocol.
22
- * @param { Identity } identity Identity of the entity that called {@link Platform#getSnapshot Platform.getSnapshot}.
23
- * @return { Promise<Snapshot> } Snapshot of current platform state.
24
- */
25
- getSnapshot(payload: undefined, identity: OpenFin.Identity): Promise<OpenFin.Snapshot>;
26
- /**
27
- * **NOTE**: Internal use only. It is not recommended to manage the state of individual views.
28
- * 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.
29
- * @param { Identity } payload Identity of the view.
30
- * @return { Promise<ViewState> }
31
- * @internal
32
- * @experimental
33
- */
34
- getViewSnapshot(payload: {
35
- viewIdentity: OpenFin.Identity;
36
- }): Promise<OpenFin.ViewState>;
37
- /**
38
- * Called when a snapshot is being applied and some windows in that snapshot would be fully or partially off-screen.
39
- * Returns an array of windows with modified positions, such that any off-screen windows are positioned in the top left
40
- * corner of the main monitor.
41
- * @param { Snapshot } snapshot The snapshot to be applied.
42
- * @param { WindowOptions[] } outOfBoundsWindows An array of WindowOptions for any windows that would be off-screen.
43
- * @return { Promise<WindowOptions[]> } An array of WindowOptions with their position modified to fit on screen.
44
- */
45
- positionOutOfBoundsWindows(snapshot: OpenFin.Snapshot, outOfBoundsWindows: OpenFin.WindowCreationOptions[]): Promise<OpenFin.WindowCreationOptions[]>;
46
- /**
47
- * Handles requests to apply a snapshot to the current Platform.
48
- * @param { ApplySnapshotPayload } payload Payload containing the snapshot to be applied, as well as any options.
49
- * @param { Identity } [identity] Identity of the entity that called {@link Platform#applySnapshot Platform.applySnapshot}.
50
- * Undefined if called internally (e.g. when opening the initial snapshot).
51
- * @return { Promise<void> }
52
- */
53
- applySnapshot(payload: OpenFin.ApplySnapshotPayload, identity?: OpenFin.Identity): Promise<void>;
54
- /**
55
- * Closes the current Platform and all child windows and views.
56
- * @param { undefined } payload Undefined unless you have implemented a custom quite protocol.
57
- * @param { Identity } identity Identity of the entity that called {@link Platform#quit Platform.quit}.
58
- * @return { Promise<void> }
59
- */
60
- quit(payload: undefined, identity: OpenFin.Identity): Promise<void>;
61
- /**
62
- * Closes a view
63
- * @param { CloseViewPayload } payload Specifies the `target` view to be closed.
64
- * @param { Identity } identity Identity of the entity that called {@link Platform#closeView Platform.closeView}.
65
- */
66
- closeView(payload: OpenFin.CloseViewPayload, identity?: OpenFin.Identity): Promise<any>;
67
- /**
68
- * Creates a new view and attaches it to a specified target window.
69
- * @param { CreateViewPayload } payload Creation options for the new view.
70
- * @param { Identity } identity Identity of the entity that called {@link Platform#createView Platform.createView}.
71
- * @return { Promise<void> }
72
- */
73
- createView(payload: OpenFin.CreateViewPayload, identity: OpenFin.Identity): Promise<OpenFin.View>;
74
- /** Handles requests to fetch manifests in the current platform.
75
- * @param { FetchManifestPayload } payload Payload containing the manifestUrl to be fetched.
76
- * @param { Identity } callerIdentity If {@link Platform#fetchManifest Platform.fetchManifest}
77
- * was called, the identity of the caller will be here.
78
- * If `fetchManifest` was called internally, `callerIdentity` will be the provider's identity.
79
- */
80
- fetchManifest(payload: OpenFin.FetchManifestPayload, callerIdentity: OpenFin.Identity): Promise<any>;
81
- /**
82
- * 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.
83
- * @param { ReplaceLayoutPayload } payload Contains the `target` window and an `opts` object with a `layout` property to apply.
84
- * @param { Identity } [identity] Identity of the entity that called {@link Platform#replaceLayout Platform.replaceLayout}.
85
- * Undefined if `replaceLayout` is called internally (e.g. while applying a snapshot).
86
- * @return { Promise<void> }
87
- */
88
- replaceLayout(payload: OpenFin.ReplaceLayoutPayload, identity?: OpenFin.Identity): Promise<void>;
89
- replaceView(payload: OpenFin.ReplaceViewPayload, identity?: OpenFin.Identity): Promise<void>;
90
- launchIntoPlatform(payload: OpenFin.LaunchIntoPlatformPayload): Promise<void>;
91
- /**
92
- * Handles requests to set a window's context. `target` may be a window or a view.
93
- * If it is a window, that window's `customContext` will be updated.
94
- * If it is a view, the `customContext` of that view's current host window will be updated.
95
- * @param { SetWindowContextPayload } payload Object containing the requested `context` update,
96
- * the `target`'s identity, and the target's `entityType`.
97
- * @param { Identity } [identity] Identity of the entity that called {@link Platform#setWindowContext Platform.setWindowContext}.
98
- * Undefined if `setWindowContext` is called internally (e.g. while applying a snapshot).
99
- * @return { Promise<any> } The new context.
100
- */
101
- setWindowContext(payload: OpenFin.SetWindowContextPayload, identity?: OpenFin.Identity): Promise<any>;
102
- /**
103
- * Handles requests to get a window's context. `target` may be a window or a view.
104
- * If it is a window, that window's `customContext` will be returned.
105
- * If it is a view, the `customContext` of that view's current host window will be returned.
106
- * @param { GetWindowContextPayload } payload Object containing the requested `context` update,
107
- * the `target`'s identity, and the target's `entityType`.
108
- * @param { Identity } [identity] Identity of the entity that called {@link Platform#getWindowContext Platform.getWindowContext}.
109
- * Undefined when `getWindowContext` is called internally
110
- * (e.g. when getting a window's context for the purpose of raising a "host-context-changed" event on a reparented view).
111
- * @return { Promise<any> } The new context.
112
- */
113
- getWindowContext(payload: OpenFin.GetWindowContextPayload, identity?: OpenFin.Identity): Promise<any>;
114
- /**
115
- * Called when a window's `customContext` is updated. Responsible for raising the `host-context-updated` event on that window's child views.
116
- * @param { WindowOptionsChangedEvent<'window', 'options-changed'> } payload The event payload for the window whose context has changed.
117
- * The new context will be contained as `payload.diff.customContext.newVal`.
118
- * @return { Promise<HostContextChangedPayload> } The event that it raised.
119
- */
120
- onWindowContextUpdated(payload: WindowOptionsChangedEvent): Promise<OpenFin.HostContextChangedPayload | undefined>;
121
- /**
122
- * Closes a Window.
123
- * By default it will fire any before unload handler set by a View in the Window.
124
- * This can be disabled by setting skipBeforeUnload in the options object of the payload.
125
- * This method is called by {@link Platform#closeWindow Platform.closeWindow}.
126
- * @param {CloseWindowPayload} payload Object that contains the Window Identity and related options.
127
- * @param {Identity} callerIdentity
128
- * @returns {Promise<void>}
129
- */
130
- closeWindow(payload: OpenFin.CloseWindowPayload, callerIdentity: OpenFin.Identity): Promise<void>;
131
- /**
132
- * Gets all the Views attached to a Window that should close along with it. This is meant to be overridable
133
- * in the case where you want to return other Views that may not be attached to the Window that is closing.
134
- * @param winId Identity of the Window that is closing
135
- * @returns { Promise<View> }
136
- */
137
- getViewsForWindowClose(windowId: OpenFin.Identity): Promise<OpenFin.View[]>;
138
- /**
139
- * 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.
140
- * @param {View[]} views Array of Views
141
- * @returns { Promise<ViewStatuses> }
142
- */
143
- checkViewsForPreventUnload(views: OpenFin.View[]): Promise<OpenFin.ViewStatuses>;
144
- /**
145
- * Handle the decision of whether a Window or specific View should close when trying to prevent an unload. This is meant to be overridden.
146
- * Called in {@link PlatformProvider#closeWindow PlatformProvider.closeWindow}.
147
- * Normally you would use this method to show a dialog indicating that there are Views that are trying to prevent an unload.
148
- * By default it will always return all Views passed into it as meaning to close.
149
- * @param {ViewsPreventingUnloadPayload} payload
150
- * @tutorial PlatformProvider.getUserDecisionForBeforeUnload
151
- * @returns {Promise<BeforeUnloadUserDecision>}
152
- */
153
- getUserDecisionForBeforeUnload(payload: OpenFin.ViewsPreventingUnloadPayload): Promise<OpenFin.BeforeUnloadUserDecision>;
154
- /**
155
- * Handles the closing of a Window and/or its Views. Called in {@link PlatformProvider#closeWindow PlatformProvider.closeWindow}.
156
- * The return of {@link PlatformProvider#getUserDecisionForBeforeUnload PlatformProvider.getUserDecisionForBeforeUnload} is passed into this method.
157
- * @param {Identity} winId Identity of the Window
158
- * @param {BeforeUnloadUserDecision} userDecision Decision object
159
- * @returns {Promise<void>}
160
- */
161
- handleViewsAndWindowClose(windowId: OpenFin.Identity, userDecision: OpenFin.BeforeUnloadUserDecision): Promise<void>;
162
- }
163
- export {};
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,38 +0,0 @@
1
- import type * as OpenFin from '../../OpenFin';
2
- import { Base } from '../base';
3
- import { SnapshotSource } from './Instance';
4
- /**
5
- * @REMOVED
6
- * @typedef { object } SnapshotProvider
7
- * @property {getSnapshot} [getSnapshot]
8
- * @property {applySnapshot} [applySnapshot]
9
- */
10
- /**
11
- * @lends SnapshotSource
12
- */
13
- export default class SnapshotSourceModule extends Base {
14
- /**
15
- * Initializes a SnapshotSource with the getSnapshot and applySnapshot methods defined.
16
- * @param { SnapshotProvider } provider
17
- * @return { Promise<void> }
18
- * @tutorial SnapshotSource.init
19
- * @static
20
- */
21
- init<T = any>(provider: OpenFin.SnapshotProvider<T>): Promise<void>;
22
- /**
23
- * Synchronously returns a SnapshotSource object that represents the current SnapshotSource.
24
- * @param { Identity } identity
25
- * @return { SnapshotSource }
26
- * @tutorial SnapshotSource.wrapSync
27
- * @static
28
- */
29
- wrapSync(identity: OpenFin.ApplicationIdentity): SnapshotSource;
30
- /**
31
- * Asynchronously returns a SnapshotSource object that represents the current SnapshotSource.
32
- * @param { Identity } identity
33
- * @return { Promise.<SnapshotSource> }
34
- * @tutorial SnapshotSource.wrap
35
- * @static
36
- */
37
- wrap(identity: OpenFin.ApplicationIdentity): Promise<SnapshotSource>;
38
- }
@@ -1,66 +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
- /**
7
- * @REMOVED
8
- * @typedef { object } SnapshotProvider
9
- * @property {getSnapshot} [getSnapshot]
10
- * @property {applySnapshot} [applySnapshot]
11
- */
12
- /**
13
- * @lends SnapshotSource
14
- */
15
- class SnapshotSourceModule extends base_1.Base {
16
- /**
17
- * Initializes a SnapshotSource with the getSnapshot and applySnapshot methods defined.
18
- * @param { SnapshotProvider } provider
19
- * @return { Promise<void> }
20
- * @tutorial SnapshotSource.init
21
- * @static
22
- */
23
- async init(provider) {
24
- this.wire.sendAction('snapshot-source-init').catch((e) => {
25
- // don't expose, analytics-only call
26
- });
27
- if (typeof provider !== 'object' ||
28
- typeof provider.getSnapshot !== 'function' ||
29
- typeof provider.applySnapshot !== 'function') {
30
- throw new Error('you must pass in a valid SnapshotProvider');
31
- }
32
- const channel = await this.fin.InterApplicationBus.Channel.create((0, utils_1.getSnapshotSourceChannelName)(this.fin.me));
33
- channel.register('get-snapshot', async () => {
34
- const snapshot = await provider.getSnapshot();
35
- return { snapshot };
36
- });
37
- channel.register('apply-snapshot', ({ snapshot }) => provider.applySnapshot(snapshot));
38
- }
39
- /**
40
- * Synchronously returns a SnapshotSource object that represents the current SnapshotSource.
41
- * @param { Identity } identity
42
- * @return { SnapshotSource }
43
- * @tutorial SnapshotSource.wrapSync
44
- * @static
45
- */
46
- wrapSync(identity) {
47
- this.wire.sendAction('snapshot-source-wrap-sync').catch((e) => {
48
- // don't expose, analytics-only call
49
- });
50
- return new Instance_1.SnapshotSource(this.wire, identity);
51
- }
52
- /**
53
- * Asynchronously returns a SnapshotSource object that represents the current SnapshotSource.
54
- * @param { Identity } identity
55
- * @return { Promise.<SnapshotSource> }
56
- * @tutorial SnapshotSource.wrap
57
- * @static
58
- */
59
- async wrap(identity) {
60
- this.wire.sendAction('snapshot-source-wrap').catch((e) => {
61
- // don't expose, analytics-only call
62
- });
63
- return this.wrapSync(identity);
64
- }
65
- }
66
- exports.default = SnapshotSourceModule;
@@ -1,31 +0,0 @@
1
- import type * as OpenFin from '../../OpenFin';
2
- import { Base } from '../base';
3
- import { Transport } from '../../transport/transport';
4
- /**
5
- * Enables configuring a SnapshotSource with custom getSnapshot and applySnapshot methods.
6
- * @namespace
7
- */
8
- export declare class SnapshotSource<T = any> extends Base {
9
- #private;
10
- constructor(wire: Transport, id: OpenFin.ApplicationIdentity);
11
- get identity(): OpenFin.ApplicationIdentity;
12
- /**
13
- * Method to determine if the SnapshotSource has been initialized.
14
- *
15
- * Use when the parent application is starting up to ensure the SnapshotSource is able to accept and
16
- * apply a snapshot using the {@link SnapshotSource#applySnapshot applySnapshot} method.
17
- * @return { Promise<void> }
18
- * @tutorial SnapshotSource.ready
19
- */
20
- ready(): Promise<void>;
21
- /**
22
- * Call the SnapshotSource's getSnapshot method defined by {@link SnapshotSource#init init}.
23
- * @return { Promise<any> }
24
- */
25
- getSnapshot(): Promise<T>;
26
- /**
27
- * Call the SnapshotSource's applySnapshot method defined by {@link SnapshotSource#init init}.
28
- * @return { Promise<void> }
29
- */
30
- applySnapshot(snapshot: T): Promise<void>;
31
- }
@@ -1,132 +0,0 @@
1
- "use strict";
2
- var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
3
- if (kind === "m") throw new TypeError("Private method is not writable");
4
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
5
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
6
- return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
7
- };
8
- var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
9
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
10
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
11
- return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
12
- };
13
- var _SnapshotSource_identity, _SnapshotSource_getConnection, _SnapshotSource_getClient, _SnapshotSource_startConnection, _SnapshotSource_setUpConnectionListener;
14
- Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.SnapshotSource = void 0;
16
- /* eslint-disable @typescript-eslint/no-non-null-assertion */
17
- const base_1 = require("../base");
18
- const utils_1 = require("./utils");
19
- const connectionMap = new Map();
20
- /**
21
- * Enables configuring a SnapshotSource with custom getSnapshot and applySnapshot methods.
22
- * @namespace
23
- */
24
- class SnapshotSource extends base_1.Base {
25
- constructor(wire, id) {
26
- super(wire);
27
- _SnapshotSource_identity.set(this, void 0);
28
- _SnapshotSource_getConnection.set(this, () => {
29
- if (!connectionMap.has(this.identity.uuid)) {
30
- connectionMap.set(this.identity.uuid, { eventFired: null, clientPromise: null });
31
- }
32
- return connectionMap.get(this.identity.uuid);
33
- });
34
- _SnapshotSource_getClient.set(this, () => {
35
- if (!__classPrivateFieldGet(this, _SnapshotSource_getConnection, "f").call(this).clientPromise) {
36
- __classPrivateFieldGet(this, _SnapshotSource_getConnection, "f").call(this).clientPromise = __classPrivateFieldGet(this, _SnapshotSource_startConnection, "f").call(this);
37
- }
38
- return __classPrivateFieldGet(this, _SnapshotSource_getConnection, "f").call(this).clientPromise;
39
- });
40
- _SnapshotSource_startConnection.set(this, async () => {
41
- const channelName = (0, utils_1.getSnapshotSourceChannelName)(this.identity);
42
- try {
43
- if (!__classPrivateFieldGet(this, _SnapshotSource_getConnection, "f").call(this).eventFired) {
44
- await __classPrivateFieldGet(this, _SnapshotSource_setUpConnectionListener, "f").call(this);
45
- }
46
- const client = await this.fin.InterApplicationBus.Channel.connect(channelName, { wait: false });
47
- client.onDisconnection(() => {
48
- __classPrivateFieldGet(this, _SnapshotSource_getConnection, "f").call(this).clientPromise = null;
49
- __classPrivateFieldGet(this, _SnapshotSource_getConnection, "f").call(this).eventFired = null;
50
- });
51
- return client;
52
- }
53
- catch (e) {
54
- __classPrivateFieldGet(this, _SnapshotSource_getConnection, "f").call(this).clientPromise = null;
55
- throw new Error("The targeted SnapshotSource is not currently initialized. Await this object's ready() method.");
56
- }
57
- });
58
- _SnapshotSource_setUpConnectionListener.set(this, async () => {
59
- const channelName = (0, utils_1.getSnapshotSourceChannelName)(this.identity);
60
- let resolve;
61
- let reject;
62
- const eventFired = new Promise((y, n) => {
63
- resolve = y;
64
- reject = n;
65
- });
66
- __classPrivateFieldGet(this, _SnapshotSource_getConnection, "f").call(this).eventFired = eventFired;
67
- const listener = async (e) => {
68
- try {
69
- if (e.channelName === channelName) {
70
- resolve();
71
- await this.fin.InterApplicationBus.Channel.removeListener('connected', listener);
72
- }
73
- }
74
- catch (err) {
75
- reject(err);
76
- }
77
- };
78
- await this.fin.InterApplicationBus.Channel.on('connected', listener);
79
- });
80
- __classPrivateFieldSet(this, _SnapshotSource_identity, id, "f");
81
- }
82
- get identity() {
83
- return __classPrivateFieldGet(this, _SnapshotSource_identity, "f");
84
- }
85
- /**
86
- * Method to determine if the SnapshotSource has been initialized.
87
- *
88
- * Use when the parent application is starting up to ensure the SnapshotSource is able to accept and
89
- * apply a snapshot using the {@link SnapshotSource#applySnapshot applySnapshot} method.
90
- * @return { Promise<void> }
91
- * @tutorial SnapshotSource.ready
92
- */
93
- async ready() {
94
- this.wire.sendAction('snapshot-source-ready').catch((e) => {
95
- // don't expose, analytics-only call
96
- });
97
- // eslint-disable-next-line no-async-promise-executor
98
- try {
99
- // If getClient was already called before this, do we have a timing issue where the channel might have been created but we missed the event but this still fails?
100
- await __classPrivateFieldGet(this, _SnapshotSource_getClient, "f").call(this);
101
- }
102
- catch (e) {
103
- // it was not running.
104
- await __classPrivateFieldGet(this, _SnapshotSource_getConnection, "f").call(this).eventFired;
105
- }
106
- }
107
- /**
108
- * Call the SnapshotSource's getSnapshot method defined by {@link SnapshotSource#init init}.
109
- * @return { Promise<any> }
110
- */
111
- async getSnapshot() {
112
- this.wire.sendAction('snapshot-source-get-snapshot').catch((e) => {
113
- // don't expose, analytics-only call
114
- });
115
- const client = await __classPrivateFieldGet(this, _SnapshotSource_getClient, "f").call(this);
116
- const response = (await client.dispatch('get-snapshot'));
117
- return (await response).snapshot;
118
- }
119
- /**
120
- * Call the SnapshotSource's applySnapshot method defined by {@link SnapshotSource#init init}.
121
- * @return { Promise<void> }
122
- */
123
- async applySnapshot(snapshot) {
124
- this.wire.sendAction('snapshot-source-apply-snapshot').catch((e) => {
125
- // don't expose, analytics-only call
126
- });
127
- const client = await __classPrivateFieldGet(this, _SnapshotSource_getClient, "f").call(this);
128
- return client.dispatch('apply-snapshot', { snapshot });
129
- }
130
- }
131
- exports.SnapshotSource = SnapshotSource;
132
- _SnapshotSource_identity = new WeakMap(), _SnapshotSource_getConnection = new WeakMap(), _SnapshotSource_getClient = new WeakMap(), _SnapshotSource_startConnection = new WeakMap(), _SnapshotSource_setUpConnectionListener = new WeakMap();
@@ -1,3 +0,0 @@
1
- import SnapshotModule from './Factory';
2
- export default SnapshotModule;
3
- export * from './Instance';
@@ -1,19 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- const Factory_1 = require("./Factory");
18
- exports.default = Factory_1.default;
19
- __exportStar(require("./Instance"), exports);
@@ -1,2 +0,0 @@
1
- import type * as OpenFin from '../../OpenFin';
2
- export declare const getSnapshotSourceChannelName: (id: OpenFin.ApplicationIdentity) => string;
@@ -1,6 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getSnapshotSourceChannelName = void 0;
4
- const channelPrefix = 'snapshot-source-provider-';
5
- const getSnapshotSourceChannelName = (id) => `${channelPrefix}${id.uuid}`;
6
- exports.getSnapshotSourceChannelName = getSnapshotSourceChannelName;