UniversalGlobalScope.h 985 B

123456789101112131415161718192021222324252627282930313233
  1. /*
  2. * Copyright (c) 2023, Linus Groh <linusg@serenityos.org>
  3. * Copyright (c) 2023, Luke Wilde <lukew@serenityos.org>
  4. * Copyright (c) 2024, Shannon Booth <shannon@serenityos.org>
  5. *
  6. * SPDX-License-Identifier: BSD-2-Clause
  7. */
  8. #pragma once
  9. #include <AK/Forward.h>
  10. #include <AK/String.h>
  11. #include <LibJS/Runtime/Value.h>
  12. #include <LibWeb/Forward.h>
  13. #include <LibWeb/WebIDL/ExceptionOr.h>
  14. namespace Web::HTML {
  15. // https://whatpr.org/html/9893/webappapis.html#universalglobalscope-mixin
  16. class UniversalGlobalScopeMixin {
  17. public:
  18. virtual ~UniversalGlobalScopeMixin();
  19. virtual Bindings::PlatformObject& this_impl() = 0;
  20. virtual Bindings::PlatformObject const& this_impl() const = 0;
  21. WebIDL::ExceptionOr<String> btoa(String const& data) const;
  22. WebIDL::ExceptionOr<String> atob(String const& data) const;
  23. void queue_microtask(WebIDL::CallbackType&);
  24. WebIDL::ExceptionOr<JS::Value> structured_clone(JS::Value, StructuredSerializeOptions const&) const;
  25. };
  26. }