Serenity Operating System
1/*
2 * Copyright (c) 2022, Sam Atkins <atkinssj@serenityos.org>
3 *
4 * SPDX-License-Identifier: BSD-2-Clause
5 */
6
7#pragma once
8
9#include <AK/Optional.h>
10#include <AK/Vector.h>
11#include <LibIDL/Types.h>
12#include <LibJS/Runtime/VM.h>
13
14namespace Web::WebIDL {
15
16struct ResolvedOverload {
17 // Corresponds to "the special value “missing”" in the overload resolution algorithm.
18 struct Missing { };
19 using Argument = Variant<JS::Value, Missing>;
20
21 int callable_id;
22 Vector<Argument> arguments;
23};
24
25// https://webidl.spec.whatwg.org/#es-overloads
26JS::ThrowCompletionOr<ResolvedOverload> resolve_overload(JS::VM&, IDL::EffectiveOverloadSet&);
27
28}