#ifndef AS_LSP_NATIVE_DATABASE_HPP
#define AS_LSP_NATIVE_DATABASE_HPP
#include "../../node_modules/node-addon-api/napi.h"
#include "../angelscript/extensions/scriptbuilder/scriptbuilder.h"
#include "../angelscript/extensions/scriptstdstring/scriptstdstring.h"
#include "../angelscript/include/angelscript.h"
#include "Diagnostic.hpp"

class Database : public Napi::ObjectWrap<Database> {
private:
    asIScriptEngine* _engine;
    CScriptBuilder _builder;
    std::vector<const Diagnostic*> _messages;

    void MessageCallback(const asSMessageInfo* msg);

public:
    static Napi::Object Init(Napi::Env env, Napi::Object exports);
    explicit Database(const Napi::CallbackInfo& info);

    void Reset(const Napi::CallbackInfo& info);
    void LoadScript(const Napi::CallbackInfo& info);
    Napi::Value Build(const Napi::CallbackInfo& info);
    Napi::Value GetMessages(const Napi::CallbackInfo& info);
};

#endif // AS_LSP_NATIVE_DATABASE_HPP
