#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 PerformanceResourceTimingConstructor {
public:
    static void initialize(JS::Realm&, JS::NativeFunction&);
    static JS::ThrowCompletionOr<GC::Ref<JS::Object>> construct(InterfaceConstructor&, JS::FunctionObject&);

private:
};

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

private:
    JS_DECLARE_NATIVE_FUNCTION(initiator_type_getter);
    JS_DECLARE_NATIVE_FUNCTION(delivery_type_getter);
    JS_DECLARE_NATIVE_FUNCTION(next_hop_protocol_getter);
    JS_DECLARE_NATIVE_FUNCTION(worker_start_getter);
    JS_DECLARE_NATIVE_FUNCTION(redirect_start_getter);
    JS_DECLARE_NATIVE_FUNCTION(redirect_end_getter);
    JS_DECLARE_NATIVE_FUNCTION(fetch_start_getter);
    JS_DECLARE_NATIVE_FUNCTION(domain_lookup_start_getter);
    JS_DECLARE_NATIVE_FUNCTION(domain_lookup_end_getter);
    JS_DECLARE_NATIVE_FUNCTION(connect_start_getter);
    JS_DECLARE_NATIVE_FUNCTION(connect_end_getter);
    JS_DECLARE_NATIVE_FUNCTION(secure_connection_start_getter);
    JS_DECLARE_NATIVE_FUNCTION(request_start_getter);
    JS_DECLARE_NATIVE_FUNCTION(final_response_headers_start_getter);
    JS_DECLARE_NATIVE_FUNCTION(first_interim_response_start_getter);
    JS_DECLARE_NATIVE_FUNCTION(response_start_getter);
    JS_DECLARE_NATIVE_FUNCTION(response_end_getter);
    JS_DECLARE_NATIVE_FUNCTION(transfer_size_getter);
    JS_DECLARE_NATIVE_FUNCTION(encoded_body_size_getter);
    JS_DECLARE_NATIVE_FUNCTION(decoded_body_size_getter);
    JS_DECLARE_NATIVE_FUNCTION(response_status_getter);
    JS_DECLARE_NATIVE_FUNCTION(render_blocking_status_getter);
    JS_DECLARE_NATIVE_FUNCTION(content_type_getter);
    JS_DECLARE_NATIVE_FUNCTION(to_json);
};

enum class RenderBlockingStatusType : u8 {
    Blocking,
    NonBlocking,
};

JS::ThrowCompletionOr<RenderBlockingStatusType> convert_to_idl_value_for_render_blocking_status_type(JS::VM&, JS::Value);

Utf16String idl_enum_to_string(RenderBlockingStatusType);

} // namespace Web::Bindings
