@openfin/core 25.68.30 → 25.70.2
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 +30 -826
- package/README.md +12 -2
- package/package.json +1 -1
- package/src/api/application/Factory.d.ts +145 -145
- package/src/api/application/Factory.js +229 -229
- package/src/api/application/Instance.d.ts +301 -302
- package/src/api/application/Instance.js +412 -412
- package/src/api/application/index.d.ts +3 -3
- package/src/api/application/index.js +15 -15
- package/src/api/base.d.ts +43 -43
- package/src/api/base.js +177 -177
- package/src/api/clipboard/index.d.ts +69 -69
- package/src/api/clipboard/index.js +88 -88
- package/src/api/events/application.d.ts +69 -0
- package/src/api/events/application.js +2 -0
- package/src/api/events/base.d.ts +17 -0
- package/src/api/events/base.js +2 -0
- package/src/api/events/channel.d.ts +10 -11
- package/src/api/events/channel.js +2 -2
- package/src/api/events/emitterMap.d.ts +11 -11
- package/src/api/events/emitterMap.js +35 -35
- package/src/api/events/eventAggregator.d.ts +5 -5
- package/src/api/events/eventAggregator.js +43 -43
- package/src/api/events/externalApplication.d.ts +5 -0
- package/src/api/events/externalApplication.js +2 -0
- package/src/api/events/frame.d.ts +9 -0
- package/src/api/events/frame.js +2 -0
- package/src/api/events/globalHotkey.d.ts +10 -0
- package/src/api/events/globalHotkey.js +2 -0
- package/src/api/events/platform.d.ts +18 -0
- package/src/api/events/platform.js +2 -0
- package/src/api/events/system.d.ts +22 -0
- package/src/api/events/system.js +2 -0
- package/src/api/events/view.d.ts +56 -0
- package/src/api/events/view.js +2 -0
- package/src/api/events/webcontents.d.ts +48 -0
- package/src/api/events/webcontents.js +2 -0
- package/src/api/events/window.d.ts +176 -0
- package/src/api/events/window.js +2 -0
- package/src/api/external-application/Factory.d.ts +26 -26
- package/src/api/external-application/Factory.js +40 -40
- package/src/api/external-application/Instance.d.ts +101 -102
- package/src/api/external-application/Instance.js +109 -109
- package/src/api/external-application/index.d.ts +3 -3
- package/src/api/external-application/index.js +15 -15
- package/src/api/fin.d.ts +49 -49
- package/src/api/fin.js +43 -43
- package/src/api/frame/Factory.d.ts +36 -36
- package/src/api/frame/Factory.js +69 -69
- package/src/api/frame/Instance.d.ts +121 -121
- package/src/api/frame/Instance.js +130 -130
- package/src/api/frame/index.d.ts +3 -3
- package/src/api/frame/index.js +15 -15
- package/src/api/global-hotkey/index.d.ts +38 -38
- package/src/api/global-hotkey/index.js +58 -58
- package/src/api/interappbus/channel/channel.d.ts +26 -26
- package/src/api/interappbus/channel/channel.js +77 -77
- package/src/api/interappbus/channel/channels-docs.d.ts +318 -318
- package/src/api/interappbus/channel/channels-docs.js +376 -376
- package/src/api/interappbus/channel/client.d.ts +22 -22
- package/src/api/interappbus/channel/client.js +84 -84
- package/src/api/interappbus/channel/connection-manager.d.ts +28 -28
- package/src/api/interappbus/channel/connection-manager.js +244 -244
- package/src/api/interappbus/channel/index.d.ts +22 -23
- package/src/api/interappbus/channel/index.js +121 -121
- package/src/api/interappbus/channel/protocols/classic/message-receiver.d.ts +13 -13
- package/src/api/interappbus/channel/protocols/classic/message-receiver.js +73 -73
- package/src/api/interappbus/channel/protocols/classic/strategy.d.ts +22 -22
- package/src/api/interappbus/channel/protocols/classic/strategy.js +84 -84
- package/src/api/interappbus/channel/protocols/combined/strategy.d.ts +20 -20
- package/src/api/interappbus/channel/protocols/combined/strategy.js +58 -58
- package/src/api/interappbus/channel/protocols/index.d.ts +44 -44
- package/src/api/interappbus/channel/protocols/index.js +2 -2
- package/src/api/interappbus/channel/protocols/protocol-manager.d.ts +10 -10
- package/src/api/interappbus/channel/protocols/protocol-manager.js +43 -43
- package/src/api/interappbus/channel/protocols/rtc/endpoint.d.ts +23 -23
- package/src/api/interappbus/channel/protocols/rtc/endpoint.js +135 -135
- package/src/api/interappbus/channel/protocols/rtc/ice-manager.d.ts +30 -30
- package/src/api/interappbus/channel/protocols/rtc/ice-manager.js +131 -131
- package/src/api/interappbus/channel/protocols/rtc/strategy.d.ts +22 -22
- package/src/api/interappbus/channel/protocols/rtc/strategy.js +87 -87
- package/src/api/interappbus/channel/protocols/strategy-types.d.ts +13 -13
- package/src/api/interappbus/channel/protocols/strategy-types.js +2 -2
- package/src/api/interappbus/channel/protocols/strategy.d.ts +15 -15
- package/src/api/interappbus/channel/protocols/strategy.js +2 -2
- package/src/api/interappbus/channel/provider.d.ts +31 -31
- package/src/api/interappbus/channel/provider.js +160 -160
- package/src/api/interappbus/index.d.ts +85 -86
- package/src/api/interappbus/index.js +175 -175
- package/src/api/interop/Factory.d.ts +37 -37
- package/src/api/interop/Factory.js +54 -54
- package/src/api/interop/InteropBroker.d.ts +363 -363
- package/src/api/interop/InteropBroker.js +914 -914
- package/src/api/interop/InteropClient.d.ts +268 -268
- package/src/api/interop/InteropClient.js +450 -450
- package/src/api/interop/SessionContextGroupBroker.d.ts +26 -26
- package/src/api/interop/SessionContextGroupBroker.js +107 -107
- package/src/api/interop/SessionContextGroupClient.d.ts +20 -20
- package/src/api/interop/SessionContextGroupClient.js +85 -85
- package/src/api/interop/fdc3/fdc3-1.2.d.ts +187 -187
- package/src/api/interop/fdc3/fdc3-1.2.js +385 -385
- package/src/api/interop/fdc3/fdc3.js +17 -17
- package/src/api/interop/fdc3/utils.d.ts +6 -6
- package/src/api/interop/fdc3/utils.js +17 -17
- package/src/api/interop/index.d.ts +4 -4
- package/src/api/interop/index.js +16 -16
- package/src/api/interop/utils.d.ts +11 -11
- package/src/api/interop/utils.js +36 -36
- package/src/api/me.d.ts +38 -35
- package/src/api/me.js +128 -60
- package/src/api/platform/Factory.d.ts +109 -109
- package/src/api/platform/Factory.js +188 -188
- package/src/api/platform/Instance.d.ts +122 -122
- package/src/api/platform/Instance.js +298 -298
- package/src/api/platform/common-utils.d.ts +6 -6
- package/src/api/platform/common-utils.js +16 -16
- package/src/api/platform/index.d.ts +3 -3
- package/src/api/platform/index.js +15 -15
- package/src/api/platform/layout/Factory.d.ts +108 -108
- package/src/api/platform/layout/Factory.js +189 -189
- package/src/api/platform/layout/Instance.d.ts +49 -49
- package/src/api/platform/layout/Instance.js +99 -99
- package/src/api/platform/layout/index.d.ts +2 -2
- package/src/api/platform/layout/index.js +14 -14
- package/src/api/platform/layout/shapes.d.ts +11 -0
- package/src/api/{window → platform/layout}/shapes.js +2 -2
- package/src/api/snapshot-source/Factory.d.ts +36 -36
- package/src/api/snapshot-source/Factory.js +65 -65
- package/src/api/snapshot-source/Instance.d.ts +30 -30
- package/src/api/snapshot-source/Instance.js +134 -134
- package/src/api/snapshot-source/index.d.ts +3 -3
- package/src/api/snapshot-source/index.js +15 -15
- package/src/api/snapshot-source/utils.d.ts +1 -1
- package/src/api/snapshot-source/utils.js +5 -5
- package/src/api/system/index.d.ts +960 -961
- package/src/api/system/index.js +1241 -1241
- package/src/api/view/Factory.d.ts +49 -49
- package/src/api/view/Factory.js +103 -103
- package/src/api/view/Instance.d.ts +387 -380
- package/src/api/view/Instance.js +422 -415
- package/src/api/view/index.d.ts +3 -3
- package/src/api/view/index.js +15 -15
- package/src/api/webcontents/main.d.ts +36 -36
- package/src/api/webcontents/main.js +82 -82
- package/src/api/window/Factory.d.ts +44 -44
- package/src/api/window/Factory.js +91 -91
- package/src/api/window/Instance.d.ts +972 -966
- package/src/api/window/Instance.js +1209 -1202
- package/src/api/window/index.d.ts +3 -5
- package/src/api/window/index.js +15 -17
- package/src/environment/environment.d.ts +28 -25
- package/src/environment/environment.js +4 -4
- package/src/environment/node-env.d.ts +25 -26
- package/src/environment/node-env.js +64 -64
- package/src/environment/openfin-env.d.ts +29 -30
- package/src/environment/openfin-env.js +107 -107
- package/src/mock.d.ts +3 -3
- package/src/mock.js +91 -90
- package/src/shapes/ERROR_BOX_TYPES.d.ts +1 -0
- package/src/shapes/ERROR_BOX_TYPES.js +2 -0
- package/src/shapes/WebOptions.d.ts +12 -0
- package/src/shapes/WebOptions.js +2 -0
- package/src/shapes/WindowOptions.d.ts +42 -0
- package/src/shapes/WindowOptions.js +2 -0
- package/src/shapes/protocol.d.ts +178 -0
- package/src/shapes/protocol.js +2 -0
- package/src/transport/fin_store.d.ts +4 -4
- package/src/transport/fin_store.js +16 -16
- package/src/transport/transport-errors.d.ts +18 -18
- package/src/transport/transport-errors.js +37 -37
- package/src/transport/transport.d.ts +56 -43
- package/src/transport/transport.js +181 -181
- package/src/transport/wire.d.ts +71 -11
- package/src/transport/wire.js +32 -32
- package/src/util/asyncFilter.d.ts +1 -1
- package/src/util/asyncFilter.js +7 -7
- package/src/util/errors.d.ts +9 -5
- package/src/util/errors.js +11 -11
- package/src/util/exhaustive.d.ts +1 -1
- package/src/util/exhaustive.js +7 -7
- package/src/util/http.d.ts +11 -11
- package/src/util/http.js +83 -83
- package/src/util/normalize-config.d.ts +3 -5
- package/src/util/normalize-config.js +47 -47
- package/src/util/promises.d.ts +5 -5
- package/src/util/promises.js +27 -27
- package/src/util/ref-counter.d.ts +7 -7
- package/src/util/ref-counter.js +51 -51
- package/src/util/runtimeVersioning.d.ts +3 -3
- package/src/util/runtimeVersioning.js +25 -25
- package/src/util/utilTypes.d.ts +8 -8
- package/src/util/utilTypes.js +2 -2
- package/src/util/validate.d.ts +3 -3
- package/src/util/validate.js +11 -11
- package/docs.README(OLD).md +0 -82
- package/resources/win/OpenFinRVM.exe +0 -0
- package/src/api/window/bounds-changed.d.ts +0 -10
- package/src/api/window/bounds-changed.js +0 -6
- package/src/api/window/shapes.d.ts +0 -13
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { ChannelStrategy } from '../strategy';
|
|
2
|
-
declare type OverlapsOnlyIfMatching<T, U> = {
|
|
3
|
-
[K in Extract<keyof T, keyof U>]: U[K] extends T[K] ? U[K] : T[K] extends U[K] ? T[K] : never;
|
|
4
|
-
};
|
|
5
|
-
declare type OnlyIfCompatible<A, B, D = OverlapsOnlyIfMatching<A, B>> = D extends Record<any, never> ? keyof D extends never ? A | B : never : A | B;
|
|
6
|
-
export default class CombinedStrategy<A, B> implements ChannelStrategy<OnlyIfCompatible<A, B>> {
|
|
7
|
-
private primary;
|
|
8
|
-
private secondary;
|
|
9
|
-
static combine<A, B>(a: ChannelStrategy<A>, b: ChannelStrategy<B>): OnlyIfCompatible<A, B> extends never ? never : CombinedStrategy<A, B>;
|
|
10
|
-
private constructor();
|
|
11
|
-
onEndpointDisconnect(endpointId: string, listener: () => void): void;
|
|
12
|
-
isValidEndpointPayload(payload: unknown): payload is OnlyIfCompatible<A, B>;
|
|
13
|
-
closeEndpoint(endpointId: string): Promise<void>;
|
|
14
|
-
isEndpointConnected(endpoint: string): boolean;
|
|
15
|
-
addEndpoint(endpoint: string, payload: OnlyIfCompatible<A, B>): Promise<void>;
|
|
16
|
-
receive(listener: (action: string, payload: any, identity: any) => Promise<any>): void;
|
|
17
|
-
send(endpointId: string, action: string, payload: any): Promise<any>;
|
|
18
|
-
close(): Promise<void>;
|
|
19
|
-
}
|
|
20
|
-
export {};
|
|
1
|
+
import { ChannelStrategy } from '../strategy';
|
|
2
|
+
declare type OverlapsOnlyIfMatching<T, U> = {
|
|
3
|
+
[K in Extract<keyof T, keyof U>]: U[K] extends T[K] ? U[K] : T[K] extends U[K] ? T[K] : never;
|
|
4
|
+
};
|
|
5
|
+
declare type OnlyIfCompatible<A, B, D = OverlapsOnlyIfMatching<A, B>> = D extends Record<any, never> ? keyof D extends never ? A | B : never : A | B;
|
|
6
|
+
export default class CombinedStrategy<A, B> implements ChannelStrategy<OnlyIfCompatible<A, B>> {
|
|
7
|
+
private primary;
|
|
8
|
+
private secondary;
|
|
9
|
+
static combine<A, B>(a: ChannelStrategy<A>, b: ChannelStrategy<B>): OnlyIfCompatible<A, B> extends never ? never : CombinedStrategy<A, B>;
|
|
10
|
+
private constructor();
|
|
11
|
+
onEndpointDisconnect(endpointId: string, listener: () => void): void;
|
|
12
|
+
isValidEndpointPayload(payload: unknown): payload is OnlyIfCompatible<A, B>;
|
|
13
|
+
closeEndpoint(endpointId: string): Promise<void>;
|
|
14
|
+
isEndpointConnected(endpoint: string): boolean;
|
|
15
|
+
addEndpoint(endpoint: string, payload: OnlyIfCompatible<A, B>): Promise<void>;
|
|
16
|
+
receive(listener: (action: string, payload: any, identity: any) => Promise<any>): void;
|
|
17
|
+
send(endpointId: string, action: string, payload: any): Promise<any>;
|
|
18
|
+
close(): Promise<void>;
|
|
19
|
+
}
|
|
20
|
+
export {};
|
|
@@ -1,58 +1,58 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
class CombinedStrategy {
|
|
4
|
-
// eslint-disable-next-line no-useless-constructor
|
|
5
|
-
constructor(primary, secondary) {
|
|
6
|
-
this.primary = primary;
|
|
7
|
-
this.secondary = secondary;
|
|
8
|
-
}
|
|
9
|
-
// Making this a static method because the constructor can't be typed.
|
|
10
|
-
// Otherwise it will error when calling addEndpoint but I'd rather the whole instance be typed as never.
|
|
11
|
-
static combine(a, b) {
|
|
12
|
-
return new CombinedStrategy(a, b);
|
|
13
|
-
}
|
|
14
|
-
onEndpointDisconnect(endpointId, listener) {
|
|
15
|
-
this.primary.onEndpointDisconnect(endpointId, () => {
|
|
16
|
-
if (!this.secondary.isEndpointConnected(endpointId)) {
|
|
17
|
-
listener();
|
|
18
|
-
}
|
|
19
|
-
});
|
|
20
|
-
this.secondary.onEndpointDisconnect(endpointId, () => {
|
|
21
|
-
if (!this.primary.isEndpointConnected(endpointId)) {
|
|
22
|
-
listener();
|
|
23
|
-
}
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
isValidEndpointPayload(payload) {
|
|
27
|
-
return this.primary.isValidEndpointPayload(payload) || this.secondary.isValidEndpointPayload(payload);
|
|
28
|
-
}
|
|
29
|
-
async closeEndpoint(endpointId) {
|
|
30
|
-
await this.primary.closeEndpoint(endpointId);
|
|
31
|
-
await this.secondary.closeEndpoint(endpointId);
|
|
32
|
-
}
|
|
33
|
-
isEndpointConnected(endpoint) {
|
|
34
|
-
return this.primary.isEndpointConnected(endpoint) || this.secondary.isEndpointConnected(endpoint);
|
|
35
|
-
}
|
|
36
|
-
async addEndpoint(endpoint, payload) {
|
|
37
|
-
if (this.primary.isValidEndpointPayload(payload)) {
|
|
38
|
-
await this.primary.addEndpoint(endpoint, payload);
|
|
39
|
-
}
|
|
40
|
-
if (this.secondary.isValidEndpointPayload(payload)) {
|
|
41
|
-
await this.secondary.addEndpoint(endpoint, payload);
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
receive(listener) {
|
|
45
|
-
this.primary.receive(listener);
|
|
46
|
-
this.secondary.receive(listener);
|
|
47
|
-
}
|
|
48
|
-
send(endpointId, action, payload) {
|
|
49
|
-
if (this.primary.isEndpointConnected(endpointId)) {
|
|
50
|
-
return this.primary.send(endpointId, action, payload);
|
|
51
|
-
}
|
|
52
|
-
return this.secondary.send(endpointId, action, payload);
|
|
53
|
-
}
|
|
54
|
-
async close() {
|
|
55
|
-
await Promise.all([this.primary.close(), this.secondary.close()]);
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
exports.default = CombinedStrategy;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
class CombinedStrategy {
|
|
4
|
+
// eslint-disable-next-line no-useless-constructor
|
|
5
|
+
constructor(primary, secondary) {
|
|
6
|
+
this.primary = primary;
|
|
7
|
+
this.secondary = secondary;
|
|
8
|
+
}
|
|
9
|
+
// Making this a static method because the constructor can't be typed.
|
|
10
|
+
// Otherwise it will error when calling addEndpoint but I'd rather the whole instance be typed as never.
|
|
11
|
+
static combine(a, b) {
|
|
12
|
+
return new CombinedStrategy(a, b);
|
|
13
|
+
}
|
|
14
|
+
onEndpointDisconnect(endpointId, listener) {
|
|
15
|
+
this.primary.onEndpointDisconnect(endpointId, () => {
|
|
16
|
+
if (!this.secondary.isEndpointConnected(endpointId)) {
|
|
17
|
+
listener();
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
this.secondary.onEndpointDisconnect(endpointId, () => {
|
|
21
|
+
if (!this.primary.isEndpointConnected(endpointId)) {
|
|
22
|
+
listener();
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
isValidEndpointPayload(payload) {
|
|
27
|
+
return this.primary.isValidEndpointPayload(payload) || this.secondary.isValidEndpointPayload(payload);
|
|
28
|
+
}
|
|
29
|
+
async closeEndpoint(endpointId) {
|
|
30
|
+
await this.primary.closeEndpoint(endpointId);
|
|
31
|
+
await this.secondary.closeEndpoint(endpointId);
|
|
32
|
+
}
|
|
33
|
+
isEndpointConnected(endpoint) {
|
|
34
|
+
return this.primary.isEndpointConnected(endpoint) || this.secondary.isEndpointConnected(endpoint);
|
|
35
|
+
}
|
|
36
|
+
async addEndpoint(endpoint, payload) {
|
|
37
|
+
if (this.primary.isValidEndpointPayload(payload)) {
|
|
38
|
+
await this.primary.addEndpoint(endpoint, payload);
|
|
39
|
+
}
|
|
40
|
+
if (this.secondary.isValidEndpointPayload(payload)) {
|
|
41
|
+
await this.secondary.addEndpoint(endpoint, payload);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
receive(listener) {
|
|
45
|
+
this.primary.receive(listener);
|
|
46
|
+
this.secondary.receive(listener);
|
|
47
|
+
}
|
|
48
|
+
send(endpointId, action, payload) {
|
|
49
|
+
if (this.primary.isEndpointConnected(endpointId)) {
|
|
50
|
+
return this.primary.send(endpointId, action, payload);
|
|
51
|
+
}
|
|
52
|
+
return this.secondary.send(endpointId, action, payload);
|
|
53
|
+
}
|
|
54
|
+
async close() {
|
|
55
|
+
await Promise.all([this.primary.close(), this.secondary.close()]);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
exports.default = CombinedStrategy;
|
|
@@ -1,44 +1,44 @@
|
|
|
1
|
-
export interface ProtocolPacketBase {
|
|
2
|
-
version: number;
|
|
3
|
-
minimumVersion?: number;
|
|
4
|
-
type: string;
|
|
5
|
-
payload?: any;
|
|
6
|
-
}
|
|
7
|
-
export interface ClassicProtocolOffer extends ProtocolPacketBase {
|
|
8
|
-
type: 'classic';
|
|
9
|
-
}
|
|
10
|
-
export interface RTCProtocolOffer extends ProtocolPacketBase {
|
|
11
|
-
type: 'rtc';
|
|
12
|
-
payload: {
|
|
13
|
-
offer: RTCSessionDescriptionInit;
|
|
14
|
-
rtcConnectionId: string;
|
|
15
|
-
};
|
|
16
|
-
}
|
|
17
|
-
export declare type ProtocolOffer = ClassicProtocolOffer | RTCProtocolOffer;
|
|
18
|
-
export declare type MessagingProtocols = ProtocolOffer['type'];
|
|
19
|
-
export declare type LocalSupportedProtocol = {
|
|
20
|
-
type: MessagingProtocols;
|
|
21
|
-
minimumVersion: number;
|
|
22
|
-
version: number;
|
|
23
|
-
};
|
|
24
|
-
export interface ExternalClientOffer {
|
|
25
|
-
maxProtocols: number;
|
|
26
|
-
supportedProtocols: ProtocolPacketBase[];
|
|
27
|
-
}
|
|
28
|
-
export interface ClientOffer {
|
|
29
|
-
supportedProtocols: ProtocolOffer[];
|
|
30
|
-
maxProtocols: number;
|
|
31
|
-
}
|
|
32
|
-
export interface ClassicProtocolAnswer extends ProtocolPacketBase {
|
|
33
|
-
type: 'classic';
|
|
34
|
-
}
|
|
35
|
-
export interface RTCProtocolAnswer extends ProtocolPacketBase {
|
|
36
|
-
type: 'rtc';
|
|
37
|
-
payload: {
|
|
38
|
-
answer: RTCSessionDescriptionInit;
|
|
39
|
-
};
|
|
40
|
-
}
|
|
41
|
-
export declare type ProtocolAnswer = ClassicProtocolAnswer | RTCProtocolAnswer;
|
|
42
|
-
export interface ClientAnswer {
|
|
43
|
-
supportedProtocols: ProtocolAnswer[];
|
|
44
|
-
}
|
|
1
|
+
export interface ProtocolPacketBase {
|
|
2
|
+
version: number;
|
|
3
|
+
minimumVersion?: number;
|
|
4
|
+
type: string;
|
|
5
|
+
payload?: any;
|
|
6
|
+
}
|
|
7
|
+
export interface ClassicProtocolOffer extends ProtocolPacketBase {
|
|
8
|
+
type: 'classic';
|
|
9
|
+
}
|
|
10
|
+
export interface RTCProtocolOffer extends ProtocolPacketBase {
|
|
11
|
+
type: 'rtc';
|
|
12
|
+
payload: {
|
|
13
|
+
offer: RTCSessionDescriptionInit;
|
|
14
|
+
rtcConnectionId: string;
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
export declare type ProtocolOffer = ClassicProtocolOffer | RTCProtocolOffer;
|
|
18
|
+
export declare type MessagingProtocols = ProtocolOffer['type'];
|
|
19
|
+
export declare type LocalSupportedProtocol = {
|
|
20
|
+
type: MessagingProtocols;
|
|
21
|
+
minimumVersion: number;
|
|
22
|
+
version: number;
|
|
23
|
+
};
|
|
24
|
+
export interface ExternalClientOffer {
|
|
25
|
+
maxProtocols: number;
|
|
26
|
+
supportedProtocols: ProtocolPacketBase[];
|
|
27
|
+
}
|
|
28
|
+
export interface ClientOffer {
|
|
29
|
+
supportedProtocols: ProtocolOffer[];
|
|
30
|
+
maxProtocols: number;
|
|
31
|
+
}
|
|
32
|
+
export interface ClassicProtocolAnswer extends ProtocolPacketBase {
|
|
33
|
+
type: 'classic';
|
|
34
|
+
}
|
|
35
|
+
export interface RTCProtocolAnswer extends ProtocolPacketBase {
|
|
36
|
+
type: 'rtc';
|
|
37
|
+
payload: {
|
|
38
|
+
answer: RTCSessionDescriptionInit;
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
export declare type ProtocolAnswer = ClassicProtocolAnswer | RTCProtocolAnswer;
|
|
42
|
+
export interface ClientAnswer {
|
|
43
|
+
supportedProtocols: ProtocolAnswer[];
|
|
44
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { MessagingProtocols, ExternalClientOffer, ProtocolOffer, LocalSupportedProtocol } from '.';
|
|
2
|
-
export declare class ProtocolManager {
|
|
3
|
-
private ProtocolsInPreferenceOrder;
|
|
4
|
-
DefaultClientProtocols: ['classic'];
|
|
5
|
-
DefaultProviderProtocols: ['classic'];
|
|
6
|
-
constructor(ProtocolsInPreferenceOrder: MessagingProtocols[]);
|
|
7
|
-
getClientProtocols: (protocols?: string[]) => MessagingProtocols[];
|
|
8
|
-
getProviderProtocols: (protocols?: string[]) => ['rtc'] | ['rtc', 'classic'] | ['classic'];
|
|
9
|
-
getCompatibleProtocols: (providerProtocols: LocalSupportedProtocol[], clientOffer: ExternalClientOffer) => ProtocolOffer[];
|
|
10
|
-
}
|
|
1
|
+
import { MessagingProtocols, ExternalClientOffer, ProtocolOffer, LocalSupportedProtocol } from '.';
|
|
2
|
+
export declare class ProtocolManager {
|
|
3
|
+
private ProtocolsInPreferenceOrder;
|
|
4
|
+
DefaultClientProtocols: ['classic'];
|
|
5
|
+
DefaultProviderProtocols: ['classic'];
|
|
6
|
+
constructor(ProtocolsInPreferenceOrder: MessagingProtocols[]);
|
|
7
|
+
getClientProtocols: (protocols?: string[]) => MessagingProtocols[];
|
|
8
|
+
getProviderProtocols: (protocols?: string[]) => ['rtc'] | ['rtc', 'classic'] | ['classic'];
|
|
9
|
+
getCompatibleProtocols: (providerProtocols: LocalSupportedProtocol[], clientOffer: ExternalClientOffer) => ProtocolOffer[];
|
|
10
|
+
}
|
|
@@ -1,43 +1,43 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ProtocolManager = void 0;
|
|
4
|
-
/*
|
|
5
|
-
This should be agnostic of any actual openfin code to be unit testable.
|
|
6
|
-
Dependencies on the actual srategies should be handled in ConnectionManager
|
|
7
|
-
*/
|
|
8
|
-
class ProtocolManager {
|
|
9
|
-
// eslint-disable-next-line no-useless-constructor
|
|
10
|
-
constructor(ProtocolsInPreferenceOrder) {
|
|
11
|
-
this.ProtocolsInPreferenceOrder = ProtocolsInPreferenceOrder;
|
|
12
|
-
this.DefaultClientProtocols = ['classic'];
|
|
13
|
-
this.DefaultProviderProtocols = ['classic'];
|
|
14
|
-
this.getClientProtocols = (protocols) => {
|
|
15
|
-
const supported = protocols
|
|
16
|
-
? this.ProtocolsInPreferenceOrder.filter((x) => protocols.includes(x))
|
|
17
|
-
: this.DefaultClientProtocols;
|
|
18
|
-
if (!supported.length) {
|
|
19
|
-
throw new Error(`No valid protocols were passed in. Accepted values are: ${this.ProtocolsInPreferenceOrder.join(', ')}.`);
|
|
20
|
-
}
|
|
21
|
-
return supported;
|
|
22
|
-
};
|
|
23
|
-
this.getProviderProtocols = (protocols) => {
|
|
24
|
-
const supported = protocols
|
|
25
|
-
? this.ProtocolsInPreferenceOrder.filter((x) => protocols.includes(x))
|
|
26
|
-
: this.DefaultProviderProtocols;
|
|
27
|
-
if (!supported.length) {
|
|
28
|
-
throw new Error(`No valid protocols were passed in. Accepted values are: ${this.ProtocolsInPreferenceOrder.join(', ')}.`);
|
|
29
|
-
}
|
|
30
|
-
return supported;
|
|
31
|
-
};
|
|
32
|
-
this.getCompatibleProtocols = (providerProtocols, clientOffer) => {
|
|
33
|
-
const supported = clientOffer.supportedProtocols.filter((clientProtocol) => providerProtocols.some((providerProtocol) => {
|
|
34
|
-
var _a;
|
|
35
|
-
return providerProtocol.type === clientProtocol.type &&
|
|
36
|
-
clientProtocol.version >= providerProtocol.minimumVersion &&
|
|
37
|
-
providerProtocol.version >= ((_a = clientProtocol.minimumVersion) !== null && _a !== void 0 ? _a : 0);
|
|
38
|
-
}));
|
|
39
|
-
return supported.slice(0, clientOffer.maxProtocols);
|
|
40
|
-
};
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
exports.ProtocolManager = ProtocolManager;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ProtocolManager = void 0;
|
|
4
|
+
/*
|
|
5
|
+
This should be agnostic of any actual openfin code to be unit testable.
|
|
6
|
+
Dependencies on the actual srategies should be handled in ConnectionManager
|
|
7
|
+
*/
|
|
8
|
+
class ProtocolManager {
|
|
9
|
+
// eslint-disable-next-line no-useless-constructor
|
|
10
|
+
constructor(ProtocolsInPreferenceOrder) {
|
|
11
|
+
this.ProtocolsInPreferenceOrder = ProtocolsInPreferenceOrder;
|
|
12
|
+
this.DefaultClientProtocols = ['classic'];
|
|
13
|
+
this.DefaultProviderProtocols = ['classic'];
|
|
14
|
+
this.getClientProtocols = (protocols) => {
|
|
15
|
+
const supported = protocols
|
|
16
|
+
? this.ProtocolsInPreferenceOrder.filter((x) => protocols.includes(x))
|
|
17
|
+
: this.DefaultClientProtocols;
|
|
18
|
+
if (!supported.length) {
|
|
19
|
+
throw new Error(`No valid protocols were passed in. Accepted values are: ${this.ProtocolsInPreferenceOrder.join(', ')}.`);
|
|
20
|
+
}
|
|
21
|
+
return supported;
|
|
22
|
+
};
|
|
23
|
+
this.getProviderProtocols = (protocols) => {
|
|
24
|
+
const supported = protocols
|
|
25
|
+
? this.ProtocolsInPreferenceOrder.filter((x) => protocols.includes(x))
|
|
26
|
+
: this.DefaultProviderProtocols;
|
|
27
|
+
if (!supported.length) {
|
|
28
|
+
throw new Error(`No valid protocols were passed in. Accepted values are: ${this.ProtocolsInPreferenceOrder.join(', ')}.`);
|
|
29
|
+
}
|
|
30
|
+
return supported;
|
|
31
|
+
};
|
|
32
|
+
this.getCompatibleProtocols = (providerProtocols, clientOffer) => {
|
|
33
|
+
const supported = clientOffer.supportedProtocols.filter((clientProtocol) => providerProtocols.some((providerProtocol) => {
|
|
34
|
+
var _a;
|
|
35
|
+
return providerProtocol.type === clientProtocol.type &&
|
|
36
|
+
clientProtocol.version >= providerProtocol.minimumVersion &&
|
|
37
|
+
providerProtocol.version >= ((_a = clientProtocol.minimumVersion) !== null && _a !== void 0 ? _a : 0);
|
|
38
|
+
}));
|
|
39
|
+
return supported.slice(0, clientOffer.maxProtocols);
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
exports.ProtocolManager = ProtocolManager;
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import ProviderIdentity = OpenFin.ProviderIdentity;
|
|
2
|
-
export interface RTCEndpointChannels {
|
|
3
|
-
request: RTCDataChannel;
|
|
4
|
-
response: RTCDataChannel;
|
|
5
|
-
}
|
|
6
|
-
export interface RTCPacket {
|
|
7
|
-
rtcClient: RTCPeerConnection;
|
|
8
|
-
channels: RTCEndpointChannels;
|
|
9
|
-
channelsOpened: Promise<void>;
|
|
10
|
-
}
|
|
11
|
-
export declare class RTCEndpoint {
|
|
12
|
-
#private;
|
|
13
|
-
private rtc;
|
|
14
|
-
private endpointIdentity;
|
|
15
|
-
private responseMap;
|
|
16
|
-
constructor(rtc: RTCPacket, endpointIdentity: OpenFin.ClientIdentity | ProviderIdentity);
|
|
17
|
-
private connectionStateChangeHandler;
|
|
18
|
-
onDisconnect(listener: () => void): void;
|
|
19
|
-
receive(listener: (action: string, payload: any, identity: OpenFin.ClientIdentity | ProviderIdentity) => Promise<any>): void;
|
|
20
|
-
send: (action: string, payload: any) => Promise<any>;
|
|
21
|
-
close: () => void;
|
|
22
|
-
get connected(): boolean;
|
|
23
|
-
}
|
|
1
|
+
import ProviderIdentity = OpenFin.ProviderIdentity;
|
|
2
|
+
export interface RTCEndpointChannels {
|
|
3
|
+
request: RTCDataChannel;
|
|
4
|
+
response: RTCDataChannel;
|
|
5
|
+
}
|
|
6
|
+
export interface RTCPacket {
|
|
7
|
+
rtcClient: RTCPeerConnection;
|
|
8
|
+
channels: RTCEndpointChannels;
|
|
9
|
+
channelsOpened: Promise<void>;
|
|
10
|
+
}
|
|
11
|
+
export declare class RTCEndpoint {
|
|
12
|
+
#private;
|
|
13
|
+
private rtc;
|
|
14
|
+
private endpointIdentity;
|
|
15
|
+
private responseMap;
|
|
16
|
+
constructor(rtc: RTCPacket, endpointIdentity: OpenFin.ClientIdentity | ProviderIdentity);
|
|
17
|
+
private connectionStateChangeHandler;
|
|
18
|
+
onDisconnect(listener: () => void): void;
|
|
19
|
+
receive(listener: (action: string, payload: any, identity: OpenFin.ClientIdentity | ProviderIdentity) => Promise<any>): void;
|
|
20
|
+
send: (action: string, payload: any) => Promise<any>;
|
|
21
|
+
close: () => void;
|
|
22
|
+
get connected(): boolean;
|
|
23
|
+
}
|