namespace EventBus
{
    /// <summary>
    /// 匿名事件
    /// </summary>
    /// <typeparam name="T"></typeparam>
    public interface IAnonymousEventData<T> : IBaseEventData
    {
        /// <summary>
        /// 发布同步事件
        /// </summary>
        T Publish(object sender, Properties? properties = null, params object[] data);
        /// <summary>
        /// 发布异步事件
        /// </summary>
        Task<T> PublishAsync(object sender, Properties? properties = null, params object[] data);

        /// <summary>
        /// 发布数组请求同步事件
        /// </summary>
        List<T> PublishList(object sender, Properties? properties = null, params object[] data);
        /// <summary>
        /// 发布数组请求异步事件
        /// </summary>
        Task<List<T>> PublishListAsync(object sender, Properties? properties = null, params object[] data);

        /// <summary>
        /// 订阅事件
        /// </summary>
        /// <param name="func">事件处理函数</param>
        /// <param name="properties">筛选器</param>
        Guid Subscrip(Func<object, EventArgs<object[]>, T> func, Properties? properties = null);
        /// <summary>
        /// 订阅事件
        /// </summary>
        /// <param name="func">事件处理函数</param>
        /// <param name="properties">筛选器</param>
        Guid SubscripList(Func<object, EventArgs<object[]>, List<T>> func, Properties? properties = null);
    }
}