#pragma once

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

namespace Web::Bindings {

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

private:
};

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

private:
    JS_DECLARE_NATIVE_FUNCTION(parse_from_string);
};

enum class DOMParserSupportedType : u8 {
    Text_Html,
    Text_Xml,
    Application_Xml,
    Application_XhtmlXml,
    Image_SvgXml,
};

JS::ThrowCompletionOr<DOMParserSupportedType> convert_to_idl_value_for_dom_parser_supported_type(JS::VM&, JS::Value);

Utf16String idl_enum_to_string(DOMParserSupportedType);

} // namespace Web::Bindings
