ladybird/Userland/Libraries/LibWeb/HTML/Scripting/ImportMap.h
Shannon Booth 9ce8189f21 Everywhere: Use unqualified AK::URL
Now possible in LibWeb now that there is no longer a Web::URL.
2024-02-25 08:54:31 +01:00

31 lines
745 B
C++

/*
* Copyright (c) 2022, networkException <networkexception@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <AK/HashMap.h>
namespace Web::HTML {
using ModuleSpecifierMap = HashMap<ByteString, Optional<URL>>;
// https://html.spec.whatwg.org/multipage/webappapis.html#import-map
class ImportMap {
public:
ImportMap() = default;
ModuleSpecifierMap const& imports() const { return m_imports; }
ModuleSpecifierMap& imports() { return m_imports; }
HashMap<URL, ModuleSpecifierMap> const& scopes() const { return m_scopes; }
HashMap<URL, ModuleSpecifierMap>& scopes() { return m_scopes; }
private:
ModuleSpecifierMap m_imports;
HashMap<URL, ModuleSpecifierMap> m_scopes;
};
}