//
//  Event.hpp
//  SwitchboardSDK
//
//  Copyright © 2026 Synervoz. All rights reserved.
//

#pragma once

#include "export.h"

#include <any>
#include <functional>
#include <string>
#include <switchboard/SBAny.hpp>

namespace switchboard {

/// @brief Event data can be any type
using EventData = SBAny;

/// @brief Represents an event that can be emitted and listened to
struct SWITCHBOARDSDK_EXPORT Event {
    /// @brief Unique identifier for the event
    std::string id;

    /// @brief URI of the object emitting the event
    std::string objectURI;
    
    /// @brief Name of the event
    std::string name;
    
    /// @brief Timestamp of when the event was created (in milliseconds since epoch)
    int64_t timestamp;

    /// @brief Data associated with the event
    EventData data;
};

/// @brief Callback function type for handling events
using EventCallback = std::function<void(const Event&)>;

}