#pragma once

#include <LibGC/Ptr.h>
#include <LibJS/Forward.h>
#include <LibJS/Runtime/NativeFunction.h>
#include <LibJS/Runtime/Object.h>
#include <LibJS/Runtime/Value.h>
#include <LibWeb/Bindings/InterfaceObject.h>
#include <LibWeb/Bindings/UIEvent.h>
#include <LibWeb/Forward.h>

namespace Web::Bindings {

struct FocusEventConstructor {
public:
    static void initialize(JS::Realm&, JS::NativeFunction&);
    static JS::ThrowCompletionOr<GC::Ref<JS::Object>> construct(InterfaceConstructor&, JS::FunctionObject&);

private:
};

struct FocusEventPrototype {
public:
    static void initialize(JS::Realm&, JS::Object&);
    static void define_unforgeable_attributes(JS::Realm&, JS::Object&);

private:
    JS_DECLARE_NATIVE_FUNCTION(related_target_getter);
};

struct FocusEventInit : public UIEventInit {
    GC::Ptr<DOM::EventTarget> related_target { nullptr };
};

JS::ThrowCompletionOr<FocusEventInit> convert_to_idl_value_for_focus_event_init(JS::VM&, JS::Value);

} // namespace Web::Bindings
