@openfin/core 47.100.27 → 47.100.31
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/mock-alpha.d.ts +87 -11
- package/out/mock-beta.d.ts +87 -11
- package/out/mock-public.d.ts +87 -11
- package/out/stub.d.ts +109 -18
- package/out/stub.js +275 -118
- package/out/stub.mjs +275 -118
- package/package.json +1 -1
package/out/mock-alpha.d.ts
CHANGED
|
@@ -2758,12 +2758,9 @@ declare class ChannelBase {
|
|
|
2758
2758
|
*/
|
|
2759
2759
|
declare class ChannelClient extends ChannelBase {
|
|
2760
2760
|
#private;
|
|
2761
|
-
private disconnectListener;
|
|
2762
|
-
private endpointId;
|
|
2763
|
-
/* Excluded from this release type: closeChannelByEndpointId */
|
|
2764
|
-
/* Excluded from this release type: handleProviderDisconnect */
|
|
2765
2761
|
/* Excluded from this release type: __constructor */
|
|
2766
2762
|
protected processAction: (action: string, payload: any, senderIdentity: OpenFin_2.ProviderIdentity | OpenFin_2.ClientIdentity) => Promise<any>;
|
|
2763
|
+
/* Excluded from this release type: [teardown] */
|
|
2767
2764
|
/**
|
|
2768
2765
|
* a read-only provider identity
|
|
2769
2766
|
*/
|
|
@@ -2795,8 +2792,8 @@ declare class ChannelClient extends ChannelBase {
|
|
|
2795
2792
|
*/
|
|
2796
2793
|
dispatch(action: string, payload?: any): Promise<any>;
|
|
2797
2794
|
/**
|
|
2798
|
-
* Register a listener that is called
|
|
2799
|
-
*
|
|
2795
|
+
* Register a listener that is called when this client loses its channel: the provider disconnects, the
|
|
2796
|
+
* endpoint drops, or a self-heal fails. It is passed the provider identity.
|
|
2800
2797
|
*
|
|
2801
2798
|
* @param listener
|
|
2802
2799
|
*
|
|
@@ -2813,6 +2810,43 @@ declare class ChannelClient extends ChannelBase {
|
|
|
2813
2810
|
* ```
|
|
2814
2811
|
*/
|
|
2815
2812
|
onDisconnection(listener: OpenFin_2.ChannelProviderDisconnectionListener): void;
|
|
2813
|
+
/**
|
|
2814
|
+
* Register a listener that is called each time this client transparently self-heals its connection to the
|
|
2815
|
+
* provider.
|
|
2816
|
+
*
|
|
2817
|
+
* @remarks
|
|
2818
|
+
* A channel client's underlying endpoint is torn down while its document sits in the back/forward cache
|
|
2819
|
+
* (bfcache). If the back/forward cache is supported and the document is restored from it, the client
|
|
2820
|
+
* automatically re-handshakes with the provider and swaps in a fresh endpoint; all of this client's
|
|
2821
|
+
* `register`/middleware handlers are preserved, so no re-registration is required.
|
|
2822
|
+
*
|
|
2823
|
+
* A restore is not guaranteed: Chromium may evict a cached document at any time, in which case navigating
|
|
2824
|
+
* back reloads the page and a new client must connect.
|
|
2825
|
+
*
|
|
2826
|
+
* This listener fires once per successful reconnect, after the new endpoint is live, and can fire multiple
|
|
2827
|
+
* times over the client's lifetime. It is triggered when the document is restored from the back/forward
|
|
2828
|
+
* cache (a bfcache `pageshow`). It does not fire for the initial connection, nor after
|
|
2829
|
+
* {@link ChannelClient#disconnect disconnect}. {@link ChannelClient#onDisconnection onDisconnection} fires
|
|
2830
|
+
* when the provider or endpoint goes away.
|
|
2831
|
+
*
|
|
2832
|
+
* The info provides the reconnected {@link OpenFin.ProviderIdentity provider identity} along with
|
|
2833
|
+
* the previous and new endpoint ids.
|
|
2834
|
+
*
|
|
2835
|
+
* @param listener
|
|
2836
|
+
*
|
|
2837
|
+
* @example
|
|
2838
|
+
*
|
|
2839
|
+
* ```js
|
|
2840
|
+
* (async () => {
|
|
2841
|
+
* const client = await fin.InterApplicationBus.Channel.connect('channelName');
|
|
2842
|
+
*
|
|
2843
|
+
* client.onReconnection(({ providerIdentity, previousEndpointId, endpointId }) => {
|
|
2844
|
+
* console.log(`Reconnected to ${providerIdentity.channelName}: ${previousEndpointId} -> ${endpointId}`);
|
|
2845
|
+
* });
|
|
2846
|
+
* })();
|
|
2847
|
+
* ```
|
|
2848
|
+
*/
|
|
2849
|
+
onReconnection(listener: OpenFin_2.ChannelClientReconnectionListener): void;
|
|
2816
2850
|
/**
|
|
2817
2851
|
* Disconnects the client from the channel.
|
|
2818
2852
|
*
|
|
@@ -2827,16 +2861,42 @@ declare class ChannelClient extends ChannelBase {
|
|
|
2827
2861
|
* ```
|
|
2828
2862
|
*/
|
|
2829
2863
|
disconnect(): Promise<void>;
|
|
2830
|
-
|
|
2831
|
-
/* Excluded from this release type: wireClose */
|
|
2864
|
+
/* Excluded from this release type: sendDisconnectAction */
|
|
2832
2865
|
}
|
|
2833
2866
|
|
|
2834
2867
|
declare type ChannelClient_2 = OpenFin_2.ChannelClient;
|
|
2835
2868
|
|
|
2869
|
+
/* Excluded from this release type: ChannelClientConfig */
|
|
2870
|
+
|
|
2836
2871
|
declare type ChannelClientConnectionListener = (identity: ClientIdentity, connectionMessage?: any) => Promise<any> | any;
|
|
2837
2872
|
|
|
2838
2873
|
declare type ChannelClientDisconnectionListener = (identity: ClientIdentity) => any;
|
|
2839
2874
|
|
|
2875
|
+
/**
|
|
2876
|
+
* Info passed to a {@link ChannelClient.onReconnection} listener when a channel client
|
|
2877
|
+
* re-establishes its connection to the provider after its endpoint was torn down.
|
|
2878
|
+
*/
|
|
2879
|
+
declare type ChannelClientReconnectionInfo = {
|
|
2880
|
+
/** Identity of the provider this client re-established its connection to. */
|
|
2881
|
+
providerIdentity: ProviderIdentity_4;
|
|
2882
|
+
/** The client's endpoint id before the reconnect (now torn down). */
|
|
2883
|
+
previousEndpointId: string;
|
|
2884
|
+
/** The client's endpoint id after the reconnect. */
|
|
2885
|
+
endpointId: string;
|
|
2886
|
+
};
|
|
2887
|
+
|
|
2888
|
+
/**
|
|
2889
|
+
* Listener registered via {@link ChannelClient.onReconnection}, called once each time the client self-heals its
|
|
2890
|
+
* connection to the provider.
|
|
2891
|
+
*
|
|
2892
|
+
* Currently, this will only occur during a [bfcache](https://developer.mozilla.org/en-US/docs/Glossary/bfcache) Restore.
|
|
2893
|
+
*
|
|
2894
|
+
* For example, if the Channel Client belongs to a Window / View that is compatible with the bfcache, and
|
|
2895
|
+
* 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
|
|
2896
|
+
* exists.
|
|
2897
|
+
*/
|
|
2898
|
+
declare type ChannelClientReconnectionListener = (info: ChannelClientReconnectionInfo) => void;
|
|
2899
|
+
|
|
2840
2900
|
/**
|
|
2841
2901
|
* Options provided on a client connection to a channel.
|
|
2842
2902
|
*
|
|
@@ -5304,6 +5364,8 @@ declare type EndLoadEvent = BaseEvent_5 & {
|
|
|
5304
5364
|
isMain: boolean;
|
|
5305
5365
|
};
|
|
5306
5366
|
|
|
5367
|
+
/* Excluded from this release type: EndpointConnectionInstance */
|
|
5368
|
+
|
|
5307
5369
|
/**
|
|
5308
5370
|
* Generated at the end of a user-driven change to a window's size or position.
|
|
5309
5371
|
*
|
|
@@ -7070,6 +7132,11 @@ declare class InterApplicationBus extends Base {
|
|
|
7070
7132
|
subscriberRemoved: string;
|
|
7071
7133
|
};
|
|
7072
7134
|
private refCounter;
|
|
7135
|
+
/**
|
|
7136
|
+
* One entry per subscription the runtime knows about, keyed by the same subscription key the
|
|
7137
|
+
* emitter and the ref counter use. Listeners sharing a key share a single entry.
|
|
7138
|
+
*/
|
|
7139
|
+
private activeSubscriptions;
|
|
7073
7140
|
protected emitter: EventEmitter;
|
|
7074
7141
|
on: any;
|
|
7075
7142
|
removeAllListeners: any;
|
|
@@ -7109,16 +7176,21 @@ declare class InterApplicationBus extends Base {
|
|
|
7109
7176
|
* Subscribes to messages from the specified application on the specified topic.
|
|
7110
7177
|
* @param source This object is described in the Identity in the typedef
|
|
7111
7178
|
* @param topic The topic on which the message is sent
|
|
7112
|
-
* @param listener A function that is called when a message has
|
|
7113
|
-
*
|
|
7179
|
+
* @param listener A function that is called when a message has been received. It is passed
|
|
7180
|
+
* two arguments: the message, and the identity (`{ uuid, name }`) of the sender.
|
|
7114
7181
|
* The message can be either a primitive data type (string, number, or boolean) or
|
|
7115
7182
|
* composite data type (object, array) that is composed of other primitive or composite
|
|
7116
7183
|
* data types
|
|
7117
7184
|
*
|
|
7185
|
+
* @remarks This differs from the legacy `fin.desktop.InterApplicationBus.subscribe` API,
|
|
7186
|
+
* which passes `(message, uuid, name)` as separate arguments.
|
|
7187
|
+
*
|
|
7118
7188
|
* @example
|
|
7119
7189
|
* ```js
|
|
7120
7190
|
* // subscribe to a specified application
|
|
7121
|
-
* fin.InterApplicationBus.subscribe(fin.me, 'topic',
|
|
7191
|
+
* fin.InterApplicationBus.subscribe(fin.me, 'topic', (message, sender) => {
|
|
7192
|
+
* console.log(`Received from ${sender.uuid}/${sender.name}:`, message);
|
|
7193
|
+
* }).then(() => console.log('Subscribed to the specified application')).catch(err => console.log(err));
|
|
7122
7194
|
*
|
|
7123
7195
|
* // subscribe to wildcard
|
|
7124
7196
|
* fin.InterApplicationBus.subscribe({ uuid: '*' }, 'topic', sub_msg => console.log(sub_msg)).then(() => console.log('Subscribed to *')).catch(err => console.log(err));
|
|
@@ -11127,6 +11199,8 @@ declare namespace OpenFin_2 {
|
|
|
11127
11199
|
ChannelClientConnectionListener,
|
|
11128
11200
|
ChannelClientDisconnectionListener,
|
|
11129
11201
|
ChannelProviderDisconnectionListener,
|
|
11202
|
+
ChannelClientReconnectionInfo,
|
|
11203
|
+
ChannelClientReconnectionListener,
|
|
11130
11204
|
RoutingInfo,
|
|
11131
11205
|
DownloadShelfOptions,
|
|
11132
11206
|
SnapZoneOptions,
|
|
@@ -17536,6 +17610,8 @@ declare type TaskBar = DipScaleRects & {
|
|
|
17536
17610
|
rect: RectangleByEdgePositions;
|
|
17537
17611
|
};
|
|
17538
17612
|
|
|
17613
|
+
declare const teardown: unique symbol;
|
|
17614
|
+
|
|
17539
17615
|
/**
|
|
17540
17616
|
* @interface
|
|
17541
17617
|
*/
|
package/out/mock-beta.d.ts
CHANGED
|
@@ -2758,12 +2758,9 @@ declare class ChannelBase {
|
|
|
2758
2758
|
*/
|
|
2759
2759
|
declare class ChannelClient extends ChannelBase {
|
|
2760
2760
|
#private;
|
|
2761
|
-
private disconnectListener;
|
|
2762
|
-
private endpointId;
|
|
2763
|
-
/* Excluded from this release type: closeChannelByEndpointId */
|
|
2764
|
-
/* Excluded from this release type: handleProviderDisconnect */
|
|
2765
2761
|
/* Excluded from this release type: __constructor */
|
|
2766
2762
|
protected processAction: (action: string, payload: any, senderIdentity: OpenFin_2.ProviderIdentity | OpenFin_2.ClientIdentity) => Promise<any>;
|
|
2763
|
+
/* Excluded from this release type: [teardown] */
|
|
2767
2764
|
/**
|
|
2768
2765
|
* a read-only provider identity
|
|
2769
2766
|
*/
|
|
@@ -2795,8 +2792,8 @@ declare class ChannelClient extends ChannelBase {
|
|
|
2795
2792
|
*/
|
|
2796
2793
|
dispatch(action: string, payload?: any): Promise<any>;
|
|
2797
2794
|
/**
|
|
2798
|
-
* Register a listener that is called
|
|
2799
|
-
*
|
|
2795
|
+
* Register a listener that is called when this client loses its channel: the provider disconnects, the
|
|
2796
|
+
* endpoint drops, or a self-heal fails. It is passed the provider identity.
|
|
2800
2797
|
*
|
|
2801
2798
|
* @param listener
|
|
2802
2799
|
*
|
|
@@ -2813,6 +2810,43 @@ declare class ChannelClient extends ChannelBase {
|
|
|
2813
2810
|
* ```
|
|
2814
2811
|
*/
|
|
2815
2812
|
onDisconnection(listener: OpenFin_2.ChannelProviderDisconnectionListener): void;
|
|
2813
|
+
/**
|
|
2814
|
+
* Register a listener that is called each time this client transparently self-heals its connection to the
|
|
2815
|
+
* provider.
|
|
2816
|
+
*
|
|
2817
|
+
* @remarks
|
|
2818
|
+
* A channel client's underlying endpoint is torn down while its document sits in the back/forward cache
|
|
2819
|
+
* (bfcache). If the back/forward cache is supported and the document is restored from it, the client
|
|
2820
|
+
* automatically re-handshakes with the provider and swaps in a fresh endpoint; all of this client's
|
|
2821
|
+
* `register`/middleware handlers are preserved, so no re-registration is required.
|
|
2822
|
+
*
|
|
2823
|
+
* A restore is not guaranteed: Chromium may evict a cached document at any time, in which case navigating
|
|
2824
|
+
* back reloads the page and a new client must connect.
|
|
2825
|
+
*
|
|
2826
|
+
* This listener fires once per successful reconnect, after the new endpoint is live, and can fire multiple
|
|
2827
|
+
* times over the client's lifetime. It is triggered when the document is restored from the back/forward
|
|
2828
|
+
* cache (a bfcache `pageshow`). It does not fire for the initial connection, nor after
|
|
2829
|
+
* {@link ChannelClient#disconnect disconnect}. {@link ChannelClient#onDisconnection onDisconnection} fires
|
|
2830
|
+
* when the provider or endpoint goes away.
|
|
2831
|
+
*
|
|
2832
|
+
* The info provides the reconnected {@link OpenFin.ProviderIdentity provider identity} along with
|
|
2833
|
+
* the previous and new endpoint ids.
|
|
2834
|
+
*
|
|
2835
|
+
* @param listener
|
|
2836
|
+
*
|
|
2837
|
+
* @example
|
|
2838
|
+
*
|
|
2839
|
+
* ```js
|
|
2840
|
+
* (async () => {
|
|
2841
|
+
* const client = await fin.InterApplicationBus.Channel.connect('channelName');
|
|
2842
|
+
*
|
|
2843
|
+
* client.onReconnection(({ providerIdentity, previousEndpointId, endpointId }) => {
|
|
2844
|
+
* console.log(`Reconnected to ${providerIdentity.channelName}: ${previousEndpointId} -> ${endpointId}`);
|
|
2845
|
+
* });
|
|
2846
|
+
* })();
|
|
2847
|
+
* ```
|
|
2848
|
+
*/
|
|
2849
|
+
onReconnection(listener: OpenFin_2.ChannelClientReconnectionListener): void;
|
|
2816
2850
|
/**
|
|
2817
2851
|
* Disconnects the client from the channel.
|
|
2818
2852
|
*
|
|
@@ -2827,16 +2861,42 @@ declare class ChannelClient extends ChannelBase {
|
|
|
2827
2861
|
* ```
|
|
2828
2862
|
*/
|
|
2829
2863
|
disconnect(): Promise<void>;
|
|
2830
|
-
|
|
2831
|
-
/* Excluded from this release type: wireClose */
|
|
2864
|
+
/* Excluded from this release type: sendDisconnectAction */
|
|
2832
2865
|
}
|
|
2833
2866
|
|
|
2834
2867
|
declare type ChannelClient_2 = OpenFin_2.ChannelClient;
|
|
2835
2868
|
|
|
2869
|
+
/* Excluded from this release type: ChannelClientConfig */
|
|
2870
|
+
|
|
2836
2871
|
declare type ChannelClientConnectionListener = (identity: ClientIdentity, connectionMessage?: any) => Promise<any> | any;
|
|
2837
2872
|
|
|
2838
2873
|
declare type ChannelClientDisconnectionListener = (identity: ClientIdentity) => any;
|
|
2839
2874
|
|
|
2875
|
+
/**
|
|
2876
|
+
* Info passed to a {@link ChannelClient.onReconnection} listener when a channel client
|
|
2877
|
+
* re-establishes its connection to the provider after its endpoint was torn down.
|
|
2878
|
+
*/
|
|
2879
|
+
declare type ChannelClientReconnectionInfo = {
|
|
2880
|
+
/** Identity of the provider this client re-established its connection to. */
|
|
2881
|
+
providerIdentity: ProviderIdentity_4;
|
|
2882
|
+
/** The client's endpoint id before the reconnect (now torn down). */
|
|
2883
|
+
previousEndpointId: string;
|
|
2884
|
+
/** The client's endpoint id after the reconnect. */
|
|
2885
|
+
endpointId: string;
|
|
2886
|
+
};
|
|
2887
|
+
|
|
2888
|
+
/**
|
|
2889
|
+
* Listener registered via {@link ChannelClient.onReconnection}, called once each time the client self-heals its
|
|
2890
|
+
* connection to the provider.
|
|
2891
|
+
*
|
|
2892
|
+
* Currently, this will only occur during a [bfcache](https://developer.mozilla.org/en-US/docs/Glossary/bfcache) Restore.
|
|
2893
|
+
*
|
|
2894
|
+
* For example, if the Channel Client belongs to a Window / View that is compatible with the bfcache, and
|
|
2895
|
+
* 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
|
|
2896
|
+
* exists.
|
|
2897
|
+
*/
|
|
2898
|
+
declare type ChannelClientReconnectionListener = (info: ChannelClientReconnectionInfo) => void;
|
|
2899
|
+
|
|
2840
2900
|
/**
|
|
2841
2901
|
* Options provided on a client connection to a channel.
|
|
2842
2902
|
*
|
|
@@ -5304,6 +5364,8 @@ declare type EndLoadEvent = BaseEvent_5 & {
|
|
|
5304
5364
|
isMain: boolean;
|
|
5305
5365
|
};
|
|
5306
5366
|
|
|
5367
|
+
/* Excluded from this release type: EndpointConnectionInstance */
|
|
5368
|
+
|
|
5307
5369
|
/**
|
|
5308
5370
|
* Generated at the end of a user-driven change to a window's size or position.
|
|
5309
5371
|
*
|
|
@@ -7070,6 +7132,11 @@ declare class InterApplicationBus extends Base {
|
|
|
7070
7132
|
subscriberRemoved: string;
|
|
7071
7133
|
};
|
|
7072
7134
|
private refCounter;
|
|
7135
|
+
/**
|
|
7136
|
+
* One entry per subscription the runtime knows about, keyed by the same subscription key the
|
|
7137
|
+
* emitter and the ref counter use. Listeners sharing a key share a single entry.
|
|
7138
|
+
*/
|
|
7139
|
+
private activeSubscriptions;
|
|
7073
7140
|
protected emitter: EventEmitter;
|
|
7074
7141
|
on: any;
|
|
7075
7142
|
removeAllListeners: any;
|
|
@@ -7109,16 +7176,21 @@ declare class InterApplicationBus extends Base {
|
|
|
7109
7176
|
* Subscribes to messages from the specified application on the specified topic.
|
|
7110
7177
|
* @param source This object is described in the Identity in the typedef
|
|
7111
7178
|
* @param topic The topic on which the message is sent
|
|
7112
|
-
* @param listener A function that is called when a message has
|
|
7113
|
-
*
|
|
7179
|
+
* @param listener A function that is called when a message has been received. It is passed
|
|
7180
|
+
* two arguments: the message, and the identity (`{ uuid, name }`) of the sender.
|
|
7114
7181
|
* The message can be either a primitive data type (string, number, or boolean) or
|
|
7115
7182
|
* composite data type (object, array) that is composed of other primitive or composite
|
|
7116
7183
|
* data types
|
|
7117
7184
|
*
|
|
7185
|
+
* @remarks This differs from the legacy `fin.desktop.InterApplicationBus.subscribe` API,
|
|
7186
|
+
* which passes `(message, uuid, name)` as separate arguments.
|
|
7187
|
+
*
|
|
7118
7188
|
* @example
|
|
7119
7189
|
* ```js
|
|
7120
7190
|
* // subscribe to a specified application
|
|
7121
|
-
* fin.InterApplicationBus.subscribe(fin.me, 'topic',
|
|
7191
|
+
* fin.InterApplicationBus.subscribe(fin.me, 'topic', (message, sender) => {
|
|
7192
|
+
* console.log(`Received from ${sender.uuid}/${sender.name}:`, message);
|
|
7193
|
+
* }).then(() => console.log('Subscribed to the specified application')).catch(err => console.log(err));
|
|
7122
7194
|
*
|
|
7123
7195
|
* // subscribe to wildcard
|
|
7124
7196
|
* fin.InterApplicationBus.subscribe({ uuid: '*' }, 'topic', sub_msg => console.log(sub_msg)).then(() => console.log('Subscribed to *')).catch(err => console.log(err));
|
|
@@ -11127,6 +11199,8 @@ declare namespace OpenFin_2 {
|
|
|
11127
11199
|
ChannelClientConnectionListener,
|
|
11128
11200
|
ChannelClientDisconnectionListener,
|
|
11129
11201
|
ChannelProviderDisconnectionListener,
|
|
11202
|
+
ChannelClientReconnectionInfo,
|
|
11203
|
+
ChannelClientReconnectionListener,
|
|
11130
11204
|
RoutingInfo,
|
|
11131
11205
|
DownloadShelfOptions,
|
|
11132
11206
|
SnapZoneOptions,
|
|
@@ -17536,6 +17610,8 @@ declare type TaskBar = DipScaleRects & {
|
|
|
17536
17610
|
rect: RectangleByEdgePositions;
|
|
17537
17611
|
};
|
|
17538
17612
|
|
|
17613
|
+
declare const teardown: unique symbol;
|
|
17614
|
+
|
|
17539
17615
|
/**
|
|
17540
17616
|
* @interface
|
|
17541
17617
|
*/
|
package/out/mock-public.d.ts
CHANGED
|
@@ -2758,12 +2758,9 @@ declare class ChannelBase {
|
|
|
2758
2758
|
*/
|
|
2759
2759
|
declare class ChannelClient extends ChannelBase {
|
|
2760
2760
|
#private;
|
|
2761
|
-
private disconnectListener;
|
|
2762
|
-
private endpointId;
|
|
2763
|
-
/* Excluded from this release type: closeChannelByEndpointId */
|
|
2764
|
-
/* Excluded from this release type: handleProviderDisconnect */
|
|
2765
2761
|
/* Excluded from this release type: __constructor */
|
|
2766
2762
|
protected processAction: (action: string, payload: any, senderIdentity: OpenFin_2.ProviderIdentity | OpenFin_2.ClientIdentity) => Promise<any>;
|
|
2763
|
+
/* Excluded from this release type: [teardown] */
|
|
2767
2764
|
/**
|
|
2768
2765
|
* a read-only provider identity
|
|
2769
2766
|
*/
|
|
@@ -2795,8 +2792,8 @@ declare class ChannelClient extends ChannelBase {
|
|
|
2795
2792
|
*/
|
|
2796
2793
|
dispatch(action: string, payload?: any): Promise<any>;
|
|
2797
2794
|
/**
|
|
2798
|
-
* Register a listener that is called
|
|
2799
|
-
*
|
|
2795
|
+
* Register a listener that is called when this client loses its channel: the provider disconnects, the
|
|
2796
|
+
* endpoint drops, or a self-heal fails. It is passed the provider identity.
|
|
2800
2797
|
*
|
|
2801
2798
|
* @param listener
|
|
2802
2799
|
*
|
|
@@ -2813,6 +2810,43 @@ declare class ChannelClient extends ChannelBase {
|
|
|
2813
2810
|
* ```
|
|
2814
2811
|
*/
|
|
2815
2812
|
onDisconnection(listener: OpenFin_2.ChannelProviderDisconnectionListener): void;
|
|
2813
|
+
/**
|
|
2814
|
+
* Register a listener that is called each time this client transparently self-heals its connection to the
|
|
2815
|
+
* provider.
|
|
2816
|
+
*
|
|
2817
|
+
* @remarks
|
|
2818
|
+
* A channel client's underlying endpoint is torn down while its document sits in the back/forward cache
|
|
2819
|
+
* (bfcache). If the back/forward cache is supported and the document is restored from it, the client
|
|
2820
|
+
* automatically re-handshakes with the provider and swaps in a fresh endpoint; all of this client's
|
|
2821
|
+
* `register`/middleware handlers are preserved, so no re-registration is required.
|
|
2822
|
+
*
|
|
2823
|
+
* A restore is not guaranteed: Chromium may evict a cached document at any time, in which case navigating
|
|
2824
|
+
* back reloads the page and a new client must connect.
|
|
2825
|
+
*
|
|
2826
|
+
* This listener fires once per successful reconnect, after the new endpoint is live, and can fire multiple
|
|
2827
|
+
* times over the client's lifetime. It is triggered when the document is restored from the back/forward
|
|
2828
|
+
* cache (a bfcache `pageshow`). It does not fire for the initial connection, nor after
|
|
2829
|
+
* {@link ChannelClient#disconnect disconnect}. {@link ChannelClient#onDisconnection onDisconnection} fires
|
|
2830
|
+
* when the provider or endpoint goes away.
|
|
2831
|
+
*
|
|
2832
|
+
* The info provides the reconnected {@link OpenFin.ProviderIdentity provider identity} along with
|
|
2833
|
+
* the previous and new endpoint ids.
|
|
2834
|
+
*
|
|
2835
|
+
* @param listener
|
|
2836
|
+
*
|
|
2837
|
+
* @example
|
|
2838
|
+
*
|
|
2839
|
+
* ```js
|
|
2840
|
+
* (async () => {
|
|
2841
|
+
* const client = await fin.InterApplicationBus.Channel.connect('channelName');
|
|
2842
|
+
*
|
|
2843
|
+
* client.onReconnection(({ providerIdentity, previousEndpointId, endpointId }) => {
|
|
2844
|
+
* console.log(`Reconnected to ${providerIdentity.channelName}: ${previousEndpointId} -> ${endpointId}`);
|
|
2845
|
+
* });
|
|
2846
|
+
* })();
|
|
2847
|
+
* ```
|
|
2848
|
+
*/
|
|
2849
|
+
onReconnection(listener: OpenFin_2.ChannelClientReconnectionListener): void;
|
|
2816
2850
|
/**
|
|
2817
2851
|
* Disconnects the client from the channel.
|
|
2818
2852
|
*
|
|
@@ -2827,16 +2861,42 @@ declare class ChannelClient extends ChannelBase {
|
|
|
2827
2861
|
* ```
|
|
2828
2862
|
*/
|
|
2829
2863
|
disconnect(): Promise<void>;
|
|
2830
|
-
|
|
2831
|
-
/* Excluded from this release type: wireClose */
|
|
2864
|
+
/* Excluded from this release type: sendDisconnectAction */
|
|
2832
2865
|
}
|
|
2833
2866
|
|
|
2834
2867
|
declare type ChannelClient_2 = OpenFin_2.ChannelClient;
|
|
2835
2868
|
|
|
2869
|
+
/* Excluded from this release type: ChannelClientConfig */
|
|
2870
|
+
|
|
2836
2871
|
declare type ChannelClientConnectionListener = (identity: ClientIdentity, connectionMessage?: any) => Promise<any> | any;
|
|
2837
2872
|
|
|
2838
2873
|
declare type ChannelClientDisconnectionListener = (identity: ClientIdentity) => any;
|
|
2839
2874
|
|
|
2875
|
+
/**
|
|
2876
|
+
* Info passed to a {@link ChannelClient.onReconnection} listener when a channel client
|
|
2877
|
+
* re-establishes its connection to the provider after its endpoint was torn down.
|
|
2878
|
+
*/
|
|
2879
|
+
declare type ChannelClientReconnectionInfo = {
|
|
2880
|
+
/** Identity of the provider this client re-established its connection to. */
|
|
2881
|
+
providerIdentity: ProviderIdentity_4;
|
|
2882
|
+
/** The client's endpoint id before the reconnect (now torn down). */
|
|
2883
|
+
previousEndpointId: string;
|
|
2884
|
+
/** The client's endpoint id after the reconnect. */
|
|
2885
|
+
endpointId: string;
|
|
2886
|
+
};
|
|
2887
|
+
|
|
2888
|
+
/**
|
|
2889
|
+
* Listener registered via {@link ChannelClient.onReconnection}, called once each time the client self-heals its
|
|
2890
|
+
* connection to the provider.
|
|
2891
|
+
*
|
|
2892
|
+
* Currently, this will only occur during a [bfcache](https://developer.mozilla.org/en-US/docs/Glossary/bfcache) Restore.
|
|
2893
|
+
*
|
|
2894
|
+
* For example, if the Channel Client belongs to a Window / View that is compatible with the bfcache, and
|
|
2895
|
+
* 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
|
|
2896
|
+
* exists.
|
|
2897
|
+
*/
|
|
2898
|
+
declare type ChannelClientReconnectionListener = (info: ChannelClientReconnectionInfo) => void;
|
|
2899
|
+
|
|
2840
2900
|
/**
|
|
2841
2901
|
* Options provided on a client connection to a channel.
|
|
2842
2902
|
*
|
|
@@ -5304,6 +5364,8 @@ declare type EndLoadEvent = BaseEvent_5 & {
|
|
|
5304
5364
|
isMain: boolean;
|
|
5305
5365
|
};
|
|
5306
5366
|
|
|
5367
|
+
/* Excluded from this release type: EndpointConnectionInstance */
|
|
5368
|
+
|
|
5307
5369
|
/**
|
|
5308
5370
|
* Generated at the end of a user-driven change to a window's size or position.
|
|
5309
5371
|
*
|
|
@@ -7070,6 +7132,11 @@ declare class InterApplicationBus extends Base {
|
|
|
7070
7132
|
subscriberRemoved: string;
|
|
7071
7133
|
};
|
|
7072
7134
|
private refCounter;
|
|
7135
|
+
/**
|
|
7136
|
+
* One entry per subscription the runtime knows about, keyed by the same subscription key the
|
|
7137
|
+
* emitter and the ref counter use. Listeners sharing a key share a single entry.
|
|
7138
|
+
*/
|
|
7139
|
+
private activeSubscriptions;
|
|
7073
7140
|
protected emitter: EventEmitter;
|
|
7074
7141
|
on: any;
|
|
7075
7142
|
removeAllListeners: any;
|
|
@@ -7109,16 +7176,21 @@ declare class InterApplicationBus extends Base {
|
|
|
7109
7176
|
* Subscribes to messages from the specified application on the specified topic.
|
|
7110
7177
|
* @param source This object is described in the Identity in the typedef
|
|
7111
7178
|
* @param topic The topic on which the message is sent
|
|
7112
|
-
* @param listener A function that is called when a message has
|
|
7113
|
-
*
|
|
7179
|
+
* @param listener A function that is called when a message has been received. It is passed
|
|
7180
|
+
* two arguments: the message, and the identity (`{ uuid, name }`) of the sender.
|
|
7114
7181
|
* The message can be either a primitive data type (string, number, or boolean) or
|
|
7115
7182
|
* composite data type (object, array) that is composed of other primitive or composite
|
|
7116
7183
|
* data types
|
|
7117
7184
|
*
|
|
7185
|
+
* @remarks This differs from the legacy `fin.desktop.InterApplicationBus.subscribe` API,
|
|
7186
|
+
* which passes `(message, uuid, name)` as separate arguments.
|
|
7187
|
+
*
|
|
7118
7188
|
* @example
|
|
7119
7189
|
* ```js
|
|
7120
7190
|
* // subscribe to a specified application
|
|
7121
|
-
* fin.InterApplicationBus.subscribe(fin.me, 'topic',
|
|
7191
|
+
* fin.InterApplicationBus.subscribe(fin.me, 'topic', (message, sender) => {
|
|
7192
|
+
* console.log(`Received from ${sender.uuid}/${sender.name}:`, message);
|
|
7193
|
+
* }).then(() => console.log('Subscribed to the specified application')).catch(err => console.log(err));
|
|
7122
7194
|
*
|
|
7123
7195
|
* // subscribe to wildcard
|
|
7124
7196
|
* fin.InterApplicationBus.subscribe({ uuid: '*' }, 'topic', sub_msg => console.log(sub_msg)).then(() => console.log('Subscribed to *')).catch(err => console.log(err));
|
|
@@ -11127,6 +11199,8 @@ declare namespace OpenFin_2 {
|
|
|
11127
11199
|
ChannelClientConnectionListener,
|
|
11128
11200
|
ChannelClientDisconnectionListener,
|
|
11129
11201
|
ChannelProviderDisconnectionListener,
|
|
11202
|
+
ChannelClientReconnectionInfo,
|
|
11203
|
+
ChannelClientReconnectionListener,
|
|
11130
11204
|
RoutingInfo,
|
|
11131
11205
|
DownloadShelfOptions,
|
|
11132
11206
|
SnapZoneOptions,
|
|
@@ -17536,6 +17610,8 @@ declare type TaskBar = DipScaleRects & {
|
|
|
17536
17610
|
rect: RectangleByEdgePositions;
|
|
17537
17611
|
};
|
|
17538
17612
|
|
|
17613
|
+
declare const teardown: unique symbol;
|
|
17614
|
+
|
|
17539
17615
|
/**
|
|
17540
17616
|
* @interface
|
|
17541
17617
|
*/
|