import { DestroyRef } from '@angular/core'; import { Subject } from 'rxjs'; /** * Cấu hình các key global cho truyền thông micro */ export declare class UtilsCommunicateMicroKeyGlobal { /** Key sự kiện cho modal */ static KEY_MESSAGE_MODAL: string; /** Bỏ qua cập nhật thời gian live event modal */ static IGNORE_INTERVAL_UPDATE_TIME_LIVE_EVENT_MODAL: boolean; } /** * Tiện ích hỗ trợ truyền thông giữa các cửa sổ, iframes (Cross-document communication) * Sử dụng Window.postMessage kèm theo mã hóa/giải mã dữ liệu tự động. */ export declare class UtilsCommunicateMicro { private static initdEvent?; private static subs; private static allMessageSub; /** * Khởi tạo trình lắng nghe sự kiện 'message' trên window hiện tại. * Cần được gọi một lần duy nhất tại Root Component (AppComponent). * @param currentWindow Đối tượng window hiện tại * @param destroyRef Reference để tự động unsubscribe khi component bị hủy */ static initEvent(currentWindow: Window, destroyRef: DestroyRef): void; /** * Gửi message tới cửa sổ cha (Parent) hoặc top window. * Thường dùng khi app chạy trong Iframe. * @param data Dữ liệu cần gửi ({type: string, response: any}) */ static PostMessageToParent(data: any): void; /** * Gửi message tới tất cả các iframe con có trong trang. * @param data Dữ liệu cần gửi ({type: string, response: any}) */ static PostMessageToChildren(data: any): void; /** * Gửi message tới cửa sổ đã mở cửa sổ hiện tại (Window Opener). * @param data Dữ liệu cần gửi ({type: string, response: any}) */ static PostMessageToOpener(data: any): void; private static convertData; /** * Đăng ký lắng nghe các message theo type cụ thể. Trả về một RxJS Subject. * @param messageType Type của message hoặc danh sách các types cần lắng nghe * @returns Subject sẽ phát ra message event khi nhận được dữ liệu hợp lệ */ static GetMessage(messageType: string | Array): Subject; private static initSubject; }