#pragma once

#include <AK/String.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>

namespace Web::Bindings {

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

private:
};

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

private:
    JS_DECLARE_NATIVE_FUNCTION(data_getter);
    JS_DECLARE_NATIVE_FUNCTION(init_composition_event);
};

struct CompositionEventInit : public UIEventInit {
    String data { String {} };
};

JS::ThrowCompletionOr<CompositionEventInit> convert_to_idl_value_for_composition_event_init(JS::VM&, JS::Value);

} // namespace Web::Bindings
