2022-09-08 17:25:53 +01:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2022, Sam Atkins <atkinssj@serenityos.org>
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <AK/Optional.h>
|
2024-10-29 00:57:16 +13:00
|
|
|
#include <AK/Span.h>
|
2022-09-08 17:25:53 +01:00
|
|
|
#include <AK/Vector.h>
|
|
|
|
#include <LibIDL/Types.h>
|
|
|
|
#include <LibJS/Runtime/VM.h>
|
2025-07-19 19:35:33 -07:00
|
|
|
#include <LibWeb/Export.h>
|
2022-09-08 17:25:53 +01:00
|
|
|
|
2022-09-24 16:18:31 +01:00
|
|
|
namespace Web::WebIDL {
|
2022-09-08 17:25:53 +01:00
|
|
|
|
|
|
|
struct ResolvedOverload {
|
|
|
|
// Corresponds to "the special value “missing”" in the overload resolution algorithm.
|
|
|
|
struct Missing { };
|
|
|
|
using Argument = Variant<JS::Value, Missing>;
|
|
|
|
|
|
|
|
int callable_id;
|
|
|
|
Vector<Argument> arguments;
|
|
|
|
};
|
|
|
|
|
|
|
|
// https://webidl.spec.whatwg.org/#es-overloads
|
2025-07-19 19:35:33 -07:00
|
|
|
WEB_API JS::ThrowCompletionOr<ResolvedOverload> resolve_overload(JS::VM&, IDL::EffectiveOverloadSet&, ReadonlySpan<StringView> interface_dictionaries);
|
2022-09-08 17:25:53 +01:00
|
|
|
|
|
|
|
}
|