@openfin/fdc3-api 47.100.26 → 47.100.29
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/out/fdc3-api-alpha.d.ts +87 -11
- package/out/fdc3-api-beta.d.ts +87 -11
- package/out/fdc3-api-public.d.ts +87 -11
- package/out/fdc3-api.d.ts +109 -18
- package/package.json +1 -1
package/out/fdc3-api-alpha.d.ts
CHANGED
|
@@ -2755,12 +2755,9 @@ declare class ChannelBase {
|
|
|
2755
2755
|
*/
|
|
2756
2756
|
declare class ChannelClient extends ChannelBase {
|
|
2757
2757
|
#private;
|
|
2758
|
-
private disconnectListener;
|
|
2759
|
-
private endpointId;
|
|
2760
|
-
/* Excluded from this release type: closeChannelByEndpointId */
|
|
2761
|
-
/* Excluded from this release type: handleProviderDisconnect */
|
|
2762
2758
|
/* Excluded from this release type: __constructor */
|
|
2763
2759
|
protected processAction: (action: string, payload: any, senderIdentity: OpenFin.ProviderIdentity | OpenFin.ClientIdentity) => Promise<any>;
|
|
2760
|
+
/* Excluded from this release type: [teardown] */
|
|
2764
2761
|
/**
|
|
2765
2762
|
* a read-only provider identity
|
|
2766
2763
|
*/
|
|
@@ -2792,8 +2789,8 @@ declare class ChannelClient extends ChannelBase {
|
|
|
2792
2789
|
*/
|
|
2793
2790
|
dispatch(action: string, payload?: any): Promise<any>;
|
|
2794
2791
|
/**
|
|
2795
|
-
* Register a listener that is called
|
|
2796
|
-
*
|
|
2792
|
+
* Register a listener that is called when this client loses its channel: the provider disconnects, the
|
|
2793
|
+
* endpoint drops, or a self-heal fails. It is passed the provider identity.
|
|
2797
2794
|
*
|
|
2798
2795
|
* @param listener
|
|
2799
2796
|
*
|
|
@@ -2810,6 +2807,43 @@ declare class ChannelClient extends ChannelBase {
|
|
|
2810
2807
|
* ```
|
|
2811
2808
|
*/
|
|
2812
2809
|
onDisconnection(listener: OpenFin.ChannelProviderDisconnectionListener): void;
|
|
2810
|
+
/**
|
|
2811
|
+
* Register a listener that is called each time this client transparently self-heals its connection to the
|
|
2812
|
+
* provider.
|
|
2813
|
+
*
|
|
2814
|
+
* @remarks
|
|
2815
|
+
* A channel client's underlying endpoint is torn down while its document sits in the back/forward cache
|
|
2816
|
+
* (bfcache). If the back/forward cache is supported and the document is restored from it, the client
|
|
2817
|
+
* automatically re-handshakes with the provider and swaps in a fresh endpoint; all of this client's
|
|
2818
|
+
* `register`/middleware handlers are preserved, so no re-registration is required.
|
|
2819
|
+
*
|
|
2820
|
+
* A restore is not guaranteed: Chromium may evict a cached document at any time, in which case navigating
|
|
2821
|
+
* back reloads the page and a new client must connect.
|
|
2822
|
+
*
|
|
2823
|
+
* This listener fires once per successful reconnect, after the new endpoint is live, and can fire multiple
|
|
2824
|
+
* times over the client's lifetime. It is triggered when the document is restored from the back/forward
|
|
2825
|
+
* cache (a bfcache `pageshow`). It does not fire for the initial connection, nor after
|
|
2826
|
+
* {@link ChannelClient#disconnect disconnect}. {@link ChannelClient#onDisconnection onDisconnection} fires
|
|
2827
|
+
* when the provider or endpoint goes away.
|
|
2828
|
+
*
|
|
2829
|
+
* The info provides the reconnected {@link OpenFin.ProviderIdentity provider identity} along with
|
|
2830
|
+
* the previous and new endpoint ids.
|
|
2831
|
+
*
|
|
2832
|
+
* @param listener
|
|
2833
|
+
*
|
|
2834
|
+
* @example
|
|
2835
|
+
*
|
|
2836
|
+
* ```js
|
|
2837
|
+
* (async () => {
|
|
2838
|
+
* const client = await fin.InterApplicationBus.Channel.connect('channelName');
|
|
2839
|
+
*
|
|
2840
|
+
* client.onReconnection(({ providerIdentity, previousEndpointId, endpointId }) => {
|
|
2841
|
+
* console.log(`Reconnected to ${providerIdentity.channelName}: ${previousEndpointId} -> ${endpointId}`);
|
|
2842
|
+
* });
|
|
2843
|
+
* })();
|
|
2844
|
+
* ```
|
|
2845
|
+
*/
|
|
2846
|
+
onReconnection(listener: OpenFin.ChannelClientReconnectionListener): void;
|
|
2813
2847
|
/**
|
|
2814
2848
|
* Disconnects the client from the channel.
|
|
2815
2849
|
*
|
|
@@ -2824,16 +2858,42 @@ declare class ChannelClient extends ChannelBase {
|
|
|
2824
2858
|
* ```
|
|
2825
2859
|
*/
|
|
2826
2860
|
disconnect(): Promise<void>;
|
|
2827
|
-
|
|
2828
|
-
/* Excluded from this release type: wireClose */
|
|
2861
|
+
/* Excluded from this release type: sendDisconnectAction */
|
|
2829
2862
|
}
|
|
2830
2863
|
|
|
2831
2864
|
declare type ChannelClient_2 = OpenFin.ChannelClient;
|
|
2832
2865
|
|
|
2866
|
+
/* Excluded from this release type: ChannelClientConfig */
|
|
2867
|
+
|
|
2833
2868
|
declare type ChannelClientConnectionListener = (identity: ClientIdentity, connectionMessage?: any) => Promise<any> | any;
|
|
2834
2869
|
|
|
2835
2870
|
declare type ChannelClientDisconnectionListener = (identity: ClientIdentity) => any;
|
|
2836
2871
|
|
|
2872
|
+
/**
|
|
2873
|
+
* Info passed to a {@link ChannelClient.onReconnection} listener when a channel client
|
|
2874
|
+
* re-establishes its connection to the provider after its endpoint was torn down.
|
|
2875
|
+
*/
|
|
2876
|
+
declare type ChannelClientReconnectionInfo = {
|
|
2877
|
+
/** Identity of the provider this client re-established its connection to. */
|
|
2878
|
+
providerIdentity: ProviderIdentity_4;
|
|
2879
|
+
/** The client's endpoint id before the reconnect (now torn down). */
|
|
2880
|
+
previousEndpointId: string;
|
|
2881
|
+
/** The client's endpoint id after the reconnect. */
|
|
2882
|
+
endpointId: string;
|
|
2883
|
+
};
|
|
2884
|
+
|
|
2885
|
+
/**
|
|
2886
|
+
* Listener registered via {@link ChannelClient.onReconnection}, called once each time the client self-heals its
|
|
2887
|
+
* connection to the provider.
|
|
2888
|
+
*
|
|
2889
|
+
* Currently, this will only occur during a [bfcache](https://developer.mozilla.org/en-US/docs/Glossary/bfcache) Restore.
|
|
2890
|
+
*
|
|
2891
|
+
* For example, if the Channel Client belongs to a Window / View that is compatible with the bfcache, and
|
|
2892
|
+
* the Window / View is navigated away from and then back to using the history API, the Channel Client will re-establish its connection to the provider if it still
|
|
2893
|
+
* exists.
|
|
2894
|
+
*/
|
|
2895
|
+
declare type ChannelClientReconnectionListener = (info: ChannelClientReconnectionInfo) => void;
|
|
2896
|
+
|
|
2837
2897
|
/**
|
|
2838
2898
|
* Options provided on a client connection to a channel.
|
|
2839
2899
|
*
|
|
@@ -5253,6 +5313,8 @@ declare type EndLoadEvent = BaseEvent_5 & {
|
|
|
5253
5313
|
isMain: boolean;
|
|
5254
5314
|
};
|
|
5255
5315
|
|
|
5316
|
+
/* Excluded from this release type: EndpointConnectionInstance */
|
|
5317
|
+
|
|
5256
5318
|
/**
|
|
5257
5319
|
* Generated at the end of a user-driven change to a window's size or position.
|
|
5258
5320
|
*
|
|
@@ -7364,6 +7426,11 @@ declare class InterApplicationBus extends Base {
|
|
|
7364
7426
|
subscriberRemoved: string;
|
|
7365
7427
|
};
|
|
7366
7428
|
private refCounter;
|
|
7429
|
+
/**
|
|
7430
|
+
* One entry per subscription the runtime knows about, keyed by the same subscription key the
|
|
7431
|
+
* emitter and the ref counter use. Listeners sharing a key share a single entry.
|
|
7432
|
+
*/
|
|
7433
|
+
private activeSubscriptions;
|
|
7367
7434
|
protected emitter: EventEmitter;
|
|
7368
7435
|
on: any;
|
|
7369
7436
|
removeAllListeners: any;
|
|
@@ -7403,16 +7470,21 @@ declare class InterApplicationBus extends Base {
|
|
|
7403
7470
|
* Subscribes to messages from the specified application on the specified topic.
|
|
7404
7471
|
* @param source This object is described in the Identity in the typedef
|
|
7405
7472
|
* @param topic The topic on which the message is sent
|
|
7406
|
-
* @param listener A function that is called when a message has
|
|
7407
|
-
*
|
|
7473
|
+
* @param listener A function that is called when a message has been received. It is passed
|
|
7474
|
+
* two arguments: the message, and the identity (`{ uuid, name }`) of the sender.
|
|
7408
7475
|
* The message can be either a primitive data type (string, number, or boolean) or
|
|
7409
7476
|
* composite data type (object, array) that is composed of other primitive or composite
|
|
7410
7477
|
* data types
|
|
7411
7478
|
*
|
|
7479
|
+
* @remarks This differs from the legacy `fin.desktop.InterApplicationBus.subscribe` API,
|
|
7480
|
+
* which passes `(message, uuid, name)` as separate arguments.
|
|
7481
|
+
*
|
|
7412
7482
|
* @example
|
|
7413
7483
|
* ```js
|
|
7414
7484
|
* // subscribe to a specified application
|
|
7415
|
-
* fin.InterApplicationBus.subscribe(fin.me, 'topic',
|
|
7485
|
+
* fin.InterApplicationBus.subscribe(fin.me, 'topic', (message, sender) => {
|
|
7486
|
+
* console.log(`Received from ${sender.uuid}/${sender.name}:`, message);
|
|
7487
|
+
* }).then(() => console.log('Subscribed to the specified application')).catch(err => console.log(err));
|
|
7416
7488
|
*
|
|
7417
7489
|
* // subscribe to wildcard
|
|
7418
7490
|
* fin.InterApplicationBus.subscribe({ uuid: '*' }, 'topic', sub_msg => console.log(sub_msg)).then(() => console.log('Subscribed to *')).catch(err => console.log(err));
|
|
@@ -11399,6 +11471,8 @@ declare namespace OpenFin {
|
|
|
11399
11471
|
ChannelClientConnectionListener,
|
|
11400
11472
|
ChannelClientDisconnectionListener,
|
|
11401
11473
|
ChannelProviderDisconnectionListener,
|
|
11474
|
+
ChannelClientReconnectionInfo,
|
|
11475
|
+
ChannelClientReconnectionListener,
|
|
11402
11476
|
RoutingInfo,
|
|
11403
11477
|
DownloadShelfOptions,
|
|
11404
11478
|
SnapZoneOptions,
|
|
@@ -17806,6 +17880,8 @@ declare type TaskBar = DipScaleRects & {
|
|
|
17806
17880
|
rect: RectangleByEdgePositions;
|
|
17807
17881
|
};
|
|
17808
17882
|
|
|
17883
|
+
declare const teardown: unique symbol;
|
|
17884
|
+
|
|
17809
17885
|
/**
|
|
17810
17886
|
* @interface
|
|
17811
17887
|
*/
|
package/out/fdc3-api-beta.d.ts
CHANGED
|
@@ -2755,12 +2755,9 @@ declare class ChannelBase {
|
|
|
2755
2755
|
*/
|
|
2756
2756
|
declare class ChannelClient extends ChannelBase {
|
|
2757
2757
|
#private;
|
|
2758
|
-
private disconnectListener;
|
|
2759
|
-
private endpointId;
|
|
2760
|
-
/* Excluded from this release type: closeChannelByEndpointId */
|
|
2761
|
-
/* Excluded from this release type: handleProviderDisconnect */
|
|
2762
2758
|
/* Excluded from this release type: __constructor */
|
|
2763
2759
|
protected processAction: (action: string, payload: any, senderIdentity: OpenFin.ProviderIdentity | OpenFin.ClientIdentity) => Promise<any>;
|
|
2760
|
+
/* Excluded from this release type: [teardown] */
|
|
2764
2761
|
/**
|
|
2765
2762
|
* a read-only provider identity
|
|
2766
2763
|
*/
|
|
@@ -2792,8 +2789,8 @@ declare class ChannelClient extends ChannelBase {
|
|
|
2792
2789
|
*/
|
|
2793
2790
|
dispatch(action: string, payload?: any): Promise<any>;
|
|
2794
2791
|
/**
|
|
2795
|
-
* Register a listener that is called
|
|
2796
|
-
*
|
|
2792
|
+
* Register a listener that is called when this client loses its channel: the provider disconnects, the
|
|
2793
|
+
* endpoint drops, or a self-heal fails. It is passed the provider identity.
|
|
2797
2794
|
*
|
|
2798
2795
|
* @param listener
|
|
2799
2796
|
*
|
|
@@ -2810,6 +2807,43 @@ declare class ChannelClient extends ChannelBase {
|
|
|
2810
2807
|
* ```
|
|
2811
2808
|
*/
|
|
2812
2809
|
onDisconnection(listener: OpenFin.ChannelProviderDisconnectionListener): void;
|
|
2810
|
+
/**
|
|
2811
|
+
* Register a listener that is called each time this client transparently self-heals its connection to the
|
|
2812
|
+
* provider.
|
|
2813
|
+
*
|
|
2814
|
+
* @remarks
|
|
2815
|
+
* A channel client's underlying endpoint is torn down while its document sits in the back/forward cache
|
|
2816
|
+
* (bfcache). If the back/forward cache is supported and the document is restored from it, the client
|
|
2817
|
+
* automatically re-handshakes with the provider and swaps in a fresh endpoint; all of this client's
|
|
2818
|
+
* `register`/middleware handlers are preserved, so no re-registration is required.
|
|
2819
|
+
*
|
|
2820
|
+
* A restore is not guaranteed: Chromium may evict a cached document at any time, in which case navigating
|
|
2821
|
+
* back reloads the page and a new client must connect.
|
|
2822
|
+
*
|
|
2823
|
+
* This listener fires once per successful reconnect, after the new endpoint is live, and can fire multiple
|
|
2824
|
+
* times over the client's lifetime. It is triggered when the document is restored from the back/forward
|
|
2825
|
+
* cache (a bfcache `pageshow`). It does not fire for the initial connection, nor after
|
|
2826
|
+
* {@link ChannelClient#disconnect disconnect}. {@link ChannelClient#onDisconnection onDisconnection} fires
|
|
2827
|
+
* when the provider or endpoint goes away.
|
|
2828
|
+
*
|
|
2829
|
+
* The info provides the reconnected {@link OpenFin.ProviderIdentity provider identity} along with
|
|
2830
|
+
* the previous and new endpoint ids.
|
|
2831
|
+
*
|
|
2832
|
+
* @param listener
|
|
2833
|
+
*
|
|
2834
|
+
* @example
|
|
2835
|
+
*
|
|
2836
|
+
* ```js
|
|
2837
|
+
* (async () => {
|
|
2838
|
+
* const client = await fin.InterApplicationBus.Channel.connect('channelName');
|
|
2839
|
+
*
|
|
2840
|
+
* client.onReconnection(({ providerIdentity, previousEndpointId, endpointId }) => {
|
|
2841
|
+
* console.log(`Reconnected to ${providerIdentity.channelName}: ${previousEndpointId} -> ${endpointId}`);
|
|
2842
|
+
* });
|
|
2843
|
+
* })();
|
|
2844
|
+
* ```
|
|
2845
|
+
*/
|
|
2846
|
+
onReconnection(listener: OpenFin.ChannelClientReconnectionListener): void;
|
|
2813
2847
|
/**
|
|
2814
2848
|
* Disconnects the client from the channel.
|
|
2815
2849
|
*
|
|
@@ -2824,16 +2858,42 @@ declare class ChannelClient extends ChannelBase {
|
|
|
2824
2858
|
* ```
|
|
2825
2859
|
*/
|
|
2826
2860
|
disconnect(): Promise<void>;
|
|
2827
|
-
|
|
2828
|
-
/* Excluded from this release type: wireClose */
|
|
2861
|
+
/* Excluded from this release type: sendDisconnectAction */
|
|
2829
2862
|
}
|
|
2830
2863
|
|
|
2831
2864
|
declare type ChannelClient_2 = OpenFin.ChannelClient;
|
|
2832
2865
|
|
|
2866
|
+
/* Excluded from this release type: ChannelClientConfig */
|
|
2867
|
+
|
|
2833
2868
|
declare type ChannelClientConnectionListener = (identity: ClientIdentity, connectionMessage?: any) => Promise<any> | any;
|
|
2834
2869
|
|
|
2835
2870
|
declare type ChannelClientDisconnectionListener = (identity: ClientIdentity) => any;
|
|
2836
2871
|
|
|
2872
|
+
/**
|
|
2873
|
+
* Info passed to a {@link ChannelClient.onReconnection} listener when a channel client
|
|
2874
|
+
* re-establishes its connection to the provider after its endpoint was torn down.
|
|
2875
|
+
*/
|
|
2876
|
+
declare type ChannelClientReconnectionInfo = {
|
|
2877
|
+
/** Identity of the provider this client re-established its connection to. */
|
|
2878
|
+
providerIdentity: ProviderIdentity_4;
|
|
2879
|
+
/** The client's endpoint id before the reconnect (now torn down). */
|
|
2880
|
+
previousEndpointId: string;
|
|
2881
|
+
/** The client's endpoint id after the reconnect. */
|
|
2882
|
+
endpointId: string;
|
|
2883
|
+
};
|
|
2884
|
+
|
|
2885
|
+
/**
|
|
2886
|
+
* Listener registered via {@link ChannelClient.onReconnection}, called once each time the client self-heals its
|
|
2887
|
+
* connection to the provider.
|
|
2888
|
+
*
|
|
2889
|
+
* Currently, this will only occur during a [bfcache](https://developer.mozilla.org/en-US/docs/Glossary/bfcache) Restore.
|
|
2890
|
+
*
|
|
2891
|
+
* For example, if the Channel Client belongs to a Window / View that is compatible with the bfcache, and
|
|
2892
|
+
* the Window / View is navigated away from and then back to using the history API, the Channel Client will re-establish its connection to the provider if it still
|
|
2893
|
+
* exists.
|
|
2894
|
+
*/
|
|
2895
|
+
declare type ChannelClientReconnectionListener = (info: ChannelClientReconnectionInfo) => void;
|
|
2896
|
+
|
|
2837
2897
|
/**
|
|
2838
2898
|
* Options provided on a client connection to a channel.
|
|
2839
2899
|
*
|
|
@@ -5253,6 +5313,8 @@ declare type EndLoadEvent = BaseEvent_5 & {
|
|
|
5253
5313
|
isMain: boolean;
|
|
5254
5314
|
};
|
|
5255
5315
|
|
|
5316
|
+
/* Excluded from this release type: EndpointConnectionInstance */
|
|
5317
|
+
|
|
5256
5318
|
/**
|
|
5257
5319
|
* Generated at the end of a user-driven change to a window's size or position.
|
|
5258
5320
|
*
|
|
@@ -7364,6 +7426,11 @@ declare class InterApplicationBus extends Base {
|
|
|
7364
7426
|
subscriberRemoved: string;
|
|
7365
7427
|
};
|
|
7366
7428
|
private refCounter;
|
|
7429
|
+
/**
|
|
7430
|
+
* One entry per subscription the runtime knows about, keyed by the same subscription key the
|
|
7431
|
+
* emitter and the ref counter use. Listeners sharing a key share a single entry.
|
|
7432
|
+
*/
|
|
7433
|
+
private activeSubscriptions;
|
|
7367
7434
|
protected emitter: EventEmitter;
|
|
7368
7435
|
on: any;
|
|
7369
7436
|
removeAllListeners: any;
|
|
@@ -7403,16 +7470,21 @@ declare class InterApplicationBus extends Base {
|
|
|
7403
7470
|
* Subscribes to messages from the specified application on the specified topic.
|
|
7404
7471
|
* @param source This object is described in the Identity in the typedef
|
|
7405
7472
|
* @param topic The topic on which the message is sent
|
|
7406
|
-
* @param listener A function that is called when a message has
|
|
7407
|
-
*
|
|
7473
|
+
* @param listener A function that is called when a message has been received. It is passed
|
|
7474
|
+
* two arguments: the message, and the identity (`{ uuid, name }`) of the sender.
|
|
7408
7475
|
* The message can be either a primitive data type (string, number, or boolean) or
|
|
7409
7476
|
* composite data type (object, array) that is composed of other primitive or composite
|
|
7410
7477
|
* data types
|
|
7411
7478
|
*
|
|
7479
|
+
* @remarks This differs from the legacy `fin.desktop.InterApplicationBus.subscribe` API,
|
|
7480
|
+
* which passes `(message, uuid, name)` as separate arguments.
|
|
7481
|
+
*
|
|
7412
7482
|
* @example
|
|
7413
7483
|
* ```js
|
|
7414
7484
|
* // subscribe to a specified application
|
|
7415
|
-
* fin.InterApplicationBus.subscribe(fin.me, 'topic',
|
|
7485
|
+
* fin.InterApplicationBus.subscribe(fin.me, 'topic', (message, sender) => {
|
|
7486
|
+
* console.log(`Received from ${sender.uuid}/${sender.name}:`, message);
|
|
7487
|
+
* }).then(() => console.log('Subscribed to the specified application')).catch(err => console.log(err));
|
|
7416
7488
|
*
|
|
7417
7489
|
* // subscribe to wildcard
|
|
7418
7490
|
* fin.InterApplicationBus.subscribe({ uuid: '*' }, 'topic', sub_msg => console.log(sub_msg)).then(() => console.log('Subscribed to *')).catch(err => console.log(err));
|
|
@@ -11399,6 +11471,8 @@ declare namespace OpenFin {
|
|
|
11399
11471
|
ChannelClientConnectionListener,
|
|
11400
11472
|
ChannelClientDisconnectionListener,
|
|
11401
11473
|
ChannelProviderDisconnectionListener,
|
|
11474
|
+
ChannelClientReconnectionInfo,
|
|
11475
|
+
ChannelClientReconnectionListener,
|
|
11402
11476
|
RoutingInfo,
|
|
11403
11477
|
DownloadShelfOptions,
|
|
11404
11478
|
SnapZoneOptions,
|
|
@@ -17806,6 +17880,8 @@ declare type TaskBar = DipScaleRects & {
|
|
|
17806
17880
|
rect: RectangleByEdgePositions;
|
|
17807
17881
|
};
|
|
17808
17882
|
|
|
17883
|
+
declare const teardown: unique symbol;
|
|
17884
|
+
|
|
17809
17885
|
/**
|
|
17810
17886
|
* @interface
|
|
17811
17887
|
*/
|
package/out/fdc3-api-public.d.ts
CHANGED
|
@@ -2755,12 +2755,9 @@ declare class ChannelBase {
|
|
|
2755
2755
|
*/
|
|
2756
2756
|
declare class ChannelClient extends ChannelBase {
|
|
2757
2757
|
#private;
|
|
2758
|
-
private disconnectListener;
|
|
2759
|
-
private endpointId;
|
|
2760
|
-
/* Excluded from this release type: closeChannelByEndpointId */
|
|
2761
|
-
/* Excluded from this release type: handleProviderDisconnect */
|
|
2762
2758
|
/* Excluded from this release type: __constructor */
|
|
2763
2759
|
protected processAction: (action: string, payload: any, senderIdentity: OpenFin.ProviderIdentity | OpenFin.ClientIdentity) => Promise<any>;
|
|
2760
|
+
/* Excluded from this release type: [teardown] */
|
|
2764
2761
|
/**
|
|
2765
2762
|
* a read-only provider identity
|
|
2766
2763
|
*/
|
|
@@ -2792,8 +2789,8 @@ declare class ChannelClient extends ChannelBase {
|
|
|
2792
2789
|
*/
|
|
2793
2790
|
dispatch(action: string, payload?: any): Promise<any>;
|
|
2794
2791
|
/**
|
|
2795
|
-
* Register a listener that is called
|
|
2796
|
-
*
|
|
2792
|
+
* Register a listener that is called when this client loses its channel: the provider disconnects, the
|
|
2793
|
+
* endpoint drops, or a self-heal fails. It is passed the provider identity.
|
|
2797
2794
|
*
|
|
2798
2795
|
* @param listener
|
|
2799
2796
|
*
|
|
@@ -2810,6 +2807,43 @@ declare class ChannelClient extends ChannelBase {
|
|
|
2810
2807
|
* ```
|
|
2811
2808
|
*/
|
|
2812
2809
|
onDisconnection(listener: OpenFin.ChannelProviderDisconnectionListener): void;
|
|
2810
|
+
/**
|
|
2811
|
+
* Register a listener that is called each time this client transparently self-heals its connection to the
|
|
2812
|
+
* provider.
|
|
2813
|
+
*
|
|
2814
|
+
* @remarks
|
|
2815
|
+
* A channel client's underlying endpoint is torn down while its document sits in the back/forward cache
|
|
2816
|
+
* (bfcache). If the back/forward cache is supported and the document is restored from it, the client
|
|
2817
|
+
* automatically re-handshakes with the provider and swaps in a fresh endpoint; all of this client's
|
|
2818
|
+
* `register`/middleware handlers are preserved, so no re-registration is required.
|
|
2819
|
+
*
|
|
2820
|
+
* A restore is not guaranteed: Chromium may evict a cached document at any time, in which case navigating
|
|
2821
|
+
* back reloads the page and a new client must connect.
|
|
2822
|
+
*
|
|
2823
|
+
* This listener fires once per successful reconnect, after the new endpoint is live, and can fire multiple
|
|
2824
|
+
* times over the client's lifetime. It is triggered when the document is restored from the back/forward
|
|
2825
|
+
* cache (a bfcache `pageshow`). It does not fire for the initial connection, nor after
|
|
2826
|
+
* {@link ChannelClient#disconnect disconnect}. {@link ChannelClient#onDisconnection onDisconnection} fires
|
|
2827
|
+
* when the provider or endpoint goes away.
|
|
2828
|
+
*
|
|
2829
|
+
* The info provides the reconnected {@link OpenFin.ProviderIdentity provider identity} along with
|
|
2830
|
+
* the previous and new endpoint ids.
|
|
2831
|
+
*
|
|
2832
|
+
* @param listener
|
|
2833
|
+
*
|
|
2834
|
+
* @example
|
|
2835
|
+
*
|
|
2836
|
+
* ```js
|
|
2837
|
+
* (async () => {
|
|
2838
|
+
* const client = await fin.InterApplicationBus.Channel.connect('channelName');
|
|
2839
|
+
*
|
|
2840
|
+
* client.onReconnection(({ providerIdentity, previousEndpointId, endpointId }) => {
|
|
2841
|
+
* console.log(`Reconnected to ${providerIdentity.channelName}: ${previousEndpointId} -> ${endpointId}`);
|
|
2842
|
+
* });
|
|
2843
|
+
* })();
|
|
2844
|
+
* ```
|
|
2845
|
+
*/
|
|
2846
|
+
onReconnection(listener: OpenFin.ChannelClientReconnectionListener): void;
|
|
2813
2847
|
/**
|
|
2814
2848
|
* Disconnects the client from the channel.
|
|
2815
2849
|
*
|
|
@@ -2824,16 +2858,42 @@ declare class ChannelClient extends ChannelBase {
|
|
|
2824
2858
|
* ```
|
|
2825
2859
|
*/
|
|
2826
2860
|
disconnect(): Promise<void>;
|
|
2827
|
-
|
|
2828
|
-
/* Excluded from this release type: wireClose */
|
|
2861
|
+
/* Excluded from this release type: sendDisconnectAction */
|
|
2829
2862
|
}
|
|
2830
2863
|
|
|
2831
2864
|
declare type ChannelClient_2 = OpenFin.ChannelClient;
|
|
2832
2865
|
|
|
2866
|
+
/* Excluded from this release type: ChannelClientConfig */
|
|
2867
|
+
|
|
2833
2868
|
declare type ChannelClientConnectionListener = (identity: ClientIdentity, connectionMessage?: any) => Promise<any> | any;
|
|
2834
2869
|
|
|
2835
2870
|
declare type ChannelClientDisconnectionListener = (identity: ClientIdentity) => any;
|
|
2836
2871
|
|
|
2872
|
+
/**
|
|
2873
|
+
* Info passed to a {@link ChannelClient.onReconnection} listener when a channel client
|
|
2874
|
+
* re-establishes its connection to the provider after its endpoint was torn down.
|
|
2875
|
+
*/
|
|
2876
|
+
declare type ChannelClientReconnectionInfo = {
|
|
2877
|
+
/** Identity of the provider this client re-established its connection to. */
|
|
2878
|
+
providerIdentity: ProviderIdentity_4;
|
|
2879
|
+
/** The client's endpoint id before the reconnect (now torn down). */
|
|
2880
|
+
previousEndpointId: string;
|
|
2881
|
+
/** The client's endpoint id after the reconnect. */
|
|
2882
|
+
endpointId: string;
|
|
2883
|
+
};
|
|
2884
|
+
|
|
2885
|
+
/**
|
|
2886
|
+
* Listener registered via {@link ChannelClient.onReconnection}, called once each time the client self-heals its
|
|
2887
|
+
* connection to the provider.
|
|
2888
|
+
*
|
|
2889
|
+
* Currently, this will only occur during a [bfcache](https://developer.mozilla.org/en-US/docs/Glossary/bfcache) Restore.
|
|
2890
|
+
*
|
|
2891
|
+
* For example, if the Channel Client belongs to a Window / View that is compatible with the bfcache, and
|
|
2892
|
+
* the Window / View is navigated away from and then back to using the history API, the Channel Client will re-establish its connection to the provider if it still
|
|
2893
|
+
* exists.
|
|
2894
|
+
*/
|
|
2895
|
+
declare type ChannelClientReconnectionListener = (info: ChannelClientReconnectionInfo) => void;
|
|
2896
|
+
|
|
2837
2897
|
/**
|
|
2838
2898
|
* Options provided on a client connection to a channel.
|
|
2839
2899
|
*
|
|
@@ -5253,6 +5313,8 @@ declare type EndLoadEvent = BaseEvent_5 & {
|
|
|
5253
5313
|
isMain: boolean;
|
|
5254
5314
|
};
|
|
5255
5315
|
|
|
5316
|
+
/* Excluded from this release type: EndpointConnectionInstance */
|
|
5317
|
+
|
|
5256
5318
|
/**
|
|
5257
5319
|
* Generated at the end of a user-driven change to a window's size or position.
|
|
5258
5320
|
*
|
|
@@ -7364,6 +7426,11 @@ declare class InterApplicationBus extends Base {
|
|
|
7364
7426
|
subscriberRemoved: string;
|
|
7365
7427
|
};
|
|
7366
7428
|
private refCounter;
|
|
7429
|
+
/**
|
|
7430
|
+
* One entry per subscription the runtime knows about, keyed by the same subscription key the
|
|
7431
|
+
* emitter and the ref counter use. Listeners sharing a key share a single entry.
|
|
7432
|
+
*/
|
|
7433
|
+
private activeSubscriptions;
|
|
7367
7434
|
protected emitter: EventEmitter;
|
|
7368
7435
|
on: any;
|
|
7369
7436
|
removeAllListeners: any;
|
|
@@ -7403,16 +7470,21 @@ declare class InterApplicationBus extends Base {
|
|
|
7403
7470
|
* Subscribes to messages from the specified application on the specified topic.
|
|
7404
7471
|
* @param source This object is described in the Identity in the typedef
|
|
7405
7472
|
* @param topic The topic on which the message is sent
|
|
7406
|
-
* @param listener A function that is called when a message has
|
|
7407
|
-
*
|
|
7473
|
+
* @param listener A function that is called when a message has been received. It is passed
|
|
7474
|
+
* two arguments: the message, and the identity (`{ uuid, name }`) of the sender.
|
|
7408
7475
|
* The message can be either a primitive data type (string, number, or boolean) or
|
|
7409
7476
|
* composite data type (object, array) that is composed of other primitive or composite
|
|
7410
7477
|
* data types
|
|
7411
7478
|
*
|
|
7479
|
+
* @remarks This differs from the legacy `fin.desktop.InterApplicationBus.subscribe` API,
|
|
7480
|
+
* which passes `(message, uuid, name)` as separate arguments.
|
|
7481
|
+
*
|
|
7412
7482
|
* @example
|
|
7413
7483
|
* ```js
|
|
7414
7484
|
* // subscribe to a specified application
|
|
7415
|
-
* fin.InterApplicationBus.subscribe(fin.me, 'topic',
|
|
7485
|
+
* fin.InterApplicationBus.subscribe(fin.me, 'topic', (message, sender) => {
|
|
7486
|
+
* console.log(`Received from ${sender.uuid}/${sender.name}:`, message);
|
|
7487
|
+
* }).then(() => console.log('Subscribed to the specified application')).catch(err => console.log(err));
|
|
7416
7488
|
*
|
|
7417
7489
|
* // subscribe to wildcard
|
|
7418
7490
|
* fin.InterApplicationBus.subscribe({ uuid: '*' }, 'topic', sub_msg => console.log(sub_msg)).then(() => console.log('Subscribed to *')).catch(err => console.log(err));
|
|
@@ -11399,6 +11471,8 @@ declare namespace OpenFin {
|
|
|
11399
11471
|
ChannelClientConnectionListener,
|
|
11400
11472
|
ChannelClientDisconnectionListener,
|
|
11401
11473
|
ChannelProviderDisconnectionListener,
|
|
11474
|
+
ChannelClientReconnectionInfo,
|
|
11475
|
+
ChannelClientReconnectionListener,
|
|
11402
11476
|
RoutingInfo,
|
|
11403
11477
|
DownloadShelfOptions,
|
|
11404
11478
|
SnapZoneOptions,
|
|
@@ -17806,6 +17880,8 @@ declare type TaskBar = DipScaleRects & {
|
|
|
17806
17880
|
rect: RectangleByEdgePositions;
|
|
17807
17881
|
};
|
|
17808
17882
|
|
|
17883
|
+
declare const teardown: unique symbol;
|
|
17884
|
+
|
|
17809
17885
|
/**
|
|
17810
17886
|
* @interface
|
|
17811
17887
|
*/
|
package/out/fdc3-api.d.ts
CHANGED
|
@@ -2795,22 +2795,17 @@ declare class ChannelBase {
|
|
|
2795
2795
|
*/
|
|
2796
2796
|
declare class ChannelClient extends ChannelBase {
|
|
2797
2797
|
#private;
|
|
2798
|
-
private disconnectListener;
|
|
2799
|
-
private endpointId;
|
|
2800
|
-
/**
|
|
2801
|
-
* @internal
|
|
2802
|
-
*/
|
|
2803
|
-
static closeChannelByEndpointId(id: string): void;
|
|
2804
2798
|
/**
|
|
2805
2799
|
* @internal
|
|
2806
|
-
* closes the corresponding channel and invokes the disconnect listener if an event payload is passed.
|
|
2807
2800
|
*/
|
|
2808
|
-
|
|
2801
|
+
constructor(config: ChannelClientConfig);
|
|
2802
|
+
protected processAction: (action: string, payload: any, senderIdentity: OpenFin.ProviderIdentity | OpenFin.ClientIdentity) => Promise<any>;
|
|
2809
2803
|
/**
|
|
2810
2804
|
* @internal
|
|
2805
|
+
* Closes the client. `notifyRuntime` sends `disconnect-from-channel` for the current endpoint; `emitEvent` then
|
|
2806
|
+
* fires the onDisconnection listener, even if notifying the runtime failed.
|
|
2811
2807
|
*/
|
|
2812
|
-
|
|
2813
|
-
protected processAction: (action: string, payload: any, senderIdentity: OpenFin.ProviderIdentity | OpenFin.ClientIdentity) => Promise<any>;
|
|
2808
|
+
[teardown](emitEvent?: boolean, notifyRuntime?: boolean): Promise<void>;
|
|
2814
2809
|
/**
|
|
2815
2810
|
* a read-only provider identity
|
|
2816
2811
|
*/
|
|
@@ -2842,8 +2837,8 @@ declare class ChannelClient extends ChannelBase {
|
|
|
2842
2837
|
*/
|
|
2843
2838
|
dispatch(action: string, payload?: any): Promise<any>;
|
|
2844
2839
|
/**
|
|
2845
|
-
* Register a listener that is called
|
|
2846
|
-
*
|
|
2840
|
+
* Register a listener that is called when this client loses its channel: the provider disconnects, the
|
|
2841
|
+
* endpoint drops, or a self-heal fails. It is passed the provider identity.
|
|
2847
2842
|
*
|
|
2848
2843
|
* @param listener
|
|
2849
2844
|
*
|
|
@@ -2860,6 +2855,43 @@ declare class ChannelClient extends ChannelBase {
|
|
|
2860
2855
|
* ```
|
|
2861
2856
|
*/
|
|
2862
2857
|
onDisconnection(listener: OpenFin.ChannelProviderDisconnectionListener): void;
|
|
2858
|
+
/**
|
|
2859
|
+
* Register a listener that is called each time this client transparently self-heals its connection to the
|
|
2860
|
+
* provider.
|
|
2861
|
+
*
|
|
2862
|
+
* @remarks
|
|
2863
|
+
* A channel client's underlying endpoint is torn down while its document sits in the back/forward cache
|
|
2864
|
+
* (bfcache). If the back/forward cache is supported and the document is restored from it, the client
|
|
2865
|
+
* automatically re-handshakes with the provider and swaps in a fresh endpoint; all of this client's
|
|
2866
|
+
* `register`/middleware handlers are preserved, so no re-registration is required.
|
|
2867
|
+
*
|
|
2868
|
+
* A restore is not guaranteed: Chromium may evict a cached document at any time, in which case navigating
|
|
2869
|
+
* back reloads the page and a new client must connect.
|
|
2870
|
+
*
|
|
2871
|
+
* This listener fires once per successful reconnect, after the new endpoint is live, and can fire multiple
|
|
2872
|
+
* times over the client's lifetime. It is triggered when the document is restored from the back/forward
|
|
2873
|
+
* cache (a bfcache `pageshow`). It does not fire for the initial connection, nor after
|
|
2874
|
+
* {@link ChannelClient#disconnect disconnect}. {@link ChannelClient#onDisconnection onDisconnection} fires
|
|
2875
|
+
* when the provider or endpoint goes away.
|
|
2876
|
+
*
|
|
2877
|
+
* The info provides the reconnected {@link OpenFin.ProviderIdentity provider identity} along with
|
|
2878
|
+
* the previous and new endpoint ids.
|
|
2879
|
+
*
|
|
2880
|
+
* @param listener
|
|
2881
|
+
*
|
|
2882
|
+
* @example
|
|
2883
|
+
*
|
|
2884
|
+
* ```js
|
|
2885
|
+
* (async () => {
|
|
2886
|
+
* const client = await fin.InterApplicationBus.Channel.connect('channelName');
|
|
2887
|
+
*
|
|
2888
|
+
* client.onReconnection(({ providerIdentity, previousEndpointId, endpointId }) => {
|
|
2889
|
+
* console.log(`Reconnected to ${providerIdentity.channelName}: ${previousEndpointId} -> ${endpointId}`);
|
|
2890
|
+
* });
|
|
2891
|
+
* })();
|
|
2892
|
+
* ```
|
|
2893
|
+
*/
|
|
2894
|
+
onReconnection(listener: OpenFin.ChannelClientReconnectionListener): void;
|
|
2863
2895
|
/**
|
|
2864
2896
|
* Disconnects the client from the channel.
|
|
2865
2897
|
*
|
|
@@ -2874,20 +2906,57 @@ declare class ChannelClient extends ChannelBase {
|
|
|
2874
2906
|
* ```
|
|
2875
2907
|
*/
|
|
2876
2908
|
disconnect(): Promise<void>;
|
|
2877
|
-
sendDisconnectAction(): Promise<void>;
|
|
2878
2909
|
/**
|
|
2879
2910
|
* @internal
|
|
2880
|
-
*
|
|
2911
|
+
* Notify the runtime that the current endpoint has disconnected.
|
|
2881
2912
|
*/
|
|
2882
|
-
|
|
2913
|
+
sendDisconnectAction(): Promise<void>;
|
|
2883
2914
|
}
|
|
2884
2915
|
|
|
2885
2916
|
declare type ChannelClient_2 = OpenFin.ChannelClient;
|
|
2886
2917
|
|
|
2918
|
+
/**
|
|
2919
|
+
* @internal
|
|
2920
|
+
* `wire` and `reestablish` let the client notify the runtime on disconnect and self-heal after a BF-Cache restore.
|
|
2921
|
+
* The in-memory transport has no runtime and passes no-ops.
|
|
2922
|
+
*/
|
|
2923
|
+
declare type ChannelClientConfig = {
|
|
2924
|
+
initialConnection: EndpointConnectionInstance;
|
|
2925
|
+
wire: Pick<Transport, 'sendAction'> & {
|
|
2926
|
+
environment: Pick<Transport['environment'], 'onBFCacheRestore'>;
|
|
2927
|
+
};
|
|
2928
|
+
reestablish: () => Promise<EndpointConnectionInstance>;
|
|
2929
|
+
};
|
|
2930
|
+
|
|
2887
2931
|
declare type ChannelClientConnectionListener = (identity: ClientIdentity, connectionMessage?: any) => Promise<any> | any;
|
|
2888
2932
|
|
|
2889
2933
|
declare type ChannelClientDisconnectionListener = (identity: ClientIdentity) => any;
|
|
2890
2934
|
|
|
2935
|
+
/**
|
|
2936
|
+
* Info passed to a {@link ChannelClient.onReconnection} listener when a channel client
|
|
2937
|
+
* re-establishes its connection to the provider after its endpoint was torn down.
|
|
2938
|
+
*/
|
|
2939
|
+
declare type ChannelClientReconnectionInfo = {
|
|
2940
|
+
/** Identity of the provider this client re-established its connection to. */
|
|
2941
|
+
providerIdentity: ProviderIdentity_4;
|
|
2942
|
+
/** The client's endpoint id before the reconnect (now torn down). */
|
|
2943
|
+
previousEndpointId: string;
|
|
2944
|
+
/** The client's endpoint id after the reconnect. */
|
|
2945
|
+
endpointId: string;
|
|
2946
|
+
};
|
|
2947
|
+
|
|
2948
|
+
/**
|
|
2949
|
+
* Listener registered via {@link ChannelClient.onReconnection}, called once each time the client self-heals its
|
|
2950
|
+
* connection to the provider.
|
|
2951
|
+
*
|
|
2952
|
+
* Currently, this will only occur during a [bfcache](https://developer.mozilla.org/en-US/docs/Glossary/bfcache) Restore.
|
|
2953
|
+
*
|
|
2954
|
+
* For example, if the Channel Client belongs to a Window / View that is compatible with the bfcache, and
|
|
2955
|
+
* the Window / View is navigated away from and then back to using the history API, the Channel Client will re-establish its connection to the provider if it still
|
|
2956
|
+
* exists.
|
|
2957
|
+
*/
|
|
2958
|
+
declare type ChannelClientReconnectionListener = (info: ChannelClientReconnectionInfo) => void;
|
|
2959
|
+
|
|
2891
2960
|
/**
|
|
2892
2961
|
* Options provided on a client connection to a channel.
|
|
2893
2962
|
*
|
|
@@ -5365,6 +5434,14 @@ declare type EndLoadEvent = BaseEvent_5 & {
|
|
|
5365
5434
|
isMain: boolean;
|
|
5366
5435
|
};
|
|
5367
5436
|
|
|
5437
|
+
/**
|
|
5438
|
+
* @internal
|
|
5439
|
+
*/
|
|
5440
|
+
declare type EndpointConnectionInstance = {
|
|
5441
|
+
routingInfo: OpenFin.RoutingInfo;
|
|
5442
|
+
strategy: AnyStrategy;
|
|
5443
|
+
};
|
|
5444
|
+
|
|
5368
5445
|
/**
|
|
5369
5446
|
* Generated at the end of a user-driven change to a window's size or position.
|
|
5370
5447
|
*
|
|
@@ -7512,6 +7589,11 @@ declare class InterApplicationBus extends Base {
|
|
|
7512
7589
|
subscriberRemoved: string;
|
|
7513
7590
|
};
|
|
7514
7591
|
private refCounter;
|
|
7592
|
+
/**
|
|
7593
|
+
* One entry per subscription the runtime knows about, keyed by the same subscription key the
|
|
7594
|
+
* emitter and the ref counter use. Listeners sharing a key share a single entry.
|
|
7595
|
+
*/
|
|
7596
|
+
private activeSubscriptions;
|
|
7515
7597
|
protected emitter: EventEmitter;
|
|
7516
7598
|
on: any;
|
|
7517
7599
|
removeAllListeners: any;
|
|
@@ -7554,16 +7636,21 @@ declare class InterApplicationBus extends Base {
|
|
|
7554
7636
|
* Subscribes to messages from the specified application on the specified topic.
|
|
7555
7637
|
* @param source This object is described in the Identity in the typedef
|
|
7556
7638
|
* @param topic The topic on which the message is sent
|
|
7557
|
-
* @param listener A function that is called when a message has
|
|
7558
|
-
*
|
|
7639
|
+
* @param listener A function that is called when a message has been received. It is passed
|
|
7640
|
+
* two arguments: the message, and the identity (`{ uuid, name }`) of the sender.
|
|
7559
7641
|
* The message can be either a primitive data type (string, number, or boolean) or
|
|
7560
7642
|
* composite data type (object, array) that is composed of other primitive or composite
|
|
7561
7643
|
* data types
|
|
7562
7644
|
*
|
|
7645
|
+
* @remarks This differs from the legacy `fin.desktop.InterApplicationBus.subscribe` API,
|
|
7646
|
+
* which passes `(message, uuid, name)` as separate arguments.
|
|
7647
|
+
*
|
|
7563
7648
|
* @example
|
|
7564
7649
|
* ```js
|
|
7565
7650
|
* // subscribe to a specified application
|
|
7566
|
-
* fin.InterApplicationBus.subscribe(fin.me, 'topic',
|
|
7651
|
+
* fin.InterApplicationBus.subscribe(fin.me, 'topic', (message, sender) => {
|
|
7652
|
+
* console.log(`Received from ${sender.uuid}/${sender.name}:`, message);
|
|
7653
|
+
* }).then(() => console.log('Subscribed to the specified application')).catch(err => console.log(err));
|
|
7567
7654
|
*
|
|
7568
7655
|
* // subscribe to wildcard
|
|
7569
7656
|
* fin.InterApplicationBus.subscribe({ uuid: '*' }, 'topic', sub_msg => console.log(sub_msg)).then(() => console.log('Subscribed to *')).catch(err => console.log(err));
|
|
@@ -11793,6 +11880,8 @@ declare namespace OpenFin {
|
|
|
11793
11880
|
ChannelClientConnectionListener,
|
|
11794
11881
|
ChannelClientDisconnectionListener,
|
|
11795
11882
|
ChannelProviderDisconnectionListener,
|
|
11883
|
+
ChannelClientReconnectionInfo,
|
|
11884
|
+
ChannelClientReconnectionListener,
|
|
11796
11885
|
RoutingInfo,
|
|
11797
11886
|
DownloadShelfOptions,
|
|
11798
11887
|
SnapZoneOptions,
|
|
@@ -18305,6 +18394,8 @@ declare type TaskBar = DipScaleRects & {
|
|
|
18305
18394
|
rect: RectangleByEdgePositions;
|
|
18306
18395
|
};
|
|
18307
18396
|
|
|
18397
|
+
declare const teardown: unique symbol;
|
|
18398
|
+
|
|
18308
18399
|
/**
|
|
18309
18400
|
* @interface
|
|
18310
18401
|
*/
|