@openfin/core 30.73.5 → 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.
- package/OpenFin.d.ts +1 -1729
- package/fin.d.ts +3 -4
- package/package.json +1 -1
- package/src/GlobalOpenFin.d.ts +4 -0
- package/src/OpenFin.d.ts +2938 -0
- package/src/OpenFin.js +4 -0
- package/src/api/application/Factory.d.ts +2 -0
- package/src/api/application/Factory.js +4 -3
- package/src/api/application/Instance.d.ts +3 -1
- package/src/api/application/Instance.js +1 -0
- package/src/api/application/index.js +7 -3
- package/src/api/base.d.ts +19 -15
- package/src/api/base.js +20 -22
- package/src/api/clipboard/index.d.ts +2 -0
- package/src/api/clipboard/index.js +1 -0
- package/src/api/events/application.d.ts +66 -56
- package/src/api/events/base.d.ts +33 -15
- package/src/api/events/channel.d.ts +13 -8
- package/src/api/events/eventAggregator.js +1 -9
- package/src/api/events/externalApplication.d.ts +10 -5
- package/src/api/events/frame.d.ts +13 -7
- package/src/api/events/globalHotkey.d.ts +11 -10
- package/src/api/events/platform.d.ts +10 -16
- package/src/api/events/system.d.ts +48 -18
- package/src/api/events/typedEventEmitter.d.ts +20 -0
- package/src/api/events/typedEventEmitter.js +2 -0
- package/src/api/events/view.d.ts +38 -54
- package/src/api/events/webcontents.d.ts +55 -28
- package/src/api/events/window.d.ts +148 -134
- package/src/api/external-application/Factory.d.ts +1 -0
- package/src/api/external-application/Instance.d.ts +2 -1
- package/src/api/external-application/index.js +7 -3
- package/src/api/fin.d.ts +3 -1
- package/src/api/fin.js +2 -2
- package/src/api/frame/Factory.d.ts +1 -0
- package/src/api/frame/Factory.js +2 -2
- package/src/api/frame/Instance.d.ts +3 -1
- package/src/api/frame/index.js +7 -3
- package/src/api/global-hotkey/index.d.ts +2 -2
- package/src/api/global-hotkey/index.js +6 -0
- package/src/api/interappbus/channel/channel.d.ts +6 -4
- package/src/api/interappbus/channel/channels-docs.d.ts +22 -0
- package/src/api/interappbus/channel/channels-docs.js +22 -0
- package/src/api/interappbus/channel/client.d.ts +2 -1
- package/src/api/interappbus/channel/client.js +24 -26
- package/src/api/interappbus/channel/connection-manager.d.ts +1 -0
- package/src/api/interappbus/channel/connection-manager.js +30 -28
- package/src/api/interappbus/channel/index.d.ts +6 -4
- package/src/api/interappbus/channel/index.js +34 -19
- package/src/api/interappbus/channel/protocols/classic/strategy.d.ts +3 -1
- package/src/api/interappbus/channel/protocols/classic/strategy.js +21 -22
- package/src/api/interappbus/channel/protocols/index.d.ts +3 -0
- package/src/api/interappbus/channel/protocols/protocol-manager.d.ts +1 -1
- package/src/api/interappbus/channel/protocols/rtc/endpoint.d.ts +3 -1
- package/src/api/interappbus/channel/protocols/rtc/endpoint.js +25 -27
- package/src/api/interappbus/channel/protocols/rtc/ice-manager.js +0 -1
- package/src/api/interappbus/channel/protocols/rtc/strategy.d.ts +3 -1
- package/src/api/interappbus/channel/protocols/rtc/strategy.js +29 -31
- package/src/api/interappbus/channel/protocols/strategy.d.ts +3 -1
- package/src/api/interappbus/channel/provider.d.ts +8 -4
- package/src/api/interappbus/channel/provider.js +140 -139
- package/src/api/interappbus/index.js +1 -1
- package/src/api/interop/Factory.d.ts +2 -0
- package/src/api/interop/Factory.js +20 -2
- package/src/api/interop/InteropBroker.d.ts +62 -39
- package/src/api/interop/InteropBroker.js +114 -55
- package/src/api/interop/InteropClient.d.ts +9 -0
- package/src/api/interop/InteropClient.js +46 -40
- package/src/api/interop/SessionContextGroupBroker.d.ts +1 -0
- package/src/api/interop/SessionContextGroupClient.d.ts +1 -0
- package/src/api/interop/SessionContextGroupClient.js +22 -24
- package/src/api/interop/fdc3/PrivateChannelClient.d.ts +9 -7
- package/src/api/interop/fdc3/PrivateChannelClient.js +6 -6
- package/src/api/interop/fdc3/PrivateChannelProvider.d.ts +1 -0
- package/src/api/interop/fdc3/fdc3-1.2.d.ts +14 -13
- package/src/api/interop/fdc3/fdc3-1.2.js +3 -14
- package/src/api/interop/fdc3/fdc3-2.0.d.ts +24 -21
- package/src/api/interop/fdc3/fdc3-2.0.js +27 -27
- package/src/api/interop/fdc3/fdc3.d.ts +12 -0
- package/src/api/interop/fdc3/overrideCheck.d.ts +4 -0
- package/src/api/interop/fdc3/overrideCheck.js +32 -0
- package/src/api/interop/fdc3/shapes/fdc3v1.d.ts +53 -0
- package/src/api/interop/fdc3/shapes/fdc3v1.js +4 -0
- package/src/api/interop/fdc3/shapes/fdc3v2.d.ts +75 -0
- package/src/api/interop/fdc3/shapes/fdc3v2.js +2 -0
- package/src/api/interop/fdc3/utils.d.ts +15 -5
- package/src/api/interop/fdc3/utils.js +29 -11
- package/src/api/interop/fdc3/versions.d.ts +1 -0
- package/src/api/interop/fdc3/versions.js +2 -0
- package/src/api/interop/index.js +7 -3
- package/src/api/interop/utils.d.ts +2 -0
- package/src/api/interop/utils.js +29 -15
- package/src/api/me.d.ts +3 -1
- package/src/api/platform/Factory.d.ts +6 -0
- package/src/api/platform/Factory.js +14 -5
- package/src/api/platform/Instance.d.ts +18 -3
- package/src/api/platform/Instance.js +30 -13
- package/src/api/platform/common-utils.d.ts +2 -1
- package/src/api/platform/index.js +7 -3
- package/src/api/platform/layout/Factory.d.ts +7 -1
- package/src/api/platform/layout/Factory.js +22 -20
- package/src/api/platform/layout/Instance.d.ts +6 -4
- package/src/api/platform/layout/Instance.js +2 -3
- package/src/api/platform/layout/controllers/splitter-controller.js +1 -1
- package/src/api/platform/layout/controllers/tab-drag-controller.d.ts +1 -0
- package/src/api/platform/layout/controllers/tab-drag-controller.js +1 -1
- package/src/api/platform/layout/index.js +7 -3
- package/src/api/platform/layout/shapes.d.ts +3 -1
- package/src/api/platform/layout/utils/bounds-observer.d.ts +1 -1
- package/src/api/platform/layout/utils/bounds-observer.js +7 -5
- package/src/api/platform/layout/utils/view-overlay.d.ts +1 -0
- package/src/api/platform/provider.d.ts +162 -0
- package/src/api/platform/provider.js +2 -0
- package/src/api/snapshot-source/Factory.d.ts +2 -0
- package/src/api/snapshot-source/Factory.js +2 -1
- package/src/api/snapshot-source/Instance.d.ts +1 -0
- package/src/api/snapshot-source/Instance.js +33 -35
- package/src/api/snapshot-source/index.js +7 -3
- package/src/api/snapshot-source/utils.d.ts +1 -0
- package/src/api/snapshot-source/utils.js +2 -1
- package/src/api/system/index.d.ts +76 -16
- package/src/api/system/index.js +127 -3
- package/src/api/view/Factory.d.ts +1 -0
- package/src/api/view/Factory.js +2 -2
- package/src/api/view/Instance.d.ts +17 -3
- package/src/api/view/Instance.js +20 -0
- package/src/api/view/index.js +7 -3
- package/src/api/webcontents/main.d.ts +20 -5
- package/src/api/webcontents/main.js +10 -0
- package/src/api/window/Factory.d.ts +1 -0
- package/src/api/window/Factory.js +2 -2
- package/src/api/window/Instance.d.ts +26 -3
- package/src/api/window/Instance.js +26 -1
- package/src/api/window/index.js +7 -3
- package/src/browser.d.ts +4 -4
- package/src/environment/browser.d.ts +3 -1
- package/src/environment/environment.d.ts +3 -1
- package/src/environment/node-env.d.ts +3 -1
- package/src/environment/node-env.js +2 -2
- package/src/environment/openfin-env.d.ts +3 -1
- package/src/environment/openfin-env.js +15 -17
- package/src/fdc3.d.ts +3 -0
- package/src/fdc3.js +1 -1
- package/src/mock.d.ts +2 -2
- package/src/mock.js +3 -3
- package/src/namespaces.d.ts +21 -0
- package/src/namespaces.js +24 -0
- package/src/shapes/WebOptions.d.ts +1 -0
- package/src/shapes/WindowOptions.d.ts +1 -0
- package/src/shapes/protocol.d.ts +34 -26
- package/src/transport/transport.d.ts +6 -5
- package/src/transport/transport.js +26 -28
- package/src/transport/wire.d.ts +9 -7
- package/src/util/http.d.ts +1 -1
- package/src/util/http.js +16 -11
- package/src/util/inaccessibleObject.d.ts +2 -0
- package/src/util/inaccessibleObject.js +49 -0
- package/src/util/normalize-config.js +5 -5
package/src/api/system/index.js
CHANGED
|
@@ -3,7 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const base_1 = require("../base");
|
|
4
4
|
const transport_errors_1 = require("../../transport/transport-errors");
|
|
5
5
|
const window_1 = require("../window");
|
|
6
|
+
const events_1 = require("events");
|
|
6
7
|
/**
|
|
8
|
+
* @PORTED
|
|
7
9
|
* AppAssetInfo interface
|
|
8
10
|
* @typedef { object } AppAssetInfo
|
|
9
11
|
* @property { string } src The URL to a zip file containing the package files (executables, dlls, etc…)
|
|
@@ -15,11 +17,13 @@ const window_1 = require("../window");
|
|
|
15
17
|
* When set to false, the app will continue to load if the asset cannot be downloaded. (Default: true)
|
|
16
18
|
*/
|
|
17
19
|
/**
|
|
20
|
+
* @PORTED
|
|
18
21
|
* AppAssetRequest interface
|
|
19
22
|
* @typedef { object } AppAssetRequest
|
|
20
23
|
* @property { string } alias The name of the asset
|
|
21
24
|
*/
|
|
22
25
|
/**
|
|
26
|
+
* @PORTED
|
|
23
27
|
* ApplicationState interface
|
|
24
28
|
* @typedef { object } ApplicationState
|
|
25
29
|
* @property { boolean } isPlatform true when the application is a Platform controller
|
|
@@ -28,6 +32,7 @@ const window_1 = require("../window");
|
|
|
28
32
|
* @property { string } parentUuid uuid of the application that launches this application
|
|
29
33
|
*/
|
|
30
34
|
/**
|
|
35
|
+
* @PORTED
|
|
31
36
|
* @typedef { object } ClearCacheOption
|
|
32
37
|
* @summary Clear cache options.
|
|
33
38
|
* @desc These are the options required by the clearCache function.
|
|
@@ -38,6 +43,7 @@ const window_1 = require("../window");
|
|
|
38
43
|
* @property {boolean} localStorage browser data that can be used across sessions
|
|
39
44
|
*/
|
|
40
45
|
/**
|
|
46
|
+
* @REMOVED
|
|
41
47
|
* CookieInfo interface
|
|
42
48
|
* @typedef { object } CookieInfo
|
|
43
49
|
* @property { string } name The name of the cookie
|
|
@@ -45,11 +51,13 @@ const window_1 = require("../window");
|
|
|
45
51
|
* @property { string } path The path of the cookie
|
|
46
52
|
*/
|
|
47
53
|
/**
|
|
54
|
+
* @REMOVED
|
|
48
55
|
* CookieOption interface
|
|
49
56
|
* @typedef { object } CookieOption
|
|
50
57
|
* @property { string } name The name of the cookie
|
|
51
58
|
*/
|
|
52
59
|
/**
|
|
60
|
+
* @PORTED
|
|
53
61
|
* CpuInfo interface
|
|
54
62
|
* @typedef { object } CpuInfo
|
|
55
63
|
* @property { string } model The model of the cpu
|
|
@@ -57,6 +65,7 @@ const window_1 = require("../window");
|
|
|
57
65
|
* @property { Time } times The numbers of milliseconds the CPU has spent in different modes.
|
|
58
66
|
*/
|
|
59
67
|
/**
|
|
68
|
+
* @PORTED
|
|
60
69
|
* CrashReporterState interface
|
|
61
70
|
* @typedef { object } CrashReporterState
|
|
62
71
|
* @property { boolean } diagnosticsMode In diagnostics mode the crash reporter will send diagnostic logs to
|
|
@@ -64,24 +73,28 @@ const window_1 = require("../window");
|
|
|
64
73
|
* @property { boolean } isRunning check if it's running
|
|
65
74
|
*/
|
|
66
75
|
/**
|
|
76
|
+
* @PORTED
|
|
67
77
|
* CrashReporterOptions interface
|
|
68
78
|
* @typedef { object } CrashReporterOptions
|
|
69
79
|
* @property { boolean } diagnosticsMode In diagnostics mode the crash reporter will send diagnostic logs to
|
|
70
80
|
* the OpenFin reporting service on runtime shutdown
|
|
71
81
|
*/
|
|
72
82
|
/**
|
|
83
|
+
* @REMOVED
|
|
73
84
|
* DipRect interface
|
|
74
85
|
* @typedef { object } DipRect
|
|
75
86
|
* @property { Rect } dipRect The DIP coordinates
|
|
76
87
|
* @property { Rect } scaledRect The scale coordinates
|
|
77
88
|
*/
|
|
78
89
|
/**
|
|
90
|
+
* @REMOVED
|
|
79
91
|
* DipScaleRects interface
|
|
80
92
|
* @typedef { object } DipScaleRects
|
|
81
93
|
* @property { Rect } dipRect The DIP coordinates
|
|
82
94
|
* @property { Rect } scaledRect The scale coordinates
|
|
83
95
|
*/
|
|
84
96
|
/**
|
|
97
|
+
* @PORTED
|
|
85
98
|
* DownloadPreloadInfo interface
|
|
86
99
|
* @typedef { object } DownloadPreloadInfo
|
|
87
100
|
* @desc downloadPreloadScripts function return value
|
|
@@ -90,18 +103,21 @@ const window_1 = require("../window");
|
|
|
90
103
|
* @property { boolean } succeess download operation success
|
|
91
104
|
*/
|
|
92
105
|
/**
|
|
106
|
+
* @PORTED
|
|
93
107
|
* DownloadPreloadOption interface
|
|
94
108
|
* @typedef { object } DownloadPreloadOption
|
|
95
109
|
* @desc These are the options object required by the downloadPreloadScripts function
|
|
96
110
|
* @property { string } url url to the preload script
|
|
97
111
|
*/
|
|
98
112
|
/**
|
|
113
|
+
* @REMOVED
|
|
99
114
|
* ApplicationType interface
|
|
100
115
|
* @typedef { object } ApplicationType
|
|
101
116
|
* @property { string } type The type of the entity
|
|
102
117
|
* @property { string } uuid The uuid of the entity
|
|
103
118
|
*/
|
|
104
119
|
/**
|
|
120
|
+
* @REMOVED
|
|
105
121
|
* EntityInfo interface
|
|
106
122
|
* @typedef { object } EntityInfo
|
|
107
123
|
* @property { string } name The name of the entity
|
|
@@ -110,17 +126,20 @@ const window_1 = require("../window");
|
|
|
110
126
|
* @property { string } entityType The type of the entity
|
|
111
127
|
*/
|
|
112
128
|
/**
|
|
129
|
+
* @REMOVED
|
|
113
130
|
* ExternalApplicationInfo interface
|
|
114
131
|
* @typedef { object } ExternalApplicationInfo
|
|
115
132
|
* @property { Identity } parent The parent identity
|
|
116
133
|
*/
|
|
117
134
|
/**
|
|
135
|
+
* @PORTED
|
|
118
136
|
* ExternalConnection interface
|
|
119
137
|
* @typedef { object } ExternalConnection
|
|
120
138
|
* @property { string } token The token to broker an external connection
|
|
121
139
|
* @property { string } uuid The uuid of the external connection
|
|
122
140
|
*/
|
|
123
141
|
/**
|
|
142
|
+
* @PORTED
|
|
124
143
|
* ExternalProcessRequestType interface
|
|
125
144
|
* @typedef { object } ExternalProcessRequestType
|
|
126
145
|
* @property { string } path The file path to where the running application resides
|
|
@@ -130,14 +149,17 @@ const window_1 = require("../window");
|
|
|
130
149
|
* @property { string } cwd current working directory
|
|
131
150
|
*/
|
|
132
151
|
/**
|
|
152
|
+
* @REMOVED
|
|
133
153
|
* FrameInfo interface
|
|
134
154
|
* @typedef { object } FrameInfo
|
|
135
155
|
* @property { string } name The name of the frame
|
|
136
156
|
* @property { string } uuid The uuid of the frame
|
|
137
157
|
* @property { EntityType } entityType The entity type, could be 'window', 'iframe', 'external connection' or 'unknown'
|
|
138
158
|
* @property { Identity } parent The parent identity
|
|
159
|
+
* @property { string } url URL
|
|
139
160
|
*/
|
|
140
161
|
/**
|
|
162
|
+
* @PORTED
|
|
141
163
|
* GetLogRequestType interface
|
|
142
164
|
* @typedef { object } GetLogRequestType
|
|
143
165
|
* @property { string } name The name of the running application
|
|
@@ -145,11 +167,13 @@ const window_1 = require("../window");
|
|
|
145
167
|
* @property { number } sizeLimit The set size limit of the log file
|
|
146
168
|
*/
|
|
147
169
|
/**
|
|
170
|
+
* @REMOVED
|
|
148
171
|
* GpuInfo interface
|
|
149
172
|
* @typedef { object } GpuInfo
|
|
150
173
|
* @property { string } name The graphics card name
|
|
151
174
|
*/
|
|
152
175
|
/**
|
|
176
|
+
* @PORTED
|
|
153
177
|
* HostSpecs interface
|
|
154
178
|
* @typedef { object } HostSpecs
|
|
155
179
|
* @property { boolean } aeroGlassEnabled Value to check if Aero Glass theme is supported on Windows platforms
|
|
@@ -161,12 +185,14 @@ const window_1 = require("../window");
|
|
|
161
185
|
* @property { boolean } screenSaver Value to check if screensaver is running. Supported on Windows only
|
|
162
186
|
*/
|
|
163
187
|
/**
|
|
188
|
+
* @PORTED
|
|
164
189
|
* Identity interface
|
|
165
190
|
* @typedef { object } Identity
|
|
166
191
|
* @property { string } name Optional - the name of the component
|
|
167
192
|
* @property { string } uuid Universally unique identifier of the application
|
|
168
193
|
*/
|
|
169
194
|
/**
|
|
195
|
+
* @PORTED
|
|
170
196
|
* LogInfo interface
|
|
171
197
|
* @typedef { object } LogInfo
|
|
172
198
|
* @property { string } name The filename of the log
|
|
@@ -174,12 +200,14 @@ const window_1 = require("../window");
|
|
|
174
200
|
* @property { string } date The unix time at which the log was created "Thu Jan 08 2015 14:40:30 GMT-0500 (Eastern Standard Time)"
|
|
175
201
|
*/
|
|
176
202
|
/**
|
|
203
|
+
* @PORTED
|
|
177
204
|
* ManifestInfo interface
|
|
178
205
|
* @typedef { object } ManifestInfo
|
|
179
206
|
* @property { string } uuid The uuid of the application
|
|
180
207
|
* @property { string } manifestUrl The runtime manifest URL
|
|
181
208
|
*/
|
|
182
209
|
/**
|
|
210
|
+
* @PORTED
|
|
183
211
|
* MonitorDetails interface
|
|
184
212
|
* @typedef { object } MonitorDetails
|
|
185
213
|
* @property { DipScaleRects } available The available DIP scale coordinates
|
|
@@ -193,6 +221,7 @@ const window_1 = require("../window");
|
|
|
193
221
|
* @property { DipScaleRects } monitor The monitor coordinates
|
|
194
222
|
*/
|
|
195
223
|
/**
|
|
224
|
+
* @PORTED
|
|
196
225
|
* MonitorInfo interface
|
|
197
226
|
* @typedef { object } MonitorInfo
|
|
198
227
|
* @property { number } deviceScaleFactor The device scale factor
|
|
@@ -204,6 +233,7 @@ const window_1 = require("../window");
|
|
|
204
233
|
* @property { DipRect } virtualScreen The virtual display screen coordinates
|
|
205
234
|
*/
|
|
206
235
|
/**
|
|
236
|
+
* @PORTED
|
|
207
237
|
* @typedef { verbose | info | warning | error | fatal } LogLevel
|
|
208
238
|
* @summary Log verbosity levels.
|
|
209
239
|
* @desc Describes the minimum level (inclusive) above which logs will be written
|
|
@@ -215,18 +245,21 @@ const window_1 = require("../window");
|
|
|
215
245
|
* @property { string } fatal fatal only, indicates a crash is imminent
|
|
216
246
|
*/
|
|
217
247
|
/**
|
|
248
|
+
* @PORTED
|
|
218
249
|
* PointTopLeft interface
|
|
219
250
|
* @typedef { object } PointTopLeft
|
|
220
251
|
* @property { number } top The mouse top position in virtual screen coordinates
|
|
221
252
|
* @property { number } left The mouse left position in virtual screen coordinates
|
|
222
253
|
*/
|
|
223
254
|
/**
|
|
255
|
+
* @PORTED
|
|
224
256
|
* Point interface
|
|
225
257
|
* @typedef { object } Point
|
|
226
258
|
* @property { number } x The mouse x position
|
|
227
259
|
* @property { number } y The mouse y position
|
|
228
260
|
*/
|
|
229
261
|
/**
|
|
262
|
+
* @REMOVED
|
|
230
263
|
* ProcessInfo interface
|
|
231
264
|
* @typedef { object } ProcessInfo
|
|
232
265
|
* @property { number } cpuUsage The percentage of total CPU usage
|
|
@@ -244,18 +277,21 @@ const window_1 = require("../window");
|
|
|
244
277
|
* @property { number } workingSetSize The current working set size (both shared and private data) in bytes
|
|
245
278
|
*/
|
|
246
279
|
/**
|
|
280
|
+
* @REMOVED
|
|
247
281
|
* SystemProcessInfo interface
|
|
248
282
|
* @typedef { object } SystemProcessInfo
|
|
249
283
|
* @property { ProcessDetails } browserProcess Info on browser process
|
|
250
284
|
* @property { Array<AppProcessInfo> } apps Array of apps and their process info
|
|
251
285
|
*/
|
|
252
286
|
/**
|
|
287
|
+
* @PORTED
|
|
253
288
|
* AppProcessInfo interface
|
|
254
289
|
* @typedef { object } AppProcessInfo
|
|
255
290
|
* @property { string } uuid The uuid of the application
|
|
256
291
|
* @property { Array<EntityProcessDetails> } entities Array of process info for each window and view for the application
|
|
257
292
|
*/
|
|
258
293
|
/**
|
|
294
|
+
* @REMOVED
|
|
259
295
|
* EntityProcessDetails interface
|
|
260
296
|
* @typedef { object } EntityProcessDetails
|
|
261
297
|
* @property { string } uuid The uuid for the entity
|
|
@@ -277,6 +313,7 @@ const window_1 = require("../window");
|
|
|
277
313
|
* @property { Array<FrameProcessDetails> } frames Array of process info for each iframe corresponeding to the entity
|
|
278
314
|
*/
|
|
279
315
|
/**
|
|
316
|
+
* @PORTED
|
|
280
317
|
* FrameProcessDetails interface
|
|
281
318
|
* @typedef { object } FrameProcessDetails
|
|
282
319
|
* @property { string } url Current URL associated with the process
|
|
@@ -294,6 +331,7 @@ const window_1 = require("../window");
|
|
|
294
331
|
* @property { number } pid The native process identifier
|
|
295
332
|
*/
|
|
296
333
|
/**
|
|
334
|
+
* @PORTED
|
|
297
335
|
* ProcessDetails interface
|
|
298
336
|
* @typedef { object } ProcessDetails
|
|
299
337
|
* @property { number } cpuUsage The percentage of total CPU usage
|
|
@@ -309,6 +347,7 @@ const window_1 = require("../window");
|
|
|
309
347
|
* @property { number } pid The native process identifier
|
|
310
348
|
*/
|
|
311
349
|
/**
|
|
350
|
+
* @PORTED
|
|
312
351
|
* ProxyConfig interface
|
|
313
352
|
* @typedef { object } ProxyConfig
|
|
314
353
|
* @property { string } proxyAddress The configured proxy address
|
|
@@ -316,12 +355,14 @@ const window_1 = require("../window");
|
|
|
316
355
|
* @property { string } type The proxy Type
|
|
317
356
|
*/
|
|
318
357
|
/**
|
|
358
|
+
* @REMOVED
|
|
319
359
|
* ProxyInfo interface
|
|
320
360
|
* @typedef { object } ProxyInfo
|
|
321
361
|
* @property { ProxyConfig } config The proxy config
|
|
322
362
|
* @property { ProxySystemInfo } system The proxy system info
|
|
323
363
|
*/
|
|
324
364
|
/**
|
|
365
|
+
* @PORTED
|
|
325
366
|
* QueryPermissionResult interface
|
|
326
367
|
* @typedef { object } QueryPermissionResult
|
|
327
368
|
* @property { string } permission The full name of a secured API
|
|
@@ -330,6 +371,7 @@ const window_1 = require("../window");
|
|
|
330
371
|
* @property { object } [rawValue] The value of permission
|
|
331
372
|
*/
|
|
332
373
|
/**
|
|
374
|
+
* @PORTED
|
|
333
375
|
* ProxySystemInfo interface
|
|
334
376
|
* @typedef { object } ProxySystemInfo
|
|
335
377
|
* @property { string } autoConfigUrl The auto configuration url
|
|
@@ -338,6 +380,7 @@ const window_1 = require("../window");
|
|
|
338
380
|
* @property { string } proxy The proxy info
|
|
339
381
|
*/
|
|
340
382
|
/**
|
|
383
|
+
* @REMOVED
|
|
341
384
|
* Rect interface
|
|
342
385
|
* @typedef { object } Rect
|
|
343
386
|
* @property { number } bottom The bottom-most coordinate
|
|
@@ -346,6 +389,7 @@ const window_1 = require("../window");
|
|
|
346
389
|
* @property { number } top The top-most coordinate
|
|
347
390
|
*/
|
|
348
391
|
/**
|
|
392
|
+
* @REMOVED
|
|
349
393
|
* RegistryInfo interface
|
|
350
394
|
* @typedef { object } RegistryInfo
|
|
351
395
|
* @property { any } data The registry data
|
|
@@ -355,12 +399,14 @@ const window_1 = require("../window");
|
|
|
355
399
|
* @property { string } value The registry value name
|
|
356
400
|
*/
|
|
357
401
|
/**
|
|
402
|
+
* @PORTED
|
|
358
403
|
* RuntimeDownloadOptions interface
|
|
359
404
|
* @typedef { object } RuntimeDownloadOptions
|
|
360
405
|
* @desc These are the options object required by the downloadRuntime function.
|
|
361
406
|
* @property { string } version The given version to download
|
|
362
407
|
*/
|
|
363
408
|
/**
|
|
409
|
+
* @PORTED
|
|
364
410
|
* RuntimeInfo interface
|
|
365
411
|
* @typedef { object } RuntimeInfo
|
|
366
412
|
* @property { string } architecture The runtime build architecture
|
|
@@ -373,6 +419,7 @@ const window_1 = require("../window");
|
|
|
373
419
|
* @property { string } electronVersion The electron version
|
|
374
420
|
*/
|
|
375
421
|
/**
|
|
422
|
+
* @PORTED
|
|
376
423
|
* RVMInfo interface
|
|
377
424
|
* @typedef { object } RVMInfo
|
|
378
425
|
* @property { string } action The name of action: "get-rvm-info"
|
|
@@ -383,24 +430,29 @@ const window_1 = require("../window");
|
|
|
383
430
|
* @property { string } 'working-dir' The working directory
|
|
384
431
|
*/
|
|
385
432
|
/**
|
|
433
|
+
* @PORTED
|
|
386
434
|
* RvmLaunchOptions interface
|
|
387
435
|
* @typedef { object } RvmLaunchOptions
|
|
388
436
|
* @property { boolean } [noUi] true if no UI when launching
|
|
389
437
|
* @property { object } [userAppConfigArgs] The user app configuration args
|
|
390
438
|
* @property { number } [timeToLive] Timeout in seconds until RVM launch request expires
|
|
439
|
+
* @property { Function } [subscribe] Called whenever app version resolver events occur.
|
|
391
440
|
*/
|
|
392
441
|
/**
|
|
442
|
+
* @PORTED
|
|
393
443
|
* ServiceIdentifier interface
|
|
394
444
|
* @typedef { object } ServiceIdentifier
|
|
395
445
|
* @property { string } name The name of the service
|
|
396
446
|
*/
|
|
397
447
|
/**
|
|
448
|
+
* @PORTED
|
|
398
449
|
* ServiceConfiguration interface
|
|
399
450
|
* @typedef { object } ServiceConfiguration
|
|
400
451
|
* @property { object } config The service configuration
|
|
401
452
|
* @property { string } name The name of the service
|
|
402
453
|
*/
|
|
403
454
|
/**
|
|
455
|
+
* @PORTED
|
|
404
456
|
* ShortCutConfig interface
|
|
405
457
|
* @typedef { object } ShortCutConfig
|
|
406
458
|
* @property { boolean } desktop true if application has a shortcut on the desktop
|
|
@@ -408,17 +460,20 @@ const window_1 = require("../window");
|
|
|
408
460
|
* @property { boolean } systemStartup true if application will be launched on system startup
|
|
409
461
|
*/
|
|
410
462
|
/**
|
|
463
|
+
* @PORTED
|
|
411
464
|
* SubOptions interface
|
|
412
465
|
* @typedef { Object } SubOptions
|
|
413
466
|
* @property { number } timestamp The event timestamp
|
|
414
467
|
*/
|
|
415
468
|
/**
|
|
469
|
+
* @PORTED
|
|
416
470
|
* TaskBar interface
|
|
417
471
|
* @typedef { object } TaskBar
|
|
418
472
|
* @property { string } edge which edge of a monitor the taskbar is on
|
|
419
473
|
* @property { Rect } rect The taskbar coordinates
|
|
420
474
|
*/
|
|
421
475
|
/**
|
|
476
|
+
* @PORTED
|
|
422
477
|
* TerminateExternalRequestType interface
|
|
423
478
|
* @typedef { object } TerminateExternalRequestType
|
|
424
479
|
* @property { string } uuid The uuid of the running application
|
|
@@ -426,6 +481,7 @@ const window_1 = require("../window");
|
|
|
426
481
|
* @property { boolean } killtree Value to terminate the running application
|
|
427
482
|
*/
|
|
428
483
|
/**
|
|
484
|
+
* @PORTED
|
|
429
485
|
* Time interface
|
|
430
486
|
* @typedef { object } Time
|
|
431
487
|
* @property { number } user The number of milliseconds the CPU has spent in user mode
|
|
@@ -435,6 +491,7 @@ const window_1 = require("../window");
|
|
|
435
491
|
* @property { number } irq The number of milliseconds the CPU has spent in irq mode
|
|
436
492
|
*/
|
|
437
493
|
/**
|
|
494
|
+
* @PORTED
|
|
438
495
|
* TrayInfo interface
|
|
439
496
|
* @typedef { object } TrayInfo
|
|
440
497
|
* @property { Bounds } bounds The bound of tray icon in virtual screen pixels
|
|
@@ -443,6 +500,7 @@ const window_1 = require("../window");
|
|
|
443
500
|
* @property { number } y copy of bounds.y
|
|
444
501
|
*/
|
|
445
502
|
/**
|
|
503
|
+
* @PORTED
|
|
446
504
|
* WindowDetail interface
|
|
447
505
|
* @typedef { object } WindowDetail
|
|
448
506
|
* @property { number } bottom The bottom-most coordinate of the window
|
|
@@ -456,6 +514,7 @@ const window_1 = require("../window");
|
|
|
456
514
|
* @property { number } width The width of the window
|
|
457
515
|
*/
|
|
458
516
|
/**
|
|
517
|
+
* @PORTED
|
|
459
518
|
* ApplicationWindowInfo interface
|
|
460
519
|
* @typedef { object } ApplicationWindowInfo
|
|
461
520
|
* @property { Array<WindowDetail> } childWindows The array of child windows details
|
|
@@ -463,6 +522,7 @@ const window_1 = require("../window");
|
|
|
463
522
|
* @property { string } uuid The uuid of the application
|
|
464
523
|
*/
|
|
465
524
|
/**
|
|
525
|
+
* @REMOVED
|
|
466
526
|
* CertifiedAppInfo interface
|
|
467
527
|
* @typedef { object } CertifiedAppInfo
|
|
468
528
|
* @property { boolean } isRunning true if the app is running
|
|
@@ -890,7 +950,7 @@ class System extends base_1.EmitterBase {
|
|
|
890
950
|
* Runs an executable or batch file. A path to the file must be included in options.
|
|
891
951
|
* <br> A uuid may be optionally provided. If not provided, OpenFin will create a uuid for the new process.
|
|
892
952
|
* <br> Note: This method is restricted by default and must be enabled via
|
|
893
|
-
* <a href="https://developers.openfin.co/docs/api-security">API security settings</a>.
|
|
953
|
+
* <a href="https://developers.openfin.co/docs/api-security">API security settings</a>. Also, this api has an enhanced permission set to make it less dangerous. So application owners can only allow to launch the assets owned by the application, the enabled downloaded files or the restricted executables.
|
|
894
954
|
* @param { ExternalProcessRequestType } options A object that is defined in the ExternalProcessRequestType interface
|
|
895
955
|
* @return {Promise.<Identity>}
|
|
896
956
|
* @tutorial System.launchExternalProcess
|
|
@@ -998,6 +1058,8 @@ class System extends base_1.EmitterBase {
|
|
|
998
1058
|
progressListener(p);
|
|
999
1059
|
};
|
|
1000
1060
|
const cleanListeners = () => {
|
|
1061
|
+
// TODO: fix internal types
|
|
1062
|
+
// @ts-expect-error
|
|
1001
1063
|
this.removeListener(dlProgressKey, dlProgress);
|
|
1002
1064
|
};
|
|
1003
1065
|
const dlError = (r, err) => {
|
|
@@ -1009,8 +1071,14 @@ class System extends base_1.EmitterBase {
|
|
|
1009
1071
|
cleanListeners();
|
|
1010
1072
|
resolve();
|
|
1011
1073
|
};
|
|
1074
|
+
// TODO: fix internal types
|
|
1075
|
+
// @ts-expect-error
|
|
1012
1076
|
this.on(dlProgressKey, dlProgress);
|
|
1077
|
+
// TODO: fix internal types
|
|
1078
|
+
// @ts-expect-error
|
|
1013
1079
|
this.once(dlErrorKey, dlError);
|
|
1080
|
+
// TODO: fix internal types
|
|
1081
|
+
// @ts-expect-error
|
|
1014
1082
|
this.once(dlCompleteKey, dlComplete);
|
|
1015
1083
|
const downloadOptions = Object.assign(appAsset, { downloadId });
|
|
1016
1084
|
this.wire.sendAction('download-asset', downloadOptions).catch((err) => {
|
|
@@ -1045,6 +1113,8 @@ class System extends base_1.EmitterBase {
|
|
|
1045
1113
|
progressListener(p);
|
|
1046
1114
|
};
|
|
1047
1115
|
const cleanListeners = () => {
|
|
1116
|
+
// TODO: fix internal types
|
|
1117
|
+
// @ts-expect-error
|
|
1048
1118
|
this.removeListener(dlProgressKey, dlProgress);
|
|
1049
1119
|
};
|
|
1050
1120
|
const dlError = (r, err) => {
|
|
@@ -1056,8 +1126,14 @@ class System extends base_1.EmitterBase {
|
|
|
1056
1126
|
cleanListeners();
|
|
1057
1127
|
resolve();
|
|
1058
1128
|
};
|
|
1129
|
+
// TODO: fix internal types
|
|
1130
|
+
// @ts-expect-error
|
|
1059
1131
|
this.on(dlProgressKey, dlProgress);
|
|
1132
|
+
// TODO: fix internal types
|
|
1133
|
+
// @ts-expect-error
|
|
1060
1134
|
this.once(dlErrorKey, dlError);
|
|
1135
|
+
// TODO: fix internal types
|
|
1136
|
+
// @ts-expect-error
|
|
1061
1137
|
this.once(dlCompleteKey, dlComplete);
|
|
1062
1138
|
const downloadOptions = Object.assign(options, { downloadId });
|
|
1063
1139
|
this.wire.sendAction('download-runtime', downloadOptions).catch((err) => {
|
|
@@ -1203,10 +1279,58 @@ class System extends base_1.EmitterBase {
|
|
|
1203
1279
|
* @tutorial System.launchManifest
|
|
1204
1280
|
* @static
|
|
1205
1281
|
*/
|
|
1206
|
-
async launchManifest(manifestUrl, opts) {
|
|
1282
|
+
async launchManifest(manifestUrl, opts = {}) {
|
|
1283
|
+
const { subscribe, ..._sendOpts } = opts;
|
|
1284
|
+
const sendOpts = _sendOpts;
|
|
1285
|
+
if (subscribe) {
|
|
1286
|
+
const launchEmitter = new events_1.EventEmitter();
|
|
1287
|
+
subscribe(launchEmitter);
|
|
1288
|
+
const AppVersionProgressEventName = 'app-version-progress';
|
|
1289
|
+
const RuntimeStatusEventName = 'runtime-status';
|
|
1290
|
+
const AppVersionCompleteEventName = 'app-version-complete';
|
|
1291
|
+
const AppVersionErrorEventName = 'app-version-error';
|
|
1292
|
+
// add id to avoid multiple api calls getting duplicated events
|
|
1293
|
+
const id = this.wire.environment.getNextMessageId().toString();
|
|
1294
|
+
sendOpts.appVersionId = id;
|
|
1295
|
+
const supportedEvents = [
|
|
1296
|
+
AppVersionCompleteEventName,
|
|
1297
|
+
AppVersionProgressEventName,
|
|
1298
|
+
RuntimeStatusEventName,
|
|
1299
|
+
AppVersionErrorEventName
|
|
1300
|
+
];
|
|
1301
|
+
const cleanEventPayload = (payload) => {
|
|
1302
|
+
// We need to do type castings below to make sure the return type is correct.
|
|
1303
|
+
const { appVersionId, topic, type: typeWithId, ...rest } = payload;
|
|
1304
|
+
const type = supportedEvents.find((x) => typeWithId.includes(x));
|
|
1305
|
+
return {
|
|
1306
|
+
...rest,
|
|
1307
|
+
type
|
|
1308
|
+
};
|
|
1309
|
+
};
|
|
1310
|
+
const appVersionListener = (payload) => {
|
|
1311
|
+
const cleanPayload = cleanEventPayload(payload);
|
|
1312
|
+
launchEmitter.emit(cleanPayload.type, cleanPayload);
|
|
1313
|
+
};
|
|
1314
|
+
const removeAllListeners = () => {
|
|
1315
|
+
this.removeListener(`${AppVersionProgressEventName}.${id}`, appVersionListener);
|
|
1316
|
+
this.removeListener(`${RuntimeStatusEventName}.${id}`, appVersionListener);
|
|
1317
|
+
this.removeListener(`${AppVersionCompleteEventName}.${id}`, appVersionListener);
|
|
1318
|
+
this.removeListener(`${AppVersionErrorEventName}.${id}`, appVersionListener);
|
|
1319
|
+
this.removeListener(`${AppVersionCompleteEventName}.${id}`, removeAllListeners);
|
|
1320
|
+
this.removeListener(`${AppVersionErrorEventName}.${id}`, removeAllListeners);
|
|
1321
|
+
};
|
|
1322
|
+
await Promise.all([
|
|
1323
|
+
this.on(`${AppVersionProgressEventName}.${id}`, appVersionListener),
|
|
1324
|
+
this.on(`${RuntimeStatusEventName}.${id}`, appVersionListener),
|
|
1325
|
+
this.once(`${AppVersionCompleteEventName}.${id}`, appVersionListener),
|
|
1326
|
+
this.once(`${AppVersionErrorEventName}.${id}`, appVersionListener),
|
|
1327
|
+
this.once(`${AppVersionCompleteEventName}.${id}`, removeAllListeners),
|
|
1328
|
+
this.once(`${AppVersionErrorEventName}.${id}`, removeAllListeners)
|
|
1329
|
+
]);
|
|
1330
|
+
}
|
|
1207
1331
|
const response = await this.wire.sendAction('launch-manifest', {
|
|
1208
1332
|
manifestUrl,
|
|
1209
|
-
opts
|
|
1333
|
+
opts: sendOpts
|
|
1210
1334
|
});
|
|
1211
1335
|
return response.payload.data.manifest;
|
|
1212
1336
|
}
|
package/src/api/view/Factory.js
CHANGED
|
@@ -41,7 +41,7 @@ class ViewModule extends base_1.Base {
|
|
|
41
41
|
*/
|
|
42
42
|
async wrap(identity) {
|
|
43
43
|
this.wire.sendAction('view-wrap');
|
|
44
|
-
const errorMsg = validate_1.validateIdentity(identity);
|
|
44
|
+
const errorMsg = (0, validate_1.validateIdentity)(identity);
|
|
45
45
|
if (errorMsg) {
|
|
46
46
|
throw new Error(errorMsg);
|
|
47
47
|
}
|
|
@@ -59,7 +59,7 @@ class ViewModule extends base_1.Base {
|
|
|
59
59
|
this.wire.sendAction('view-wrap-sync').catch((e) => {
|
|
60
60
|
// we do not want to expose this error, just continue if this analytics-only call fails
|
|
61
61
|
});
|
|
62
|
-
const errorMsg = validate_1.validateIdentity(identity);
|
|
62
|
+
const errorMsg = (0, validate_1.validateIdentity)(identity);
|
|
63
63
|
if (errorMsg) {
|
|
64
64
|
throw new Error(errorMsg);
|
|
65
65
|
}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
import type * as OpenFin from '../../OpenFin';
|
|
1
2
|
import { WebContents } from '../webcontents/main';
|
|
2
3
|
import Transport from '../../transport/transport';
|
|
3
4
|
import { Layout } from '../platform/layout';
|
|
4
|
-
import
|
|
5
|
-
|
|
5
|
+
import { ViewEvent } from '../events/view';
|
|
6
|
+
declare type UpdatableViewOptions = OpenFin.UpdatableViewOptions;
|
|
6
7
|
/**
|
|
8
|
+
* @PORTED
|
|
7
9
|
* @typedef {object} View~options
|
|
8
10
|
* @summary View creation options.
|
|
9
11
|
* @desc This is the options object required by {@link View.create View.create}.
|
|
@@ -169,7 +171,7 @@ import UpdatableViewOptions = OpenFin.UpdatableViewOptions;
|
|
|
169
171
|
* @alias View
|
|
170
172
|
* @hideconstructor
|
|
171
173
|
*/
|
|
172
|
-
export declare class View extends WebContents<
|
|
174
|
+
export declare class View extends WebContents<ViewEvent> {
|
|
173
175
|
identity: OpenFin.Identity;
|
|
174
176
|
constructor(wire: Transport, identity: OpenFin.Identity);
|
|
175
177
|
/**
|
|
@@ -451,4 +453,16 @@ export declare class View extends WebContents<ViewEvents> {
|
|
|
451
453
|
* @experimental
|
|
452
454
|
*/
|
|
453
455
|
triggerBeforeUnload: () => Promise<boolean>;
|
|
456
|
+
/**
|
|
457
|
+
* **NOTE**: Internal use only.
|
|
458
|
+
* Attaches this view to an HTML element in the current context. The view will resize responsively when the element bounds change.
|
|
459
|
+
*
|
|
460
|
+
* @param { string } elementId - id of the HTML element to attach the view to.
|
|
461
|
+
* @return {Function} - Cleanup function that will disconnect the element resize observer.
|
|
462
|
+
* @internal
|
|
463
|
+
* @experimental
|
|
464
|
+
* @tutorial View.bindToElement
|
|
465
|
+
*/
|
|
466
|
+
bindToElement: (elementId: string) => Promise<() => void>;
|
|
454
467
|
}
|
|
468
|
+
export {};
|
package/src/api/view/Instance.js
CHANGED
|
@@ -6,7 +6,9 @@ exports.View = void 0;
|
|
|
6
6
|
/* eslint-disable @typescript-eslint/no-non-null-assertion */
|
|
7
7
|
const main_1 = require("../webcontents/main");
|
|
8
8
|
const window_1 = require("../window");
|
|
9
|
+
const bounds_observer_1 = require("../platform/layout/utils/bounds-observer");
|
|
9
10
|
/**
|
|
11
|
+
* @PORTED
|
|
10
12
|
* @typedef {object} View~options
|
|
11
13
|
* @summary View creation options.
|
|
12
14
|
* @desc This is the options object required by {@link View.create View.create}.
|
|
@@ -455,6 +457,24 @@ class View extends main_1.WebContents {
|
|
|
455
457
|
const message = await this.wire.sendAction('trigger-before-unload', { ...this.identity });
|
|
456
458
|
return message.payload.data;
|
|
457
459
|
};
|
|
460
|
+
/**
|
|
461
|
+
* **NOTE**: Internal use only.
|
|
462
|
+
* Attaches this view to an HTML element in the current context. The view will resize responsively when the element bounds change.
|
|
463
|
+
*
|
|
464
|
+
* @param { string } elementId - id of the HTML element to attach the view to.
|
|
465
|
+
* @return {Function} - Cleanup function that will disconnect the element resize observer.
|
|
466
|
+
* @internal
|
|
467
|
+
* @experimental
|
|
468
|
+
* @tutorial View.bindToElement
|
|
469
|
+
*/
|
|
470
|
+
this.bindToElement = async (elementId) => {
|
|
471
|
+
const element = document.getElementById(elementId);
|
|
472
|
+
if (!element) {
|
|
473
|
+
throw new Error(`Element matching id: ${elementId} not found.`);
|
|
474
|
+
}
|
|
475
|
+
const onChange = async (bounds) => this.setBounds(bounds);
|
|
476
|
+
return (0, bounds_observer_1.observeBounds)(element, onChange);
|
|
477
|
+
};
|
|
458
478
|
}
|
|
459
479
|
/**
|
|
460
480
|
* Gets a base64 encoded image of the view or a part of it.
|
package/src/api/view/index.js
CHANGED
|
@@ -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.
|
|
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" && !
|
|
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;
|