@montonio/montonio-js 1.1.3 → 1.1.4
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.
|
@@ -14,11 +14,11 @@ export declare class MessagingService {
|
|
|
14
14
|
private subscriptions;
|
|
15
15
|
constructor();
|
|
16
16
|
/**
|
|
17
|
-
* Subscribe to messages of a specific type from a specific source iframe
|
|
18
|
-
* @param messageType The message type to listen for
|
|
19
|
-
* @param handler Handler function to call when the message is received
|
|
20
|
-
* @param iframe Iframe object to listen to
|
|
21
|
-
* @returns Subscription ID that can be used to unsubscribe
|
|
17
|
+
* Subscribe to messages of a specific type from a specific source iframe.
|
|
18
|
+
* @param messageType The message type to listen for.
|
|
19
|
+
* @param handler Handler function to call when the message is received.
|
|
20
|
+
* @param iframe Iframe object to listen to.
|
|
21
|
+
* @returns Subscription ID that can be used to unsubscribe.
|
|
22
22
|
*/
|
|
23
23
|
subscribe<T extends MessageTypeEnum>(messageType: T, handler: (message: MessageByType<T>) => void, iframe: Iframe): void;
|
|
24
24
|
/**
|
|
@@ -53,8 +53,4 @@ export declare class MessagingService {
|
|
|
53
53
|
* Set up the message listener for capturing all window messages
|
|
54
54
|
*/
|
|
55
55
|
private setupMessageListener;
|
|
56
|
-
/**
|
|
57
|
-
* Extract the window source from the Iframe object
|
|
58
|
-
*/
|
|
59
|
-
private extractWindowFromIframe;
|
|
60
56
|
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { ActionRequiredActionEnum, LocaleEnum } from '../../components/MontonioCheckout/types';
|
|
2
|
+
import type { Iframe } from '../../components/Iframe/Iframe';
|
|
2
3
|
export interface MessageSubscription {
|
|
3
4
|
handler: (message: Messages) => void;
|
|
4
|
-
sources:
|
|
5
|
+
sources: Iframe[];
|
|
5
6
|
}
|
|
6
7
|
export interface MessageOptions {
|
|
7
8
|
targetOrigin?: string;
|