using System;

namespace Darkmatter.Libs.Observer
{
    public interface IEventBus
    {
        /// <summary>
        /// Publish an event of type T to all subscribers.
        /// </summary>
        void Publish<T>(T evt) where T : struct;

        /// <summary>
        /// Subscribe to an event of type T.
        /// Returns IDisposable – calling Dispose() unsubscribes.
        /// </summary>
        IDisposable Subscribe<T>(Action<T> handler) where T : struct;
    }
}