type Callback = (e: T) => void; type Vouch = { id: string; externalId?: string; }; type Campaign = Vouch; export type VouchCustomEvent = { vouch: Vouch; campaign: Campaign; }; export type VouchMessage = { event: string; detail?: VouchCustomEvent; }; /** * * @param {VouchMessage} message */ declare function dispatchMessage(message: VouchMessage): void; /** * * @param {HTMLElement} el * @param {string} event * @param {Callback>} callback * @returns {Function} unbind function */ declare function bindEvent(el: HTMLElement, event: string, callback: Callback>): () => void; /** * * @param {Window} el * @param {string} event * @param {Callback>} callback * @returns typeof bindEvent */ declare function bindMessage(el: Window, event: string, callback: Callback>): ReturnType; export { bindEvent, bindMessage, dispatchMessage };