mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-30 03:20:28 +00:00
LibWeb: Add BodyInit union type
This commit is contained in:
parent
571f4e3ebb
commit
8f5620b5d9
Notes:
sideshowbarker
2024-07-17 06:42:26 +09:00
Author: https://github.com/linusg Commit: https://github.com/SerenityOS/serenity/commit/8f5620b5d9 Pull-request: https://github.com/SerenityOS/serenity/pull/15323 Reviewed-by: https://github.com/davidot ✅ Reviewed-by: https://github.com/kennethmyhra ✅
2 changed files with 9 additions and 0 deletions
|
@ -16,6 +16,9 @@ namespace Web::Fetch {
|
|||
// https://fetch.spec.whatwg.org/#typedefdef-xmlhttprequestbodyinit
|
||||
using XMLHttpRequestBodyInit = Variant<JS::Handle<FileAPI::Blob>, JS::Handle<JS::Object>, JS::Handle<URL::URLSearchParams>, String>;
|
||||
|
||||
// https://fetch.spec.whatwg.org/#bodyinit
|
||||
using BodyInit = Variant<JS::Handle<Streams::ReadableStream>, JS::Handle<FileAPI::Blob>, JS::Handle<JS::Object>, JS::Handle<URL::URLSearchParams>, String>;
|
||||
|
||||
ErrorOr<Infrastructure::BodyWithType> extract_body(JS::Realm&, XMLHttpRequestBodyInit const&);
|
||||
|
||||
}
|
||||
|
|
|
@ -1,5 +1,11 @@
|
|||
#import <FileAPI/Blob.idl>
|
||||
#import <Streams/ReadableStream.idl>
|
||||
#import <URL/URLSearchParams.idl>
|
||||
|
||||
// https://fetch.spec.whatwg.org/#typedefdef-xmlhttprequestbodyinit
|
||||
typedef (Blob or BufferSource or URLSearchParams or USVString) XMLHttpRequestBodyInit;
|
||||
|
||||
// https://fetch.spec.whatwg.org/#bodyinit
|
||||
// FIXME: IDLParser doesn't resolve nested unions properly
|
||||
// typedef (ReadableStream or XMLHttpRequestBodyInit) BodyInit;
|
||||
typedef (ReadableStream or Blob or BufferSource or URLSearchParams or USVString) BodyInit;
|
||||
|
|
Loading…
Reference in a new issue