@openfin/core 33.76.31 → 33.76.36
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-core-33.76.36.tgz +0 -0
- package/package.json +1 -1
- package/src/OpenFin.d.ts +27 -16
- package/src/api/application/Factory.d.ts +148 -100
- package/src/api/application/Factory.js +148 -100
- package/src/api/application/Instance.d.ts +477 -106
- package/src/api/application/Instance.js +474 -106
- package/src/api/application/index.d.ts +9 -0
- package/src/api/application/index.js +9 -0
- package/src/api/base.d.ts +69 -0
- package/src/api/base.js +69 -0
- package/src/api/clipboard/index.d.ts +111 -31
- package/src/api/clipboard/index.js +111 -31
- package/src/api/events/application.d.ts +12 -0
- package/src/api/events/application.js +12 -0
- package/src/api/events/channel.d.ts +5 -0
- package/src/api/events/channel.js +5 -0
- package/src/api/events/externalApplication.d.ts +5 -0
- package/src/api/events/externalApplication.js +5 -0
- package/src/api/events/frame.d.ts +5 -0
- package/src/api/events/globalHotkey.d.ts +5 -0
- package/src/api/events/platform.d.ts +9 -1
- package/src/api/events/platform.js +8 -0
- package/src/api/events/system.d.ts +13 -0
- package/src/api/events/system.js +13 -0
- package/src/api/events/view.d.ts +19 -9
- package/src/api/events/view.js +10 -0
- package/src/api/events/webcontents.d.ts +21 -10
- package/src/api/events/webcontents.js +11 -0
- package/src/api/events/window.d.ts +70 -1
- package/src/api/events/window.js +10 -0
- package/src/api/external-application/Factory.d.ts +16 -9
- package/src/api/external-application/Factory.js +16 -9
- package/src/api/external-application/Instance.d.ts +40 -32
- package/src/api/external-application/Instance.js +40 -32
- package/src/api/external-application/index.d.ts +9 -0
- package/src/api/external-application/index.js +9 -0
- package/src/api/fin.d.ts +3 -0
- package/src/api/fin.js +3 -0
- package/src/api/frame/Factory.d.ts +30 -13
- package/src/api/frame/Factory.js +30 -13
- package/src/api/frame/Instance.d.ts +51 -38
- package/src/api/frame/Instance.js +51 -38
- package/src/api/frame/index.d.ts +11 -0
- package/src/api/frame/index.js +11 -0
- package/src/api/global-hotkey/index.d.ts +81 -13
- package/src/api/global-hotkey/index.js +81 -13
- package/src/api/interappbus/channel/channel.d.ts +257 -0
- package/src/api/interappbus/channel/channel.js +257 -0
- package/src/api/interappbus/channel/channels-docs.d.ts +59 -57
- package/src/api/interappbus/channel/channels-docs.js +71 -68
- package/src/api/interappbus/channel/client.d.ts +93 -0
- package/src/api/interappbus/channel/client.js +93 -1
- package/src/api/interappbus/channel/index.d.ts +164 -0
- package/src/api/interappbus/channel/index.js +165 -1
- package/src/api/interappbus/channel/provider.d.ts +172 -0
- package/src/api/interappbus/channel/provider.js +172 -0
- package/src/api/interappbus/index.d.ts +55 -20
- package/src/api/interappbus/index.js +55 -20
- package/src/api/interop/Factory.d.ts +30 -10
- package/src/api/interop/Factory.js +30 -10
- package/src/api/interop/InteropBroker.d.ts +298 -70
- package/src/api/interop/InteropBroker.js +298 -70
- package/src/api/interop/InteropClient.d.ts +286 -62
- package/src/api/interop/InteropClient.js +286 -62
- package/src/api/interop/SessionContextGroupClient.d.ts +2 -2
- package/src/api/interop/SessionContextGroupClient.js +2 -2
- package/src/api/interop/fdc3/documentationStub.d.ts +14 -0
- package/src/api/interop/fdc3/documentationStub.js +17 -0
- package/src/api/interop/fdc3/fdc3-1.2.d.ts +31 -34
- package/src/api/interop/fdc3/fdc3-1.2.js +31 -34
- package/src/api/interop/fdc3/fdc3-2.0.d.ts +48 -51
- package/src/api/interop/fdc3/fdc3-2.0.js +48 -51
- package/src/api/interop/index.d.ts +8 -0
- package/src/api/interop/index.js +8 -0
- package/src/api/platform/Factory.d.ts +121 -65
- package/src/api/platform/Factory.js +122 -66
- package/src/api/platform/Instance.d.ts +551 -48
- package/src/api/platform/Instance.js +551 -49
- package/src/api/platform/index.d.ts +9 -0
- package/src/api/platform/index.js +9 -0
- package/src/api/platform/layout/Factory.d.ts +53 -76
- package/src/api/platform/layout/Factory.js +53 -76
- package/src/api/platform/layout/Instance.d.ts +158 -23
- package/src/api/platform/layout/Instance.js +118 -20
- package/src/api/platform/layout/entities/layout-entities.d.ts +222 -30
- package/src/api/platform/layout/entities/layout-entities.js +222 -30
- package/src/api/platform/layout/index.d.ts +9 -0
- package/src/api/platform/layout/index.js +9 -0
- package/src/api/platform/provider.d.ts +398 -51
- package/src/api/snapshot-source/Factory.d.ts +33 -18
- package/src/api/snapshot-source/Factory.js +33 -18
- package/src/api/snapshot-source/Instance.d.ts +30 -8
- package/src/api/snapshot-source/Instance.js +30 -8
- package/src/api/snapshot-source/index.d.ts +9 -0
- package/src/api/snapshot-source/index.js +9 -0
- package/src/api/system/index.d.ts +1137 -186
- package/src/api/system/index.js +1142 -186
- package/src/api/view/Factory.d.ts +54 -16
- package/src/api/view/Factory.js +54 -16
- package/src/api/view/Instance.d.ts +330 -216
- package/src/api/view/Instance.js +331 -217
- package/src/api/view/index.d.ts +9 -0
- package/src/api/view/index.js +9 -0
- package/src/api/webcontents/main.d.ts +890 -0
- package/src/api/webcontents/main.js +890 -0
- package/src/api/window/Factory.d.ts +67 -16
- package/src/api/window/Factory.js +67 -16
- package/src/api/window/Instance.d.ts +824 -316
- package/src/api/window/Instance.js +822 -320
- package/src/api/window/index.d.ts +11 -0
- package/src/api/window/index.js +11 -0
- package/src/namespaces.d.ts +1 -0
- package/src/namespaces.js +3 -1
- package/src/shapes/protocol.d.ts +4 -0
- package/openfin-core-33.76.31.tgz +0 -0
|
@@ -2,23 +2,27 @@ import type * as OpenFin from '../../OpenFin';
|
|
|
2
2
|
import { EmitterBase } from '../base';
|
|
3
3
|
import { Transport } from '../../transport/transport';
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
6
|
-
* execute, show/close an application as well as listen to
|
|
7
|
-
* @class
|
|
8
|
-
* @hideconstructor
|
|
5
|
+
* An object representing an application. Allows the developer to create,
|
|
6
|
+
* execute, show/close an application as well as listen to {@link OpenFin.ApplicationEvents application events}.
|
|
9
7
|
*/
|
|
10
8
|
export declare class Application extends EmitterBase<OpenFin.ApplicationEvent> {
|
|
11
9
|
identity: OpenFin.ApplicationIdentity;
|
|
10
|
+
/**
|
|
11
|
+
* @internal
|
|
12
|
+
*/
|
|
12
13
|
_manifestUrl?: string;
|
|
13
14
|
private window;
|
|
15
|
+
/**
|
|
16
|
+
* @internal
|
|
17
|
+
*/
|
|
14
18
|
constructor(wire: Transport, identity: OpenFin.ApplicationIdentity);
|
|
15
19
|
private windowListFromIdentityList;
|
|
16
20
|
/**
|
|
17
21
|
* Adds a listener to the end of the listeners array for the specified event.
|
|
18
|
-
* @param
|
|
19
|
-
* @param
|
|
20
|
-
* @param
|
|
21
|
-
*
|
|
22
|
+
* @param eventType - The type of the event.
|
|
23
|
+
* @param listener - Called whenever an event of the specified type occurs.
|
|
24
|
+
* @param options - Option to support event timestamps.
|
|
25
|
+
*
|
|
22
26
|
* @function addListener
|
|
23
27
|
* @memberof Application
|
|
24
28
|
* @instance
|
|
@@ -26,10 +30,10 @@ export declare class Application extends EmitterBase<OpenFin.ApplicationEvent> {
|
|
|
26
30
|
*/
|
|
27
31
|
/**
|
|
28
32
|
* Adds a listener to the end of the listeners array for the specified event.
|
|
29
|
-
* @param
|
|
30
|
-
* @param
|
|
31
|
-
* @param
|
|
32
|
-
*
|
|
33
|
+
* @param eventType - The type of the event.
|
|
34
|
+
* @param listener - Called whenever an event of the specified type occurs.
|
|
35
|
+
* @param options - Option to support event timestamps.
|
|
36
|
+
*
|
|
33
37
|
* @function on
|
|
34
38
|
* @memberof Application
|
|
35
39
|
* @instance
|
|
@@ -37,10 +41,10 @@ export declare class Application extends EmitterBase<OpenFin.ApplicationEvent> {
|
|
|
37
41
|
*/
|
|
38
42
|
/**
|
|
39
43
|
* Adds a one time listener for the event. The listener is invoked only the first time the event is fired, after which it is removed.
|
|
40
|
-
* @param
|
|
41
|
-
* @param
|
|
42
|
-
* @param
|
|
43
|
-
*
|
|
44
|
+
* @param eventType - The type of the event.
|
|
45
|
+
* @param listener - The callback function.
|
|
46
|
+
* @param options - Option to support event timestamps.
|
|
47
|
+
*
|
|
44
48
|
* @function once
|
|
45
49
|
* @memberof Application
|
|
46
50
|
* @instance
|
|
@@ -48,10 +52,10 @@ export declare class Application extends EmitterBase<OpenFin.ApplicationEvent> {
|
|
|
48
52
|
*/
|
|
49
53
|
/**
|
|
50
54
|
* Adds a listener to the beginning of the listeners array for the specified event.
|
|
51
|
-
* @param
|
|
52
|
-
* @param
|
|
53
|
-
* @param
|
|
54
|
-
*
|
|
55
|
+
* @param eventType - The type of the event.
|
|
56
|
+
* @param listener - The callback function.
|
|
57
|
+
* @param options - Option to support event timestamps.
|
|
58
|
+
*
|
|
55
59
|
* @function prependListener
|
|
56
60
|
* @memberof Application
|
|
57
61
|
* @instance
|
|
@@ -60,10 +64,10 @@ export declare class Application extends EmitterBase<OpenFin.ApplicationEvent> {
|
|
|
60
64
|
/**
|
|
61
65
|
* Adds a one time listener for the event. The listener is invoked only the first time the event is fired, after which it is removed.
|
|
62
66
|
* The listener is added to the beginning of the listeners array.
|
|
63
|
-
* @param
|
|
64
|
-
* @param
|
|
65
|
-
* @param
|
|
66
|
-
*
|
|
67
|
+
* @param eventType - The type of the event.
|
|
68
|
+
* @param listener - The callback function.
|
|
69
|
+
* @param options - Option to support event timestamps.
|
|
70
|
+
*
|
|
67
71
|
* @function prependOnceListener
|
|
68
72
|
* @memberof Application
|
|
69
73
|
* @instance
|
|
@@ -72,10 +76,10 @@ export declare class Application extends EmitterBase<OpenFin.ApplicationEvent> {
|
|
|
72
76
|
/**
|
|
73
77
|
* Remove a listener from the listener array for the specified event.
|
|
74
78
|
* Caution: Calling this method changes the array indices in the listener array behind the listener.
|
|
75
|
-
* @param
|
|
76
|
-
* @param
|
|
77
|
-
* @param
|
|
78
|
-
*
|
|
79
|
+
* @param eventType - The type of the event.
|
|
80
|
+
* @param listener - The callback function.
|
|
81
|
+
* @param options - Option to support event timestamps.
|
|
82
|
+
*
|
|
79
83
|
* @function removeListener
|
|
80
84
|
* @memberof Application
|
|
81
85
|
* @instance
|
|
@@ -83,18 +87,13 @@ export declare class Application extends EmitterBase<OpenFin.ApplicationEvent> {
|
|
|
83
87
|
*/
|
|
84
88
|
/**
|
|
85
89
|
* Removes all listeners, or those of the specified event.
|
|
86
|
-
* @param
|
|
87
|
-
*
|
|
90
|
+
* @param eventType - The type of the event.
|
|
91
|
+
*
|
|
88
92
|
* @function removeAllListeners
|
|
89
93
|
* @memberof Application
|
|
90
94
|
* @instance
|
|
91
95
|
* @tutorial Application.EventEmitter
|
|
92
96
|
*/
|
|
93
|
-
/**
|
|
94
|
-
* Determines if the application is currently running.
|
|
95
|
-
* @return {Promise.<boolean>}
|
|
96
|
-
* @tutorial Application.isRunning
|
|
97
|
-
*/
|
|
98
97
|
/**
|
|
99
98
|
* JumpListCategory interface
|
|
100
99
|
* @typedef { object } JumpListCategory
|
|
@@ -112,190 +111,546 @@ export declare class Application extends EmitterBase<OpenFin.ApplicationEvent> {
|
|
|
112
111
|
* @property { string } iconPath The absolute path to an icon to be displayed for the item, which can be an arbitrary resource file that contains an icon (e.g. .ico, .exe, .dll).
|
|
113
112
|
* @property { number } iconIndex The index of the icon in the resource file. If a resource file contains multiple icons this value can be used to specify the zero-based index of the icon that should be displayed for this task. If a resource file contains only one icon, this property should be set to zero.
|
|
114
113
|
*/
|
|
114
|
+
/**
|
|
115
|
+
* Determines if the application is currently running.
|
|
116
|
+
*
|
|
117
|
+
* @example
|
|
118
|
+
*
|
|
119
|
+
* ```js
|
|
120
|
+
* async function isAppRunning() {
|
|
121
|
+
* const app = await fin.Application.getCurrent();
|
|
122
|
+
* return await app.isRunning();
|
|
123
|
+
* }
|
|
124
|
+
* isAppRunning().then(running => console.log(`Current app is running: ${running}`)).catch(err => console.log(err));
|
|
125
|
+
* ```
|
|
126
|
+
*/
|
|
115
127
|
isRunning(): Promise<boolean>;
|
|
116
128
|
/**
|
|
117
129
|
* Closes the application and any child windows created by the application.
|
|
118
130
|
* Cleans the application from state so it is no longer found in getAllApplications.
|
|
119
|
-
* @param
|
|
131
|
+
* @param force Close will be prevented from closing when force is false and
|
|
120
132
|
* ‘close-requested’ has been subscribed to for application’s main window.
|
|
121
|
-
*
|
|
122
|
-
* @
|
|
133
|
+
*
|
|
134
|
+
* @example
|
|
135
|
+
*
|
|
136
|
+
* ```js
|
|
137
|
+
* async function closeApp() {
|
|
138
|
+
* const allApps1 = await fin.System.getAllApplications(); //[{uuid: 'app1', isRunning: true}, {uuid: 'app2', isRunning: true}]
|
|
139
|
+
* const app = await fin.Application.wrap({uuid: 'app2'});
|
|
140
|
+
* await app.quit();
|
|
141
|
+
* const allApps2 = await fin.System.getAllApplications(); //[{uuid: 'app1', isRunning: true}]
|
|
142
|
+
*
|
|
143
|
+
* }
|
|
144
|
+
* closeApp().then(() => console.log('Application quit')).catch(err => console.log(err));
|
|
145
|
+
* ```
|
|
123
146
|
*/
|
|
124
147
|
quit(force?: boolean): Promise<void>;
|
|
125
148
|
private _close;
|
|
149
|
+
/**
|
|
150
|
+
* @deprecated use Application.quit instead
|
|
151
|
+
* Closes the application and any child windows created by the application.
|
|
152
|
+
* @param force - Close will be prevented from closing when force is false and ‘close-requested’ has been subscribed to for application’s main window.
|
|
153
|
+
* @param callback - called if the method succeeds.
|
|
154
|
+
* @param errorCallback - called if the method fails. The reason for failure is passed as an argument.
|
|
155
|
+
*
|
|
156
|
+
* @example
|
|
157
|
+
*
|
|
158
|
+
* ```js
|
|
159
|
+
* async function closeApp() {
|
|
160
|
+
* const app = await fin.Application.getCurrent();
|
|
161
|
+
* return await app.close();
|
|
162
|
+
* }
|
|
163
|
+
* closeApp().then(() => console.log('Application closed')).catch(err => console.log(err));
|
|
164
|
+
* ```
|
|
165
|
+
*/
|
|
126
166
|
close(force?: boolean): Promise<void>;
|
|
127
167
|
/**
|
|
128
168
|
* Retrieves an array of wrapped fin.Windows for each of the application’s child windows.
|
|
129
|
-
*
|
|
130
|
-
* @
|
|
169
|
+
*
|
|
170
|
+
* @example
|
|
171
|
+
*
|
|
172
|
+
* ```js
|
|
173
|
+
* async function getChildWindows() {
|
|
174
|
+
* const app = await fin.Application.getCurrent();
|
|
175
|
+
* return await app.getChildWindows();
|
|
176
|
+
* }
|
|
177
|
+
*
|
|
178
|
+
* getChildWindows().then(children => console.log(children)).catch(err => console.log(err));
|
|
179
|
+
* ```
|
|
131
180
|
*/
|
|
132
181
|
getChildWindows(): Promise<Array<OpenFin.Window>>;
|
|
133
182
|
/**
|
|
134
183
|
* Retrieves the JSON manifest that was used to create the application. Invokes the error callback
|
|
135
184
|
* if the application was not created from a manifest.
|
|
136
|
-
*
|
|
137
|
-
* @
|
|
185
|
+
*
|
|
186
|
+
* @example
|
|
187
|
+
*
|
|
188
|
+
* ```js
|
|
189
|
+
* async function getManifest() {
|
|
190
|
+
* const app = await fin.Application.getCurrent();
|
|
191
|
+
* return await app.getManifest();
|
|
192
|
+
* }
|
|
193
|
+
*
|
|
194
|
+
* getManifest().then(manifest => console.log(manifest)).catch(err => console.log(err));
|
|
195
|
+
* ```
|
|
138
196
|
*/
|
|
139
197
|
getManifest(): Promise<OpenFin.Manifest>;
|
|
140
198
|
/**
|
|
141
199
|
* Retrieves UUID of the application that launches this application. Invokes the error callback
|
|
142
200
|
* if the application was created from a manifest.
|
|
143
|
-
*
|
|
144
|
-
* @
|
|
201
|
+
*
|
|
202
|
+
* @example
|
|
203
|
+
*
|
|
204
|
+
* ```js
|
|
205
|
+
* async function getParentUuid() {
|
|
206
|
+
* const app = await fin.Application.start({
|
|
207
|
+
* uuid: 'app-1',
|
|
208
|
+
* name: 'myApp',
|
|
209
|
+
* url: 'https://cdn.openfin.co/docs/javascript/stable/tutorial-Application.getParentUuid.html',
|
|
210
|
+
* autoShow: true
|
|
211
|
+
* });
|
|
212
|
+
* return await app.getParentUuid();
|
|
213
|
+
* }
|
|
214
|
+
*
|
|
215
|
+
* getParentUuid().then(parentUuid => console.log(parentUuid)).catch(err => console.log(err));
|
|
216
|
+
* ```
|
|
145
217
|
*/
|
|
146
218
|
getParentUuid(): Promise<string>;
|
|
147
219
|
/**
|
|
148
220
|
* Retrieves current application's shortcut configuration.
|
|
149
|
-
*
|
|
150
|
-
* @
|
|
221
|
+
*
|
|
222
|
+
* @example
|
|
223
|
+
*
|
|
224
|
+
* ```js
|
|
225
|
+
* async function getShortcuts() {
|
|
226
|
+
* const app = await fin.Application.wrap({ uuid: 'testapp' });
|
|
227
|
+
* return await app.getShortcuts();
|
|
228
|
+
* }
|
|
229
|
+
* getShortcuts().then(config => console.log(config)).catch(err => console.log(err));
|
|
230
|
+
* ```
|
|
151
231
|
*/
|
|
152
232
|
getShortcuts(): Promise<OpenFin.ShortCutConfig>;
|
|
153
233
|
/**
|
|
154
234
|
* Retrieves current application's views.
|
|
155
235
|
* @experimental
|
|
156
|
-
*
|
|
157
|
-
* @
|
|
236
|
+
*
|
|
237
|
+
* @example
|
|
238
|
+
*
|
|
239
|
+
* ```js
|
|
240
|
+
* async function getViews() {
|
|
241
|
+
* const app = await fin.Application.getCurrent();
|
|
242
|
+
* return await app.getViews();
|
|
243
|
+
* }
|
|
244
|
+
* getViews().then(views => console.log(views)).catch(err => console.log(err));
|
|
245
|
+
* ```
|
|
158
246
|
*/
|
|
159
247
|
getViews(): Promise<Array<OpenFin.View>>;
|
|
160
248
|
/**
|
|
161
249
|
* Returns the current zoom level of the application.
|
|
162
|
-
*
|
|
163
|
-
* @
|
|
250
|
+
*
|
|
251
|
+
* @example
|
|
252
|
+
*
|
|
253
|
+
* ```js
|
|
254
|
+
* async function getZoomLevel() {
|
|
255
|
+
* const app = await fin.Application.getCurrent();
|
|
256
|
+
* return await app.getZoomLevel();
|
|
257
|
+
* }
|
|
258
|
+
*
|
|
259
|
+
* getZoomLevel().then(zoomLevel => console.log(zoomLevel)).catch(err => console.log(err));
|
|
260
|
+
* ```
|
|
164
261
|
*/
|
|
165
262
|
getZoomLevel(): Promise<number>;
|
|
166
263
|
/**
|
|
167
264
|
* Returns an instance of the main Window of the application
|
|
168
|
-
*
|
|
169
|
-
* @
|
|
265
|
+
*
|
|
266
|
+
* @example
|
|
267
|
+
*
|
|
268
|
+
* ```js
|
|
269
|
+
* async function getWindow() {
|
|
270
|
+
* const app = await fin.Application.start({
|
|
271
|
+
* uuid: 'app-1',
|
|
272
|
+
* name: 'myApp',
|
|
273
|
+
* url: 'https://cdn.openfin.co/docs/javascript/stable/tutorial-Application.getWindow.html',
|
|
274
|
+
* autoShow: true
|
|
275
|
+
* });
|
|
276
|
+
* return await app.getWindow();
|
|
277
|
+
* }
|
|
278
|
+
*
|
|
279
|
+
* getWindow().then(win => {
|
|
280
|
+
* win.showAt(0, 400);
|
|
281
|
+
* win.flash();
|
|
282
|
+
* }).catch(err => console.log(err));
|
|
283
|
+
* ```
|
|
170
284
|
*/
|
|
171
285
|
getWindow(): Promise<OpenFin.Window>;
|
|
172
286
|
/**
|
|
173
287
|
* Manually registers a user with the licensing service. The only data sent by this call is userName and appName.
|
|
174
|
-
* @param
|
|
175
|
-
* @param
|
|
176
|
-
*
|
|
177
|
-
* @
|
|
288
|
+
* @param userName - username to be passed to the RVM.
|
|
289
|
+
* @param appName - app name to be passed to the RVM.
|
|
290
|
+
*
|
|
291
|
+
* @example
|
|
292
|
+
*
|
|
293
|
+
* ```js
|
|
294
|
+
* async function registerUser() {
|
|
295
|
+
* const app = await fin.Application.getCurrent();
|
|
296
|
+
* return await app.registerUser('user', 'myApp');
|
|
297
|
+
* }
|
|
298
|
+
*
|
|
299
|
+
* registerUser().then(() => console.log('Successfully registered the user')).catch(err => console.log(err));
|
|
300
|
+
* ```
|
|
178
301
|
*/
|
|
179
302
|
registerUser(userName: string, appName: string): Promise<void>;
|
|
180
303
|
/**
|
|
181
304
|
* Removes the application’s icon from the tray.
|
|
182
|
-
*
|
|
183
|
-
* @
|
|
305
|
+
*
|
|
306
|
+
* @example
|
|
307
|
+
*
|
|
308
|
+
* ```js
|
|
309
|
+
* async function removeTrayIcon() {
|
|
310
|
+
* const app = await fin.Application.getCurrent();
|
|
311
|
+
* return await app.removeTrayIcon();
|
|
312
|
+
* }
|
|
313
|
+
*
|
|
314
|
+
* removeTrayIcon().then(() => console.log('Removed the tray icon.')).catch(err => console.log(err));
|
|
315
|
+
* ```
|
|
184
316
|
*/
|
|
185
317
|
removeTrayIcon(): Promise<void>;
|
|
186
318
|
/**
|
|
187
319
|
* Restarts the application.
|
|
188
|
-
*
|
|
189
|
-
* @
|
|
320
|
+
*
|
|
321
|
+
* @example
|
|
322
|
+
*
|
|
323
|
+
* ```js
|
|
324
|
+
* async function restartApp() {
|
|
325
|
+
* const app = await fin.Application.getCurrent();
|
|
326
|
+
* return await app.restart();
|
|
327
|
+
* }
|
|
328
|
+
* restartApp().then(() => console.log('Application restarted')).catch(err => console.log(err));
|
|
329
|
+
* ```
|
|
190
330
|
*/
|
|
191
331
|
restart(): Promise<void>;
|
|
192
332
|
/**
|
|
193
333
|
* DEPRECATED method to run the application.
|
|
194
334
|
* Needed when starting application via {@link Application.create}, but NOT needed when starting via {@link Application.start}.
|
|
195
|
-
*
|
|
196
|
-
* @
|
|
335
|
+
*
|
|
336
|
+
* @example
|
|
337
|
+
*
|
|
338
|
+
* ```js
|
|
339
|
+
* async function run() {
|
|
340
|
+
* const app = await fin.Application.create({
|
|
341
|
+
* name: 'myApp',
|
|
342
|
+
* uuid: 'app-1',
|
|
343
|
+
* url: 'https://cdn.openfin.co/docs/javascript/stable/tutorial-Application.run.html',
|
|
344
|
+
* autoShow: true
|
|
345
|
+
* });
|
|
346
|
+
* await app.run();
|
|
347
|
+
* }
|
|
348
|
+
* run().then(() => console.log('Application is running')).catch(err => console.log(err));
|
|
349
|
+
* ```
|
|
350
|
+
*
|
|
197
351
|
* @ignore
|
|
198
352
|
*/
|
|
199
353
|
run(): Promise<void>;
|
|
200
354
|
private _run;
|
|
201
355
|
/**
|
|
202
356
|
* Instructs the RVM to schedule one restart of the application.
|
|
203
|
-
*
|
|
204
|
-
* @
|
|
357
|
+
*
|
|
358
|
+
* @example
|
|
359
|
+
*
|
|
360
|
+
* ```js
|
|
361
|
+
* async function scheduleRestart() {
|
|
362
|
+
* const app = await fin.Application.getCurrent();
|
|
363
|
+
* return await app.scheduleRestart();
|
|
364
|
+
* }
|
|
365
|
+
*
|
|
366
|
+
* scheduleRestart().then(() => console.log('Application is scheduled to restart')).catch(err => console.log(err));
|
|
367
|
+
* ```
|
|
205
368
|
*/
|
|
206
369
|
scheduleRestart(): Promise<void>;
|
|
207
370
|
/**
|
|
208
371
|
* Sends a message to the RVM to upload the application's logs. On success,
|
|
209
372
|
* an object containing logId is returned.
|
|
210
|
-
*
|
|
211
|
-
* @
|
|
373
|
+
*
|
|
374
|
+
* @example
|
|
375
|
+
*
|
|
376
|
+
* ```js
|
|
377
|
+
* async function sendLog() {
|
|
378
|
+
* const app = await fin.Application.getCurrent();
|
|
379
|
+
* return await app.sendApplicationLog();
|
|
380
|
+
* }
|
|
381
|
+
*
|
|
382
|
+
* sendLog().then(info => console.log(info.logId)).catch(err => console.log(err));
|
|
383
|
+
* ```
|
|
212
384
|
*/
|
|
213
385
|
sendApplicationLog(): Promise<OpenFin.SendApplicationLogResponse>;
|
|
214
386
|
/**
|
|
215
387
|
* Sets or removes a custom JumpList for the application. Only applicable in Windows OS.
|
|
216
388
|
* If categories is null the previously set custom JumpList (if any) will be replaced by the standard JumpList for the app (managed by Windows).
|
|
217
389
|
* Note: If the "name" property is omitted it defaults to "tasks".
|
|
218
|
-
* @param
|
|
219
|
-
*
|
|
220
|
-
*
|
|
390
|
+
* @param jumpListCategories An array of JumpList Categories to populate. If null, remove any existing JumpList configuration and set to Windows default.
|
|
391
|
+
*
|
|
392
|
+
*
|
|
393
|
+
* @remarks If categories is null the previously set custom JumpList (if any) will be replaced by the standard JumpList for the app (managed by Windows).
|
|
394
|
+
*
|
|
395
|
+
* The bottommost item in the jumplist will always be an item pointing to the current app. Its name is taken from the manifest's
|
|
396
|
+
* **` shortcut.name `** and uses **` shortcut.company `** as a fallback. Clicking that item will launch the app from its current manifest.
|
|
397
|
+
*
|
|
398
|
+
* Note: If the "name" property is omitted it defaults to "tasks".
|
|
399
|
+
*
|
|
400
|
+
* Note: Window OS caches jumplists icons, therefore an icon change might only be visible after the cache is removed or the
|
|
401
|
+
* uuid or shortcut.name is changed.
|
|
402
|
+
*
|
|
403
|
+
* @example
|
|
404
|
+
*
|
|
405
|
+
* ```js
|
|
406
|
+
* const app = fin.Application.getCurrentSync();
|
|
407
|
+
* const appName = 'My App';
|
|
408
|
+
* const jumpListConfig = [ // array of JumpList categories
|
|
409
|
+
* {
|
|
410
|
+
* // has no name and no type so `type` is assumed to be "tasks"
|
|
411
|
+
* items: [ // array of JumpList items
|
|
412
|
+
* {
|
|
413
|
+
* type: 'task',
|
|
414
|
+
* title: `Launch ${appName}`,
|
|
415
|
+
* description: `Runs ${appName} with the default configuration`,
|
|
416
|
+
* deepLink: 'fins://path.to/app/manifest.json',
|
|
417
|
+
* iconPath: 'https://path.to/app/icon.ico',
|
|
418
|
+
* iconIndex: 0
|
|
419
|
+
* },
|
|
420
|
+
* { type: 'separator' },
|
|
421
|
+
* {
|
|
422
|
+
* type: 'task',
|
|
423
|
+
* title: `Restore ${appName}`,
|
|
424
|
+
* description: 'Restore to last configuration',
|
|
425
|
+
* deepLink: 'fins://path.to/app/manifest.json?$$use-last-configuration=true',
|
|
426
|
+
* iconPath: 'https://path.to/app/icon.ico',
|
|
427
|
+
* iconIndex: 0
|
|
428
|
+
* },
|
|
429
|
+
* ]
|
|
430
|
+
* },
|
|
431
|
+
* {
|
|
432
|
+
* name: 'Tools',
|
|
433
|
+
* items: [ // array of JumpList items
|
|
434
|
+
* {
|
|
435
|
+
* type: 'task',
|
|
436
|
+
* title: 'Tool A',
|
|
437
|
+
* description: 'Runs Tool A',
|
|
438
|
+
* deepLink: 'fins://path.to/tool-a/manifest.json',
|
|
439
|
+
* iconPath: 'https://path.to/tool-a/icon.ico',
|
|
440
|
+
* iconIndex: 0
|
|
441
|
+
* },
|
|
442
|
+
* {
|
|
443
|
+
* type: 'task',
|
|
444
|
+
* title: 'Tool B',
|
|
445
|
+
* description: 'Runs Tool B',
|
|
446
|
+
* deepLink: 'fins://path.to/tool-b/manifest.json',
|
|
447
|
+
* iconPath: 'https://path.to/tool-b/icon.ico',
|
|
448
|
+
* iconIndex: 0
|
|
449
|
+
* }]
|
|
450
|
+
* }
|
|
451
|
+
* ];
|
|
452
|
+
*
|
|
453
|
+
* app.setJumpList(jumpListConfig).then(() => console.log('JumpList applied')).catch(e => console.log(`JumpList failed to apply: ${e.toString()}`));
|
|
454
|
+
* ```
|
|
455
|
+
*
|
|
456
|
+
* To handle deeplink args:
|
|
457
|
+
* ```js
|
|
458
|
+
* function handleUseLastConfiguration() {
|
|
459
|
+
* // this handler is called when the app is being launched
|
|
460
|
+
* app.on('run-requested', event => {
|
|
461
|
+
* if(event.userAppConfigArgs['use-last-configuration']) {
|
|
462
|
+
* // your logic here
|
|
463
|
+
* }
|
|
464
|
+
* });
|
|
465
|
+
* // this handler is called when the app was already running when the launch was requested
|
|
466
|
+
* fin.desktop.main(function(args) {
|
|
467
|
+
* if(args && args['use-last-configuration']) {
|
|
468
|
+
* // your logic here
|
|
469
|
+
* }
|
|
470
|
+
* });
|
|
471
|
+
* }
|
|
472
|
+
* ```
|
|
221
473
|
*/
|
|
222
474
|
setJumpList(jumpListCategories: OpenFin.JumpListCategory[] | null): Promise<void>;
|
|
223
475
|
/**
|
|
224
476
|
* Adds a customizable icon in the system tray. To listen for a click on the icon use the `tray-icon-clicked` event.
|
|
225
|
-
* @param
|
|
226
|
-
*
|
|
227
|
-
* @
|
|
477
|
+
* @param icon Image URL or base64 encoded string to be used as the icon
|
|
478
|
+
*
|
|
479
|
+
* @example
|
|
480
|
+
*
|
|
481
|
+
* ```js
|
|
482
|
+
* const imageUrl = "http://cdn.openfin.co/assets/testing/icons/circled-digit-one.png";
|
|
483
|
+
* const base64EncodedImage = "iVBORw0KGgoAAAANSUhEUgAAAAgAAAAIAQMAAAD+wSzIAAAABlBMVEX\
|
|
484
|
+
* ///+/v7+jQ3Y5AAAADklEQVQI12P4AIX8EAgALgAD/aNpbtEAAAAASUVORK5CYII";
|
|
485
|
+
* const dataURL = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DH\
|
|
486
|
+
* xgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==";
|
|
487
|
+
*
|
|
488
|
+
* async function setTrayIcon(icon) {
|
|
489
|
+
* const app = await fin.Application.getCurrent();
|
|
490
|
+
* return await app.setTrayIcon(icon);
|
|
491
|
+
* }
|
|
492
|
+
*
|
|
493
|
+
* // use image url to set tray icon
|
|
494
|
+
* setTrayIcon(imageUrl).then(() => console.log('Setting tray icon')).catch(err => console.log(err));
|
|
495
|
+
*
|
|
496
|
+
* // use base64 encoded string to set tray icon
|
|
497
|
+
* setTrayIcon(base64EncodedImage).then(() => console.log('Setting tray icon')).catch(err => console.log(err));
|
|
498
|
+
*
|
|
499
|
+
* // use a dataURL to set tray icon
|
|
500
|
+
* setTrayIcon(dataURL).then(() => console.log('Setting tray icon')).catch(err => console.log(err));
|
|
501
|
+
* ```
|
|
228
502
|
*/
|
|
229
503
|
setTrayIcon(icon: string): Promise<void>;
|
|
230
504
|
/**
|
|
231
505
|
* Sets new application's shortcut configuration. Windows only.
|
|
232
|
-
* @param
|
|
233
|
-
*
|
|
234
|
-
* @
|
|
235
|
-
*
|
|
236
|
-
*
|
|
237
|
-
* @
|
|
506
|
+
* @param config New application's shortcut configuration.
|
|
507
|
+
*
|
|
508
|
+
* @remarks Application has to be launched with a manifest and has to have shortcut configuration (icon url, name, etc.) in its manifest
|
|
509
|
+
* to be able to change shortcut states.
|
|
510
|
+
*
|
|
511
|
+
* @example
|
|
512
|
+
*
|
|
513
|
+
* ```js
|
|
514
|
+
* async function setShortcuts(config) {
|
|
515
|
+
* const app = await fin.Application.getCurrent();
|
|
516
|
+
* return app.setShortcuts(config);
|
|
517
|
+
* }
|
|
518
|
+
*
|
|
519
|
+
* setShortcuts({
|
|
520
|
+
* desktop: true,
|
|
521
|
+
* startMenu: false,
|
|
522
|
+
* systemStartup: true
|
|
523
|
+
* }).then(() => console.log('Shortcuts are set.')).catch(err => console.log(err));
|
|
524
|
+
* ```
|
|
238
525
|
*/
|
|
239
526
|
setShortcuts(config: OpenFin.ShortCutConfig): Promise<void>;
|
|
240
527
|
/**
|
|
241
528
|
* Sets the query string in all shortcuts for this app. Requires RVM 5.5+.
|
|
242
|
-
* @param
|
|
243
|
-
*
|
|
244
|
-
* @
|
|
529
|
+
* @param queryString The new query string for this app's shortcuts.
|
|
530
|
+
*
|
|
531
|
+
* @example
|
|
532
|
+
*
|
|
533
|
+
* ```js
|
|
534
|
+
* const newQueryArgs = 'arg=true&arg2=false';
|
|
535
|
+
* const app = await fin.Application.getCurrent();
|
|
536
|
+
* try {
|
|
537
|
+
* await app.setShortcutQueryParams(newQueryArgs);
|
|
538
|
+
* } catch(err) {
|
|
539
|
+
* console.error(err)
|
|
540
|
+
* }
|
|
541
|
+
* ```
|
|
245
542
|
*/
|
|
246
543
|
setShortcutQueryParams(queryString: string): Promise<void>;
|
|
247
544
|
/**
|
|
248
545
|
* Sets the zoom level of the application. The original size is 0 and each increment above or below represents zooming 20%
|
|
249
546
|
* larger or smaller to default limits of 300% and 50% of original size, respectively.
|
|
250
|
-
* @param
|
|
251
|
-
*
|
|
252
|
-
* @
|
|
547
|
+
* @param level The zoom level
|
|
548
|
+
*
|
|
549
|
+
* @example
|
|
550
|
+
*
|
|
551
|
+
* ```js
|
|
552
|
+
* async function setZoomLevel(number) {
|
|
553
|
+
* const app = await fin.Application.getCurrent();
|
|
554
|
+
* return await app.setZoomLevel(number);
|
|
555
|
+
* }
|
|
556
|
+
*
|
|
557
|
+
* setZoomLevel(5).then(() => console.log('Setting a zoom level')).catch(err => console.log(err));
|
|
558
|
+
* ```
|
|
253
559
|
*/
|
|
254
560
|
setZoomLevel(level: number): Promise<void>;
|
|
255
561
|
/**
|
|
256
562
|
* Sets a username to correlate with App Log Management.
|
|
257
|
-
* @param
|
|
258
|
-
*
|
|
259
|
-
* @
|
|
563
|
+
* @param username Username to correlate with App's Log.
|
|
564
|
+
*
|
|
565
|
+
* @example
|
|
566
|
+
*
|
|
567
|
+
* ```js
|
|
568
|
+
* async function setAppLogUser() {
|
|
569
|
+
* const app = await fin.Application.getCurrent();
|
|
570
|
+
* return await app.setAppLogUsername('username');
|
|
571
|
+
* }
|
|
572
|
+
*
|
|
573
|
+
* setAppLogUser().then(() => console.log('Success')).catch(err => console.log(err));
|
|
574
|
+
*
|
|
575
|
+
* ```
|
|
260
576
|
*/
|
|
261
577
|
setAppLogUsername(username: string): Promise<void>;
|
|
262
578
|
/**
|
|
263
|
-
*
|
|
264
|
-
* @
|
|
265
|
-
*
|
|
266
|
-
* @
|
|
579
|
+
* Retrieves information about the system tray. If the system tray is not set, it will throw an error message.
|
|
580
|
+
* @remarks The only information currently returned is the position and dimensions.
|
|
581
|
+
*
|
|
582
|
+
* @example
|
|
583
|
+
*
|
|
584
|
+
* ```js
|
|
585
|
+
* async function getTrayIconInfo() {
|
|
586
|
+
* const app = await fin.Application.wrap({ uuid: 'testapp' });
|
|
587
|
+
* return await app.getTrayIconInfo();
|
|
588
|
+
* }
|
|
589
|
+
* getTrayIconInfo().then(info => console.log(info)).catch(err => console.log(err));
|
|
590
|
+
* ```
|
|
267
591
|
*/
|
|
268
592
|
getTrayIconInfo(): Promise<OpenFin.TrayInfo>;
|
|
269
593
|
/**
|
|
270
|
-
*
|
|
271
|
-
*
|
|
272
|
-
* @
|
|
594
|
+
* Checks if the application has an associated tray icon.
|
|
595
|
+
*
|
|
596
|
+
* @example
|
|
597
|
+
*
|
|
598
|
+
* ```js
|
|
599
|
+
* const app = await fin.Application.wrap({ uuid: 'testapp' });
|
|
600
|
+
* const hasTrayIcon = await app.hasTrayIcon();
|
|
601
|
+
* console.log(hasTrayIcon);
|
|
602
|
+
* ```
|
|
273
603
|
*/
|
|
274
604
|
hasTrayIcon(): Promise<boolean>;
|
|
275
605
|
/**
|
|
276
606
|
* Closes the application by terminating its process.
|
|
277
|
-
*
|
|
278
|
-
* @
|
|
607
|
+
*
|
|
608
|
+
* @example
|
|
609
|
+
*
|
|
610
|
+
* ```js
|
|
611
|
+
* async function terminateApp() {
|
|
612
|
+
* const app = await fin.Application.getCurrent();
|
|
613
|
+
* return await app.terminate();
|
|
614
|
+
* }
|
|
615
|
+
* terminateApp().then(() => console.log('Application terminated')).catch(err => console.log(err));
|
|
616
|
+
* ```
|
|
279
617
|
*/
|
|
280
618
|
terminate(): Promise<void>;
|
|
281
619
|
/**
|
|
282
620
|
* Waits for a hanging application. This method can be called in response to an application
|
|
283
621
|
* "not-responding" to allow the application to continue and to generate another "not-responding"
|
|
284
622
|
* message after a certain period of time.
|
|
285
|
-
*
|
|
623
|
+
*
|
|
286
624
|
* @ignore
|
|
287
625
|
*/
|
|
288
626
|
wait(): Promise<void>;
|
|
289
627
|
/**
|
|
290
628
|
* Retrieves information about the application.
|
|
291
|
-
*
|
|
292
|
-
* @
|
|
629
|
+
*
|
|
630
|
+
* @remarks If the application was not launched from a manifest, the call will return the closest parent application `manifest`
|
|
631
|
+
* and `manifestUrl`. `initialOptions` shows the parameters used when launched programmatically, or the `startup_app` options
|
|
632
|
+
* if launched from manifest. The `parentUuid` will be the uuid of the immediate parent (if applicable).
|
|
633
|
+
*
|
|
634
|
+
* @example
|
|
635
|
+
*
|
|
636
|
+
* ```js
|
|
637
|
+
* async function getInfo() {
|
|
638
|
+
* const app = await fin.Application.getCurrent();
|
|
639
|
+
* return await app.getInfo();
|
|
640
|
+
* }
|
|
641
|
+
*
|
|
642
|
+
* getInfo().then(info => console.log(info)).catch(err => console.log(err));
|
|
643
|
+
* ```
|
|
293
644
|
*/
|
|
294
645
|
getInfo(): Promise<OpenFin.ApplicationInfo>;
|
|
295
646
|
/**
|
|
296
647
|
* Retrieves all process information for entities (windows and views) associated with an application.
|
|
297
|
-
*
|
|
298
|
-
* @
|
|
648
|
+
*
|
|
649
|
+
* @example
|
|
650
|
+
* ```js
|
|
651
|
+
* const app = await fin.Application.getCurrent();
|
|
652
|
+
* const processInfo = await app.getProcessInfo();
|
|
653
|
+
* ```
|
|
299
654
|
* @experimental
|
|
300
655
|
*/
|
|
301
656
|
getProcessInfo(): Promise<OpenFin.AppProcessInfo>;
|
|
@@ -303,19 +658,35 @@ export declare class Application extends EmitterBase<OpenFin.ApplicationEvent> {
|
|
|
303
658
|
* Sets file auto download location. It's only allowed in the same application.
|
|
304
659
|
* Note: This method is restricted by default and must be enabled via
|
|
305
660
|
* <a href="https://developers.openfin.co/docs/api-security">API security settings</a>.
|
|
306
|
-
* @param
|
|
307
|
-
*
|
|
661
|
+
* @param downloadLocation file auto download location
|
|
662
|
+
*
|
|
308
663
|
* @throws if setting file auto download location on different applications.
|
|
309
|
-
* @
|
|
664
|
+
* @example
|
|
665
|
+
*
|
|
666
|
+
* ```js
|
|
667
|
+
* const downloadLocation = 'C:\\dev\\temp';
|
|
668
|
+
* const app = await fin.Application.getCurrent();
|
|
669
|
+
* try {
|
|
670
|
+
* await app.setFileDownloadLocation(downloadLocation);
|
|
671
|
+
* console.log('File download location is set');
|
|
672
|
+
* } catch(err) {
|
|
673
|
+
* console.error(err)
|
|
674
|
+
* }
|
|
675
|
+
* ```
|
|
310
676
|
*/
|
|
311
677
|
setFileDownloadLocation(downloadLocation: string): Promise<void>;
|
|
312
678
|
/**
|
|
313
679
|
* Gets file auto download location. It's only allowed in the same application. If file auto download location is not set, it will return the default location.
|
|
314
680
|
* Note: This method is restricted by default and must be enabled via
|
|
315
681
|
* <a href="https://developers.openfin.co/docs/api-security">API security settings</a>.
|
|
316
|
-
*
|
|
682
|
+
*
|
|
317
683
|
* @throws if getting file auto download location on different applications.
|
|
318
|
-
* @
|
|
684
|
+
* @example
|
|
685
|
+
*
|
|
686
|
+
* ```js
|
|
687
|
+
* const app = await fin.Application.getCurrent();
|
|
688
|
+
* const fileDownloadDir = await app.getFileDownloadLocation();
|
|
689
|
+
* ```
|
|
319
690
|
*/
|
|
320
691
|
getFileDownloadLocation(): Promise<string>;
|
|
321
692
|
}
|