using System;
using System.Threading.Tasks;
namespace Impostor.Api.Events.Managers
{
public interface IEventManager
{
///
/// Register a temporary event listener.
///
/// Event listener.
/// Middleware between the events, which can be used to swap to the correct thread dispatcher.
/// Disposable that unregisters the callback from the event manager.
/// Type of the event listener.
IDisposable RegisterListener(TListener listener, Func, Task>? invoker = null)
where TListener : IEventListener;
///
/// Returns true if an event with the type is registered.
///
/// True if the is registered.
/// Type of the event.
bool IsRegistered()
where TEvent : IEvent;
///
/// Call all the event listeners for the type .
///
/// The event argument.
/// Type of the event.
/// A representing the asynchronous operation.
ValueTask CallAsync(TEvent @event)
where TEvent : IEvent;
}
}