Skip to content
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

web-sys: Add Blob.stream() method #2140

Merged
merged 1 commit into from
May 18, 2020
Merged
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
8 changes: 8 additions & 0 deletions crates/web-sys/src/features/gen_Blob.rs
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,14 @@ extern "C" {
end: f64,
content_type: &str,
) -> Result<Blob, JsValue>;
#[cfg(feature = "ReadableStream")]
# [ wasm_bindgen ( method , structural , js_class = "Blob" , js_name = stream ) ]
#[doc = "The `stream()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Blob/stream)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `Blob`, `ReadableStream`*"]
pub fn stream(this: &Blob) -> ReadableStream;
# [ wasm_bindgen ( method , structural , js_class = "Blob" , js_name = text ) ]
#[doc = "The `text()` method."]
#[doc = ""]
Expand Down
2 changes: 2 additions & 0 deletions crates/web-sys/webidls/enabled/Blob.webidl
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ interface Blob {
[Clamp] optional long long end,
optional DOMString contentType);

// read from the Blob.
[NewObject] ReadableStream stream();
[NewObject] Promise<DOMString> text();
[NewObject] Promise<ArrayBuffer> arrayBuffer();
};
Expand Down