UnderlyingSource.h 690 B

12345678910111213141516171819202122232425262728293031
  1. /*
  2. * Copyright (c) 2023, Matthew Olsson <mattco@serenityos.org>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #pragma once
  7. #include <AK/Forward.h>
  8. #include <LibJS/Forward.h>
  9. #include <LibWeb/Bindings/PlatformObject.h>
  10. #include <LibWeb/Forward.h>
  11. #include <LibWeb/WebIDL/Promise.h>
  12. namespace Web::Streams {
  13. enum class ReadableStreamType {
  14. Bytes
  15. };
  16. struct UnderlyingSource {
  17. JS::Handle<WebIDL::CallbackType> start;
  18. JS::Handle<WebIDL::CallbackType> pull;
  19. JS::Handle<WebIDL::CallbackType> cancel;
  20. Optional<ReadableStreamType> type;
  21. Optional<i64> auto_allocate_chunk_size;
  22. static JS::ThrowCompletionOr<UnderlyingSource> from_value(JS::VM&, JS::Value);
  23. };
  24. }