@openfin/core 33.76.36 → 33.76.38
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/OpenFin.d.ts +1 -1
- package/README.md +29 -4
- package/fin.d.ts +2 -2
- package/{src → out}/GlobalOpenFin.d.ts +1 -1
- package/out/mock-alpha.d.ts +16112 -0
- package/out/mock-beta.d.ts +16112 -0
- package/out/mock-public.d.ts +16112 -0
- package/out/mock.d.ts +16797 -0
- package/out/mock.js +17104 -0
- package/package.json +30 -23
- package/LICENSE +0 -13
- package/NOTICE +0 -16
- package/openfin-core-33.76.36.tgz +0 -0
- package/src/OpenFin.d.ts +0 -3091
- package/src/OpenFin.js +0 -2
- package/src/api/api-exposer/api-consumer.d.ts +0 -28
- package/src/api/api-exposer/api-consumer.js +0 -28
- package/src/api/api-exposer/api-exposer.d.ts +0 -35
- package/src/api/api-exposer/api-exposer.js +0 -38
- package/src/api/api-exposer/decorators.d.ts +0 -10
- package/src/api/api-exposer/decorators.js +0 -18
- package/src/api/api-exposer/index.d.ts +0 -4
- package/src/api/api-exposer/index.js +0 -20
- package/src/api/api-exposer/strategies/index.d.ts +0 -1
- package/src/api/api-exposer/strategies/index.js +0 -17
- package/src/api/api-exposer/strategies/openfin-channels/channels-consumer.d.ts +0 -14
- package/src/api/api-exposer/strategies/openfin-channels/channels-consumer.js +0 -20
- package/src/api/api-exposer/strategies/openfin-channels/channels-exposer.d.ts +0 -20
- package/src/api/api-exposer/strategies/openfin-channels/channels-exposer.js +0 -23
- package/src/api/api-exposer/strategies/openfin-channels/index.d.ts +0 -2
- package/src/api/api-exposer/strategies/openfin-channels/index.js +0 -18
- package/src/api/application/Factory.d.ts +0 -196
- package/src/api/application/Factory.js +0 -278
- package/src/api/application/Instance.d.ts +0 -692
- package/src/api/application/Instance.js +0 -821
- package/src/api/application/index.d.ts +0 -12
- package/src/api/application/index.js +0 -28
- package/src/api/base.d.ts +0 -117
- package/src/api/base.js +0 -246
- package/src/api/clipboard/index.d.ts +0 -172
- package/src/api/clipboard/index.js +0 -200
- package/src/api/events/application.d.ts +0 -158
- package/src/api/events/application.js +0 -14
- package/src/api/events/base.d.ts +0 -42
- package/src/api/events/base.js +0 -2
- package/src/api/events/channel.d.ts +0 -35
- package/src/api/events/channel.js +0 -7
- package/src/api/events/emitterMap.d.ts +0 -11
- package/src/api/events/emitterMap.js +0 -35
- package/src/api/events/eventAggregator.d.ts +0 -5
- package/src/api/events/eventAggregator.js +0 -35
- package/src/api/events/externalApplication.d.ts +0 -24
- package/src/api/events/externalApplication.js +0 -7
- package/src/api/events/frame.d.ts +0 -35
- package/src/api/events/frame.js +0 -2
- package/src/api/events/globalHotkey.d.ts +0 -25
- package/src/api/events/globalHotkey.js +0 -2
- package/src/api/events/platform.d.ts +0 -34
- package/src/api/events/platform.js +0 -10
- package/src/api/events/system.d.ts +0 -126
- package/src/api/events/system.js +0 -15
- package/src/api/events/typedEventEmitter.d.ts +0 -20
- package/src/api/events/typedEventEmitter.js +0 -2
- package/src/api/events/view.d.ts +0 -92
- package/src/api/events/view.js +0 -12
- package/src/api/events/webcontents.d.ts +0 -277
- package/src/api/events/webcontents.js +0 -13
- package/src/api/events/window.d.ts +0 -421
- package/src/api/events/window.js +0 -12
- package/src/api/external-application/Factory.d.ts +0 -34
- package/src/api/external-application/Factory.js +0 -47
- package/src/api/external-application/Instance.d.ts +0 -110
- package/src/api/external-application/Instance.js +0 -117
- package/src/api/external-application/index.d.ts +0 -12
- package/src/api/external-application/index.js +0 -28
- package/src/api/fin.d.ts +0 -54
- package/src/api/fin.js +0 -45
- package/src/api/frame/Factory.d.ts +0 -54
- package/src/api/frame/Factory.js +0 -86
- package/src/api/frame/Instance.d.ts +0 -136
- package/src/api/frame/Instance.js +0 -143
- package/src/api/frame/index.d.ts +0 -14
- package/src/api/frame/index.js +0 -30
- package/src/api/global-hotkey/index.d.ts +0 -106
- package/src/api/global-hotkey/index.js +0 -132
- package/src/api/interappbus/channel/channel.d.ts +0 -285
- package/src/api/interappbus/channel/channel.js +0 -334
- package/src/api/interappbus/channel/channels-docs.d.ts +0 -342
- package/src/api/interappbus/channel/channels-docs.js +0 -401
- package/src/api/interappbus/channel/client.d.ts +0 -117
- package/src/api/interappbus/channel/client.js +0 -181
- package/src/api/interappbus/channel/connection-manager.d.ts +0 -29
- package/src/api/interappbus/channel/connection-manager.js +0 -246
- package/src/api/interappbus/channel/index.d.ts +0 -189
- package/src/api/interappbus/channel/index.js +0 -333
- package/src/api/interappbus/channel/protocols/classic/message-receiver.d.ts +0 -13
- package/src/api/interappbus/channel/protocols/classic/message-receiver.js +0 -73
- package/src/api/interappbus/channel/protocols/classic/strategy.d.ts +0 -24
- package/src/api/interappbus/channel/protocols/classic/strategy.js +0 -101
- package/src/api/interappbus/channel/protocols/combined/strategy.d.ts +0 -20
- package/src/api/interappbus/channel/protocols/combined/strategy.js +0 -58
- package/src/api/interappbus/channel/protocols/index.d.ts +0 -47
- package/src/api/interappbus/channel/protocols/index.js +0 -2
- package/src/api/interappbus/channel/protocols/protocol-manager.d.ts +0 -10
- package/src/api/interappbus/channel/protocols/protocol-manager.js +0 -43
- package/src/api/interappbus/channel/protocols/rtc/endpoint.d.ts +0 -25
- package/src/api/interappbus/channel/protocols/rtc/endpoint.js +0 -141
- package/src/api/interappbus/channel/protocols/rtc/ice-manager.d.ts +0 -30
- package/src/api/interappbus/channel/protocols/rtc/ice-manager.js +0 -130
- package/src/api/interappbus/channel/protocols/rtc/strategy.d.ts +0 -24
- package/src/api/interappbus/channel/protocols/rtc/strategy.js +0 -85
- package/src/api/interappbus/channel/protocols/strategy-types.d.ts +0 -13
- package/src/api/interappbus/channel/protocols/strategy-types.js +0 -2
- package/src/api/interappbus/channel/protocols/strategy.d.ts +0 -17
- package/src/api/interappbus/channel/protocols/strategy.js +0 -2
- package/src/api/interappbus/channel/provider.d.ts +0 -206
- package/src/api/interappbus/channel/provider.js +0 -338
- package/src/api/interappbus/index.d.ts +0 -120
- package/src/api/interappbus/index.js +0 -210
- package/src/api/interop/Factory.d.ts +0 -57
- package/src/api/interop/Factory.js +0 -96
- package/src/api/interop/InteropBroker.d.ts +0 -665
- package/src/api/interop/InteropBroker.js +0 -1313
- package/src/api/interop/InteropClient.d.ts +0 -502
- package/src/api/interop/InteropClient.js +0 -683
- package/src/api/interop/SessionContextGroupBroker.d.ts +0 -27
- package/src/api/interop/SessionContextGroupBroker.js +0 -108
- package/src/api/interop/SessionContextGroupClient.d.ts +0 -21
- package/src/api/interop/SessionContextGroupClient.js +0 -86
- package/src/api/interop/fdc3/PrivateChannelClient.d.ts +0 -20
- package/src/api/interop/fdc3/PrivateChannelClient.js +0 -90
- package/src/api/interop/fdc3/PrivateChannelProvider.d.ts +0 -55
- package/src/api/interop/fdc3/PrivateChannelProvider.js +0 -276
- package/src/api/interop/fdc3/documentationStub.d.ts +0 -14
- package/src/api/interop/fdc3/documentationStub.js +0 -17
- package/src/api/interop/fdc3/fdc3-1.2.d.ts +0 -205
- package/src/api/interop/fdc3/fdc3-1.2.js +0 -435
- package/src/api/interop/fdc3/fdc3-2.0.d.ts +0 -298
- package/src/api/interop/fdc3/fdc3-2.0.js +0 -479
- package/src/api/interop/fdc3/fdc3.d.ts +0 -12
- package/src/api/interop/fdc3/fdc3.js +0 -35
- package/src/api/interop/fdc3/overrideCheck.d.ts +0 -4
- package/src/api/interop/fdc3/overrideCheck.js +0 -32
- package/src/api/interop/fdc3/shapes/fdc3v1.d.ts +0 -53
- package/src/api/interop/fdc3/shapes/fdc3v1.js +0 -4
- package/src/api/interop/fdc3/shapes/fdc3v2.d.ts +0 -75
- package/src/api/interop/fdc3/shapes/fdc3v2.js +0 -2
- package/src/api/interop/fdc3/utils.d.ts +0 -45
- package/src/api/interop/fdc3/utils.js +0 -239
- package/src/api/interop/fdc3/versions.d.ts +0 -1
- package/src/api/interop/fdc3/versions.js +0 -2
- package/src/api/interop/index.d.ts +0 -12
- package/src/api/interop/index.js +0 -28
- package/src/api/interop/utils.d.ts +0 -18
- package/src/api/interop/utils.js +0 -61
- package/src/api/me.d.ts +0 -40
- package/src/api/me.js +0 -134
- package/src/api/platform/Factory.d.ts +0 -171
- package/src/api/platform/Factory.js +0 -240
- package/src/api/platform/Instance.d.ts +0 -653
- package/src/api/platform/Instance.js +0 -834
- package/src/api/platform/common-utils.d.ts +0 -7
- package/src/api/platform/common-utils.js +0 -16
- package/src/api/platform/index.d.ts +0 -12
- package/src/api/platform/index.js +0 -28
- package/src/api/platform/layout/Factory.d.ts +0 -91
- package/src/api/platform/layout/Factory.js +0 -151
- package/src/api/platform/layout/Instance.d.ts +0 -192
- package/src/api/platform/layout/Instance.js +0 -224
- package/src/api/platform/layout/controllers/layout-content-cache.d.ts +0 -9
- package/src/api/platform/layout/controllers/layout-content-cache.js +0 -54
- package/src/api/platform/layout/controllers/layout-entities-controller.d.ts +0 -119
- package/src/api/platform/layout/controllers/layout-entities-controller.js +0 -287
- package/src/api/platform/layout/entities/layout-entities.d.ts +0 -427
- package/src/api/platform/layout/entities/layout-entities.js +0 -504
- package/src/api/platform/layout/entities/shapes.d.ts +0 -6
- package/src/api/platform/layout/entities/shapes.js +0 -2
- package/src/api/platform/layout/index.d.ts +0 -11
- package/src/api/platform/layout/index.js +0 -27
- package/src/api/platform/layout/layout.constants.d.ts +0 -1
- package/src/api/platform/layout/layout.constants.js +0 -4
- package/src/api/platform/layout/shapes.d.ts +0 -16
- package/src/api/platform/layout/shapes.js +0 -2
- package/src/api/platform/layout/utils/layout-traversal.d.ts +0 -4
- package/src/api/platform/layout/utils/layout-traversal.js +0 -65
- package/src/api/platform/provider.d.ts +0 -510
- package/src/api/platform/provider.js +0 -2
- package/src/api/snapshot-source/Factory.d.ts +0 -53
- package/src/api/snapshot-source/Factory.js +0 -81
- package/src/api/snapshot-source/Instance.d.ts +0 -53
- package/src/api/snapshot-source/Instance.js +0 -154
- package/src/api/snapshot-source/index.d.ts +0 -12
- package/src/api/snapshot-source/index.js +0 -28
- package/src/api/snapshot-source/utils.d.ts +0 -2
- package/src/api/snapshot-source/utils.js +0 -6
- package/src/api/system/index.d.ts +0 -1468
- package/src/api/system/index.js +0 -1851
- package/src/api/view/Factory.d.ts +0 -88
- package/src/api/view/Factory.js +0 -141
- package/src/api/view/Instance.d.ts +0 -601
- package/src/api/view/Instance.js +0 -671
- package/src/api/view/index.d.ts +0 -12
- package/src/api/view/index.js +0 -28
- package/src/api/webcontents/main.d.ts +0 -922
- package/src/api/webcontents/main.js +0 -1046
- package/src/api/window/Factory.d.ts +0 -96
- package/src/api/window/Factory.js +0 -142
- package/src/api/window/Instance.d.ts +0 -1598
- package/src/api/window/Instance.js +0 -1851
- package/src/api/window/index.d.ts +0 -14
- package/src/api/window/index.js +0 -30
- package/src/browser.d.ts +0 -10
- package/src/browser.js +0 -36
- package/src/environment/browser.d.ts +0 -29
- package/src/environment/browser.js +0 -60
- package/src/environment/environment.d.ts +0 -33
- package/src/environment/environment.js +0 -4
- package/src/environment/mockEnvironment.d.ts +0 -27
- package/src/environment/mockEnvironment.js +0 -61
- package/src/environment/node-env.d.ts +0 -29
- package/src/environment/node-env.js +0 -72
- package/src/fdc3.d.ts +0 -3
- package/src/fdc3.js +0 -9
- package/src/mock.d.ts +0 -3
- package/src/mock.js +0 -18
- package/src/namespaces.d.ts +0 -22
- package/src/namespaces.js +0 -26
- package/src/shapes/ERROR_BOX_TYPES.d.ts +0 -1
- package/src/shapes/ERROR_BOX_TYPES.js +0 -2
- package/src/shapes/WebOptions.d.ts +0 -13
- package/src/shapes/WebOptions.js +0 -2
- package/src/shapes/WindowOptions.d.ts +0 -43
- package/src/shapes/WindowOptions.js +0 -2
- package/src/shapes/protocol.d.ts +0 -204
- package/src/shapes/protocol.js +0 -2
- package/src/transport/mockWire.d.ts +0 -11
- package/src/transport/mockWire.js +0 -26
- package/src/transport/transport-errors.d.ts +0 -31
- package/src/transport/transport-errors.js +0 -79
- package/src/transport/transport.d.ts +0 -73
- package/src/transport/transport.js +0 -219
- package/src/transport/wire.d.ts +0 -77
- package/src/transport/wire.js +0 -36
- package/src/util/asyncFilter.d.ts +0 -1
- package/src/util/asyncFilter.js +0 -7
- package/src/util/channel-api-relay.d.ts +0 -13
- package/src/util/channel-api-relay.js +0 -47
- package/src/util/errors.d.ts +0 -10
- package/src/util/errors.js +0 -12
- package/src/util/exhaustive.d.ts +0 -1
- package/src/util/exhaustive.js +0 -7
- package/src/util/http.d.ts +0 -11
- package/src/util/http.js +0 -90
- package/src/util/inaccessibleObject.d.ts +0 -2
- package/src/util/inaccessibleObject.js +0 -49
- package/src/util/lazy.d.ts +0 -34
- package/src/util/lazy.js +0 -54
- package/src/util/normalize-config.d.ts +0 -3
- package/src/util/normalize-config.js +0 -52
- package/src/util/promises.d.ts +0 -5
- package/src/util/promises.js +0 -27
- package/src/util/ref-counter.d.ts +0 -7
- package/src/util/ref-counter.js +0 -52
- package/src/util/reversible-map.d.ts +0 -11
- package/src/util/reversible-map.js +0 -49
- package/src/util/runtimeVersioning.d.ts +0 -3
- package/src/util/runtimeVersioning.js +0 -25
- package/src/util/utilTypes.d.ts +0 -8
- package/src/util/utilTypes.js +0 -2
- package/src/util/validate.d.ts +0 -3
- package/src/util/validate.js +0 -11
|
@@ -1,922 +0,0 @@
|
|
|
1
|
-
import type * as OpenFin from '../../OpenFin';
|
|
2
|
-
import { EmitterBase } from '../base';
|
|
3
|
-
import { Transport } from '../../transport/transport';
|
|
4
|
-
import { BaseEvent } from '../events/base';
|
|
5
|
-
export declare class WebContents<T extends BaseEvent> extends EmitterBase<T> {
|
|
6
|
-
identity: OpenFin.Identity;
|
|
7
|
-
entityType: string;
|
|
8
|
-
constructor(wire: Transport, identity: OpenFin.Identity, entityType: string);
|
|
9
|
-
/**
|
|
10
|
-
* Gets a base64 encoded image of all or part of the WebContents.
|
|
11
|
-
* @function capturePage
|
|
12
|
-
* @param options Options for the capturePage call.
|
|
13
|
-
* @memberOf View
|
|
14
|
-
* @instance
|
|
15
|
-
*
|
|
16
|
-
* @example
|
|
17
|
-
*
|
|
18
|
-
* View:
|
|
19
|
-
* ```js
|
|
20
|
-
* const view = fin.View.getCurrentSync();
|
|
21
|
-
*
|
|
22
|
-
* // PNG image of a full visible View
|
|
23
|
-
* console.log(await view.capturePage());
|
|
24
|
-
*
|
|
25
|
-
* // Low-quality JPEG image of a defined visible area of the view
|
|
26
|
-
* const options = {
|
|
27
|
-
* area: {
|
|
28
|
-
* height: 100,
|
|
29
|
-
* width: 100,
|
|
30
|
-
* x: 10,
|
|
31
|
-
* y: 10,
|
|
32
|
-
* },
|
|
33
|
-
* format: 'jpg',
|
|
34
|
-
* quality: 20
|
|
35
|
-
* }
|
|
36
|
-
* console.log(await view.capturePage(options));
|
|
37
|
-
* ```
|
|
38
|
-
*
|
|
39
|
-
* Window:
|
|
40
|
-
* ```js
|
|
41
|
-
* const wnd = await fin.Window.getCurrent();
|
|
42
|
-
*
|
|
43
|
-
* // PNG image of a full visible window
|
|
44
|
-
* console.log(await wnd.capturePage());
|
|
45
|
-
*
|
|
46
|
-
* // Low-quality JPEG image of a defined visible area of the window
|
|
47
|
-
* const options = {
|
|
48
|
-
* area: {
|
|
49
|
-
* height: 100,
|
|
50
|
-
* width: 100,
|
|
51
|
-
* x: 10,
|
|
52
|
-
* y: 10,
|
|
53
|
-
* },
|
|
54
|
-
* format: 'jpg',
|
|
55
|
-
* quality: 20
|
|
56
|
-
* }
|
|
57
|
-
* console.log(await wnd.capturePage(options));
|
|
58
|
-
* ```
|
|
59
|
-
*/
|
|
60
|
-
capturePage(options?: OpenFin.CapturePageOptions): Promise<string>;
|
|
61
|
-
/**
|
|
62
|
-
* Executes Javascript on the WebContents, restricted to contents you own or contents owned by
|
|
63
|
-
* applications you have created.
|
|
64
|
-
* @param code JavaScript code to be executed on the view.
|
|
65
|
-
* @function executeJavaScript
|
|
66
|
-
* @memberOf View
|
|
67
|
-
* @instance
|
|
68
|
-
*
|
|
69
|
-
* @example
|
|
70
|
-
* View:
|
|
71
|
-
* ```js
|
|
72
|
-
* async function executeJavaScript(code) {
|
|
73
|
-
* const view = await fin.View.wrap({uuid: 'uuid', name: 'view name'});
|
|
74
|
-
* return await view.executeJavaScript(code);
|
|
75
|
-
* }
|
|
76
|
-
*
|
|
77
|
-
* executeJavaScript(`console.log('Hello, Openfin')`).then(() => console.log('Javascript excuted')).catch(err => console.log(err));
|
|
78
|
-
* ```
|
|
79
|
-
*
|
|
80
|
-
* Window:
|
|
81
|
-
* ```js
|
|
82
|
-
* async function executeJavaScript(code) {
|
|
83
|
-
* const app = await fin.Application.start({
|
|
84
|
-
* name: 'myApp',
|
|
85
|
-
* uuid: 'app-1',
|
|
86
|
-
* url: 'https://cdn.openfin.co/docs/javascript/stable/tutorial-Window.executeJavaScript.html',
|
|
87
|
-
* autoShow: true
|
|
88
|
-
* });
|
|
89
|
-
* const win = await app.getWindow();
|
|
90
|
-
* return await win.executeJavaScript(code);
|
|
91
|
-
* }
|
|
92
|
-
*
|
|
93
|
-
* executeJavaScript(`console.log('Hello, Openfin')`).then(() => console.log('Javascript excuted')).catch(err => console.log(err));
|
|
94
|
-
* ```
|
|
95
|
-
*/
|
|
96
|
-
executeJavaScript(code: string): Promise<void>;
|
|
97
|
-
/**
|
|
98
|
-
* Returns the zoom level of the WebContents.
|
|
99
|
-
* @function getZoomLevel
|
|
100
|
-
* @memberOf View
|
|
101
|
-
* @instance
|
|
102
|
-
*
|
|
103
|
-
* @example
|
|
104
|
-
* View:
|
|
105
|
-
* ```js
|
|
106
|
-
* async function getZoomLevel() {
|
|
107
|
-
* const view = await fin.View.getCurrent();
|
|
108
|
-
* return await view.getZoomLevel();
|
|
109
|
-
* }
|
|
110
|
-
*
|
|
111
|
-
* getZoomLevel().then(zoomLevel => console.log(zoomLevel)).catch(err => console.log(err));
|
|
112
|
-
* ```
|
|
113
|
-
*
|
|
114
|
-
* Window:
|
|
115
|
-
* ```js
|
|
116
|
-
* async function createWin() {
|
|
117
|
-
* const app = await fin.Application.start({
|
|
118
|
-
* name: 'myApp',
|
|
119
|
-
* uuid: 'app-1',
|
|
120
|
-
* url: 'https://cdn.openfin.co/docs/javascript/stable/tutorial-Window.getZoomLevel.html',
|
|
121
|
-
* autoShow: true
|
|
122
|
-
* });
|
|
123
|
-
* return await app.getWindow();
|
|
124
|
-
* }
|
|
125
|
-
*
|
|
126
|
-
* async function getZoomLevel() {
|
|
127
|
-
* const win = await createWin();
|
|
128
|
-
* return await win.getZoomLevel();
|
|
129
|
-
* }
|
|
130
|
-
*
|
|
131
|
-
* getZoomLevel().then(zoomLevel => console.log(zoomLevel)).catch(err => console.log(err));
|
|
132
|
-
* ```
|
|
133
|
-
*/
|
|
134
|
-
getZoomLevel(): Promise<number>;
|
|
135
|
-
/**
|
|
136
|
-
* Sets the zoom level of the WebContents.
|
|
137
|
-
* @param level The zoom level
|
|
138
|
-
* @function setZoomLevel
|
|
139
|
-
* @memberOf View
|
|
140
|
-
* @instance
|
|
141
|
-
*
|
|
142
|
-
* @example
|
|
143
|
-
* View:
|
|
144
|
-
* ```js
|
|
145
|
-
* async function setZoomLevel(number) {
|
|
146
|
-
* const view = await fin.View.getCurrent();
|
|
147
|
-
* return await view.setZoomLevel(number);
|
|
148
|
-
* }
|
|
149
|
-
*
|
|
150
|
-
* setZoomLevel(4).then(() => console.log('Setting a zoom level')).catch(err => console.log(err));
|
|
151
|
-
* ```
|
|
152
|
-
*
|
|
153
|
-
* Window:
|
|
154
|
-
* ```js
|
|
155
|
-
* async function createWin() {
|
|
156
|
-
* const app = await fin.Application.start({
|
|
157
|
-
* name: 'myApp',
|
|
158
|
-
* uuid: 'app-1',
|
|
159
|
-
* url: 'https://cdn.openfin.co/docs/javascript/stable/tutorial-Window.setZoomLevel.html',
|
|
160
|
-
* autoShow: true
|
|
161
|
-
* });
|
|
162
|
-
* return await app.getWindow();
|
|
163
|
-
* }
|
|
164
|
-
*
|
|
165
|
-
* async function setZoomLevel(number) {
|
|
166
|
-
* const win = await createWin();
|
|
167
|
-
* return await win.setZoomLevel(number);
|
|
168
|
-
* }
|
|
169
|
-
*
|
|
170
|
-
* setZoomLevel(4).then(() => console.log('Setting a zoom level')).catch(err => console.log(err));
|
|
171
|
-
* ```
|
|
172
|
-
*/
|
|
173
|
-
setZoomLevel(level: number): Promise<void>;
|
|
174
|
-
/**
|
|
175
|
-
* Navigates the WebContents to a specified URL.
|
|
176
|
-
*
|
|
177
|
-
* @remarks The url must contain the protocol prefix such as http:// or https://.
|
|
178
|
-
* @param url - The URL to navigate the WebContents to.
|
|
179
|
-
*
|
|
180
|
-
* @function navigate
|
|
181
|
-
* @memberof View
|
|
182
|
-
* @instance
|
|
183
|
-
* @example
|
|
184
|
-
* View:
|
|
185
|
-
* ```js
|
|
186
|
-
* async function createView() {
|
|
187
|
-
* const me = await fin.Window.getCurrent();
|
|
188
|
-
* return fin.View.create({
|
|
189
|
-
* name: 'viewName',
|
|
190
|
-
* target: me.identity,
|
|
191
|
-
* bounds: {top: 10, left: 10, width: 200, height: 200}
|
|
192
|
-
* });
|
|
193
|
-
* }
|
|
194
|
-
*
|
|
195
|
-
* createView()
|
|
196
|
-
* .then(view => view.navigate('https://example.com'))
|
|
197
|
-
* .then(() => console.log('navigation complete'))
|
|
198
|
-
* .catch(err => console.log(err));
|
|
199
|
-
* ```
|
|
200
|
-
*
|
|
201
|
-
* Window:
|
|
202
|
-
* ```js
|
|
203
|
-
* async function navigate() {
|
|
204
|
-
* const win = await fin.Window.getCurrent();
|
|
205
|
-
* return await win.navigate('https://cdn.openfin.co/docs/javascript/stable/tutorial-Window.navigate.html');
|
|
206
|
-
* }
|
|
207
|
-
* navigate().then(() => console.log('Navigate to tutorial')).catch(err => console.log(err));
|
|
208
|
-
* ```
|
|
209
|
-
* @experimental
|
|
210
|
-
*/
|
|
211
|
-
navigate(url: string): Promise<void>;
|
|
212
|
-
/**
|
|
213
|
-
* Navigates the WebContents back one page.
|
|
214
|
-
* @function navigateBack
|
|
215
|
-
* @memberOf View
|
|
216
|
-
* @instance
|
|
217
|
-
*
|
|
218
|
-
* @example
|
|
219
|
-
* View:
|
|
220
|
-
* ```js
|
|
221
|
-
* async function navigateBack() {
|
|
222
|
-
* const view = await fin.View.wrap({ name: 'testapp-view', uuid: 'testapp' });
|
|
223
|
-
* await view.navigate('https://www.google.com');
|
|
224
|
-
* return await view.navigateBack();
|
|
225
|
-
* }
|
|
226
|
-
* navigateBack().then(() => console.log('Navigated back')).catch(err => console.log(err));
|
|
227
|
-
* ```
|
|
228
|
-
*
|
|
229
|
-
* Window:
|
|
230
|
-
* ```js
|
|
231
|
-
* async function navigateBack() {
|
|
232
|
-
* const win = await fin.Window.wrap({ name: 'testapp', uuid: 'testapp' });
|
|
233
|
-
* await win.navigate('https://www.google.com');
|
|
234
|
-
* return await win.navigateBack();
|
|
235
|
-
* }
|
|
236
|
-
* navigateBack().then(() => console.log('Navigated back')).catch(err => console.log(err));
|
|
237
|
-
* ```
|
|
238
|
-
*/
|
|
239
|
-
navigateBack(): Promise<void>;
|
|
240
|
-
/**
|
|
241
|
-
* Navigates the WebContents forward one page.
|
|
242
|
-
* @function navigateForward
|
|
243
|
-
* @memberOf View
|
|
244
|
-
* @instance
|
|
245
|
-
*
|
|
246
|
-
* @example
|
|
247
|
-
* View:
|
|
248
|
-
* ```js
|
|
249
|
-
* async function navigateForward() {
|
|
250
|
-
* const view = await fin.View.getCurrent();
|
|
251
|
-
* await view.navigate('https://www.google.com');
|
|
252
|
-
* await view.navigateBack();
|
|
253
|
-
* return await view.navigateForward();
|
|
254
|
-
* }
|
|
255
|
-
* navigateForward().then(() => console.log('Navigated forward')).catch(err => console.log(err));
|
|
256
|
-
* ```
|
|
257
|
-
*
|
|
258
|
-
* Window:
|
|
259
|
-
* ```js
|
|
260
|
-
* async function navigateForward() {
|
|
261
|
-
* const win = await fin.Window.getCurrent();
|
|
262
|
-
* await win.navigate('https://www.google.com');
|
|
263
|
-
* await win.navigateBack();
|
|
264
|
-
* return await win.navigateForward();
|
|
265
|
-
* }
|
|
266
|
-
* navigateForward().then(() => console.log('Navigated forward')).catch(err => console.log(err));
|
|
267
|
-
* ```
|
|
268
|
-
*/
|
|
269
|
-
navigateForward(): Promise<void>;
|
|
270
|
-
/**
|
|
271
|
-
* Stops any current navigation the WebContents is performing.
|
|
272
|
-
* @function stopNavigation
|
|
273
|
-
* @memberOf View
|
|
274
|
-
* @instance
|
|
275
|
-
*
|
|
276
|
-
* @example
|
|
277
|
-
* View:
|
|
278
|
-
* ```js
|
|
279
|
-
* async function stopNavigation() {
|
|
280
|
-
* const view = await fin.View.wrap({ name: 'testapp-view', uuid: 'testapp' });
|
|
281
|
-
* await view.navigate('https://www.google.com');
|
|
282
|
-
* return await view.stopNavigation();
|
|
283
|
-
* }
|
|
284
|
-
* stopNavigation().then(() => console.log('you shall not navigate')).catch(err => console.log(err));
|
|
285
|
-
* ```
|
|
286
|
-
*
|
|
287
|
-
* Window:
|
|
288
|
-
* ```js
|
|
289
|
-
* async function stopNavigation() {
|
|
290
|
-
* const win = await fin.Window.wrap({ name: 'testapp', uuid: 'testapp' });
|
|
291
|
-
* await win.navigate('https://www.google.com');
|
|
292
|
-
* return await win.stopNavigation();
|
|
293
|
-
* }
|
|
294
|
-
* stopNavigation().then(() => console.log('you shall not navigate')).catch(err => console.log(err));
|
|
295
|
-
* ```
|
|
296
|
-
*/
|
|
297
|
-
stopNavigation(): Promise<void>;
|
|
298
|
-
/**
|
|
299
|
-
* Reloads the WebContents
|
|
300
|
-
* @function reload
|
|
301
|
-
* @memberOf View
|
|
302
|
-
* @instance
|
|
303
|
-
*
|
|
304
|
-
* @example
|
|
305
|
-
* View:
|
|
306
|
-
* ```js
|
|
307
|
-
* async function reload() {
|
|
308
|
-
* const view = await fin.View.getCurrent();
|
|
309
|
-
* return await view.reload();
|
|
310
|
-
* }
|
|
311
|
-
*
|
|
312
|
-
* reload().then(() => {
|
|
313
|
-
* console.log('Reloaded view')
|
|
314
|
-
* }).catch(err => console.log(err));
|
|
315
|
-
* ```
|
|
316
|
-
*
|
|
317
|
-
* Window:
|
|
318
|
-
* ```js
|
|
319
|
-
* async function reloadWindow() {
|
|
320
|
-
* const app = await fin.Application.start({
|
|
321
|
-
* name: 'myApp',
|
|
322
|
-
* uuid: 'app-1',
|
|
323
|
-
* url: 'https://cdn.openfin.co/docs/javascript/stable/tutorial-Window.reload.html',
|
|
324
|
-
* autoShow: true
|
|
325
|
-
* });
|
|
326
|
-
* const win = await app.getWindow();
|
|
327
|
-
* return await win.reload();
|
|
328
|
-
* }
|
|
329
|
-
*
|
|
330
|
-
* reloadWindow().then(() => {
|
|
331
|
-
* console.log('Reloaded window')
|
|
332
|
-
* }).catch(err => console.log(err));
|
|
333
|
-
* ```
|
|
334
|
-
*/
|
|
335
|
-
reload(ignoreCache?: boolean): Promise<void>;
|
|
336
|
-
/**
|
|
337
|
-
* Prints the WebContents.
|
|
338
|
-
* @param options Printer Options
|
|
339
|
-
* @function print
|
|
340
|
-
* @memberOf View
|
|
341
|
-
* @instance
|
|
342
|
-
*
|
|
343
|
-
* @remarks When `silent` is set to `true`, the API will pick the system's default printer if deviceName
|
|
344
|
-
* is empty and the default settings for printing.
|
|
345
|
-
*
|
|
346
|
-
* Use the CSS style `page-break-before: always;` to force print to a new page.
|
|
347
|
-
*
|
|
348
|
-
* @example
|
|
349
|
-
* ```js
|
|
350
|
-
* const view = fin.View.getCurrentSync();
|
|
351
|
-
*
|
|
352
|
-
* view.print({ silent: false, deviceName: 'system-printer-name' }).then(() => {
|
|
353
|
-
* console.log('print call has been sent to the system');
|
|
354
|
-
* });
|
|
355
|
-
* ```
|
|
356
|
-
*/
|
|
357
|
-
print(options?: OpenFin.PrintOptions): Promise<void>;
|
|
358
|
-
/**
|
|
359
|
-
* Find and highlight text on a page.
|
|
360
|
-
* @param searchTerm Term to find in page
|
|
361
|
-
* @param options Search options
|
|
362
|
-
* @function findInPage
|
|
363
|
-
* @memberOf View
|
|
364
|
-
* @instance
|
|
365
|
-
*
|
|
366
|
-
* @remarks By default, each subsequent call will highlight the next text that matches the search term.
|
|
367
|
-
*
|
|
368
|
-
* Returns a promise with the results for the request. By subscribing to the
|
|
369
|
-
* found-in-page event, you can get the results of this call as well.
|
|
370
|
-
*
|
|
371
|
-
* @example
|
|
372
|
-
* View:
|
|
373
|
-
* ```js
|
|
374
|
-
* const view = fin.View.getCurrentSync();
|
|
375
|
-
*
|
|
376
|
-
* //By subscribing to the 'found in page' event we can get the results of each findInPage call made.
|
|
377
|
-
* view.addListener('found-in-page', (event) => {
|
|
378
|
-
* console.log(event);
|
|
379
|
-
* });
|
|
380
|
-
*
|
|
381
|
-
* // The promise also returns the results for the request
|
|
382
|
-
* view.findInPage('a').then((result) => {
|
|
383
|
-
* console.log(result)
|
|
384
|
-
* });
|
|
385
|
-
* ```
|
|
386
|
-
*
|
|
387
|
-
* Window:
|
|
388
|
-
* ```js
|
|
389
|
-
* const win = fin.Window.getCurrentSync();
|
|
390
|
-
*
|
|
391
|
-
* //By subscribing to the 'found in page' event we can get the results of each findInPage call made.
|
|
392
|
-
* win.addListener('found-in-page', (event) => {
|
|
393
|
-
* console.log(event);
|
|
394
|
-
* });
|
|
395
|
-
*
|
|
396
|
-
* // The promise also returns the results for the request
|
|
397
|
-
* win.findInPage('a').then((result) => {
|
|
398
|
-
* console.log(result)
|
|
399
|
-
* });
|
|
400
|
-
* ```
|
|
401
|
-
*/
|
|
402
|
-
findInPage(searchTerm: string, options?: OpenFin.FindInPageOptions): Promise<void>;
|
|
403
|
-
/**
|
|
404
|
-
* Stop a {@link View#findInPage findInPage} call by specifying any of these actions:
|
|
405
|
-
*
|
|
406
|
-
* * clearSelection - Clear the selection.
|
|
407
|
-
* * keepSelection - Translate the selection into a normal selection.
|
|
408
|
-
* * activateSelection - Focus and click the selection node.
|
|
409
|
-
*
|
|
410
|
-
* @example
|
|
411
|
-
* View:
|
|
412
|
-
* ```js
|
|
413
|
-
* const view = fin.View.getCurrentSync();
|
|
414
|
-
*
|
|
415
|
-
* view.addListener('found-in-page', (event) => {
|
|
416
|
-
* setTimeout(() => {
|
|
417
|
-
* view.stopFindInPage('clearSelection');
|
|
418
|
-
* }, 5000);
|
|
419
|
-
* });
|
|
420
|
-
*
|
|
421
|
-
* view.findInPage('a').then(results => {
|
|
422
|
-
* console.log(results);
|
|
423
|
-
* });
|
|
424
|
-
* ```
|
|
425
|
-
*
|
|
426
|
-
* Window:
|
|
427
|
-
* ```js
|
|
428
|
-
* const win = fin.Window.getCurrentSync();
|
|
429
|
-
*
|
|
430
|
-
* win.addListener('found-in-page', (event) => {
|
|
431
|
-
* setTimeout(() => {
|
|
432
|
-
* win.stopFindInPage('clearSelection');
|
|
433
|
-
* }, 5000);
|
|
434
|
-
* });
|
|
435
|
-
*
|
|
436
|
-
* win.findInPage('a').then(results => {
|
|
437
|
-
* console.log(results);
|
|
438
|
-
* });
|
|
439
|
-
* ```
|
|
440
|
-
*/
|
|
441
|
-
stopFindInPage(action: string): Promise<void>;
|
|
442
|
-
/**
|
|
443
|
-
* Returns an array with all system printers
|
|
444
|
-
* @deprecated use System.getPrinters instead
|
|
445
|
-
* @function getPrinters
|
|
446
|
-
* @memberOf View
|
|
447
|
-
* @instance
|
|
448
|
-
*
|
|
449
|
-
* @example
|
|
450
|
-
* View:
|
|
451
|
-
* ```js
|
|
452
|
-
* const view = fin.View.getCurrentSync();
|
|
453
|
-
*
|
|
454
|
-
* view.getPrinters()
|
|
455
|
-
* .then((printers) => {
|
|
456
|
-
* printers.forEach((printer) => {
|
|
457
|
-
* if (printer.isDefault) {
|
|
458
|
-
* console.log(printer);
|
|
459
|
-
* }
|
|
460
|
-
* });
|
|
461
|
-
* })
|
|
462
|
-
* .catch((err) => {
|
|
463
|
-
* console.log(err);
|
|
464
|
-
* });
|
|
465
|
-
* ```
|
|
466
|
-
*
|
|
467
|
-
* Window:
|
|
468
|
-
* ```js
|
|
469
|
-
* const win = fin.Window.getCurrentSync();
|
|
470
|
-
*
|
|
471
|
-
* win.getPrinters()
|
|
472
|
-
* .then((printers) => {
|
|
473
|
-
* printers.forEach((printer) => {
|
|
474
|
-
* if (printer.isDefault) {
|
|
475
|
-
* console.log(printer);
|
|
476
|
-
* }
|
|
477
|
-
* });
|
|
478
|
-
* })
|
|
479
|
-
* .catch((err) => {
|
|
480
|
-
* console.log(err);
|
|
481
|
-
* });
|
|
482
|
-
* ```
|
|
483
|
-
*/
|
|
484
|
-
getPrinters(): Promise<OpenFin.PrinterInfo>;
|
|
485
|
-
/**
|
|
486
|
-
* Gives focus to the WebContents.
|
|
487
|
-
*
|
|
488
|
-
* @function focus
|
|
489
|
-
* @emits focused
|
|
490
|
-
* @memberOf Window
|
|
491
|
-
* @instance
|
|
492
|
-
* @example
|
|
493
|
-
* ```js
|
|
494
|
-
* async function focusWindow() {
|
|
495
|
-
* const app = await fin.Application.start({
|
|
496
|
-
* name: 'myApp',
|
|
497
|
-
* uuid: 'app-1',
|
|
498
|
-
* url: 'https://cdn.openfin.co/docs/javascript/stable/tutorial-Window.focus.html',
|
|
499
|
-
* autoShow: true
|
|
500
|
-
* });
|
|
501
|
-
* const win = await app.getWindow();
|
|
502
|
-
* return await win.focus();
|
|
503
|
-
* }
|
|
504
|
-
*
|
|
505
|
-
* focusWindow().then(() => console.log('Window focused')).catch(err => console.log(err));
|
|
506
|
-
* ```
|
|
507
|
-
*/
|
|
508
|
-
focus({ emitSynthFocused }?: {
|
|
509
|
-
emitSynthFocused: boolean;
|
|
510
|
-
}): Promise<void>;
|
|
511
|
-
/**
|
|
512
|
-
* Shows the Chromium Developer Tools
|
|
513
|
-
* @function showDeveloperTools
|
|
514
|
-
* @memberOf View
|
|
515
|
-
* @instance
|
|
516
|
-
*
|
|
517
|
-
* @example
|
|
518
|
-
* View:
|
|
519
|
-
* ```js
|
|
520
|
-
* async function showDeveloperTools() {
|
|
521
|
-
* const view = await fin.View.getCurrent();
|
|
522
|
-
* return view.showDeveloperTools();
|
|
523
|
-
* }
|
|
524
|
-
*
|
|
525
|
-
* showDevelopertools()
|
|
526
|
-
* .then(() => console.log('Showing dev tools'))
|
|
527
|
-
* .catch(err => console.error(err));
|
|
528
|
-
* ```
|
|
529
|
-
*
|
|
530
|
-
* Window:
|
|
531
|
-
* ```js
|
|
532
|
-
* async function showDeveloperTools() {
|
|
533
|
-
* const win = await fin.Window.getCurrent();
|
|
534
|
-
* return win.showDeveloperTools();
|
|
535
|
-
* }
|
|
536
|
-
*
|
|
537
|
-
* showDevelopertools()
|
|
538
|
-
* .then(() => console.log('Showing dev tools'))
|
|
539
|
-
* .catch(err => console.error(err));
|
|
540
|
-
* ```
|
|
541
|
-
*/
|
|
542
|
-
showDeveloperTools(): Promise<void>;
|
|
543
|
-
/**
|
|
544
|
-
* Retrieves the process information associated with a WebContents.
|
|
545
|
-
*
|
|
546
|
-
* @remarks This includes any iframes associated with the WebContents
|
|
547
|
-
*
|
|
548
|
-
* @function getProcessInfo
|
|
549
|
-
* @memberOf View
|
|
550
|
-
* @instance
|
|
551
|
-
*
|
|
552
|
-
* @example
|
|
553
|
-
* View:
|
|
554
|
-
* ```js
|
|
555
|
-
* const view = await fin.View.getCurrent();
|
|
556
|
-
* const processInfo = await view.getProcessInfo();
|
|
557
|
-
* ```
|
|
558
|
-
*
|
|
559
|
-
* Window:
|
|
560
|
-
* ```js
|
|
561
|
-
* const win = await fin.Window.getCurrent();
|
|
562
|
-
* const processInfo = await win.getProcessInfo();
|
|
563
|
-
* ```
|
|
564
|
-
*/
|
|
565
|
-
getProcessInfo(): Promise<OpenFin.EntityProcessDetails>;
|
|
566
|
-
/**
|
|
567
|
-
* Retrieves information on all Shared Workers.
|
|
568
|
-
* @function getSharedWorkers
|
|
569
|
-
* @memberOf View
|
|
570
|
-
* @instance
|
|
571
|
-
*
|
|
572
|
-
* @example
|
|
573
|
-
* View:
|
|
574
|
-
* ```js
|
|
575
|
-
* const view = await fin.View.create({
|
|
576
|
-
* name: 'viewName',
|
|
577
|
-
* target: fin.me.identity,
|
|
578
|
-
* bounds: {top: 10, left: 10, width: 200, height: 200}
|
|
579
|
-
* });
|
|
580
|
-
*
|
|
581
|
-
* await view.navigate('http://mdn.github.io/simple-shared-worker/index2.html');
|
|
582
|
-
*
|
|
583
|
-
* const sharedWorkers = await view.getSharedWorkers();
|
|
584
|
-
* ```
|
|
585
|
-
*
|
|
586
|
-
* Window:
|
|
587
|
-
* ```js
|
|
588
|
-
* const winOption = {
|
|
589
|
-
* name:'child',
|
|
590
|
-
* defaultWidth: 300,
|
|
591
|
-
* defaultHeight: 300,
|
|
592
|
-
* url: 'http://mdn.github.io/simple-shared-worker/index2.html',
|
|
593
|
-
* frame: true,
|
|
594
|
-
* autoShow: true
|
|
595
|
-
* };
|
|
596
|
-
* const win = await fin.Window.create(winOption);
|
|
597
|
-
* const sharedWorkers = await win.getSharedWorkers();
|
|
598
|
-
* ```
|
|
599
|
-
*/
|
|
600
|
-
getSharedWorkers(): Promise<OpenFin.SharedWorkerInfo[]>;
|
|
601
|
-
/**
|
|
602
|
-
* Opens the developer tools for the shared worker context.
|
|
603
|
-
* @function inspectSharedWorker
|
|
604
|
-
* @memberOf View
|
|
605
|
-
* @instance
|
|
606
|
-
*
|
|
607
|
-
* @example
|
|
608
|
-
* View:
|
|
609
|
-
* ```js
|
|
610
|
-
* const view = await fin.View.create({
|
|
611
|
-
* name: 'viewName',
|
|
612
|
-
* target: fin.me.identity,
|
|
613
|
-
* bounds: {top: 10, left: 10, width: 200, height: 200}
|
|
614
|
-
* });
|
|
615
|
-
*
|
|
616
|
-
* await view.navigate('http://mdn.github.io/simple-shared-worker/index2.html');
|
|
617
|
-
*
|
|
618
|
-
* await view.inspectSharedWorker();
|
|
619
|
-
* ```
|
|
620
|
-
*
|
|
621
|
-
* Example:
|
|
622
|
-
* ```js
|
|
623
|
-
* const winOption = {
|
|
624
|
-
* name:'child',
|
|
625
|
-
* defaultWidth: 300,
|
|
626
|
-
* defaultHeight: 300,
|
|
627
|
-
* url: 'http://mdn.github.io/simple-shared-worker/index2.html',
|
|
628
|
-
* frame: true,
|
|
629
|
-
* autoShow: true
|
|
630
|
-
* };
|
|
631
|
-
* const win = await fin.Window.create(winOption);
|
|
632
|
-
* await win.inspectSharedWorker();
|
|
633
|
-
* ```
|
|
634
|
-
*/
|
|
635
|
-
inspectSharedWorker(): Promise<void>;
|
|
636
|
-
/**
|
|
637
|
-
* Inspects the shared worker based on its ID.
|
|
638
|
-
* @param workerId - The id of the shared worker.
|
|
639
|
-
* @function inspectSharedWorkerById
|
|
640
|
-
* @memberOf View
|
|
641
|
-
* @instance
|
|
642
|
-
*
|
|
643
|
-
* @example
|
|
644
|
-
* View:
|
|
645
|
-
* ```js
|
|
646
|
-
* const view = await fin.View.create({
|
|
647
|
-
* name: 'viewName',
|
|
648
|
-
* target: fin.me.identity,
|
|
649
|
-
* bounds: {top: 10, left: 10, width: 200, height: 200}
|
|
650
|
-
* });
|
|
651
|
-
*
|
|
652
|
-
* await view.navigate('http://mdn.github.io/simple-shared-worker/index2.html');
|
|
653
|
-
*
|
|
654
|
-
* const sharedWorkers = await view.getSharedWorkers();
|
|
655
|
-
* await view.inspectSharedWorkerById(sharedWorkers[0].id);
|
|
656
|
-
* ```
|
|
657
|
-
*
|
|
658
|
-
* Window:
|
|
659
|
-
* ```js
|
|
660
|
-
* const winOption = {
|
|
661
|
-
* name:'child',
|
|
662
|
-
* defaultWidth: 300,
|
|
663
|
-
* defaultHeight: 300,
|
|
664
|
-
* url: 'http://mdn.github.io/simple-shared-worker/index2.html',
|
|
665
|
-
* frame: true,
|
|
666
|
-
* autoShow: true
|
|
667
|
-
* };
|
|
668
|
-
* const win = await fin.Window.create(winOption);
|
|
669
|
-
* const sharedWorkers = await win.getSharedWorkers();
|
|
670
|
-
* await win.inspectSharedWorkerById(sharedWorkers[0].id);
|
|
671
|
-
* ```
|
|
672
|
-
*/
|
|
673
|
-
inspectSharedWorkerById(workerId: string): Promise<void>;
|
|
674
|
-
/**
|
|
675
|
-
* Opens the developer tools for the service worker context.
|
|
676
|
-
* @function inspectServiceWorker
|
|
677
|
-
* @memberOf View
|
|
678
|
-
* @instance
|
|
679
|
-
*
|
|
680
|
-
* @example
|
|
681
|
-
* View:
|
|
682
|
-
* ```js
|
|
683
|
-
* const view = await fin.View.create({
|
|
684
|
-
* name: 'viewName',
|
|
685
|
-
* target: fin.me.identity,
|
|
686
|
-
* bounds: {top: 10, left: 10, width: 200, height: 200}
|
|
687
|
-
* });
|
|
688
|
-
*
|
|
689
|
-
* await view.navigate('http://googlechrome.github.io/samples/service-worker/basic/index.html');
|
|
690
|
-
*
|
|
691
|
-
* await view.inspectServiceWorker();
|
|
692
|
-
* ```
|
|
693
|
-
*
|
|
694
|
-
* Window:
|
|
695
|
-
* ```js
|
|
696
|
-
* const winOption = {
|
|
697
|
-
* name:'child',
|
|
698
|
-
* defaultWidth: 300,
|
|
699
|
-
* defaultHeight: 300,
|
|
700
|
-
* url: 'http://googlechrome.github.io/samples/service-worker/basic/index.html',
|
|
701
|
-
* frame: true,
|
|
702
|
-
* autoShow: true
|
|
703
|
-
* };
|
|
704
|
-
* const win = await fin.Window.create(winOption);
|
|
705
|
-
* await win.inspectServiceWorker();
|
|
706
|
-
* ```
|
|
707
|
-
*/
|
|
708
|
-
inspectServiceWorker(): Promise<void>;
|
|
709
|
-
/**
|
|
710
|
-
* Shows a popup window.
|
|
711
|
-
*
|
|
712
|
-
* @remarks If this WebContents is a view and its attached window has a popup open, this will close it.
|
|
713
|
-
*
|
|
714
|
-
* Shows a popup window. Including a `name` in `options` will attempt to show an existing window as a popup, if
|
|
715
|
-
* that window doesn't exist or no `name` is included a window will be created. If the caller view or the caller
|
|
716
|
-
* view's parent window currently has a popup window open, calling `showPopupWindow` again will dismiss the currently
|
|
717
|
-
* open popup window before showing the new popup window. Also, if the caller view is destroyed or detached, the popup
|
|
718
|
-
* will be dismissed.
|
|
719
|
-
*
|
|
720
|
-
* NOTE: in the case where the window being shown as a popup needs to be created, it is a child of the caller view's parent window.
|
|
721
|
-
*
|
|
722
|
-
* @example
|
|
723
|
-
*
|
|
724
|
-
* Create and show a single-use popup window that returns a single result to the caller. `initialOptions` allows
|
|
725
|
-
* us to pass window options to the popup window that will be created. `resultDispatchBehavior: 'close'` ensures
|
|
726
|
-
* that once the popup window calls `dispatchPopupResult` it is closed. `blurBehavior: 'close'` will yield a dismissed
|
|
727
|
-
* result should the popup window lose focus.
|
|
728
|
-
*
|
|
729
|
-
* ```js
|
|
730
|
-
* const result = await fin.me.showPopupWindow({
|
|
731
|
-
* initialOptions: {
|
|
732
|
-
* frame: false
|
|
733
|
-
* },
|
|
734
|
-
* url: '<my_popup_url>',
|
|
735
|
-
* resultDispatchBehavior: 'close',
|
|
736
|
-
* blurBehavior: 'close',
|
|
737
|
-
* focus: true,
|
|
738
|
-
* height: 300,
|
|
739
|
-
* width: 300,
|
|
740
|
-
* x: 0,
|
|
741
|
-
* y: 0
|
|
742
|
-
* });
|
|
743
|
-
* ```
|
|
744
|
-
*
|
|
745
|
-
* Same as above but using an existing window as a popup by referencing its `name`:
|
|
746
|
-
*
|
|
747
|
-
* Note: if a window with the `name` provided doesn't exist, it will be created.
|
|
748
|
-
*
|
|
749
|
-
* ```js
|
|
750
|
-
* const result = await fin.me.showPopupWindow({
|
|
751
|
-
* initialOptions: {
|
|
752
|
-
* frame: true
|
|
753
|
-
* },
|
|
754
|
-
* name: 'my-popup', // shows the 'my-popup' window if it exists, otherwise creates it
|
|
755
|
-
* url: '<my_popup_url>', // navigates to this url if it doesn't match the location.href of the 'my-popup' window
|
|
756
|
-
* resultDispatchBehavior: 'close',
|
|
757
|
-
* blurBehavior: 'close',
|
|
758
|
-
* focus: true,
|
|
759
|
-
* hideOnClose: true, // persist window on 'dismissed' result, alternatively change onResultDispatch and blurBehavior to 'hide'
|
|
760
|
-
* height: 300,
|
|
761
|
-
* width: 300,
|
|
762
|
-
* x: 0,
|
|
763
|
-
* y: 0
|
|
764
|
-
* });
|
|
765
|
-
* ```
|
|
766
|
-
*
|
|
767
|
-
* Create and show a popup window that is able to return multiple results to the caller via an `onPopupResult` callback. Each
|
|
768
|
-
* time the popup window calls `dispatchPopupResult`, the callback will be executed on the result. Once the popup window is
|
|
769
|
-
* closed or hidden, the `showPopupWindow` promise will resolve with a `dismissed` result that will include the most recently
|
|
770
|
-
* dispatched result as `lastDispatchResult`:
|
|
771
|
-
*
|
|
772
|
-
* ```js
|
|
773
|
-
* const popupResultCallback = (payload) => {
|
|
774
|
-
* if (payload.result === 'clicked') {
|
|
775
|
-
* if (payload.data.topic === 'color-changed') {
|
|
776
|
-
* // do something like
|
|
777
|
-
* // setColor(payload.data.value);
|
|
778
|
-
* }
|
|
779
|
-
* }
|
|
780
|
-
* };
|
|
781
|
-
*
|
|
782
|
-
* await fin.me.showPopupWindow({
|
|
783
|
-
* initialOptions: {
|
|
784
|
-
* frame: false
|
|
785
|
-
* },
|
|
786
|
-
* url: '<my_popup_url>',
|
|
787
|
-
* resultDispatchBehavior: 'none',
|
|
788
|
-
* blurBehavior: 'close',
|
|
789
|
-
* focus: true,
|
|
790
|
-
* height: 300,
|
|
791
|
-
* width: 300,
|
|
792
|
-
* x: 0,
|
|
793
|
-
* y: 0,
|
|
794
|
-
* onPopupResult: popupResultCallback
|
|
795
|
-
* });
|
|
796
|
-
* ```
|
|
797
|
-
*
|
|
798
|
-
* Same as above but using an existing window as a popup:
|
|
799
|
-
*
|
|
800
|
-
* ```js
|
|
801
|
-
* const popupResultCallback = (payload) => {
|
|
802
|
-
* if (payload.result === 'clicked') {
|
|
803
|
-
* if (payload.data.topic === 'color-changed') {
|
|
804
|
-
* // do something like
|
|
805
|
-
* // setColor(payload.data.value);
|
|
806
|
-
* }
|
|
807
|
-
* }
|
|
808
|
-
* };
|
|
809
|
-
*
|
|
810
|
-
* await fin.me.showPopupWindow({
|
|
811
|
-
* initialOptions: {
|
|
812
|
-
* frame: false
|
|
813
|
-
* },
|
|
814
|
-
* name: 'my-popup', // shows the 'my-popup' window if it exists, otherwise creates it
|
|
815
|
-
* url: '<my_popup_url>', // navigates to this url if it doesn't match the location.href of the 'my-popup' window
|
|
816
|
-
* resultDispatchBehavior: 'none',
|
|
817
|
-
* blurBehavior: 'hide',
|
|
818
|
-
* focus: true,
|
|
819
|
-
* hideOnClose: true, // we can just use this or we can change blurBehavior to 'hide'
|
|
820
|
-
* height: 300,
|
|
821
|
-
* width: 300,
|
|
822
|
-
* x: 0,
|
|
823
|
-
* y: 0,
|
|
824
|
-
* onPopupResult: popupResultCallback
|
|
825
|
-
* });
|
|
826
|
-
* ```
|
|
827
|
-
*
|
|
828
|
-
* Create or show a popup window that disables user movement (positioning and resizing) in the caller
|
|
829
|
-
* view's parent window by using `blurBehavior: 'modal'`:
|
|
830
|
-
*
|
|
831
|
-
* ```js
|
|
832
|
-
* const result = await fin.me.showPopupWindow({
|
|
833
|
-
* initialOptions: {
|
|
834
|
-
* frame: false
|
|
835
|
-
* },
|
|
836
|
-
* url: '<my_popup_url>',
|
|
837
|
-
* resultDispatchBehavior: 'close',
|
|
838
|
-
* blurBehavior: 'modal',
|
|
839
|
-
* focus: true,
|
|
840
|
-
* height: 300,
|
|
841
|
-
* width: 300,
|
|
842
|
-
* x: 0,
|
|
843
|
-
* y: 0
|
|
844
|
-
* });
|
|
845
|
-
* ```
|
|
846
|
-
*
|
|
847
|
-
* Create a popup window as a modal:
|
|
848
|
-
*
|
|
849
|
-
* Note: The only way to ensure true modal behavior is to create the window being shown as a popup with a
|
|
850
|
-
* `modalParentIdentity` that uses the caller view's parent window identity.
|
|
851
|
-
*
|
|
852
|
-
* ```js
|
|
853
|
-
* const result = await fin.me.showPopupWindow({
|
|
854
|
-
* initialOptions: {
|
|
855
|
-
* frame: false,
|
|
856
|
-
* modalParentIdentity: fin.me.identity
|
|
857
|
-
* },
|
|
858
|
-
* url: '<my_popup_url>',
|
|
859
|
-
* resultDispatchBehavior: 'close',
|
|
860
|
-
* blurBehavior: 'modal',
|
|
861
|
-
* focus: true,
|
|
862
|
-
* height: 300,
|
|
863
|
-
* width: 300,
|
|
864
|
-
* x: 0,
|
|
865
|
-
* y: 0
|
|
866
|
-
* });
|
|
867
|
-
* ```
|
|
868
|
-
*
|
|
869
|
-
* Pass data to a popup window that is available when the popup is shown.
|
|
870
|
-
*
|
|
871
|
-
* Note: this is just one example for a use of `additionalOptions`, it can be used to update any updatable
|
|
872
|
-
* window options when creating or showing an existing window as a popup.
|
|
873
|
-
*
|
|
874
|
-
* ```js
|
|
875
|
-
* const result = await fin.me.showPopupWindow({
|
|
876
|
-
* additionalOptions: {
|
|
877
|
-
* customData: {
|
|
878
|
-
* foo: 'bar'
|
|
879
|
-
* }
|
|
880
|
-
* },
|
|
881
|
-
* url: '<my_popup_url>',
|
|
882
|
-
* resultDispatchBehavior: 'close',
|
|
883
|
-
* blurBehavior: 'close',
|
|
884
|
-
* focus: true,
|
|
885
|
-
* height: 300,
|
|
886
|
-
* width: 300,
|
|
887
|
-
* x: 0,
|
|
888
|
-
* y: 0
|
|
889
|
-
* });
|
|
890
|
-
*
|
|
891
|
-
* // Access from the popup window context like so:
|
|
892
|
-
* const { customData } = await fin.me.getOptions();
|
|
893
|
-
* const { foo } = customData;
|
|
894
|
-
* ```
|
|
895
|
-
*
|
|
896
|
-
* Execute a callback on the popup's OpenFin window when the popup is shown:
|
|
897
|
-
*
|
|
898
|
-
* ```js
|
|
899
|
-
* const popupWindowCallback = async (win) => {
|
|
900
|
-
* await win.flash();
|
|
901
|
-
* };
|
|
902
|
-
*
|
|
903
|
-
* const result = await fin.me.showPopupWindow({
|
|
904
|
-
* url: '<my_popup_url>',
|
|
905
|
-
* resultDispatchBehavior: 'close',
|
|
906
|
-
* blurBehavior: 'close',
|
|
907
|
-
* focus: true,
|
|
908
|
-
* height: 300,
|
|
909
|
-
* width: 300,
|
|
910
|
-
* x: 0,
|
|
911
|
-
* y: 0,
|
|
912
|
-
* onPopupReady: popupWindowCallback;
|
|
913
|
-
* });
|
|
914
|
-
* ```
|
|
915
|
-
* @function showPopupWindow
|
|
916
|
-
* @memberOf View
|
|
917
|
-
* @instance
|
|
918
|
-
* @param options
|
|
919
|
-
*
|
|
920
|
-
*/
|
|
921
|
-
showPopupWindow(options: OpenFin.PopupOptions): Promise<OpenFin.PopupResult>;
|
|
922
|
-
}
|