Skip to content

feat(Blob): add Blob.bytes() method #4506

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions crates/web-sys/src/features/gen_Blob.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,13 @@ extern "C" {
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `Blob`*"]
pub fn array_buffer(this: &Blob) -> ::js_sys::Promise;
# [wasm_bindgen (method , structural , js_class = "Blob" , js_name = bytes)]
#[doc = "The `bytes()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Blob/bytes)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `Blob`*"]
pub fn bytes(this: &Blob) -> ::js_sys::Promise;
# [wasm_bindgen (catch , method , structural , js_class = "Blob" , js_name = slice)]
#[doc = "The `slice()` method."]
#[doc = ""]
Expand Down
1 change: 1 addition & 0 deletions crates/web-sys/webidls/enabled/Blob.webidl
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ interface Blob {
[NewObject] ReadableStream stream();
[NewObject] Promise<DOMString> text();
[NewObject] Promise<ArrayBuffer> arrayBuffer();
[NewObject] Promise<Uint8Array> bytes();
};

enum EndingTypes { "transparent", "native" };
Expand Down
Loading