#pragma once

#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/MouseEvent.h>
#include <LibWeb/WebIDL/Types.h>

namespace Web::Bindings {

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

private:
};

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

private:
    JS_DECLARE_NATIVE_FUNCTION(delta_x_getter);
    JS_DECLARE_NATIVE_FUNCTION(delta_y_getter);
    JS_DECLARE_NATIVE_FUNCTION(delta_z_getter);
    JS_DECLARE_NATIVE_FUNCTION(delta_mode_getter);
    JS_DECLARE_NATIVE_FUNCTION(wheel_delta_x_getter);
    JS_DECLARE_NATIVE_FUNCTION(wheel_delta_y_getter);
    JS_DECLARE_NATIVE_FUNCTION(wheel_delta_getter);
};

struct WheelEventInit : public MouseEventInit {
    WebIDL::UnsignedLong delta_mode { 0 };
    double delta_x { 0 };
    double delta_y { 0 };
    double delta_z { 0 };
    WebIDL::Long wheel_delta_x { 0 };
    WebIDL::Long wheel_delta_y { 0 };
};

JS::ThrowCompletionOr<WheelEventInit> convert_to_idl_value_for_wheel_event_init(JS::VM&, JS::Value);

} // namespace Web::Bindings
