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

namespace Web::Bindings {

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

private:
};

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

private:
    JS_DECLARE_NATIVE_FUNCTION(closed_getter);
    JS_DECLARE_NATIVE_FUNCTION(read);
    JS_DECLARE_NATIVE_FUNCTION(release_lock);
    JS_DECLARE_NATIVE_FUNCTION(cancel);
};

struct ReadableStreamBYOBReaderReadOptions {
    WebIDL::UnsignedLongLong min { 1 };
};

JS::ThrowCompletionOr<ReadableStreamBYOBReaderReadOptions> convert_to_idl_value_for_readable_stream_byob_reader_read_options(JS::VM&, JS::Value);

} // namespace Web::Bindings
