@openfin/core 30.73.6 → 30.73.7

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 (158) hide show
  1. package/OpenFin.d.ts +1 -1729
  2. package/fin.d.ts +3 -4
  3. package/package.json +1 -1
  4. package/src/GlobalOpenFin.d.ts +4 -0
  5. package/src/OpenFin.d.ts +2938 -0
  6. package/src/OpenFin.js +4 -0
  7. package/src/api/application/Factory.d.ts +2 -0
  8. package/src/api/application/Factory.js +4 -3
  9. package/src/api/application/Instance.d.ts +3 -1
  10. package/src/api/application/Instance.js +1 -0
  11. package/src/api/application/index.js +7 -3
  12. package/src/api/base.d.ts +19 -15
  13. package/src/api/base.js +20 -22
  14. package/src/api/clipboard/index.d.ts +2 -0
  15. package/src/api/clipboard/index.js +1 -0
  16. package/src/api/events/application.d.ts +66 -56
  17. package/src/api/events/base.d.ts +33 -15
  18. package/src/api/events/channel.d.ts +13 -8
  19. package/src/api/events/eventAggregator.js +1 -9
  20. package/src/api/events/externalApplication.d.ts +10 -5
  21. package/src/api/events/frame.d.ts +13 -7
  22. package/src/api/events/globalHotkey.d.ts +11 -10
  23. package/src/api/events/platform.d.ts +10 -16
  24. package/src/api/events/system.d.ts +48 -18
  25. package/src/api/events/typedEventEmitter.d.ts +20 -0
  26. package/src/api/events/typedEventEmitter.js +2 -0
  27. package/src/api/events/view.d.ts +38 -54
  28. package/src/api/events/webcontents.d.ts +55 -28
  29. package/src/api/events/window.d.ts +148 -134
  30. package/src/api/external-application/Factory.d.ts +1 -0
  31. package/src/api/external-application/Instance.d.ts +2 -1
  32. package/src/api/external-application/index.js +7 -3
  33. package/src/api/fin.d.ts +3 -1
  34. package/src/api/fin.js +2 -2
  35. package/src/api/frame/Factory.d.ts +1 -0
  36. package/src/api/frame/Factory.js +2 -2
  37. package/src/api/frame/Instance.d.ts +3 -1
  38. package/src/api/frame/index.js +7 -3
  39. package/src/api/global-hotkey/index.d.ts +2 -2
  40. package/src/api/global-hotkey/index.js +6 -0
  41. package/src/api/interappbus/channel/channel.d.ts +6 -4
  42. package/src/api/interappbus/channel/channels-docs.d.ts +22 -0
  43. package/src/api/interappbus/channel/channels-docs.js +22 -0
  44. package/src/api/interappbus/channel/client.d.ts +2 -1
  45. package/src/api/interappbus/channel/client.js +24 -26
  46. package/src/api/interappbus/channel/connection-manager.d.ts +1 -0
  47. package/src/api/interappbus/channel/connection-manager.js +30 -28
  48. package/src/api/interappbus/channel/index.d.ts +6 -4
  49. package/src/api/interappbus/channel/index.js +34 -19
  50. package/src/api/interappbus/channel/protocols/classic/strategy.d.ts +3 -1
  51. package/src/api/interappbus/channel/protocols/classic/strategy.js +21 -22
  52. package/src/api/interappbus/channel/protocols/index.d.ts +3 -0
  53. package/src/api/interappbus/channel/protocols/protocol-manager.d.ts +1 -1
  54. package/src/api/interappbus/channel/protocols/rtc/endpoint.d.ts +3 -1
  55. package/src/api/interappbus/channel/protocols/rtc/endpoint.js +25 -27
  56. package/src/api/interappbus/channel/protocols/rtc/ice-manager.js +0 -1
  57. package/src/api/interappbus/channel/protocols/rtc/strategy.d.ts +3 -1
  58. package/src/api/interappbus/channel/protocols/rtc/strategy.js +29 -31
  59. package/src/api/interappbus/channel/protocols/strategy.d.ts +3 -1
  60. package/src/api/interappbus/channel/provider.d.ts +8 -4
  61. package/src/api/interappbus/channel/provider.js +140 -139
  62. package/src/api/interappbus/index.js +1 -1
  63. package/src/api/interop/Factory.d.ts +2 -0
  64. package/src/api/interop/Factory.js +20 -2
  65. package/src/api/interop/InteropBroker.d.ts +62 -39
  66. package/src/api/interop/InteropBroker.js +114 -55
  67. package/src/api/interop/InteropClient.d.ts +9 -0
  68. package/src/api/interop/InteropClient.js +46 -40
  69. package/src/api/interop/SessionContextGroupBroker.d.ts +1 -0
  70. package/src/api/interop/SessionContextGroupClient.d.ts +1 -0
  71. package/src/api/interop/SessionContextGroupClient.js +22 -24
  72. package/src/api/interop/fdc3/PrivateChannelClient.d.ts +9 -7
  73. package/src/api/interop/fdc3/PrivateChannelClient.js +6 -6
  74. package/src/api/interop/fdc3/PrivateChannelProvider.d.ts +1 -0
  75. package/src/api/interop/fdc3/fdc3-1.2.d.ts +14 -13
  76. package/src/api/interop/fdc3/fdc3-1.2.js +3 -14
  77. package/src/api/interop/fdc3/fdc3-2.0.d.ts +24 -21
  78. package/src/api/interop/fdc3/fdc3-2.0.js +27 -27
  79. package/src/api/interop/fdc3/fdc3.d.ts +12 -0
  80. package/src/api/interop/fdc3/overrideCheck.d.ts +4 -0
  81. package/src/api/interop/fdc3/overrideCheck.js +32 -0
  82. package/src/api/interop/fdc3/shapes/fdc3v1.d.ts +53 -0
  83. package/src/api/interop/fdc3/shapes/fdc3v1.js +4 -0
  84. package/src/api/interop/fdc3/shapes/fdc3v2.d.ts +75 -0
  85. package/src/api/interop/fdc3/shapes/fdc3v2.js +2 -0
  86. package/src/api/interop/fdc3/utils.d.ts +15 -5
  87. package/src/api/interop/fdc3/utils.js +29 -11
  88. package/src/api/interop/fdc3/versions.d.ts +1 -0
  89. package/src/api/interop/fdc3/versions.js +2 -0
  90. package/src/api/interop/index.js +7 -3
  91. package/src/api/interop/utils.d.ts +2 -0
  92. package/src/api/interop/utils.js +29 -15
  93. package/src/api/me.d.ts +3 -1
  94. package/src/api/platform/Factory.d.ts +6 -0
  95. package/src/api/platform/Factory.js +14 -5
  96. package/src/api/platform/Instance.d.ts +18 -3
  97. package/src/api/platform/Instance.js +30 -13
  98. package/src/api/platform/common-utils.d.ts +2 -1
  99. package/src/api/platform/index.js +7 -3
  100. package/src/api/platform/layout/Factory.d.ts +7 -1
  101. package/src/api/platform/layout/Factory.js +22 -20
  102. package/src/api/platform/layout/Instance.d.ts +6 -4
  103. package/src/api/platform/layout/Instance.js +2 -3
  104. package/src/api/platform/layout/controllers/splitter-controller.js +1 -1
  105. package/src/api/platform/layout/controllers/tab-drag-controller.d.ts +1 -0
  106. package/src/api/platform/layout/controllers/tab-drag-controller.js +1 -1
  107. package/src/api/platform/layout/index.js +7 -3
  108. package/src/api/platform/layout/shapes.d.ts +3 -1
  109. package/src/api/platform/layout/utils/bounds-observer.d.ts +1 -1
  110. package/src/api/platform/layout/utils/bounds-observer.js +7 -5
  111. package/src/api/platform/layout/utils/view-overlay.d.ts +1 -0
  112. package/src/api/platform/provider.d.ts +162 -0
  113. package/src/api/platform/provider.js +2 -0
  114. package/src/api/snapshot-source/Factory.d.ts +2 -0
  115. package/src/api/snapshot-source/Factory.js +2 -1
  116. package/src/api/snapshot-source/Instance.d.ts +1 -0
  117. package/src/api/snapshot-source/Instance.js +33 -35
  118. package/src/api/snapshot-source/index.js +7 -3
  119. package/src/api/snapshot-source/utils.d.ts +1 -0
  120. package/src/api/snapshot-source/utils.js +2 -1
  121. package/src/api/system/index.d.ts +76 -16
  122. package/src/api/system/index.js +127 -3
  123. package/src/api/view/Factory.d.ts +1 -0
  124. package/src/api/view/Factory.js +2 -2
  125. package/src/api/view/Instance.d.ts +17 -3
  126. package/src/api/view/Instance.js +20 -0
  127. package/src/api/view/index.js +7 -3
  128. package/src/api/webcontents/main.d.ts +20 -5
  129. package/src/api/webcontents/main.js +10 -0
  130. package/src/api/window/Factory.d.ts +1 -0
  131. package/src/api/window/Factory.js +2 -2
  132. package/src/api/window/Instance.d.ts +26 -3
  133. package/src/api/window/Instance.js +26 -1
  134. package/src/api/window/index.js +7 -3
  135. package/src/browser.d.ts +4 -4
  136. package/src/environment/browser.d.ts +3 -1
  137. package/src/environment/environment.d.ts +3 -1
  138. package/src/environment/node-env.d.ts +3 -1
  139. package/src/environment/node-env.js +2 -2
  140. package/src/environment/openfin-env.d.ts +3 -1
  141. package/src/environment/openfin-env.js +15 -17
  142. package/src/fdc3.d.ts +3 -0
  143. package/src/fdc3.js +1 -1
  144. package/src/mock.d.ts +2 -2
  145. package/src/mock.js +3 -3
  146. package/src/namespaces.d.ts +21 -0
  147. package/src/namespaces.js +24 -0
  148. package/src/shapes/WebOptions.d.ts +1 -0
  149. package/src/shapes/WindowOptions.d.ts +1 -0
  150. package/src/shapes/protocol.d.ts +34 -26
  151. package/src/transport/transport.d.ts +6 -5
  152. package/src/transport/transport.js +26 -28
  153. package/src/transport/wire.d.ts +9 -7
  154. package/src/util/http.d.ts +1 -1
  155. package/src/util/http.js +16 -11
  156. package/src/util/inaccessibleObject.d.ts +2 -0
  157. package/src/util/inaccessibleObject.js +49 -0
  158. package/src/util/normalize-config.js +5 -5
@@ -90,7 +90,7 @@ class TabDragController {
90
90
  const onDropAreaHighlighted = async (e) => {
91
91
  try {
92
92
  const { bounds } = e.detail;
93
- if (!lastBounds || !bounds_observer_1.isDomRectEqual(lastBounds, bounds)) {
93
+ if (!lastBounds || !(0, bounds_observer_1.isDomRectEqual)(lastBounds, bounds)) {
94
94
  lastBounds = bounds;
95
95
  await this.viewOverlay.renderOverlay(bounds);
96
96
  }
@@ -1,14 +1,18 @@
1
1
  "use strict";
2
2
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
3
  if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[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);
5
9
  }) : (function(o, m, k, k2) {
6
10
  if (k2 === undefined) k2 = k;
7
11
  o[k2] = m[k];
8
12
  }));
9
13
  var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
- for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p);
11
- }
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
12
16
  Object.defineProperty(exports, "__esModule", { value: true });
13
17
  __exportStar(require("./Factory"), exports);
14
18
  __exportStar(require("./Instance"), exports);
@@ -1,4 +1,5 @@
1
- import LayoutPresetType = OpenFin.LayoutPresetType;
1
+ import type * as OpenFin from '../../../OpenFin';
2
+ declare type LayoutPresetType = OpenFin.LayoutPresetType;
2
3
  export interface InitLayoutOptions {
3
4
  containerId?: string;
4
5
  }
@@ -9,3 +10,4 @@ export interface DragPayload {
9
10
  'view-config': OpenFin.ViewCreationOptions;
10
11
  'view-identity': [string, string, string];
11
12
  }
13
+ export {};
@@ -16,4 +16,4 @@ export declare const isDomRectEqual: (a: DOMRect, b: DOMRect) => boolean;
16
16
  * @returns Function which disposes the observers when invoked.
17
17
  * @ignore
18
18
  */
19
- export declare const observeBounds: (element: Element, onChange: (bounds: DOMRect) => void) => () => void;
19
+ export declare const observeBounds: (element: Element, onChange: (bounds: DOMRect) => Promise<void> | void) => (() => void);
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.observeBounds = exports.isDomRectEqual = void 0;
4
- exports.isDomRectEqual = (a, b) => {
4
+ const isDomRectEqual = (a, b) => {
5
5
  if (a.top !== b.top ||
6
6
  a.left !== b.left ||
7
7
  a.width !== b.width ||
@@ -12,6 +12,7 @@ exports.isDomRectEqual = (a, b) => {
12
12
  }
13
13
  return true;
14
14
  };
15
+ exports.isDomRectEqual = isDomRectEqual;
15
16
  /**
16
17
  * Observes the bounding client box rectangle of the given element for changes.
17
18
  *
@@ -29,13 +30,13 @@ exports.isDomRectEqual = (a, b) => {
29
30
  * @returns Function which disposes the observers when invoked.
30
31
  * @ignore
31
32
  */
32
- exports.observeBounds = (element, onChange) => {
33
+ const observeBounds = (element, onChange) => {
33
34
  let lastBounds;
34
- const checkBounds = () => {
35
+ const checkBounds = async () => {
35
36
  const currentBounds = element.getBoundingClientRect();
36
- if (!lastBounds || !exports.isDomRectEqual(lastBounds, currentBounds)) {
37
+ if (!lastBounds || !(0, exports.isDomRectEqual)(lastBounds, currentBounds)) {
37
38
  lastBounds = currentBounds;
38
- onChange(element.getBoundingClientRect());
39
+ await onChange(element.getBoundingClientRect());
39
40
  }
40
41
  };
41
42
  const resizeObserver = new ResizeObserver(() => checkBounds());
@@ -48,3 +49,4 @@ exports.observeBounds = (element, onChange) => {
48
49
  mutationObserver.disconnect();
49
50
  };
50
51
  };
52
+ exports.observeBounds = observeBounds;
@@ -1,3 +1,4 @@
1
+ import type * as OpenFin from '../../../../OpenFin';
1
2
  import Transport from '../../../../transport/transport';
2
3
  /**
3
4
  * Api client allowing an empty electron BrowserView to be rendered
@@ -0,0 +1,162 @@
1
+ import { WindowOptionsChangedEvent } from '../events/window';
2
+ import * as OpenFin from '../../OpenFin';
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
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,6 +1,8 @@
1
+ import type * as OpenFin from '../../OpenFin';
1
2
  import { Base } from '../base';
2
3
  import { SnapshotSource } from './Instance';
3
4
  /**
5
+ * @REMOVED
4
6
  * @typedef { object } SnapshotProvider
5
7
  * @property {getSnapshot} [getSnapshot]
6
8
  * @property {applySnapshot} [applySnapshot]
@@ -4,6 +4,7 @@ const base_1 = require("../base");
4
4
  const Instance_1 = require("./Instance");
5
5
  const utils_1 = require("./utils");
6
6
  /**
7
+ * @REMOVED
7
8
  * @typedef { object } SnapshotProvider
8
9
  * @property {getSnapshot} [getSnapshot]
9
10
  * @property {applySnapshot} [applySnapshot]
@@ -28,7 +29,7 @@ class SnapshotSourceModule extends base_1.Base {
28
29
  typeof provider.applySnapshot !== 'function') {
29
30
  throw new Error('you must pass in a valid SnapshotProvider');
30
31
  }
31
- const channel = await this.fin.InterApplicationBus.Channel.create(utils_1.getSnapshotSourceChannelName(fin.me.identity));
32
+ const channel = await this.fin.InterApplicationBus.Channel.create((0, utils_1.getSnapshotSourceChannelName)(this.fin.me));
32
33
  channel.register('get-snapshot', async () => {
33
34
  const snapshot = await provider.getSnapshot();
34
35
  return { snapshot };
@@ -1,3 +1,4 @@
1
+ import type * as OpenFin from '../../OpenFin';
1
2
  import { Base } from '../base';
2
3
  import Transport from '../../transport/transport';
3
4
  /**
@@ -1,18 +1,16 @@
1
1
  "use strict";
2
- var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, privateMap, value) {
3
- if (!privateMap.has(receiver)) {
4
- throw new TypeError("attempted to set private field on non-instance");
5
- }
6
- privateMap.set(receiver, value);
7
- return value;
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;
8
7
  };
9
- var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, privateMap) {
10
- if (!privateMap.has(receiver)) {
11
- throw new TypeError("attempted to get private field on non-instance");
12
- }
13
- return privateMap.get(receiver);
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);
14
12
  };
15
- var _identity, _getConnection, _getClient, _startConnection, _setUpConnectionListener;
13
+ var _SnapshotSource_identity, _SnapshotSource_getConnection, _SnapshotSource_getClient, _SnapshotSource_startConnection, _SnapshotSource_setUpConnectionListener;
16
14
  Object.defineProperty(exports, "__esModule", { value: true });
17
15
  exports.SnapshotSource = void 0;
18
16
  /* eslint-disable @typescript-eslint/no-non-null-assertion */
@@ -26,46 +24,46 @@ const connectionMap = new Map();
26
24
  class SnapshotSource extends base_1.Base {
27
25
  constructor(wire, id) {
28
26
  super(wire);
29
- _identity.set(this, void 0);
30
- _getConnection.set(this, () => {
27
+ _SnapshotSource_identity.set(this, void 0);
28
+ _SnapshotSource_getConnection.set(this, () => {
31
29
  if (!connectionMap.has(this.identity.uuid)) {
32
30
  connectionMap.set(this.identity.uuid, { eventFired: null, clientPromise: null });
33
31
  }
34
32
  return connectionMap.get(this.identity.uuid);
35
33
  });
36
- _getClient.set(this, () => {
37
- if (!__classPrivateFieldGet(this, _getConnection).call(this).clientPromise) {
38
- __classPrivateFieldGet(this, _getConnection).call(this).clientPromise = __classPrivateFieldGet(this, _startConnection).call(this);
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);
39
37
  }
40
- return __classPrivateFieldGet(this, _getConnection).call(this).clientPromise;
38
+ return __classPrivateFieldGet(this, _SnapshotSource_getConnection, "f").call(this).clientPromise;
41
39
  });
42
- _startConnection.set(this, async () => {
43
- const channelName = utils_1.getSnapshotSourceChannelName(this.identity);
40
+ _SnapshotSource_startConnection.set(this, async () => {
41
+ const channelName = (0, utils_1.getSnapshotSourceChannelName)(this.identity);
44
42
  try {
45
- if (!__classPrivateFieldGet(this, _getConnection).call(this).eventFired) {
46
- await __classPrivateFieldGet(this, _setUpConnectionListener).call(this);
43
+ if (!__classPrivateFieldGet(this, _SnapshotSource_getConnection, "f").call(this).eventFired) {
44
+ await __classPrivateFieldGet(this, _SnapshotSource_setUpConnectionListener, "f").call(this);
47
45
  }
48
46
  const client = await this.fin.InterApplicationBus.Channel.connect(channelName, { wait: false });
49
47
  client.onDisconnection(() => {
50
- __classPrivateFieldGet(this, _getConnection).call(this).clientPromise = null;
51
- __classPrivateFieldGet(this, _getConnection).call(this).eventFired = null;
48
+ __classPrivateFieldGet(this, _SnapshotSource_getConnection, "f").call(this).clientPromise = null;
49
+ __classPrivateFieldGet(this, _SnapshotSource_getConnection, "f").call(this).eventFired = null;
52
50
  });
53
51
  return client;
54
52
  }
55
53
  catch (e) {
56
- __classPrivateFieldGet(this, _getConnection).call(this).clientPromise = null;
54
+ __classPrivateFieldGet(this, _SnapshotSource_getConnection, "f").call(this).clientPromise = null;
57
55
  throw new Error("The targeted SnapshotSource is not currently initialized. Await this object's ready() method.");
58
56
  }
59
57
  });
60
- _setUpConnectionListener.set(this, async () => {
61
- const channelName = utils_1.getSnapshotSourceChannelName(this.identity);
58
+ _SnapshotSource_setUpConnectionListener.set(this, async () => {
59
+ const channelName = (0, utils_1.getSnapshotSourceChannelName)(this.identity);
62
60
  let resolve;
63
61
  let reject;
64
62
  const eventFired = new Promise((y, n) => {
65
63
  resolve = y;
66
64
  reject = n;
67
65
  });
68
- __classPrivateFieldGet(this, _getConnection).call(this).eventFired = eventFired;
66
+ __classPrivateFieldGet(this, _SnapshotSource_getConnection, "f").call(this).eventFired = eventFired;
69
67
  const listener = async (e) => {
70
68
  try {
71
69
  if (e.channelName === channelName) {
@@ -79,10 +77,10 @@ class SnapshotSource extends base_1.Base {
79
77
  };
80
78
  await this.fin.InterApplicationBus.Channel.on('connected', listener);
81
79
  });
82
- __classPrivateFieldSet(this, _identity, id);
80
+ __classPrivateFieldSet(this, _SnapshotSource_identity, id, "f");
83
81
  }
84
82
  get identity() {
85
- return __classPrivateFieldGet(this, _identity);
83
+ return __classPrivateFieldGet(this, _SnapshotSource_identity, "f");
86
84
  }
87
85
  /**
88
86
  * Method to determine if the SnapshotSource has been initialized.
@@ -99,11 +97,11 @@ class SnapshotSource extends base_1.Base {
99
97
  // eslint-disable-next-line no-async-promise-executor
100
98
  try {
101
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?
102
- await __classPrivateFieldGet(this, _getClient).call(this);
100
+ await __classPrivateFieldGet(this, _SnapshotSource_getClient, "f").call(this);
103
101
  }
104
102
  catch (e) {
105
103
  // it was not running.
106
- await __classPrivateFieldGet(this, _getConnection).call(this).eventFired;
104
+ await __classPrivateFieldGet(this, _SnapshotSource_getConnection, "f").call(this).eventFired;
107
105
  }
108
106
  }
109
107
  /**
@@ -114,7 +112,7 @@ class SnapshotSource extends base_1.Base {
114
112
  this.wire.sendAction('snapshot-source-get-snapshot').catch((e) => {
115
113
  // don't expose, analytics-only call
116
114
  });
117
- const client = await __classPrivateFieldGet(this, _getClient).call(this);
115
+ const client = await __classPrivateFieldGet(this, _SnapshotSource_getClient, "f").call(this);
118
116
  const response = (await client.dispatch('get-snapshot'));
119
117
  return (await response).snapshot;
120
118
  }
@@ -126,9 +124,9 @@ class SnapshotSource extends base_1.Base {
126
124
  this.wire.sendAction('snapshot-source-apply-snapshot').catch((e) => {
127
125
  // don't expose, analytics-only call
128
126
  });
129
- const client = await __classPrivateFieldGet(this, _getClient).call(this);
127
+ const client = await __classPrivateFieldGet(this, _SnapshotSource_getClient, "f").call(this);
130
128
  return client.dispatch('apply-snapshot', { snapshot });
131
129
  }
132
130
  }
133
131
  exports.SnapshotSource = SnapshotSource;
134
- _identity = new WeakMap(), _getConnection = new WeakMap(), _getClient = new WeakMap(), _startConnection = new WeakMap(), _setUpConnectionListener = new WeakMap();
132
+ _SnapshotSource_identity = new WeakMap(), _SnapshotSource_getConnection = new WeakMap(), _SnapshotSource_getClient = new WeakMap(), _SnapshotSource_startConnection = new WeakMap(), _SnapshotSource_setUpConnectionListener = new WeakMap();
@@ -1,14 +1,18 @@
1
1
  "use strict";
2
2
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
3
  if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[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);
5
9
  }) : (function(o, m, k, k2) {
6
10
  if (k2 === undefined) k2 = k;
7
11
  o[k2] = m[k];
8
12
  }));
9
13
  var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
- for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p);
11
- }
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
12
16
  Object.defineProperty(exports, "__esModule", { value: true });
13
17
  const Factory_1 = require("./Factory");
14
18
  exports.default = Factory_1.default;
@@ -1 +1,2 @@
1
+ import type * as OpenFin from '../../OpenFin';
1
2
  export declare const getSnapshotSourceChannelName: (id: OpenFin.ApplicationIdentity) => string;
@@ -2,4 +2,5 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getSnapshotSourceChannelName = void 0;
4
4
  const channelPrefix = 'snapshot-source-provider-';
5
- exports.getSnapshotSourceChannelName = (id) => `${channelPrefix}${id.uuid}`;
5
+ const getSnapshotSourceChannelName = (id) => `${channelPrefix}${id.uuid}`;
6
+ exports.getSnapshotSourceChannelName = getSnapshotSourceChannelName;