@openfin/core 30.73.6 → 30.73.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/OpenFin.d.ts +1 -1729
- package/fin.d.ts +3 -4
- package/package.json +1 -1
- package/src/GlobalOpenFin.d.ts +4 -0
- package/src/OpenFin.d.ts +2938 -0
- package/src/OpenFin.js +4 -0
- package/src/api/application/Factory.d.ts +2 -0
- package/src/api/application/Factory.js +4 -3
- package/src/api/application/Instance.d.ts +3 -1
- package/src/api/application/Instance.js +1 -0
- package/src/api/application/index.js +7 -3
- package/src/api/base.d.ts +19 -15
- package/src/api/base.js +20 -22
- package/src/api/clipboard/index.d.ts +2 -0
- package/src/api/clipboard/index.js +1 -0
- package/src/api/events/application.d.ts +66 -56
- package/src/api/events/base.d.ts +33 -15
- package/src/api/events/channel.d.ts +13 -8
- package/src/api/events/eventAggregator.js +1 -9
- package/src/api/events/externalApplication.d.ts +10 -5
- package/src/api/events/frame.d.ts +13 -7
- package/src/api/events/globalHotkey.d.ts +11 -10
- package/src/api/events/platform.d.ts +10 -16
- package/src/api/events/system.d.ts +48 -18
- package/src/api/events/typedEventEmitter.d.ts +20 -0
- package/src/api/events/typedEventEmitter.js +2 -0
- package/src/api/events/view.d.ts +38 -54
- package/src/api/events/webcontents.d.ts +55 -28
- package/src/api/events/window.d.ts +148 -134
- package/src/api/external-application/Factory.d.ts +1 -0
- package/src/api/external-application/Instance.d.ts +2 -1
- package/src/api/external-application/index.js +7 -3
- package/src/api/fin.d.ts +3 -1
- package/src/api/fin.js +2 -2
- package/src/api/frame/Factory.d.ts +1 -0
- package/src/api/frame/Factory.js +2 -2
- package/src/api/frame/Instance.d.ts +3 -1
- package/src/api/frame/index.js +7 -3
- package/src/api/global-hotkey/index.d.ts +2 -2
- package/src/api/global-hotkey/index.js +6 -0
- package/src/api/interappbus/channel/channel.d.ts +6 -4
- package/src/api/interappbus/channel/channels-docs.d.ts +22 -0
- package/src/api/interappbus/channel/channels-docs.js +22 -0
- package/src/api/interappbus/channel/client.d.ts +2 -1
- package/src/api/interappbus/channel/client.js +24 -26
- package/src/api/interappbus/channel/connection-manager.d.ts +1 -0
- package/src/api/interappbus/channel/connection-manager.js +30 -28
- package/src/api/interappbus/channel/index.d.ts +6 -4
- package/src/api/interappbus/channel/index.js +34 -19
- package/src/api/interappbus/channel/protocols/classic/strategy.d.ts +3 -1
- package/src/api/interappbus/channel/protocols/classic/strategy.js +21 -22
- package/src/api/interappbus/channel/protocols/index.d.ts +3 -0
- package/src/api/interappbus/channel/protocols/protocol-manager.d.ts +1 -1
- package/src/api/interappbus/channel/protocols/rtc/endpoint.d.ts +3 -1
- package/src/api/interappbus/channel/protocols/rtc/endpoint.js +25 -27
- package/src/api/interappbus/channel/protocols/rtc/ice-manager.js +0 -1
- package/src/api/interappbus/channel/protocols/rtc/strategy.d.ts +3 -1
- package/src/api/interappbus/channel/protocols/rtc/strategy.js +29 -31
- package/src/api/interappbus/channel/protocols/strategy.d.ts +3 -1
- package/src/api/interappbus/channel/provider.d.ts +8 -4
- package/src/api/interappbus/channel/provider.js +140 -139
- package/src/api/interappbus/index.js +1 -1
- package/src/api/interop/Factory.d.ts +2 -0
- package/src/api/interop/Factory.js +20 -2
- package/src/api/interop/InteropBroker.d.ts +62 -39
- package/src/api/interop/InteropBroker.js +114 -55
- package/src/api/interop/InteropClient.d.ts +9 -0
- package/src/api/interop/InteropClient.js +46 -40
- package/src/api/interop/SessionContextGroupBroker.d.ts +1 -0
- package/src/api/interop/SessionContextGroupClient.d.ts +1 -0
- package/src/api/interop/SessionContextGroupClient.js +22 -24
- package/src/api/interop/fdc3/PrivateChannelClient.d.ts +9 -7
- package/src/api/interop/fdc3/PrivateChannelClient.js +6 -6
- package/src/api/interop/fdc3/PrivateChannelProvider.d.ts +1 -0
- package/src/api/interop/fdc3/fdc3-1.2.d.ts +14 -13
- package/src/api/interop/fdc3/fdc3-1.2.js +3 -14
- package/src/api/interop/fdc3/fdc3-2.0.d.ts +24 -21
- package/src/api/interop/fdc3/fdc3-2.0.js +27 -27
- package/src/api/interop/fdc3/fdc3.d.ts +12 -0
- package/src/api/interop/fdc3/overrideCheck.d.ts +4 -0
- package/src/api/interop/fdc3/overrideCheck.js +32 -0
- package/src/api/interop/fdc3/shapes/fdc3v1.d.ts +53 -0
- package/src/api/interop/fdc3/shapes/fdc3v1.js +4 -0
- package/src/api/interop/fdc3/shapes/fdc3v2.d.ts +75 -0
- package/src/api/interop/fdc3/shapes/fdc3v2.js +2 -0
- package/src/api/interop/fdc3/utils.d.ts +15 -5
- package/src/api/interop/fdc3/utils.js +29 -11
- package/src/api/interop/fdc3/versions.d.ts +1 -0
- package/src/api/interop/fdc3/versions.js +2 -0
- package/src/api/interop/index.js +7 -3
- package/src/api/interop/utils.d.ts +2 -0
- package/src/api/interop/utils.js +29 -15
- package/src/api/me.d.ts +3 -1
- package/src/api/platform/Factory.d.ts +6 -0
- package/src/api/platform/Factory.js +14 -5
- package/src/api/platform/Instance.d.ts +18 -3
- package/src/api/platform/Instance.js +30 -13
- package/src/api/platform/common-utils.d.ts +2 -1
- package/src/api/platform/index.js +7 -3
- package/src/api/platform/layout/Factory.d.ts +7 -1
- package/src/api/platform/layout/Factory.js +22 -20
- package/src/api/platform/layout/Instance.d.ts +6 -4
- package/src/api/platform/layout/Instance.js +2 -3
- package/src/api/platform/layout/controllers/splitter-controller.js +1 -1
- package/src/api/platform/layout/controllers/tab-drag-controller.d.ts +1 -0
- package/src/api/platform/layout/controllers/tab-drag-controller.js +1 -1
- package/src/api/platform/layout/index.js +7 -3
- package/src/api/platform/layout/shapes.d.ts +3 -1
- package/src/api/platform/layout/utils/bounds-observer.d.ts +1 -1
- package/src/api/platform/layout/utils/bounds-observer.js +7 -5
- package/src/api/platform/layout/utils/view-overlay.d.ts +1 -0
- package/src/api/platform/provider.d.ts +162 -0
- package/src/api/platform/provider.js +2 -0
- package/src/api/snapshot-source/Factory.d.ts +2 -0
- package/src/api/snapshot-source/Factory.js +2 -1
- package/src/api/snapshot-source/Instance.d.ts +1 -0
- package/src/api/snapshot-source/Instance.js +33 -35
- package/src/api/snapshot-source/index.js +7 -3
- package/src/api/snapshot-source/utils.d.ts +1 -0
- package/src/api/snapshot-source/utils.js +2 -1
- package/src/api/system/index.d.ts +76 -16
- package/src/api/system/index.js +127 -3
- package/src/api/view/Factory.d.ts +1 -0
- package/src/api/view/Factory.js +2 -2
- package/src/api/view/Instance.d.ts +17 -3
- package/src/api/view/Instance.js +20 -0
- package/src/api/view/index.js +7 -3
- package/src/api/webcontents/main.d.ts +20 -5
- package/src/api/webcontents/main.js +10 -0
- package/src/api/window/Factory.d.ts +1 -0
- package/src/api/window/Factory.js +2 -2
- package/src/api/window/Instance.d.ts +26 -3
- package/src/api/window/Instance.js +26 -1
- package/src/api/window/index.js +7 -3
- package/src/browser.d.ts +4 -4
- package/src/environment/browser.d.ts +3 -1
- package/src/environment/environment.d.ts +3 -1
- package/src/environment/node-env.d.ts +3 -1
- package/src/environment/node-env.js +2 -2
- package/src/environment/openfin-env.d.ts +3 -1
- package/src/environment/openfin-env.js +15 -17
- package/src/fdc3.d.ts +3 -0
- package/src/fdc3.js +1 -1
- package/src/mock.d.ts +2 -2
- package/src/mock.js +3 -3
- package/src/namespaces.d.ts +21 -0
- package/src/namespaces.js +24 -0
- package/src/shapes/WebOptions.d.ts +1 -0
- package/src/shapes/WindowOptions.d.ts +1 -0
- package/src/shapes/protocol.d.ts +34 -26
- package/src/transport/transport.d.ts +6 -5
- package/src/transport/transport.js +26 -28
- package/src/transport/wire.d.ts +9 -7
- package/src/util/http.d.ts +1 -1
- package/src/util/http.js +16 -11
- package/src/util/inaccessibleObject.d.ts +2 -0
- package/src/util/inaccessibleObject.js +49 -0
- package/src/util/normalize-config.js +5 -5
package/src/OpenFin.js
ADDED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
import type * as OpenFin from '../../OpenFin';
|
|
1
2
|
import { Base } from '../base';
|
|
2
3
|
/**
|
|
4
|
+
* @PORTED
|
|
3
5
|
* @typedef {object} ApplicationOptions
|
|
4
6
|
* @summary Application creation options.
|
|
5
7
|
* @desc This is the options object required by {@link Application.start Application.start}.
|
|
@@ -4,6 +4,7 @@ const base_1 = require("../base");
|
|
|
4
4
|
const validate_1 = require("../../util/validate");
|
|
5
5
|
const Instance_1 = require("./Instance");
|
|
6
6
|
/**
|
|
7
|
+
* @PORTED
|
|
7
8
|
* @typedef {object} ApplicationOptions
|
|
8
9
|
* @summary Application creation options.
|
|
9
10
|
* @desc This is the options object required by {@link Application.start Application.start}.
|
|
@@ -89,7 +90,7 @@ class ApplicationModule extends base_1.Base {
|
|
|
89
90
|
this.wire.sendAction('wrap-application').catch((e) => {
|
|
90
91
|
// we do not want to expose this error, just continue if this analytics-only call fails
|
|
91
92
|
});
|
|
92
|
-
const errorMsg = validate_1.validateIdentity(identity);
|
|
93
|
+
const errorMsg = (0, validate_1.validateIdentity)(identity);
|
|
93
94
|
if (errorMsg) {
|
|
94
95
|
throw new Error(errorMsg);
|
|
95
96
|
}
|
|
@@ -106,7 +107,7 @@ class ApplicationModule extends base_1.Base {
|
|
|
106
107
|
this.wire.sendAction('wrap-application-sync').catch((e) => {
|
|
107
108
|
// we do not want to expose this error, just continue if this analytics-only call fails
|
|
108
109
|
});
|
|
109
|
-
const errorMsg = validate_1.validateIdentity(identity);
|
|
110
|
+
const errorMsg = (0, validate_1.validateIdentity)(identity);
|
|
110
111
|
if (errorMsg) {
|
|
111
112
|
throw new Error(errorMsg);
|
|
112
113
|
}
|
|
@@ -202,7 +203,7 @@ class ApplicationModule extends base_1.Base {
|
|
|
202
203
|
// we do not want to expose this error, just continue if this analytics-only call fails
|
|
203
204
|
});
|
|
204
205
|
const app = await this._createFromManifest(manifestUrl);
|
|
205
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-
|
|
206
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
206
207
|
// @ts-ignore using private method without warning.
|
|
207
208
|
await app._run(opts); // eslint-disable-line no-underscore-dangle
|
|
208
209
|
return app;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type * as OpenFin from '../../OpenFin';
|
|
1
2
|
import { EmitterBase } from '../base';
|
|
2
3
|
import Transport from '../../transport/transport';
|
|
3
4
|
/**
|
|
@@ -6,7 +7,7 @@ import Transport from '../../transport/transport';
|
|
|
6
7
|
* @class
|
|
7
8
|
* @hideconstructor
|
|
8
9
|
*/
|
|
9
|
-
export declare class Application extends EmitterBase<OpenFin.
|
|
10
|
+
export declare class Application extends EmitterBase<OpenFin.ApplicationEvent> {
|
|
10
11
|
identity: OpenFin.ApplicationIdentity;
|
|
11
12
|
_manifestUrl?: string;
|
|
12
13
|
private window;
|
|
@@ -101,6 +102,7 @@ export declare class Application extends EmitterBase<OpenFin.ApplicationEvents>
|
|
|
101
102
|
* @property { JumpListItem[] } items Array of JumpListItem objects
|
|
102
103
|
*/
|
|
103
104
|
/**
|
|
105
|
+
* @PORTED
|
|
104
106
|
* JumpListItem interface
|
|
105
107
|
* @typedef { object } JumpListItem
|
|
106
108
|
* @property { string } type One of the following: "task" or "separator". Defaults to task.
|
|
@@ -119,6 +119,7 @@ class Application extends base_1.EmitterBase {
|
|
|
119
119
|
* @property { JumpListItem[] } items Array of JumpListItem objects
|
|
120
120
|
*/
|
|
121
121
|
/**
|
|
122
|
+
* @PORTED
|
|
122
123
|
* JumpListItem interface
|
|
123
124
|
* @typedef { object } JumpListItem
|
|
124
125
|
* @property { string } type One of the following: "task" or "separator". Defaults to task.
|
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
8
12
|
}));
|
|
9
13
|
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
-
for (var p in m) if (p !== "default" && !
|
|
11
|
-
}
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
12
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
17
|
const Factory_1 = require("./Factory");
|
|
14
18
|
__exportStar(require("./Instance"), exports);
|
package/src/api/base.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import { EventEmitter } from 'events';
|
|
3
3
|
import Transport from '../transport/transport';
|
|
4
|
+
import type * as OpenFin from '../OpenFin';
|
|
4
5
|
import Fin from './fin';
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
import { BaseEvent, EventHandler } from './events/base';
|
|
7
|
+
declare type ApplicationIdentity = OpenFin.ApplicationIdentity;
|
|
8
|
+
declare type Identity = OpenFin.Identity;
|
|
8
9
|
export declare class Base {
|
|
9
10
|
wire: Transport;
|
|
10
11
|
constructor(wire: Transport);
|
|
@@ -14,27 +15,29 @@ export declare class Base {
|
|
|
14
15
|
protected isOpenFinEnvironment: () => boolean;
|
|
15
16
|
protected isBrowserEnvironment: () => boolean;
|
|
16
17
|
}
|
|
17
|
-
export declare class EmitterBase<
|
|
18
|
+
export declare class EmitterBase<EmitterEvent extends BaseEvent, EmitterEventType extends EmitterEvent['type'] = EmitterEvent['type']> extends Base {
|
|
18
19
|
#private;
|
|
19
20
|
private topic;
|
|
20
21
|
protected identity: ApplicationIdentity;
|
|
21
22
|
constructor(wire: Transport, topic: string, ...additionalAccessors: string[]);
|
|
22
23
|
eventNames: () => (string | symbol)[];
|
|
23
|
-
emit: <
|
|
24
|
+
emit: <EventType extends EmitterEventType>(eventType: EventType, payload: Extract<EmitterEvent, {
|
|
25
|
+
type: EventType;
|
|
26
|
+
}>, ...args: any[]) => boolean;
|
|
24
27
|
private hasEmitter;
|
|
25
28
|
private getOrCreateEmitter;
|
|
26
29
|
listeners: (type: string | symbol) => Function[];
|
|
27
30
|
listenerCount: (type: string | symbol) => number;
|
|
28
|
-
protected registerEventListener: (eventType:
|
|
29
|
-
protected deregisterEventListener: (eventType:
|
|
30
|
-
on<
|
|
31
|
-
addListener: <
|
|
32
|
-
once<
|
|
33
|
-
prependListener<
|
|
34
|
-
prependOnceListener<
|
|
35
|
-
removeListener<
|
|
36
|
-
protected deregisterAllListeners(eventType:
|
|
37
|
-
removeAllListeners(eventType?:
|
|
31
|
+
protected registerEventListener: (eventType: EmitterEventType, options: OpenFin.SubscriptionOptions, applySubscription: (emitter: EventEmitter) => void, undoSubscription: (emitter: EventEmitter) => void) => Promise<void>;
|
|
32
|
+
protected deregisterEventListener: (eventType: EmitterEventType, options?: OpenFin.SubscriptionOptions) => Promise<void | EventEmitter>;
|
|
33
|
+
on<EventType extends EmitterEventType>(eventType: EventType, listener: EventHandler<EmitterEvent, EventType>, options?: OpenFin.SubscriptionOptions): Promise<this>;
|
|
34
|
+
addListener: <EventType extends EmitterEventType>(eventType: EventType, listener: OpenFin.BaseEvents.EventHandler<EmitterEvent, EventType>, options?: OpenFin.SubscriptionOptions) => Promise<this>;
|
|
35
|
+
once<EventType extends EmitterEventType>(eventType: EventType, listener: EventHandler<EmitterEvent, EventType>, options?: OpenFin.SubscriptionOptions): Promise<this>;
|
|
36
|
+
prependListener<EventType extends EmitterEventType>(eventType: EventType, listener: EventHandler<EmitterEvent, EventType>, options?: OpenFin.SubscriptionOptions): Promise<this>;
|
|
37
|
+
prependOnceListener<EventType extends EmitterEventType>(eventType: EventType, listener: EventHandler<EmitterEvent, EventType>, options?: OpenFin.SubscriptionOptions): Promise<this>;
|
|
38
|
+
removeListener<EventType extends EmitterEventType>(eventType: EventType, listener: EventHandler<EmitterEvent, EventType>, options?: OpenFin.SubscriptionOptions): Promise<this>;
|
|
39
|
+
protected deregisterAllListeners(eventType: EmitterEventType): Promise<EventEmitter | void>;
|
|
40
|
+
removeAllListeners(eventType?: EmitterEventType): Promise<this>;
|
|
38
41
|
private deleteEmitterIfNothingRegistered;
|
|
39
42
|
}
|
|
40
43
|
export declare class Reply<TOPIC extends string, TYPE extends string | void> implements Identity {
|
|
@@ -43,3 +46,4 @@ export declare class Reply<TOPIC extends string, TYPE extends string | void> imp
|
|
|
43
46
|
uuid: string;
|
|
44
47
|
name: string;
|
|
45
48
|
}
|
|
49
|
+
export {};
|
package/src/api/base.js
CHANGED
|
@@ -1,18 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver,
|
|
3
|
-
if (
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
return value;
|
|
2
|
+
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
3
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
4
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
5
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
6
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
8
7
|
};
|
|
9
|
-
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver,
|
|
10
|
-
if (!
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
return privateMap.get(receiver);
|
|
8
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
9
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
10
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
11
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
14
12
|
};
|
|
15
|
-
var
|
|
13
|
+
var _EmitterBase_emitterAccessor;
|
|
16
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
15
|
exports.Reply = exports.EmitterBase = exports.Base = void 0;
|
|
18
16
|
const promises_1 = require("../util/promises");
|
|
@@ -31,7 +29,7 @@ class Base {
|
|
|
31
29
|
this.wire = wire;
|
|
32
30
|
}
|
|
33
31
|
get fin() {
|
|
34
|
-
return fin_store_1.getFin(this.wire);
|
|
32
|
+
return (0, fin_store_1.getFin)(this.wire);
|
|
35
33
|
}
|
|
36
34
|
get me() {
|
|
37
35
|
return this.wire.me;
|
|
@@ -42,13 +40,13 @@ class EmitterBase extends Base {
|
|
|
42
40
|
constructor(wire, topic, ...additionalAccessors) {
|
|
43
41
|
super(wire);
|
|
44
42
|
this.topic = topic;
|
|
45
|
-
|
|
43
|
+
_EmitterBase_emitterAccessor.set(this, void 0);
|
|
46
44
|
this.eventNames = () => (this.hasEmitter() ? this.getOrCreateEmitter().eventNames() : []);
|
|
47
|
-
this.emit = (
|
|
48
|
-
return this.hasEmitter() ? this.getOrCreateEmitter().emit(
|
|
45
|
+
this.emit = (eventType, payload, ...args) => {
|
|
46
|
+
return this.hasEmitter() ? this.getOrCreateEmitter().emit(eventType, payload, ...args) : false;
|
|
49
47
|
};
|
|
50
|
-
this.hasEmitter = () => this.wire.eventAggregator.has(__classPrivateFieldGet(this,
|
|
51
|
-
this.getOrCreateEmitter = () => this.wire.eventAggregator.getOrCreate(__classPrivateFieldGet(this,
|
|
48
|
+
this.hasEmitter = () => this.wire.eventAggregator.has(__classPrivateFieldGet(this, _EmitterBase_emitterAccessor, "f"));
|
|
49
|
+
this.getOrCreateEmitter = () => this.wire.eventAggregator.getOrCreate(__classPrivateFieldGet(this, _EmitterBase_emitterAccessor, "f"));
|
|
52
50
|
this.listeners = (type) => this.hasEmitter() ? this.getOrCreateEmitter().listeners(type) : [];
|
|
53
51
|
this.listenerCount = (type) => this.hasEmitter() ? this.getOrCreateEmitter().listenerCount(type) : 0;
|
|
54
52
|
this.registerEventListener = async (eventType, options = {}, applySubscription, undoSubscription) => {
|
|
@@ -87,7 +85,7 @@ class EmitterBase extends Base {
|
|
|
87
85
|
return Promise.resolve();
|
|
88
86
|
};
|
|
89
87
|
this.addListener = this.on;
|
|
90
|
-
__classPrivateFieldSet(this,
|
|
88
|
+
__classPrivateFieldSet(this, _EmitterBase_emitterAccessor, [topic, ...additionalAccessors], "f");
|
|
91
89
|
this.listeners = (event) => this.hasEmitter() ? this.getOrCreateEmitter().listeners(event) : [];
|
|
92
90
|
}
|
|
93
91
|
async on(eventType, listener, options) {
|
|
@@ -163,18 +161,18 @@ class EmitterBase extends Base {
|
|
|
163
161
|
}
|
|
164
162
|
else if (this.hasEmitter()) {
|
|
165
163
|
const events = this.getOrCreateEmitter().eventNames();
|
|
166
|
-
await promises_1.promiseMap(events, removeByEvent);
|
|
164
|
+
await (0, promises_1.promiseMap)(events, removeByEvent);
|
|
167
165
|
}
|
|
168
166
|
return this;
|
|
169
167
|
}
|
|
170
168
|
deleteEmitterIfNothingRegistered(emitter) {
|
|
171
169
|
if (emitter.eventNames().length === 0) {
|
|
172
|
-
this.wire.eventAggregator.delete(__classPrivateFieldGet(this,
|
|
170
|
+
this.wire.eventAggregator.delete(__classPrivateFieldGet(this, _EmitterBase_emitterAccessor, "f"));
|
|
173
171
|
}
|
|
174
172
|
}
|
|
175
173
|
}
|
|
176
174
|
exports.EmitterBase = EmitterBase;
|
|
177
|
-
|
|
175
|
+
_EmitterBase_emitterAccessor = new WeakMap();
|
|
178
176
|
class Reply {
|
|
179
177
|
}
|
|
180
178
|
exports.Reply = Reply;
|
|
@@ -1,69 +1,79 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
1
|
+
import type * as OpenFin from '../../OpenFin';
|
|
2
|
+
import { IdentityEvent, NamedEvent, PropagatedEvent } from './base';
|
|
3
|
+
import { PropagatedWindowEvent } from './window';
|
|
4
|
+
import { PropagatedViewEvent } from './view';
|
|
5
|
+
export declare type CrashedEvent = NamedEvent & {
|
|
6
|
+
type: 'crashed';
|
|
5
7
|
reason: 'normal-termination' | 'abnormal-termination' | 'killed' | 'crashed' | 'still-running' | 'launch-failed' | 'out-of-memory' | 'integrity-failure';
|
|
6
8
|
exitCode: number;
|
|
7
9
|
details: {
|
|
8
10
|
reason: string;
|
|
9
11
|
exitCode: number;
|
|
10
12
|
};
|
|
11
|
-
}
|
|
12
|
-
export
|
|
13
|
-
|
|
13
|
+
};
|
|
14
|
+
export declare type RunRequestedEvent = IdentityEvent & {
|
|
15
|
+
type: 'run-requested';
|
|
16
|
+
userAppConfigArgs: Record<string, any>;
|
|
14
17
|
manifest: OpenFin.ManifestInfo;
|
|
15
|
-
}
|
|
16
|
-
export
|
|
18
|
+
};
|
|
19
|
+
export declare type TrayIconClickedEvent = IdentityEvent & {
|
|
20
|
+
type: 'tray-icon-clicked';
|
|
17
21
|
button: 0 | 1 | 2;
|
|
18
22
|
bounds: OpenFin.Rectangle;
|
|
19
23
|
x: number;
|
|
20
24
|
y: number;
|
|
21
25
|
monitorInfo: any;
|
|
22
|
-
}
|
|
23
|
-
export interface ApplicationEventMapping<Topic = string, Type = string> extends BaseEventMap {
|
|
24
|
-
'closed': ApplicationEvent<Topic, Type>;
|
|
25
|
-
'connected': ApplicationEvent<Topic, Type>;
|
|
26
|
-
'crashed': CrashedEvent & ApplicationEvent<Topic, Type>;
|
|
27
|
-
'initialized': ApplicationEvent<Topic, Type>;
|
|
28
|
-
'manifest-changed': ApplicationEvent<Topic, Type>;
|
|
29
|
-
'not-responding': ApplicationEvent<Topic, Type>;
|
|
30
|
-
'responding': ApplicationEvent<Topic, Type>;
|
|
31
|
-
'run-requested': RunRequestedEvent<Topic, Type>;
|
|
32
|
-
'started': ApplicationEvent<Topic, Type>;
|
|
33
|
-
'tray-icon-clicked': TrayIconClicked<Topic, Type>;
|
|
34
|
-
'window-alert-requested': WindowAlertRequestedEvent<Topic, Type>;
|
|
35
|
-
'window-auth-requested': WindowAuthRequestedEvent<Topic, Type>;
|
|
36
|
-
'window-created': WindowEvent<Topic, Type>;
|
|
37
|
-
'window-end-load': WindowEndLoadEvent<Topic, Type>;
|
|
38
|
-
'window-not-responding': WindowEvent<Topic, Type>;
|
|
39
|
-
'window-performance-report': WindowPerformanceReport<Topic, Type>;
|
|
40
|
-
'window-responding': WindowEvent<Topic, Type>;
|
|
41
|
-
'window-show-requested': WindowEvent<Topic, Type>;
|
|
42
|
-
'window-start-load': WindowEvent<Topic, Type>;
|
|
43
|
-
}
|
|
44
|
-
export interface PropagatedApplicationEventMapping<Topic = string, Type = string> {
|
|
45
|
-
'application-closed': ApplicationEvent<Topic, Type>;
|
|
46
|
-
'application-connected': ApplicationEvent<Topic, Type>;
|
|
47
|
-
'application-crashed': CrashedEvent & ApplicationEvent<Topic, Type>;
|
|
48
|
-
'application-initialized': ApplicationEvent<Topic, Type>;
|
|
49
|
-
'application-manifest-changed': ApplicationEvent<Topic, Type>;
|
|
50
|
-
'application-not-responding': ApplicationEvent<Topic, Type>;
|
|
51
|
-
'application-responding': ApplicationEvent<Topic, Type>;
|
|
52
|
-
'application-started': ApplicationEvent<Topic, Type>;
|
|
53
|
-
'application-tray-icon-clicked': TrayIconClicked<Topic, Type>;
|
|
54
|
-
'window-created': WindowEvent<Topic, Type>;
|
|
55
|
-
'window-did-change-theme-color': WindowEvent<Topic, Type>;
|
|
56
|
-
'window-end-load': WindowEndLoadEvent<Topic, Type>;
|
|
57
|
-
'window-not-responding': WindowEvent<Topic, Type>;
|
|
58
|
-
'window-page-favicon-updated': WindowEvent<Topic, Type>;
|
|
59
|
-
'window-page-title-updated': WindowEvent<Topic, Type>;
|
|
60
|
-
'window-performance-report': WindowPerformanceReport<Topic, Type>;
|
|
61
|
-
'window-responding': WindowEvent<Topic, Type>;
|
|
62
|
-
'window-start-load': WindowEvent<Topic, Type>;
|
|
63
|
-
}
|
|
64
|
-
export declare type ApplicationEvents = PropagatedWindowEvents<'application'> & PropagatedViewEvents<'application'> & {
|
|
65
|
-
[Type in keyof ApplicationEventMapping]: ApplicationEventMapping<'application', Type>[Type];
|
|
66
|
-
};
|
|
67
|
-
export declare type PropagatedApplicationEvents<Topic> = {
|
|
68
|
-
[Type in keyof PropagatedApplicationEventMapping]: PropagatedApplicationEventMapping<Topic, Type>[Type];
|
|
69
26
|
};
|
|
27
|
+
export declare type WindowAlertRequestedEvent = NamedEvent & {
|
|
28
|
+
type: 'window-alert-requested';
|
|
29
|
+
};
|
|
30
|
+
export declare type WindowCreatedEvent = NamedEvent & {
|
|
31
|
+
type: 'window-created';
|
|
32
|
+
};
|
|
33
|
+
export declare type WindowEndLoadEvent = NamedEvent & {
|
|
34
|
+
type: 'window-end-load';
|
|
35
|
+
};
|
|
36
|
+
export declare type WindowNotRespondingEvent = NamedEvent & {
|
|
37
|
+
type: 'window-not-responding';
|
|
38
|
+
};
|
|
39
|
+
export declare type WindowRespondingEvent = NamedEvent & {
|
|
40
|
+
type: 'window-responding';
|
|
41
|
+
};
|
|
42
|
+
export declare type WindowStartLoadEvent = NamedEvent & {
|
|
43
|
+
type: 'window-start-load';
|
|
44
|
+
};
|
|
45
|
+
/**
|
|
46
|
+
* A Window event that is natively published at the Application level (not Window).
|
|
47
|
+
*/
|
|
48
|
+
export declare type ApplicationWindowEvent = WindowAlertRequestedEvent | WindowCreatedEvent | WindowEndLoadEvent | WindowNotRespondingEvent | WindowRespondingEvent | WindowStartLoadEvent;
|
|
49
|
+
export declare type ClosedEvent = IdentityEvent & {
|
|
50
|
+
type: 'closed';
|
|
51
|
+
};
|
|
52
|
+
export declare type ApplicationConnectedEvent = IdentityEvent & {
|
|
53
|
+
type: 'connected';
|
|
54
|
+
};
|
|
55
|
+
export declare type InitializedEvent = IdentityEvent & {
|
|
56
|
+
type: 'initialized';
|
|
57
|
+
};
|
|
58
|
+
export declare type ManifestChangedEvent = IdentityEvent & {
|
|
59
|
+
type: 'manifest-changed';
|
|
60
|
+
};
|
|
61
|
+
export declare type NotRespondingEvent = IdentityEvent & {
|
|
62
|
+
type: 'not-responding';
|
|
63
|
+
};
|
|
64
|
+
export declare type RespondingEvent = IdentityEvent & {
|
|
65
|
+
type: 'responding';
|
|
66
|
+
};
|
|
67
|
+
export declare type StartedEvent = IdentityEvent & {
|
|
68
|
+
type: 'started';
|
|
69
|
+
};
|
|
70
|
+
/**
|
|
71
|
+
* An Application event that does propagate to (republish on) parent topics.
|
|
72
|
+
*/
|
|
73
|
+
export declare type WillPropagateApplicationEvent = ClosedEvent | ApplicationConnectedEvent | CrashedEvent | InitializedEvent | ManifestChangedEvent | NotRespondingEvent | RespondingEvent | RunRequestedEvent | StartedEvent | TrayIconClickedEvent;
|
|
74
|
+
export declare type ApplicationEvent = {
|
|
75
|
+
topic: 'application';
|
|
76
|
+
} & (PropagatedViewEvent | PropagatedWindowEvent | ApplicationWindowEvent | WillPropagateApplicationEvent);
|
|
77
|
+
export declare type ApplicationEventType = ApplicationEvent['type'];
|
|
78
|
+
export declare type PropagatedApplicationEvent = PropagatedEvent<'application', WillPropagateApplicationEvent> | ApplicationWindowEvent;
|
|
79
|
+
export declare type PropagatedApplicationEventType = PropagatedApplicationEvent['type'];
|
package/src/api/events/base.d.ts
CHANGED
|
@@ -1,17 +1,35 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import type * as OpenFin from '../../OpenFin';
|
|
2
|
+
/**
|
|
3
|
+
* Modifies an event key to reflect propagation by prefixing with the topic.
|
|
4
|
+
*/
|
|
5
|
+
export declare type PropagatedEventType<Topic extends string, Type extends string> = `${Topic}-${Type}`;
|
|
6
|
+
/**
|
|
7
|
+
* Modifies an event shape to reflect propagation to a parent topic. The 'type' field
|
|
8
|
+
* is prefixed with the original topic, and a new property is added with the original topic's identity.
|
|
9
|
+
*/
|
|
10
|
+
export declare type PropagatedEvent<Topic extends string, Event extends {
|
|
11
|
+
type: string;
|
|
12
|
+
}> = Event extends infer E extends {
|
|
13
|
+
type: string;
|
|
14
|
+
} ? Omit<E, 'type'> & {
|
|
15
|
+
type: PropagatedEventType<Topic, E['type']>;
|
|
16
|
+
} & {
|
|
17
|
+
[topic in `${Topic}Identity`]: OpenFin.Identity;
|
|
18
|
+
} : never;
|
|
19
|
+
/**
|
|
20
|
+
* Handler for an event on an EventEmitter; selects the correct type for the event
|
|
21
|
+
* payload from the provided union based on the provided string literal type.
|
|
22
|
+
*/
|
|
23
|
+
export declare type EventHandler<EmitterEvent extends BaseEvent, EventType extends string> = (payload: Extract<EmitterEvent, {
|
|
24
|
+
type: EventType;
|
|
25
|
+
}>, ...args: any[]) => void;
|
|
26
|
+
export declare type BaseEvent = {
|
|
27
|
+
topic: string;
|
|
28
|
+
type: string;
|
|
29
|
+
};
|
|
30
|
+
export declare type IdentityEvent = BaseEvent & {
|
|
8
31
|
uuid: string;
|
|
9
|
-
}
|
|
10
|
-
export
|
|
32
|
+
};
|
|
33
|
+
export declare type NamedEvent = IdentityEvent & {
|
|
11
34
|
name: string;
|
|
12
|
-
}
|
|
13
|
-
export interface BaseEventMap {
|
|
14
|
-
[name: string]: any;
|
|
15
|
-
newListener: string;
|
|
16
|
-
listenerRemoved: string;
|
|
17
|
-
}
|
|
35
|
+
};
|
|
@@ -1,10 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export
|
|
1
|
+
import { NamedEvent } from './base';
|
|
2
|
+
export declare type BaseChannelEvent = NamedEvent & {
|
|
3
3
|
channelName: string;
|
|
4
4
|
channelId: string;
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
5
|
+
};
|
|
6
|
+
export declare type ChannelConnectedEvent = BaseChannelEvent & {
|
|
7
|
+
type: 'connected';
|
|
8
|
+
};
|
|
9
|
+
export declare type ChannelDisconnectedEvent = BaseChannelEvent & {
|
|
10
|
+
type: 'disconnected';
|
|
11
|
+
};
|
|
12
|
+
export declare type ChannelEvent = {
|
|
13
|
+
topic: 'channel';
|
|
14
|
+
} & (ChannelConnectedEvent | ChannelDisconnectedEvent);
|
|
15
|
+
export declare type ChannelEventType = ChannelEvent['type'];
|
|
@@ -6,11 +6,7 @@ function isEventMessage(message) {
|
|
|
6
6
|
}
|
|
7
7
|
function mapKeyFromEvent(event) {
|
|
8
8
|
const { topic } = event;
|
|
9
|
-
if (topic === 'frame') {
|
|
10
|
-
const { uuid, name } = event;
|
|
11
|
-
return [topic, uuid, name];
|
|
12
|
-
}
|
|
13
|
-
if (topic === 'window') {
|
|
9
|
+
if (topic === 'frame' || topic === 'window' || topic === 'view') {
|
|
14
10
|
const { uuid, name } = event;
|
|
15
11
|
return [topic, uuid, name];
|
|
16
12
|
}
|
|
@@ -18,10 +14,6 @@ function mapKeyFromEvent(event) {
|
|
|
18
14
|
const { uuid } = event;
|
|
19
15
|
return [topic, uuid];
|
|
20
16
|
}
|
|
21
|
-
if (topic === 'view') {
|
|
22
|
-
const { uuid, name } = event;
|
|
23
|
-
return [topic, uuid, name];
|
|
24
|
-
}
|
|
25
17
|
return [topic];
|
|
26
18
|
}
|
|
27
19
|
class EventAggregator extends emitterMap_1.EmitterMap {
|
|
@@ -1,5 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { BaseEvent } from './base';
|
|
2
|
+
export declare type ExternalApplicationConnectedEvent = BaseEvent & {
|
|
3
|
+
type: 'connected';
|
|
4
|
+
};
|
|
5
|
+
export declare type ExternalApplicationDisconnectedEvent = BaseEvent & {
|
|
6
|
+
type: 'disconnected';
|
|
7
|
+
};
|
|
8
|
+
export declare type ExternalApplicationEvent = {
|
|
9
|
+
topic: 'externalapplication';
|
|
10
|
+
} & (ExternalApplicationConnectedEvent | ExternalApplicationDisconnectedEvent);
|
|
@@ -1,9 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export
|
|
1
|
+
import { NamedEvent } from './base';
|
|
2
|
+
export declare type BaseFrameEvent = NamedEvent & {
|
|
3
3
|
entityType: 'iframe';
|
|
4
4
|
frameName: string;
|
|
5
|
-
}
|
|
6
|
-
export
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
};
|
|
6
|
+
export declare type FrameConnectedEvent = BaseFrameEvent & {
|
|
7
|
+
type: 'connected';
|
|
8
|
+
};
|
|
9
|
+
export declare type FrameDisconnectedEvent = BaseFrameEvent & {
|
|
10
|
+
type: 'disconnected';
|
|
11
|
+
};
|
|
12
|
+
export declare type FrameEvent = {
|
|
13
|
+
topic: 'frame';
|
|
14
|
+
} & (FrameConnectedEvent | FrameDisconnectedEvent);
|
|
15
|
+
export declare type FrameEventType = FrameEvent['type'];
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
import { BaseEvent } from './base';
|
|
2
|
+
export declare type RegisteredEvent = BaseEvent & {
|
|
3
|
+
type: 'registered';
|
|
4
|
+
};
|
|
5
|
+
export declare type UnregisteredEvent = BaseEvent & {
|
|
6
|
+
type: 'unregistered';
|
|
7
|
+
};
|
|
8
|
+
export declare type GlobalHotkeyEvent = {
|
|
9
|
+
topic: 'global-hotkey';
|
|
10
|
+
hotkey: 'string';
|
|
11
|
+
} & (RegisteredEvent | UnregisteredEvent);
|
|
@@ -1,18 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
'platform-api-ready': ApplicationEvent<Topic, Type>;
|
|
7
|
-
'platform-snapshot-applied': ApplicationEvent<Topic, Type>;
|
|
8
|
-
}
|
|
9
|
-
export interface PropagatedPlatformEventMapping<Topic = string, Type = string> extends PropagatedApplicationEventMapping {
|
|
10
|
-
'platform-api-ready': ApplicationEvent<Topic, Type>;
|
|
11
|
-
'platform-snapshot-applied': ApplicationEvent<Topic, Type>;
|
|
12
|
-
}
|
|
13
|
-
export declare type PlatformEvents = PropagatedWindowEvents<'application'> & PropagatedViewEvents<'application'> & {
|
|
14
|
-
[Type in keyof PlatformEventMapping]: PlatformEventMapping<'application', Type>[Type];
|
|
1
|
+
import { BaseEvent } from './base';
|
|
2
|
+
import { PropagatedViewEvent } from './view';
|
|
3
|
+
import { PropagatedWindowEvent } from './window';
|
|
4
|
+
export declare type PlatformApiReadyEvent = BaseEvent & {
|
|
5
|
+
type: 'platform-api-ready';
|
|
15
6
|
};
|
|
16
|
-
export declare type
|
|
17
|
-
|
|
7
|
+
export declare type PlatformSnapshotAppliedEvent = BaseEvent & {
|
|
8
|
+
type: 'platform-snapshot-applied';
|
|
18
9
|
};
|
|
10
|
+
export declare type PlatformEvent = {
|
|
11
|
+
topic: 'platform';
|
|
12
|
+
} & (PropagatedWindowEvent | PropagatedViewEvent | PlatformApiReadyEvent | PlatformSnapshotAppliedEvent);
|