import type { RouteData } from "@0xsquid/sdk"; import { EventListenerFunction, WidgetEventMap } from "../../core/types/event"; export declare class WidgetEvents extends EventTarget { private static instance; private constructor(); static getInstance(): WidgetEvents; /** * Overriding the addEventListener method to make it easier to use with typescript * @param type * @param listener * @param options */ listenToWidget(type: T, listener: EventListenerFunction, options?: boolean | AddEventListenerOptions): void; /** * Overriding the removeEventListener method to make it easier to use with typescript * @param type * @param listener * @param options */ removeWidgetListener(type: T, listener: EventListenerFunction, options?: boolean | EventListenerOptions): void; /** * Dispatch an event of the widget * To be listened from an integrator website * For example to display a success message when transaction is done * @param name * @param data */ dispatch(name: T, data: WidgetEventMap[T]): void; /** * Will dispatch the main axelar status of transaction * This will be called every time the status is received by backend * (Using interval to check status) * @param status */ dispatchSwapStatus(status: string): void; /** * Dispatch event when user executes a swap * Only when we have the tx hash received * @param route */ dispatchSwapExecuteCall(route: RouteData, txHash: string): void; /** * Dispatch event when user changes chain/token * @param swapParams */ dispatchSwapParamsChanged(swapParams: { fromChainId?: string; toChainId?: string; fromTokenAddress?: string; toTokenAddress?: string; }): void; }