export type UseEventBusReturns<T, P> = {
/**
* Subscribe to an event. When calling emit, the listeners will execute.
*
* @param listener watch listener.
* @returns a stop function to remove the current callback.
*/
on: (listener: EventBusListener<T, P>) => AnyFunc
/**
* Similar to `on`, but only fires once
*
* @param listener watch listener.
* @returns a stop function to remove the current callback.
*/
once: (listener: EventBusListener<T, P>) => AnyFunc
/**
* Emit an event, the corresponding event listeners will execute.
*
* @param event data sent.
*/
emit: (event?: T, payload?: P) => void
/**
* Remove the corresponding listener.
*
* @param listener watch listener.
*/
off: (listener: EventBusListener<T>) => void
/**
* Clear all events in global scope
*/
reset(): void
/**
* Clear all listeners in the current component context
*/
cleanup(): void
}