@openfin/core 33.76.36 → 33.77.1
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 +17111 -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,88 +0,0 @@
|
|
|
1
|
-
import type * as OpenFin from '../../OpenFin';
|
|
2
|
-
import { Base } from '../base';
|
|
3
|
-
export default class ViewModule extends Base {
|
|
4
|
-
/**
|
|
5
|
-
* Creates a new View.
|
|
6
|
-
* @param options - View creation options
|
|
7
|
-
*
|
|
8
|
-
* @example
|
|
9
|
-
* ```js
|
|
10
|
-
* let view;
|
|
11
|
-
* async function createView() {
|
|
12
|
-
* const me = await fin.Window.getCurrent();
|
|
13
|
-
* return fin.View.create({
|
|
14
|
-
* name: 'viewNameCreate',
|
|
15
|
-
* target: me.identity,
|
|
16
|
-
* bounds: {top: 10, left: 10, width: 200, height: 200}
|
|
17
|
-
* });
|
|
18
|
-
* }
|
|
19
|
-
*
|
|
20
|
-
* createView()
|
|
21
|
-
* .then((createdView) => {
|
|
22
|
-
* view = createdView;
|
|
23
|
-
* console.log('View created.', view);
|
|
24
|
-
* view.navigate('https://google.com');
|
|
25
|
-
* console.log('View navigated to given url.');
|
|
26
|
-
* })
|
|
27
|
-
* .catch(err => console.log(err));
|
|
28
|
-
* ```
|
|
29
|
-
* Note that created views needs to navigate somewhere for them to actually render a website.
|
|
30
|
-
* @experimental
|
|
31
|
-
* @static
|
|
32
|
-
*/
|
|
33
|
-
create(options: OpenFin.ViewCreationOptions): Promise<OpenFin.View>;
|
|
34
|
-
/**
|
|
35
|
-
* Asynchronously returns a View object that represents an existing view.
|
|
36
|
-
* @param identity
|
|
37
|
-
*
|
|
38
|
-
* @example
|
|
39
|
-
* ```js
|
|
40
|
-
* fin.View.wrap({ uuid: 'testViewUuid', name: 'testViewName' }))
|
|
41
|
-
* .then(view => console.log('wrapped view', view))
|
|
42
|
-
* .catch(err => console.log(err));
|
|
43
|
-
* ```
|
|
44
|
-
* @experimental
|
|
45
|
-
* @static
|
|
46
|
-
*/
|
|
47
|
-
wrap(identity: OpenFin.Identity): Promise<OpenFin.View>;
|
|
48
|
-
/**
|
|
49
|
-
* Synchronously returns a View object that represents an existing view.
|
|
50
|
-
* @param identity
|
|
51
|
-
*
|
|
52
|
-
* @example
|
|
53
|
-
* ```js
|
|
54
|
-
* const view = fin.View.wrapSync({ uuid: 'testView', name: 'testViewName' });
|
|
55
|
-
* await view.hide();
|
|
56
|
-
* ```
|
|
57
|
-
* @experimental
|
|
58
|
-
* @static
|
|
59
|
-
*/
|
|
60
|
-
wrapSync(identity: OpenFin.Identity): OpenFin.View;
|
|
61
|
-
/**
|
|
62
|
-
* Asynchronously returns a View object that represents the current view
|
|
63
|
-
*
|
|
64
|
-
* @example
|
|
65
|
-
* ```js
|
|
66
|
-
* fin.View.getCurrent()
|
|
67
|
-
* .then(view => console.log('current view', view))
|
|
68
|
-
* .catch(err => console.log(err));
|
|
69
|
-
*
|
|
70
|
-
* ```
|
|
71
|
-
* @experimental
|
|
72
|
-
* @static
|
|
73
|
-
*/
|
|
74
|
-
getCurrent(): Promise<OpenFin.View>;
|
|
75
|
-
/**
|
|
76
|
-
* Synchronously returns a View object that represents the current view
|
|
77
|
-
*
|
|
78
|
-
* @example
|
|
79
|
-
* ```js
|
|
80
|
-
* const view = fin.View.getCurrentSync();
|
|
81
|
-
* console.log(view);
|
|
82
|
-
*
|
|
83
|
-
* ```
|
|
84
|
-
* @experimental
|
|
85
|
-
* @static
|
|
86
|
-
*/
|
|
87
|
-
getCurrentSync(): OpenFin.View;
|
|
88
|
-
}
|
package/src/api/view/Factory.js
DELETED
|
@@ -1,141 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const base_1 = require("../base");
|
|
4
|
-
const validate_1 = require("../../util/validate");
|
|
5
|
-
const index_1 = require("./index");
|
|
6
|
-
class ViewModule extends base_1.Base {
|
|
7
|
-
/**
|
|
8
|
-
* Creates a new View.
|
|
9
|
-
* @param options - View creation options
|
|
10
|
-
*
|
|
11
|
-
* @example
|
|
12
|
-
* ```js
|
|
13
|
-
* let view;
|
|
14
|
-
* async function createView() {
|
|
15
|
-
* const me = await fin.Window.getCurrent();
|
|
16
|
-
* return fin.View.create({
|
|
17
|
-
* name: 'viewNameCreate',
|
|
18
|
-
* target: me.identity,
|
|
19
|
-
* bounds: {top: 10, left: 10, width: 200, height: 200}
|
|
20
|
-
* });
|
|
21
|
-
* }
|
|
22
|
-
*
|
|
23
|
-
* createView()
|
|
24
|
-
* .then((createdView) => {
|
|
25
|
-
* view = createdView;
|
|
26
|
-
* console.log('View created.', view);
|
|
27
|
-
* view.navigate('https://google.com');
|
|
28
|
-
* console.log('View navigated to given url.');
|
|
29
|
-
* })
|
|
30
|
-
* .catch(err => console.log(err));
|
|
31
|
-
* ```
|
|
32
|
-
* Note that created views needs to navigate somewhere for them to actually render a website.
|
|
33
|
-
* @experimental
|
|
34
|
-
* @static
|
|
35
|
-
*/
|
|
36
|
-
async create(options) {
|
|
37
|
-
const { uuid } = this.wire.me;
|
|
38
|
-
if (!options.name || typeof options.name !== 'string') {
|
|
39
|
-
throw new Error('Please provide a name property as a string in order to create a View.');
|
|
40
|
-
}
|
|
41
|
-
if (this.wire.environment.childViews) {
|
|
42
|
-
await this.wire.environment.createChildContent({
|
|
43
|
-
entityType: 'view',
|
|
44
|
-
options: { ...options, uuid }
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
|
-
else {
|
|
48
|
-
await this.wire.sendAction('create-view', { ...options, uuid });
|
|
49
|
-
}
|
|
50
|
-
return this.wrapSync({ uuid, name: options.name });
|
|
51
|
-
}
|
|
52
|
-
/**
|
|
53
|
-
* Asynchronously returns a View object that represents an existing view.
|
|
54
|
-
* @param identity
|
|
55
|
-
*
|
|
56
|
-
* @example
|
|
57
|
-
* ```js
|
|
58
|
-
* fin.View.wrap({ uuid: 'testViewUuid', name: 'testViewName' }))
|
|
59
|
-
* .then(view => console.log('wrapped view', view))
|
|
60
|
-
* .catch(err => console.log(err));
|
|
61
|
-
* ```
|
|
62
|
-
* @experimental
|
|
63
|
-
* @static
|
|
64
|
-
*/
|
|
65
|
-
async wrap(identity) {
|
|
66
|
-
this.wire.sendAction('view-wrap');
|
|
67
|
-
const errorMsg = (0, validate_1.validateIdentity)(identity);
|
|
68
|
-
if (errorMsg) {
|
|
69
|
-
throw new Error(errorMsg);
|
|
70
|
-
}
|
|
71
|
-
return new index_1.View(this.wire, identity);
|
|
72
|
-
}
|
|
73
|
-
/**
|
|
74
|
-
* Synchronously returns a View object that represents an existing view.
|
|
75
|
-
* @param identity
|
|
76
|
-
*
|
|
77
|
-
* @example
|
|
78
|
-
* ```js
|
|
79
|
-
* const view = fin.View.wrapSync({ uuid: 'testView', name: 'testViewName' });
|
|
80
|
-
* await view.hide();
|
|
81
|
-
* ```
|
|
82
|
-
* @experimental
|
|
83
|
-
* @static
|
|
84
|
-
*/
|
|
85
|
-
wrapSync(identity) {
|
|
86
|
-
this.wire.sendAction('view-wrap-sync').catch((e) => {
|
|
87
|
-
// we do not want to expose this error, just continue if this analytics-only call fails
|
|
88
|
-
});
|
|
89
|
-
const errorMsg = (0, validate_1.validateIdentity)(identity);
|
|
90
|
-
if (errorMsg) {
|
|
91
|
-
throw new Error(errorMsg);
|
|
92
|
-
}
|
|
93
|
-
return new index_1.View(this.wire, identity);
|
|
94
|
-
}
|
|
95
|
-
/**
|
|
96
|
-
* Asynchronously returns a View object that represents the current view
|
|
97
|
-
*
|
|
98
|
-
* @example
|
|
99
|
-
* ```js
|
|
100
|
-
* fin.View.getCurrent()
|
|
101
|
-
* .then(view => console.log('current view', view))
|
|
102
|
-
* .catch(err => console.log(err));
|
|
103
|
-
*
|
|
104
|
-
* ```
|
|
105
|
-
* @experimental
|
|
106
|
-
* @static
|
|
107
|
-
*/
|
|
108
|
-
getCurrent() {
|
|
109
|
-
this.wire.sendAction('view-get-current').catch((e) => {
|
|
110
|
-
// we do not want to expose this error, just continue if this analytics-only call fails
|
|
111
|
-
});
|
|
112
|
-
if (!this.wire.me.isView) {
|
|
113
|
-
throw new Error('You are not in a View context');
|
|
114
|
-
}
|
|
115
|
-
const { uuid, name } = this.wire.me;
|
|
116
|
-
return this.wrap({ uuid, name });
|
|
117
|
-
}
|
|
118
|
-
/**
|
|
119
|
-
* Synchronously returns a View object that represents the current view
|
|
120
|
-
*
|
|
121
|
-
* @example
|
|
122
|
-
* ```js
|
|
123
|
-
* const view = fin.View.getCurrentSync();
|
|
124
|
-
* console.log(view);
|
|
125
|
-
*
|
|
126
|
-
* ```
|
|
127
|
-
* @experimental
|
|
128
|
-
* @static
|
|
129
|
-
*/
|
|
130
|
-
getCurrentSync() {
|
|
131
|
-
this.wire.sendAction('view-get-current-sync').catch((e) => {
|
|
132
|
-
// we do not want to expose this error, just continue if this analytics-only call fails
|
|
133
|
-
});
|
|
134
|
-
if (!this.wire.me.isView) {
|
|
135
|
-
throw new Error('You are not in a View context');
|
|
136
|
-
}
|
|
137
|
-
const { uuid, name } = this.wire.me;
|
|
138
|
-
return this.wrapSync({ uuid, name });
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
exports.default = ViewModule;
|