#pragma once

#include "Web_Event.h"

#include <memory>
#include <optional>
#include <string>

namespace renderive::web {

enum class Web_Response_Type : std::uint8_t { Pixels, Json };

struct Web_Response {
    Web_Response_Type type = Web_Response_Type::Pixels;
    std::string payload;
};

class Web_Plot_Session final {
public:
    Web_Plot_Session();
    ~Web_Plot_Session();
    Web_Plot_Session(const Web_Plot_Session&) = delete;
    Web_Plot_Session& operator=(const Web_Plot_Session&) = delete;

    [[nodiscard]] std::optional<Web_Response> handle(const Web_Event& event);

private:
    struct Impl;
    std::unique_ptr<Impl> impl_;
};

} // namespace renderive::web
