@elliemae/pui-app-bridge 2.35.4 → 2.35.6
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/dist/cjs/appBridge.js +16 -11
- package/dist/cjs/eventManager.js +48 -19
- package/dist/cjs/microfeHost.js +39 -9
- package/dist/esm/appBridge.js +17 -12
- package/dist/esm/eventManager.js +48 -19
- package/dist/esm/microfeHost.js +39 -9
- package/dist/public/e2e-host.html +1 -1
- package/dist/public/e2e-index.html +1 -1
- package/dist/public/frame.html +1 -1
- package/dist/public/index.html +1 -1
- package/dist/public/js/emuiAppBridge.a2a0a24ba9221b91e9ea.js +17 -0
- package/dist/public/js/emuiAppBridge.a2a0a24ba9221b91e9ea.js.br +0 -0
- package/dist/public/js/emuiAppBridge.a2a0a24ba9221b91e9ea.js.gz +0 -0
- package/dist/public/js/emuiAppBridge.a2a0a24ba9221b91e9ea.js.map +1 -0
- package/dist/types/lib/eventManager.d.ts +22 -4
- package/dist/types/lib/microfeHost.d.ts +18 -3
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/dist/umd/index.js +6 -6
- package/dist/umd/index.js.br +0 -0
- package/dist/umd/index.js.gz +0 -0
- package/dist/umd/index.js.map +1 -1
- package/package.json +2 -2
- package/dist/public/js/emuiAppBridge.d51e198b1c4d4ee0e752.js +0 -17
- package/dist/public/js/emuiAppBridge.d51e198b1c4d4ee0e752.js.br +0 -0
- package/dist/public/js/emuiAppBridge.d51e198b1c4d4ee0e752.js.gz +0 -0
- package/dist/public/js/emuiAppBridge.d51e198b1c4d4ee0e752.js.map +0 -1
|
@@ -13,6 +13,11 @@ type EventListenerDetails = {
|
|
|
13
13
|
* guest instance id when subscribed via a guest iframe host
|
|
14
14
|
*/
|
|
15
15
|
guestId?: string;
|
|
16
|
+
/**
|
|
17
|
+
* instance id of the guest host (openApp uuid) that registered this listener.
|
|
18
|
+
* Used only for cleanup; it never affects event delivery.
|
|
19
|
+
*/
|
|
20
|
+
ownerInstanceId?: string;
|
|
16
21
|
/**
|
|
17
22
|
* event listener
|
|
18
23
|
*/
|
|
@@ -61,19 +66,32 @@ export declare class EventManager<AppEvents extends EventListeners = Events> {
|
|
|
61
66
|
*/
|
|
62
67
|
subscribe: <EventId extends Extract<keyof AppEvents, string>>(param: SubscribeParam<EventId, AppEvents[EventId]> & {
|
|
63
68
|
guestId?: string;
|
|
69
|
+
ownerInstanceId?: string;
|
|
64
70
|
}) => string;
|
|
65
71
|
/**
|
|
66
|
-
* Unsubscribe from an event
|
|
72
|
+
* Unsubscribe from an event.
|
|
73
|
+
*
|
|
74
|
+
* With a token, removes that subscription; a token that matches nothing
|
|
75
|
+
* (including an empty string) removes nothing. Without a token (undefined or
|
|
76
|
+
* null), removes every listener of the event, or, when `ownerInstanceId` is
|
|
77
|
+
* given, only the listeners registered by that owner. When `ownerInstanceId`
|
|
78
|
+
* is given, a token unsubscribe only removes a listener registered by that
|
|
79
|
+
* owner; a token owned by someone else is kept and a warning is logged.
|
|
80
|
+
* Removal never mutates the listener array an in-progress dispatch iterates.
|
|
67
81
|
* @param {UnsubscribeParam<EventId>} param - parameters for unsubscribing from an event
|
|
68
82
|
*/
|
|
69
|
-
unsubscribe: <EventId extends Extract<keyof AppEvents, string>>(param: UnsubscribeParam<EventId>
|
|
83
|
+
unsubscribe: <EventId extends Extract<keyof AppEvents, string>>(param: Omit<UnsubscribeParam<EventId>, "token"> & {
|
|
84
|
+
token?: string | null;
|
|
85
|
+
ownerInstanceId?: string;
|
|
86
|
+
}) => void;
|
|
70
87
|
/**
|
|
71
88
|
* Unsubscribe from all events
|
|
72
89
|
*/
|
|
73
90
|
unsubscribeAll: () => void;
|
|
74
91
|
/**
|
|
75
|
-
* Removes every listener registered for a guest iframe host instance
|
|
76
|
-
*
|
|
92
|
+
* Removes every listener registered for a guest iframe host instance:
|
|
93
|
+
* listeners scoped to it (`guestId`) and listeners it owns
|
|
94
|
+
* (`ownerInstanceId`). Listeners of the host and of other guests are preserved.
|
|
77
95
|
* @param guestId openApp instance id
|
|
78
96
|
*/
|
|
79
97
|
unsubscribeByGuestId: (guestId: string) => void;
|
|
@@ -4,6 +4,13 @@ import type { EventListeners, GuestContext, SubscribeParam, UnsubscribeParam } f
|
|
|
4
4
|
import { ScriptingObjectManager, ScriptingObjects } from '@elliemae/microfe-common';
|
|
5
5
|
import { EventManager } from './eventManager.js';
|
|
6
6
|
import { IMicroFEHost, AppWindowSize } from './typings/host.js';
|
|
7
|
+
/**
|
|
8
|
+
* Key of the method that disposes a host when its guest closes. Only the app
|
|
9
|
+
* bridge imports it; it is not exported from the package index, so guests
|
|
10
|
+
* holding the host have no named way to call it.
|
|
11
|
+
* @internal
|
|
12
|
+
*/
|
|
13
|
+
export declare const DISPOSE_HOST: unique symbol;
|
|
7
14
|
/**
|
|
8
15
|
* Constructor parameters for the host application
|
|
9
16
|
*/
|
|
@@ -67,14 +74,22 @@ export declare class CMicroFEHost<AppObjects extends ScriptingObjects = Partial<
|
|
|
67
74
|
*/
|
|
68
75
|
setAppWindowSize: (appSize: AppWindowSize) => void;
|
|
69
76
|
/**
|
|
70
|
-
* add listener to the scripting object event
|
|
77
|
+
* add listener to the scripting object event.
|
|
78
|
+
* The listener is owned by this guest instance and is removed when the guest is closed.
|
|
71
79
|
* @param {SubscribeParam<EventId, EventListener>} params - parameters to add event listener
|
|
72
|
-
* @returns subscription id
|
|
80
|
+
* @returns subscription id, or an empty string when the guest is already closed
|
|
73
81
|
*/
|
|
74
82
|
subscribe: <EventId extends Extract<keyof AppEvents, string>>(params: SubscribeParam<EventId, AppEvents[EventId]>) => string;
|
|
75
83
|
/**
|
|
76
|
-
* removes listener from the scripting object event
|
|
84
|
+
* removes listener from the scripting object event.
|
|
85
|
+
* Only listeners registered by this guest instance are removed.
|
|
77
86
|
* @param {UnsubscribeParam<EventId>} params - parameters to remove event listener
|
|
78
87
|
*/
|
|
79
88
|
unsubscribe: <EventId extends Extract<keyof AppEvents, string>>(params: UnsubscribeParam<EventId>) => void;
|
|
89
|
+
/**
|
|
90
|
+
* Called by the app bridge when the guest is closed.
|
|
91
|
+
* Later subscribe calls are ignored so a closed guest cannot register listeners again.
|
|
92
|
+
* @internal
|
|
93
|
+
*/
|
|
94
|
+
[DISPOSE_HOST](): void;
|
|
80
95
|
}
|